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§
fn kind(&self) -> RuntimeKind
Sourcefn credentials(
&self,
block_id: &str,
env: &HashMap<String, String>,
) -> Vec<(String, String)>
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.
Sourcefn srv_endpoint(&self, local_url: &str) -> String
fn srv_endpoint(&self, local_url: &str) -> String
AGENTMUX_LOCAL_URL as the process sees it, given how this srv sees itself.
Sourcefn map_mount(&self, role: MountRole, host_path: &str) -> String
fn map_mount(&self, role: MountRole, host_path: &str) -> String
Where host_path, the folder of role, appears in the runtime.
Sourcefn tool_path(&self, tool: ToolId) -> String
fn tool_path(&self, tool: ToolId) -> String
How tool is named in the config files written for the agent.
Sourcefn materialize(&self, ctrl: &SubprocessController)
fn materialize(&self, ctrl: &SubprocessController)
What a turn does before it runs. Call before launch.
Sourcefn launch(
&self,
ctrl: &SubprocessController,
config: SubprocessSpawnConfig,
) -> Result<(), String>
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.
Sourcefn carries_signing_keys(&self) -> bool
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.
Sourcefn accepts_attachments(&self) -> bool
fn accepts_attachments(&self) -> bool
Whether an attachment’s host path means anything to the agent.
Sourcefn accepts_persistent_controller(&self) -> bool
fn accepts_persistent_controller(&self) -> bool
Whether a long-lived (persistent) controller can host the agent.
Sourcefn can_host(&self, controller: ControllerType) -> bool
fn can_host(&self, controller: ControllerType) -> bool
Whether a provider run by controller can run here.
Sourcefn controller_type_for_open(
&self,
provider_default: &'static str,
) -> &'static str
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".