Skip to content

armgit / cua

Public Imported from GitHub
0

Scale computer-use 2.0 with open-source drivers, cross-OS sandboxes, and benchmarks for training, evaluation, and data generation.

12.0 KB
Raw Blame
// SPDX-License-Identifier: FSL-1.1-MIT
// Copyright (c) 2026 Cua AI, Inc.

/**
 * Arguments that take every operation down its usual path on the demo
 * host's data (its Spaces, runs, Keyvault requests and grants), for the
 * contract tests here and in apps/cua-spaces-desktop.
 */

import type { OpArgs, OpName } from "../protocol";

const SPACE = "local:design-review";

export const DEMO_ARGS: { [K in OpName]: OpArgs<K> } = {
  "spaces.list": {},
  "spaces.create": { config: { image: "linux", on: "local", name: "contract-check" }, pendingId: "pending:contract" },
  "spaces.cancelCreate": { pendingId: "pending:none" },
  "spaces.setPower": { spaceId: SPACE, on: true },
  "spaces.delete": { spaceId: "local:agent-sandbox" },
  "spaces.deleteMany": { ids: ["relay:linux-box/windows-legacy"] },
  "spaces.leave": { ids: ["relay:space-priya-checkout"] },
  "spaces.rename": { spaceId: SPACE, name: "design-review-2" },
  "network.get": { spaceId: SPACE },
  "network.set": { spaceId: SPACE, network: "internet", allow: [], deny: [] },
  "network.log": { spaceId: SPACE },
  "network.ackNotice": { spaceId: SPACE },
  "spaces.setAccess": { spaceId: SPACE, clipboard: "ask" },
  "spaces.tree": {},
  "children.set": { spaceId: SPACE, enabled: true },
  "budget.get": { spaceId: SPACE },
  "budget.set": { spaceId: SPACE, limits: { maxSpaces: 4 } },
  "services.list": { spaceId: SPACE },
  "services.control": { spaceId: SPACE, name: "web", action: "restart" },
  "spaces.open": { spaceId: SPACE },
  "machines.list": {},
  "host.status": {},
  "settings.get": {},
  "settings.set": { key: "menuBar", value: true },
  "settings.choose": { row: "auto-connect", option: "off" },
  "keyvault.overview": {},
  "keyvault.unlock": { passphrase: null },
  "keyvault.setup": { passphrase: null },
  "keyvault.showItems": {},
  "keyvault.delete": { itemIds: ["kv-linear"] },
  "keyvault.run": { command: { type: "revoke-grant", id: "grant-1" } },
  "keyvault.dismiss": { imports: ["imp-1"] },
  "keyvault.setUnattended": { itemIds: ["kv-linear"], unattended: true },
  "keyvault.setDisabled": { disabled: false },
  "keyvault.approve": { requestId: "req-1", items: null },
  "keyvault.deny": { requestId: "req-2" },
  "keyvault.revokeGrant": { id: "grant-1" },
  "session.get": {},
  "session.signIn": {},
  "session.signOut": {},
  "session.completeOnboarding": { mode: "client" },
  "session.resetOnboarding": {},
  "session.openExternal": { url: "https://cua.ai" },
  "agents.list": {},
  "agents.runs": { spaceId: SPACE },
  "agents.events": { spaceId: SPACE, runId: "run-ada-7", cursor: 0 },
  "agents.start": { spaceId: SPACE, agent: "claude-code", prompt: "Run the tests" },
  "agents.message": { spaceId: SPACE, runId: "run-ada-7", text: "Use Python 3.13" },
  "agents.pause": { name: "ada" },
  "agents.resume": { name: "ada" },
  "agents.setup": {},
  "agents.configure": { agents: null },
  "agents.signIn": { agent: "codex" },
  "agents.status": { refresh: true },
  "agents.connect": { agents: ["codex"], signIn: true },
  "agents.disconnect": { agents: ["codex"], signIn: true },
  "agents.signInStart": { agent: "codex" },
  "agents.signInWait": { id: "codex-1" },
  "agents.detail": { name: "ada" },
  "agents.readFile": { path: "agents/ada/MEMORY.md" },
  "agents.restoreFile": { path: "agents/ada/MEMORY.md", version: "agents/ada/MEMORY.md@1" },
  "agents.addRoutine": { agent: "ada", title: "Contract check", prompt: "Say hi", everyMinutes: 30, dailyAt: null, weeklyOn: null },
  "agents.setRoutine": { id: "rt-ada-standup", enabled: false },
  "agents.removeRoutine": { id: "rt-ada-standup" },
  "agents.allowComputer": { agent: "ada", machine: "relay:this-mac" },
  "agents.revokeComputer": { agent: "ada", machine: "relay:this-mac" },
  "spaces.createOptions": {},
  "spaces.add": { url: "studio.local:7400", token: null, name: null },
  "clouds.status": {},
  "clouds.test": { target: { provider: "aws", region: "us-west-2" } },
  "clouds.connect": { target: { provider: "aws", region: "us-west-2" }, makeDefault: false },
  "clouds.disconnect": { provider: "aws", deleteResources: false },
  "clouds.approve": { provider: "aws", approve: true },
  "teleport.catalog": { spaceId: SPACE },
  "teleport.entryForPath": { path: "/Applications/Slack.app" },
  "teleport.windows": {},
  "teleport.remoteWindows": { spaceId: SPACE },
  "teleport.icon": { spaceId: SPACE, icon: { kind: "host", path: "/Applications/Slack.app" } },
  "teleport.thumbnail": { spaceId: SPACE, thumbnail: { kind: "host-window", windowId: 41 } },
  "teleport.plan": { spaceId: SPACE, entry: { id: "slack" } as never, move: "app_only", files: [], sensitiveGroups: [] },
  "teleport.run": {
    spaceId: SPACE,
    plan: { app: { id: "slack" }, steps: [], consent: [] } as never,
    consent: { approved: true, acknowledgeSensitive: false },
    runId: "run-contract",
  },
  "teleport.sites": { providerId: "chrome" },
  "teleport.readiness": { providerId: "chrome", profile: null },
  "teleport.remembered": { providerId: "chrome", spaceId: SPACE },
  "teleport.streamWindow": { spaceId: SPACE, spaceName: "design-review", windowId: "w-1", appName: "Firefox", title: "Mozilla Firefox" },
  "sharing.list": { spaceId: SPACE },
  "sharing.share": { spaceId: SPACE, who: "[email protected]", role: "viewer" },
  "sharing.unshare": { spaceId: SPACE, who: "[email protected]" },
  "sharing.removals": {},
  "sharing.ackRemovals": {},
  "agentKeys.list": {},
  "agentKeys.check": {},
  "agentKeys.set": { provider: "anthropic", value: "sk-ant-test-0000" },
  "agentKeys.remove": { env: "ANTHROPIC_API_KEY" },
  "agentKeys.use": { app: "hermes", env: "OPENAI_API_KEY" },
  "agentKeys.rename": { env: "OPENAI_API_KEY", label: "Work key" },
  "agentKeys.shell": {},
  "agentKeys.fromShell": { env: "ANTHROPIC_API_KEY" },
  "github.status": {},
  "github.rescan": {},
  "github.use": { host: "github.com", login: "ada" },
  "github.enable": { host: "github.com", enabled: false },
  "volume.overview": {},
  "volume.storage": {},
  "volume.storageSet": { update: { backend: "fs", s3: null, access_key_id: null, secret_access_key: null, dry_run: true } },
  "volume.mount": {},
  "volume.unmount": {},
  "volume.approve": { id: "req-research" },
  "volume.deny": { id: "q2" },
  "volume.revoke": { id: "grant-writer" },
  "volume.resolve": { path: "public/plan.md" },
  "volume.reveal": { path: "/Users/ada/Cua Volume/public" },
  "agents.setupDriver": { agents: ["codex"] },
  "spaces.openStream": { spaceId: SPACE, tier: "tile" },
  "relay.usage": {},
  "nudges.pending": {},
  "agents.recentThreads": { limit: 4 },
  "agents.threadHistory": { agent: "claude-code", id: "0b1e5c2a-1111-4222-8333-944445555666" },
  "nudges.answer": { id: "risky-1-1", choice: "here" },
  "resources.get": { visible: true },
  "machines.rename": { id: "m-studio", name: "Studio" },
  "machines.remove": { machine: "m-old", device: "dev_old" },
  "machines.checkHealth": {},
  "spaces.settings": {},
  "spaces.setSettings": { defaultSpace: "relay:mac-mini", fallback: ["relay:linux-box"], fallbackOn: true },
  "spaces.resolveDefault": {},
  "checklist.get": {},
  "checklist.send": { action: { type: "done", step: "teleport" } },
  "links.list": {},
  "links.create": { target: "space:dev:3000" },
  "links.stop": { id: "all" },
  "links.approve": { id: "share-pending", always: false },
  "links.deny": { id: "share-pending" },
  "shares.settings.get": {},
  "shares.settings.set": {
    settings: {
      landing: "auto",
      relayFallback: true,
      dailyCapMib: 2048,
      defaultAllow: [],
      approveAgentShares: true,
      alwaysAllowSpaces: [],
      edgeConsent: [],
      usedToday: 0,
      edgeCloud: null,
      edgeHost: null,
      edgeMonthlyUsd: null,
    },
  },
  "shares.edge.remove": {},
  "cli.plan": {},
  "cli.install": { modifyPath: true },
  "ci.overview": { live: true },
  "ci.connect": {},
  "ci.connectToken": { org: "acme" },
  "ci.connectCancel": {},
  "ci.repositories": { allow: ["acme/website"] },
  "ci.goal": { target: "aws", goal: "fastest" },
  "ci.log": { jobKey: "9911/298", pool: "hosted", slot: "s7" },
  "thread.read": { spaceId: "relay:linux-box/ubuntu-build", limit: 100 },
  "thread.post": { spaceId: "relay:linux-box/ubuntu-build", text: "thanks @hermes" },
  "thread.members": { spaceId: "relay:linux-box/ubuntu-build" },
  "thread.setRights": { spaceId: "relay:linux-box/ubuntu-build", name: "hermes", approve: "members" },
  "thread.agentRemove": { spaceId: "relay:linux-box/ubuntu-build", name: "cursor" },
  "thread.agentAdd": { spaceId: "relay:linux-box/ubuntu-build", name: "codex", harness: "openai-codex" },
  "thread.joinCodeCreate": { spaceId: "relay:linux-box/ubuntu-build", ttlS: 3600, canTask: "owner" },
  "thread.joinCodeList": { spaceId: "relay:linux-box/ubuntu-build" },
  "thread.joinCodeCancel": { spaceId: "relay:linux-box/ubuntu-build", id: "jc_demo00001" },
  "thread.settings": { spaceId: "relay:linux-box/ubuntu-build" },
  "presence.join": { spaceId: SPACE },
  "presence.publish": { handle: "p1", x: 0.5, y: 0.5, visible: true },
  "presence.leave": { handle: "p1" },
  "spaces.fixRuntime": { action: "start-docker" },
  "about.get": {},
  "about.set": { channel: "nightly" },
  "about.checkNow": {},
  "update.get": {},
  "update.install": {},
  "experiments.get": {},
  "experiments.set": { experiments: { cuaVolume: true } },
  "loginItem.get": {},
  "loginItem.set": { on: true },
  "loginItem.openSettings": {},
  "runtimes.check": { kind: "container", path: "/usr/local/bin/docker" },
  "runtimes.browse": { kind: "container" },
  "repoCache.get": {},
  "repoCache.set": { enabled: true, sizeGb: 2 },
  "repoCache.clear": {},
  "devices.get": {},
  "devices.enroll": {},
  "devices.checkEnrolled": {},
  "devices.approve": { code: "K7QX-M2RP", deviceId: null },
  "devices.rename": { id: "dev_studio", name: "Studio" },
  "devices.revoke": { id: "dev_old" },
  "devices.confirmMachine": { id: "m1" },
  "devices.createPairingCode": { team: null },
  "devices.pairingCodes": {},
  "devices.revokePairingCode": { id: "pc_demo0" },
  "teams.list": {},
  "storage.get": {},
  "storage.run": { request: { kind: "clear-cache" } },
  "notifications.list": {},
  "notifications.markAllRead": {},
  "notifications.markRead": { ids: ["n1"] },
  "telemetry.track": { signals: [{ type: "step", step: "app_launched", ok: true }] },
  "telemetry.linkNotice": {},
  "telemetry.acknowledgeLinkNotice": {},
  "crashReporting.config": {},
  "spaces.usage": { spaceId: SPACE },
  "spaces.windows": { spaceId: SPACE },
  "stream.pip": { spaceId: SPACE, command: { type: "open", row: "desktop" } },
  "spaces.thumbnail": { spaceId: SPACE },
  "spaces.chooseFiles": {},
  "spaces.droppedFiles": { names: ["notes.txt"] },
  "spaces.sendFiles": { spaceId: SPACE, paths: ["/tmp/cua-contract-notes.txt"] },
  "host.setUp": { request: { mode: "relay" } },
  "host.joinWithCode": { code: "K7QM-4XPB-2RHD" },
  "host.action": { action: "stop-sharing" },
  "host.limits": { maxSpaces: 6 },
  "host.openSettings": { url: "x-apple.systempreferences:com.apple.preference.security?Privacy_Accessibility" },
  "startup.get": {},
  "startup.act": { action: "allowAccess" },
  "driver.status": {},
  "driver.list": {},
  "driver.config": {},
  "driver.setConfig": { changes: { "cursor.float": "off" } },
  "driver.test": {},
  "driver.pause": { paused: false },
  "driver.setApp": { app: "codex", on: true },
  "driver.setup": {},
  "driver.update": {},
  "driver.permissions": {},
};

/** Operations the demo host refuses on purpose, and why. */
export const DEMO_REFUSES: Partial<Record<OpName, string>> = {
  "spaces.openStream": "the demo host has no video; the page keeps its drawn thumbnail",
  "presence.join": "the demo host has no video to draw cursors over",
  "presence.publish": "the demo host has no video to draw cursors over",
  "presence.leave": "the demo host has no video to draw cursors over",
  "spaces.fixRuntime": "the demo host has no local runtime to fix",
  "checklist.get": "the demo host keeps no checklist; the page keeps its own",
  "checklist.send": "the demo host keeps no checklist; the page keeps its own",
  "links.approve": "the demo host has no waiting share until one is made",
  "links.deny": "the demo host has no waiting share until one is made",
};