From 3147ec1596c32c8ede9192fe64f017dd7d853582 Mon Sep 17 00:00:00 2001 From: Yichen Jiang Date: Tue, 10 Nov 2026 12:00:17 +0800 Subject: [PATCH] feat(cua-mcp): compose the profile standalone and initialize it from the bundle declaration The cua-mcp bundle composes its profile from one insert over the empty root instead of layering on dsh-base, so no model adapter, prompt-side tool, telemetry, or session-management row loads; every row is a bundle dependency. The bundle declares the profile through dsh.bundle.profile, and app-boot's shippedProfileTemplate initializes a missing profile from that single shipped bundle for `dsh --profile`, the CLI `dsh plugin` command, and the plugin manager's pnpm path. The `dsh plugin enable|disable` subcommand is withdrawn. --- ...26-11-09-computer-use-mcp-server.i18n.yaml | 8 +- .../2026-11-09-computer-use-mcp-server.md | 8 +- .../2026-11-09-computer-use-mcp-server.zh.md | 8 +- apps/cli/reference/README.i18n.yaml | 4 +- apps/cli/reference/README.md | 2 - apps/cli/reference/README.zh.md | 2 - apps/cli/src/args.ts | 2 +- apps/cli/src/plugin.ts | 70 +---------- apps/cli/tests/plugin.spec.ts | 55 +-------- .../profiles/cua-mcp/cua-mcp.expected.e2e.ts | 15 +-- .../profiles/cua-mcp/expected/codex.toml | 2 +- .../profiles/cua-mcp/expected/reference.md | 10 +- docs/cli-help.md | 3 +- docs/cli-help.zh.md | 3 +- docs/module-graph.md | 9 +- docs/module-graph.zh.md | 9 +- docs/subsystems/computer-use.i18n.yaml | 4 +- docs/subsystems/computer-use.md | 2 +- docs/subsystems/computer-use.zh.md | 2 +- packages/boot/app-boot/README.i18n.yaml | 4 +- packages/boot/app-boot/README.md | 2 +- packages/boot/app-boot/README.zh.md | 2 +- packages/boot/app-boot/src/index.ts | 2 + packages/boot/app-boot/src/profile.ts | 48 +++++++- packages/boot/app-boot/tests/profile.spec.ts | 34 +++++- .../boot/plugin-manager/src/operations.ts | 7 +- .../experimental/cua-mcp/README.i18n.yaml | 18 +-- packages/experimental/cua-mcp/README.md | 27 +---- packages/experimental/cua-mcp/README.zh.md | 27 +---- .../experimental/cua-mcp/cordis.patch.yml | 113 ++++++++++++++---- packages/experimental/cua-mcp/package.json | 34 +++--- .../experimental/cua-mcp/src/client-config.ts | 8 +- .../experimental/cua-mcp/tests/bundle.spec.ts | 53 ++++---- .../cua-mcp/tests/client-config.spec.ts | 14 +-- .../cua-mcp/tests/startup.spec.ts | 2 +- .../util/official-bundles/README.i18n.yaml | 4 +- packages/util/official-bundles/README.md | 2 +- packages/util/official-bundles/README.zh.md | 2 +- packages/util/package-manifest/src/types.ts | 5 + pnpm-lock.yaml | 84 ++++++++----- scripts/optional-bundles.spec.ts | 18 ++- 41 files changed, 385 insertions(+), 343 deletions(-) diff --git a/.agents/notes/implemented/architecture/2026-11-09-computer-use-mcp-server.i18n.yaml b/.agents/notes/implemented/architecture/2026-11-09-computer-use-mcp-server.i18n.yaml index 02417d58c7..303dc6cd10 100644 --- a/.agents/notes/implemented/architecture/2026-11-09-computer-use-mcp-server.i18n.yaml +++ b/.agents/notes/implemented/architecture/2026-11-09-computer-use-mcp-server.i18n.yaml @@ -9,11 +9,11 @@ en: 6050884223e0e491 zh: eb808c298c9fb652 /agent-note-serve-computer-use-to-other-harnesses-as-an-mcp-server/decision: - en: 7087ecc0b83d2759 - zh: 9008903182bb7e13 + en: 105a26da72fd7ff0 + zh: e00c8a688935b2bf /agent-note-serve-computer-use-to-other-harnesses-as-an-mcp-server/alternatives-considered: - en: cad5bdefc9bfe720 - zh: 8564660068c66fc1 + en: b30d473439234af3 + zh: fdc0ecf85535f97b /agent-note-serve-computer-use-to-other-harnesses-as-an-mcp-server/consequences: en: cb25b3b611178f0a zh: 6234bf3e87e0e14c diff --git a/.agents/notes/implemented/architecture/2026-11-09-computer-use-mcp-server.md b/.agents/notes/implemented/architecture/2026-11-09-computer-use-mcp-server.md index 1ec8139e67..78e66822a3 100644 --- a/.agents/notes/implemented/architecture/2026-11-09-computer-use-mcp-server.md +++ b/.agents/notes/implemented/architecture/2026-11-09-computer-use-mcp-server.md @@ -10,7 +10,7 @@ Computer Use training data should come from several agent harnesses, not only fr ## Decision -`@deepseek-ai/dsh-cua-mcp` is an experimental bundle in `OPTIONAL_BUNDLES`: a profile frontend over `dsh-base` selected with `dsh plugin --profile cua-mcp enable @deepseek-ai/dsh-cua-mcp` and started with `dsh --profile cua-mcp`. It is the only MCP application path; no package bin or SDK escape exists, and a shipped profile template waits for CUA promotion because templates cannot name experimental packages. +`@deepseek-ai/dsh-cua-mcp` is an experimental bundle in `OPTIONAL_BUNDLES` that composes the standalone `cua-mcp` profile from one insert over the empty root and declares that profile through `dsh.bundle.profile`, so the first `dsh --profile cua-mcp` initializes the profile from this single bundle. It is the only MCP application path; no package bin or SDK escape exists, and the bundle stays out of `PROFILE_TEMPLATES` because templates cannot name experimental packages. The server runs inside the profile process and calls `ctx.tools.execute` with the connection's Agent and no model step. One stdio connection owns one Agent: creation after client initialization, disposal at stdin EOF. Agent ownership already selects the retained program process, native connection, and session-scoped grants, so connection lifetime and state lifetime coincide. The empty default preset `cua-mcp` gives that Agent `cua_run_code` and nothing else, because the provider registers program tools only for composed presets. @@ -18,7 +18,7 @@ Two tools form the surface. `cua_run_code` forwards `code`, an optional `descrip Consent has two modes. `DSH_CUA_CONSENT=allow` answers every approval question of the connection's Agent with its approving label for the session. The default `elicit` forwards each question to the client as a form elicitation whose enum is the question's labels. No Session event is added: the training side consumes MCP tool results, and the connected harness's transcript records calls; DSH retains nested `tool/ptc-dispatch` events for diagnosis. -`dsh plugin enable|disable` selects installed bundles by editing `dsh.profile.bundles` without pnpm, the same operation as the Plugins page switch, so the Python runtime wheel and offline training Hosts need no registry access. `--print-client-config codex|claude-code|json` renders the client entry for the exact installation. +The composition lists its dependency closure, twenty-five rows, instead of layering on `dsh-base`: no model adapter, prompt-side tool, telemetry, or session-management row loads, and a new service injection in the CUA or PTC packages fails the required startup entry loudly until the patch adds the row. Initialization needs no `dsh plugin` step, so the Python runtime wheel and offline training Hosts need no registry access. `--print-client-config codex|claude-code|json` renders the client entry for the exact installation. ## Alternatives considered @@ -32,6 +32,10 @@ Consent has two modes. `DSH_CUA_CONSENT=allow` answers every approval question o **Exposing the raw `cua` tool or program sandbox escalation.** Raw operations need per-method schemas the external model would relearn, and escalation needs an approval answerer the profile does not have. +**A profile frontend layered on `dsh-base` with model rows disabled.** The composed profile carried about a hundred rows without a consumer: model adapters, web tools, subagents, compaction, telemetry, and session management. The explicit closure is a quarter of that and fails loud on drift. + +**A `dsh plugin enable|disable` subcommand that selects the shipped bundle.** It duplicated the plugin manager's manifest-only selection inside the launcher and still produced a base-backed profile; a bundle-declared profile needs no step. + ## Consequences Every installation carries the bundle and its optional macOS provider dependency; `verify-default-product-isolation` keeps it out of default templates. The required startup entry `cua-mcp` fails the profile loudly when the frontend cannot activate. Clients see state loss on process exit, `cua_reset`, or Agent disposal and recreate objects. Consent elicitation depends on the 2025 MCP request model; clients on the 2026-07-28 revision use `allow`. The reference text in the first result is pinned by the profile's expected-output test and changes with the installed CUA packages. diff --git a/.agents/notes/implemented/architecture/2026-11-09-computer-use-mcp-server.zh.md b/.agents/notes/implemented/architecture/2026-11-09-computer-use-mcp-server.zh.md index a1b4a6477a..eaccffabef 100644 --- a/.agents/notes/implemented/architecture/2026-11-09-computer-use-mcp-server.zh.md +++ b/.agents/notes/implemented/architecture/2026-11-09-computer-use-mcp-server.zh.md @@ -10,7 +10,7 @@ Computer Use 的训练数据应来自多个 agent harness,而不只是 DSH 会 ## 决策 -`@deepseek-ai/dsh-cua-mcp` 是 `OPTIONAL_BUNDLES` 中的实验性组合包:一个位于 `dsh-base` 之上的 profile 前端,用 `dsh plugin --profile cua-mcp enable @deepseek-ai/dsh-cua-mcp` 选中,用 `dsh --profile cua-mcp` 启动。这是唯一的 MCP 应用路径;没有包 bin 或 SDK 逃逸,随附的 profile 模板等待 CUA 晋升,因为模板不能引用实验包。 +`@deepseek-ai/dsh-cua-mcp` 是 `OPTIONAL_BUNDLES` 中的实验性组合包:它在空 profile 根上用一次 insert 组成独立的 `cua-mcp` profile,并通过 `dsh.bundle.profile` 声明该 profile,因此首次 `dsh --profile cua-mcp` 就从这一个组合包初始化 profile。这是唯一的 MCP 应用路径;没有包 bin 或 SDK 逃逸,该组合包不进入 `PROFILE_TEMPLATES`,因为模板不能引用实验包。 服务器运行在 profile 进程内,带着连接的 Agent、不经模型步骤地调用 `ctx.tools.execute`。一个 stdio 连接拥有一个 Agent:客户端初始化后创建,stdin EOF 时销毁。Agent 归属已经决定了保留的程序进程、本机连接和会话级授权,因此连接生命周期与状态生命周期重合。空的默认 preset `cua-mcp` 让该 Agent 只获得 `cua_run_code`,因为提供方只为已组合 preset 注册程序工具。 @@ -18,7 +18,7 @@ Computer Use 的训练数据应来自多个 agent harness,而不只是 DSH 会 授权有两种模式。`DSH_CUA_CONSENT=allow` 以批准标签为本会话回答连接 Agent 的每个审批问题。默认的 `elicit` 把每个问题作为表单 elicitation 转发给客户端,枚举即问题的选项标签。不新增任何 Session 事件:训练侧只消费 MCP 工具结果,接入 harness 的 transcript 记录调用;DSH 保留嵌套的 `tool/ptc-dispatch` 事件以供诊断。 -`dsh plugin enable|disable` 不经 pnpm、只编辑 `dsh.profile.bundles` 来选择已安装的组合包,与插件页开关是同一操作,因此 Python runtime wheel 和离线训练 Host 都不需要访问 registry。`--print-client-config codex|claude-code|json` 为当前安装渲染客户端配置项。 +组合列出自己的依赖闭包(25 行),而不是叠在 `dsh-base` 之上:不加载任何模型适配器、提示侧工具、遥测或会话管理行;CUA 或 PTC 包新增服务注入时,必需启动条目会大声失败,直到 patch 补上该行。初始化不需要 `dsh plugin` 步骤,因此 Python runtime wheel 和离线训练 Host 都不需要访问 registry。`--print-client-config codex|claude-code|json` 为当前安装渲染客户端配置项。 ## 考虑过的替代方案 @@ -32,6 +32,10 @@ Computer Use 的训练数据应来自多个 agent harness,而不只是 DSH 会 **暴露原始 `cua` 工具或程序沙箱提权。** 原始操作需要外部模型重新学习的逐方法 schema,提权需要该 profile 不具备的审批应答者。 +**叠在 `dsh-base` 之上、禁用模型行的 profile 前端。** 组合出的 profile 带着约一百行没有消费者的插件:模型适配器、web 工具、子代理、压缩、遥测和会话管理。显式闭包只有四分之一,且在漂移时大声失败。 + +**用 `dsh plugin enable|disable` 子命令选中随附组合包。** 它在启动器里重复了插件管理器的仅改 manifest 选择,而且仍然产生以 base 为底的 profile;组合包声明的 profile 不需要任何步骤。 + ## 后果 每个安装都携带该组合包及其可选的 macOS 提供方依赖;`verify-default-product-isolation` 让它留在默认模板之外。必需启动条目 `cua-mcp` 在前端无法激活时让 profile 大声失败。客户端会在进程退出、`cua_reset` 或 Agent 销毁时看到状态丢失并重新创建对象。授权 elicitation 依赖 2025 版 MCP 请求模型;使用 2026-07-28 修订版的客户端改用 `allow`。首个结果中的参考文本由 profile 的期望输出测试固定,并随已安装的 CUA 包变化。 diff --git a/apps/cli/reference/README.i18n.yaml b/apps/cli/reference/README.i18n.yaml index 420c01973f..2c33416553 100644 --- a/apps/cli/reference/README.i18n.yaml +++ b/apps/cli/reference/README.i18n.yaml @@ -18,8 +18,8 @@ en: d6368bf97a02bd57 zh: 2ab7888a108961ce /dsh-cli-behavior-reference/plugin-management: - en: 66fa35fcd6ec2a76 - zh: b5fbe1cd6ba9f336 + en: 8d2cfff9bab7327f + zh: 21515ab6e6798504 /dsh-cli-behavior-reference/web-profile: en: 149c5571acd51baf zh: 300e3c2425273a92 diff --git a/apps/cli/reference/README.md b/apps/cli/reference/README.md index 558b2d7e85..dc84a267d8 100644 --- a/apps/cli/reference/README.md +++ b/apps/cli/reference/README.md @@ -84,8 +84,6 @@ New directories and files request modes `0700` and `0600` on POSIX. The CLI prin `dsh plugin --profile ` initializes the profile when missing (shipped template, or `@deepseek-ai/dsh-base` alone for other names), then forwards `` to `pnpm` with the profile directory as working directory — `add`, `remove`, `why`, `update`, and every other pnpm verb work unchanged; pnpm must be on PATH. Relative path specs (`.`, `../plugin`, and their `file:`/`link:` forms) are anchored to the invoking directory first, so `add .` from a plugin checkout installs that checkout, not the profile. After every successful run, `dsh.profile.bundles` is reconciled against the installed state: each dependency resolving to a package whose manifest declares `"dsh": { "bundle": { "patch": "./cordis.patch.yml" } }` joins the layer stack (so an `update` that gains the declaration activates it), a bundle-less dependency stays plain with a one-time warning, and a removed dependency leaves the stack. -`dsh plugin --profile enable ` and `disable ` change only `dsh.profile.bundles` and never run pnpm. `enable` selects a bundle the installation ships, such as an [optional bundle](../../../packages/util/official-bundles/README.md), or one the profile already installed, after its platform declaration and version compatibility pass; `disable` deselects it. Both refuse a bundle of the profile's shipped template, initialize a missing profile first, and print the change; a running profile applies it after a restart. - `dsh plugin` reads `--profile` only before the forwarded arguments, which start at the first token it does not recognize, so `--profile ` comes first. When the forwarded arguments begin with the pnpm command, everything after that command reaches pnpm verbatim, including `-h` and `--help`. When they begin with a pnpm option such as `--filter ` or `-r`, a later `-h` or `--help` still prints the forwarder's help instead of pnpm's, so put the pnpm command before them to reach pnpm's help. `-h` or `--help` before any forwarded argument prints the forwarder's own help and exits 0. The Codex and Claude Code subagent providers are separate optional Bundles. Add either package, both in one command, or remove either package independently: diff --git a/apps/cli/reference/README.zh.md b/apps/cli/reference/README.zh.md index 1785b2a163..2de7755983 100644 --- a/apps/cli/reference/README.zh.md +++ b/apps/cli/reference/README.zh.md @@ -84,8 +84,6 @@ dsh --profile web --patch ./extra.yml --dump-config `dsh plugin --profile ` 在 profile 缺失时先初始化它(有随附模板的用模板,其他名称只装 `@deepseek-ai/dsh-base`),然后以 profile 目录为工作目录,把 `` 转发给 `pnpm`:`add`、`remove`、`why`、`update` 及其他所有 pnpm 子命令都照常可用;pnpm 必须在 PATH 上。相对路径 spec(`.`、`../plugin` 及其 `file:`/`link:` 形式)会先锚定到调用目录,因此在插件 checkout 中执行 `add .` 安装的是该 checkout,而不是 profile。每次成功运行后,系统都会根据当前安装状态更新 `dsh.profile.bundles`:如果某项依赖解析到的包在 manifest 中声明了 `"dsh": { "bundle": { "patch": "./cordis.patch.yml" } }`,该依赖就会加入配置层栈;如果某项依赖在 `update` 后获得该声明,也会随即激活。没有组合包声明的依赖仍作为普通依赖保留,并显示一次性警告;已移除的依赖则从配置层栈中删除。 -`dsh plugin --profile enable ` 与 `disable ` 只修改 `dsh.profile.bundles`,不运行 pnpm。`enable` 在平台声明和版本兼容性检查通过后,选择安装自带的组合包(例如[可选组合包](../../../packages/util/official-bundles/README.zh.md))或 profile 已安装的组合包;`disable` 取消选择。两者都拒绝 profile 随附模板中的组合包,会先初始化缺失的 profile 并打印变更;正在运行的 profile 在重启后应用。 - `dsh plugin` 只在被转发的参数之前读取 `--profile`;被转发的参数从它无法识别的第一个 token 开始,因此 `--profile ` 必须写在最前面。被转发的参数以 pnpm 命令开头时,该命令之后的所有内容都会原样交给 pnpm,包括 `-h` 和 `--help`。被转发的参数以 `--filter ` 或 `-r` 等 pnpm 选项开头时,后面的 `-h` 或 `--help` 仍会打印转发器的帮助而不是 pnpm 的帮助,因此要查看 pnpm 的帮助,需把 pnpm 命令写在它们之前。在任何被转发的参数之前出现的 `-h` 或 `--help` 会打印转发器自身的帮助并以 0 退出。 Codex 与 Claude Code subagent 提供方是两个彼此独立的可选组合包。可以只添加一个包、在同一命令中添加两个包,或独立移除任一包: diff --git a/apps/cli/src/args.ts b/apps/cli/src/args.ts index a071b6635e..41d4ebeaa8 100644 --- a/apps/cli/src/args.ts +++ b/apps/cli/src/args.ts @@ -193,7 +193,7 @@ export function parseDshArgs(argv: readonly string[], version: string, manageDes .passThroughOptions() .requiredOption('--profile ', 'the profile whose plugins to manage (initialized on first use)', selectProfile) .allowUnknownOption() - .argument('[args...]', 'pnpm arguments, forwarded verbatim (add , remove , why , ...), or enable|disable to select an installed bundle without pnpm') + .argument('[args...]', 'pnpm arguments, forwarded verbatim (add , remove , why , ...)') .action((args: string[], options: { profile: string }) => { if (options.profile === '') program.error('error: --profile needs a name') if (!manageDesktopProfile) rejectElectronProfile(plugin, options.profile) diff --git a/apps/cli/src/plugin.ts b/apps/cli/src/plugin.ts index bf95877ab0..a1f2100877 100644 --- a/apps/cli/src/plugin.ts +++ b/apps/cli/src/plugin.ts @@ -1,11 +1,8 @@ -/** Profile package management, manifest-only bundle selection, and explicit, exact-version compatibility approvals. */ -import { bundleManifest, runPluginCommand, runProfilePnpm, setProfileVersionExemption, type PackageOperationOptions } from '@deepseek-ai/dsh-plugin-manager/operations' +/** Profile package management and explicit, exact-version compatibility approvals. */ +import { runPluginCommand, runProfilePnpm, setProfileVersionExemption, type PackageOperationOptions } from '@deepseek-ai/dsh-plugin-manager/operations' import { INSTALL_ANCHOR } from './profile-boot.ts' -import { - assertBundlePlatform, evaluatePluginCompatibility, initProfile, pluginCompatibilityWarning, readProfileCompatibility, - readProfileManifest, readProfileVersionExemptions, resolveProfileDir, writeProfileBundles, type ProfileContext, -} from '@deepseek-ai/dsh-app-boot' -import { PROFILE_TEMPLATES, DEFAULT_PROFILE_BUNDLES } from '@deepseek-ai/dsh-official-bundles' +import { initProfile, readProfileCompatibility, resolveProfileDir, shippedProfileTemplate, type ProfileContext } from '@deepseek-ai/dsh-app-boot' +import { DEFAULT_PROFILE_BUNDLES } from '@deepseek-ai/dsh-official-bundles' import { withFileLock } from '@deepseek-ai/dsh-atomic-write' import { existsSync } from 'node:fs' import { mkdir } from 'node:fs/promises' @@ -48,7 +45,7 @@ async function versionCommand(profile: string, args: readonly string[]): Promise if (profile !== 'desktop') await mkdir(dir, { recursive: true }) await withFileLock(join(dir, 'package.json'), async () => { if (profile === 'desktop') requireDesktopProfile(dir) - else if (!existsSync(join(dir, 'package.json'))) initProfile(dir, PROFILE_TEMPLATES[profile]?.bundles ?? DEFAULT_PROFILE_BUNDLES) + else if (!existsSync(join(dir, 'package.json'))) initProfile(dir, shippedProfileTemplate('dsh', profile, INSTALL_ANCHOR, dir) ?? DEFAULT_PROFILE_BUNDLES) if (request === undefined) { const { exemptions, warnings } = readProfileCompatibility(dir) for (const warning of warnings) process.stderr.write(`dsh: warning: ${warning}\n`) @@ -65,62 +62,9 @@ async function versionCommand(profile: string, args: readonly string[]): Promise } } -/** - * Select or deselect installed bundles by editing `dsh.profile.bundles` alone, the way the Plugins page switch does; - * pnpm never runs. `enable` admits a bundle the installation ships or the profile installed after its platform and - * version checks pass; `disable` removes a selection. Bundles of the profile's shipped template are refused. - */ -async function selectionCommand(profile: string, args: readonly string[]): Promise { - const [command, ...names] = args - if (command !== 'enable' && command !== 'disable') return undefined - try { - if (names.length === 0 || names.some(name => name.startsWith('-'))) throw new Error(`usage: dsh plugin ${command} `) - const template = PROFILE_TEMPLATES[profile]?.bundles ?? DEFAULT_PROFILE_BUNDLES - const dir = resolveProfileDir(profile) - if (profile !== 'desktop') await mkdir(dir, { recursive: true }) - await withFileLock(join(dir, 'package.json'), () => { - if (profile === 'desktop') requireDesktopProfile(dir) - else if (!existsSync(join(dir, 'package.json'))) initProfile(dir, template) - const manifest = readProfileManifest('dsh', dir) - const previous = manifest.dsh?.profile?.bundles ?? [] - const bundles = [...previous] - for (const name of names) { - if (template.includes(name)) throw new Error(`${name} is a bundle of the ${profile} profile template and cannot be ${command}d`) - if (command === 'disable') { - const index = bundles.indexOf(name) - if (index >= 0) bundles.splice(index, 1) - continue - } - let metadata: ReturnType - try { - metadata = bundleManifest(name, dir, INSTALL_ANCHOR) - } catch (error) { - throw new Error(`${name} is not installed: run 'dsh plugin --profile ${profile} add ${name}', or enable a bundle this installation ships`, { cause: error }) - } - if (metadata === undefined) throw new Error(`${name} declares no dsh.bundle; only bundles can be enabled`) - assertBundlePlatform(metadata.dsh?.bundle?.platforms, process.platform) - const issue = evaluatePluginCompatibility(metadata, readProfileVersionExemptions(dir)) - if (issue !== undefined && !issue.exempted) throw new Error(pluginCompatibilityWarning(issue)) - if (!bundles.includes(name)) bundles.push(name) - } - if (JSON.stringify(bundles) === JSON.stringify(previous)) { - process.stdout.write(`dsh: profile ${profile} already has ${names.join(', ')} ${command}d\n`) - return Promise.resolve() - } - writeProfileBundles(dir, manifest, bundles) - process.stdout.write(`dsh: ${command}d ${names.join(', ')} in profile ${profile}; restart the profile to apply\n`) - return Promise.resolve() - }, { waitMs: 120000 }) - return 0 - } catch (error) { - process.stderr.write(`dsh: ${String(error)}\n`) - return 1 - } -} - /** Run package management for a profile. * @param profile Profile name; Desktop's reserved profile must already be initialized by the application. - * @param args DSH exemption or bundle selection command, or pnpm arguments relative to the invoking directory. + * @param args DSH exemption command or pnpm arguments relative to the invoking directory. * @param packageManager Installation-owned executable and environment for pnpm operations. * @returns Zero on success; nonzero on invalid approval or package-manager failure. */ @@ -133,8 +77,6 @@ export async function runPlugin(profile: string, args: readonly string[], packag } const versionResult = await versionCommand(profile, args) if (versionResult !== undefined) return versionResult - const selectionResult = await selectionCommand(profile, args) - if (selectionResult !== undefined) return selectionResult const dir = resolveProfileDir(profile) if (existsSync(join(dir, 'package.json'))) { for (const warning of readProfileCompatibility(dir).warnings) process.stderr.write(`dsh: warning: ${warning}\n`) diff --git a/apps/cli/tests/plugin.spec.ts b/apps/cli/tests/plugin.spec.ts index 94f23b88ed..9185315cb1 100644 --- a/apps/cli/tests/plugin.spec.ts +++ b/apps/cli/tests/plugin.spec.ts @@ -1,5 +1,5 @@ /** Explicit CLI exemptions use the profile lock and never become pnpm arguments. */ -import { existsSync, mkdirSync, mkdtempSync, readFileSync, rmSync, writeFileSync } from 'node:fs' +import { existsSync, mkdtempSync, readFileSync, rmSync } from 'node:fs' import { tmpdir } from 'node:os' import { join } from 'node:path' import { expect, it, onTestFinished, vi } from 'vitest' @@ -176,56 +176,3 @@ it('applies version approvals to the existing Desktop profile without replacing expect(runPluginCommand).not.toHaveBeenCalled() expect(runProfilePnpm).not.toHaveBeenCalled() }) - -/** An installed package the profile can select: a bundle, or a plain dependency without a patch. */ -function installPackage(dir: string, name: string, manifest: Record): void { - const packageDir = join(dir, 'node_modules', ...name.split('/')) - mkdirSync(packageDir, { recursive: true }) - writeFileSync(join(packageDir, 'package.json'), JSON.stringify({ name, version: '1.0.0', ...manifest })) - writeFileSync(join(packageDir, 'cordis.patch.yml'), '[]\n') -} - -function bundlesOf(dir: string): string[] { - return (JSON.parse(readFileSync(join(dir, 'package.json'), 'utf8')) as { dsh: { profile: { bundles: string[] } } }).dsh.profile.bundles -} - -it('enables and disables an installed bundle by editing the manifest without pnpm', async () => { - const { dir, stdout } = fixture() - initProfile(dir, PROFILE_TEMPLATES.web!.bundles) - installPackage(dir, '@example/bundle', { dsh: { bundle: { patch: './cordis.patch.yml' } } }) - expect(await runPlugin('test', ['enable', '@example/bundle'])).toBe(0) - expect(bundlesOf(dir)).toEqual([...PROFILE_TEMPLATES.web!.bundles, '@example/bundle']) - expect(stdout).toHaveBeenLastCalledWith('dsh: enabled @example/bundle in profile test; restart the profile to apply\n') - expect(await runPlugin('test', ['enable', '@example/bundle'])).toBe(0) - expect(stdout).toHaveBeenLastCalledWith('dsh: profile test already has @example/bundle enabled\n') - expect(await runPlugin('test', ['disable', '@example/bundle'])).toBe(0) - expect(bundlesOf(dir)).toEqual(PROFILE_TEMPLATES.web!.bundles) - expect(runPluginCommand).not.toHaveBeenCalled() -}) - -it('initializes a missing profile from the default bundles before enabling', async () => { - const { dir } = fixture() - mkdirSync(join(dir, 'node_modules'), { recursive: true }) - installPackage(dir, '@example/bundle', { dsh: { bundle: { patch: './cordis.patch.yml' } } }) - expect(await runPlugin('test', ['enable', '@example/bundle'])).toBe(0) - expect(bundlesOf(dir)).toEqual(['@deepseek-ai/dsh-base', '@example/bundle']) -}) - -it.each([ - { args: ['enable'], message: 'usage: dsh plugin enable ' }, - { args: ['enable', '@example/absent'], message: "@example/absent is not installed: run 'dsh plugin --profile test add @example/absent'" }, - { args: ['enable', '@example/plain'], message: '@example/plain declares no dsh.bundle' }, - { args: ['enable', '@example/elsewhere'], message: `Bundle supports Host platforms ${process.platform === 'aix' ? 'sunos' : 'aix'}` }, - { args: ['enable', '@example/old'], message: 'is incompatible with dsh' }, - { args: ['disable', '@deepseek-ai/dsh-base'], message: 'bundle of the test profile template and cannot be disabled' }, -])('refuses $args without changing the selection', async ({ args, message }) => { - const { dir, stderr } = fixture() - initProfile(dir, PROFILE_TEMPLATES.web!.bundles) - installPackage(dir, '@example/plain', {}) - installPackage(dir, '@example/elsewhere', { dsh: { bundle: { patch: './cordis.patch.yml', platforms: [process.platform === 'aix' ? 'sunos' : 'aix'] } } }) - installPackage(dir, '@example/old', { dsh: { bundle: { patch: './cordis.patch.yml' } }, engines: { dsh: '^0.0.1' } }) - expect(await runPlugin('test', args)).toBe(1) - expect(stderr.mock.calls.map(call => call[0]).join('')).toContain(message) - expect(bundlesOf(dir)).toEqual(PROFILE_TEMPLATES.web!.bundles) - expect(runPluginCommand).not.toHaveBeenCalled() -}) diff --git a/apps/cli/tests/profiles/cua-mcp/cua-mcp.expected.e2e.ts b/apps/cli/tests/profiles/cua-mcp/cua-mcp.expected.e2e.ts index 5c35518c86..72c05f8984 100644 --- a/apps/cli/tests/profiles/cua-mcp/cua-mcp.expected.e2e.ts +++ b/apps/cli/tests/profiles/cua-mcp/cua-mcp.expected.e2e.ts @@ -1,4 +1,4 @@ -/** The shipped cua-mcp bundle: enabled through the real CLI, serving Computer Use programs over stdio to an MCP client. */ +/** The shipped cua-mcp bundle: the real CLI initializes its declared profile and serves Computer Use programs over stdio. */ import { execFile } from 'node:child_process' import { existsSync } from 'node:fs' import { mkdtemp, readFile, rm } from 'node:fs/promises' @@ -26,7 +26,7 @@ function textOf(block: CallResult['content'][number] | undefined): string { } describe.skipIf(!existsSync(bin))('cua-mcp profile', { retry: 0 }, () => { - it('enables the shipped bundle, prints client configuration, serves programs over stdio, and exits on EOF', async () => { + it('initializes the declared profile on first start, prints client configuration, serves programs over stdio, and exits on EOF', async () => { const temporary = await mkdtemp(join(tmpdir(), 'dsh-cua-mcp-profile-')) const home = join(temporary, 'home') const workspace = join(temporary, 'workspace') @@ -41,13 +41,10 @@ describe.skipIf(!existsSync(bin))('cua-mcp profile', { retry: 0 }, () => { await execFileAsync(process.execPath, ['-e', 'require("node:fs").mkdirSync(process.argv[1], { recursive: true })', workspace]) const options = { cwd: workspace, env, timeout: 120_000, maxBuffer: 4_000_000 } - // One command selects the installation-owned bundle without pnpm or network access. - const enabled = await execFileAsync(process.execPath, [bin, 'plugin', '--profile', 'cua-mcp', 'enable', '@deepseek-ai/dsh-cua-mcp'], options) - expect(enabled.stdout).toBe('dsh: enabled @deepseek-ai/dsh-cua-mcp in profile cua-mcp; restart the profile to apply\n') - const manifest = JSON.parse(await readFile(join(home, 'profiles', 'cua-mcp', 'package.json'), 'utf8')) as { dsh: { profile: { bundles: string[] } } } - expect(manifest.dsh.profile.bundles).toEqual(['@deepseek-ai/dsh-base', '@deepseek-ai/dsh-cua-mcp']) - + // The first start initializes the profile the shipped bundle declares, without pnpm or network access. const printed = await execFileAsync(process.execPath, [bin, '--profile', 'cua-mcp', '--print-client-config', 'codex'], options) + const manifest = JSON.parse(await readFile(join(home, 'profiles', 'cua-mcp', 'package.json'), 'utf8')) as { dsh: { profile: { bundles: string[] } } } + expect(manifest.dsh.profile.bundles).toEqual(['@deepseek-ai/dsh-cua-mcp']) const normalized = printed.stdout .split(JSON.stringify(process.execPath).slice(1, -1)).join('{{node}}') .split(JSON.stringify(bin).slice(1, -1)).join('{{bin}}') @@ -67,7 +64,7 @@ describe.skipIf(!existsSync(bin))('cua-mcp profile', { retry: 0 }, () => { const first = await probe.request('tools/call', { name: 'cua_run_code', arguments: { code: 'globalThis.visits = 1; var app = await cua.getApp("test.fixture"); var win = await app.getWindow(7); ' - + 'await win.click("0"); await win.getScreenshot(); ({ visits, window: win.windowId, pid: process.pid })', + + 'await win.getAccessibilityTree({ emit: false }); await win.click("0"); await win.getScreenshot(); ({ visits, window: win.windowId, pid: process.pid })', } }) as CallResult expect(first.isError).toBeUndefined() expect(first.content.map(block => block.type)).toEqual(['text', 'text', 'text', 'image']) diff --git a/apps/cli/tests/profiles/cua-mcp/expected/codex.toml b/apps/cli/tests/profiles/cua-mcp/expected/codex.toml index 3776d31179..a1613c52f7 100644 --- a/apps/cli/tests/profiles/cua-mcp/expected/codex.toml +++ b/apps/cli/tests/profiles/cua-mcp/expected/codex.toml @@ -1,4 +1,4 @@ -# ~/.codex/config.toml — run once first: dsh plugin --profile cua-mcp enable @deepseek-ai/dsh-cua-mcp +# ~/.codex/config.toml — the first start initializes the profile and prepares the Computer Use helper [mcp_servers.dsh_cua] command = "{{node}}" args = ["{{bin}}", "--profile", "cua-mcp"] diff --git a/apps/cli/tests/profiles/cua-mcp/expected/reference.md b/apps/cli/tests/profiles/cua-mcp/expected/reference.md index 0ff49a0f0a..bf0e811bab 100644 --- a/apps/cli/tests/profiles/cua-mcp/expected/reference.md +++ b/apps/cli/tests/profiles/cua-mcp/expected/reference.md @@ -15,9 +15,9 @@ Setup and discovery: - cua.listApps(options?: { emit?: boolean }) -> { id: string, displayName: string, isRunning: true, pid: number }[] — enumerate running applications. - cua.findApps(query: string, options?: { emit?: boolean }) -> ({ id: string, displayName: string, path: string } & ({ isRunning: true, pid: number } | { isRunning: false }))[] — search installed applications, including stopped matches; only running matches carry pid. - cua.getState(options?: { emit?: boolean }) -> { apps: { id: string, displayName: string, isRunning: true, pid: number }[], browsers: [] } — summarize running applications; this is not an accessibility observation. -- cua.getApp(selector: string) -> App — select an application by name, bundle ID, absolute path, or running PID string, obtain consent, launch in the background if needed, and read initial AX state silently; it does not activate the app. +- cua.getApp(selector: string) -> App — select an application by name, bundle ID, absolute path, or running PID string, obtain consent, launch in the background if needed, and return without reading AX or activating the app. - app.getWindows(options?: { emit?: boolean }) -> { windowId: number, appName: string, title: string, bounds: { x: number, y: number, width: number, height: number }, isOnScreen: boolean, onCurrentSpace: boolean | null }[] — enumerate windows with global native bounds; null onCurrentSpace means unknown Space membership. -- app.getWindow(windowId: number) -> Window — select one window and read its initial AX state silently; do this before any window screenshot or coordinate input. +- app.getWindow(windowId: number) -> Window — select a window by an ID from getWindows without reading AX. Providers reject closed or foreign windows when operating on them. - app.activate() -> ActionResult — request explicit foreground activation; use only when foreground access is required. - app.show() -> { dispatched: boolean, windowId: number | null, foregroundChanged: boolean | null } — unhide the app and restore its selected, focused, main, or sole window without activation. - window.show() -> { dispatched: boolean, windowId: number | null, foregroundChanged: boolean | null } — unhide and restore that explicit window without activation. @@ -25,7 +25,7 @@ Setup and discovery: ## Accessibility tree Available at app or window level depending on the platform. -Element ids are opaque strings from the latest successful tree; the object facade keeps one current snapshot per app across its repeated app and window objects, a new read replaces it, and a failed read invalidates the previous one. Repeated strings can appear for different elements, so do not reuse an old id blindly, and element operations do not fall back to pointer input or typing. +Read getAccessibilityTree explicitly before using element ids. Selection and screenshots do not read or replace the current AX snapshot. Element ids are opaque strings from the latest successful tree; the object facade keeps one current snapshot per app across its repeated app and window objects, a new read replaces it, and a failed read invalidates the previous one. Repeated strings can appear for different elements, so do not reuse an old id blindly, and element operations do not fall back to pointer input or typing. - getAccessibilityTree(options?: { emit?: boolean, includeMenus?: boolean, details?: boolean, maxElements?: number, maxDepth?: number }) -> string — set the node count or depth for one read. Omitted limits use the provider settings. includeMenus expands menu contents and details adds identifiers, native bounds, and complete action names. - listActions(elementId: string) -> string[] — list the actions an element advertises. - invoke(elementId: string) -> ActionResult — invoke the element's default action; dispatched is false when it has none. @@ -34,7 +34,7 @@ Element ids are opaque strings from the latest successful tree; the object facad - selectText(elementId: string, text: string, options?: { prefix?: string, suffix?: string, selectionType?: 'text' | 'cursor_before' | 'cursor_after' }) -> ActionResult — select one literal occurrence or place the cursor beside it, using adjacent context to disambiguate. ## Simulated mouse -Use an explicit window for screenshots and pointer input. +Use an explicit window for screenshots and pointer input. Before coordinate input, including relative coordinates, obtain a successful getAccessibilityTree observation covering that window or take its screenshot. Absolute pixel coordinates require a returned screenshot. - getScreenshot(options?: { emit?: boolean }) -> { bytes: Uint8Array, mimeType: 'image/png' | 'image/jpeg' | 'image/webp' | 'image/gif', pixelWidth: number, pixelHeight: number, windowId: number } — capture the selected window as one encoded image; bytes is a JavaScript byte array, and mimeType identifies its encoding, so do not assume PNG. - mouseMove(target: string | [number, number], options?: { relative?: boolean }) -> { dispatched: boolean, foregroundChanged?: boolean | null, hoverRoute: 'accessibility' | 'system-pointer', systemPointerMoved: boolean } — request a mouse move to the target without pressing a button; inspect hoverRoute and systemPointerMoved, and expect no automatic pointer restoration. - click(target: string | [number, number], options?: { mouseButton?: 'left' | 'right' | 'middle', clickCount?: 1 | 2, modifiers?: ('command' | 'control' | 'option' | 'shift' | 'fn')[], holdMs?: number, relative?: boolean }) -> ActionResult — click an element id or point, or perform a left-button double-click; holdMs controls the press duration of each press. @@ -49,7 +49,7 @@ Available at app or window level depending on the platform. - paste(text: string, options?: { format?: 'text' | 'html' }) -> ActionResult — deliver text or HTML through the app's Paste command, restoring prior clipboard contents unless another writer changes them; a Paste failure is surfaced without substituting typeText, and PASTE_NOT_CONSUMED means inspect before any retry. - pressKey(key: string, modifiers?: string[]) -> ActionResult — press and release one complete keystroke. For example pressKey('Tab', ['shift']) or pressKey('+'). Key and modifier names are platform-defined strings. Pass key and modifiers separately; do not pack them into a chord string. -Raw tools use { method, params }: include appHandle for app calls and windowId for window calls, and use snapshotId with elementId for element routes. The emit option is facade-only: emit is local output control, so raw callers must follow the raw operation schema for admitted params. getAccessibilityTree and getWindow read through raw getState; getWindows maps to listWindows; getScreenshot maps to screenshot; cua.getState maps to listApps; every other named operation uses the same method name. +Raw tools use { method, params }: include appHandle for app calls and windowId for window calls, and use snapshotId with elementId for element routes. The emit option is facade-only: emit is local output control, so raw callers must follow the raw operation schema for admitted params. getAccessibilityTree maps to getState; getWindow has no raw method; getWindows maps to listWindows; getScreenshot maps to screenshot; cua.getState maps to listApps; every other named operation uses the same method name. AX read defaults: maxElements=2000, maxDepth=25. diff --git a/docs/cli-help.md b/docs/cli-help.md index 7e8ba84f25..1cbc117945 100644 --- a/docs/cli-help.md +++ b/docs/cli-help.md @@ -71,8 +71,7 @@ profile directory Arguments: args pnpm arguments, forwarded verbatim (add , remove , - why , ...), or enable|disable to select an - installed bundle without pnpm + why , ...) Options: --profile the profile whose plugins to manage (initialized on first diff --git a/docs/cli-help.zh.md b/docs/cli-help.zh.md index 0ac9a88185..c682e26067 100644 --- a/docs/cli-help.zh.md +++ b/docs/cli-help.zh.md @@ -73,8 +73,7 @@ profile directory Arguments: args pnpm arguments, forwarded verbatim (add , remove , - why , ...), or enable|disable to select an - installed bundle without pnpm + why , ...) Options: --profile the profile whose plugins to manage (initialized on first diff --git a/docs/module-graph.md b/docs/module-graph.md index f7fbe117eb..ccd8d0bbb6 100644 --- a/docs/module-graph.md +++ b/docs/module-graph.md @@ -528,6 +528,8 @@ flowchart TD pkg_hmr --> pkg_cmdline pkg_authorization --> pkg_credentials pkg_authorization --> pkg_llm + pkg_cua_mcp --> pkg_app_boot + pkg_cua_mcp --> pkg_attachment pkg_experimental_computer_use_cua_driver_mcp --> pkg_computer_use pkg_experimental_forge_github --> pkg_experimental_forge pkg_experimental_forge_github --> pkg_subprocess @@ -959,11 +961,6 @@ flowchart TD pkg_creation_recommendations --> pkg_session pkg_creation_recommendations --> pkg_skill pkg_creation_recommendations --> pkg_tools - pkg_cua_mcp --> pkg_agent - pkg_cua_mcp --> pkg_app_boot - pkg_cua_mcp --> pkg_attachment - pkg_cua_mcp --> pkg_system_prompt - pkg_cua_mcp --> pkg_tools pkg_experimental_browser_use_chrome_devtools_mcp --> pkg_agent pkg_experimental_browser_use_chrome_devtools_mcp --> pkg_browser_use pkg_experimental_browser_use_chrome_devtools_mcp --> pkg_system_prompt @@ -1730,6 +1727,7 @@ flowchart TD | [`attachment-local`](../packages/attachment/attachment-local) | `attachment` | [`attachment`](../packages/attachment/attachment), [`home-paths`](../packages/util/home-paths) | | [`hmr`](../packages/boot/hmr) | `boot` | [`app-boot`](../packages/boot/app-boot), [`cmdline`](../packages/boot/cmdline) | | [`authorization`](../packages/credentials/authorization) | `credentials` | [`credentials`](../packages/credentials/credentials), [`llm`](../packages/llm/llm) | +| [`cua-mcp`](../packages/experimental/cua-mcp) | `experimental` | [`app-boot`](../packages/boot/app-boot), [`attachment`](../packages/attachment/attachment) | | [`experimental-computer-use-cua-driver-mcp`](../packages/experimental/computer-use-cua-driver-mcp) | `experimental` | [`computer-use`](../packages/computer-use/computer-use) | | [`experimental-forge-github`](../packages/experimental/forge-github) | `experimental` | [`experimental-forge`](../packages/experimental/forge), [`subprocess`](../packages/subprocess/subprocess) | | [`experimental-webworker-runtime`](../packages/experimental/webworker-runtime) | `experimental` | [`client-connection`](../packages/client/connection), [`client-modules`](../packages/client/modules), [`host-webserver`](../packages/host/webserver) | @@ -1838,7 +1836,6 @@ flowchart TD | [`workspace-changes`](../packages/deliverables/workspace-changes) | `deliverables` | [`agent`](../packages/core/agent), [`fs`](../packages/fs/fs), [`session`](../packages/core/session), [`subprocess`](../packages/subprocess/subprocess), [`tools`](../packages/core/tools) | | [`action-cards`](../packages/experimental/action-cards) | `experimental` | [`llm`](../packages/llm/llm), [`session`](../packages/core/session), [`tools`](../packages/core/tools), [`typert-protocol`](../packages/typert/protocol) | | [`creation-recommendations`](../packages/experimental/creation-recommendations) | `experimental` | [`llm`](../packages/llm/llm), [`session`](../packages/core/session), [`skill`](../packages/skill/skill), [`tools`](../packages/core/tools) | -| [`cua-mcp`](../packages/experimental/cua-mcp) | `experimental` | [`agent`](../packages/core/agent), [`app-boot`](../packages/boot/app-boot), [`attachment`](../packages/attachment/attachment), [`system-prompt`](../packages/core/system-prompt), [`tools`](../packages/core/tools) | | [`experimental-browser-use-chrome-devtools-mcp`](../packages/experimental/browser-use-chrome-devtools-mcp) | `experimental` | [`agent`](../packages/core/agent), [`browser-use`](../packages/browser-use/browser-use), [`system-prompt`](../packages/core/system-prompt), [`tools`](../packages/core/tools), [`working-directory`](../packages/session/working-directory) | | [`experimental-browser-use-playwright-mcp`](../packages/experimental/browser-use-playwright-mcp) | `experimental` | [`agent`](../packages/core/agent), [`browser-use`](../packages/browser-use/browser-use), [`system-prompt`](../packages/core/system-prompt), [`tools`](../packages/core/tools), [`working-directory`](../packages/session/working-directory) | | [`experimental-browser-use-stagehand-native`](../packages/experimental/browser-use-stagehand-native) | `experimental` | [`agent`](../packages/core/agent), [`browser-use`](../packages/browser-use/browser-use), [`system-prompt`](../packages/core/system-prompt), [`tools`](../packages/core/tools) | diff --git a/docs/module-graph.zh.md b/docs/module-graph.zh.md index 95c503b21b..79f2858b58 100644 --- a/docs/module-graph.zh.md +++ b/docs/module-graph.zh.md @@ -530,6 +530,8 @@ flowchart TD pkg_hmr --> pkg_cmdline pkg_authorization --> pkg_credentials pkg_authorization --> pkg_llm + pkg_cua_mcp --> pkg_app_boot + pkg_cua_mcp --> pkg_attachment pkg_experimental_computer_use_cua_driver_mcp --> pkg_computer_use pkg_experimental_forge_github --> pkg_experimental_forge pkg_experimental_forge_github --> pkg_subprocess @@ -961,11 +963,6 @@ flowchart TD pkg_creation_recommendations --> pkg_session pkg_creation_recommendations --> pkg_skill pkg_creation_recommendations --> pkg_tools - pkg_cua_mcp --> pkg_agent - pkg_cua_mcp --> pkg_app_boot - pkg_cua_mcp --> pkg_attachment - pkg_cua_mcp --> pkg_system_prompt - pkg_cua_mcp --> pkg_tools pkg_experimental_browser_use_chrome_devtools_mcp --> pkg_agent pkg_experimental_browser_use_chrome_devtools_mcp --> pkg_browser_use pkg_experimental_browser_use_chrome_devtools_mcp --> pkg_system_prompt @@ -1732,6 +1729,7 @@ flowchart TD | [`attachment-local`](../packages/attachment/attachment-local) | `attachment` | [`attachment`](../packages/attachment/attachment), [`home-paths`](../packages/util/home-paths) | | [`hmr`](../packages/boot/hmr) | `boot` | [`app-boot`](../packages/boot/app-boot), [`cmdline`](../packages/boot/cmdline) | | [`authorization`](../packages/credentials/authorization) | `credentials` | [`credentials`](../packages/credentials/credentials), [`llm`](../packages/llm/llm) | +| [`cua-mcp`](../packages/experimental/cua-mcp) | `experimental` | [`app-boot`](../packages/boot/app-boot), [`attachment`](../packages/attachment/attachment) | | [`experimental-computer-use-cua-driver-mcp`](../packages/experimental/computer-use-cua-driver-mcp) | `experimental` | [`computer-use`](../packages/computer-use/computer-use) | | [`experimental-forge-github`](../packages/experimental/forge-github) | `experimental` | [`experimental-forge`](../packages/experimental/forge), [`subprocess`](../packages/subprocess/subprocess) | | [`experimental-webworker-runtime`](../packages/experimental/webworker-runtime) | `experimental` | [`client-connection`](../packages/client/connection), [`client-modules`](../packages/client/modules), [`host-webserver`](../packages/host/webserver) | @@ -1840,7 +1838,6 @@ flowchart TD | [`workspace-changes`](../packages/deliverables/workspace-changes) | `deliverables` | [`agent`](../packages/core/agent), [`fs`](../packages/fs/fs), [`session`](../packages/core/session), [`subprocess`](../packages/subprocess/subprocess), [`tools`](../packages/core/tools) | | [`action-cards`](../packages/experimental/action-cards) | `experimental` | [`llm`](../packages/llm/llm), [`session`](../packages/core/session), [`tools`](../packages/core/tools), [`typert-protocol`](../packages/typert/protocol) | | [`creation-recommendations`](../packages/experimental/creation-recommendations) | `experimental` | [`llm`](../packages/llm/llm), [`session`](../packages/core/session), [`skill`](../packages/skill/skill), [`tools`](../packages/core/tools) | -| [`cua-mcp`](../packages/experimental/cua-mcp) | `experimental` | [`agent`](../packages/core/agent), [`app-boot`](../packages/boot/app-boot), [`attachment`](../packages/attachment/attachment), [`system-prompt`](../packages/core/system-prompt), [`tools`](../packages/core/tools) | | [`experimental-browser-use-chrome-devtools-mcp`](../packages/experimental/browser-use-chrome-devtools-mcp) | `experimental` | [`agent`](../packages/core/agent), [`browser-use`](../packages/browser-use/browser-use), [`system-prompt`](../packages/core/system-prompt), [`tools`](../packages/core/tools), [`working-directory`](../packages/session/working-directory) | | [`experimental-browser-use-playwright-mcp`](../packages/experimental/browser-use-playwright-mcp) | `experimental` | [`agent`](../packages/core/agent), [`browser-use`](../packages/browser-use/browser-use), [`system-prompt`](../packages/core/system-prompt), [`tools`](../packages/core/tools), [`working-directory`](../packages/session/working-directory) | | [`experimental-browser-use-stagehand-native`](../packages/experimental/browser-use-stagehand-native) | `experimental` | [`agent`](../packages/core/agent), [`browser-use`](../packages/browser-use/browser-use), [`system-prompt`](../packages/core/system-prompt), [`tools`](../packages/core/tools) | diff --git a/docs/subsystems/computer-use.i18n.yaml b/docs/subsystems/computer-use.i18n.yaml index 642573ebc8..8d644c6906 100644 --- a/docs/subsystems/computer-use.i18n.yaml +++ b/docs/subsystems/computer-use.i18n.yaml @@ -6,8 +6,8 @@ en: e02a2e4cc9970cba zh: 29aac6c0530a582f /computer-use/serve-computer-use-to-another-harness: - en: a2beb91957e93f87 - zh: cf2a96b0fae0aae4 + en: 5c932fde2a8839f4 + zh: 8b753a0e382f5941 /computer-use/choose-a-provider: en: fa2e0d7b41c0450b zh: af9a799711f901e6 diff --git a/docs/subsystems/computer-use.md b/docs/subsystems/computer-use.md index e95f0b1d3c..e2287cac7f 100644 --- a/docs/subsystems/computer-use.md +++ b/docs/subsystems/computer-use.md @@ -21,7 +21,7 @@ The [shared object API](../../packages/experimental/cua/README.md) uses `connect ## Serve Computer Use to another harness -[Computer use MCP server](../../packages/experimental/cua-mcp/README.md) is a shipped optional bundle for the `cua-mcp` profile. `dsh --profile cua-mcp` serves `cua_run_code` and `cua_reset` to one MCP client such as Codex or Claude Code; each connection owns one Agent whose programs retain application and window objects, and consent is granted unattended or forwarded to the client as an elicitation. `dsh --profile cua-mcp --print-client-config codex|claude-code|json` prints the client configuration. The profile runs no model turn and records no root tool calls in its Session. +[Computer use MCP server](../../packages/experimental/cua-mcp/README.md) is a shipped optional bundle that composes the standalone `cua-mcp` profile; the first `dsh --profile cua-mcp` initializes it. `dsh --profile cua-mcp` serves `cua_run_code` and `cua_reset` to one MCP client such as Codex or Claude Code; each connection owns one Agent whose programs retain application and window objects, and consent is granted unattended or forwarded to the client as an elicitation. `dsh --profile cua-mcp --print-client-config codex|claude-code|json` prints the client configuration. The profile runs no model turn and records no root tool calls in its Session. ## Choose a provider diff --git a/docs/subsystems/computer-use.zh.md b/docs/subsystems/computer-use.zh.md index 82d260fd66..7ff9771273 100644 --- a/docs/subsystems/computer-use.zh.md +++ b/docs/subsystems/computer-use.zh.md @@ -21,7 +21,7 @@ CUA provider 通过 `ctx.cuaAccess` 提供系统权限状态、用户主动申 ## 向其他 harness 提供 Computer Use -[Computer Use MCP 服务器](../../packages/experimental/cua-mcp/README.zh.md)是随安装提供的可选组合包,服务于 `cua-mcp` profile。`dsh --profile cua-mcp` 向一个 MCP 客户端(如 Codex 或 Claude Code)提供 `cua_run_code` 和 `cua_reset`;每个连接拥有一个 Agent,其程序保留应用与窗口对象,授权可无人值守放行或作为 elicitation 转发给客户端。`dsh --profile cua-mcp --print-client-config codex|claude-code|json` 打印客户端配置。该 profile 不运行模型回合,其 Session 中不记录根工具调用。 +[Computer Use MCP 服务器](../../packages/experimental/cua-mcp/README.zh.md)是随安装提供的可选组合包,独立组成 `cua-mcp` profile;首次 `dsh --profile cua-mcp` 即初始化该 profile。`dsh --profile cua-mcp` 向一个 MCP 客户端(如 Codex 或 Claude Code)提供 `cua_run_code` 和 `cua_reset`;每个连接拥有一个 Agent,其程序保留应用与窗口对象,授权可无人值守放行或作为 elicitation 转发给客户端。`dsh --profile cua-mcp --print-client-config codex|claude-code|json` 打印客户端配置。该 profile 不运行模型回合,其 Session 中不记录根工具调用。 ## 选择提供方 diff --git a/packages/boot/app-boot/README.i18n.yaml b/packages/boot/app-boot/README.i18n.yaml index a9a757958a..cf93e3a3af 100644 --- a/packages/boot/app-boot/README.i18n.yaml +++ b/packages/boot/app-boot/README.i18n.yaml @@ -24,8 +24,8 @@ en: 964aafe2cb5bc898 zh: fda067dd80664a30 /deepseek-ai-dsh-app-boot/use-this-package/profiles: - en: 781fe487a973ee6f - zh: e95188274f75f9ad + en: 429a2e3a7ace95ea + zh: 2e747341f0cc08fe /deepseek-ai-dsh-app-boot/use-this-package/previewing-the-effective-configuration: en: 646a0ccdd7881ad1 zh: e3696acb1573dd7b diff --git a/packages/boot/app-boot/README.md b/packages/boot/app-boot/README.md index 9d926cfbcc..4ac257328c 100644 --- a/packages/boot/app-boot/README.md +++ b/packages/boot/app-boot/README.md @@ -49,7 +49,7 @@ const ctx = await boot('dsh', resolveConfigPath(argv[2], process.env.DSH_SNAPSHO Import profile and bundle declaration types from [`@deepseek-ai/dsh-package-manifest`](../../util/package-manifest/README.md). App-boot adapts `DshPackageManifest` to `ProfileManifest` with optional package identity because local profiles need no published version. App-boot owns profile loading, JSON validation, and resolved runtime data. -A profile is how one dsh installation ships different app surfaces: `web`, `headless`, `acp`, `sdk`, and `sdk-minimal` start distinct compositions from the same launcher. A profile lives at `$DSH_HOME/profiles/` and combines installable bundles with its own `cordis.patch.yml`. A bundle's `dsh.bundle.patch` names one patch file or an ordered list of files; `bundlePatchFiles` validates the declaration and `bundlePatchPaths` resolves it to absolute paths; the layer concatenates their patch lists in that order. The YAML composition enables or disables HMR. The shipped `web` template uses live reload, while the other shipped templates apply patches only at startup. `sdk-minimal` names only its standalone bundle; the other templates retain base-plus-mode stacks. `dsh --profile --from-default-profile