Skip to main content

RuntimeAdapter

Trait RuntimeAdapter 

Source
pub trait RuntimeAdapter: Send + Sync {
    // Required methods
    fn status<'life0, 'async_trait>(
        &'life0 self,
    ) -> Pin<Box<dyn Future<Output = Result<RuntimeStatus>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn list_files<'life0, 'async_trait>(
        &'life0 self,
    ) -> Pin<Box<dyn Future<Output = Result<Vec<WorkspaceFile>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn read_file<'life0, 'life1, 'async_trait>(
        &'life0 self,
        path: &'life1 str,
    ) -> Pin<Box<dyn Future<Output = Result<FileSnapshot>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn propose_changes<'life0, 'async_trait>(
        &'life0 self,
        changes: Vec<FileChange>,
    ) -> Pin<Box<dyn Future<Output = Result<PatchProposal>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn apply_proposal<'life0, 'life1, 'async_trait>(
        &'life0 self,
        proposal_id: &'life1 str,
    ) -> Pin<Box<dyn Future<Output = Result<AppliedChange>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn run_checks<'life0, 'life1, 'async_trait>(
        &'life0 self,
        command: &'life1 str,
    ) -> Pin<Box<dyn Future<Output = Result<CheckResult>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn revert_last_change<'life0, 'life1, 'async_trait>(
        &'life0 self,
        change_id: &'life1 str,
    ) -> Pin<Box<dyn Future<Output = Result<AppliedChange>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn request_turn<'life0, 'life1, 'life2, 'async_trait>(
        &'life0 self,
        prompt: &'life1 str,
        proposal_id: Option<&'life2 str>,
    ) -> Pin<Box<dyn Future<Output = Result<TurnResult>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait;

    // Provided method
    fn cancel<'life0, 'life1, 'async_trait>(
        &'life0 self,
        _target_id: &'life1 str,
    ) -> Pin<Box<dyn Future<Output = Result<bool>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait { ... }
}
Expand description

The runtime boundary used by the WebMCP transport.

Required Methods§

Source

fn status<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<RuntimeStatus>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Return current workspace and permission state.

Source

fn list_files<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<Vec<WorkspaceFile>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

List files visible to the session.

Source

fn read_file<'life0, 'life1, 'async_trait>( &'life0 self, path: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<FileSnapshot>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Read one visible file.

Source

fn propose_changes<'life0, 'async_trait>( &'life0 self, changes: Vec<FileChange>, ) -> Pin<Box<dyn Future<Output = Result<PatchProposal>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Validate and stage a proposal without mutating the workspace.

Source

fn apply_proposal<'life0, 'life1, 'async_trait>( &'life0 self, proposal_id: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<AppliedChange>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Apply a proposal through the runtime’s approval authority.

Source

fn run_checks<'life0, 'life1, 'async_trait>( &'life0 self, command: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<CheckResult>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Run a runtime-approved check command.

Source

fn revert_last_change<'life0, 'life1, 'async_trait>( &'life0 self, change_id: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<AppliedChange>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Revert a still-current last change.

Source

fn request_turn<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, prompt: &'life1 str, proposal_id: Option<&'life2 str>, ) -> Pin<Box<dyn Future<Output = Result<TurnResult>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Submit a prompt and optional validated proposal to the active runtime.

Provided Methods§

Source

fn cancel<'life0, 'life1, 'async_trait>( &'life0 self, _target_id: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<bool>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Cancel a runtime request.

The boolean reports whether an active operation was found and accepted for cancellation. Unknown or already-complete identifiers are not errors, which keeps reconnecting clients idempotent.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§