use aether_core::core::PromptSourceError;
use thiserror::Error;
#[derive(Debug, Error)]
pub enum SettingsError {
#[error("Failed to parse settings file: {0}")]
ParseError(String),
#[error("Invalid model '{model}' for agent '{agent}': {error}")]
InvalidModel { agent: String, model: String, error: String },
#[error("Agent '{agent}' is missing required field: {field}")]
MissingField { agent: String, field: String },
#[error("Agent at index {index} has an empty name")]
EmptyAgentName { index: usize },
#[error("Agent name '{name}' is reserved and cannot be used")]
ReservedAgentName { name: String },
#[error("Duplicate agent name: '{name}'")]
DuplicateAgentName { name: String },
#[error("Agent '{agent}' must have at least one invocation flag (userInvocable or agentInvocable)")]
NoInvocationSurface { agent: String },
#[error("Agent '{agent}': {source}")]
AgentPromptSource {
agent: String,
#[source]
source: PromptSourceError,
},
#[error(transparent)]
PromptSource(#[from] PromptSourceError),
#[error("Agent '{agent}' has no prompts after inheritance (neither inherited nor local)")]
NoPrompts { agent: String },
#[error("MCP config path '{path}' does not exist or is not a file")]
InvalidMcpConfigPath { path: String },
#[error("I/O error: {0}")]
IoError(String),
#[error("Agent '{name}' not found")]
AgentNotFound { name: String },
#[error("Aether config must contain at least one agent")]
EmptyAgents,
#[error("Configured agent selector '{name}' did not match any agent")]
InvalidAgentSelector { name: String },
#[error("Configured agent selector '{name}' is not user-invocable")]
NonUserInvocableAgentSelector { name: String },
#[error("Duplicate prompt name: '{name}'")]
DuplicatePromptName { name: String },
}