Skip to main content

chasm_cli/
lib.rs

1// Copyright (c) 2024-2028 Nervosys LLC
2// SPDX-License-Identifier: Apache-2.0
3//! Chat System Manager (CSM) - 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//! ```rust,ignore
26//! use csm::Agency::{Agent, AgentBuilder, Runtime, Tool};
27//!
28//! let agent = AgentBuilder::new("assistant")
29//!     .instruction("You are a helpful assistant.")
30//!     .model("gemini-2.5-flash")
31//!     .tool(Tool::web_search())
32//!     .build();
33//!
34//! let runtime = Runtime::new()?;
35//! runtime.register_agent(agent);
36//! let result = runtime.run("assistant", "Hello!").await?;
37//! ```
38
39// Library modules export public APIs for external use - suppress dead_code warnings
40#![allow(dead_code)]
41#![allow(unused_imports)]
42#![allow(clippy::upper_case_acronyms)]
43#![allow(clippy::type_complexity)]
44
45pub mod agency;
46pub mod analytics;
47pub mod automation;
48pub mod browser;
49pub mod cli;
50pub mod cloud_sync;
51pub mod commands;
52pub mod database;
53pub mod encryption;
54pub mod error;
55pub mod integrations;
56pub mod intelligence;
57pub mod mcp;
58pub mod models;
59pub mod plugins;
60pub mod providers;
61pub mod routing;
62pub mod scaling;
63pub mod storage;
64pub mod sync;
65pub mod teams;
66pub mod telemetry;
67pub mod tui;
68pub mod workspace;
69
70// Re-export commonly used items
71pub use cli::{
72    Cli, Commands, ExportCommands, FetchCommands, FindCommands, GitCommands, ImportCommands,
73    ListCommands, MergeCommands, MigrationCommands, MoveCommands, ProviderCommands, RunCommands,
74    ShowCommands,
75};
76pub use database::{ChatDatabase, ShareLinkInfo, ShareLinkParser, ShareLinkProvider};
77pub use error::CsmError;
78pub use models::{
79    ChatMessage, ChatRequest, ChatSession, ChatSessionIndex, ChatSessionIndexEntry,
80    SessionWithPath, Workspace, WorkspaceJson,
81};
82pub use providers::{
83    CsmConfig, GenericMessage, GenericSession, ProviderConfig, ProviderRegistry, ProviderType,
84};
85pub use storage::{
86    add_session_to_index, backup_workspace_sessions, is_vscode_running, read_chat_session_index,
87    register_all_sessions_from_directory, write_chat_session_index,
88};
89pub use workspace::{
90    decode_workspace_folder, discover_workspaces, find_workspace_by_path,
91    get_chat_sessions_from_workspace, get_workspace_by_hash, get_workspace_by_path,
92    get_workspace_storage_path, normalize_path,
93};
94
95