Skip to main content

ironbridge/
lib.rs

1// Copyright (c) 2024-2026 Nervosys LLC
2// SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-IronBridge-Commercial
3//! Chat System Manager (IRONBRIDGE) - Library
4//!
5//! A library for managing and merging chat sessions across workspaces and LLM providers.
6//!
7//! ## Supported Providers
8//!
9//! - **VS Code Copilot Chat** - Default, file-based sessions
10//! - **Cursor** - Cursor IDE chat sessions
11//! - **Ollama** - Local LLM inference
12//! - **vLLM** - High-performance LLM serving
13//! - **Azure AI Foundry** - Microsoft's AI platform (Foundry Local)
14//! - **LM Studio** - Local model runner
15//! - **LocalAI** - Drop-in OpenAI replacement
16//! - **Text Generation WebUI** - oobabooga's web interface
17//! - **Jan.ai** - Open source ChatGPT alternative
18//! - **GPT4All** - Local privacy-focused AI
19//! - **Llamafile** - Portable executable LLMs
20//!
21//! ## Agent Development Kit (Agency)
22//!
23//! The `Agency` module provides a Rust-native framework for building AI agents:
24//!
25//! ```no_run
26//! use ironbridge::agency::{AgentBuilder, BuiltinTools, Runtime};
27//!
28//! # async fn example() -> anyhow::Result<()> {
29//! let agent = AgentBuilder::new("assistant")
30//!     .instruction("You are a helpful assistant.")
31//!     .model("gemini-2.5-flash")
32//!     .tool(BuiltinTools::web_search())
33//!     .build();
34//!
35//! let mut runtime = Runtime::new()?;
36//! runtime.register_agent(agent);
37//! let result = runtime.run("assistant", "Hello!", None).await?;
38//! println!("{}", result.response);
39//! # Ok(())
40//! # }
41//! ```
42
43// Library modules export public APIs for external use - suppress dead_code warnings
44#![allow(dead_code)]
45#![allow(unused_imports)]
46#![allow(clippy::upper_case_acronyms)]
47#![allow(clippy::type_complexity)]
48
49pub mod agency;
50pub mod analytics;
51pub mod api;
52pub mod automation;
53pub mod browser;
54pub mod cli;
55pub mod cloud_sync;
56pub mod commands;
57pub mod copilot_version;
58pub mod database;
59pub mod encryption;
60#[cfg(feature = "enterprise")]
61pub mod enterprise;
62pub mod error;
63pub mod integrations;
64pub mod intelligence;
65pub mod mcp;
66pub mod models;
67pub mod plugins;
68pub mod providers;
69pub mod routing;
70pub mod scaling;
71pub mod schema;
72pub mod storage;
73pub mod sync;
74pub mod teams;
75pub mod telemetry;
76pub mod text;
77pub mod tui;
78pub mod workspace;
79
80// Re-export commonly used items
81pub use cli::{
82    Cli, Commands, ExportCommands, FetchCommands, FindCommands, GitCommands, ImportCommands,
83    ListCommands, MergeCommands, MigrationCommands, MoveCommands, ProviderCommands, RunCommands,
84    SchemaCommands, SdkCommands, ShardCommands, ShowCommands,
85};
86pub use database::{ChatDatabase, ShareLinkInfo, ShareLinkParser, ShareLinkProvider};
87pub use error::IronBridgeError;
88pub use models::{
89    ChatMessage, ChatRequest, ChatSession, ChatSessionIndex, ChatSessionIndexEntry,
90    SessionWithPath, Workspace, WorkspaceJson,
91};
92pub use providers::{
93    GenericMessage, GenericSession, IronBridgeConfig, ProviderConfig, ProviderRegistry,
94    ProviderType,
95};
96pub use schema::{DetectedSchema, Ontology, ProviderSchema, SchemaRegistry, SchemaVersion};
97pub use storage::{
98    add_session_to_index, backup_workspace_sessions, close_vscode_and_wait, compact_session_jsonl,
99    is_vscode_running, parse_session_auto, parse_session_file, parse_session_json,
100    parse_session_jsonl, read_chat_session_index, recover_from_all_backups, recover_from_jsonl_bak,
101    register_all_sessions_from_directory, reopen_vscode, repair_workspace_sessions,
102    sync_session_index, trim_session_jsonl, write_chat_session_index,
103};
104pub use workspace::{
105    decode_workspace_folder, discover_workspaces, find_workspace_by_path,
106    get_chat_sessions_from_workspace, get_workspace_by_hash, get_workspace_by_path,
107    get_workspace_storage_path, normalize_path,
108};