use thiserror::Error;
#[derive(Error, Debug)]
#[non_exhaustive]
pub enum Error {
#[error("io error: {0}")]
Io(#[from] std::io::Error),
#[error("serialization error: {0}")]
Serde(#[from] serde_json::Error),
#[error("pty/transport error: {0}")]
Transport(String),
#[error("command still running (timed out before completion)")]
StillRunning,
#[error("shell exited and closed the session; create a new session")]
ShellExited,
#[error("session poisoned by a prior timeout; create a new session")]
SessionPoisoned,
#[error("blocked by policy: {0}")]
PolicyDenied(String),
#[error("unsupported: {0}")]
Unsupported(String),
#[error("invalid output budget: {0}")]
Budget(String),
}
pub type Result<T> = std::result::Result<T, Error>;