use thiserror::Error;

#[derive(Debug, Error)]
pub enum SwarmError {
    #[error("Swarm error: {0}")]
    SwarmError(String),

    #[error("Negotiation failed: {0}")]
    NegotiationFailed(String),

    #[error("Agent not found: {0}")]
    AgentNotFound(String),

    #[error("Coalition error: {0}")]
    CoalitionError(String),

    #[error("Consensus error: {0}")]
    ConsensusError(String),

    #[error("Task assignment error: {0}")]
    AssignmentError(String),

    #[error("Serialization error: {0}")]
    SerializationError(#[from] serde_json::Error),

    #[error("Channel error: {0}")]
    ChannelError(String),
}

pub type Result<T> = std::result::Result<T, SwarmError>;
