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("Invalid glob pattern '{pattern}' for agent '{agent}': {error}")]
InvalidGlobPattern { agent: String, pattern: String, error: String },
#[error("Invalid inherited glob pattern '{pattern}': {error}")]
InvalidInheritedGlobPattern { pattern: String, error: String },
#[error("Prompt entry '{pattern}' for agent '{agent}' resolves to no files")]
ZeroMatchPrompt { agent: String, pattern: String },
#[error("Inherited prompt entry '{pattern}' resolves to no files")]
ZeroMatchInheritedPrompt { pattern: String },
#[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("Duplicate prompt name: '{name}'")]
DuplicatePromptName { name: String },
}