lc/lib.rs
1//! LC (LLM Client) Library
2//!
3//! This library provides the core functionality for the LC CLI tool,
4//! including configuration management, provider handling, and chat functionality.
5//!
6//! # Platform Differences
7//!
8//! This crate includes platform-specific features that are only available on certain operating systems:
9//!
10//! ## Unix Socket Support
11//!
12//! Unix socket functionality is only available on Unix-like systems (Linux, macOS, BSD, WSL2) and requires
13//! the `unix-sockets` feature to be enabled.
14//!
15//! ### MCP Daemon
16//!
17//! The MCP (Model Context Protocol) daemon functionality uses Unix domain sockets for inter-process
18//! communication and is therefore only available on Unix systems:
19//!
20//! - **Unix systems** (Linux, macOS, WSL2): Full MCP daemon support with persistent connections
21//! - **Windows**: MCP daemon is not supported; direct MCP connections work on all platforms
22//!
23//! ## Usage Statistics
24//!
25//! Usage statistics functionality works on all platforms (Windows, macOS, Linux, WSL2).
26//! It uses SQLite database which has full cross-platform support.
27//!
28//! ### Feature Flags
29//!
30//! - `unix-sockets`: Enables Unix socket functionality (default on Unix systems)
31//! - `pdf`: Enables PDF processing support (default)
32//!
33//! To build without Unix socket support:
34//! ```bash
35//! cargo build --no-default-features --features pdf
36//! ```
37//!
38//! To build with all features:
39//! ```bash
40//! cargo build --features "unix-sockets,pdf"
41//! ```
42
43pub mod chat;
44pub mod cli;
45pub mod completion;
46pub mod config;
47pub mod database;
48pub mod dump_metadata;
49pub mod error;
50pub mod http_client;
51pub mod image_utils;
52pub mod input;
53pub mod mcp;
54// MCP daemon module - Unix implementation with Windows stubs
55// On Windows, all daemon functions return appropriate "unsupported" errors
56pub mod mcp_daemon;
57pub mod model_metadata;
58pub mod models_cache;
59pub mod provider;
60pub mod proxy;
61pub mod readers;
62pub mod search;
63pub mod sync;
64pub mod template_processor;
65pub mod test_utils;
66pub mod token_utils;
67pub mod unified_cache;
68pub mod usage_stats;
69pub mod vector_db;
70pub mod webchatproxy;
71
72// Re-export commonly used types for easier access in tests
73pub use config::{CachedToken, Config, ProviderConfig};
74pub use provider::{ChatRequest, Message, OpenAIClient};