1use aether_core::core::PromptSourceError;
4use thiserror::Error;
5
6#[derive(Debug, Error)]
8pub enum SettingsError {
9 #[error("Failed to parse settings file: {0}")]
11 ParseError(String),
12
13 #[error("Invalid model '{model}' for agent '{agent}': {error}")]
15 InvalidModel { agent: String, model: String, error: String },
16
17 #[error("Agent '{agent}' has invalid reasoning effort: {source}")]
19 InvalidReasoningEffort {
20 agent: String,
21 #[source]
22 source: llm::catalog::ReasoningEffortError,
23 },
24
25 #[error("Agent '{agent}' is missing required field: {field}")]
27 MissingField { agent: String, field: String },
28
29 #[error("Agent '{agent}' has invalid contextWindow {context_window}; expected a positive integer")]
31 InvalidContextWindow { agent: String, context_window: u32 },
32
33 #[error("Agent at index {index} has an empty name")]
35 EmptyAgentName { index: usize },
36
37 #[error("Agent name '{name}' is reserved and cannot be used")]
39 ReservedAgentName { name: String },
40
41 #[error("Duplicate agent name: '{name}'")]
43 DuplicateAgentName { name: String },
44
45 #[error("Agent '{agent}' must have at least one invocation flag (userInvocable or agentInvocable)")]
47 NoInvocationSurface { agent: String },
48
49 #[error("Agent '{agent}': {source}")]
51 AgentPromptSource {
52 agent: String,
53 #[source]
54 source: PromptSourceError,
55 },
56
57 #[error(transparent)]
59 PromptSource(#[from] PromptSourceError),
60
61 #[error("Agent '{agent}' has no prompts declared (neither inherited nor local)")]
63 NoPromptsDeclared { agent: String },
64
65 #[error("Agent '{agent}': all prompt entries were optional and matched no files")]
67 AllOptionalPromptsMissing { agent: String },
68
69 #[error("MCP config path '{path}' does not exist or is not a file")]
71 InvalidMcpConfigPath { path: String },
72
73 #[error("MCP config path '{path}' references undefined variable '{variable}'")]
75 UnresolvedMcpConfigVariable { path: String, variable: String },
76
77 #[error("Failed to read MCP config '{path}': {source}")]
78 McpConfig {
79 path: String,
80 #[source]
81 source: aether_core::mcp::ParseError,
82 },
83
84 #[error("I/O error: {0}")]
86 IoError(String),
87
88 #[error("Agent '{name}' not found")]
90 AgentNotFound { name: String },
91
92 #[error("Aether config must contain at least one agent")]
94 EmptyAgents,
95
96 #[error("Aether config must contain at least one user-invocable agent")]
98 NoUserInvocableAgents,
99
100 #[error("Configured agent selector '{name}' did not match any agent")]
102 InvalidAgentSelector { name: String },
103
104 #[error("Configured agent selector '{name}' is not user-invocable")]
106 NonUserInvocableAgentSelector { name: String },
107
108 #[error("Duplicate prompt name: '{name}'")]
110 DuplicatePromptName { name: String },
111}