Skip to main content

Shell

Trait Shell 

Source
pub trait Shell: Send + Sync {
    // Required methods
    fn exec(
        &self,
        command: &str,
        cwd: &Path,
        timeout: Duration,
    ) -> Result<Output, String>;
    fn describe(&self) -> String;

    // Provided methods
    fn exec_user(
        &self,
        command: &str,
        cwd: &Path,
        timeout: Duration,
    ) -> Result<Output, String> { ... }
    fn exec_host(
        &self,
        command: &str,
        cwd: &Path,
        timeout: Duration,
    ) -> Result<Output, String> { ... }
    fn available_binaries(
        &self,
        cwd: &Path,
        candidates: &[&'static str],
    ) -> Vec<String> { ... }
}

Required Methods§

Source

fn exec( &self, command: &str, cwd: &Path, timeout: Duration, ) -> Result<Output, String>

Run a command to completion. Blocking by contract – see tools for why.

Source

fn describe(&self) -> String

Human-readable description of where commands land, for the system prompt. A worker that knows it is inside a container does not go looking for the host.

Provided Methods§

Source

fn exec_user( &self, command: &str, cwd: &Path, timeout: Duration, ) -> Result<Output, String>

Run a command the model issued. Where the executor keeps a persistent session, its cd and export carry over to the model’s next command, as in a terminal. The default is exec: a fresh process in cwd.

Source

fn exec_host( &self, command: &str, cwd: &Path, timeout: Duration, ) -> Result<Output, String>

Source

fn available_binaries( &self, cwd: &Path, candidates: &[&'static str], ) -> Vec<String>

Which binaries exist in the execution environment, not on the orchestrator’s host.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§