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}' is missing required field: {field}")]
19 MissingField { agent: String, field: String },
20
21 #[error("Agent '{agent}' has invalid contextWindow {context_window}; expected a positive integer")]
23 InvalidContextWindow { agent: String, context_window: u32 },
24
25 #[error("Agent at index {index} has an empty name")]
27 EmptyAgentName { index: usize },
28
29 #[error("Agent name '{name}' is reserved and cannot be used")]
31 ReservedAgentName { name: String },
32
33 #[error("Duplicate agent name: '{name}'")]
35 DuplicateAgentName { name: String },
36
37 #[error("Agent '{agent}' must have at least one invocation flag (userInvocable or agentInvocable)")]
39 NoInvocationSurface { agent: String },
40
41 #[error("Agent '{agent}': {source}")]
43 AgentPromptSource {
44 agent: String,
45 #[source]
46 source: PromptSourceError,
47 },
48
49 #[error(transparent)]
51 PromptSource(#[from] PromptSourceError),
52
53 #[error("Agent '{agent}' has no prompts declared (neither inherited nor local)")]
55 NoPromptsDeclared { agent: String },
56
57 #[error("Agent '{agent}': all prompt entries were optional and matched no files")]
59 AllOptionalPromptsMissing { agent: String },
60
61 #[error("MCP config path '{path}' does not exist or is not a file")]
63 InvalidMcpConfigPath { path: String },
64
65 #[error("MCP config path '{path}' references undefined variable '{variable}'")]
67 UnresolvedMcpConfigVariable { path: String, variable: String },
68
69 #[error("I/O error: {0}")]
71 IoError(String),
72
73 #[error("Agent '{name}' not found")]
75 AgentNotFound { name: String },
76
77 #[error("Aether config must contain at least one agent")]
79 EmptyAgents,
80
81 #[error("Aether config must contain at least one user-invocable agent")]
83 NoUserInvocableAgents,
84
85 #[error("Configured agent selector '{name}' did not match any agent")]
87 InvalidAgentSelector { name: String },
88
89 #[error("Configured agent selector '{name}' is not user-invocable")]
91 NonUserInvocableAgentSelector { name: String },
92
93 #[error("Duplicate prompt name: '{name}'")]
95 DuplicatePromptName { name: String },
96}