Skip to main content

Crate adk_computer_use

Crate adk_computer_use 

Source
Expand description

§adk-computer-use

First-party ADK-Rust orchestration and wire contracts for the computer-use-mcp desktop-automation server.

This crate does not perform desktop actuation. Desktop policy, target validation, lease ownership, physical-user interruption, and idempotent effects remain authoritative in computer-use-mcp. Instead, this crate supplies the governed ADK-side layer that drives that server safely:

  • Wire contracts (contracts) — camelCase wire types with disclosure-safe validation (digest-only postconditions, value-free sensitivity evidence, bounded approval scopes).
  • Authorization (ScopeAuthorizer, ComputerUseAuthContext) — a coarse computer:* scope gate bound to an adk_auth-verified identity that model or graph state cannot forge.
  • Deterministic workflow (build_reference_graph) — an adk_graph graph that fans observation out in parallel, previews before mutation, interrupts for digest-bound approval, executes exactly once, and verifies the receipt.
  • Runtime boundary (ComputerUseRuntime) — the trait the graph drives, with a live MCP adapter (ComputerUseMcpRuntime) or an in-process fake.
  • Cancellation (CancellationBridge) — revokes desktop authority before stopping ADK reasoning.
  • Release evaluation (ComputerUseEvaluator, AdkEvaluationReceipt) — deterministic trajectory scoring and a tamper-evident evidence receipt.

§Quick start

The graph is driven through the ComputerUseRuntime trait, so it can run against an in-process implementation with no external server. See the minimal_graph example for a complete, runnable version:

use std::sync::Arc;
use adk_computer_use::{build_reference_graph, ScopeAuthorizer};
let authorizer = Arc::new(ScopeAuthorizer::new(["computer:plan", "computer:execute:background"]));
let graph = build_reference_graph(runtime, authorizer)?;

To drive a real desktop, back the graph with ComputerUseMcpRuntime and a running computer-use-mcp server (see the macOS examples).

Re-exports§

pub use runtime::ComputerUseMcpConfig;
pub use runtime::ComputerUseMcpRuntime;
pub use runtime::ComputerUseRuntime;
pub use runtime::TraceCorrelation;
pub use runtime::VerificationOutcome;
pub use contracts::ActionClass;
pub use contracts::ActionEnvelope;
pub use contracts::ActionPostcondition;
pub use contracts::ActionPreview;
pub use contracts::ActionProvenance;
pub use contracts::ActionResourceContext;
pub use contracts::ApprovalGrant;
pub use contracts::ApprovalGrantScope;
pub use contracts::Bounds;
pub use contracts::ControlLease;
pub use contracts::ExecutionCapability;
pub use contracts::ExecutionMode;
pub use contracts::ExecutionReceipt;
pub use contracts::LeaseBoundaries;
pub use contracts::PolicyDecision;
pub use contracts::PostconditionEvidence;
pub use contracts::ReceiptStatus;
pub use contracts::RuntimeSession;
pub use contracts::SafetyCorpus;
pub use contracts::SafetyExpectation;
pub use contracts::SafetyScenario;
pub use contracts::SessionCompletionEvidence;
pub use contracts::SessionDeletionResult;
pub use contracts::SessionEvent;
pub use contracts::SessionFollowUp;
pub use contracts::SessionFollowUpPage;
pub use contracts::TargetEvidence;
pub use contracts::TargetReservation;
pub use contracts::TargetReservationScope;
pub use contracts::TargetSensitivityAssessment;
pub use contracts::TargetSensitivityEvidence;
pub use contracts::TargetSensitivitySignal;
pub use contracts::TargetSensitivitySource;

Modules§

contracts
camelCase wire contracts for computer-use-mcp.
runtime
Runtime adapters and response binding. The ComputerUseRuntime boundary and its concrete adapters.

Structs§

AdkEvaluationClaims
Claims asserted by an AdkEvaluationReceipt and re-checked on verify.
AdkEvaluationReceipt
Tamper-evident release-evaluation receipt for a computer-use subject.
AdkEvaluationSource
A source file digest included in an AdkEvaluationReceipt.
CancellationBridge
Propagates controls in the safe order: revoke desktop authority, then stop reasoning.
ComputerUseAuthContext
Authenticated identity and exact operation context forwarded to the runtime.
ComputerUseEvaluation
Outcome of scoring one session’s event trajectory.
ComputerUseEvaluator
Deterministic release evaluator layered beside ADK’s task-quality evaluators.
ScopeAuthorizer
Coarse ADK scope gate. The runtime policy engine still evaluates the exact action.

Enums§

AuthorizationError
Reason a ScopeAuthorizer rejected a ComputerUseAuthContext.
CancellationError
Failure propagating a cancellation control to the desktop runtime.
ComputerUseError
Structured error surfaced by the computer-use graph, runtime trait, and MCP adapter.

Traits§

AgentInterrupter
Minimal boundary implemented by adk_runner::Runner::interrupt or another host.

Functions§

build_reference_graph
Build the flagship deterministic ADK graph.
build_reference_graph_with_checkpointer
Build the reference graph with a durable host-supplied checkpointer.

Type Aliases§

Result
Convenience alias for fallible computer-use operations.