pub struct ComputerUseMcpRuntime<S>{ /* private fields */ }Expand description
ComputerUseRuntime implementation backed by a live computer-use-mcp server.
The adapter is bound to a single authenticated session via
ComputerUseMcpConfig. It forwards every observation through the governed
execute_action shadow facade and re-checks the principal/session identity
on each response so that graph or model state can never substitute a different
authority.
§Errors
Methods return ComputerUseError: transport faults become
ComputerUseError::Mcp, decode failures become ComputerUseError::Decode,
and identity re-checks become ComputerUseError::IdentityMismatch.
Implementations§
Source§impl<S> ComputerUseMcpRuntime<S>
impl<S> ComputerUseMcpRuntime<S>
Sourcepub fn new(toolset: Arc<McpToolset<S>>, config: ComputerUseMcpConfig) -> Self
pub fn new(toolset: Arc<McpToolset<S>>, config: ComputerUseMcpConfig) -> Self
Create an adapter bound to the supplied MCP toolset and session config.
Sourcepub async fn observe_tool(
&self,
tool: &str,
arguments: Value,
) -> Result<Value, ComputerUseError>
pub async fn observe_tool( &self, tool: &str, arguments: Value, ) -> Result<Value, ComputerUseError>
Run a read-only desktop tool through the governed shadow facade.
Useful for bootstrapping exact target evidence before graph execution.
§Errors
Returns ComputerUseError::Mcp if the underlying MCP call fails.
Sourcepub async fn delete_terminal_session(
&self,
) -> Result<SessionDeletionResult, ComputerUseError>
pub async fn delete_terminal_session( &self, ) -> Result<SessionDeletionResult, ComputerUseError>
Permanently remove this adapter’s terminal runtime session through the authenticated MCP principal. The server, not graph state, owns identity.
§Errors
Returns ComputerUseError::Mcp or ComputerUseError::Decode if the
call fails or the deletion result cannot be decoded.
Sourcepub async fn prune_terminal_sessions(
&self,
older_than: &str,
limit: u32,
) -> Result<Vec<SessionDeletionResult>, ComputerUseError>
pub async fn prune_terminal_sessions( &self, older_than: &str, limit: u32, ) -> Result<Vec<SessionDeletionResult>, ComputerUseError>
Explicitly prune caller-owned terminal sessions before the supplied timestamp. The MCP server enforces principal ownership and the limit.
§Errors
Returns ComputerUseError::Mcp or ComputerUseError::Decode on
transport or decoding failure.
Sourcepub async fn get_follow_ups(
&self,
after_sequence: u64,
limit: u32,
) -> Result<SessionFollowUpPage, ComputerUseError>
pub async fn get_follow_ups( &self, after_sequence: u64, limit: u32, ) -> Result<SessionFollowUpPage, ComputerUseError>
Consume remote/local steering with a monotonic cursor. The server binds both the session and returned instructions to the authenticated principal.
§Errors
Returns ComputerUseError::InvalidRequest if limit is outside
1..=1000, ComputerUseError::IdentityMismatch if any returned
follow-up does not match the authenticated context, or a transport/decode
error otherwise.
Sourcepub async fn submit_follow_up(
&self,
instruction: &str,
) -> Result<SessionFollowUp, ComputerUseError>
pub async fn submit_follow_up( &self, instruction: &str, ) -> Result<SessionFollowUp, ComputerUseError>
Submit steering through the same principal-bound MCP boundary. Hosts normally call this; exposing it here supports supervisor/graph tests.
§Errors
Returns ComputerUseError::IdentityMismatch if the returned follow-up
does not match the authenticated context, or a transport/decode error
otherwise.
Trait Implementations§
Source§impl<S> ComputerUseRuntime for ComputerUseMcpRuntime<S>
impl<S> ComputerUseRuntime for ComputerUseMcpRuntime<S>
Source§fn discover_capabilities<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Value, ComputerUseError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn discover_capabilities<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Value, ComputerUseError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Source§fn observe_visual<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Value, ComputerUseError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn observe_visual<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Value, ComputerUseError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Source§fn observe_semantic<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Value, ComputerUseError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn observe_semantic<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Value, ComputerUseError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Source§fn preview_action<'life0, 'async_trait>(
&'life0 self,
proposed_action: Value,
) -> Pin<Box<dyn Future<Output = Result<ActionPreview, ComputerUseError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn preview_action<'life0, 'async_trait>(
&'life0 self,
proposed_action: Value,
) -> Pin<Box<dyn Future<Output = Result<ActionPreview, ComputerUseError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Source§fn acquire_lease<'life0, 'life1, 'async_trait>(
&'life0 self,
envelope: &'life1 ActionEnvelope,
) -> Pin<Box<dyn Future<Output = Result<ControlLease, ComputerUseError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn acquire_lease<'life0, 'life1, 'async_trait>(
&'life0 self,
envelope: &'life1 ActionEnvelope,
) -> Pin<Box<dyn Future<Output = Result<ControlLease, ComputerUseError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Source§fn reserve_target<'life0, 'life1, 'async_trait>(
&'life0 self,
envelope: &'life1 ActionEnvelope,
) -> Pin<Box<dyn Future<Output = Result<Option<TargetReservation>, ComputerUseError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn reserve_target<'life0, 'life1, 'async_trait>(
&'life0 self,
envelope: &'life1 ActionEnvelope,
) -> Pin<Box<dyn Future<Output = Result<Option<TargetReservation>, ComputerUseError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Source§fn release_target<'life0, 'life1, 'async_trait>(
&'life0 self,
reservation: &'life1 TargetReservation,
) -> Pin<Box<dyn Future<Output = Result<(), ComputerUseError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn release_target<'life0, 'life1, 'async_trait>(
&'life0 self,
reservation: &'life1 TargetReservation,
) -> Pin<Box<dyn Future<Output = Result<(), ComputerUseError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
TargetReservation. Read more