|
| 1 | +--- |
| 2 | +summary: Default background computer use via a two-provider seam (CUA + Peekaboo) behind one typed computer.act v2 contract, app-owned TCC, cloud-gateway/multi-node ready. |
| 3 | +title: Computer use plan |
| 4 | +read_when: |
| 5 | + - Implementing or reviewing computer.act v2, the node provider seam, or the CUA/Peekaboo adapters |
| 6 | + - Changing macOS embedded driver spawning, provider selection UX, or managed driver artifacts |
| 7 | + - Extending Peekaboo or CUA integration surfaces |
| 8 | +--- |
| 9 | + |
| 10 | +## Status |
| 11 | + |
| 12 | +Active campaign, started 2026-08-13. Owner-directed (steipete): build autonomously |
| 13 | +end to end, live-test everything, ship fully. Tracker table below is the source of |
| 14 | +truth and is updated as work lands. Derived from RFC 0025 |
| 15 | +(openclaw/rfcs `rfcs/0025-default-pluggable-computer-use.md`, RomneyDa) with the |
| 16 | +owner rulings recorded under Decisions. Coordinate with RFC author before |
| 17 | +each wave lands (check live PRs to avoid collisions with in-flight maintainer work). |
| 18 | + |
| 19 | +## Problem |
| 20 | + |
| 21 | +OpenClaw's computer use is foreground-only everywhere: the macOS fulfiller drives |
| 22 | +the shared cursor via embedded Peekaboo + CGEvent primitives, and the `cua-computer` |
| 23 | +plugin uses only CUA's global desktop scope (`scope:"desktop"`, no `delivery_mode`). |
| 24 | +Both CUA and Peekaboo now have real background window-scoped input (no cursor move, |
| 25 | +no focus steal, no Space switch), semantic observation (AX tree + screenshot + |
| 26 | +element refs), and structured verification. None of that reaches the model. The |
| 27 | +current CUA adapter maps 8 of 49 driver tools; Peekaboo's MCP surface (25 tools, |
| 28 | +background-default clicks, `see` frame binding, `verify_state`) is not reachable |
| 29 | +through `computer.act` at all. |
| 30 | + |
| 31 | +## Goals |
| 32 | + |
| 33 | +- One typed `computer.act` v2 contract (portable actions: window/element/browser |
| 34 | + targets, `deliveryMode: background|foreground`, verification envelope) carried |
| 35 | + over the existing node protocol. Cloud gateway + many paired desktop nodes works |
| 36 | + unchanged — provider processes live on the node. |
| 37 | +- Two first-class macOS providers behind one adapter seam in the app-owned |
| 38 | + TypeScript node worker: CUA (`cua-driver serve --embedded`, app-spawned, TCC via |
| 39 | + responsibility chain) and Peekaboo (`peekaboo mcp` or in-process |
| 40 | + PeekabooAutomationKit). Settings picker; exact capability advertisement per |
| 41 | + provider; no per-call fallback between them. |
| 42 | +- Windows/Linux via the same bundled plugin: CUA daemon + MCP proxy supervised by |
| 43 | + the node host; Windows companion PR in `openclaw/openclaw-windows-node`. |
| 44 | +- Model guidance (skill profile) teaching the background-first ladder: |
| 45 | + observe window -> background element action -> background pixel -> foreground -> |
| 46 | + desktop, driven by structured `effect`/refusal results. |
| 47 | +- Live-tested at every stage; UI changes ship with screenshots/video. |
| 48 | + |
| 49 | +## Non-goals |
| 50 | + |
| 51 | +- Raw provider MCP passthrough to the model (rejected in RFC 0025; breaks |
| 52 | + multi-node caching, arming, and skills). |
| 53 | +- Reimplementing driver internals in TS/Swift. |
| 54 | +- Recording/replay + browser-isolation parity for Peekaboo (optional capability |
| 55 | + families; CUA-only at first). |
| 56 | +- Wayland-beyond-upstream, Windows elevated/UIAccess targets in v1. |
| 57 | + |
| 58 | +## Decisions (owner rulings, 2026-08-13) |
| 59 | + |
| 60 | +1. **No backward compatibility.** v2 replaces the v1 `computer.act` payload in |
| 61 | + place under the same command names. Old node + new gateway (or reverse) gets a |
| 62 | + typed `COMPUTER_CONTRACT_MISMATCH` rejection — a visible outcome, not silent |
| 63 | + degradation. No dual wire contract, no v1 preservation lane. (Supersedes RFC |
| 64 | + delivery rule "shipped v1 wire contract remains green".) |
| 65 | +2. **Production LOC is a hard constraint.** The provider seam replaces the |
| 66 | + duplicate per-plugin command registration; the CUA plugin refactor deletes the |
| 67 | + desktop-scope-only branches it obsoletes; Peekaboo adapter reuses the same |
| 68 | + mapping core (frame binding, refusal codes, queueing) rather than forking it. |
| 69 | + Target: net-new production LOC bounded by deletions elsewhere; every wave |
| 70 | + reports its delta. |
| 71 | +3. **Peekaboo is ours to change.** Gaps close upstream in Peekaboo |
| 72 | + (middle/triple click, hold/mouse-down/up, `get_cursor_position`; browser tool |
| 73 | + shape may align toward the v2 browser family) instead of adapter warts. |
| 74 | +4. **Bundle CUA on macOS** (38 MB universal binary, re-signed with our Developer |
| 75 | + ID inside OpenClaw.app Resources — upstream's recommended embedding shape; |
| 76 | + avoids Gatekeeper friction). Windows/Linux use digest-pinned managed download |
| 77 | + per RFC OC-10A. |
| 78 | +5. **Both providers ship together on macOS** with a Settings picker |
| 79 | + (CUA recommended / Peekaboo). Provider selection is node-local; switch ends the |
| 80 | + active execution and rotates provider generation. |
| 81 | +6. **`invoke_menu` joins the v2 action union** (both providers support it; RFC |
| 82 | + omitted it). Recording + browser families are optional capability families — |
| 83 | + a provider without them is first-class, not degraded. |
| 84 | + |
| 85 | +## Architecture |
| 86 | + |
| 87 | +```text |
| 88 | +Model ── one computer tool (typed v2 actions, capability-filtered) |
| 89 | + Gateway (cloud OK) ── node.invoke("computer.act") over node protocol |
| 90 | + Desktop node |
| 91 | + node-host provider seam (one registration for screen.snapshot + computer.act) |
| 92 | + ├─ CUA adapter ── cua-driver mcp ──socket── cua-driver serve --embedded |
| 93 | + │ (macOS: app-spawned, TCC responsibility chain; Win/Linux: node-host |
| 94 | + │ supervised, interactive session required) |
| 95 | + └─ Peekaboo adapter ── peekaboo mcp / PeekabooAutomationKit (macOS only) |
| 96 | +``` |
| 97 | + |
| 98 | +Key invariants (all existing, preserved): frame/observation binding |
| 99 | +(`displayFrameId` -> v2 `observationId`+`elementRef`, generation-scoped), dangerous |
| 100 | +command arming, pairing approval, serialized actions, model-only screenshots, |
| 101 | +cancellation releases held input. TCC: OpenClaw.app probes and holds |
| 102 | +Accessibility + Screen Recording at startup; app-spawned driver children inherit |
| 103 | +via the macOS responsibility chain — no new permission UX. |
| 104 | + |
| 105 | +Provider capability truth (verified in source, 2026-08-13): |
| 106 | + |
| 107 | +- CUA 0.19.3: 49 MCP tools; background delivery per-call with typed refusals |
| 108 | + (`background_unavailable`, `background_occluded`, `background_uipi_blocked`, |
| 109 | + `off_space_or_ax_unresolved`); SkyLight per-pid posting on macOS, synthetic |
| 110 | + pointer injection on Windows, XTest/libei on Linux (Wayland cannot target |
| 111 | + background windows — capability-gated). Embedded host mode, inherited IPC |
| 112 | + (#2410, PR 2545) and the protected-consent adapter (#2411, PR 2578) are all |
| 113 | + contained in v0.13.1+ (verified via tag containment) — the pinned 0.19.3 |
| 114 | + needs no bump. |
| 115 | +- Peekaboo v4: 25 MCP tools; background-default clicks (AX-action-first, |
| 116 | + pid-routed events, window-routed pointer); `see` = screenshot + element map + |
| 117 | + `reference_id` (maps to observation binding); `verify_state` structured |
| 118 | + predicates without focus; app/window/menu/dialog/space management; CDP browser |
| 119 | + tool into user Chrome with explicit connect consent. Missing vs v2: middle/ |
| 120 | + triple click, held input, cursor position, recording. |
| 121 | + |
| 122 | +## Workstreams and tracker |
| 123 | + |
| 124 | +Waves follow RFC 0025's implementation plan, compressed by the no-compat ruling. |
| 125 | +Status: `todo | in-progress | pr | landed | blocked`. |
| 126 | + |
| 127 | +| ID | Work | Repo | Status | Notes | |
| 128 | +| ---------- | -------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------- | ------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------- | |
| 129 | +| W0-FIX | Parity matrix + pinned fixtures: 49 CUA tools + 25 Peekaboo tools classified against the v2 union; recorded tools/list + result fixtures | openclaw | landed | landed #123469 (d9646ad): 58 CUA + 26 Peekaboo tools, +1059 test-only LOC | |
| 130 | +| W0-PIN | Pick + pin CUA release with embedded/inherited-IPC support; dependency bump (needs Dependency Guard approval) | openclaw | landed | resolved: 0.19.3 already contains #2410+#2411 | |
| 131 | +| W1-PROTO | v2 types: action union (+`invoke_menu`), target union, capability descriptor, result envelope, closed error codes; **replaces** v1 params in place | openclaw | landed | landed #123544 (d19c755) | |
| 132 | +| W1-TOOL | Built-in computer tool v2: capability-filtered schema, observation refs, result projection, no auto-retry | openclaw | landed | landed #123544: v1 651 / v2 742 tokens | |
| 133 | +| W1-SEAM | Node-host provider seam: one registration, provider selection, generation, lifecycle close path; absorbs cua-computer's direct registration | openclaw | landed | landed #123509 (848a7e3): seam+contract, prod +348/-217 | |
| 134 | +| W2-CUA | CUA plugin refactor onto seam: full v2 mapping (window/element/background), session-per-execution, deletes desktop-scope-only adapter | openclaw | landed | landed #123604 (2af5eca): full v2 adapter, prod +1129/-41 | |
| 135 | +| W2-MAC | macOS app: bundle + re-sign driver, direct `serve --embedded` spawn, private socket handoff to worker, TCC restart handling | openclaw | landed | landed #123635 (19ace68): app-owned daemon + picker + orphan reaping, live-proven | |
| 136 | +| W2-PKB | Peekaboo adapter on the same seam (macOS): see/click/type/press/set_value/verify_state/app/window/menu mapping | openclaw | todo | new vs RFC (was v1-only) | |
| 137 | +| W2-PKB-UP | Peekaboo upstream: middle/triple click, hold_key + mouse down/up in BackgroundInputDriver, get_cursor_position; optional browser-shape alignment | Peekaboo | todo | owner-approved | |
| 138 | +| W2-UX | Settings -> Computer Use provider picker + readiness checklist (both apps: macOS now, Tauri Linux later) | openclaw | todo | RFC OC-10B slice; owns picker screenshots (W2-MAC shipped without them; app instance lock at `/tmp/openclaw-UID-app-instances` can block a fresh profile launch) | |
| 139 | +| W3-GATE | Integration gate: live vertical on macOS (both providers) + Linux X11 (CUA): observe window -> background element click -> verify | openclaw | todo | RFC OC-8 | |
| 140 | +| W3-SKILL | Version-pinned skill profile: background-first ladder, result precedence, no CLI/daemon instructions | openclaw | todo | RFC OC-9D | |
| 141 | +| W4-BROWSER | CUA browser family (isolated profile first; existing-profile gated on consent adapter) | openclaw | todo | RFC OC-9B; optional family | |
| 142 | +| W4-REC | CUA recording/resources family with node-owned roots | openclaw | todo | RFC OC-9C; optional family | |
| 143 | +| W4-WIN | Windows companion CUA host PR | openclaw-windows-node | todo | RFC WIN-1; after W1-SEAM/W2-CUA | |
| 144 | +| W4-ART | Managed artifacts: Win/Linux digest-pinned download, atomic update + rollback | openclaw | todo | RFC OC-10A | |
| 145 | +| W5-SEC | Security closure: high-risk action classification, socket ownership audit, hostile-arg tests | openclaw | todo | RFC OC-10C | |
| 146 | +| W5-ACC | Packaged cross-platform acceptance + default-provider rollout | openclaw | todo | RFC OC-11/12 | |
| 147 | + |
| 148 | +Production LOC ledger (updated per landed PR): net target ≤ +1500 for the whole |
| 149 | +campaign excluding tests/fixtures, funded by deleting the v1-only branches, the |
| 150 | +duplicate registration path, and the eight-tool adapter. |
| 151 | + |
| 152 | +## Live testing matrix |
| 153 | + |
| 154 | +Every wave carries live proof; unit fixtures alone never advance the tracker. |
| 155 | + |
| 156 | +- **macOS both providers**: dev gateway (isolated `OPENCLAW_STATE_DIR`, own port) |
| 157 | + - signed local OpenClaw.app build on one of the owner's Macs. Scenario: |
| 158 | + background-click + type into a non-frontmost TextEdit window while frontmost app |
| 159 | + keeps focus; assert frontmost app unchanged, cursor position unchanged, |
| 160 | + `verify_state`/`effect` confirms the edit. Video via screen recording for |
| 161 | + UX-visible changes. |
| 162 | +- **Linux CUA**: Crabbox Xvfb host (recipe proven in PR #117205): node registers |
| 163 | + command pair, real screenshot + frame id, background window action against |
| 164 | + xterm/gtk test app; Wayland smoke on Sway only. |
| 165 | +- **Windows**: openclaw-windows-node companion on a Windows box/VM |
| 166 | + (Parallels lab); Session 0 rejection probe over SSH. |
| 167 | +- **Multi-node**: two paired Macs + cloud gateway; explicit `node` selection, |
| 168 | + frame tokens do not cross nodes, provider generation rotates on app restart. |
| 169 | +- **Skew probe** (no-compat ruling): old app + new gateway must produce the typed |
| 170 | + contract-mismatch error in the tool result, not silence. |
| 171 | + |
| 172 | +## Risks |
| 173 | + |
| 174 | +- CUA prerelease churn: everything pins to one accepted release + fixtures; |
| 175 | + version skew refuses closed. |
| 176 | +- v2 union token cost: measured in W1-TOOL; split into tool family only if a |
| 177 | + provider cannot consume one discriminated union reliably. |
| 178 | +- Private-socket embedding: owner-only dir, 0600, ownership validated, pre-existing |
| 179 | + path rejected; upgrade to inherited IPC when the pinned release supports it. |
| 180 | +- Dependency Guard approvals (CUA bump, new Peekaboo dep surface) interrupt |
| 181 | + autonomy; batch them per wave. |
| 182 | +- Collision with RFC author's in-flight work: check live PRs before each wave. |
0 commit comments