use thiserror::Error;
#[derive(Error, Debug)]
pub enum UbiquityError {
#[error("Consciousness level {0} below operational threshold")]
ConsciousnessTooLow(f64),
#[error("Coherence loss detected: {0}")]
CoherenceLoss(f64),
#[error("Agent {0} not found in mesh")]
AgentNotFound(String),
#[error("Socket error: {0}")]
SocketError(#[from] std::io::Error),
#[error("Serialization error: {0}")]
SerializationError(#[from] serde_json::Error),
#[error("Task execution failed: {0}")]
TaskExecutionError(String),
#[error("Mesh communication error: {0}")]
MeshError(String),
#[error("Invalid configuration: {0}")]
ConfigError(String),
#[error("Database error: {0}")]
DatabaseError(String),
#[error("LLM error: {0}")]
LLMError(String),
#[error("Rate limit exceeded: {0}")]
RateLimitError(String),
#[error("Authentication failed: {0}")]
AuthenticationError(String),
#[error("Command execution failed: {0}")]
CommandExecution(String),
#[error("Command timeout: {0}")]
Timeout(String),
#[error("Resource not found: {0}")]
NotFound(String),
#[error("Internal error: {0}")]
Internal(String),
#[error("Network error: {0}")]
Network(String),
#[error("Serialization error: {0}")]
Serialization(String),
#[error("Configuration error: {0}")]
Configuration(String),
#[error("Resource exhausted: {0}")]
ResourceExhausted(String),
#[error("Cloud execution error: {0}")]
CloudExecution(String),
#[error(transparent)]
Other(#[from] anyhow::Error),
}
pub type Result<T> = std::result::Result<T, UbiquityError>;