Skip to main content

RuntimeAdapter

Trait RuntimeAdapter 

Source
pub trait RuntimeAdapter: Send + Sync {
    // Required methods
    fn kind(&self) -> RuntimeKind;
    fn credentials(
        &self,
        block_id: &str,
        env: &HashMap<String, String>,
    ) -> Vec<(String, String)>;
    fn srv_endpoint(&self, local_url: &str) -> String;
    fn map_mount(&self, role: MountRole, host_path: &str) -> String;
    fn tool_path(&self, tool: ToolId) -> String;
    fn materialize(&self, ctrl: &SubprocessController);
    fn launch(
        &self,
        ctrl: &SubprocessController,
        config: SubprocessSpawnConfig,
    ) -> Result<(), String>;
    fn carries_signing_keys(&self) -> bool;
    fn accepts_attachments(&self) -> bool;
    fn accepts_persistent_controller(&self) -> bool;
    fn can_host(&self, controller: ControllerType) -> bool;
    fn controller_type_for_open(
        &self,
        provider_default: &'static str,
    ) -> &'static str;
}

Required Methods§

Source

fn kind(&self) -> RuntimeKind

Source

fn credentials( &self, block_id: &str, env: &HashMap<String, String>, ) -> Vec<(String, String)>

The env a turn’s process is given, from the env the block resolved. block_id names whose scoped token a runtime that uses one hands out.

Source

fn srv_endpoint(&self, local_url: &str) -> String

AGENTMUX_LOCAL_URL as the process sees it, given how this srv sees itself.

Source

fn map_mount(&self, role: MountRole, host_path: &str) -> String

Where host_path, the folder of role, appears in the runtime.

Source

fn tool_path(&self, tool: ToolId) -> String

How tool is named in the config files written for the agent.

Source

fn materialize(&self, ctrl: &SubprocessController)

What a turn does before it runs. Call before launch.

Source

fn launch( &self, ctrl: &SubprocessController, config: SubprocessSpawnConfig, ) -> Result<(), String>

Start one turn. config is in the host’s shape (cli_command, cli_args, working_dir); a runtime that runs the CLI elsewhere turns that into its own.

Source

fn carries_signing_keys(&self) -> bool

Whether the .mcp.json written for the agent carries its signing keys. A runtime that mounts the file where other code reads it does not.

Source

fn accepts_attachments(&self) -> bool

Whether an attachment’s host path means anything to the agent.

Source

fn accepts_persistent_controller(&self) -> bool

Whether a long-lived (persistent) controller can host the agent.

Source

fn can_host(&self, controller: ControllerType) -> bool

Whether a provider run by controller can run here.

Source

fn controller_type_for_open( &self, provider_default: &'static str, ) -> &'static str

The controller type a new pane gets, given the provider’s own.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§