use thiserror::Error;
#[derive(Debug, Error)]
pub enum AcpError {
#[error("failed to spawn ACP agent: {0}")]
Spawn(String),
#[error("ACP protocol error: {0}")]
Protocol(String),
#[error("ACP agent error: {0}")]
AgentError(String),
#[error("ACP connection lost: {0}")]
ConnectionLost(String),
#[error("ACP agent timed out after {0}ms")]
Timeout(u64),
#[error("invalid ACP agent config: {0}")]
InvalidConfig(String),
}
impl From<AcpError> for adk_core::AdkError {
fn from(err: AcpError) -> Self {
adk_core::AdkError::tool(err.to_string())
}
}
pub type Result<T> = std::result::Result<T, AcpError>;