Local-first AI coding agent desktop: Electron + Rust host core + pi Agent Harness + user-installable plugins
TypeScript ai-agentcoding-agentdesktop-appelectronglobali18nlocal-firstmcppipi-agentpi-desktoppluginsreactrusttypescript
docs(adr): move computer use to 0342 so it no longer claims 0340
vastsac5122ffa6209
diff --git a/apps/desktop/electron/main/computer-use/capture.ts b/apps/desktop/electron/main/computer-use/capture.tsindex d76a86171..40ab656b3 100644--- a/apps/desktop/electron/main/computer-use/capture.ts+++ b/apps/desktop/electron/main/computer-use/capture.ts@@ -2,7 +2,7 @@ import { desktopCapturer, systemPreferences } from "electron";import type { ComputerPermissionState, ComputerRect } from "@pi-desktop/shared";/**- * Scope-cropped capture for computer use (ADR 0340 §11).+ * Scope-cropped capture for computer use (ADR 0342 §11).** Chromium's `desktopCapturer` is the one part of the capability that is* already cross-platform, and a window source is inherently scoped: nothingdiff --git a/apps/desktop/electron/main/computer-use/cursor-overlay.ts b/apps/desktop/electron/main/computer-use/cursor-overlay.tsindex 66041e765..e67db1d2b 100644--- a/apps/desktop/electron/main/computer-use/cursor-overlay.ts+++ b/apps/desktop/electron/main/computer-use/cursor-overlay.ts@@ -5,7 +5,7 @@ import { getModuleDirectory } from "../module-path";import { suppressLinuxFramelessSystemMenu } from "../frameless-system-menu";/**- * The agent's own cursor, drawn over the granted window (ADR 0340 §10).+ * The agent's own cursor, drawn over the granted window (ADR 0342 §10).** This window is visualization and nothing else. It is click-through, so it* cannot take a press away from the user, and it owns no part of any action:diff --git a/apps/desktop/electron/main/computer-use/provider.ts b/apps/desktop/electron/main/computer-use/provider.tsindex 3285fdcab..c5dc3ba75 100644--- a/apps/desktop/electron/main/computer-use/provider.ts+++ b/apps/desktop/electron/main/computer-use/provider.ts@@ -6,7 +6,7 @@ import type { HostProcess } from "../host-process";* Resolve the user's computer-use model into a provider config.** It is deliberately its own binding rather than the conversation model- * (ADR 0340 §9), so it is resolved the way image generation resolves its+ * (ADR 0342 §9), so it is resolved the way image generation resolves its* binding: from the provider row the user picked, with its own secret. A* binding whose provider is gone, disabled, or missing its key resolves to* `null`, and the tool reports an unconfigured feature instead of quietlydiff --git a/apps/desktop/electron/main/computer-use/service.ts b/apps/desktop/electron/main/computer-use/service.tsindex 978989178..6e7d0beeb 100644--- a/apps/desktop/electron/main/computer-use/service.ts+++ b/apps/desktop/electron/main/computer-use/service.ts@@ -17,7 +17,7 @@ import { captureGrantedWindow } from "./capture";import type { ComputerCursorOverlay } from "./cursor-overlay";/**- * The `Computer` tool handler (ADR 0340 §1, §2).+ * The `Computer` tool handler (ADR 0342 §1, §2).** The loop lives here because it needs two things host-core deliberately does* not have: a model provider and Chromium. Everything that can *refuse* staysdiff --git a/apps/desktop/electron/main/index.ts b/apps/desktop/electron/main/index.tsindex e4ed190a1..39b654d53 100644--- a/apps/desktop/electron/main/index.ts+++ b/apps/desktop/electron/main/index.ts@@ -757,7 +757,7 @@ const eventPersistence = createEventPersistence({const { persistAgentEvent } = eventPersistence;/**- * The agent's drawn cursor and the indicator feed (ADR 0340 §10).+ * The agent's drawn cursor and the indicator feed (ADR 0342 §10).** The overlay is created lazily by its own module on the first draw command,* and it closes with the grant: a window that outlived the authority it wasdiff --git a/apps/desktop/electron/main/ipc/computer-ipc.ts b/apps/desktop/electron/main/ipc/computer-ipc.tsindex cf6f8ab16..fcc50e291 100644--- a/apps/desktop/electron/main/ipc/computer-ipc.ts+++ b/apps/desktop/electron/main/ipc/computer-ipc.ts@@ -1,5 +1,5 @@/**- * The computer-use channels the renderer may call (ADR 0340).+ * The computer-use channels the renderer may call (ADR 0342).** Deliberately short: read what the platform can do, list windows while the* picker is open, mint a grant from a window the user chose, revoke one, anddiff --git a/apps/desktop/electron/main/runtime/session-launch.ts b/apps/desktop/electron/main/runtime/session-launch.tsindex 5b9f4a37a..e822ff996 100644--- a/apps/desktop/electron/main/runtime/session-launch.ts+++ b/apps/desktop/electron/main/runtime/session-launch.ts@@ -746,7 +746,7 @@ export function createSessionLaunchRuntime({fastMode: session.fastMode === true && storedModel?.fastModeAllowed === true,...(jevApiKey ? { jevApiKey } : {}),// A disabled feature is absent from the prompt rather than advertised- // and refused on every call (ADR 0340 §13).+ // and refused on every call (ADR 0342 §13)....(mode === "agent" && settings.computerUse?.enabled === true? { computerUseEnabled: true }: {}),diff --git a/apps/desktop/electron/main/runtime/sidecar.ts b/apps/desktop/electron/main/runtime/sidecar.tsindex 1b6485d9c..ffc49fa8a 100644--- a/apps/desktop/electron/main/runtime/sidecar.ts+++ b/apps/desktop/electron/main/runtime/sidecar.ts@@ -69,7 +69,7 @@ export type SidecarRuntimeDependencies = {disabledBuiltinSkills: () => Promise<string[]>;pluginActiveInProject: (pluginId: string, projectPath: string | null | undefined) => boolean;currentNetworkProxy: () => any;- /** The agent's drawn cursor. Visualization only (ADR 0340 §10). */+ /** The agent's drawn cursor. Visualization only (ADR 0342 §10). */computerCursorOverlay: Pick<ComputerCursorOverlay, "apply">;/** Push the live computer-use grant to the renderer's indicator. */publishComputerGrant: (grant: ComputerGrantView | null) => void;@@ -579,7 +579,7 @@ export function createSidecarRuntime({// Fake-IP tolerance belongs to the network policy, not to the proxy switch.allowFakeIp: () => relaxedNetworkPolicyEnabled(),}));- // Granted native application control (ADR 0340). The host authorises the+ // Granted native application control (ADR 0342). The host authorises the// call through `tools.execute` before this handler runs, and the loop here// holds no grant of its own: it re-reads the live one on every observation.s.setLocalTool("Computer", createComputerUseTool({diff --git a/apps/desktop/src/features/computer-use/ComputerCursor.tsx b/apps/desktop/src/features/computer-use/ComputerCursor.tsxindex 518431d72..ee25fb1b9 100644--- a/apps/desktop/src/features/computer-use/ComputerCursor.tsx+++ b/apps/desktop/src/features/computer-use/ComputerCursor.tsx@@ -4,7 +4,7 @@ import { computerUseApi } from "./computer-use-api";import "../../styles/computer-cursor.css";/**- * The agent's drawn cursor (ADR 0340 §10).+ * The agent's drawn cursor (ADR 0342 §10).** This surface renders in its own click-through window, so it can never take a* press away from the user. It owns no part of any action: it is told where andiff --git a/apps/desktop/src/features/computer-use/ComputerUseIndicator.tsx b/apps/desktop/src/features/computer-use/ComputerUseIndicator.tsxindex f75ddd819..8826273be 100644--- a/apps/desktop/src/features/computer-use/ComputerUseIndicator.tsx+++ b/apps/desktop/src/features/computer-use/ComputerUseIndicator.tsx@@ -10,7 +10,7 @@ import "../../styles/computer-use.css";/*** The grant indicator and the only way to hand an application over- * (ADR 0340 §4).+ * (ADR 0342 §4).** The picker list comes from the host, including the windows it refuses, so a* window the user can see is either pickable or carries the reason it is not.diff --git a/apps/desktop/src/features/computer-use/computer-use-api.ts b/apps/desktop/src/features/computer-use/computer-use-api.tsindex bfa841bc9..d21cbf2a0 100644--- a/apps/desktop/src/features/computer-use/computer-use-api.ts+++ b/apps/desktop/src/features/computer-use/computer-use-api.ts@@ -9,7 +9,7 @@ import {} from "@pi-desktop/shared";/**- * The renderer's computer-use surface (ADR 0340).+ * The renderer's computer-use surface (ADR 0342).** Read, pick, and revoke — nothing here dispatches input, because the renderer* is the one process that must never hold that authority. A refusal keeps itsdiff --git a/apps/desktop/src/features/settings/computer-use/ComputerUseSettings.tsx b/apps/desktop/src/features/settings/computer-use/ComputerUseSettings.tsxindex 8cb7b390e..adc1123f4 100644--- a/apps/desktop/src/features/settings/computer-use/ComputerUseSettings.tsx+++ b/apps/desktop/src/features/settings/computer-use/ComputerUseSettings.tsx@@ -16,7 +16,7 @@ import { api } from "../../../lib/api";import { computerUseApi } from "../../computer-use/computer-use-api";/**- * Computer use settings (ADR 0340).+ * Computer use settings (ADR 0342).** The three things only the user can decide live here: whether the capability* exists at all, which model may drive it, and whether a run may take pixelsdiff --git a/crates/host-core/src/computer/backend.rs b/crates/host-core/src/computer/backend.rsindex 2f3a03f3b..c5ced5414 100644--- a/crates/host-core/src/computer/backend.rs+++ b/crates/host-core/src/computer/backend.rs@@ -1,6 +1,6 @@//! The platform contract for computer use, plus the fallback that exists on//! every target so an unimplemented platform is a refusal rather than a-//! compile error or a silent no-op (ADR 0340 §11).+//! compile error or a silent no-op (ADR 0342 §11).//!//! A backend may only *attempt* work. It never decides whether a request is//! allowed: policy has already admitted the request by the time a backend seesdiff --git a/crates/host-core/src/computer/mod.rs b/crates/host-core/src/computer/mod.rsindex b92404625..6c1327398 100644--- a/crates/host-core/src/computer/mod.rs+++ b/crates/host-core/src/computer/mod.rs@@ -1,4 +1,4 @@-//! Granted native application control (ADR 0340).+//! Granted native application control (ADR 0342).//!//! This module is the only place that may refuse a computer-use request, so//! every refusal lives here rather than in the caller: the loop that decidesdiff --git a/crates/host-core/src/computer/tests.rs b/crates/host-core/src/computer/tests.rsindex 74e91b1a2..161323ffb 100644--- a/crates/host-core/src/computer/tests.rs+++ b/crates/host-core/src/computer/tests.rs@@ -1,4 +1,4 @@-//! Refusal coverage for computer use. These are the tests ADR 0340 names as+//! Refusal coverage for computer use. These are the tests ADR 0342 names as//! landing gates, and they run on every platform because the fake backend//! stands in for the native one: the rules being checked are policy's, not the//! platform's.diff --git a/crates/host-core/src/state.rs b/crates/host-core/src/state.rsindex 082c31aff..591003a0e 100644--- a/crates/host-core/src/state.rs+++ b/crates/host-core/src/state.rs@@ -93,7 +93,7 @@ pub struct AppState {/// Session-scoped Read/Edit snapshot store (ADR 0087). Interior mutex so/// tool execution does not hold the AppState lock.pub hashline: crate::tools::HashlineStore,- /// The single active computer-use grant (ADR 0340). Process-local and+ /// The single active computer-use grant (ADR 0342). Process-local and/// never persisted: a restart must not hand a new process authority over/// the user's screen.pub computer_grant: Option<crate::computer::Grant>,diff --git a/crates/host-core/src/tools/mod.rs b/crates/host-core/src/tools/mod.rsindex 8396c2404..9f67bf355 100644--- a/crates/host-core/src/tools/mod.rs+++ b/crates/host-core/src/tools/mod.rs@@ -1280,7 +1280,7 @@ pub async fn execute_tool_with_file_lease(// Only the trusted desktop runner performs the external call.// Both run in Electron main after the host authorises them:// image generation needs a provider SDK, and computer use needs- // a provider plus Chromium capture (ADR 0340).+ // a provider plus Chromium capture (ADR 0342)."GenerateImages" | "Computer" => Ok(serde_json::json!({ "authorized": true })),"Read" | "Glob" | "Grep" | "Write" | "Edit" => {run_file_tool(diff --git a/docs/adr/0340-os-computer-use-capability.md b/docs/adr/0342-os-computer-use-capability.mdsimilarity index 99%rename from docs/adr/0340-os-computer-use-capability.mdrename to docs/adr/0342-os-computer-use-capability.mdindex c640e9922..64b44b5c6 100644--- a/docs/adr/0340-os-computer-use-capability.md+++ b/docs/adr/0342-os-computer-use-capability.md@@ -1,4 +1,4 @@-# ADR 0340: Built-in computer use is a host-owned capability behind a user-picked scope grant+# ADR 0342: Built-in computer use is a host-owned capability behind a user-picked scope grant- Status: Accepted- Date: 2026-11-04diff --git a/docs/adr/README.md b/docs/adr/README.mdindex 6dfbfe2e6..3a7a616b3 100644--- a/docs/adr/README.md+++ b/docs/adr/README.md@@ -400,4 +400,4 @@ Each ADR includes:| 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) |-| 0340 | [Built-in computer use is a host-owned capability behind a user-picked scope grant](0340-os-computer-use-capability.md) | Proposed (D681; amends non-goal 9) |+| 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) |diff --git a/docs/implementation/computer-use-evidence.md b/docs/implementation/computer-use-evidence.mdindex 39b831682..6c4652ec5 100644--- a/docs/implementation/computer-use-evidence.md+++ b/docs/implementation/computer-use-evidence.md@@ -1,6 +1,6 @@# Computer Use Stage 1 Evidence-What was built for [ADR 0340](../adr/0340-os-computer-use-capability.md) stage 1,+What was built for [ADR 0342](../adr/0342-os-computer-use-capability.md) stage 1,and — more importantly — what has *not* been verified. This file contains nowindow titles, no captured pixels, and no credentials.diff --git a/docs/spec/01-product/02-non-goals.md b/docs/spec/01-product/02-non-goals.mdindex 9061ae554..819b7d472 100644--- a/docs/spec/01-product/02-non-goals.md+++ b/docs/spec/01-product/02-non-goals.md@@ -11,7 +11,7 @@6. Mobile clients7. Multi-user auth systems8. Billing/subscription modules-9. Computer Use browser takeover *(amended by ADR 0340)* — browser takeover and+9. Computer Use browser takeover *(amended by ADR 0342)* — browser takeover andunattended full-desktop control remain non-goals, and the model may neverchoose its own target. Bounded native application control through auser-picked, revocable, audited scope grant is an accepted capability; seediff --git a/docs/spec/03-runtime/03-tools-and-permissions.md b/docs/spec/03-runtime/03-tools-and-permissions.mdindex fceb766bf..19aa94f8e 100644--- a/docs/spec/03-runtime/03-tools-and-permissions.md+++ b/docs/spec/03-runtime/03-tools-and-permissions.md@@ -134,7 +134,7 @@ Let the agent get things done, but stay under control by default.| `Write` | high | Create/overwrite files; returns the post-write `tag` || `Edit` | high | Modify files through line-anchored ops against a verified `tag` ([18](18-line-anchored-edit-contract.md)) || `Bash` | high | Execute commands |-| `Computer` | high | Inspect and operate the one native window or application the user granted; disabled without an active scope grant ([computer-use](computer-use.md), ADR 0340) |+| `Computer` | high | Inspect and operate the one native window or application the user granted; disabled without an active scope grant ([computer-use](computer-use.md), ADR 0342) || `asktool` | low | Ask one or more user questions and return the submitted answers as tool output || `TodoWrite` | low | Replace the current Agent session checklist; host validates and persists the full ordered snapshot |diff --git a/docs/spec/03-runtime/05-host-core-rust.md b/docs/spec/03-runtime/05-host-core-rust.mdindex 4f38de6ff..f6c19074f 100644--- a/docs/spec/03-runtime/05-host-core-rust.md+++ b/docs/spec/03-runtime/05-host-core-rust.md@@ -31,7 +31,7 @@ It does **not** replace pi. It provides safe host capabilities to:11. Audit logging for sensitive actions12. Computer-use capability: window enumeration, accessibility inspection,event synthesis, scoped screen capture, and the scope-grant broker- ([computer-use](computer-use.md), ADR 0340)+ ([computer-use](computer-use.md), ADR 0342)## 3. Non-responsibilitiesdiff --git a/docs/spec/03-runtime/08-error-codes.md b/docs/spec/03-runtime/08-error-codes.mdindex e6472fbbe..eef6dcd6c 100644--- a/docs/spec/03-runtime/08-error-codes.md+++ b/docs/spec/03-runtime/08-error-codes.md@@ -350,7 +350,7 @@ does not trigger automatic provider or billing fallback.| `LIVE_AUDIO_BACKPRESSURE` | no | bounded PCM or playback credits were exhausted || `LIVE_EXECUTION_NOT_CONNECTED` | no | a provider requested an unsupported function/delegation execution path |-### 3.10 Computer use (ADR 0340)+### 3.10 Computer use (ADR 0342)Computer-use errors are returned as `Computer` tool failures and host`computer.*` responses. Each refusal is separately attributable: a missingdiff --git a/docs/spec/03-runtime/computer-use.md b/docs/spec/03-runtime/computer-use.mdindex 0c4688ba4..bdbe8d41a 100644--- a/docs/spec/03-runtime/computer-use.md+++ b/docs/spec/03-runtime/computer-use.md@@ -2,7 +2,7 @@> Status: Stage 1 implemented, device-unverified. This page is the> authoritative contract for the capability described in-> [ADR 0340](../../adr/0340-os-computer-use-capability.md). The agent is the+> [ADR 0342](../../adr/0342-os-computer-use-capability.md). The agent is the> only caller; the spoken entry point is specified here and built in stage 3.> The refusals, the loop, and the tool's own paths are unit-covered; no real> application has been driven, and Windows and Linux reportdiff --git a/docs/spec/03-runtime/live-voice.md b/docs/spec/03-runtime/live-voice.mdindex df3dc175b..cee6b75ab 100644--- a/docs/spec/03-runtime/live-voice.md+++ b/docs/spec/03-runtime/live-voice.md@@ -38,7 +38,7 @@ executed by the Agent turn under that session's policy; minting a scope grantstays a desktop-UI decision, which a call may ask for but never make, and thecall bar only reports that the app needs attention. Voice-driven computer use istask delegation, not per-frame teleoperation-([Computer Use](computer-use.md), [ADR 0340](../../adr/0340-os-computer-use-capability.md)).+([Computer Use](computer-use.md), [ADR 0342](../../adr/0342-os-computer-use-capability.md)).## Ownership and securitydiff --git a/docs/spec/05-security/01-security.md b/docs/spec/05-security/01-security.mdindex 7e6ddc579..55e9111aa 100644--- a/docs/spec/05-security/01-security.md+++ b/docs/spec/05-security/01-security.md@@ -350,7 +350,7 @@ host-core. They do not change the loopback-only rule above.| Dependency poisoning | lockfiles, few deps, native-module review || Malicious local plugin | declared permissions, no secret access, process isolation tracked post-MVP (ADR 0008) || Skill market SSRF via user source URL | public-HTTPS classifier + DNS + per-hop redirect checks in main; renderer CSP forbids the fetch (ADR 0243) |-| Synthetic input approving this app's own dialogs | computer use refuses PI-Desktop windows and credential surfaces unconditionally; scope grant is user-picked and host-owned (ADR 0340) |+| Synthetic input approving this app's own dialogs | computer use refuses PI-Desktop windows and credential surfaces unconditionally; scope grant is user-picked and host-owned (ADR 0342) |## 11. Security acceptance gates@@ -413,7 +413,7 @@ name); cleanup removes only files whose device/inode and content still matchwhat this operation created, and unexpected filesystem failures cross thepreload boundary only as a path-free classified error.-## 13. Computer-use boundary (ADR 0340)+## 13. Computer-use boundary (ADR 0342)Synthetic input is indistinguishable from the user, so the boundary isstructural rather than advisory. The capability lives in host-core; thediff --git a/docs/spec/06-delivery/04-e2e-test-plan.md b/docs/spec/06-delivery/04-e2e-test-plan.mdindex 7e54278d4..2e0e7901a 100644--- a/docs/spec/06-delivery/04-e2e-test-plan.md+++ b/docs/spec/06-delivery/04-e2e-test-plan.md@@ -19587,7 +19587,7 @@ their separate platform acceptance.group lookup failure, missing project providers, failed/malformed lookup,rename identity, and stale results after Host replacement.-## Computer use (ADR 0340)+## 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 isdiff --git a/docs/spec/08-meta/decisions-log.md b/docs/spec/08-meta/decisions-log.mdindex c54e7126d..9a04a1a4f 100644--- a/docs/spec/08-meta/decisions-log.md+++ b/docs/spec/08-meta/decisions-log.md@@ -8192,7 +8192,7 @@ must keep splitting are covered by `markdown-blocks.test.mjs`.## 2026-11-04 — Computer use is a host-owned capability behind a scope grant (D681)-- D681 / ADR 0340 accepts bounded native application control as a design. The+- D681 / ADR 0342 accepts bounded native application control as a design. Theagent could already drive the embedded browser guest over allowlisted CDP andnothing else; there is no screen capture, synthetic input, window enumeration,or accessibility client anywhere in the repository. This decision records thediff --git a/docs/zh-CN/adr/index.md b/docs/zh-CN/adr/index.mdindex 6e0e866fb..1c35aa8f3 100644--- a/docs/zh-CN/adr/index.md+++ b/docs/zh-CN/adr/index.md@@ -317,7 +317,7 @@ ADR 记录那些不应被静默改变的架构选择。中文入口与英文索| 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) |-| 0340 | [内置电脑操作是宿主拥有、以用户挑选的作用域授权为门的能力](/adr/0340-os-computer-use-capability) | 提议中(D681;修订非目标第 9 条) |+| 0342 | [内置电脑操作是宿主拥有、以用户挑选的作用域授权为门的能力](/adr/0342-os-computer-use-capability) | 提议中(D681;修订非目标第 9 条) |## 什么时候看 ADRdiff --git a/docs/zh-CN/spec/01-product/02-non-goals.md b/docs/zh-CN/spec/01-product/02-non-goals.mdindex f47fc7055..e0169d938 100644--- a/docs/zh-CN/spec/01-product/02-non-goals.md+++ b/docs/zh-CN/spec/01-product/02-non-goals.md@@ -14,7 +14,7 @@6. 移动客户端7. 多用户认证系统8.Billing/subscription 模块-9.计算机使用浏览器接管 *(由 ADR 0340 修订)*——浏览器接管与无人看管的+9.计算机使用浏览器接管 *(由 ADR 0342 修订)*——浏览器接管与无人看管的全桌面控制仍是非目标,模型也永不自行选择目标。通过用户挑选、可撤销、有审计的作用域授权来实现有界的原生应用操作是已接受的能力,见[03-runtime/computer-use](/zh-CN/spec/03-runtime/computer-use)diff --git a/docs/zh-CN/spec/03-runtime/03-tools-and-permissions.md b/docs/zh-CN/spec/03-runtime/03-tools-and-permissions.mdindex f3982aa05..8001292a5 100644--- a/docs/zh-CN/spec/03-runtime/03-tools-and-permissions.md+++ b/docs/zh-CN/spec/03-runtime/03-tools-and-permissions.md@@ -107,7 +107,7 @@ ToolBudget 一次授予全部资源和容量;等待前驱或资源不占槽位| `Write` | 高 | Create/overwrite 文件;返回写入后的 `tag` || `Edit` | 高 | 通过针对已校验 `tag` 的行锚定操作修改文件([18](18-line-anchored-edit-contract.md)) || `Bash` | 高 | 执行命令 |-| `Computer` | 高 | 检查并操作用户授权的那一个原生窗口或应用;没有活动作用域授权时不可用([computer-use](computer-use.md),ADR 0340) |+| `Computer` | 高 | 检查并操作用户授权的那一个原生窗口或应用;没有活动作用域授权时不可用([computer-use](computer-use.md),ADR 0342) || `asktool` | 低 | 询问一个或多个用户问题并将提交的答案作为工具输出返回 || `TodoWrite` | 低 | 替换当前 Agent 会话清单;由主机校验并持久化完整有序快照 |diff --git a/docs/zh-CN/spec/03-runtime/05-host-core-rust.md b/docs/zh-CN/spec/03-runtime/05-host-core-rust.mdindex a416b6d56..6d8b5de24 100644--- a/docs/zh-CN/spec/03-runtime/05-host-core-rust.md+++ b/docs/zh-CN/spec/03-runtime/05-host-core-rust.md@@ -32,7 +32,7 @@10. 密钥存储集成点11.敏感操作的审核日志记录12. 电脑操作能力:窗口枚举、无障碍检查、事件合成、作用域内屏幕截取,- 以及作用域授权中介([computer-use](computer-use.md),ADR 0340)+ 以及作用域授权中介([computer-use](computer-use.md),ADR 0342)## 3. 非责任diff --git a/docs/zh-CN/spec/03-runtime/08-error-codes.md b/docs/zh-CN/spec/03-runtime/08-error-codes.mdindex 268b521de..5e20f8dd7 100644--- a/docs/zh-CN/spec/03-runtime/08-error-codes.md+++ b/docs/zh-CN/spec/03-runtime/08-error-codes.md@@ -343,7 +343,7 @@ ADR 0285)。渲染进程除了一个标识徽章外看不到本地/远程之| `LIVE_AUDIO_BACKPRESSURE` | 否 | PCM 或播放 credit 的有界容量已耗尽 || `LIVE_EXECUTION_NOT_CONNECTED` | 否 | Provider 请求了当前不支持的函数/delegation 执行路径 |-### 3.10 电脑操作(ADR 0340)+### 3.10 电脑操作(ADR 0342)电脑操作错误以 `Computer` 工具失败和宿主 `computer.*` 响应的形式返回。每一种拒绝都可单独归因:缺失的能力永不表现为挂起,也永不以成功回报空操作。可重试表示同一diff --git a/docs/zh-CN/spec/03-runtime/computer-use.md b/docs/zh-CN/spec/03-runtime/computer-use.mdindex 7529088c9..607a562e6 100644--- a/docs/zh-CN/spec/03-runtime/computer-use.md+++ b/docs/zh-CN/spec/03-runtime/computer-use.md@@ -2,7 +2,7 @@> **翻译说明:** 本页与[英文源规格](/spec/03-runtime/computer-use)一一对应。代码、协议字段和标识符保留原文;如翻译与英文源事实存在差异,以英文版本为准。-> 状态:阶段 1 已实现,但未经真机验证。本页是 [ADR 0340](../../../adr/0340-os-computer-use-capability.md) 所述能力的权威契约。当前唯一调用方是 Agent;语音入口在本页定义,但在阶段 3 才接通。拒绝逻辑、回路与工具自身路径已有单测覆盖;尚未驱动过任何真实应用,Windows 与 Linux 在阶段 2 之前一律返回 `COMPUTER_PLATFORM_UNSUPPORTED`。+> 状态:阶段 1 已实现,但未经真机验证。本页是 [ADR 0342](../../../adr/0342-os-computer-use-capability.md) 所述能力的权威契约。当前唯一调用方是 Agent;语音入口在本页定义,但在阶段 3 才接通。拒绝逻辑、回路与工具自身路径已有单测覆盖;尚未驱动过任何真实应用,Windows 与 Linux 在阶段 2 之前一律返回 `COMPUTER_PLATFORM_UNSUPPORTED`。## 范围diff --git a/docs/zh-CN/spec/03-runtime/live-voice.md b/docs/zh-CN/spec/03-runtime/live-voice.mdindex ad69d4a11..b9a7c7b85 100644--- a/docs/zh-CN/spec/03-runtime/live-voice.md+++ b/docs/zh-CN/spec/03-runtime/live-voice.md@@ -14,7 +14,7 @@独立作用域的 Live Work 通话也可以解决绑定会话唯一一个待回答的 AskTool 提问,但只能从该提问自己提供的选项标签中选择;权限与 Plan/Goal 审批仍然只在桌面 UI 中决定(见[实时语音工作会话接入](live-work-session.md)与 [ADR 0315](../../../adr/0315-live-voice-spoken-asktool-answers.md))。-实时语音自身不持有任何电脑操作权限。一句口述只能作为绑定会话上的普通工作请求触达 `Computer` 工具,由该会话策略下的 Agent 轮次执行;签发作用域授权仍然是桌面 UI 的决定,通话可以请求但永不自行做出,通话条只提示应用需要关注。语音驱动的电脑操作是任务委派,不是逐帧遥控(见[电脑操作](computer-use.md)与 [ADR 0340](../../../adr/0340-os-computer-use-capability.md))。+实时语音自身不持有任何电脑操作权限。一句口述只能作为绑定会话上的普通工作请求触达 `Computer` 工具,由该会话策略下的 Agent 轮次执行;签发作用域授权仍然是桌面 UI 的决定,通话可以请求但永不自行做出,通话条只提示应用需要关注。语音驱动的电脑操作是任务委派,不是逐帧遥控(见[电脑操作](computer-use.md)与 [ADR 0342](../../../adr/0342-os-computer-use-capability.md))。公开设置为 `liveVoice: { enabled, selectedBindingId?, bindings }`。它只包含 Provider ID、模型/音色选择和协议 profile,不保存凭证。现有 `voice` 和 `speech` 设置保持原义。持久化 JSON 由 Host Core 所有;它会将 Live 设置与其他设置合并。diff --git a/docs/zh-CN/spec/05-security/01-security.md b/docs/zh-CN/spec/05-security/01-security.mdindex 69f798007..cb2c8db50 100644--- a/docs/zh-CN/spec/05-security/01-security.md+++ b/docs/zh-CN/spec/05-security/01-security.md@@ -228,7 +228,7 @@ MCP 市场只接受无凭据的公网 HTTPS 源和目录端点。Main 在每一| 依赖性中毒 | 锁定文件、几个 dep、本机模块审查 || 恶意本地插件 | 声明的权限、无秘密访问、MVP 后跟踪的进程隔离 (ADR 0008) || 技能市场 SSRF(用户源 URL) | 主进程公网 HTTPS 分类器 + DNS + 逐跳 redirect;渲染层 CSP 禁止该 fetch(ADR 0243) |-| 合成输入批准本应用自己的对话框 | 电脑操作无条件拒绝 PI-Desktop 窗口与凭据界面;作用域授权由用户挑选、宿主持有(ADR 0340) |+| 合成输入批准本应用自己的对话框 | 电脑操作无条件拒绝 PI-Desktop 窗口与凭据界面;作用域授权由用户挑选、宿主持有(ADR 0342) |## 11. 安检门@@ -252,7 +252,7 @@ approve/reject-only 和计划的 Plan 在 artifact/queue 工作之前被拒绝PI-Desktop 自身窗口或安全输入状态为目标,遇到过期 `basis` 或 revision时拒绝而不是照样合成输入,并在 Plan 与 Goal 中被直接拒绝-## 13. 电脑操作边界(ADR 0340)+## 13. 电脑操作边界(ADR 0342)合成输入与用户本人不可区分,因此这条边界是结构性的,而不是靠提示。能力住在host-core;Renderer 永不持有窗口句柄、原生元素引用或输入原语,sidecar 只能通过diff --git a/docs/zh-CN/spec/06-delivery/04-e2e-test-plan.md b/docs/zh-CN/spec/06-delivery/04-e2e-test-plan.mdindex 503f0d6a4..f09b498e7 100644--- a/docs/zh-CN/spec/06-delivery/04-e2e-test-plan.md+++ b/docs/zh-CN/spec/06-delivery/04-e2e-test-plan.md@@ -10160,7 +10160,7 @@ PluginPack 产物的解包目录,仅用于开发验证。验收 #1711 前需- **Status**: Automated offline; native UI clicking and live providers areoutside this fixture's coverage.-## 电脑操作(ADR 0340)+## 电脑操作(ADR 0342)每一条都是 [03-runtime/computer-use](/zh-CN/spec/03-runtime/computer-use)所述能力的落地闸门。阶段 1 已实现,因此每条场景依赖的拒绝逻辑都有单测覆盖;diff --git a/docs/zh-CN/spec/08-meta/decisions-log.md b/docs/zh-CN/spec/08-meta/decisions-log.mdindex 6ebe37b9a..b5be33c7d 100644--- a/docs/zh-CN/spec/08-meta/decisions-log.md+++ b/docs/zh-CN/spec/08-meta/decisions-log.md@@ -5723,7 +5723,7 @@ Markdown 源码,不是 `text/html` 负载;对禁用行内 HTML 的外部编## 2026-11-04 —— 电脑操作是宿主拥有、以作用域授权为门的能力(D681)-- D681 / ADR 0340 以设计形式接受有界的原生应用操作。Agent 此前只能通过白名单+- D681 / ADR 0342 以设计形式接受有界的原生应用操作。Agent 此前只能通过白名单CDP 驱动内嵌浏览器宿体,除此之外一无所能;仓库里没有任何屏幕截取、合成输入、窗口枚举或无障碍客户端。本决定记录的是契约而不是实现:没有任何代码随之交付。- 该能力住在 `crates/host-core`,作为 `computer.*` 域存在,并以唯一一个高风险diff --git a/packages/agent-runtime/src/computer-use/tool.ts b/packages/agent-runtime/src/computer-use/tool.tsindex de3ce4133..dd85e0987 100644--- a/packages/agent-runtime/src/computer-use/tool.ts+++ b/packages/agent-runtime/src/computer-use/tool.ts@@ -2,7 +2,7 @@ import { COMPUTER_MAX_STEPS_LIMIT } from "@pi-desktop/shared";import { Type } from "typebox";/**- * The agent-facing `Computer` schema (ADR 0340 §2).+ * The agent-facing `Computer` schema (ADR 0342 §2).** It takes an instruction and nothing else: no window, no element, no* coordinate. The target comes from the grant the user minted, and addressingdiff --git a/packages/agent-runtime/src/runtime.ts b/packages/agent-runtime/src/runtime.tsindex 1b5fcd28f..379630f24 100644--- a/packages/agent-runtime/src/runtime.ts+++ b/packages/agent-runtime/src/runtime.ts@@ -1017,7 +1017,7 @@ export type AgentRuntimeOptions = {/** TypeSafe Jev credential, resolved by Electron main only when enabled. */jevApiKey?: string;/**- * Whether the `Computer` tool is offered at all (ADR 0340). Resolved by+ * Whether the `Computer` tool is offered at all (ADR 0342). Resolved by* Electron main from settings, so a disabled feature is absent from the* prompt rather than advertised and refused on every call.*/diff --git a/packages/computer-use/src/answer.ts b/packages/computer-use/src/answer.tsindex 2bdeef130..c52c3eb19 100644--- a/packages/computer-use/src/answer.ts+++ b/packages/computer-use/src/answer.ts@@ -1,5 +1,5 @@/**- * The strict wire between the bound model and the machine (ADR 0340 §9).+ * The strict wire between the bound model and the machine (ADR 0342 §9).** Everything in this file treats the model's reply as untrusted text. It is* parsed, not interpreted: a reply that is not exactly one well-formed answerdiff --git a/packages/computer-use/src/loop.ts b/packages/computer-use/src/loop.tsindex 1fd0caaf3..ee41caf79 100644--- a/packages/computer-use/src/loop.ts+++ b/packages/computer-use/src/loop.ts@@ -1,5 +1,5 @@/**- * The bounded perceive-decide-act loop (ADR 0340 §9).+ * The bounded perceive-decide-act loop (ADR 0342 §9).** Electron-independent on purpose: everything the loop needs — observing,* acting, asking the bound model, drawing the cursor — arrives as an injecteddiff --git a/packages/shared/src/computer-use.ts b/packages/shared/src/computer-use.tsindex d07ce14fc..5d231c113 100644--- a/packages/shared/src/computer-use.ts+++ b/packages/shared/src/computer-use.ts@@ -1,5 +1,5 @@/**- * Public, host-authoritative contracts for computer use (ADR 0340).+ * Public, host-authoritative contracts for computer use (ADR 0342).** Nothing here carries authority by itself. The grant is minted by host-core* from a target the user picked, and every field a caller could forge — the@@ -207,7 +207,7 @@ export type ComputerNode = {role: string;/** Accessible name, truncated. Absent when the platform exposes none. */label?: string;- /** Whether a value exists — never the value itself (ADR 0340 §3). */+ /** Whether a value exists — never the value itself (ADR 0342 §3). */hasValue: boolean;enabled: boolean;focused: boolean;diff --git a/packages/shared/src/errors.ts b/packages/shared/src/errors.tsindex ad5cbf248..4bc21ffed 100644--- a/packages/shared/src/errors.ts+++ b/packages/shared/src/errors.ts@@ -92,7 +92,7 @@ export const ErrorCodes = {LIVE_AUDIO_BACKPRESSURE: "LIVE_AUDIO_BACKPRESSURE",LIVE_EXECUTION_NOT_CONNECTED: "LIVE_EXECUTION_NOT_CONNECTED",/**- * Computer use (ADR 0340). Each refusal is separately attributable because a+ * Computer use (ADR 0342). Each refusal is separately attributable because a* missing native capability must never read as an action that did nothing:* `COMPUTER_PLATFORM_UNSUPPORTED` is a backend that does not exist here,* while `COMPUTER_ELEMENT_NOT_ACTIONABLE` is a real element that offers nodiff --git a/packages/shared/src/protocol.ts b/packages/shared/src/protocol.tsindex 497820fff..7572eee07 100644--- a/packages/shared/src/protocol.ts+++ b/packages/shared/src/protocol.ts@@ -131,7 +131,7 @@ export const IPC = {liveVoiceWidgetOwnerState: "pi-desktop/voice/live/widget/ownerState",liveVoiceWidgetVisibility: "pi-desktop/voice/live/widget/visibility",/**- * Computer use (ADR 0340). The renderer may read capabilities, list+ * Computer use (ADR 0342). The renderer may read capabilities, list* pickable targets while a picker is open, mint a grant from a target the* user chose, and revoke one. It can never act: there is no channel that* dispatches input, and `computer.act` is reachable only from main's tooldiff --git a/packages/shared/src/types/settings.ts b/packages/shared/src/types/settings.tsindex 00d442fff..fe54a8f6d 100644--- a/packages/shared/src/types/settings.ts+++ b/packages/shared/src/types/settings.ts@@ -72,7 +72,7 @@ export type AppSettings = {speech?: SpeechSettings;/** App-owned real-time voice bindings; separate from local dictation. */liveVoice?: LiveVoiceSettings;- /** Granted native application control (ADR 0340); off and unbound by default. */+ /** Granted native application control (ADR 0342); off and unbound by default. */computerUse?: import("../computer-use.js").ComputerUseSettings;defaultMode: Mode;/**