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 at index {index} has an empty name")]
23 EmptyAgentName { index: usize },
24
25 #[error("Agent name '{name}' is reserved and cannot be used")]
27 ReservedAgentName { name: String },
28
29 #[error("Duplicate agent name: '{name}'")]
31 DuplicateAgentName { name: String },
32
33 #[error("Agent '{agent}' must have at least one invocation flag (userInvocable or agentInvocable)")]
35 NoInvocationSurface { agent: String },
36
37 #[error("Agent '{agent}': {source}")]
39 AgentPromptSource {
40 agent: String,
41 #[source]
42 source: PromptSourceError,
43 },
44
45 #[error(transparent)]
47 PromptSource(#[from] PromptSourceError),
48
49 #[error("Agent '{agent}' has no prompts after inheritance (neither inherited nor local)")]
51 NoPrompts { agent: String },
52
53 #[error("MCP config path '{path}' does not exist or is not a file")]
55 InvalidMcpConfigPath { path: String },
56
57 #[error("I/O error: {0}")]
59 IoError(String),
60
61 #[error("Agent '{name}' not found")]
63 AgentNotFound { name: String },
64
65 #[error("Aether config must contain at least one agent")]
67 EmptyAgents,
68
69 #[error("Configured agent selector '{name}' did not match any agent")]
71 InvalidAgentSelector { name: String },
72
73 #[error("Configured agent selector '{name}' is not user-invocable")]
75 NonUserInvocableAgentSelector { name: String },
76
77 #[error("Duplicate prompt name: '{name}'")]
79 DuplicatePromptName { name: String },
80}