Skip to main content

claude_utils/
lib.rs

1pub mod clipboard;
2pub mod file_manager;
3pub mod mcp;
4pub mod turbo;
5
6use thiserror::Error;
7
8#[derive(Error, Debug)]
9pub enum ClaudeUtilsError {
10    #[error("Clipboard error: {0}")]
11    Clipboard(String),
12
13    #[error("File operation error: {0}")]
14    FileOperation(#[from] std::io::Error),
15
16    #[error("Image processing error: {0}")]
17    ImageProcessing(#[from] image::ImageError),
18
19    #[error("Serialization error: {0}")]
20    Serialization(#[from] serde_json::Error),
21
22    #[error("Authentication error: {0}")]
23    Authentication(String),
24
25    #[error("MCP protocol error: {0}")]
26    McpProtocol(String),
27
28    #[error("Server error: {0}")]
29    Server(String),
30
31    #[error("Turbo mode error: {0}")]
32    Turbo(String),
33}
34
35pub type Result<T> = std::result::Result<T, ClaudeUtilsError>;
36
37pub const DEFAULT_PORT: u16 = 3830;
38pub const DEFAULT_HOST: &str = "127.0.0.1";
39pub const STAGING_DIR_NAME: &str = "claude-utils";
40pub const MAX_INLINE_SIZE: usize = 65536; // 64KB
41pub const CLEANUP_INTERVAL_MINS: u64 = 15;
42
43#[cfg(test)]
44mod main_test;