Skip to main content

RuntimeAdapter

Trait RuntimeAdapter 

Source
pub trait RuntimeAdapter: Send + Sync {
    // Required methods
    fn name(&self) -> &str;
    fn has_shell_access(&self) -> bool;
    fn has_filesystem_access(&self) -> bool;
    fn storage_path(&self) -> PathBuf;
    fn supports_long_running(&self) -> bool;
    fn build_shell_command(
        &self,
        command: &str,
        workspace_dir: &Path,
    ) -> Result<Command>;

    // Provided method
    fn memory_budget(&self) -> u64 { ... }
}
Expand description

Runtime adapter — abstracts platform differences so the same agent code runs on native, Docker, Cloudflare Workers, Raspberry Pi, etc.

Required Methods§

Source

fn name(&self) -> &str

Human-readable runtime name

Source

fn has_shell_access(&self) -> bool

Whether this runtime supports shell access

Source

fn has_filesystem_access(&self) -> bool

Whether this runtime supports filesystem access

Source

fn storage_path(&self) -> PathBuf

Base storage path for this runtime

Source

fn supports_long_running(&self) -> bool

Whether long-running processes (gateway, heartbeat) are supported

Source

fn build_shell_command( &self, command: &str, workspace_dir: &Path, ) -> Result<Command>

Build a shell command process for this runtime.

Provided Methods§

Source

fn memory_budget(&self) -> u64

Maximum memory budget in bytes (0 = unlimited)

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§