atomr-agents-coding-cli-isolator 0.21.0

Isolator trait + Local and Docker implementations for the coding-cli harness. Spawns CLI processes on the host or in a container with optional PTY.
Documentation
use thiserror::Error;

#[derive(Debug, Error)]
pub enum IsolatorError {
    #[error("spawn failed: {0}")]
    Spawn(String),

    #[error("io error: {0}")]
    Io(#[from] std::io::Error),

    #[error("pty error: {0}")]
    Pty(String),

    #[error("process already exited")]
    AlreadyExited,

    #[cfg(feature = "docker")]
    #[error("docker error: {0}")]
    Docker(String),

    #[error("not supported in this isolator: {0}")]
    Unsupported(&'static str),
}

#[cfg(feature = "docker")]
impl From<bollard::errors::Error> for IsolatorError {
    fn from(e: bollard::errors::Error) -> Self {
        IsolatorError::Docker(e.to_string())
    }
}