Skip to content

Local-first AI coding agent desktop: Electron + Rust host core + pi Agent Harness + user-installable plugins

merge(main): bring computer use onto the renumbered ADR sequence

vastsa39012f229664
diff --cc docs/adr/README.md
index 3a7a616b3,c882c6fbd..cdcb89579
--- a/docs/adr/README.md
+++ b/docs/adr/README.md
@@@ -399,5 -400,4 +400,5 @@@ Each ADR includes
| 0339 | [Chat file references open absolute files outside the managed roots](0339-chat-file-refs-open-absolute-files-outside-managed-roots.md) | Accepted (amends ADR 0262 §4) |
| model-reasoning-effort-override | [Model reasoning effort override](model-reasoning-effort-override.md) | Proposed |
- | 0339 | [Let a granted plugin reach every session, not only its imports](0339-plugin-session-all-scope.md) | Accepted (D680; amends ADR 0200 and ADR 0323) |
+| 0342 | [Built-in computer use is a host-owned capability behind a user-picked scope grant](0342-os-computer-use-capability.md) | Proposed (D681; amends non-goal 9) |
+ | 0340 | [Let a granted plugin reach every session, not only its imports](0340-plugin-session-all-scope.md) | Accepted (D680; amends ADR 0200 and ADR 0323) |
diff --cc docs/spec/06-delivery/04-e2e-test-plan.md
index 2e0e7901a,4db93cf01..7305a8911
--- a/docs/spec/06-delivery/04-e2e-test-plan.md
+++ b/docs/spec/06-delivery/04-e2e-test-plan.md
@@@ -19587,119 -19605,73 +19605,190 @@@ their separate platform acceptance
group lookup failure, missing project providers, failed/malformed lookup,
rename identity, and stale results after Host replacement.
+## Computer use (ADR 0342)
+
+Every one of these is a landing gate for the capability described in
+[03-runtime/computer-use](../03-runtime/computer-use.md). Stage 1 is
+implemented, so the refusals each scenario depends on are covered by unit
+tests; the scenarios themselves drive a real application and are all
+`NOT RUN`. Automation that does exist is named per scenario.
+
+### E2E-COMPUTER-USE-grant-is-user-minted-and-revocable
+
+- **Preconditions**: Isolated desktop profile, computer use enabled, OS
+ permissions granted on the platform under test, one fixture target
+ application, no provider account needed.
+- **Steps**: Ask the agent to operate the target before any grant exists. Mint a
+ grant through the picker, run `describe_scope`, `inspect`, and one `act`.
+ Press Stop in the indicator mid-task. Mint a second grant from another session
+ while the first is active. Let a grant idle past its expiry, and exhaust an
+ action budget.
+- **Expected**: The first request fails `COMPUTER_NO_GRANT` without an OS prompt
+ or capture. The grant appears in the indicator with target, budget, and
+ capture mode, and stays visible while the app is backgrounded. Stop terminates
+ the remaining steps immediately. The second grant is refused
+ `COMPUTER_GRANT_IN_USE`. Idle expiry and budget exhaustion close the grant with
+ their own codes, and no grant survives a restart.
+- **Specs**: [Computer Use](../03-runtime/computer-use.md),
+ [03-tools-and-permissions](../03-runtime/03-tools-and-permissions.md).
+- **Automation**: `computer::tests::only_one_grant_is_active_per_instance`,
+ `another_session_cannot_use_the_active_grant`,
+ `an_idle_grant_expires_and_stays_expired`, and
+ `the_budget_closes_the_grant_and_refuses_the_next_action` in host-core;
+ `apps/desktop/test/computer-use-service.test.mjs` covers the no-grant and
+ wrong-session refusals the agent would hit.
+- **Status**: NOT RUN — needs a real window and the picker.
+
+### E2E-COMPUTER-USE-self-target-and-secure-input-refused
+
+- **Preconditions**: Isolated desktop profile with an active grant, a PI-Desktop
+ window with a pending approval card, and a fixture window containing a
+ password field.
+- **Steps**: Attempt to inspect, capture, and act on a PI-Desktop window,
+ including its approval card and the Live Voice widget, under every permission
+ mode including `auto` and under an `autonomous-in-scope` grant. Focus the
+ password field and attempt `inspect`, `screenshot`, and `set_value`. Attempt a
+ target on the built-in credential denylist and try to remove that entry.
+- **Expected**: Every self-target attempt fails `COMPUTER_SELF_TARGET_REFUSED`;
+ no synthetic event reaches any PI-Desktop window and no approval card is
+ dismissed. Secure input refuses capture and synthesis with
+ `COMPUTER_SECURE_INPUT_REFUSED`, and no field content appears in a snapshot,
+ image, tool result, or log. The built-in denylist entry cannot be removed.
+- **Specs**: [Computer Use](../03-runtime/computer-use.md),
+ [05-security/01-security](../05-security/01-security.md) §13.
+- **Automation**: `computer::tests::our_own_windows_are_never_pickable`,
+ `a_renamed_self_process_is_still_refused`,
+ `built_in_credential_surfaces_cannot_be_allowlisted`, and
+ `secure_input_refuses_both_inspection_and_action` in host-core.
+- **Status**: NOT RUN — needs a real approval card and a real password field.
+
+### E2E-COMPUTER-USE-stale-basis-and-revision-fail-closed
+
+- **Preconditions**: Isolated desktop profile, an `a11y-and-pixels` grant, and a
+ fixture window that can be moved, resized, and re-stacked on demand.
+- **Steps**: Capture a `screenshot`, move the target, then act on the stale
+ basis. Resize the target between `inspect` and `act` on a `uid`. Act with a
+ coordinate outside the measured bounds. Act with a basis minted for a
+ different grant. Act under an `a11y-only` grant with coordinates.
+- **Expected**: `COMPUTER_STALE_BASIS`, `COMPUTER_STALE_REVISION`,
+ `COMPUTER_SCOPE_VIOLATION`, and `COMPUTER_CAPTURE_UNAVAILABLE` respectively;
+ no event is dispatched in any of them, nothing is clamped silently, and the
+ target application observes no input.
+- **Specs**: [Computer Use](../03-runtime/computer-use.md),
+ [08-error-codes](../03-runtime/08-error-codes.md) §3.10.
+- **Automation**: `computer::tests::a_moved_window_bumps_the_revision_and_invalidates_a_basis`,
+ `a_resized_window_with_the_same_revision_still_refuses_a_stale_basis`,
+ `coordinates_outside_the_measured_window_are_refused_not_clamped`, and
+ `a_coordinate_action_without_a_basis_is_refused` in host-core.
+- **Status**: NOT RUN — needs a real window that moves mid-step.
+
+### E2E-COMPUTER-USE-voice-request-cannot-mint-a-grant
+
+- **Preconditions**: Isolated desktop profile, a Live Voice fixture adapter with
+ a bound work session, computer use enabled with no active grant, no real
+ provider account or microphone.
+- **Steps**: Deliver a spoken request that asks the agent to operate an
+ application. Repeat after a user mints a grant in the desktop UI. Repeat with
+ the session in Plan and in Goal.
+- **Expected**: The first request produces a desktop-UI grant request, not a
+ grant: the card appears in the main window, the call bar reports that the app
+ needs attention, and no capture or synthesis happens before the user decides.
+ After a grant exists, the request runs as an ordinary Agent turn under the
+ session's policy, with progress spoken through the existing work-feedback
+ channel. Plan and Goal deny the tool before permission evaluation.
+- **Specs**: [Computer Use](../03-runtime/computer-use.md),
+ [live-voice](../03-runtime/live-voice.md),
+ [live-work-session](../03-runtime/live-work-session.md).
+- **Automation**: none. The spoken path is stage 3 and is deliberately not
+ wired, so there is nothing to drive yet.
+- **Status**: NOT RUN — stage 3.
+
+### E2E-COMPUTER-USE-platform-support-is-explicit
+
+- **Preconditions**: One run per supported platform plus a Wayland session and a
+ platform with the OS permission denied.
+- **Steps**: Enable the feature and open the doctor view on each platform. Mint a
+ grant and act. On Windows, target a window owned by a higher-integrity
+ process. On Wayland, attempt input and then capture. On a platform with Screen
+ Recording or Accessibility denied, attempt inspection and capture.
+- **Expected**: The doctor view distinguishes "not requested", "denied", and
+ "unsupported on this platform". Input on Wayland fails
+ `COMPUTER_PLATFORM_UNSUPPORTED` while portal capture still works; an elevated
+ Windows target fails `COMPUTER_TARGET_ELEVATED` rather than dropping events; a
+ denied OS permission fails `COMPUTER_OS_PERMISSION_MISSING`. No path hangs and
+ none reports success without acting.
+- **Specs**: [Computer Use](../03-runtime/computer-use.md).
+- **Automation**: `computer::tests::an_unsupported_platform_refuses_every_operation`
+ in host-core covers the fallback backend every unported platform uses.
+- **Status**: NOT RUN — needs one run per platform, including Wayland.
++
+ ## Round review reader
+
+ Scenario: E2E-REVIEW-ROUNDS (local desktop, implemented)
+
+ - Preconditions: candidate JavaScript and Rust Host built; isolated temporary
+ profile/data/workspace; no provider or running user instance.
+ - Command: `node scripts/e2e-review-history.mjs` with `PI_DESKTOP_HOST_BIN` pointing
+ at this candidate's Host binary. The runner writes controlled-data preview PNGs
+ under `docs/public/screenshots/review-history/`.
+ - Actions: create modified, newer modified and no-edit rounds through real Host
+ RPC; add delegated evidence; select rounds, expand a multi-operation file,
+ choose Last round/History, hover the context submenu (only 1/3/5), toggle word
+ wrapping, scroll and resize, copy, attempt conflicting rollback, append a
+ late delegate result, restart Host and switch sessions. Choose one context line,
+ reopen Review, switch conversations and reload the renderer from the same
+ isolated profile; verify both the checked menu option and actual diff context
+ retain that choice. Missing/invalid/blocked storage is unit-covered by
+ `apps/desktop/test/review-preferences.test.mjs`.
+ - Expected: latest skips no-edit rounds; delegates belong to their original user
+ round; all file records are accessible; old/new numbers and bounded immutable context
+ agree; one gutter uses old numbers for deletions and new numbers otherwise;
+ file-type glyphs match between Review and turn summaries; both ellipsis menus
+ retain trigger-relative placement across click points and fit narrow windows;
+ no full after-image is cached; only the outer review scrolls; headers stick without toolbar overlap in
+ normal/narrow layouts; copy and conflict protection survive; history restores.
+ Toggle checks trail labels, summary dots have no circle, history options contain
+ date/time plus true per-round recorded totals before the check and fit an
+ arrow-safe field. Unknown/binary/oversized counts are not shown as zero.
+ File headers have no idle
+ fill, and no execution-root row appears. File menus disable internal open when
+ the plugin is absent, open its loaded view when available, and pass the resolved
+ current file and session to external open. The third action, Open folder,
+ invokes system reveal without requiring a plugin (OS launch/reveal boundaries
+ are stubbed). Non-workspace rows hide internal open; their remaining two actions
+ exercise the real reviewed-file service and Host snapshot authentication.
+ A multi-operation file has exactly one action bar and no record-number heading;
+ copy contains every operation, conflicting rollback changes nothing, and a
+ successful grouped rollback restores the content before the first operation.
+ Scope and historical round controls reuse the shared native Select with local
+ customizable-picker styles. Check light/dark palettes and live sidebar color
+ changes: selected fills follow the sidebar but differ from the list base, not
+ system blue. Only first-row upper and last-row lower corners are rounded;
+ interior edges are square, and a single row has all four corners. Verify native
+ ArrowUp/ArrowDown, Enter, Escape/focus retention and close-after-selection;
+ the scope trigger is 24px high, the round field stays 28px high, and both
+ vertically center their text and arrow. Round labels show date/time and recorded totals with
+ reserved trigger-arrow space.
+ The long-file fixture has 3100 lines with local edits: unchanged head/tail do
+ not consume the LCS matrix budget, while original hunk coordinates, 1/3/5-line
+ context, copy and guarded rollback still work. Byte/line/middle-cell caps remain. Absolute/outside-root labels show `.../basename`, while the title
+ retains the full path; normal workspace-relative labels remain unchanged.
+ A real approved outside-workspace Write is included in the historical round:
+ its diff remains readable after restart, its label is `.../basename`, and it
+ grants no rollback writes. Rust RPC tests cover workspace/scratch/external
+ Write and Edit, same-named paths, approval denial, failed Edit, and no Bash capture.
+ The visualization RPC Write → Read → Edit path starts with no visualization
+ directory and checks non-reversible review evidence for both mutations.
+ Ordinary operations keep that root lazy; denied redirected writes leave no
+ review snapshots. Run the complete visualization suite, not only review-named
+ tests, to cover the pre-existing cross-platform path contract.
+ `review-file-open.test.mjs` covers missing/fuzzy paths, worktree/secondary-root
+ locations, plugin unload, stale session/project results, and visible failures.
+ - Additional acceptance: Rust RPC tests cover over 100 turns/changes, dedup,
+ invalid evidence and root isolation; context tests cover legacy, binary, resource
+ budgets, additions/deletions and newline-only changes. Renderer unit tests cover
+ numbered ranges, grouping and cancelled pagination. Existing review/chat/history
+ tests remain required regression coverage.
+ - Specs: ADR 0043; runtime RPC/storage specs; component spec Round review reader.
+ - Milestone: maintenance. Traceability: acceptance criteria 1–9 of the approved
+ native round-review enhancement map to this scenario and the tests above.
diff --cc docs/spec/08-meta/decisions-log.md
index 9a04a1a4f,a2bc81056..24e0b3419
--- a/docs/spec/08-meta/decisions-log.md
+++ b/docs/spec/08-meta/decisions-log.md
@@@ -8186,85 -8186,6 +8186,85 @@@ must keep splitting are covered by `mar
60/minute budget.
- Covered by the `plugin_sessions` and `plugin_session` host-core tests,
`apps/desktop/test/plugin-session-access.test.mjs`, and
- `apps/desktop/test/plugin-session-api.test.mjs`. See ADR 0339, ADR 0200's
+ `apps/desktop/test/plugin-session-api.test.mjs`. See ADR 0340, ADR 0200's
amendment, ADR 0323's corrected alternative, `03-plugin-api.md` §plugin-owned
and host-wide sessions, `13-plugin-permissions-matrix.md` §2, and E2E-268.
+
+## 2026-11-04 — Computer use is a host-owned capability behind a scope grant (D681)
+
+- D681 / ADR 0342 accepts bounded native application control as a design. The
+ agent could already drive the embedded browser guest over allowlisted CDP and
+ nothing else; there is no screen capture, synthetic input, window enumeration,
+ or accessibility client anywhere in the repository. This decision records the
+ contract, not an implementation: no code ships with it.
+- The capability lives in `crates/host-core` as a `computer.*` domain and
+ reaches the agent as one high-risk builtin tool, `Computer`. It is deliberately
+ not a plugin host API, so the most dangerous privilege in the product cannot be
+ requested by a third-party manifest. Electron main stays thin — the picker, the
+ indicator, and the `tools.execute` relay — and the sidecar needs no new
+ `host.proxy` method.
+- Authority is one user-minted scope grant naming one window or application,
+ with a revision, an action budget, an idle expiry, an input policy, and a
+ capture mode. The model cannot name, enumerate, or widen a target; there is at
+ most one active grant per desktop instance; grants are never persisted.
+- Identity is accessibility-first: `inspect` returns roles, names, bounds and
+ per-grant opaque `uid`s, and `act` dispatches platform accessibility actions.
+ Coordinates exist only against a `basis` minted by a capture of the same
+ scope, re-validated immediately before synthesis, so a blind click is
+ unexpressible and a moved window fails closed.
+- Two refusals hold under every mode, setting and grant option: the capability
+ never targets PI-Desktop's own windows, because synthetic input into this app
+ is a permission-broker bypass, and both capture and synthesis refuse under a
+ secure input state or a focused password field. The built-in
+ credential-surface denylist entries cannot be removed.
+- Permission mode governs the grant rather than each keystroke. Minting is
+ always an explicit desktop-UI decision with no deadline; `auto` mints nothing
+ and a spoken request cannot. Within a grant, inspection auto-allows and input
+ follows `confirm-each` (the only policy under `ask`) or an opt-in
+ `autonomous-in-scope`. Plan and Goal hard-deny the tool, and no
+ `allow-session` grant exists for it.
+- Computer use carries **its own model binding** — one `{ providerId, modelId }`
+ the user picks from the existing provider rows, following `imageGeneration`.
+ A bounded perceive-decide-act loop in `packages/computer-use` turns one
+ instruction into validated steps against a strict action schema; the
+ conversation model never drives the machine and there is no silent fallback
+ to it. The agent-facing tool therefore takes an instruction, not a `uid` or a
+ coordinate, and returns a bounded summary rather than the inner transcript.
+- The loop and the capture run in Electron main, not host-core: the loop needs
+ a model provider and the capture needs Chromium, and host-core holds neither.
+ host-core keeps everything that can refuse — targets, accessibility,
+ synthesis, the grant broker, per-action re-validation, audit — and `Computer`
+ follows the `GenerateImages` shape, where `tools.execute` performs the
+ permission evaluation and main executes only after the host authorises.
+- **The agent's cursor is drawn, not stolen.** Actions go through accessibility
+ actions or window-targeted events, so the real pointer never warps and the
+ user keeps their mouse while the agent works; a path that could only act by
+ warping is refused. A frameless, transparent, click-through, always-on-top
+ overlay draws the agent's own cursor, owns no part of the action, cannot
+ receive input, and is never the source of truth for where an action landed.
+- Voice is specified and deliberately unwired in the first release: the agent
+ is the only caller. When stage 3 lands it, a spoken request will reach
+ `Computer` only as a work request on the bound session through the existing
+ delegate/classifier path, as task delegation rather than teleoperation.
+- All three desktop platforms are in scope. Capture is `desktopCapturer`
+ everywhere, so only inspection and input are platform work: macOS
+ (`AXUIElement` actions, `CGEventPostToPid` keys, hand-declared framework FFI
+ with no new crates) is stage 1; Windows (UIA, window-targeted messages,
+ higher-integrity targets refused) and Linux/X11 (AT-SPI, best effort) are
+ stage 2; Wayland refuses input and keeps portal capture. Every unsupported
+ path has its own code, never a hang or a silent no-op, and a partial-fidelity
+ backend declares it instead of returning an empty tree.
+- Non-goal 9 is amended rather than deleted: browser takeover, unattended
+ full-desktop control, and any model-chosen target remain non-goals.
+- Contract pages: `03-runtime/computer-use.md`, `08-error-codes.md` §3.10
+ (`COMPUTER_*`), `05-host-core-rust.md` §2/§5b/§6,
+ `05-security/01-security.md` §13, and `03-tools-and-permissions.md` §0/§2/§6.
+- Stage 1 shipped with the decision: `packages/shared/src/computer-use.ts`,
+ `crates/host-core/src/computer/` with the macOS backend and
+ `rpc/computer_rpc.rs`, `packages/computer-use/`,
+ `apps/desktop/electron/main/computer-use/`, and the picker, indicator,
+ settings card, and drawn cursor in the renderer. Covered by the host-core
+ `computer::` tests, `packages/computer-use` unit tests, the shared
+ validators, and `apps/desktop/test/computer-use-service.test.mjs`. No real
+ application was driven and the five `E2E-COMPUTER-USE-*` gates remain
+ `NOT RUN`; see `docs/implementation/computer-use-evidence.md`.
diff --cc docs/zh-CN/adr/index.md
index 1c35aa8f3,a7dea24e3..2d2e9f695
--- a/docs/zh-CN/adr/index.md
+++ b/docs/zh-CN/adr/index.md
@@@ -316,8 -316,7 +316,8 @@@ ADR 记录那些不应被静默改变�
| 0311 | [在 Host 受理时重新核验 Live Work 工作空间身份](/adr/0311-live-work-workspace-admission-guard) | 已实现候选 |
| 0312 | [会话级 Todo 清单](/adr/0312-session-scoped-todo-checklist) | 已接受实施 |
| registry-header-variable-spelling | [Remote header variables accept the registry's `{name}` spelling](/adr/registry-header-variable-spelling) | Proposed |
- | 0339 | [插件可访问任意会话(新增 .all 权限)](/adr/0339-plugin-session-all-scope) | 已接受(修订 ADR 0200、ADR 0323;D680) |
+| 0342 | [内置电脑操作是宿主拥有、以用户挑选的作用域授权为门的能力](/adr/0342-os-computer-use-capability) | 提议中(D681;修订非目标第 9 条) |
+ | 0340 | [插件可访问任意会话(新增 .all 权限)](/adr/0340-plugin-session-all-scope) | 已接受(修订 ADR 0200、ADR 0323;D680) |
## 什么时候看 ADR
diff --cc docs/zh-CN/spec/08-meta/decisions-log.md
index b5be33c7d,d8e7378d0..e7274582d
--- a/docs/zh-CN/spec/08-meta/decisions-log.md
+++ b/docs/zh-CN/spec/08-meta/decisions-log.md
@@@ -5717,65 -5717,6 +5717,65 @@@ Markdown 源码,不是 `text/html` �
schema 与持久化格式。删除限流仍为每分钟 20 次;四个消息写入共用每分钟 60 次。
- 覆盖:host-core 的 `plugin_sessions` 与 `plugin_session` 测试、
`apps/desktop/test/plugin-session-access.test.mjs`、
- `apps/desktop/test/plugin-session-api.test.mjs`。见 ADR 0339、ADR 0200 修订、
+ `apps/desktop/test/plugin-session-api.test.mjs`。见 ADR 0340、ADR 0200 修订、
ADR 0323 更正后的备选方案、`03-plugin-api.md` §插件拥有与全量会话、
`13-plugin-permissions-matrix.md` 第 2 节与 E2E-268。
+
+## 2026-11-04 —— 电脑操作是宿主拥有、以作用域授权为门的能力(D681)
+
+- D681 / ADR 0342 以设计形式接受有界的原生应用操作。Agent 此前只能通过白名单
+ CDP 驱动内嵌浏览器宿体,除此之外一无所能;仓库里没有任何屏幕截取、合成输入、
+ 窗口枚举或无障碍客户端。本决定记录的是契约而不是实现:没有任何代码随之交付。
+- 该能力住在 `crates/host-core`,作为 `computer.*` 域存在,并以唯一一个高风险
+ 内置工具 `Computer` 触达 Agent。它刻意不是插件宿主 API,因此产品中最危险的
+ 权限无法被第三方清单申请。Electron Main 保持为薄层——挑选器、指示器和
+ `tools.execute` 转发——sidecar 不需要新的 `host.proxy` 方法。
+- 权限是一份由用户签发、指向一个窗口或一个应用的作用域授权,带 revision、动作
+ 预算、空闲过期、输入策略与截取模式。模型不能命名、枚举或扩大目标;每个桌面
+ 实例最多一个活动授权;授权从不持久化。
+- 身份以无障碍为先:`inspect` 返回 role、name、bounds 与按授权生成的不透明
+ `uid`,`act` 派发平台无障碍动作。坐标只在配合 `basis`(由同一作用域的截取签发)
+ 时存在,并在合成前立即重新校验,因此盲点击无法被表达,移动过的窗口失败关闭。
+- 两条拒绝在任何模式、设置与授权选项下都成立:该能力永不以 PI-Desktop 自身窗口
+ 为目标——向本应用合成输入等于绕过权限中介——并且在安全输入状态或焦点落在密码
+ 字段时,截取与合成一律拒绝。内置的凭据界面拒绝名单条目不可移除。
+- 权限模式治理授权而非每次按键。签发始终是桌面 UI 的显式决定且无截止期限;
+ `auto` 不签发任何授权,口述请求也不能。在授权内,检查类动作自动允许,输入遵循
+ `confirm-each`(`ask` 下唯一策略)或需显式选择的 `autonomous-in-scope`。
+ Plan 与 Goal 硬拒绝该工具,且它不存在 `allow-session` 授权。
+- 电脑操作有**自己的模型绑定**——用户从已配置的 Provider 行中挑选的一组
+ `{ providerId, modelId }`,沿用 `imageGeneration` 的先例。
+ `packages/computer-use` 中一条有界的"观察—决策—动作"回路把一条指令按严格
+ 动作 schema 变成一串已校验的步骤;对话模型绝不驱动机器,也没有静默回退。
+ 因此面向 Agent 的工具接受的是一条指令,而不是 `uid` 或坐标,返回的是有界
+ 摘要而不是内层记录。
+- 回路与截取跑在 Electron Main 而不是 host-core:回路需要模型 Provider,截取
+ 需要 Chromium,host-core 两者都不持有。host-core 保留一切能够拒绝的东西——
+ 目标枚举、无障碍、合成、授权中介、每动作重校验、审计——而 `Computer` 沿用
+ `GenerateImages` 的形状:`tools.execute` 做权限评估,Main 在宿主放行后才执行。
+- **Agent 的光标是画出来的,不是抢来的。** 动作走无障碍动作或面向窗口的事件,
+ 真实指针永不被挪动,Agent 工作期间用户的鼠标仍归自己;只能靠挪动真实指针来
+ 动作的路径会被拒绝。一个无边框、透明、穿透点击、置顶的浮层画出 Agent 自己的
+ 光标,它不拥有动作的任何部分,不能接收输入,也绝不是动作落点的事实来源。
+- 语音在首个版本中只定规格、刻意不接通:唯一调用方是 Agent。阶段 3 接通后,
+ 一句口述只能经由现有委派/分类器路径成为绑定会话上的工作请求,属于任务委派
+ 而不是遥控。
+- 三个桌面平台都在范围内。截取各平台统一用 `desktopCapturer`,因此只有检查与
+ 输入是平台工作:macOS(`AXUIElement` 动作、`CGEventPostToPid` 按键、手写
+ framework FFI 且不引入新 crate)属阶段 1;Windows(UIA、面向窗口的消息、
+ 提权目标被拒绝)与 Linux/X11(AT-SPI,尽力而为)属阶段 2;Wayland 拒绝输入
+ 并保留门户截取。每条不支持路径都有自己的错误码,绝不挂起,也绝不静默空操作,
+ 保真度只是部分的后端必须自行声明,而不是返回一棵空树。
+- 非目标第 9 条是修订而非删除:浏览器接管、无人看管的全桌面控制,以及任何由
+ 模型自行选择目标,仍然是非目标。
+- 契约页面:`03-runtime/computer-use.md`、`08-error-codes.md` §3.10
+ (`COMPUTER_*`)、`05-host-core-rust.md` §2/§5b/§6、
+ `05-security/01-security.md` §13、`03-tools-and-permissions.md` §0/§2/§6。
+- 阶段 1 随本决定一起交付:`packages/shared/src/computer-use.ts`、
+ `crates/host-core/src/computer/`(含 macOS 后端与 `rpc/computer_rpc.rs`)、
+ `packages/computer-use/`、`apps/desktop/electron/main/computer-use/`,以及
+ Renderer 中的挑选器、指示器、设置卡片与绘制光标。覆盖来自 host-core 的
+ `computer::` 测试、`packages/computer-use` 单测、shared 校验器,以及
+ `apps/desktop/test/computer-use-service.test.mjs`。尚未驱动任何真实应用,
+ 五条 `E2E-COMPUTER-USE-*` 闸门仍为 `NOT RUN`,详见
+ `docs/implementation/computer-use-evidence.md`。