1use thiserror::Error;
2
3#[derive(Debug, Error)]
5pub enum ModeError {
6 #[error("Mode not found: {0}")]
8 NotFound(String),
9
10 #[error("Invalid mode transition: {0} -> {1}")]
12 InvalidTransition(String, String),
13
14 #[error("Capability not available in {mode}: {capability}")]
16 CapabilityNotAvailable {
17 mode: String,
19 capability: String,
21 },
22
23 #[error("Operation not allowed in {mode}: {operation}")]
25 OperationNotAllowed {
26 mode: String,
28 operation: String,
30 },
31
32 #[error("File operation blocked in Ask Mode")]
34 FileOperationBlocked,
35
36 #[error("Processing failed: {0}")]
38 ProcessingFailed(String),
39
40 #[error("Think More timeout after {0}ms")]
42 ThinkMoreTimeout(u64),
43
44 #[error("Configuration error: {0}")]
46 ConfigError(String),
47
48 #[error("Session context error: {0}")]
50 ContextError(String),
51
52 #[error("Serialization error: {0}")]
54 SerializationError(#[from] serde_json::Error),
55}
56
57pub type Result<T> = std::result::Result<T, ModeError>;