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("I/O error: {0}")]
79 IoError(String),
80
81 #[error("Agent '{name}' not found")]
83 AgentNotFound { name: String },
84
85 #[error("Aether config must contain at least one agent")]
87 EmptyAgents,
88
89 #[error("Aether config must contain at least one user-invocable agent")]
91 NoUserInvocableAgents,
92
93 #[error("Configured agent selector '{name}' did not match any agent")]
95 InvalidAgentSelector { name: String },
96
97 #[error("Configured agent selector '{name}' is not user-invocable")]
99 NonUserInvocableAgentSelector { name: String },
100
101 #[error("Duplicate prompt name: '{name}'")]
103 DuplicatePromptName { name: String },
104}