pub struct ComputerUseMcpRuntime<S>{ /* private fields */ }computer-use only.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,
) -> ComputerUseMcpRuntime<S>
pub fn new( toolset: Arc<McpToolset<S>>, config: ComputerUseMcpConfig, ) -> ComputerUseMcpRuntime<S>
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
'life0: 'async_trait,
ComputerUseMcpRuntime<S>: 'async_trait,
fn discover_capabilities<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Value, ComputerUseError>> + Send + 'async_trait>>where
'life0: 'async_trait,
ComputerUseMcpRuntime<S>: 'async_trait,
Source§fn observe_visual<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Value, ComputerUseError>> + Send + 'async_trait>>where
'life0: 'async_trait,
ComputerUseMcpRuntime<S>: 'async_trait,
fn observe_visual<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Value, ComputerUseError>> + Send + 'async_trait>>where
'life0: 'async_trait,
ComputerUseMcpRuntime<S>: 'async_trait,
Source§fn observe_semantic<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Value, ComputerUseError>> + Send + 'async_trait>>where
'life0: 'async_trait,
ComputerUseMcpRuntime<S>: 'async_trait,
fn observe_semantic<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Value, ComputerUseError>> + Send + 'async_trait>>where
'life0: 'async_trait,
ComputerUseMcpRuntime<S>: '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
'life0: 'async_trait,
ComputerUseMcpRuntime<S>: '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
'life0: 'async_trait,
ComputerUseMcpRuntime<S>: '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
'life0: 'async_trait,
'life1: 'async_trait,
ComputerUseMcpRuntime<S>: '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
'life0: 'async_trait,
'life1: 'async_trait,
ComputerUseMcpRuntime<S>: '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
'life0: 'async_trait,
'life1: 'async_trait,
ComputerUseMcpRuntime<S>: '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
'life0: 'async_trait,
'life1: 'async_trait,
ComputerUseMcpRuntime<S>: '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
'life0: 'async_trait,
'life1: 'async_trait,
ComputerUseMcpRuntime<S>: '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
'life0: 'async_trait,
'life1: 'async_trait,
ComputerUseMcpRuntime<S>: 'async_trait,
TargetReservation. Read moreSource§fn execute_action<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
envelope: &'life1 ActionEnvelope,
lease: &'life2 ControlLease,
approval_grant_id: Option<&'life3 str>,
) -> Pin<Box<dyn Future<Output = Result<ExecutionReceipt, ComputerUseError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
ComputerUseMcpRuntime<S>: 'async_trait,
fn execute_action<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
envelope: &'life1 ActionEnvelope,
lease: &'life2 ControlLease,
approval_grant_id: Option<&'life3 str>,
) -> Pin<Box<dyn Future<Output = Result<ExecutionReceipt, ComputerUseError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
ComputerUseMcpRuntime<S>: 'async_trait,
Source§fn verify<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
receipt: &'life1 ExecutionReceipt,
postcondition: Option<&'life2 ActionPostcondition>,
) -> Pin<Box<dyn Future<Output = Result<VerificationOutcome, ComputerUseError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
ComputerUseMcpRuntime<S>: 'async_trait,
fn verify<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
receipt: &'life1 ExecutionReceipt,
postcondition: Option<&'life2 ActionPostcondition>,
) -> Pin<Box<dyn Future<Output = Result<VerificationOutcome, ComputerUseError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
ComputerUseMcpRuntime<S>: 'async_trait,
Source§fn pause_session<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
session_id: &'life1 str,
reason: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<(), ComputerUseError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
ComputerUseMcpRuntime<S>: 'async_trait,
fn pause_session<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
session_id: &'life1 str,
reason: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<(), ComputerUseError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
ComputerUseMcpRuntime<S>: 'async_trait,
Source§fn stop_session<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
session_id: &'life1 str,
reason: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<(), ComputerUseError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
ComputerUseMcpRuntime<S>: 'async_trait,
fn stop_session<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
session_id: &'life1 str,
reason: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<(), ComputerUseError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
ComputerUseMcpRuntime<S>: 'async_trait,
Source§fn emergency_stop<'life0, 'life1, 'async_trait>(
&'life0 self,
reason: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<(), ComputerUseError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
ComputerUseMcpRuntime<S>: 'async_trait,
fn emergency_stop<'life0, 'life1, 'async_trait>(
&'life0 self,
reason: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<(), ComputerUseError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
ComputerUseMcpRuntime<S>: 'async_trait,
Auto Trait Implementations§
impl<S> !Freeze for ComputerUseMcpRuntime<S>
impl<S> !RefUnwindSafe for ComputerUseMcpRuntime<S>
impl<S> !UnwindSafe for ComputerUseMcpRuntime<S>
impl<S> Send for ComputerUseMcpRuntime<S>
impl<S> Sync for ComputerUseMcpRuntime<S>
impl<S> Unpin for ComputerUseMcpRuntime<S>
impl<S> UnsafeUnpin for ComputerUseMcpRuntime<S>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> FmtForward for T
impl<T> FmtForward for T
Source§fn fmt_binary(self) -> FmtBinary<Self>where
Self: Binary,
fn fmt_binary(self) -> FmtBinary<Self>where
Self: Binary,
self to use its Binary implementation when Debug-formatted.Source§fn fmt_display(self) -> FmtDisplay<Self>where
Self: Display,
fn fmt_display(self) -> FmtDisplay<Self>where
Self: Display,
self to use its Display implementation when
Debug-formatted.Source§fn fmt_lower_exp(self) -> FmtLowerExp<Self>where
Self: LowerExp,
fn fmt_lower_exp(self) -> FmtLowerExp<Self>where
Self: LowerExp,
self to use its LowerExp implementation when
Debug-formatted.Source§fn fmt_lower_hex(self) -> FmtLowerHex<Self>where
Self: LowerHex,
fn fmt_lower_hex(self) -> FmtLowerHex<Self>where
Self: LowerHex,
self to use its LowerHex implementation when
Debug-formatted.Source§fn fmt_octal(self) -> FmtOctal<Self>where
Self: Octal,
fn fmt_octal(self) -> FmtOctal<Self>where
Self: Octal,
self to use its Octal implementation when Debug-formatted.Source§fn fmt_pointer(self) -> FmtPointer<Self>where
Self: Pointer,
fn fmt_pointer(self) -> FmtPointer<Self>where
Self: Pointer,
self to use its Pointer implementation when
Debug-formatted.Source§fn fmt_upper_exp(self) -> FmtUpperExp<Self>where
Self: UpperExp,
fn fmt_upper_exp(self) -> FmtUpperExp<Self>where
Self: UpperExp,
self to use its UpperExp implementation when
Debug-formatted.Source§fn fmt_upper_hex(self) -> FmtUpperHex<Self>where
Self: UpperHex,
fn fmt_upper_hex(self) -> FmtUpperHex<Self>where
Self: UpperHex,
self to use its UpperHex implementation when
Debug-formatted.Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreimpl<T> MaybeSend for Twhere
T: Send,
Source§impl<T> Pipe for Twhere
T: ?Sized,
impl<T> Pipe for Twhere
T: ?Sized,
Source§fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
Source§fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
self and passes that borrow into the pipe function. Read moreSource§fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
self and passes that borrow into the pipe function. Read moreSource§fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
Source§fn pipe_borrow_mut<'a, B, R>(
&'a mut self,
func: impl FnOnce(&'a mut B) -> R,
) -> R
fn pipe_borrow_mut<'a, B, R>( &'a mut self, func: impl FnOnce(&'a mut B) -> R, ) -> R
Source§fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
self, then passes self.as_ref() into the pipe function.Source§fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
self, then passes self.as_mut() into the pipe
function.Source§fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
self, then passes self.deref() into the pipe function.Source§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
Source§impl<T> Tap for T
impl<T> Tap for T
Source§fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
Borrow<B> of a value. Read moreSource§fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
BorrowMut<B> of a value. Read moreSource§fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
AsRef<R> view of a value. Read moreSource§fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
AsMut<R> view of a value. Read moreSource§fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
Deref::Target of a value. Read moreSource§fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
Deref::Target of a value. Read moreSource§fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
.tap() only in debug builds, and is erased in release builds.Source§fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
.tap_mut() only in debug builds, and is erased in release
builds.Source§fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
.tap_borrow() only in debug builds, and is erased in release
builds.Source§fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
.tap_borrow_mut() only in debug builds, and is erased in release
builds.Source§fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
.tap_ref() only in debug builds, and is erased in release
builds.Source§fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
.tap_ref_mut() only in debug builds, and is erased in release
builds.Source§fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
.tap_deref() only in debug builds, and is erased in release
builds.