chasm-cli 2.0.0

Universal chat session manager - harvest, merge, and analyze AI chat history from VS Code, Cursor, and other editors
Documentation
// Copyright (c) 2024-2026 Nervosys LLC
// SPDX-License-Identifier: AGPL-3.0-only
//! Chat System Manager (CSM) - Library
//!
//! A library for managing and merging chat sessions across workspaces and LLM providers.
//!
//! ## Supported Providers
//!
//! - **VS Code Copilot Chat** - Default, file-based sessions
//! - **Cursor** - Cursor IDE chat sessions
//! - **Ollama** - Local LLM inference
//! - **vLLM** - High-performance LLM serving
//! - **Azure AI Foundry** - Microsoft's AI platform (Foundry Local)
//! - **LM Studio** - Local model runner
//! - **LocalAI** - Drop-in OpenAI replacement
//! - **Text Generation WebUI** - oobabooga's web interface
//! - **Jan.ai** - Open source ChatGPT alternative
//! - **GPT4All** - Local privacy-focused AI
//! - **Llamafile** - Portable executable LLMs
//!
//! ## Agent Development Kit (Agency)
//!
//! The `Agency` module provides a Rust-native framework for building AI agents:
//!
//! ```rust,ignore
//! use csm::Agency::{Agent, AgentBuilder, Runtime, Tool};
//!
//! let agent = AgentBuilder::new("assistant")
//!     .instruction("You are a helpful assistant.")
//!     .model("gemini-2.5-flash")
//!     .tool(Tool::web_search())
//!     .build();
//!
//! let runtime = Runtime::new()?;
//! runtime.register_agent(agent);
//! let result = runtime.run("assistant", "Hello!").await?;
//! ```

// Library modules export public APIs for external use - suppress dead_code warnings
#![allow(dead_code)]
#![allow(unused_imports)]
#![allow(clippy::upper_case_acronyms)]
#![allow(clippy::type_complexity)]

pub mod agency;
pub mod analytics;
pub mod api;
pub mod automation;
pub mod browser;
pub mod cli;
pub mod cloud_sync;
pub mod commands;
pub mod copilot_version;
pub mod database;
pub mod encryption;
pub mod error;
pub mod integrations;
pub mod intelligence;
pub mod mcp;
pub mod models;
pub mod plugins;
pub mod providers;
pub mod routing;
pub mod scaling;
pub mod schema;
pub mod storage;
pub mod sync;
pub mod teams;
pub mod telemetry;
pub mod tui;
pub mod workspace;

// Re-export commonly used items
pub use cli::{
    Cli, Commands, ExportCommands, FetchCommands, FindCommands, GitCommands, ImportCommands,
    ListCommands, MergeCommands, MigrationCommands, MoveCommands, ProviderCommands, RunCommands,
    SchemaCommands, ShardCommands, ShowCommands,
};
pub use schema::{DetectedSchema, Ontology, ProviderSchema, SchemaRegistry, SchemaVersion};
pub use database::{ChatDatabase, ShareLinkInfo, ShareLinkParser, ShareLinkProvider};
pub use error::CsmError;
pub use models::{
    ChatMessage, ChatRequest, ChatSession, ChatSessionIndex, ChatSessionIndexEntry,
    SessionWithPath, Workspace, WorkspaceJson,
};
pub use providers::{
    CsmConfig, GenericMessage, GenericSession, ProviderConfig, ProviderRegistry, ProviderType,
};
pub use storage::{
    add_session_to_index, backup_workspace_sessions, close_vscode_and_wait, compact_session_jsonl,
    is_vscode_running, parse_session_auto, parse_session_file, parse_session_json,
    parse_session_jsonl, read_chat_session_index, recover_from_all_backups, recover_from_jsonl_bak,
    register_all_sessions_from_directory, reopen_vscode, repair_workspace_sessions,
    sync_session_index, trim_session_jsonl, write_chat_session_index,
};
pub use workspace::{
    decode_workspace_folder, discover_workspaces, find_workspace_by_path,
    get_chat_sessions_from_workspace, get_workspace_by_hash, get_workspace_by_path,
    get_workspace_storage_path, normalize_path,
};