forked from cflmy/deepseek-harness
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.
This commit is contained in:
1 parent
6ebf030579
commit
3147ec1596
41 files changed
+385
-343
No files matched your search
@@ -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
|
||||
@@ -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.
|
||||
@@ -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 包变化。
|
||||
@@ -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
|
||||
|
||||
@@ -84,8 +84,6 @@ New directories and files request modes `0700` and `0600` on POSIX. The CLI prin
|
||||
|
||||
`dsh plugin --profile <name> <args...>` initializes the profile when missing (shipped template, or `@deepseek-ai/dsh-base` alone for other names), then forwards `<args...>` 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 <name> enable <bundle...>` and `disable <bundle...>` 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 <name>` 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 <selector>` 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:
|
||||
|
||||
@@ -84,8 +84,6 @@ dsh --profile web --patch ./extra.yml --dump-config
|
||||
|
||||
`dsh plugin --profile <name> <args...>` 在 profile 缺失时先初始化它(有随附模板的用模板,其他名称只装 `@deepseek-ai/dsh-base`),然后以 profile 目录为工作目录,把 `<args...>` 转发给 `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 <name> enable <bundle...>` 与 `disable <bundle...>` 只修改 `dsh.profile.bundles`,不运行 pnpm。`enable` 在平台声明和版本兼容性检查通过后,选择安装自带的组合包(例如[可选组合包](../../../packages/util/official-bundles/README.zh.md))或 profile 已安装的组合包;`disable` 取消选择。两者都拒绝 profile 随附模板中的组合包,会先初始化缺失的 profile 并打印变更;正在运行的 profile 在重启后应用。
|
||||
|
||||
`dsh plugin` 只在被转发的参数之前读取 `--profile`;被转发的参数从它无法识别的第一个 token 开始,因此 `--profile <name>` 必须写在最前面。被转发的参数以 pnpm 命令开头时,该命令之后的所有内容都会原样交给 pnpm,包括 `-h` 和 `--help`。被转发的参数以 `--filter <selector>` 或 `-r` 等 pnpm 选项开头时,后面的 `-h` 或 `--help` 仍会打印转发器的帮助而不是 pnpm 的帮助,因此要查看 pnpm 的帮助,需把 pnpm 命令写在它们之前。在任何被转发的参数之前出现的 `-h` 或 `--help` 会打印转发器自身的帮助并以 0 退出。
|
||||
|
||||
Codex 与 Claude Code subagent 提供方是两个彼此独立的可选组合包。可以只添加一个包、在同一命令中添加两个包,或独立移除任一包:
|
||||
|
||||
@@ -193,7 +193,7 @@ export function parseDshArgs(argv: readonly string[], version: string, manageDes
|
||||
.passThroughOptions()
|
||||
.requiredOption('--profile <name>', 'the profile whose plugins to manage (initialized on first use)', selectProfile)
|
||||
.allowUnknownOption()
|
||||
.argument('[args...]', 'pnpm arguments, forwarded verbatim (add <pkg>, remove <pkg>, why <pkg>, ...), or enable|disable <bundle> to select an installed bundle without pnpm')
|
||||
.argument('[args...]', 'pnpm arguments, forwarded verbatim (add <pkg>, remove <pkg>, why <pkg>, ...)')
|
||||
.action((args: string[], options: { profile: string }) => {
|
||||
if (options.profile === '') program.error('error: --profile needs a name')
|
||||
if (!manageDesktopProfile) rejectElectronProfile(plugin, options.profile)
|
||||
|
||||
+6
-64
@@ -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<number | undefined> {
|
||||
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} <bundle...>`)
|
||||
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<typeof bundleManifest>
|
||||
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`)
|
||||
|
||||
@@ -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<string, unknown>): 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 <bundle...>' },
|
||||
{ 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()
|
||||
})
|
||||
@@ -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'])
|
||||
|
||||
@@ -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"]
|
||||
|
||||
@@ -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.
|
||||
|
||||
|
||||
+1
-2
@@ -71,8 +71,7 @@ profile directory
|
||||
|
||||
Arguments:
|
||||
args pnpm arguments, forwarded verbatim (add <pkg>, remove <pkg>,
|
||||
why <pkg>, ...), or enable|disable <bundle> to select an
|
||||
installed bundle without pnpm
|
||||
why <pkg>, ...)
|
||||
|
||||
Options:
|
||||
--profile <name> the profile whose plugins to manage (initialized on first
|
||||
|
||||
+1
-2
@@ -73,8 +73,7 @@ profile directory
|
||||
|
||||
Arguments:
|
||||
args pnpm arguments, forwarded verbatim (add <pkg>, remove <pkg>,
|
||||
why <pkg>, ...), or enable|disable <bundle> to select an
|
||||
installed bundle without pnpm
|
||||
why <pkg>, ...)
|
||||
|
||||
Options:
|
||||
--profile <name> the profile whose plugins to manage (initialized on first
|
||||
|
||||
@@ -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) |
|
||||
|
||||
@@ -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) |
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -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 中不记录根工具调用。
|
||||
|
||||
## 选择提供方
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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/<name>` 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 <name> --from-default-profile <template>` creates or replaces a custom profile at a non-shipped name from one shipped template, while `dsh plugin` initializes a base-backed profile and manages its installed bundles. Bundle resolution, manifest, and patch-loading failures skip that bundle without changing its selection; the loaded profile lists each skip in `skippedBundles`, and the launcher prints them once per start with `reportSkippedBundles`. Remaining bundles keep their order; profile and user-patch errors still fail startup. Skipping a bundle does not guarantee that the remaining composition can provide the required services. Application-owned npm projects, such as Electron's reserved Desktop profile, use `loadProfileDirectory` to load an already initialized directory without exposing it through CLI profile lookup.
|
||||
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/<name>` 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. A shipped optional bundle can declare a standalone profile of its own through `dsh.bundle.profile`; `shippedProfileTemplate` resolves a missing profile name to the shipped template or to that single bundle, and `loadProfile` and `dsh plugin` initialize from it. `dsh --profile <name> --from-default-profile <template>` creates or replaces a custom profile at a non-shipped name from one shipped template, while `dsh plugin` initializes a base-backed profile and manages its installed bundles. Bundle resolution, manifest, and patch-loading failures skip that bundle without changing its selection; the loaded profile lists each skip in `skippedBundles`, and the launcher prints them once per start with `reportSkippedBundles`. Remaining bundles keep their order; profile and user-patch errors still fail startup. Skipping a bundle does not guarantee that the remaining composition can provide the required services. Application-owned npm projects, such as Electron's reserved Desktop profile, use `loadProfileDirectory` to load an already initialized directory without exposing it through CLI profile lookup.
|
||||
|
||||
Before a profile imports a plugin, DSH checks its declared DSH requirement against the single runtime version returned by `getDshRuntimeVersion()`. When the manifest declares `engines.dsh`, that range alone decides and `peerDependencies` are ignored. Otherwise every `peerDependencies` range on `@deepseek-ai/dsh` and `@deepseek-ai/dsh-*` must match, and source-workspace `workspace:^`, `workspace:~`, and `workspace:*` peers refer to that same runtime. Prereleases participate in range matching. A manifest with neither declaration imposes no constraint; empty or invalid ranges, including a `workspace:` value in `engines.dsh`, are incompatible. A non-object `engines` or a non-string `engines.dsh` is a malformed manifest. A refusal names the unmet requirements, keyed `engines.dsh` or by peer package name. These checks are not a sandbox against malicious package code.
|
||||
|
||||
|
||||
@@ -49,7 +49,7 @@ const ctx = await boot('dsh', resolveConfigPath(argv[2], process.env.DSH_SNAPSHO
|
||||
|
||||
Profile 与组合包的声明类型从 [`@deepseek-ai/dsh-package-manifest`](../../util/package-manifest/README.zh.md) 导入。App-boot 将 `DshPackageManifest` 适配为包身份可选的 `ProfileManifest`,因为本地 profile 无需发布版本。App-boot 负责 profile 加载、JSON 校验和解析后的运行时数据。
|
||||
|
||||
profile 是同一套 dsh 安装提供不同应用界面的方式:`web`、`headless`、`acp`、`sdk` 与 `sdk-minimal` 从同一 launcher 启动不同组合。profile 位于 `$DSH_HOME/profiles/<name>`,由可安装组合包和自身 `cordis.patch.yml` 组成。组合包的 `dsh.bundle.patch` 指定一个 patch 文件或一个有序的文件列表;`bundlePatchFiles` 校验该声明,`bundlePatchPaths` 把它解析为绝对路径;该层按此顺序拼接各文件的 patch 列表。YAML 组合决定是否启用 HMR。随产品交付的 `web` 模板实时重载,其他随附模板只在启动时应用 patch。`sdk-minimal` 只列出自身的独立组合包,其他模板保留 base 加模式的组合包栈。`dsh --profile <name> --from-default-profile <template>` 从一个随附模板,在非内置名称处创建或替换自定义 profile;`dsh plugin` 则初始化以 base 为基础的 profile,并管理其中安装的组合包。组合包解析、manifest 读取或 patch 加载失败时会跳过该组合包,不改变其选择状态;加载结果在 `skippedBundles` 中列出每个被跳过的组合包,启动器每次启动时通过 `reportSkippedBundles` 输出一次。其余组合包保持原顺序;profile 和用户 patch 错误仍会导致启动失败。跳过组合包不保证剩余组合能够提供所需服务。由应用持有的 npm 项目(例如 Electron 保留的 Desktop profile)通过 `loadProfileDirectory` 加载已经初始化的目录,而不会将它暴露给 CLI profile 查找。
|
||||
profile 是同一套 dsh 安装提供不同应用界面的方式:`web`、`headless`、`acp`、`sdk` 与 `sdk-minimal` 从同一 launcher 启动不同组合。profile 位于 `$DSH_HOME/profiles/<name>`,由可安装组合包和自身 `cordis.patch.yml` 组成。组合包的 `dsh.bundle.patch` 指定一个 patch 文件或一个有序的文件列表;`bundlePatchFiles` 校验该声明,`bundlePatchPaths` 把它解析为绝对路径;该层按此顺序拼接各文件的 patch 列表。YAML 组合决定是否启用 HMR。随产品交付的 `web` 模板实时重载,其他随附模板只在启动时应用 patch。`sdk-minimal` 只列出自身的独立组合包,其他模板保留 base 加模式的组合包栈。随附的可选组合包可以通过 `dsh.bundle.profile` 声明自己的独立 profile;`shippedProfileTemplate` 把缺失的 profile 名称解析为随附模板或这一个组合包,`loadProfile` 和 `dsh plugin` 据此初始化。`dsh --profile <name> --from-default-profile <template>` 从一个随附模板,在非内置名称处创建或替换自定义 profile;`dsh plugin` 则初始化以 base 为基础的 profile,并管理其中安装的组合包。组合包解析、manifest 读取或 patch 加载失败时会跳过该组合包,不改变其选择状态;加载结果在 `skippedBundles` 中列出每个被跳过的组合包,启动器每次启动时通过 `reportSkippedBundles` 输出一次。其余组合包保持原顺序;profile 和用户 patch 错误仍会导致启动失败。跳过组合包不保证剩余组合能够提供所需服务。由应用持有的 npm 项目(例如 Electron 保留的 Desktop profile)通过 `loadProfileDirectory` 加载已经初始化的目录,而不会将它暴露给 CLI profile 查找。
|
||||
|
||||
profile 导入插件前,DSH 会将其声明的 DSH 版本要求与 `getDshRuntimeVersion()` 返回的唯一运行时版本比较。清单声明了 `engines.dsh` 时,只由该范围决定,忽略 `peerDependencies`。否则 `peerDependencies` 中对 `@deepseek-ai/dsh` 和 `@deepseek-ai/dsh-*` 的每个范围都必须匹配,源码工作区的 `workspace:^`、`workspace:~` 和 `workspace:*` peer 指向同一个运行时。预发布版本参与范围匹配。两者都未声明时不施加版本约束;空范围或无效范围视为不兼容,`engines.dsh` 中的 `workspace:` 值也属于无效范围。`engines` 不是对象或 `engines.dsh` 不是字符串时,清单视为格式错误。拒绝结果会列出未满足的要求,键为 `engines.dsh` 或 peer 包名。这些检查不是防范恶意包代码的沙箱。
|
||||
|
||||
|
||||
@@ -63,6 +63,7 @@ export {
|
||||
ProfileRuntimeResolution,
|
||||
bundlePatchFiles,
|
||||
bundlePatchPaths,
|
||||
bundleProfileName,
|
||||
initProfile,
|
||||
removeLinkProjections,
|
||||
loadProfile,
|
||||
@@ -73,6 +74,7 @@ export {
|
||||
reportSkippedBundles,
|
||||
resolveBundleDir,
|
||||
resolveProfileDir,
|
||||
shippedProfileTemplate,
|
||||
writeProfileManifest,
|
||||
type Profile,
|
||||
type ProfileLayer,
|
||||
|
||||
@@ -28,7 +28,7 @@ import type { EntryOptions } from '@deepseek-ai/cordis-plugin-loader'
|
||||
import { applyEntryPatches, type PatchOptions } from '@deepseek-ai/cordis-plugin-include'
|
||||
import { resolveDshHome } from '@deepseek-ai/dsh-home-paths'
|
||||
import type { DshBundleManifest, DshPackageManifest } from '@deepseek-ai/dsh-package-manifest'
|
||||
import { INSTALLATION_OWNED_PROFILE_TUPLES, PROFILE_TEMPLATES, RETIRED_BUNDLES } from '@deepseek-ai/dsh-official-bundles'
|
||||
import { INSTALLATION_OWNED_PROFILE_TUPLES, OPTIONAL_BUNDLES, PROFILE_TEMPLATES, RETIRED_BUNDLES } from '@deepseek-ai/dsh-official-bundles'
|
||||
import { assertBundlePlatform } from './bundle-platform.ts'
|
||||
import { evaluatePluginCompatibility, pluginCompatibilityWarning } from './plugin-compatibility.ts'
|
||||
import { readProfileVersionExemptions } from './profile-compatibility.ts'
|
||||
@@ -59,6 +59,46 @@ export function bundlePatchFiles(bundle: DshBundleManifest): string[] {
|
||||
return declared
|
||||
}
|
||||
|
||||
/**
|
||||
* Validate a bundle's standalone profile declaration.
|
||||
* @param bundle - the bundle's `dsh.bundle` declaration, as read from package.json.
|
||||
* @returns the profile name this bundle alone composes, or undefined when it declares none.
|
||||
* @throws {Error} when `profile` is present but not a nonempty string.
|
||||
*/
|
||||
export function bundleProfileName(bundle: DshBundleManifest): string | undefined {
|
||||
if (bundle.profile === undefined) return undefined
|
||||
if (typeof bundle.profile !== 'string' || bundle.profile === '') throw new Error('dsh.bundle.profile must be a nonempty profile name')
|
||||
return bundle.profile
|
||||
}
|
||||
|
||||
/**
|
||||
* The bundle layers a missing profile initializes with: the shipped template of that name, otherwise the one
|
||||
* installation-shipped optional bundle whose `dsh.bundle.profile` names it. A profile a bundle declares is opened
|
||||
* only by name, so it stays out of the default product.
|
||||
* @param binName - the diagnostic prefix on thrown errors.
|
||||
* @param name - the profile name.
|
||||
* @param installAnchor - absolute path of the owning dsh app's package.json.
|
||||
* @param profileDir - the profile directory being initialized; a bundle the installation lacks may resolve there.
|
||||
* @returns the ordered bundle list, or undefined when nothing shipped declares a profile of that name.
|
||||
* @throws {Error} when a shipped optional bundle cannot be resolved, several declare the same profile name, or a
|
||||
* declaration is invalid.
|
||||
*/
|
||||
export function shippedProfileTemplate(
|
||||
binName: string, name: string, installAnchor: string, profileDir: string,
|
||||
): readonly string[] | undefined {
|
||||
const template = PROFILE_TEMPLATES[name]
|
||||
if (template !== undefined) return template.bundles
|
||||
const declaring = OPTIONAL_BUNDLES.filter((packageName) => {
|
||||
const bundle = readProfileManifest(binName, resolveBundleDir(binName, packageName, installAnchor, profileDir)).dsh?.bundle
|
||||
return bundle !== undefined && bundleProfileName(bundle) === name
|
||||
})
|
||||
if (declaring.length > 1) {
|
||||
throw new Error(`${binName}: profile ${JSON.stringify(name)} is declared by several shipped bundles: ${declaring.join(', ')}`)
|
||||
}
|
||||
const [single] = declaring
|
||||
return single === undefined ? undefined : [single]
|
||||
}
|
||||
|
||||
/**
|
||||
* Resolve a bundle declaration to its ordered absolute patch files.
|
||||
* @param packageDir - absolute directory of the bundle package.
|
||||
@@ -731,13 +771,13 @@ export function loadProfile(
|
||||
): Profile {
|
||||
const dir = resolveProfileDir(name, home)
|
||||
if (!existsSync(join(dir, 'package.json'))) {
|
||||
const template = PROFILE_TEMPLATES[name]
|
||||
if (template === undefined) {
|
||||
const bundles = shippedProfileTemplate(binName, name, installAnchor, dir)
|
||||
if (bundles === undefined) {
|
||||
throw new Error(
|
||||
`${binName}: profile ${JSON.stringify(name)} does not exist; create it with 'dsh plugin --profile ${name} add <package>'`,
|
||||
)
|
||||
}
|
||||
initProfile(dir, template.bundles)
|
||||
initProfile(dir, bundles)
|
||||
}
|
||||
removeLinkProjections(dir)
|
||||
normalizeShippedProfile(name, dir, readProfileManifest(binName, dir))
|
||||
|
||||
@@ -17,7 +17,9 @@ import {
|
||||
createRuntimeResolution,
|
||||
getDshRuntimeVersion,
|
||||
initProfile,
|
||||
bundleProfileName,
|
||||
loadProfile,
|
||||
shippedProfileTemplate,
|
||||
loadProfileDirectory,
|
||||
PROFILE_COMPATIBILITY_FILENAME,
|
||||
PROFILE_PATCH_FILENAME,
|
||||
@@ -31,7 +33,7 @@ import {
|
||||
type Profile,
|
||||
type RuntimeResolution,
|
||||
} from '../src/index.ts'
|
||||
import { PROFILE_TEMPLATES } from '@deepseek-ai/dsh-official-bundles'
|
||||
import { OPTIONAL_BUNDLES, PROFILE_TEMPLATES } from '@deepseek-ai/dsh-official-bundles'
|
||||
import { installRuntimeInterception } from '../src/profile-resolution/resolver.ts'
|
||||
|
||||
const tempRoots: string[] = []
|
||||
@@ -47,7 +49,7 @@ const tmp = (): string => {
|
||||
|
||||
/** Stage a fake installed app: package.json with deps and a node_modules holding bundles. */
|
||||
function stageInstallation(
|
||||
bundles: Record<string, { patch?: string; deps?: Record<string, string>; platforms?: string[] }>,
|
||||
bundles: Record<string, { patch?: string; deps?: Record<string, string>; platforms?: string[]; profile?: unknown }>,
|
||||
appName = 'dsh-app',
|
||||
): string {
|
||||
const root = tmp()
|
||||
@@ -64,7 +66,11 @@ function stageInstallation(
|
||||
type: 'module',
|
||||
main: './index.js',
|
||||
dependencies: spec.deps ?? {},
|
||||
...spec.patch === undefined ? {} : { dsh: { bundle: { patch: './cordis.patch.yml', ...spec.platforms === undefined ? {} : { platforms: spec.platforms } } } },
|
||||
...spec.patch === undefined ? {} : { dsh: { bundle: {
|
||||
patch: './cordis.patch.yml',
|
||||
...spec.platforms === undefined ? {} : { platforms: spec.platforms },
|
||||
...spec.profile === undefined ? {} : { profile: spec.profile },
|
||||
} } },
|
||||
}))
|
||||
writeFileSync(join(dir, 'index.js'), `export const packageName = ${JSON.stringify(name)}\n`)
|
||||
if (spec.patch !== undefined) writeFileSync(join(dir, 'cordis.patch.yml'), spec.patch)
|
||||
@@ -364,6 +370,28 @@ describe('loadProfile', () => {
|
||||
.toEqual([...PROFILE_TEMPLATES.web?.bundles ?? []])
|
||||
})
|
||||
|
||||
it('initializes a profile that one shipped optional bundle declares, and only that one', () => {
|
||||
const [shipped, other] = OPTIONAL_BUNDLES
|
||||
const anchor = stageInstallation({
|
||||
[shipped!]: { patch: '- insert: []\n', profile: 'standalone' },
|
||||
[other!]: {},
|
||||
'not-shipped': { patch: '- insert: []\n', profile: 'unlisted' },
|
||||
})
|
||||
const home = tmp()
|
||||
const profileDir = (profile: string) => resolveProfileDir(profile, home)
|
||||
expect(shippedProfileTemplate('t', 'standalone', anchor, profileDir('standalone'))).toEqual([shipped])
|
||||
expect(shippedProfileTemplate('t', 'unlisted', anchor, profileDir('unlisted'))).toBeUndefined()
|
||||
expect(shippedProfileTemplate('t', 'web', anchor, profileDir('web'))).toEqual(PROFILE_TEMPLATES.web?.bundles)
|
||||
loadProfile('t', 'standalone', anchor, home)
|
||||
expect(readProfileManifest('t', resolveProfileDir('standalone', home)).dsh?.profile?.bundles).toEqual([shipped])
|
||||
expect(() => loadProfile('t', 'unlisted', anchor, home)).toThrow('profile "unlisted" does not exist')
|
||||
const duplicated = stageInstallation({ [shipped!]: { patch: '- insert: []\n', profile: 'dup' }, [other!]: { patch: '- insert: []\n', profile: 'dup' } })
|
||||
expect(() => shippedProfileTemplate('t', 'dup', duplicated, profileDir('dup'))).toThrow('declared by several shipped bundles')
|
||||
const invalid = stageInstallation({ [shipped!]: { patch: '- insert: []\n', profile: 7 } })
|
||||
expect(() => shippedProfileTemplate('t', 'anything', invalid, profileDir('anything'))).toThrow('dsh.bundle.profile must be a nonempty profile name')
|
||||
expect(bundleProfileName({ patch: './cordis.patch.yml' })).toBeUndefined()
|
||||
})
|
||||
|
||||
it('normalizes only the exact installation-owned headless bundle tuple', () => {
|
||||
const anchor = stageInstallation({
|
||||
'@deepseek-ai/dsh-base': { patch: '[]\n' },
|
||||
|
||||
@@ -8,10 +8,10 @@ import type { EntryOptions } from '@deepseek-ai/cordis-plugin-loader'
|
||||
import { withFileLock, writeFileAtomic } from '@deepseek-ai/dsh-atomic-write'
|
||||
import {
|
||||
assertBundlePlatform, UnsupportedBundlePlatformError, bundlePatchPaths, initProfile, readProfileManifest,
|
||||
resolveBundleDir, resolveProfileDir, loadOverlayPatches, composeEntries, readProfileVersionExemptions,
|
||||
resolveBundleDir, resolveProfileDir, loadOverlayPatches, composeEntries, readProfileVersionExemptions, shippedProfileTemplate,
|
||||
evaluatePluginCompatibility, pluginCompatibilityWarning, type ProfileManifest,
|
||||
} from '@deepseek-ai/dsh-app-boot'
|
||||
import { PROFILE_TEMPLATES, DEFAULT_PROFILE_BUNDLES } from '@deepseek-ai/dsh-official-bundles'
|
||||
import { DEFAULT_PROFILE_BUNDLES } from '@deepseek-ai/dsh-official-bundles'
|
||||
import { scrubbedParentEnv } from '@deepseek-ai/dsh-subprocess'
|
||||
import { parseInstallSpec } from './install-spec.ts'
|
||||
import { awaitTreeGone, leadsOwnGroup, treeAlive, type RunTree } from './run-tree.ts'
|
||||
@@ -601,8 +601,7 @@ export async function runPluginCommand(
|
||||
await mkdir(dir, { recursive: true })
|
||||
return withFileLock(join(dir, 'package.json'), async () => {
|
||||
if (!existsSync(join(dir, 'package.json'))) {
|
||||
const template = PROFILE_TEMPLATES[context.profile]
|
||||
initProfile(dir, template?.bundles ?? DEFAULT_PROFILE_BUNDLES)
|
||||
initProfile(dir, shippedProfileTemplate('dsh', context.profile, context.installAnchor, dir) ?? DEFAULT_PROFILE_BUNDLES)
|
||||
options.onOutput?.(`dsh: initialized profile ${context.profile} at ${dir}\n`, 'stderr')
|
||||
}
|
||||
return runProfilePnpm(context, args, options)
|
||||
|
||||
@@ -9,17 +9,17 @@
|
||||
en: c0bca87ff2983e2e
|
||||
zh: da83dd66b8feafab
|
||||
/deepseek-ai-dsh-cua-mcp/summary:
|
||||
en: cc170382fc781faf
|
||||
zh: 846bb765f348d365
|
||||
en: d302f8266dac3b4c
|
||||
zh: 08952f1a40505533
|
||||
/deepseek-ai-dsh-cua-mcp/table-of-contents:
|
||||
en: dcb583a860af8206
|
||||
zh: 0a0d02b6e7e4e0b6
|
||||
/deepseek-ai-dsh-cua-mcp/use-this-package:
|
||||
en: bbff250eba0f1b89
|
||||
zh: 0a618f05cc88ee2b
|
||||
/deepseek-ai-dsh-cua-mcp/use-this-package/install-into-a-profile:
|
||||
en: c41e73c449ec4e64
|
||||
zh: 9e4ff33e1d97f1f3
|
||||
/deepseek-ai-dsh-cua-mcp/use-this-package/start-the-server:
|
||||
en: 0ff492831b5835e2
|
||||
zh: d06e805ca82520d0
|
||||
/deepseek-ai-dsh-cua-mcp/use-this-package/connect-a-client:
|
||||
en: b4db34975dce7ea2
|
||||
zh: ae55298bfd3e1c3a
|
||||
@@ -30,8 +30,8 @@
|
||||
en: 8996e07a265596a5
|
||||
zh: 8cf79827c51f2a2d
|
||||
/deepseek-ai-dsh-cua-mcp/understand-the-implementation:
|
||||
en: 65cefb2a0a5be892
|
||||
zh: 09e22959474eda6a
|
||||
en: c2b398720c4ff6df
|
||||
zh: b7996a57ab75d054
|
||||
/deepseek-ai-dsh-cua-mcp/further-exploration:
|
||||
en: 0328a9b46caad949
|
||||
zh: a20731d490d5412a
|
||||
@@ -51,8 +51,8 @@
|
||||
en: 2c22520787915229
|
||||
zh: 21dafc45d1a4bc0d
|
||||
/deepseek-ai-dsh-cua-mcp/known-limitations-and-deferred-work:
|
||||
en: 56925d9b123a6b2f
|
||||
zh: 1c613a37f6c89d6a
|
||||
en: 720a9bc12e5940c4
|
||||
zh: 17e38f3831db7bc1
|
||||
/deepseek-ai-dsh-cua-mcp/known-limitations-and-deferred-work/dev-note:
|
||||
en: e67f633dc6fe7773
|
||||
zh: 8ec3e73528ddb1a6
|
||||
@@ -9,7 +9,7 @@ English | [中文](README.zh.md)
|
||||
|
||||
## Summary
|
||||
|
||||
This experimental bundle turns a `dsh` profile into an MCP stdio server for Computer Use. Every DSH installation ships it switched off; one command selects it for the `cua-mcp` profile, and `dsh --profile cua-mcp` then serves `cua_run_code` and `cua_reset` to one MCP client. One connection owns one Agent whose programs keep application and window objects in memory between calls. Consent for application and pointer access is granted without a human or forwarded to the client as an elicitation. The profile runs no model turn; the connected harness owns the model.
|
||||
This experimental bundle composes the standalone `cua-mcp` profile, an MCP stdio server for Computer Use. Every DSH installation ships it; the first `dsh --profile cua-mcp` initializes the profile the bundle declares and serves `cua_run_code` and `cua_reset` to one MCP client. The profile is this bundle alone: no model adapter, prompt-side tool, or telemetry row loads. One connection owns one Agent whose programs keep application and window objects in memory between calls. Consent for application and pointer access is granted without a human or forwarded to the client as an elicitation; the connected harness owns the model.
|
||||
|
||||
## Table of Contents
|
||||
|
||||
@@ -26,30 +26,14 @@ This experimental bundle turns a `dsh` profile into an MCP stdio server for Comp
|
||||
<a id="use-this-package"></a>
|
||||
## Use this package
|
||||
|
||||
### Install into a profile
|
||||
### Start the server
|
||||
|
||||
The bundle is a runtime dependency of the `dsh` installation, so selecting it needs neither pnpm nor network access:
|
||||
|
||||
```sh
|
||||
dsh plugin --profile cua-mcp enable @deepseek-ai/dsh-cua-mcp
|
||||
dsh plugin --profile cua-mcp disable @deepseek-ai/dsh-cua-mcp
|
||||
```
|
||||
|
||||
`enable` initializes the profile from `@deepseek-ai/dsh-base` when it is missing and appends this bundle to `dsh.profile.bundles`; `disable` removes the selection. A source checkout runs the same commands through `pnpm dsh` after `pnpm run build`. The Python runtime wheel ships the same installation, so a training harness writes the profile manifest itself, or runs `enable` through the wheel's executable, and then uses that executable as the stdio command:
|
||||
The bundle is a runtime dependency of the `dsh` installation and declares the `cua-mcp` profile through `dsh.bundle.profile`, so the first `dsh --profile cua-mcp` initializes `$DSH_HOME/profiles/cua-mcp` with this single bundle layer; neither pnpm nor network access nor a `dsh plugin` step is involved. A source checkout runs the same command through `pnpm dsh` after `pnpm run build`. The Python runtime wheel ships the same installation, so a training harness uses its executable as the stdio command:
|
||||
|
||||
```python
|
||||
import json, os
|
||||
from pathlib import Path
|
||||
from deepseek_harness_runtime import resolve_bundled_launch_args
|
||||
|
||||
home = Path(os.environ["DSH_HOME"])
|
||||
profile = home / "profiles" / "cua-mcp"
|
||||
profile.mkdir(parents=True, exist_ok=True)
|
||||
(profile / "package.json").write_text(json.dumps({
|
||||
"name": "dsh-profile-cua-mcp", "private": True, "dependencies": {},
|
||||
"dsh": {"profile": {"bundles": ["@deepseek-ai/dsh-base", "@deepseek-ai/dsh-cua-mcp"]}},
|
||||
}))
|
||||
command = [*resolve_bundled_launch_args(), "--profile", "cua-mcp"] # the MCP stdio command
|
||||
command = [*resolve_bundled_launch_args(), "--profile", "cua-mcp"] # the MCP stdio command; the first start initializes the profile
|
||||
```
|
||||
|
||||
### Connect a client
|
||||
@@ -92,7 +76,7 @@ The patch also mounts the provider with `screenshotTarget: { longEdge: 2048, max
|
||||
<details>
|
||||
<summary>Implementation internals — click to expand</summary>
|
||||
|
||||
The [patch](cordis.patch.yml) disables the title, HMR, credential, authorization, and account rows of `dsh-base`, inserts the preset registry with the empty default preset, the `computer-use` registry, the macOS provider row disabled off Darwin, and this frontend. The frontend parses the invocation with `parseCmdline`, binds stdin EOF to the launcher's bounded shutdown, and connects the official MCP server to a stdio transport after the launcher commits readiness. `cua-mcp` is a required startup entry, so a frontend that cannot activate stops the profile.
|
||||
The [patch](cordis.patch.yml) composes the whole profile over the empty root: sessions with JSONL persistence and projections, attachments, storage for application grants, the subprocess, sandbox, approval, and filesystem seams program processes run under, tools with the native executor, the system prompt, user questions, the llm hub without an adapter, the Agent registry with the agent-loop factory, the preset registry with the empty default preset, the `computer-use` registry, the macOS provider row disabled off Darwin, and this frontend. `dsh.bundle.profile` names the `cua-mcp` profile, which app-boot initializes from this single bundle on first start. The frontend parses the invocation with `parseCmdline`, binds stdin EOF to the launcher's bounded shutdown, and connects the official MCP server to a stdio transport after the launcher commits readiness. `cua-mcp` is a required startup entry, so a frontend that cannot activate stops the profile.
|
||||
|
||||
[`server.ts`](src/server.ts) registers both tools on one `McpServer`. The connection's Agent mounts the registry's default preset and records the launch directory. `cua_run_code` runs through `ctx.tools.execute` with the Agent and the request signal and no model step, so the Session log carries nested `tool/ptc-dispatch` events but no root `tool/call`; [`projection.ts`](src/projection.ts) renders the result and its deferred screenshot contexts, reading each image through `ctx.cuaPrograms.screenshotRequestTarget`. `cua_reset` calls `ctx.cuaPrograms.reset`. [`consent.ts`](src/consent.ts) is the `user-questions/request` answerer for that Agent; [`client-config.ts`](src/client-config.ts) renders the client snippets.
|
||||
|
||||
@@ -136,6 +120,7 @@ The tool catalog and instructions are stable for one installation. The first res
|
||||
- Elicitation uses the 2025 MCP request model; a client that negotiates the 2026-07-28 revision receives an error for consent requests and should use `DSH_CUA_CONSENT=allow`.
|
||||
- Program sandbox escalation and the raw `cua` tool are not exposed; `DSH_PERMISSION_MODE` selects the launch-time file sandbox of program processes.
|
||||
- Root tool calls are not Session events; the connected harness's transcript is the record of calls and results.
|
||||
- The patch lists the profile's dependency closure explicitly; a new service injection in the CUA or PTC packages fails the required startup entry loudly until the patch adds the row.
|
||||
|
||||
<a id="dev-note"></a>
|
||||
### Dev Note
|
||||
|
||||
@@ -9,7 +9,7 @@ kind: "package-bundle"
|
||||
|
||||
## 概述
|
||||
|
||||
这个实验性组合包把一个 `dsh` profile 变成 Computer Use 的 MCP stdio 服务器。每个 DSH 安装都自带它且默认关闭;一条命令即可为 `cua-mcp` profile 选中它,随后 `dsh --profile cua-mcp` 向一个 MCP 客户端提供 `cua_run_code` 与 `cua_reset`。一个连接拥有一个 Agent,其程序在多次调用之间于内存中保留应用与窗口对象。应用与指针访问的授权可无人值守放行,或作为 elicitation 转发给客户端。该 profile 不运行模型回合;模型归接入的 harness 所有。
|
||||
这个实验性组合包独立组成 `cua-mcp` profile,即 Computer Use 的 MCP stdio 服务器。每个 DSH 安装都自带它;首次 `dsh --profile cua-mcp` 初始化组合包声明的 profile,并向一个 MCP 客户端提供 `cua_run_code` 与 `cua_reset`。该 profile 只由本组合包构成:不加载任何模型适配器、提示侧工具或遥测行。一个连接拥有一个 Agent,其程序在多次调用之间于内存中保留应用与窗口对象。应用与指针访问的授权可无人值守放行,或作为 elicitation 转发给客户端;模型归接入的 harness 所有。
|
||||
|
||||
## 目录
|
||||
|
||||
@@ -26,30 +26,14 @@ kind: "package-bundle"
|
||||
<a id="use-this-package"></a>
|
||||
## 使用本包
|
||||
|
||||
### 安装到 profile
|
||||
### 启动服务器
|
||||
|
||||
组合包是 `dsh` 安装的运行时依赖,因此选中它既不需要 pnpm 也不需要网络:
|
||||
|
||||
```sh
|
||||
dsh plugin --profile cua-mcp enable @deepseek-ai/dsh-cua-mcp
|
||||
dsh plugin --profile cua-mcp disable @deepseek-ai/dsh-cua-mcp
|
||||
```
|
||||
|
||||
`enable` 在 profile 缺失时从 `@deepseek-ai/dsh-base` 初始化它,并把本组合包追加到 `dsh.profile.bundles`;`disable` 移除该选择。源码 checkout 在 `pnpm run build` 之后通过 `pnpm dsh` 运行同样的命令。Python runtime wheel 自带同一份安装,训练 harness 可以自行写入 profile manifest,或通过 wheel 的可执行程序运行 `enable`,然后把该可执行程序用作 stdio 命令:
|
||||
组合包是 `dsh` 安装的运行时依赖,并通过 `dsh.bundle.profile` 声明 `cua-mcp` profile,因此首次 `dsh --profile cua-mcp` 就用这一个组合包层初始化 `$DSH_HOME/profiles/cua-mcp`;不涉及 pnpm、网络或任何 `dsh plugin` 步骤。源码 checkout 在 `pnpm run build` 之后通过 `pnpm dsh` 运行同样的命令。Python runtime wheel 自带同一份安装,训练 harness 直接把它的可执行程序用作 stdio 命令:
|
||||
|
||||
```python
|
||||
import json, os
|
||||
from pathlib import Path
|
||||
from deepseek_harness_runtime import resolve_bundled_launch_args
|
||||
|
||||
home = Path(os.environ["DSH_HOME"])
|
||||
profile = home / "profiles" / "cua-mcp"
|
||||
profile.mkdir(parents=True, exist_ok=True)
|
||||
(profile / "package.json").write_text(json.dumps({
|
||||
"name": "dsh-profile-cua-mcp", "private": True, "dependencies": {},
|
||||
"dsh": {"profile": {"bundles": ["@deepseek-ai/dsh-base", "@deepseek-ai/dsh-cua-mcp"]}},
|
||||
}))
|
||||
command = [*resolve_bundled_launch_args(), "--profile", "cua-mcp"] # the MCP stdio command
|
||||
command = [*resolve_bundled_launch_args(), "--profile", "cua-mcp"] # the MCP stdio command; the first start initializes the profile
|
||||
```
|
||||
|
||||
### 接入客户端
|
||||
@@ -92,7 +76,7 @@ patch 还以 `screenshotTarget: { longEdge: 2048, maxBytes: 2097152 }` 挂载提
|
||||
<details>
|
||||
<summary>实现细节 — 点击展开</summary>
|
||||
|
||||
[patch](cordis.patch.yml) 禁用 `dsh-base` 的标题、HMR、凭据、授权和账号行,插入带空默认 preset 的 preset 注册表、`computer-use` 注册表、在非 Darwin 上禁用的 macOS 提供方行,以及本前端。前端用 `parseCmdline` 解析调用,把 stdin EOF 绑定到启动器的有界关闭,并在启动器提交就绪后把官方 MCP 服务器连接到 stdio 传输。`cua-mcp` 是启动必需条目,前端无法激活时 profile 停止启动。
|
||||
[patch](cordis.patch.yml) 在空根上组成整个 profile:带 JSONL 持久化与投影的会话、附件、保存应用授权的存储、程序进程所依赖的子进程、沙箱、审批与文件系统 seam、带原生执行器的工具、系统提示、用户提问、不挂适配器的 llm hub、带 agent-loop 工厂的 Agent 注册表、带空默认 preset 的 preset 注册表、`computer-use` 注册表、在非 Darwin 上禁用的 macOS 提供方行,以及本前端。`dsh.bundle.profile` 声明 `cua-mcp` profile,app-boot 在首次启动时用这一个组合包初始化它。前端用 `parseCmdline` 解析调用,把 stdin EOF 绑定到启动器的有界关闭,并在启动器提交就绪后把官方 MCP 服务器连接到 stdio 传输。`cua-mcp` 是启动必需条目,前端无法激活时 profile 停止启动。
|
||||
|
||||
[`server.ts`](src/server.ts) 在一个 `McpServer` 上注册两个工具。连接的 Agent 挂载注册表的默认 preset 并记录启动目录。`cua_run_code` 带着 Agent 和请求 signal、不经模型步骤地通过 `ctx.tools.execute` 运行,因此 Session 日志只有嵌套的 `tool/ptc-dispatch` 事件而没有根 `tool/call`;[`projection.ts`](src/projection.ts) 渲染结果及其延后的截图上下文,并通过 `ctx.cuaPrograms.screenshotRequestTarget` 读取每张图片。`cua_reset` 调用 `ctx.cuaPrograms.reset`。[`consent.ts`](src/consent.ts) 是该 Agent 的 `user-questions/request` 应答者;[`client-config.ts`](src/client-config.ts) 渲染客户端片段。
|
||||
|
||||
@@ -136,6 +120,7 @@ patch 还以 `screenshotTarget: { longEdge: 2048, maxBytes: 2097152 }` 挂载提
|
||||
- Elicitation 使用 2025 版 MCP 请求模型;协商到 2026-07-28 修订版的客户端在授权请求时收到错误,应改用 `DSH_CUA_CONSENT=allow`。
|
||||
- 不暴露程序沙箱提权和原始 `cua` 工具;`DSH_PERMISSION_MODE` 选择程序进程启动时的文件沙箱。
|
||||
- 根工具调用不是 Session 事件;接入 harness 的 transcript 才是调用与结果的记录。
|
||||
- patch 显式列出该 profile 的依赖闭包;CUA 或 PTC 包新增服务注入时,必需启动条目会大声失败,直到 patch 补上该行。
|
||||
|
||||
<a id="dev-note"></a>
|
||||
### 开发备注
|
||||
|
||||
@@ -1,25 +1,98 @@
|
||||
# The Computer Use MCP application over dsh-base. Stdout belongs exclusively to
|
||||
# MCP JSON-RPC; one stdio connection owns one Agent whose cua_run_code programs
|
||||
# retain state until the client disconnects or calls cua_reset.
|
||||
|
||||
# No model turn ever runs in this profile: titles, credentials, and the account
|
||||
# provider have no consumer, and configuration applies at startup only.
|
||||
- id: session-title-llm
|
||||
disabled: true
|
||||
|
||||
- id: hmr
|
||||
disabled: true
|
||||
|
||||
- id: credentials
|
||||
disabled: true
|
||||
|
||||
- id: authorization
|
||||
disabled: true
|
||||
|
||||
- id: deepseek-account
|
||||
disabled: true
|
||||
# The Computer Use MCP application: a standalone profile composed from this one
|
||||
# insert over the empty profile root. No model turn ever runs here, so the
|
||||
# composition carries no model adapter, prompt-side tools, telemetry, or
|
||||
# session-management rows; stdout belongs exclusively to MCP JSON-RPC, and one
|
||||
# stdio connection owns one Agent whose cua_run_code programs retain state until
|
||||
# the client disconnects or calls cua_reset.
|
||||
#
|
||||
# Row ids match dsh-base where the plugin is the same, so a profile or home
|
||||
# cordis.patch.yml written for a base-backed profile addresses them unchanged.
|
||||
|
||||
- insert:
|
||||
# Sessions: the connection Agent's Session log (nested tool/ptc-dispatch events
|
||||
# and screenshots) and the projections that approval, sandbox policy, and the
|
||||
# Agent registry derive from it.
|
||||
- id: session
|
||||
name: '@deepseek-ai/dsh-session'
|
||||
|
||||
- id: session-persistence-jsonl
|
||||
name: '@deepseek-ai/dsh-session-persistence-jsonl'
|
||||
config:
|
||||
root: !!js dshHomePath('sessions')
|
||||
|
||||
- id: session-projection
|
||||
name: '@deepseek-ai/dsh-session-projection'
|
||||
|
||||
- id: attachment-local
|
||||
name: '@deepseek-ai/dsh-attachment-local'
|
||||
|
||||
- id: working-directory
|
||||
name: '@deepseek-ai/dsh-working-directory'
|
||||
|
||||
# Durable KV storage for the provider's application grants.
|
||||
- id: storage
|
||||
name: '@deepseek-ai/dsh-storage'
|
||||
|
||||
- id: storage-json
|
||||
name: '@deepseek-ai/dsh-storage-json'
|
||||
config:
|
||||
root: !!js dshHomePath('storages')
|
||||
|
||||
- id: storage-domain
|
||||
name: '@deepseek-ai/dsh-storage-domain'
|
||||
config:
|
||||
backend: json
|
||||
|
||||
# Program processes: the dedicated CUA runtime launches under the same
|
||||
# file-effect boundary as every shipped CLI mode.
|
||||
- id: subprocess
|
||||
name: '@deepseek-ai/dsh-subprocess-local'
|
||||
|
||||
- id: sandbox
|
||||
name: '@deepseek-ai/dsh-sandbox-local'
|
||||
|
||||
- id: sandbox-policy
|
||||
name: '@deepseek-ai/dsh-sandbox-policy'
|
||||
config:
|
||||
mode: !!js process.env.DSH_PERMISSION_MODE ?? 'workspace-write'
|
||||
workspaceRoot: !!js process.cwd()
|
||||
|
||||
- id: approval
|
||||
name: '@deepseek-ai/dsh-user-approval'
|
||||
config:
|
||||
policy: !!js "(process.env.DSH_PERMISSION_MODE ?? 'workspace-write') === 'danger-full-access' ? 'never' : 'ask'"
|
||||
|
||||
- id: fs-sandbox
|
||||
name: '@deepseek-ai/dsh-fs-sandbox'
|
||||
|
||||
# Tool execution and the Agent that owns the connection.
|
||||
- id: tools
|
||||
name: '@deepseek-ai/dsh-tools'
|
||||
|
||||
- id: tool-executor-native
|
||||
name: '@deepseek-ai/dsh-tool-executor-native'
|
||||
|
||||
- id: system-prompt
|
||||
name: '@deepseek-ai/dsh-system-prompt'
|
||||
config:
|
||||
personaPrefix: ''
|
||||
|
||||
- id: user-questions
|
||||
name: '@deepseek-ai/dsh-user-questions'
|
||||
|
||||
# The Agent registry creates the connection Agent through the agent-loop
|
||||
# factory; no model adapter is mounted on the llm hub, so no turn can run.
|
||||
- id: llm
|
||||
name: '@deepseek-ai/dsh-llm'
|
||||
|
||||
- id: agent
|
||||
name: '@deepseek-ai/dsh-agent'
|
||||
|
||||
- id: agent-loop
|
||||
name: '@deepseek-ai/dsh-agent-loop'
|
||||
config:
|
||||
agents: []
|
||||
|
||||
# A composed preset selects cua_run_code for the connection's Agent; the
|
||||
# empty preset keeps every model-facing row out of this profile.
|
||||
- id: cua-mcp-presets
|
||||
|
||||
@@ -37,26 +37,41 @@
|
||||
"license": "MIT",
|
||||
"dsh": {
|
||||
"bundle": {
|
||||
"patch": "./cordis.patch.yml"
|
||||
"patch": "./cordis.patch.yml",
|
||||
"profile": "cua-mcp"
|
||||
}
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@deepseek-ai/cordis": "workspace:~",
|
||||
"@deepseek-ai/dsh-agent": "workspace:*",
|
||||
"@deepseek-ai/dsh-attachment": "workspace:*",
|
||||
"@deepseek-ai/dsh-system-prompt": "workspace:*",
|
||||
"@deepseek-ai/dsh-tools": "workspace:*",
|
||||
"@deepseek-ai/dsh-app-boot": "workspace:*"
|
||||
},
|
||||
"dependencies": {
|
||||
"@deepseek-ai/dsh-agent": "workspace:*",
|
||||
"@deepseek-ai/dsh-agent-loop": "workspace:*",
|
||||
"@deepseek-ai/dsh-agent-preset": "workspace:*",
|
||||
"@deepseek-ai/dsh-agent-preset-registry": "workspace:*",
|
||||
"@deepseek-ai/dsh-attachment-local": "workspace:*",
|
||||
"@deepseek-ai/dsh-cmdline": "workspace:*",
|
||||
"@deepseek-ai/dsh-computer-use": "workspace:*",
|
||||
"@deepseek-ai/dsh-cua": "workspace:*",
|
||||
"@deepseek-ai/dsh-fs-sandbox": "workspace:*",
|
||||
"@deepseek-ai/dsh-llm": "workspace:*",
|
||||
"@deepseek-ai/dsh-sandbox-local": "workspace:*",
|
||||
"@deepseek-ai/dsh-sandbox-policy": "workspace:*",
|
||||
"@deepseek-ai/dsh-session": "workspace:*",
|
||||
"@deepseek-ai/dsh-session-persistence-jsonl": "workspace:*",
|
||||
"@deepseek-ai/dsh-session-projection": "workspace:*",
|
||||
"@deepseek-ai/dsh-storage": "workspace:*",
|
||||
"@deepseek-ai/dsh-storage-domain": "workspace:*",
|
||||
"@deepseek-ai/dsh-storage-json": "workspace:*",
|
||||
"@deepseek-ai/dsh-subprocess-local": "workspace:*",
|
||||
"@deepseek-ai/dsh-system-prompt": "workspace:*",
|
||||
"@deepseek-ai/dsh-tool-executor-native": "workspace:*",
|
||||
"@deepseek-ai/dsh-tools": "workspace:*",
|
||||
"@deepseek-ai/dsh-user-approval": "workspace:*",
|
||||
"@deepseek-ai/dsh-user-questions": "workspace:*",
|
||||
"@deepseek-ai/dsh-working-directory": "workspace:*",
|
||||
"@deepseek-ai/schemastery": "workspace:~",
|
||||
"@modelcontextprotocol/server": "2.2.0",
|
||||
"commander": "^15.0.0",
|
||||
@@ -69,22 +84,11 @@
|
||||
"@deepseek-ai/cordis": "workspace:~",
|
||||
"@deepseek-ai/cordis-plugin-include": "workspace:~",
|
||||
"@deepseek-ai/cordis-plugin-loader": "workspace:~",
|
||||
"@deepseek-ai/dsh-agent": "workspace:*",
|
||||
"@deepseek-ai/dsh-agent-loop": "workspace:*",
|
||||
"@deepseek-ai/dsh-app-boot": "workspace:*",
|
||||
"@deepseek-ai/dsh-attachment": "workspace:*",
|
||||
"@deepseek-ai/dsh-attachment-local": "workspace:*",
|
||||
"@deepseek-ai/dsh-brand": "workspace:*",
|
||||
"@deepseek-ai/dsh-fs-local": "workspace:*",
|
||||
"@deepseek-ai/dsh-ptc-runtime-node": "workspace:*",
|
||||
"@deepseek-ai/dsh-sandbox-local": "workspace:*",
|
||||
"@deepseek-ai/dsh-sandbox-policy": "workspace:*",
|
||||
"@deepseek-ai/dsh-session-projection": "workspace:*",
|
||||
"@deepseek-ai/dsh-subprocess-local": "workspace:*",
|
||||
"@deepseek-ai/dsh-system-prompt": "workspace:*",
|
||||
"@deepseek-ai/dsh-tool-executor-native": "workspace:*",
|
||||
"@deepseek-ai/dsh-tools": "workspace:*",
|
||||
"@deepseek-ai/dsh-working-directory": "workspace:*",
|
||||
"@modelcontextprotocol/client": "2.2.0",
|
||||
"js-yaml": "^4.3.2"
|
||||
}
|
||||
|
||||
@@ -19,8 +19,6 @@ export interface ClientLaunch {
|
||||
readonly args: readonly string[]
|
||||
/** Environment the client passes to the process. */
|
||||
readonly env: Readonly<Record<string, string>>
|
||||
/** Shell command that installs the profile once; rendered as a comment where the format allows one. */
|
||||
readonly setup: string
|
||||
}
|
||||
|
||||
/** The process facts a generated client configuration embeds. */
|
||||
@@ -37,7 +35,7 @@ export interface LaunchFacts {
|
||||
* @param facts - Current process executable, Node options, and arguments.
|
||||
* @param profile - Launched profile.
|
||||
* @param consent - Consent mode the generated environment pins.
|
||||
* @returns Absolute command, arguments, environment, and the one-time profile setup command.
|
||||
* @returns Absolute command, arguments, and environment.
|
||||
* @throws Error when a script-launched process has no script argument.
|
||||
*/
|
||||
export function clientLaunch(facts: LaunchFacts, profile: Pick<ProfileContext, 'name' | 'home'>, consent: ConsentMode): ClientLaunch {
|
||||
@@ -48,7 +46,6 @@ export function clientLaunch(facts: LaunchFacts, profile: Pick<ProfileContext, '
|
||||
command: facts.execPath,
|
||||
args: facts.sea ? selection : [...facts.execArgv, script as string, ...selection],
|
||||
env: { DSH_HOME: profile.home, DSH_CUA_CONSENT: consent },
|
||||
setup: `dsh plugin --profile ${profile.name} enable @deepseek-ai/dsh-cua-mcp`,
|
||||
}
|
||||
}
|
||||
|
||||
@@ -84,7 +81,7 @@ export function renderClientConfig(target: ClientConfigTarget, launch: ClientLau
|
||||
switch (target) {
|
||||
case 'codex':
|
||||
return [
|
||||
`# ~/.codex/config.toml — run once first: ${launch.setup}`,
|
||||
'# ~/.codex/config.toml — the first start initializes the profile and prepares the Computer Use helper',
|
||||
`[mcp_servers.${MCP_SERVER_NAME}]`,
|
||||
`command = ${tomlString(launch.command)}`,
|
||||
`args = [${launch.args.map(tomlString).join(', ')}]`,
|
||||
@@ -102,7 +99,6 @@ export function renderClientConfig(target: ClientConfigTarget, launch: ClientLau
|
||||
case 'claude-code': {
|
||||
const json = JSON.stringify({ ...entry, timeout: TOOL_TIMEOUT_SECONDS * 1000, alwaysLoad: true })
|
||||
return [
|
||||
`# run once first: ${launch.setup}`,
|
||||
`claude mcp add-json ${MCP_SERVER_NAME} '${json.replaceAll("'", String.raw`'\''`)}'`,
|
||||
'',
|
||||
].join('\n')
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/** The bundle's manifest and patch: a standalone profile frontend over dsh-base with a fixed-target CUA provider. */
|
||||
/** The bundle's manifest and patch: a standalone profile composed from one insert over the empty root. */
|
||||
import { readFileSync, readdirSync } from 'node:fs'
|
||||
import { resolve } from 'node:path'
|
||||
import { fileURLToPath } from 'node:url'
|
||||
@@ -15,7 +15,7 @@ interface Manifest {
|
||||
publishConfig: { access: string }
|
||||
icon: string
|
||||
exports: Record<string, unknown>
|
||||
dsh: { bundle: { patch: string; platforms?: string[] } }
|
||||
dsh: { bundle: { patch: string; profile: string; platforms?: string[] } }
|
||||
dependencies: Record<string, string>
|
||||
optionalDependencies: Record<string, string>
|
||||
}
|
||||
@@ -25,40 +25,52 @@ const patches = load(readFileSync(resolve(root, manifest.dsh.bundle.patch), 'utf
|
||||
{ id?: string; disabled?: unknown; insert?: EntryOptions[] }
|
||||
>
|
||||
const inserted = patches.flatMap(patch => patch.insert ?? [])
|
||||
const row = (id: string) => inserted.find(entry => entry.id === id)
|
||||
|
||||
describe('cua-mcp bundle', () => {
|
||||
it('publishes an unprefixed experimental bundle that every Host installs and only macOS serves', () => {
|
||||
it('publishes an unprefixed experimental bundle that declares its own profile and only macOS serves', () => {
|
||||
expect(manifest.name).toBe('@deepseek-ai/dsh-cua-mcp')
|
||||
expect(manifest.publishConfig.access).toBe('public')
|
||||
expect(manifest.icon).toBe('./icon.svg')
|
||||
expect(manifest.exports).toHaveProperty('./locale/*.json')
|
||||
expect(manifest.dsh.bundle).toEqual({ patch: './cordis.patch.yml' })
|
||||
expect(manifest.dsh.bundle).toEqual({ patch: './cordis.patch.yml', profile: 'cua-mcp' })
|
||||
expect(Object.keys(manifest.optionalDependencies)).toEqual(['@deepseek-ai/dsh-experimental-cua-macos'])
|
||||
expect(readdirSync(resolve(root, 'locale')).sort()).toEqual(['de.json', 'en.json', 'es.json', 'fr.json', 'ja.json', 'pt.json', 'ru.json', 'zh.json'])
|
||||
})
|
||||
|
||||
it('switches off model-turn rows and inserts the preset, provider, and frontend rows', () => {
|
||||
expect(patches.filter(patch => patch.disabled === true).map(patch => patch.id))
|
||||
.toEqual(['session-title-llm', 'hmr', 'credentials', 'authorization', 'deepseek-account'])
|
||||
expect(inserted.map(row => [row.id, row.name])).toEqual([
|
||||
['cua-mcp-presets', '@deepseek-ai/dsh-agent-preset-registry'],
|
||||
['cua-mcp-preset', '@deepseek-ai/dsh-agent-preset'],
|
||||
['cua-mcp-computer-use', '@deepseek-ai/dsh-computer-use'],
|
||||
['cua-mcp-provider', '@deepseek-ai/dsh-experimental-cua-macos'],
|
||||
['cua-mcp', '@deepseek-ai/dsh-cua-mcp'],
|
||||
it('composes the standalone profile from one insert without model adapters, prompt tools, or telemetry', () => {
|
||||
expect(patches.map(patch => Object.keys(patch))).toEqual([['insert']])
|
||||
expect(inserted.map(entry => entry.id)).toEqual([
|
||||
'session', 'session-persistence-jsonl', 'session-projection', 'attachment-local', 'working-directory',
|
||||
'storage', 'storage-json', 'storage-domain',
|
||||
'subprocess', 'sandbox', 'sandbox-policy', 'approval', 'fs-sandbox',
|
||||
'tools', 'tool-executor-native', 'system-prompt', 'user-questions', 'llm', 'agent', 'agent-loop',
|
||||
'cua-mcp-presets', 'cua-mcp-preset', 'cua-mcp-computer-use', 'cua-mcp-provider', 'cua-mcp',
|
||||
])
|
||||
const registry = inserted.find(row => row.id === 'cua-mcp-presets')
|
||||
const preset = inserted.find(row => row.id === 'cua-mcp-preset')
|
||||
expect(registry?.config).toEqual({ default: 'cua-mcp' })
|
||||
expect(preset?.config).toEqual({ id: 'cua-mcp', plugins: [] })
|
||||
for (const name of inserted.map(row => row.name)) {
|
||||
// The llm hub carries no adapter row, so no model request can leave this profile.
|
||||
expect(inserted.map(entry => entry.name).filter(name => /llm|telemetry|otel|web|subagent|compaction|skill|plugin-manager/.test(name)))
|
||||
.toEqual(['@deepseek-ai/dsh-llm'])
|
||||
expect(row('agent-loop')?.config).toEqual({ agents: [] })
|
||||
expect(row('cua-mcp-presets')?.config).toEqual({ default: 'cua-mcp' })
|
||||
expect(row('cua-mcp-preset')?.config).toEqual({ id: 'cua-mcp', plugins: [] })
|
||||
for (const name of inserted.map(entry => entry.name)) {
|
||||
if (name === manifest.name) continue
|
||||
expect({ ...manifest.dependencies, ...manifest.optionalDependencies }).toHaveProperty(name)
|
||||
}
|
||||
})
|
||||
|
||||
it('pins the file-effect boundary of every shipped CLI mode for program processes', () => {
|
||||
const policy = row('sandbox-policy')?.config as { mode: unknown; workspaceRoot: unknown }
|
||||
const approval = row('approval')?.config as { policy: unknown }
|
||||
expect(interpolate({ process: { env: {}, cwd: () => '/work' } }, policy.mode)).toBe('workspace-write')
|
||||
expect(interpolate({ process: { env: { DSH_PERMISSION_MODE: 'danger-full-access' }, cwd: () => '/work' } }, policy.mode)).toBe('danger-full-access')
|
||||
expect(interpolate({ process: { env: {}, cwd: () => '/work' } }, policy.workspaceRoot)).toBe('/work')
|
||||
expect(interpolate({ process: { env: {} } }, approval.policy)).toBe('ask')
|
||||
expect(interpolate({ process: { env: { DSH_PERMISSION_MODE: 'danger-full-access' } } }, approval.policy)).toBe('never')
|
||||
})
|
||||
|
||||
it('mounts the macOS provider only on Darwin, with a fixed screenshot target and the PTC raw-tool preset', () => {
|
||||
const provider = inserted.find(row => row.id === 'cua-mcp-provider')
|
||||
const provider = row('cua-mcp-provider')
|
||||
expect(provider?.config).toEqual({ agentPreset: 'ptc', screenshotTarget: { longEdge: 2048, maxBytes: 2_097_152 } })
|
||||
for (const platform of ['darwin', 'linux', 'win32']) {
|
||||
expect(Boolean(interpolate({ process: { platform } }, provider?.disabled))).toBe(platform !== 'darwin')
|
||||
@@ -66,8 +78,7 @@ describe('cua-mcp bundle', () => {
|
||||
})
|
||||
|
||||
it('maps DSH_CUA_CONSENT onto the frontend consent and defaults to elicitation', () => {
|
||||
const frontend = inserted.find(row => row.id === 'cua-mcp')
|
||||
const consent = (frontend?.config as { consent: unknown }).consent
|
||||
const consent = (row('cua-mcp')?.config as { consent: unknown }).consent
|
||||
expect(interpolate({ process: { env: {} } }, consent)).toBe('elicit')
|
||||
expect(interpolate({ process: { env: { DSH_CUA_CONSENT: 'allow' } } }, consent)).toBe('allow')
|
||||
})
|
||||
|
||||
@@ -6,14 +6,13 @@ const launch: ClientLaunch = {
|
||||
command: '/opt/node/bin/node',
|
||||
args: ['/opt/dsh/lib/bin.js', '--profile', 'cua-mcp'],
|
||||
env: { DSH_HOME: "/Users/o'neil/.dsh", DSH_CUA_CONSENT: 'elicit' },
|
||||
setup: 'dsh plugin --profile cua-mcp enable @deepseek-ai/dsh-cua-mcp',
|
||||
}
|
||||
|
||||
describe('client configuration', () => {
|
||||
it('renders a Codex TOML fragment with the launch command, limits, and the setup command as a comment', () => {
|
||||
it('renders a Codex TOML fragment with the launch command and limits', () => {
|
||||
const toml = renderClientConfig('codex', launch)
|
||||
expect(toml).toMatchInlineSnapshot(`
|
||||
"# ~/.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 = "/opt/node/bin/node"
|
||||
args = ["/opt/dsh/lib/bin.js", "--profile", "cua-mcp"]
|
||||
@@ -32,10 +31,10 @@ describe('client configuration', () => {
|
||||
|
||||
it('renders a shell-safe claude mcp add-json command with the stdio entry', () => {
|
||||
const command = renderClientConfig('claude-code', launch)
|
||||
const [comment, line] = command.trimEnd().split('\n')
|
||||
expect(comment).toBe('# run once first: dsh plugin --profile cua-mcp enable @deepseek-ai/dsh-cua-mcp')
|
||||
const match = /^claude mcp add-json dsh_cua '(.*)'$/.exec(line ?? '')
|
||||
if (match === null) throw new Error(`unexpected command line: ${String(line)}`)
|
||||
const lines = command.trimEnd().split('\n')
|
||||
expect(lines).toHaveLength(1)
|
||||
const match = /^claude mcp add-json dsh_cua '(.*)'$/.exec(lines[0] ?? '')
|
||||
if (match === null) throw new Error(`unexpected command line: ${String(lines[0])}`)
|
||||
// The single-quoted shell argument closes, escapes, and reopens around the apostrophe in the home path.
|
||||
const shellValue = match[1]!.replaceAll(String.raw`'\''`, "'")
|
||||
expect(JSON.parse(shellValue)).toEqual({
|
||||
@@ -60,7 +59,6 @@ describe('launch resolution', () => {
|
||||
.toEqual({
|
||||
command: '/opt/node', args: ['--import', 'tsx/esm', '/repo/apps/cli/src/bin.ts', '--profile', 'cua-mcp'],
|
||||
env: { DSH_HOME: '/home/me/.dsh', DSH_CUA_CONSENT: 'allow' },
|
||||
setup: 'dsh plugin --profile cua-mcp enable @deepseek-ai/dsh-cua-mcp',
|
||||
})
|
||||
})
|
||||
|
||||
|
||||
@@ -70,7 +70,7 @@ async function boot(args: string[], config: Partial<frontend.Config> = {}) {
|
||||
ctx.provide('profileContext', {
|
||||
name: 'cua-mcp', dir: '/profiles/cua-mcp', patchPath: '/profiles/cua-mcp/cordis.patch.yml',
|
||||
installAnchor: '/dsh/package.json', cwd: '/workspace', home: '/home/me/.dsh',
|
||||
startedBundles: ['@deepseek-ai/dsh-base', '@deepseek-ai/dsh-cua-mcp'], overlays: [], telemetryDisabledEnv: undefined,
|
||||
startedBundles: ['@deepseek-ai/dsh-cua-mcp'], overlays: [], telemetryDisabledEnv: undefined,
|
||||
})
|
||||
await ctx.plugin(frontend, frontend.Config(config))
|
||||
return { ctx, exit, stdout, stderr, stdin, ready: () => {
|
||||
|
||||
@@ -21,8 +21,8 @@
|
||||
en: 60ef21314c76c3ec
|
||||
zh: f769091957235e12
|
||||
/deepseek-ai-dsh-official-bundles/use-this-package/optional-and-retired-bundles:
|
||||
en: 8d94e2b44efb9c1d
|
||||
zh: c049a19e471d188b
|
||||
en: a103658bcb14fad2
|
||||
zh: c37c0ef2ff32ee44
|
||||
/deepseek-ai-dsh-official-bundles/use-this-package/plugin-manager-lists:
|
||||
en: 27c22abdfff69a41
|
||||
zh: e60d828cdb75c263
|
||||
|
||||
@@ -32,7 +32,7 @@ Edit this package when the installation's bundle selection or the plugin manager
|
||||
|
||||
### Optional and retired bundles
|
||||
|
||||
`OPTIONAL_BUNDLES` names the bundles the installation ships for a person to switch on. Each must be a runtime dependency of the `dsh` app that declares `dsh.bundle.patch`, an icon, and `./locale/*.json` display metadata, and no template may select it; [`verify-default-product-isolation`](../../../scripts/verify-default-product-isolation.ts) checks these rules. The [plugin manager](../../boot/plugin-manager/README.md#use-this-package) reports these bundles as `optional`. `RETIRED_BUNDLES` names bundles the installation no longer carries; app-boot removes them from a profile's bundle list when it loads the profile.
|
||||
`OPTIONAL_BUNDLES` names the bundles the installation ships for a person to switch on. Each must be a runtime dependency of the `dsh` app that declares `dsh.bundle.patch`, an icon, and `./locale/*.json` display metadata, and no template may select it; [`verify-default-product-isolation`](../../../scripts/verify-default-product-isolation.ts) checks these rules. A shipped optional bundle may instead declare its own standalone profile through `dsh.bundle.profile`; app-boot initializes a missing profile of that name from that single bundle, so the profile opens only by name. The [plugin manager](../../boot/plugin-manager/README.md#use-this-package) reports these bundles as `optional`. `RETIRED_BUNDLES` names bundles the installation no longer carries; app-boot removes them from a profile's bundle list when it loads the profile.
|
||||
|
||||
<a id="plugin-manager-lists"></a>
|
||||
### Plugin manager lists
|
||||
|
||||
@@ -32,7 +32,7 @@ kind: "package-library"
|
||||
|
||||
### 可选与已退役组合包
|
||||
|
||||
`OPTIONAL_BUNDLES` 列出安装随附、供用户开启的组合包。每一项都必须是 `dsh` 应用的运行时依赖,并声明 `dsh.bundle.patch`、图标和 `./locale/*.json` 显示元信息,且不能被任何模板选中;[`verify-default-product-isolation`](../../../scripts/verify-default-product-isolation.ts) 检查这些规则。[插件管理器](../../boot/plugin-manager/README.zh.md#use-this-package)把这些组合包报告为 `optional`。`RETIRED_BUNDLES` 列出安装不再携带的组合包;app-boot 在加载 profile 时将它们从该 profile 的组合包列表中移除。
|
||||
`OPTIONAL_BUNDLES` 列出安装随附、供用户开启的组合包。每一项都必须是 `dsh` 应用的运行时依赖,并声明 `dsh.bundle.patch`、图标和 `./locale/*.json` 显示元信息,且不能被任何模板选中;[`verify-default-product-isolation`](../../../scripts/verify-default-product-isolation.ts) 检查这些规则。随附的可选组合包可以改为通过 `dsh.bundle.profile` 声明自己的独立 profile;app-boot 用这一个组合包初始化缺失的同名 profile,因此该 profile 只按名称打开。[插件管理器](../../boot/plugin-manager/README.zh.md#use-this-package)把这些组合包报告为 `optional`。`RETIRED_BUNDLES` 列出安装不再携带的组合包;app-boot 在加载 profile 时将它们从该 profile 的组合包列表中移除。
|
||||
|
||||
<a id="plugin-manager-lists"></a>
|
||||
### 插件管理器列表
|
||||
|
||||
@@ -75,6 +75,11 @@ export interface DshBundleManifest {
|
||||
patch: string | string[]
|
||||
/** Show the bundle in GUI lists before the profile enables or installs it; omission means true. */
|
||||
listedByDefault?: boolean
|
||||
/**
|
||||
* Name of the standalone profile this bundle alone composes. `dsh --profile <name>` initializes a missing profile of
|
||||
* that name with this single bundle layer when the installation ships the bundle; omission declares no profile.
|
||||
*/
|
||||
profile?: string
|
||||
}
|
||||
|
||||
/** The bundle composition declared by a profile directory. */
|
||||
|
||||
Generated
+51
-33
@@ -10143,12 +10143,21 @@ importers:
|
||||
|
||||
packages/experimental/cua-mcp:
|
||||
dependencies:
|
||||
'@deepseek-ai/dsh-agent':
|
||||
specifier: workspace:*
|
||||
version: link:../../core/agent
|
||||
'@deepseek-ai/dsh-agent-loop':
|
||||
specifier: workspace:*
|
||||
version: link:../../core/agent-loop
|
||||
'@deepseek-ai/dsh-agent-preset':
|
||||
specifier: workspace:*
|
||||
version: link:../../preset/agent-preset
|
||||
'@deepseek-ai/dsh-agent-preset-registry':
|
||||
specifier: workspace:*
|
||||
version: link:../../preset/agent-preset-registry
|
||||
'@deepseek-ai/dsh-attachment-local':
|
||||
specifier: workspace:*
|
||||
version: link:../../attachment/attachment-local
|
||||
'@deepseek-ai/dsh-cmdline':
|
||||
specifier: workspace:*
|
||||
version: link:../../boot/cmdline
|
||||
@@ -10158,15 +10167,57 @@ importers:
|
||||
'@deepseek-ai/dsh-cua':
|
||||
specifier: workspace:*
|
||||
version: link:../cua
|
||||
'@deepseek-ai/dsh-fs-sandbox':
|
||||
specifier: workspace:*
|
||||
version: link:../../fs/fs-sandbox
|
||||
'@deepseek-ai/dsh-llm':
|
||||
specifier: workspace:*
|
||||
version: link:../../llm/llm
|
||||
'@deepseek-ai/dsh-sandbox-local':
|
||||
specifier: workspace:*
|
||||
version: link:../../sandbox/sandbox-local
|
||||
'@deepseek-ai/dsh-sandbox-policy':
|
||||
specifier: workspace:*
|
||||
version: link:../../sandbox/sandbox-policy
|
||||
'@deepseek-ai/dsh-session':
|
||||
specifier: workspace:*
|
||||
version: link:../../core/session
|
||||
'@deepseek-ai/dsh-session-persistence-jsonl':
|
||||
specifier: workspace:*
|
||||
version: link:../../session/session-persistence-jsonl
|
||||
'@deepseek-ai/dsh-session-projection':
|
||||
specifier: workspace:*
|
||||
version: link:../../session/session-projection
|
||||
'@deepseek-ai/dsh-storage':
|
||||
specifier: workspace:*
|
||||
version: link:../../storage/storage
|
||||
'@deepseek-ai/dsh-storage-domain':
|
||||
specifier: workspace:*
|
||||
version: link:../../storage/storage-domain
|
||||
'@deepseek-ai/dsh-storage-json':
|
||||
specifier: workspace:*
|
||||
version: link:../../storage/storage-json
|
||||
'@deepseek-ai/dsh-subprocess-local':
|
||||
specifier: workspace:*
|
||||
version: link:../../subprocess/subprocess-local
|
||||
'@deepseek-ai/dsh-system-prompt':
|
||||
specifier: workspace:*
|
||||
version: link:../../core/system-prompt
|
||||
'@deepseek-ai/dsh-tool-executor-native':
|
||||
specifier: workspace:*
|
||||
version: link:../../core/tool-executor-native
|
||||
'@deepseek-ai/dsh-tools':
|
||||
specifier: workspace:*
|
||||
version: link:../../core/tools
|
||||
'@deepseek-ai/dsh-user-approval':
|
||||
specifier: workspace:*
|
||||
version: link:../../interaction/user-approval
|
||||
'@deepseek-ai/dsh-user-questions':
|
||||
specifier: workspace:*
|
||||
version: link:../../interaction/user-questions
|
||||
'@deepseek-ai/dsh-working-directory':
|
||||
specifier: workspace:*
|
||||
version: link:../../session/working-directory
|
||||
'@deepseek-ai/schemastery':
|
||||
specifier: link:../../../vendor/schemastery
|
||||
version: link:../../../vendor/schemastery
|
||||
@@ -10189,21 +10240,12 @@ importers:
|
||||
'@deepseek-ai/cordis-plugin-loader':
|
||||
specifier: workspace:~
|
||||
version: link:../../../vendor/loader
|
||||
'@deepseek-ai/dsh-agent':
|
||||
specifier: workspace:*
|
||||
version: link:../../core/agent
|
||||
'@deepseek-ai/dsh-agent-loop':
|
||||
specifier: workspace:*
|
||||
version: link:../../core/agent-loop
|
||||
'@deepseek-ai/dsh-app-boot':
|
||||
specifier: workspace:*
|
||||
version: link:../../boot/app-boot
|
||||
'@deepseek-ai/dsh-attachment':
|
||||
specifier: workspace:*
|
||||
version: link:../../attachment/attachment
|
||||
'@deepseek-ai/dsh-attachment-local':
|
||||
specifier: workspace:*
|
||||
version: link:../../attachment/attachment-local
|
||||
'@deepseek-ai/dsh-brand':
|
||||
specifier: workspace:*
|
||||
version: link:../../util/brand
|
||||
@@ -10213,30 +10255,6 @@ importers:
|
||||
'@deepseek-ai/dsh-ptc-runtime-node':
|
||||
specifier: workspace:*
|
||||
version: link:../../ptc-runtime/ptc-runtime-node
|
||||
'@deepseek-ai/dsh-sandbox-local':
|
||||
specifier: workspace:*
|
||||
version: link:../../sandbox/sandbox-local
|
||||
'@deepseek-ai/dsh-sandbox-policy':
|
||||
specifier: workspace:*
|
||||
version: link:../../sandbox/sandbox-policy
|
||||
'@deepseek-ai/dsh-session-projection':
|
||||
specifier: workspace:*
|
||||
version: link:../../session/session-projection
|
||||
'@deepseek-ai/dsh-subprocess-local':
|
||||
specifier: workspace:*
|
||||
version: link:../../subprocess/subprocess-local
|
||||
'@deepseek-ai/dsh-system-prompt':
|
||||
specifier: workspace:*
|
||||
version: link:../../core/system-prompt
|
||||
'@deepseek-ai/dsh-tool-executor-native':
|
||||
specifier: workspace:*
|
||||
version: link:../../core/tool-executor-native
|
||||
'@deepseek-ai/dsh-tools':
|
||||
specifier: workspace:*
|
||||
version: link:../../core/tools
|
||||
'@deepseek-ai/dsh-working-directory':
|
||||
specifier: workspace:*
|
||||
version: link:../../session/working-directory
|
||||
'@modelcontextprotocol/client':
|
||||
specifier: 2.2.0
|
||||
version: 2.2.0
|
||||
|
||||
@@ -10,6 +10,7 @@ import { loadOverlayPatches } from '../packages/boot/app-boot/src/index.ts'
|
||||
import { readPluginMeta } from '../packages/boot/app-boot/src/package-meta.ts'
|
||||
import { bundlePatchPaths, composeEntries, initProfile, readProfileManifest } from '../packages/boot/app-boot/src/profile.ts'
|
||||
import { OPTIONAL_BUNDLES, PROFILE_TEMPLATES } from '../packages/util/official-bundles/src/bundles.ts'
|
||||
import { HIDDEN_BUNDLES } from '../packages/util/official-bundles/src/plugin-manager.ts'
|
||||
import type { DshBundleManifest } from '../packages/util/package-manifest/src/types.ts'
|
||||
import { createPluginProfile } from '../apps/desktop/src/project-manager.ts'
|
||||
|
||||
@@ -105,7 +106,22 @@ describe('optional bundles', () => {
|
||||
expect(OPTIONAL_BUNDLES).not.toContain('@deepseek-ai/dsh-experimental-inspector')
|
||||
})
|
||||
|
||||
it.each(OPTIONAL_BUNDLES)('%s composes over the Web profile without a skipped patch', (name) => {
|
||||
// A bundle that declares its own profile composes alone; the plugin page never layers it over a GUI profile.
|
||||
const standalone = OPTIONAL_BUNDLES.filter(name => bundles.get(name)?.manifest.dsh?.bundle?.profile !== undefined)
|
||||
const layered = OPTIONAL_BUNDLES.filter(name => !standalone.includes(name))
|
||||
|
||||
it.each(standalone)('%s composes its declared profile alone over the empty root and stays off the plugin page', (name) => {
|
||||
const { patches } = bundle(name)
|
||||
const warnings: string[] = []
|
||||
const composed = composeEntries([patches], message => warnings.push(message))
|
||||
expect(warnings).toEqual([])
|
||||
const topLevelIds = composed.flatMap(entry => typeof entry.id === 'string' ? [entry.id] : [])
|
||||
expect(topLevelIds.length).toBeGreaterThan(0)
|
||||
expect(topLevelIds).toHaveLength(new Set(topLevelIds).size)
|
||||
expect(HIDDEN_BUNDLES).toContain(name)
|
||||
})
|
||||
|
||||
it.each(layered)('%s composes over the Web profile without a skipped patch', (name) => {
|
||||
const { patches } = bundle(name)
|
||||
const warnings: string[] = []
|
||||
const composed = composeEntries([...shipped, patches], message => warnings.push(message))
|
||||
|
||||
Reference in new issue
Block a user