@crazx/dsh 0.1.6-alpha.2.zw.2 → 0.2.1-rc.2.zw.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.i18n.yaml CHANGED
@@ -1,6 +1,22 @@
1
- # Bilingual-pair consistency record (docs/i18n/README.md): the git blob hash of each
2
- # side as of the last confirmed-consistent state. Both languages carry equal authority;
3
- # after editing either side, bring the other along and re-record with:
1
+ # Bilingual-pair consistency record for README.md (docs/i18n/README.md): per heading
2
+ # section, a hash of its English and Chinese blocks outside code blocks and generated regions.
3
+ # After editing either side, bring the other along and re-record with:
4
4
  # pnpm run verify-translation-pairing --write apps/cli/README.md
5
- README.md: 46c6a66336839db443a825c66ebfd71dcce398af
6
- README.zh.md: 14838114b04977e7668e33479d1ba84a8ddc8434
5
+ /deepseek-ai-dsh:
6
+ en: ebdc75fa0da18801
7
+ zh: 5c6cd2554b8f8a98
8
+ /deepseek-ai-dsh/entry-modes:
9
+ en: a1e035a813554366
10
+ zh: b87053214afe71b6
11
+ /deepseek-ai-dsh/app-arguments:
12
+ en: cc03e6b75206661b
13
+ zh: 99e41f4143198352
14
+ /deepseek-ai-dsh/profiles:
15
+ en: 523477a093beb0c2
16
+ zh: f88ea21e5fbea969
17
+ /deepseek-ai-dsh/optional-overlays:
18
+ en: 3a40ddc44e55f79c
19
+ zh: 8d3949132e1ef93c
20
+ /deepseek-ai-dsh/development:
21
+ en: 0a289c1235869927
22
+ zh: a1f473f70036ad37
package/README.md CHANGED
@@ -9,7 +9,7 @@ The `dsh` command is the sole supported Node application launcher: profiles are
9
9
  | Command | Purpose |
10
10
  |---|---|
11
11
  | `dsh <name>` / `dsh --profile <name>` | Boot the named profile under `$DSH_HOME/profiles/<name>`. |
12
- | `dsh --profile <name> --from-default-profile <template>` | Create a new custom profile from a shipped template, then boot it. |
12
+ | `dsh --profile <name> --from-default-profile <template>` | Replace a custom profile with a fresh copy of a shipped template, then boot it. |
13
13
  | `dsh --profile acp` | Serve automation clients over ACP stdio until disconnect. |
14
14
  | `dsh --profile headless "job"` | Run one fresh persisted session, print the final answer, and exit. |
15
15
  | `dsh --profile sdk` | Serve SDK clients over JSON-RPC stdio until shutdown or disconnect. |
@@ -17,7 +17,7 @@ The `dsh` command is the sole supported Node application launcher: profiles are
17
17
  | `dsh web` | Boot the Web profile. |
18
18
  | `dsh plugin --profile <name> <pnpm args>` | Manage a profile's plugins by forwarding to pnpm in the profile directory. |
19
19
 
20
- The invoking directory is the default workspace root. The `web`, `headless`, `sdk`, `sdk-minimal`, and `acp` profiles auto-initialize on first use from shipped templates. Create another profile at an unused, non-shipped name with `--from-default-profile`, or initialize a base-backed profile through `dsh plugin`. The `desktop` name is reserved for the Electron-owned profile, so the CLI rejects boot, config-dump, and plugin-management requests for it.
20
+ The invoking directory is the default workspace root. The `web`, `headless`, `sdk`, `sdk-minimal`, and `acp` profiles auto-initialize on first use from shipped templates. Create or reset another profile at a non-shipped name with `--from-default-profile`, or initialize a base-backed profile through `dsh plugin`. The `desktop` name is reserved for the Electron-owned profile, so the CLI rejects boot and config-dump requests for it. The npm CLI also rejects its plugin-management requests; the [Desktop-installed command](../desktop/README.md#bundled-command-runtime) can manage the initialized Desktop profile using that installation’s runtime.
21
21
 
22
22
  ## App arguments
23
23
 
@@ -36,6 +36,8 @@ dsh --help # the launcher's own help
36
36
 
37
37
  A profile directory holds a `package.json` (out-of-tree plugin dependencies plus the profile manifest `dsh.profile` with its ordered `bundles` list) and a `cordis.patch.yml` (the user's own patch layer). `dsh-hmr`, when enabled in YAML, watches the profile manifest and both profile and home patch files, then recomposes all layers through one serialized reload. Without HMR, changes apply on restart. Edits arriving during watcher registration use the same nonfatal reload reporting as later edits. [Plugin Manager](../../packages/boot/plugin-manager/README.md) shares package operations and the profile write lock with `dsh plugin`; package updates retain disabled bundle selections. CLI package commands inherit authentication variables and terminal descriptors, including interactive build approval; service calls retain their scrubbed environment and captured diagnostics.
38
38
 
39
+ Installation and profile startup enforce the declared `engines.dsh` range, or DSH peer ranges when it is absent, against the same runtime version shown by `dsh --version`. Incompatible plugins require an explicitly acknowledged exact-version exemption. The [plugin manager's compatibility reference](../../packages/boot/plugin-manager/README.md#version-compatibility-and-exemptions) documents `version-exemptions`, `allow-version`, `revoke-version`, persistence, and risks.
40
+
39
41
  The tree composes over an empty root:
40
42
  - each bundle's patch in `dsh.profile.bundles` order
41
43
  - then the profile's `cordis.patch.yml`, then the home-level `$DSH_HOME/cordis.patch.yml`
@@ -43,13 +45,13 @@ The tree composes over an empty root:
43
45
 
44
46
  Bundles named in `dsh.profile.bundles` resolve from the dsh installation first (`@deepseek-ai/dsh-base`, `@deepseek-ai/dsh-web-app`, `@deepseek-ai/dsh-headless`, `@deepseek-ai/dsh-sdk-app`, `@deepseek-ai/dsh-sdk-minimal`, `@deepseek-ai/dsh-acp-app`), then from the profile's own `node_modules`, where pnpm installs out-of-tree plugins.
45
47
 
46
- Use `--dump-default-config` and `--dump-config` to inspect the composed tree without booting it.
48
+ Use `--dump-default-config` and `--dump-config` to inspect the composed tree without booting it. `--dump-config-schema` imports the composed tree's declared plugin schemas and prints JSON Schema for entries and patches instead of configuration values; read the [schema-dump safety and scope](reference/README.md#config-schema-dump) before inspecting untrusted plugins.
47
49
 
48
50
  The [CLI behavior reference](reference/README.md) owns exact layer precedence, flags, shutdown behavior, deployment defaults, and source execution. The [startup and reload failure table](../../packages/boot/app-boot/README.md#startup-and-reload-failures) compares optional and required plugin failures with configuration HMR.
49
51
 
50
52
  ## Optional overlays
51
53
 
52
- `config/examples/` ships opt-in overlays for GitHub review webhooks, session-local Schedule, memory MCP servers, and runtime Cordis tools. They are never part of a default profile; the [user guides](../../docs/user/guide/index.md) and [developer practice guides](../../docs/user/develop/practice/index.md) own setup and safety instructions.
54
+ `config/examples/` ships opt-in overlays for GitHub review webhooks, memory MCP servers, and runtime Cordis tools. They are never part of a default profile; the [user guides](../../docs/user/guide/index.md) and [developer practice guides](../../docs/user/develop/practice/index.md) own setup and safety instructions.
53
55
 
54
56
  ## Development
55
57
 
@@ -57,4 +59,6 @@ Production runs require built package and frontend artifacts. From the repositor
57
59
 
58
60
  The `@deepseek-ai/dsh/profile-boot` export provides the shared profile lifecycle to the Desktop host. A resolved application profile supplies its own installation anchor for runtime package resolution while retaining the Harness home patch, proxy environment, telemetry switch, patch reload, and bounded shutdown.
59
61
 
62
+ Packaged installations call the same `runCli()` entry with their package-manager executable. The Desktop carrier also enables plugin operations for its initialized profile; npm launches omit these options. Installation-owned package environments apply only to plugin package operations; the invoking directory, ordinary profile selection, and agent-shell PATH retain their CLI meanings.
63
+
60
64
  The [Web failure matrix](tests/profiles/web/tests/web-failure-matrix.expected.e2e.ts) runs the built CLI through startup failures and native configuration HMR with `awaitWriteFinish` enabled in `test:expected`. It verifies authenticated HTTP responses, diagnostics, recovery, process exits, and disposal without model API calls; the [startup acceptance](tests/profiles/web/tests/web-best-effort-startup.expected.e2e.ts) also covers the shipped required Web dependencies and port conflicts.
package/README.zh.md CHANGED
@@ -9,7 +9,7 @@
9
9
  | 命令 | 用途 |
10
10
  |---|---|
11
11
  | `dsh <name>` / `dsh --profile <name>` | 启动位于 `$DSH_HOME/profiles/<name>` 的指定 profile。 |
12
- | `dsh --profile <name> --from-default-profile <template>` | 从随附模板创建新的自定义 profile,然后启动它。 |
12
+ | `dsh --profile <name> --from-default-profile <template>` | 用随附模板的全新副本替换自定义 profile,然后启动它。 |
13
13
  | `dsh --profile acp` | 通过 ACP stdio 为自动化客户端提供服务,直至断开连接。 |
14
14
  | `dsh --profile headless "job"` | 运行一个全新的持久化会话,打印最终答案并退出。 |
15
15
  | `dsh --profile sdk` | 通过 JSON-RPC stdio 为 SDK 客户端提供服务,直至关闭或断开连接。 |
@@ -17,7 +17,7 @@
17
17
  | `dsh web` | 启动 Web profile。 |
18
18
  | `dsh plugin --profile <name> <pnpm args>` | 通过在 profile 目录中转发给 pnpm 来管理该 profile 的插件。 |
19
19
 
20
- 运行命令时所在的目录将作为默认 workspace 根目录。`web`、`headless`、`sdk`、`sdk-minimal` 和 `acp` profile 在首次使用时会从随附模板自动初始化。使用 `--from-default-profile` 可以基于这些模板之一,在尚未使用的非内置名称处创建其他 profile;通过 `dsh plugin` 则可以初始化一个以 base 为基础的 profile。`desktop` 名称保留给 Electron 持有的 profile,因此 CLI(命令行界面)会拒绝针对它的启动、配置 dump 和插件管理请求。
20
+ 运行命令时所在的目录将作为默认 workspace 根目录。`web`、`headless`、`sdk`、`sdk-minimal` 和 `acp` profile 在首次使用时会从随附模板自动初始化。使用 `--from-default-profile` 可以基于这些模板之一,在非内置名称处创建或重置其他 profile;通过 `dsh plugin` 则可以初始化一个以 base 为基础的 profile。`desktop` 名称保留给 Electron 持有的 profile,因此 CLI(命令行界面)会拒绝针对它的启动和配置 dump 请求。npm CLI 也会拒绝其插件管理请求;[Desktop 内置命令](../desktop/README.zh.md#bundled-command-runtime)可以使用该安装的运行时管理已初始化的 Desktop profile。
21
21
 
22
22
  ## 应用参数
23
23
 
@@ -36,6 +36,8 @@ dsh --help # the launcher's own help
36
36
 
37
37
  profile 目录包含一个 `package.json`,其中记录树外插件依赖,以及 profile manifest(元数据清单)`dsh.profile`、其中按顺序排列的 `bundles` 列表;还包含一个 `cordis.patch.yml`,其中保存用户自己的 patch 层。在 YAML 中启用的 `dsh-hmr` 监视 profile manifest、profile 与 home 级 patch 文件,再通过统一串行重载重新组合所有层。未启用 HMR 时,更改在重启后生效。监听器注册期间发生的编辑与后续编辑使用相同的非致命重载错误报告。[插件管理器](../../packages/boot/plugin-manager/README.zh.md) 与 `dsh plugin` 共享包操作和 profile 写锁;更新依赖会保留已停用的组合包选择。CLI 包操作继承认证环境和终端描述符,支持交互式构建批准;service 调用保留清理后的环境并捕获诊断。
38
38
 
39
+ 安装和 profile 启动会按声明的 `engines.dsh` 范围(未声明时按 DSH peer 范围),检查与 `dsh --version` 显示值相同的运行时版本。不兼容插件需要用户明确确认精确版本豁免。[插件管理器的兼容性参考](../../packages/boot/plugin-manager/README.zh.md#version-compatibility-and-exemptions)说明 `version-exemptions`、`allow-version`、`revoke-version`、持久化规则与风险。
40
+
39
41
  配置树以空根为起点,依次叠加以下配置层:
40
42
  - `dsh.profile.bundles` 中各组合包的 patch
41
43
  - profile 自身的 `cordis.patch.yml`,然后是 home 级的 `$DSH_HOME/cordis.patch.yml`
@@ -43,13 +45,13 @@ profile 目录包含一个 `package.json`,其中记录树外插件依赖,以
43
45
 
44
46
  `dsh.profile.bundles` 中列出的组合包先从 dsh 安装目录解析(`@deepseek-ai/dsh-base`、`@deepseek-ai/dsh-web-app`、`@deepseek-ai/dsh-headless`、`@deepseek-ai/dsh-sdk-app`、`@deepseek-ai/dsh-sdk-minimal`、`@deepseek-ai/dsh-acp-app`),再从 profile 自身的 `node_modules` 解析;pnpm 会将树外插件安装到该目录。
45
47
 
46
- 使用 `--dump-default-config` 和 `--dump-config` 可在不启动的情况下检查组合后的配置树。
48
+ 使用 `--dump-default-config` 和 `--dump-config` 可在不启动的情况下检查组合后的配置树。`--dump-config-schema` 会导入组合树中插件声明的 schema,并打印描述 entry 与 patch 的 JSON Schema,而不是配置值;检查不受信任的插件前,请阅读 [schema dump 的安全性与范围](reference/README.zh.md#config-schema-dump)。
47
49
 
48
50
  层的确切优先级、flag、关闭行为、部署默认值和源码执行方式,以 [CLI 行为参考](reference/README.zh.md)为准。[启动与重载失败表](../../packages/boot/app-boot/README.zh.md#startup-and-reload-failures)对比 optional、required 插件启动失败与配置 HMR 的行为。
49
51
 
50
52
  ## 可选覆盖层
51
53
 
52
- `config/examples/` 交付 GitHub 评审 webhook、会话内 Schedule、记忆 MCP 服务器与运行时 Cordis 工具的可选覆盖层。它们绝不属于默认 profile;设置与安全说明由[用户指南](../../docs/user/guide/index.zh.md)和[开发实战指南](../../docs/user/develop/practice/index.zh.md)负责。
54
+ `config/examples/` 交付 GitHub 评审 webhook、记忆 MCP 服务器与运行时 Cordis 工具的可选覆盖层。它们绝不属于默认 profile;设置与安全说明由[用户指南](../../docs/user/guide/index.zh.md)和[开发实战指南](../../docs/user/develop/practice/index.zh.md)负责。
53
55
 
54
56
  ## 开发
55
57
 
@@ -57,4 +59,6 @@ profile 目录包含一个 `package.json`,其中记录树外插件依赖,以
57
59
 
58
60
  `@deepseek-ai/dsh/profile-boot` 导出向 Desktop Host 提供共享 profile 生命周期。已解析的应用 profile 为运行时包解析指定自己的安装锚点,同时沿用 Harness home patch、代理环境、遥测开关、patch 热重载和有界关闭。
59
61
 
62
+ 打包安装通过同一个 `runCli()` 入口传入包管理器可执行文件。Desktop 载体还会启用其已初始化 profile 的插件操作;npm 启动不传入这些选项。安装包提供的包管理环境仅用于插件包操作;调用目录、普通 profile 选择与 agent shell 的 PATH 保留 CLI 语义。
63
+
60
64
  [Web 失败矩阵](tests/profiles/web/tests/web-failure-matrix.expected.e2e.ts)在 `test:expected` 中通过构建后的 CLI 验证启动失败与启用 `awaitWriteFinish` 的原生配置 HMR。它不调用模型 API,而是检查经过认证的 HTTP 响应、诊断、恢复、进程退出与 dispose;[启动验收测试](tests/profiles/web/tests/web-best-effort-startup.expected.e2e.ts)还覆盖随附 Web 的必需依赖与端口冲突。
package/lib/bin.js CHANGED
@@ -1,7 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import { readFileSync } from "node:fs";
3
- import { fileURLToPath } from "node:url";
4
- import { StartupError, loadLayeredEnv } from "@deepseek-ai/dsh-app-boot";
2
+ import { StartupError, getDshRuntimeVersion, loadLayeredEnv } from "@deepseek-ai/dsh-app-boot";
5
3
  import { resolveDshHome } from "@deepseek-ai/dsh-home-paths";
6
4
  import { Command, CommanderError, InvalidArgumentError } from "commander";
7
5
  import { randomUUID } from "node:crypto";
@@ -43,7 +41,7 @@ const HELP_EXAMPLES = `
43
41
  Examples:
44
42
  dsh web boot the web profile (same as: dsh --profile web)
45
43
  dsh rescue --from-default-profile web
46
- create rescue from the shipped web template, then boot it
44
+ recreate rescue from the shipped web template, then boot it
47
45
  dsh headless "run the tests" answer one task, print the result, and exit
48
46
  dsh tui --patch ./extra.yml boot a custom profile with one extra overlay
49
47
  dsh tui --resume <session> arguments after the launcher flags reach the app
@@ -64,15 +62,26 @@ function resolveBoot(program, profile, options, args) {
64
62
  const patches = options.patch ?? [];
65
63
  if (patches.includes("")) program.error("error: --patch needs a path");
66
64
  if (options.fromDefaultProfile === "") program.error("error: --from-default-profile needs a name");
67
- if (options.dumpConfig !== true && options.dumpDefaultConfig !== true) return {
65
+ const dumps = [
66
+ options.dumpConfig,
67
+ options.dumpDefaultConfig,
68
+ options.dumpConfigSchema
69
+ ].filter(Boolean);
70
+ if (dumps.length === 0) return {
68
71
  mode: "profile",
69
72
  profile,
70
73
  fromDefaultProfile: options.fromDefaultProfile,
71
74
  patches,
72
75
  args
73
76
  };
74
- if (options.dumpConfig === true && options.dumpDefaultConfig === true) program.error("error: --dump-config and --dump-default-config are mutually exclusive");
77
+ if (dumps.length > 1) program.error("error: --dump-config, --dump-default-config, and --dump-config-schema are mutually exclusive");
75
78
  if (args.length > 0) program.error(`error: config dumps take no app arguments, got ${args.map((argument) => JSON.stringify(argument)).join(" ")}`);
79
+ if (options.dumpConfigSchema === true) return {
80
+ mode: "dump-config-schema",
81
+ profile,
82
+ fromDefaultProfile: options.fromDefaultProfile,
83
+ patches
84
+ };
76
85
  const defaultOnly = options.dumpDefaultConfig === true;
77
86
  if (defaultOnly && patches.length > 0) program.error("error: --dump-default-config prints the bundle layers and takes no --patch");
78
87
  return {
@@ -88,13 +97,14 @@ function resolveBoot(program, profile, options, args) {
88
97
  * error.
89
98
  * @param argv - arguments after the Node binary and script.
90
99
  * @param version - version string printed by `--version`.
100
+ * @param manageDesktopProfile - permit Desktop's installed carrier to manage its reserved profile's plugins.
91
101
  * @returns the resolved invocation.
92
102
  */
93
- function parseDshArgs(argv, version) {
103
+ function parseDshArgs(argv, version, manageDesktopProfile = false) {
94
104
  const first = argv[0];
95
105
  let resolved;
96
106
  const program = new Command();
97
- program.name("dsh").version(version, "-V, --version", "output the version number").usage("[--profile] <name> [options] [app-args...]\n dsh plugin --profile <name> <pnpm-args...>").description("dsh: boot a DeepSeek Harness profile — an ordered stack of plugin-bundle patch layers under your own overrides.").addHelpText("after", HELP_EXAMPLES).exitOverride().helpOption(false).helpCommand(false).allowUnknownOption().passThroughOptions().enablePositionalOptions().argument("[args...]", "arguments for the booted profile's app (see: dsh --profile <name> --help)").option("--profile <name>", "the profile under $DSH_HOME/profiles to boot", selectProfile).option("--from-default-profile <name>", "initialize a new custom profile from a shipped profile template").option("--patch <path>", "extra patch-list overlay applied after the profile layer (repeatable)", collect).option("--dump-config", "print the composed profile tree and exit").option("--dump-default-config", "print the profile tree without its user layer or --patch overlays and exit").action((args, options) => {
107
+ program.name("dsh").version(version, "-V, --version", "output the version number").usage("[--profile] <name> [options] [app-args...]\n dsh plugin --profile <name> <pnpm-args...>").description("dsh: boot a DeepSeek Harness profile — an ordered stack of plugin-bundle patch layers under your own overrides.").addHelpText("after", HELP_EXAMPLES).exitOverride().helpOption(false).helpCommand(false).allowUnknownOption().passThroughOptions().enablePositionalOptions().argument("[args...]", "arguments for the booted profile's app (see: dsh --profile <name> --help)").option("--profile <name>", "the profile under $DSH_HOME/profiles to boot", selectProfile).option("--from-default-profile <name>", "replace a custom profile with a fresh copy of a shipped profile template").option("--patch <path>", "extra patch-list overlay applied after the profile layer (repeatable)", collect).option("--dump-config", "print the composed profile tree and exit").option("--dump-config-schema", "print JSON Schema for profile entries and patches without mounting").option("--dump-default-config", "print the profile tree without its user layer or --patch overlays and exit").action((args, options) => {
98
108
  if (options.profile === void 0) {
99
109
  if (args.some((argument) => argument === "-h" || argument === "--help")) program.help();
100
110
  program.error("error: --profile <name> is required");
@@ -131,13 +141,13 @@ function parseDshArgs(argv, version) {
131
141
  registerWebLog("web:log:tmp", true);
132
142
  if (first === "plugin") {
133
143
  const plugin = program.command("plugin").description("manage a profile's plugins by forwarding the remaining arguments to pnpm in the profile directory");
134
- plugin.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>, ...)").action((args, options) => {
144
+ plugin.helpOption("-h, --help", "show this help").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>, ...)").action((args, options) => {
135
145
  if (options.profile === "") program.error("error: --profile needs a name");
136
- rejectElectronProfile(plugin, options.profile);
146
+ if (!manageDesktopProfile) rejectElectronProfile(plugin, options.profile);
137
147
  if (args.length === 0) program.error("error: plugin needs pnpm arguments to forward (e.g. add <package>)");
138
148
  resolved = {
139
149
  mode: "plugin",
140
- profile: options.profile,
150
+ profile: options.profile.toLowerCase() === "desktop" ? "desktop" : options.profile,
141
151
  args
142
152
  };
143
153
  });
@@ -217,17 +227,15 @@ async function reportStartupFailure(error, context, write = writeStderr) {
217
227
  * @module @deepseek-ai/dsh/bin
218
228
  */
219
229
  /* v8 ignore file -- built-bin acceptance exercises this self-executing dispatch. */
220
- function readVersion() {
221
- const manifest = JSON.parse(readFileSync(fileURLToPath(new URL("../package.json", import.meta.url)), "utf8"));
222
- return typeof manifest.version === "string" ? manifest.version : "0.0.0";
223
- }
224
230
  /**
225
231
  * Run the public dsh command-line interface.
232
+ * @param options - Package runtime and Desktop profile access supplied by the installation.
226
233
  * @returns a promise that settles when the selected command mode finishes.
227
234
  */
228
- async function runCli() {
229
- const version = readVersion();
230
- const invocation = parseDshArgs(process.argv.slice(2), version);
235
+ async function runCli(options = {}) {
236
+ const version = getDshRuntimeVersion();
237
+ const { manageDesktopProfile, ...profileOptions } = options;
238
+ const invocation = parseDshArgs(process.argv.slice(2), version, manageDesktopProfile);
231
239
  switch (invocation.mode) {
232
240
  case "profile": {
233
241
  const { runProfile } = await import("./profile-boot.js");
@@ -237,7 +245,8 @@ async function runCli() {
237
245
  profile: invocation.profile,
238
246
  fromDefaultProfile: invocation.fromDefaultProfile,
239
247
  patchFiles: invocation.patches,
240
- args: invocation.args
248
+ args: invocation.args,
249
+ ...profileOptions
241
250
  });
242
251
  } catch (error) {
243
252
  if (!(error instanceof StartupError)) throw error;
@@ -251,12 +260,12 @@ async function runCli() {
251
260
  break;
252
261
  }
253
262
  case "plugin": {
254
- const { runPlugin } = await import("./plugin-DJ-rVHUS.js");
255
- process.exit(await runPlugin(invocation.profile, invocation.args));
263
+ const { runPlugin } = await import("./plugin-BiveYA7h.js");
264
+ process.exit(await runPlugin(invocation.profile, invocation.args, options.packageManager));
256
265
  break;
257
266
  }
258
267
  case "web-log": {
259
- const { runWebLog } = await import("./web-log-DZLBFfre.js");
268
+ const { runWebLog } = await import("./web-log-DVrp_oFP.js");
260
269
  runWebLog({
261
270
  tmp: invocation.tmp,
262
271
  patches: invocation.patches,
@@ -265,10 +274,15 @@ async function runCli() {
265
274
  break;
266
275
  }
267
276
  case "dump-config": {
268
- const { runDumpConfig } = await import("./dump-config-Bb5YvFIX.js");
277
+ const { runDumpConfig } = await import("./dump-config-CxNkSYcK.js");
269
278
  runDumpConfig(invocation.profile, invocation.defaultOnly, invocation.patches, invocation.fromDefaultProfile);
270
279
  break;
271
280
  }
281
+ case "dump-config-schema": {
282
+ const { runDumpConfigSchema } = await import("./dump-config-schema-D_PxIzpe.js");
283
+ await runDumpConfigSchema(invocation.profile, invocation.patches, invocation.fromDefaultProfile);
284
+ break;
285
+ }
272
286
  default: throw new Error(`dsh: unhandled invocation mode ${JSON.stringify(invocation)}`);
273
287
  }
274
288
  }
@@ -1,7 +1,7 @@
1
- import { a as prepareProfile, n as PROFILE_ROOT_FILENAME, r as homePatchPath } from "./profile-boot-BNu17Y9U.js";
2
- import { existsSync } from "node:fs";
1
+ import { a as prepareProfile, n as PROFILE_ROOT_FILENAME, r as homePatchPath } from "./profile-boot-C14i-8IN.js";
3
2
  import { loadOptionalPatches, loadOverlayPatches, renderConfigDump } from "@deepseek-ai/dsh-app-boot";
4
3
  import { join, resolve } from "node:path";
4
+ import { existsSync } from "node:fs";
5
5
  //#region lib/types/dump-config.js
6
6
  /**
7
7
  * Config-dump entry for `dsh --profile <name> --dump-config`: compose the
@@ -19,10 +19,21 @@ const NAME = "dsh";
19
19
  * (the recovery diagnostic for a broken `cordis.patch.yml`, which is then
20
20
  * never parsed).
21
21
  * @param patches - `--patch` overlay paths, in argv order.
22
- * @param fromDefaultProfile - shipped template used once to initialize a missing profile.
22
+ * @param fromDefaultProfile - shipped template that replaces the profile before loading it.
23
23
  */
24
24
  function runDumpConfig(profile, defaultOnly, patches, fromDefaultProfile) {
25
25
  const loaded = prepareProfile(profile, !defaultOnly, fromDefaultProfile);
26
+ const layers = collectConfigDumpLayers(loaded, defaultOnly, patches);
27
+ process.stdout.write(renderConfigDump(NAME, join(loaded.dir, PROFILE_ROOT_FILENAME), layers));
28
+ }
29
+ /**
30
+ * Read dump layers in bundle, profile, home, then argv order without composing them.
31
+ * @param loaded - prepared profile and parsed bundle and profile patches.
32
+ * @param defaultOnly - omit profile, home, and argv layers without reading their files.
33
+ * @param patches - overlay paths relative to the invoking directory, in argv order.
34
+ * @returns the labeled layers shared by YAML and schema dumps.
35
+ */
36
+ function collectConfigDumpLayers(loaded, defaultOnly, patches) {
26
37
  const layers = loaded.layers.map((layer) => ({
27
38
  label: layer.packageName,
28
39
  patches: layer.patches
@@ -46,8 +57,8 @@ function runDumpConfig(profile, defaultOnly, patches, fromDefaultProfile) {
46
57
  });
47
58
  }
48
59
  }
49
- process.stdout.write(renderConfigDump(NAME, join(loaded.dir, PROFILE_ROOT_FILENAME), layers));
60
+ return layers;
50
61
  }
51
62
  /* v8 ignore stop */
52
63
  //#endregion
53
- export { runDumpConfig };
64
+ export { runDumpConfig as n, collectConfigDumpLayers as t };
@@ -0,0 +1,2 @@
1
+ import { n as runDumpConfig } from "./dump-config-CWs_HdOc.js";
2
+ export { runDumpConfig };
@@ -0,0 +1,41 @@
1
+ import { a as prepareProfile, t as INSTALL_ANCHOR } from "./profile-boot-C14i-8IN.js";
2
+ import { t as collectConfigDumpLayers } from "./dump-config-CWs_HdOc.js";
3
+ import { generateConfigSchema } from "@deepseek-ai/dsh-app-boot";
4
+ //#region lib/types/dump-config-schema.js
5
+ /**
6
+ * Schema-dump entry: inspect the composed profile without applying its plugins.
7
+ * Imports and lazy schema builders execute trusted module code.
8
+ * @module @deepseek-ai/dsh/dump-config-schema
9
+ */
10
+ /* v8 ignore file -- built-bin acceptance drives schema collection and output. */
11
+ const NAME = "dsh";
12
+ /**
13
+ * Print one JSON Schema document; incomplete collection or projection sets exitCode to 1.
14
+ * Profile initialization writes match the YAML dump. Plugin imports may execute
15
+ * top-level code, but collection never applies plugins or evaluates `!!js`.
16
+ * During schema generation, ordinary stdout writes are redirected to stderr.
17
+ * @param profile - the profile name.
18
+ * @param patches - overlay paths, in argv order.
19
+ * @param fromDefaultProfile - shipped template that replaces the profile before loading it.
20
+ * @returns after collection and output, with diagnostics also written to stderr.
21
+ */
22
+ async function runDumpConfigSchema(profile, patches, fromDefaultProfile) {
23
+ const loaded = prepareProfile(profile, true, fromDefaultProfile);
24
+ const layers = collectConfigDumpLayers(loaded, false, patches);
25
+ const stdoutWrite = process.stdout.write;
26
+ let dump;
27
+ process.stdout.write = process.stderr.write.bind(process.stderr);
28
+ try {
29
+ dump = await generateConfigSchema(loaded, layers.map((layer) => layer.patches), INSTALL_ANCHOR);
30
+ } finally {
31
+ process.stdout.write = stdoutWrite;
32
+ }
33
+ process.stdout.write(`${JSON.stringify(dump, null, 2)}\n`);
34
+ for (const diagnostic of dump["x-cordis"].diagnostics) {
35
+ const location = diagnostic.path === void 0 ? "" : ` [${diagnostic.path}]`;
36
+ process.stderr.write(`${NAME}: ${diagnostic.level}:${location} ${diagnostic.message}\n`);
37
+ }
38
+ if (!dump["x-cordis"].complete) process.exitCode = 1;
39
+ }
40
+ //#endregion
41
+ export { runDumpConfigSchema };
@@ -0,0 +1,101 @@
1
+ import { t as INSTALL_ANCHOR } from "./profile-boot-C14i-8IN.js";
2
+ import { DEFAULT_PROFILE_BUNDLES, PROFILE_TEMPLATES, initProfile, readProfileCompatibility, resolveProfileDir } from "@deepseek-ai/dsh-app-boot";
3
+ import { mkdir } from "node:fs/promises";
4
+ import { join } from "node:path";
5
+ import { existsSync } from "node:fs";
6
+ import { runPluginCommand, runProfilePnpm, setProfileVersionExemption } from "@deepseek-ai/dsh-plugin-manager/operations";
7
+ import { withFileLock } from "@deepseek-ai/dsh-atomic-write";
8
+ //#region lib/types/plugin.js
9
+ /** Profile package management and explicit, exact-version compatibility approvals. */
10
+ function requireDesktopProfile(dir) {
11
+ if (!existsSync(join(dir, "package.json"))) throw new Error("Open DeepSeek Harness Desktop once to initialize its profile, then fully quit it before running dsh plugin --profile desktop.");
12
+ }
13
+ /** Parse only DSH-owned commands; all other arguments remain pnpm's responsibility. */
14
+ async function versionCommand(profile, args) {
15
+ const [command, ...rest] = args;
16
+ if (command !== "allow-version" && command !== "revoke-version" && command !== "version-exemptions") return void 0;
17
+ try {
18
+ let packageVersion;
19
+ let runtimeVersion;
20
+ let acceptRisk = false;
21
+ const argumentsIterator = rest.values();
22
+ for (const argument of argumentsIterator) if (argument === "--accept-risk" && command === "allow-version" && !acceptRisk) acceptRisk = true;
23
+ else if (argument === "--dsh-version" && runtimeVersion === void 0) runtimeVersion = argumentsIterator.next().value;
24
+ else if (argument.startsWith("--dsh-version=") && runtimeVersion === void 0) runtimeVersion = argument.slice(14);
25
+ else if (!argument.startsWith("-") && packageVersion === void 0) packageVersion = argument;
26
+ else throw new Error(`unexpected argument ${JSON.stringify(argument)}`);
27
+ if (command === "version-exemptions" && rest.length > 0) throw new Error("usage: dsh plugin version-exemptions");
28
+ let request;
29
+ if (command !== "version-exemptions") {
30
+ if (packageVersion === void 0 || runtimeVersion === void 0) throw new Error(`usage: dsh plugin ${command} <package@version> --dsh-version <exact>${command === "allow-version" ? " --accept-risk" : ""}`);
31
+ request = {
32
+ packageVersion,
33
+ runtimeVersion
34
+ };
35
+ }
36
+ if (command === "allow-version") process.stderr.write("dsh: warning: allowing incompatible plugin versions can break the application or corrupt data. Approval applies only to the exact package and DSH versions.\n");
37
+ const dir = resolveProfileDir(profile);
38
+ if (profile !== "desktop") await mkdir(dir, { recursive: true });
39
+ await withFileLock(join(dir, "package.json"), async () => {
40
+ if (profile === "desktop") requireDesktopProfile(dir);
41
+ else if (!existsSync(join(dir, "package.json"))) initProfile(dir, PROFILE_TEMPLATES[profile]?.bundles ?? DEFAULT_PROFILE_BUNDLES);
42
+ if (request === void 0) {
43
+ const { exemptions, warnings } = readProfileCompatibility(dir);
44
+ for (const warning of warnings) process.stderr.write(`dsh: warning: ${warning}\n`);
45
+ process.stdout.write(JSON.stringify(exemptions, void 0, 2) + "\n");
46
+ } else {
47
+ await setProfileVersionExemption(dir, request.packageVersion, request.runtimeVersion, command === "allow-version", acceptRisk);
48
+ process.stdout.write(`dsh: ${command === "allow-version" ? "allowed" : "revoked"} ${request.packageVersion} for DSH ${request.runtimeVersion}\n`);
49
+ }
50
+ }, { waitMs: 12e4 });
51
+ return 0;
52
+ } catch (error) {
53
+ process.stderr.write(`dsh: ${String(error)}\n`);
54
+ return 1;
55
+ }
56
+ }
57
+ /** Run package management for a profile.
58
+ * @param profile Profile name; Desktop's reserved profile must already be initialized by the application.
59
+ * @param args DSH exemption command or pnpm arguments relative to the invoking directory.
60
+ * @param packageManager Installation-owned executable and environment for pnpm operations.
61
+ * @returns Zero on success; nonzero on invalid approval or package-manager failure.
62
+ */
63
+ async function runPlugin(profile, args, packageManager) {
64
+ if (profile === "desktop") try {
65
+ requireDesktopProfile(resolveProfileDir(profile));
66
+ } catch (error) {
67
+ process.stderr.write(`dsh: ${String(error)}\n`);
68
+ return 1;
69
+ }
70
+ const versionResult = await versionCommand(profile, args);
71
+ if (versionResult !== void 0) return versionResult;
72
+ const dir = resolveProfileDir(profile);
73
+ if (existsSync(join(dir, "package.json"))) for (const warning of readProfileCompatibility(dir).warnings) process.stderr.write(`dsh: warning: ${warning}\n`);
74
+ const context = {
75
+ profile,
76
+ dir,
77
+ installAnchor: INSTALL_ANCHOR,
78
+ cwd: process.cwd()
79
+ };
80
+ const options = {
81
+ ...packageManager,
82
+ execution: "cli",
83
+ outputBytes: 16384,
84
+ lockWaitMs: 12e4,
85
+ lookupTimeoutMs: 12e4,
86
+ onOutput: (text, stream) => {
87
+ process[stream].write(text);
88
+ }
89
+ };
90
+ const result = profile === "desktop" ? await withFileLock(join(dir, "package.json"), async () => {
91
+ requireDesktopProfile(dir);
92
+ return runProfilePnpm(context, args, options);
93
+ }, { waitMs: 12e4 }) : await runPluginCommand(context, args, options);
94
+ if (result.exitCode === 127) process.stderr.write("dsh: pnpm was not found; install pnpm and make it available on PATH.\n");
95
+ for (const { name, version, runtimeVersion } of result.incompatible ?? []) process.stderr.write(`dsh: to accept the risk, run: dsh plugin --profile ${profile} allow-version ${name}@${version} --dsh-version ${runtimeVersion} --accept-risk\n`);
96
+ if (result.exitCode !== 0) process.stderr.write(`dsh: plugin command failed; diagnostics: ${result.logPath}\n`);
97
+ if (result.exitCode !== 0 && args.some((argument) => /^git\+|^github:|\.git(?:#|$)/.test(argument))) process.stderr.write(`dsh: git-hosted plugins build on install via their prepare script, which pnpm blocks until allowed — add the exact key pnpm printed above under allowBuilds in ${join(resolveProfileDir(profile), "pnpm-workspace.yaml")}, then re-run\n`);
98
+ return result.exitCode;
99
+ }
100
+ //#endregion
101
+ export { runPlugin };
@@ -1,8 +1,8 @@
1
- import { existsSync, mkdirSync, rmSync, writeFileSync } from "node:fs";
2
- import { fileURLToPath } from "node:url";
3
- import { PROFILE_PATCH_FILENAME, PROFILE_TEMPLATES, PluginPackages, boot, createProfileResolutionGeneration, healIsolatedProfileModuleFallback, healProfilesModuleFallback, initProfile, installFailLoud, loadOverlayPatches, loadProfile, readProfilePatches, resolveProfileDir } from "@deepseek-ai/dsh-app-boot";
1
+ import { PROFILE_PATCH_FILENAME, PROFILE_TEMPLATES, PluginPackages, boot, createRuntimeResolution, initProfile, installFailLoud, loadOverlayPatches, loadProfile, readProfilePatches, reportSkippedBundles, resolveProfileDir } from "@deepseek-ai/dsh-app-boot";
4
2
  import { resolveDshHome } from "@deepseek-ai/dsh-home-paths";
5
3
  import { dirname, join, resolve } from "node:path";
4
+ import { existsSync, mkdirSync, mkdtempSync, renameSync, rmSync, writeFileSync } from "node:fs";
5
+ import { fileURLToPath } from "node:url";
6
6
  import { installProxyFromEnvironment } from "@deepseek-ai/dsh-http-proxy";
7
7
  import { DSH_LAUNCH_ENVIRONMENT_KEY } from "@deepseek-ai/dsh-launch-environment";
8
8
  import { provideCmdline } from "@deepseek-ai/dsh-cmdline";
@@ -126,15 +126,22 @@ const PROFILE_ROOT_CONFIG = `# dsh profile root — an empty entry list. The tre
126
126
  /** Root config filename inside a profile directory. */
127
127
  const PROFILE_ROOT_FILENAME = "cordis.yml";
128
128
  /**
129
- * Initialize a missing profile from one shipped template. This copies only
130
- * the template's bundle list; local state from the
129
+ * Replace the named custom profile with a fresh copy of one shipped template.
130
+ * This copies only the template's bundle list; local state from the
131
131
  * same-named shipped profile is not read, and no inheritance metadata is
132
- * persisted. Shipped profile names are reserved, and the target directory is
133
- * claimed exclusively so existing or concurrent state is never reused.
134
- * @param name - the new profile name.
132
+ * persisted. The new profile is assembled in a `.<name>.staging-*` directory
133
+ * under the profiles directory and moved into place; only then is any previous
134
+ * target directory, including its dependencies and user patch, deleted. A
135
+ * failed move restores the previous directory; when restoring also fails, it
136
+ * stays in the staging directory. Shipped profile names, compared without
137
+ * case, are reserved. Concurrent replacements leave one complete copy; each
138
+ * one either succeeds or reports the concurrent recreation.
139
+ * @param name - the profile name to create or replace.
135
140
  * @param fromDefaultProfile - shipped profile template to copy.
136
141
  * @param home - Harness home containing the profile directory.
137
- * @throws when the template is unknown, the target name is shipped, or the target directory exists.
142
+ * @throws when the template is unknown, the target name is shipped, another process recreates the target
143
+ * between the two renames, or a file-system operation fails; a restore failure is an `AggregateError`
144
+ * that names the staging path holding the previous profile.
138
145
  */
139
146
  function initializeProfileFromDefault(name, fromDefaultProfile, home = resolveDshHome()) {
140
147
  const dir = resolveProfileDir(name, home);
@@ -143,28 +150,52 @@ function initializeProfileFromDefault(name, fromDefaultProfile, home = resolveDs
143
150
  const expected = Object.keys(PROFILE_TEMPLATES).sort().map((value) => JSON.stringify(value)).join(", ");
144
151
  throw new Error(`${NAME}: unknown default profile ${JSON.stringify(fromDefaultProfile)}; expected one of ${expected}`);
145
152
  }
146
- if (Object.hasOwn(PROFILE_TEMPLATES, name)) throw new Error(`${NAME}: profile ${JSON.stringify(name)} is shipped and cannot be a custom profile target; omit --from-default-profile to use it`);
153
+ const shipped = Object.keys(PROFILE_TEMPLATES).find((shippedName) => shippedName.toLowerCase() === name.toLowerCase());
154
+ if (shipped !== void 0) throw new Error(`${NAME}: profile ${JSON.stringify(name)} names shipped profile ${JSON.stringify(shipped)} and cannot be a custom profile target; omit --from-default-profile to use it`);
147
155
  mkdirSync(dirname(dir), { recursive: true });
156
+ const staging = mkdtempSync(join(dirname(dir), `.${name}.staging-`));
157
+ const previous = join(staging, "previous");
148
158
  try {
149
- mkdirSync(dir);
159
+ const fresh = join(staging, "new", name);
160
+ initProfile(fresh, template.bundles);
161
+ let moved = false;
162
+ try {
163
+ renameSync(dir, previous);
164
+ moved = true;
165
+ } catch (error) {
166
+ if (error.code !== "ENOENT") throw error;
167
+ }
168
+ try {
169
+ renameSync(fresh, dir);
170
+ } catch (error) {
171
+ if (existsSync(dir)) {
172
+ rmSync(previous, {
173
+ recursive: true,
174
+ force: true
175
+ });
176
+ throw new Error(`${NAME}: profile ${JSON.stringify(name)} was recreated concurrently at ${dir}`, { cause: error });
177
+ }
178
+ if (moved) try {
179
+ renameSync(previous, dir);
180
+ } catch (restoreError) {
181
+ throw new AggregateError([error, restoreError], `${NAME}: profile replacement failed and ${dir} could not be restored from ${previous}`);
182
+ }
183
+ throw error;
184
+ }
150
185
  } catch (error) {
151
- if (error.code !== "EEXIST") throw error;
152
- const manifestPath = join(dir, "package.json");
153
- if (existsSync(manifestPath)) throw new Error(`${NAME}: profile ${JSON.stringify(name)} already exists at ${manifestPath}; omit --from-default-profile to use it`);
154
- throw new Error(`${NAME}: profile directory ${dir} already exists; choose an unused profile name`);
186
+ if (!existsSync(previous)) rmSync(staging, {
187
+ recursive: true,
188
+ force: true
189
+ });
190
+ throw error;
155
191
  }
156
192
  try {
157
- initProfile(dir, template.bundles);
193
+ rmSync(staging, {
194
+ recursive: true,
195
+ force: true
196
+ });
158
197
  } catch (error) {
159
- try {
160
- rmSync(dir, {
161
- recursive: true,
162
- force: true
163
- });
164
- } catch (cleanupError) {
165
- throw new AggregateError([error, cleanupError], `${NAME}: profile initialization failed and ${dir} could not be removed`);
166
- }
167
- throw error;
198
+ process.stderr.write(`${NAME}: replaced profile ${JSON.stringify(name)} but could not remove ${staging}: ${String(error)}\n`);
168
199
  }
169
200
  }
170
201
  /**
@@ -178,13 +209,14 @@ function initializeProfileFromDefault(name, fromDefaultProfile, home = resolveDs
178
209
  * the identical base).
179
210
  * @param name - the profile name.
180
211
  * @param userLayer - `false` skips parsing `cordis.patch.yml` (the default dump).
181
- * @param fromDefaultProfile - shipped template used once to initialize a missing profile.
212
+ * @param fromDefaultProfile - shipped template that replaces the profile before loading it.
182
213
  * @returns the loaded profile.
183
- * @throws when explicit initialization names an unknown template or an existing profile.
214
+ * @throws when explicit initialization names an unknown template or a shipped target.
184
215
  */
185
216
  function prepareProfile(name, userLayer = true, fromDefaultProfile) {
186
217
  if (fromDefaultProfile !== void 0) initializeProfileFromDefault(name, fromDefaultProfile);
187
218
  const profile = loadProfile(NAME, name, INSTALL_ANCHOR, void 0, { userLayer });
219
+ reportSkippedBundles(NAME, profile);
188
220
  writeFileSync(join(profile.dir, PROFILE_ROOT_FILENAME), PROFILE_ROOT_CONFIG);
189
221
  return profile;
190
222
  }
@@ -197,22 +229,19 @@ function prepareProfile(name, userLayer = true, fromDefaultProfile) {
197
229
  * then the telemetry switch.
198
230
  * @param name - the profile name.
199
231
  * @param patchFiles - `--patch` overlay paths, in argv order.
200
- * @param resolutionMode - runtime lookup, disk links, or dual verification of both.
201
- * @param fromDefaultProfile - shipped template for a missing named profile.
232
+ * @param fromDefaultProfile - shipped template that replaces the named profile.
202
233
  * @param resolvedProfile - application-owned profile and installation.
203
234
  * @returns the profile and its patch layers.
204
235
  */
205
- async function composeProfile(name, patchFiles, resolutionMode, fromDefaultProfile, resolvedProfile) {
236
+ async function composeProfile(name, patchFiles, fromDefaultProfile, resolvedProfile) {
206
237
  const profile = resolvedProfile?.profile ?? prepareProfile(name, true, fromDefaultProfile);
207
238
  if (resolvedProfile !== void 0) writeFileSync(join(profile.dir, PROFILE_ROOT_FILENAME), PROFILE_ROOT_CONFIG);
208
- const resolutionOptions = {
209
- installAnchor: resolvedProfile?.installAnchor ?? INSTALL_ANCHOR,
210
- profile
211
- };
212
- if (resolvedProfile !== void 0 && resolutionMode !== "runtime") healIsolatedProfileModuleFallback(resolvedProfile);
213
239
  return {
214
240
  profile,
215
- resolution: resolutionMode === "runtime" || resolvedProfile !== void 0 ? await createProfileResolutionGeneration(resolutionOptions) : await healProfilesModuleFallback(resolutionOptions),
241
+ resolution: await createRuntimeResolution({
242
+ installAnchor: resolvedProfile?.installAnchor ?? INSTALL_ANCHOR,
243
+ profile
244
+ }),
216
245
  overlays: patchFiles.flatMap((file) => loadOverlayPatches(NAME, resolve(file)))
217
246
  };
218
247
  }
@@ -227,7 +256,6 @@ async function runProfile(options) {
227
256
  const disposeProxy = await installProxyFromEnvironment(options.environment, (message) => {
228
257
  process.stderr.write(`${NAME}: ${message}\n`);
229
258
  });
230
- const resolutionMode = process.pkg !== void 0 ? "runtime" : options.resolutionMode ?? "runtime";
231
259
  const app = {};
232
260
  let disposal;
233
261
  const dispose = () => disposal ??= (async () => {
@@ -241,7 +269,7 @@ async function runProfile(options) {
241
269
  if (failures.length > 1) throw new AggregateError(failures, "dsh: profile cleanup failed");
242
270
  })();
243
271
  try {
244
- const composed = await composeProfile(options.profile, options.patchFiles, resolutionMode, options.fromDefaultProfile, options.resolvedProfile);
272
+ const composed = await composeProfile(options.profile, options.patchFiles, options.fromDefaultProfile, options.resolvedProfile);
245
273
  const appReady = createAppReady();
246
274
  const shutdown = createProcessShutdown(dispose);
247
275
  const signalShutdown = new AbortController();
@@ -275,10 +303,7 @@ async function runProfile(options) {
275
303
  app.current = hostCtx;
276
304
  hostCtx.provide("profileContext", profileContext);
277
305
  hostCtx.provide(DSH_LAUNCH_ENVIRONMENT_KEY, options.environment);
278
- await hostCtx.plugin(PluginPackages, resolutionMode === "link" ? {} : {
279
- generation: composed.resolution,
280
- behavior: resolutionMode === "dual" ? "verify" : "enforce"
281
- });
306
+ await hostCtx.plugin(PluginPackages, { resolution: composed.resolution });
282
307
  provideCmdline(hostCtx, {
283
308
  args: options.args,
284
309
  exit: (code) => void shutdown.shutdown(code),
@@ -1,2 +1,2 @@
1
- import { a as prepareProfile, i as initializeProfileFromDefault, n as PROFILE_ROOT_FILENAME, o as runProfile, r as homePatchPath, t as INSTALL_ANCHOR } from "./profile-boot-BNu17Y9U.js";
1
+ import { a as prepareProfile, i as initializeProfileFromDefault, n as PROFILE_ROOT_FILENAME, o as runProfile, r as homePatchPath, t as INSTALL_ANCHOR } from "./profile-boot-C14i-8IN.js";
2
2
  export { INSTALL_ANCHOR, PROFILE_ROOT_FILENAME, homePatchPath, initializeProfileFromDefault, prepareProfile, runProfile };
@@ -19,7 +19,7 @@
19
19
  interface ProfileInvocation {
20
20
  mode: 'profile';
21
21
  profile: string;
22
- /** Shipped template used once to initialize a missing profile. */
22
+ /** Shipped template that replaces the named profile. */
23
23
  fromDefaultProfile?: string | undefined;
24
24
  /** Extra patch-list overlays applied after the profile's own layer, in argv order. */
25
25
  patches: string[];
@@ -30,12 +30,20 @@ interface ProfileInvocation {
30
30
  interface DumpConfigInvocation {
31
31
  mode: 'dump-config';
32
32
  profile: string;
33
- /** Shipped template used once to initialize a missing profile. */
33
+ /** Shipped template that replaces the named profile. */
34
34
  fromDefaultProfile?: string | undefined;
35
35
  /** Omit the profile's user layer and --patch overlays; print bundle layers only. */
36
36
  defaultOnly: boolean;
37
37
  patches: string[];
38
38
  }
39
+ /** Print declared plugin schemas without mounting the profile. */
40
+ interface DumpConfigSchemaInvocation {
41
+ mode: 'dump-config-schema';
42
+ profile: string;
43
+ /** Shipped template that replaces the named profile. */
44
+ fromDefaultProfile?: string | undefined;
45
+ patches: string[];
46
+ }
39
47
  /** Manage a profile's plugins: forward `args` to pnpm inside the profile directory. */
40
48
  interface PluginInvocation {
41
49
  mode: 'plugin';
@@ -53,14 +61,15 @@ interface WebLogInvocation {
53
61
  args: string[];
54
62
  }
55
63
  /** The resolved `dsh` invocation. Help, version, and errors exit inside {@link parseDshArgs}. */
56
- export type DshInvocation = ProfileInvocation | DumpConfigInvocation | PluginInvocation | WebLogInvocation;
64
+ export type DshInvocation = ProfileInvocation | DumpConfigInvocation | DumpConfigSchemaInvocation | PluginInvocation | WebLogInvocation;
57
65
  /**
58
66
  * Resolve argv into one invocation, or print and exit for help, version, or an
59
67
  * error.
60
68
  * @param argv - arguments after the Node binary and script.
61
69
  * @param version - version string printed by `--version`.
70
+ * @param manageDesktopProfile - permit Desktop's installed carrier to manage its reserved profile's plugins.
62
71
  * @returns the resolved invocation.
63
72
  */
64
- export declare function parseDshArgs(argv: readonly string[], version: string): DshInvocation;
73
+ export declare function parseDshArgs(argv: readonly string[], version: string, manageDesktopProfile?: boolean): DshInvocation;
65
74
  export {};
66
75
  //# sourceMappingURL=args.d.ts.map
@@ -3,9 +3,16 @@
3
3
  * Command-line entry for dsh.
4
4
  * @module @deepseek-ai/dsh/bin
5
5
  */
6
+ import type { RunProfileOptions } from './profile-boot.ts';
7
+ /** Installation-owned dependencies supplied by a packaged CLI launcher. */
8
+ export type RunCliOptions = Pick<RunProfileOptions, 'packageManager'> & {
9
+ /** Permit plugin commands for Desktop's existing profile; reserved for its installed carrier. */
10
+ manageDesktopProfile?: boolean;
11
+ };
6
12
  /**
7
13
  * Run the public dsh command-line interface.
14
+ * @param options - Package runtime and Desktop profile access supplied by the installation.
8
15
  * @returns a promise that settles when the selected command mode finishes.
9
16
  */
10
- export declare function runCli(): Promise<void>;
17
+ export declare function runCli(options?: RunCliOptions): Promise<void>;
11
18
  //# sourceMappingURL=bin.d.ts.map
@@ -0,0 +1,17 @@
1
+ /**
2
+ * Schema-dump entry: inspect the composed profile without applying its plugins.
3
+ * Imports and lazy schema builders execute trusted module code.
4
+ * @module @deepseek-ai/dsh/dump-config-schema
5
+ */
6
+ /**
7
+ * Print one JSON Schema document; incomplete collection or projection sets exitCode to 1.
8
+ * Profile initialization writes match the YAML dump. Plugin imports may execute
9
+ * top-level code, but collection never applies plugins or evaluates `!!js`.
10
+ * During schema generation, ordinary stdout writes are redirected to stderr.
11
+ * @param profile - the profile name.
12
+ * @param patches - overlay paths, in argv order.
13
+ * @param fromDefaultProfile - shipped template that replaces the profile before loading it.
14
+ * @returns after collection and output, with diagnostics also written to stderr.
15
+ */
16
+ export declare function runDumpConfigSchema(profile: string, patches: readonly string[], fromDefaultProfile?: string): Promise<void>;
17
+ //# sourceMappingURL=dump-config-schema.d.ts.map
@@ -5,6 +5,7 @@
5
5
  * profile's own patch file, and each `--patch` overlay.
6
6
  * @module @deepseek-ai/dsh/dump-config
7
7
  */
8
+ import { type ConfigDumpLayer, type Profile } from '@deepseek-ai/dsh-app-boot';
8
9
  /**
9
10
  * Print a profile composition with comments naming each source file and patch layer.
10
11
  * @param profile - the profile name.
@@ -12,7 +13,15 @@
12
13
  * (the recovery diagnostic for a broken `cordis.patch.yml`, which is then
13
14
  * never parsed).
14
15
  * @param patches - `--patch` overlay paths, in argv order.
15
- * @param fromDefaultProfile - shipped template used once to initialize a missing profile.
16
+ * @param fromDefaultProfile - shipped template that replaces the profile before loading it.
16
17
  */
17
18
  export declare function runDumpConfig(profile: string, defaultOnly: boolean, patches: readonly string[], fromDefaultProfile?: string): void;
19
+ /**
20
+ * Read dump layers in bundle, profile, home, then argv order without composing them.
21
+ * @param loaded - prepared profile and parsed bundle and profile patches.
22
+ * @param defaultOnly - omit profile, home, and argv layers without reading their files.
23
+ * @param patches - overlay paths relative to the invoking directory, in argv order.
24
+ * @returns the labeled layers shared by YAML and schema dumps.
25
+ */
26
+ export declare function collectConfigDumpLayers(loaded: Profile, defaultOnly: boolean, patches: readonly string[]): ConfigDumpLayer[];
18
27
  //# sourceMappingURL=dump-config.d.ts.map
@@ -1,7 +1,9 @@
1
+ import { type ProfileContext } from '@deepseek-ai/dsh-app-boot';
1
2
  /** Run package management for a profile.
2
- * @param profile Profile name.
3
- * @param args Pnpm arguments relative to the invoking directory.
4
- * @returns Pnpm exit code.
3
+ * @param profile Profile name; Desktop's reserved profile must already be initialized by the application.
4
+ * @param args DSH exemption command or pnpm arguments relative to the invoking directory.
5
+ * @param packageManager Installation-owned executable and environment for pnpm operations.
6
+ * @returns Zero on success; nonzero on invalid approval or package-manager failure.
5
7
  */
6
- export declare function runPlugin(profile: string, args: readonly string[]): Promise<number>;
8
+ export declare function runPlugin(profile: string, args: readonly string[], packageManager?: ProfileContext['packageManager']): Promise<number>;
7
9
  //# sourceMappingURL=plugin.d.ts.map
@@ -10,7 +10,7 @@
10
10
  * @module @deepseek-ai/dsh/profile-boot
11
11
  */
12
12
  import { type Context } from '@deepseek-ai/cordis';
13
- import { type ProfileContext, type Profile, type ProfileResolutionMode } from '@deepseek-ai/dsh-app-boot';
13
+ import { type ProfileContext, type Profile } from '@deepseek-ai/dsh-app-boot';
14
14
  import { type LaunchEnvironmentSnapshot } from '@deepseek-ai/dsh-launch-environment';
15
15
  import { type ProcessShutdown } from './process-shutdown.ts';
16
16
  /**
@@ -25,15 +25,22 @@ export declare const INSTALL_ANCHOR: string;
25
25
  /** Root config filename inside a profile directory. */
26
26
  export declare const PROFILE_ROOT_FILENAME = "cordis.yml";
27
27
  /**
28
- * Initialize a missing profile from one shipped template. This copies only
29
- * the template's bundle list; local state from the
28
+ * Replace the named custom profile with a fresh copy of one shipped template.
29
+ * This copies only the template's bundle list; local state from the
30
30
  * same-named shipped profile is not read, and no inheritance metadata is
31
- * persisted. Shipped profile names are reserved, and the target directory is
32
- * claimed exclusively so existing or concurrent state is never reused.
33
- * @param name - the new profile name.
31
+ * persisted. The new profile is assembled in a `.<name>.staging-*` directory
32
+ * under the profiles directory and moved into place; only then is any previous
33
+ * target directory, including its dependencies and user patch, deleted. A
34
+ * failed move restores the previous directory; when restoring also fails, it
35
+ * stays in the staging directory. Shipped profile names, compared without
36
+ * case, are reserved. Concurrent replacements leave one complete copy; each
37
+ * one either succeeds or reports the concurrent recreation.
38
+ * @param name - the profile name to create or replace.
34
39
  * @param fromDefaultProfile - shipped profile template to copy.
35
40
  * @param home - Harness home containing the profile directory.
36
- * @throws when the template is unknown, the target name is shipped, or the target directory exists.
41
+ * @throws when the template is unknown, the target name is shipped, another process recreates the target
42
+ * between the two renames, or a file-system operation fails; a restore failure is an `AggregateError`
43
+ * that names the staging path holding the previous profile.
37
44
  */
38
45
  export declare function initializeProfileFromDefault(name: string, fromDefaultProfile: string, home?: string): void;
39
46
  /**
@@ -47,9 +54,9 @@ export declare function initializeProfileFromDefault(name: string, fromDefaultPr
47
54
  * the identical base).
48
55
  * @param name - the profile name.
49
56
  * @param userLayer - `false` skips parsing `cordis.patch.yml` (the default dump).
50
- * @param fromDefaultProfile - shipped template used once to initialize a missing profile.
57
+ * @param fromDefaultProfile - shipped template that replaces the profile before loading it.
51
58
  * @returns the loaded profile.
52
- * @throws when explicit initialization names an unknown template or an existing profile.
59
+ * @throws when explicit initialization names an unknown template or a shipped target.
53
60
  */
54
61
  export declare function prepareProfile(name: string, userLayer?: boolean, fromDefaultProfile?: string): Profile;
55
62
  /** An application-owned profile and its independent installation fallback. */
@@ -67,7 +74,7 @@ export interface RunProfileOptions {
67
74
  profile: string;
68
75
  /** Loaded application profile; bypasses named profile initialization when supplied. */
69
76
  resolvedProfile?: ResolvedProfileRuntime | undefined;
70
- /** Shipped template used once to initialize a missing profile. */
77
+ /** Shipped template that replaces the named profile before boot. */
71
78
  fromDefaultProfile?: string | undefined;
72
79
  /** `--patch` overlay paths, in argv order. */
73
80
  patchFiles: readonly string[];
@@ -75,8 +82,6 @@ export interface RunProfileOptions {
75
82
  args: readonly string[];
76
83
  /** Application-owned package runtime, scoped to plugin package operations. */
77
84
  packageManager?: ProfileContext['packageManager'];
78
- /** Module fallback backend; defaults to runtime. Plain Node callers may override it; pkg executables always use runtime. */
79
- resolutionMode?: ProfileResolutionMode;
80
85
  }
81
86
  /**
82
87
  * Boot one profile invocation end to end and leave process lifetime to the
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@crazx/dsh",
3
3
  "description": "dsh CLI: profile launch, plugin management, and configuration inspection",
4
- "version": "0.1.6-alpha.2.zw.2",
4
+ "version": "0.2.1-rc.2.zw.2",
5
5
  "publishConfig": {
6
6
  "access": "public"
7
7
  },
@@ -18,140 +18,149 @@
18
18
  "lib/*.js",
19
19
  "lib/types/*.d.ts"
20
20
  ],
21
- "dsh": {
22
- "configTrees": [
23
- {
24
- "mount": "config/agent-presets",
25
- "path": "../../packages/preset/agent-presets/presets",
26
- "scanRoster": true
27
- }
28
- ]
29
- },
30
21
  "license": "MIT",
31
22
  "dependencies": {
32
- "@deepseek-ai/cordis": "^4.0.2",
33
- "@deepseek-ai/dsh-hmr": "^0.1.6-alpha.2",
34
- "@deepseek-ai/cordis-plugin-include": "^1.0.7",
35
- "@deepseek-ai/cordis-plugin-loader": "^1.0.3",
36
- "@deepseek-ai/cordis-plugin-timer": "^1.1.4",
37
- "@deepseek-ai/dsh-acp-app": "^0.1.6-alpha.2",
38
- "@deepseek-ai/dsh-agent-instructions": "^0.1.6-alpha.2",
39
- "@deepseek-ai/dsh-agent-tool-presentation": "^0.1.6-alpha.2",
40
- "@deepseek-ai/dsh-app-boot": "^0.1.6-alpha.2",
41
- "@deepseek-ai/dsh-base": "^0.1.6-alpha.2",
42
- "@deepseek-ai/dsh-client-ui-agent-preset": "^0.1.6-alpha.2",
43
- "@deepseek-ai/dsh-client-ui-cordis": "^0.1.6-alpha.2",
44
- "@deepseek-ai/dsh-cmdline": "^0.1.6-alpha.2",
45
- "@deepseek-ai/dsh-command-compact": "^0.1.6-alpha.2",
46
- "@deepseek-ai/dsh-command-goal": "^0.1.6-alpha.2",
47
- "@deepseek-ai/dsh-compaction-basic": "npm:@crazx/dsh-compaction-basic@0.1.6-alpha.2.zw.2",
48
- "@deepseek-ai/dsh-compaction-tool-result-pruner": "^0.1.6-alpha.2",
49
- "@deepseek-ai/dsh-cordis-client-runner": "^0.1.6-alpha.2",
50
- "@deepseek-ai/dsh-experimental-agent-team-profile": "^0.1.6-alpha.2",
51
- "@deepseek-ai/dsh-experimental-agent-team-web-profile": "^0.1.6-alpha.2",
52
- "@deepseek-ai/dsh-fs-local": "^0.1.6-alpha.2",
53
- "@deepseek-ai/dsh-goal": "^0.1.6-alpha.2",
54
- "@deepseek-ai/dsh-goal-round-driver": "^0.1.6-alpha.2",
55
- "@deepseek-ai/dsh-headless": "^0.1.6-alpha.2",
56
- "@deepseek-ai/dsh-home-paths": "^0.1.6-alpha.2",
57
- "@deepseek-ai/dsh-hooks-claude-code": "^0.1.6-alpha.2",
58
- "@deepseek-ai/dsh-hooks-codex": "^0.1.6-alpha.2",
59
- "@deepseek-ai/dsh-jobs-local": "^0.1.6-alpha.2",
60
- "@deepseek-ai/dsh-launch-environment": "^0.1.6-alpha.2",
61
- "@deepseek-ai/dsh-mcp-client": "npm:@crazx/dsh-mcp-client@0.1.6-alpha.2.zw.2",
62
- "@deepseek-ai/dsh-persona": "^0.1.6-alpha.2",
63
- "@deepseek-ai/dsh-plan-mode": "^0.1.6-alpha.2",
64
- "@deepseek-ai/dsh-pwsh-local": "^0.1.6-alpha.2",
65
- "@deepseek-ai/dsh-pwsh-sandbox": "^0.1.6-alpha.2",
66
- "@deepseek-ai/dsh-schedule": "^0.1.6-alpha.2",
67
- "@deepseek-ai/dsh-sdk-app": "^0.1.6-alpha.2",
68
- "@deepseek-ai/dsh-sdk-minimal": "^0.1.6-alpha.2",
69
- "@deepseek-ai/dsh-session-projection": "^0.1.6-alpha.2",
70
- "@deepseek-ai/dsh-session-reference": "^0.1.6-alpha.2",
71
- "@deepseek-ai/dsh-skill": "^0.1.6-alpha.2",
72
- "@deepseek-ai/dsh-skill-filesystem": "^0.1.6-alpha.2",
73
- "@deepseek-ai/dsh-terminal": "^0.1.6-alpha.2",
74
- "@deepseek-ai/dsh-terminal-bash": "^0.1.6-alpha.2",
75
- "@deepseek-ai/dsh-time-context": "^0.1.6-alpha.2",
76
- "@deepseek-ai/dsh-tmux-context": "^0.1.6-alpha.2",
77
- "@deepseek-ai/dsh-token-meter": "^0.1.6-alpha.2",
78
- "@deepseek-ai/dsh-tool-ask-user": "^0.1.6-alpha.2",
79
- "@deepseek-ai/dsh-tool-bash": "^0.1.6-alpha.2",
80
- "@deepseek-ai/dsh-tool-bash-persistent": "^0.1.6-alpha.2",
81
- "@deepseek-ai/dsh-tool-cordis": "npm:@crazx/dsh-tool-cordis@0.1.6-alpha.2.zw.2",
82
- "@deepseek-ai/dsh-tool-present": "^0.1.6-alpha.2",
83
- "@deepseek-ai/dsh-tool-fs": "^0.1.6-alpha.2",
84
- "@deepseek-ai/dsh-tool-fs-search": "^0.1.6-alpha.2",
85
- "@deepseek-ai/dsh-tool-goal": "^0.1.6-alpha.2",
86
- "@deepseek-ai/dsh-tool-jobs": "^0.1.6-alpha.2",
87
- "@deepseek-ai/dsh-tool-pwsh": "^0.1.6-alpha.2",
88
- "@deepseek-ai/dsh-tool-pwsh-persistent": "^0.1.6-alpha.2",
89
- "@deepseek-ai/dsh-tool-ralph": "^0.1.6-alpha.2",
90
- "@deepseek-ai/dsh-tool-skill": "^0.1.6-alpha.2",
91
- "@deepseek-ai/dsh-tool-str-replace-editor": "^0.1.6-alpha.2",
92
- "@deepseek-ai/dsh-tool-subagent": "^0.1.6-alpha.2",
93
- "@deepseek-ai/dsh-tool-subagent-control": "^0.1.6-alpha.2",
94
- "@deepseek-ai/dsh-tool-todo": "^0.1.6-alpha.2",
95
- "@deepseek-ai/dsh-tool-web": "^0.1.6-alpha.2",
96
- "@deepseek-ai/dsh-tool-workflow": "^0.1.6-alpha.2",
97
- "@deepseek-ai/dsh-web-app": "^0.1.6-alpha.2",
98
- "@deepseek-ai/dsh-webhook": "^0.1.6-alpha.2",
99
- "@deepseek-ai/dsh-webhook-github": "^0.1.6-alpha.2",
100
- "@deepseek-ai/dsh-workflow-ptc": "^0.1.6-alpha.2",
101
- "@deepseek-ai/schemastery": "^3.18.2",
23
+ "@deepseek-ai/cordis": "~4.0.5",
24
+ "@deepseek-ai/dsh-hmr": "0.2.1-rc.2",
25
+ "@deepseek-ai/cordis-plugin-include": "~1.0.10",
26
+ "@deepseek-ai/cordis-plugin-loader": "~1.0.6",
27
+ "@deepseek-ai/cordis-plugin-timer": "~1.1.7",
28
+ "@deepseek-ai/dsh-acp-app": "0.2.1-rc.2",
29
+ "@deepseek-ai/dsh-agent-instructions": "0.2.1-rc.2",
30
+ "@deepseek-ai/dsh-agent-tool-presentation": "0.2.1-rc.2",
31
+ "@deepseek-ai/dsh-app-boot": "0.2.1-rc.2",
32
+ "@deepseek-ai/dsh-base": "0.2.1-rc.2",
33
+ "@deepseek-ai/dsh-client-ui-agent-preset": "0.2.1-rc.2",
34
+ "@deepseek-ai/dsh-client-ui-cordis": "0.2.1-rc.2",
35
+ "@deepseek-ai/dsh-cmdline": "0.2.1-rc.2",
36
+ "@deepseek-ai/dsh-command-compact": "0.2.1-rc.2",
37
+ "@deepseek-ai/dsh-command-goal": "0.2.1-rc.2",
38
+ "@deepseek-ai/dsh-compaction-basic": "0.2.1-rc.2",
39
+ "@deepseek-ai/dsh-compaction-tool-result-pruner": "0.2.1-rc.2",
40
+ "@deepseek-ai/dsh-cordis-client-runner": "0.2.1-rc.2",
41
+ "@deepseek-ai/dsh-experimental-agent-team-profile": "0.2.1-rc.2",
42
+ "@deepseek-ai/dsh-experimental-inspector-profile": "0.2.1-rc.2",
43
+ "@deepseek-ai/dsh-fs-local": "0.2.1-rc.2",
44
+ "@deepseek-ai/dsh-goal": "0.2.1-rc.2",
45
+ "@deepseek-ai/dsh-goal-round-driver": "0.2.1-rc.2",
46
+ "@deepseek-ai/dsh-headless": "0.2.1-rc.2",
47
+ "@deepseek-ai/dsh-home-paths": "0.2.1-rc.2",
48
+ "@deepseek-ai/dsh-jobs-local": "0.2.1-rc.2",
49
+ "@deepseek-ai/dsh-launch-environment": "0.2.1-rc.2",
50
+ "@deepseek-ai/dsh-mcp-client": "npm:@crazx/dsh-mcp-client@0.2.1-rc.2.zw.2",
51
+ "@deepseek-ai/dsh-persona": "0.2.1-rc.2",
52
+ "@deepseek-ai/dsh-plan-mode": "0.2.1-rc.2",
53
+ "@deepseek-ai/dsh-pwsh-local": "0.2.1-rc.2",
54
+ "@deepseek-ai/dsh-pwsh-sandbox": "0.2.1-rc.2",
55
+ "@deepseek-ai/dsh-schedule": "0.2.1-rc.2",
56
+ "@deepseek-ai/dsh-sdk-app": "0.2.1-rc.2",
57
+ "@deepseek-ai/dsh-sdk-minimal": "0.2.1-rc.2",
58
+ "@deepseek-ai/dsh-session-projection": "0.2.1-rc.2",
59
+ "@deepseek-ai/dsh-session-reference": "0.2.1-rc.2",
60
+ "@deepseek-ai/dsh-skill": "0.2.1-rc.2",
61
+ "@deepseek-ai/dsh-skill-filesystem": "0.2.1-rc.2",
62
+ "@deepseek-ai/dsh-skill-office": "0.2.1-rc.2",
63
+ "@deepseek-ai/dsh-tool-workspace-dependencies": "0.2.1-rc.2",
64
+ "@deepseek-ai/dsh-terminal": "0.2.1-rc.2",
65
+ "@deepseek-ai/dsh-terminal-bash": "0.2.1-rc.2",
66
+ "@deepseek-ai/dsh-time-context": "0.2.1-rc.2",
67
+ "@deepseek-ai/dsh-tmux-context": "0.2.1-rc.2",
68
+ "@deepseek-ai/dsh-token-meter": "0.2.1-rc.2",
69
+ "@deepseek-ai/dsh-tool-ask-user": "0.2.1-rc.2",
70
+ "@deepseek-ai/dsh-tool-bash": "0.2.1-rc.2",
71
+ "@deepseek-ai/dsh-tool-bash-persistent": "0.2.1-rc.2",
72
+ "@deepseek-ai/dsh-tool-cordis": "npm:@crazx/dsh-tool-cordis@0.2.1-rc.2.zw.2",
73
+ "@deepseek-ai/dsh-tool-present": "0.2.1-rc.2",
74
+ "@deepseek-ai/dsh-tool-fs": "0.2.1-rc.2",
75
+ "@deepseek-ai/dsh-tool-fs-search": "0.2.1-rc.2",
76
+ "@deepseek-ai/dsh-tool-goal": "0.2.1-rc.2",
77
+ "@deepseek-ai/dsh-tool-jobs": "0.2.1-rc.2",
78
+ "@deepseek-ai/dsh-tool-pwsh": "0.2.1-rc.2",
79
+ "@deepseek-ai/dsh-tool-pwsh-persistent": "0.2.1-rc.2",
80
+ "@deepseek-ai/dsh-tool-schedule": "0.2.1-rc.2",
81
+ "@deepseek-ai/dsh-tool-skill": "0.2.1-rc.2",
82
+ "@deepseek-ai/dsh-tool-str-replace-editor": "0.2.1-rc.2",
83
+ "@deepseek-ai/dsh-tool-subagent": "0.2.1-rc.2",
84
+ "@deepseek-ai/dsh-tool-subagent-control": "0.2.1-rc.2",
85
+ "@deepseek-ai/dsh-tool-todo": "0.2.1-rc.2",
86
+ "@deepseek-ai/dsh-tool-web": "0.2.1-rc.2",
87
+ "@deepseek-ai/dsh-tool-workflow": "0.2.1-rc.2",
88
+ "@deepseek-ai/dsh-web-app": "0.2.1-rc.2",
89
+ "@deepseek-ai/dsh-workflow-ptc": "0.2.1-rc.2",
90
+ "@deepseek-ai/schemastery": "~3.18.5",
102
91
  "commander": "^15.0.0",
103
- "js-yaml": "^4.2.0",
104
- "node-addon-require-builtin": "^0.1.6",
105
- "@deepseek-ai/dsh-http-proxy": "^0.1.6-alpha.2",
106
- "@deepseek-ai/dsh-mcp-resources": "^0.1.6-alpha.2",
107
- "@deepseek-ai/dsh-plugin-manager": "^0.1.6-alpha.2",
108
- "@deepseek-ai/dsh-atomic-write": "^0.1.6-alpha.2"
92
+ "js-yaml": "^4.3.2",
93
+ "node-addon-require-builtin": "^0.1.9",
94
+ "@deepseek-ai/dsh-http-proxy": "0.2.1-rc.2",
95
+ "@deepseek-ai/dsh-mcp-resources": "0.2.1-rc.2",
96
+ "@deepseek-ai/dsh-plugin-manager": "0.2.1-rc.2",
97
+ "@deepseek-ai/dsh-atomic-write": "0.2.1-rc.2",
98
+ "@deepseek-ai/dsh-agent-preset": "0.2.1-rc.2",
99
+ "@deepseek-ai/dsh-experimental-voice-input-bundle": "0.2.1-rc.2",
100
+ "@deepseek-ai/dsh-experimental-auto-review": "0.2.1-rc.2",
101
+ "@deepseek-ai/dsh-experimental-cot-translation-bundle": "0.2.1-rc.2",
102
+ "@deepseek-ai/dsh-experimental-badge-skill-bundle": "0.2.1-rc.2",
103
+ "@deepseek-ai/dsh-experimental-ralph-bundle": "0.2.1-rc.2",
104
+ "@deepseek-ai/dsh-experimental-session-titles-bundle": "0.2.1-rc.2",
105
+ "@deepseek-ai/dsh-experimental-terminal-bundle": "0.2.1-rc.2",
106
+ "@deepseek-ai/dsh-experimental-session-search": "0.2.1-rc.2",
107
+ "@deepseek-ai/dsh-experimental-tool-worktree": "0.2.1-rc.2",
108
+ "@deepseek-ai/dsh-experimental-plugin-market-bundle": "0.2.1-rc.2"
109
109
  },
110
110
  "devDependencies": {
111
+ "@deepseek-ai/dsh-skill-badge": "0.2.1-rc.2",
112
+ "@deepseek-ai/dsh-webhook-github": "0.2.1-rc.2",
113
+ "@deepseek-ai/dsh-webhook": "0.2.1-rc.2",
114
+ "@deepseek-ai/dsh-tool-ralph": "0.2.1-rc.2",
115
+ "@deepseek-ai/dsh-hooks-codex": "0.2.1-rc.2",
116
+ "@deepseek-ai/dsh-hooks-claude-code": "0.2.1-rc.2",
111
117
  "@agentclientprotocol/sdk": "1.4.0",
112
- "@deepseek-ai/dsh-acp": "^0.1.6-alpha.2",
113
- "@deepseek-ai/dsh-agent": "^0.1.6-alpha.2",
114
- "@deepseek-ai/dsh-agent-loop": "^0.1.6-alpha.2",
115
- "@deepseek-ai/dsh-agent-loop-testkit": "^0.1.6-alpha.2",
116
- "@deepseek-ai/dsh-attachment-local": "^0.1.6-alpha.2",
117
- "@deepseek-ai/dsh-bash-local": "^0.1.6-alpha.2",
118
- "@deepseek-ai/dsh-credentials-local": "^0.1.6-alpha.2",
119
- "@deepseek-ai/dsh-deepseek-llm-api-extensions": "^0.1.6-alpha.2",
120
- "@deepseek-ai/dsh-experimental-agent-team": "^0.1.6-alpha.2",
121
- "@deepseek-ai/dsh-experimental-ptc-runtime-python": "^0.1.6-alpha.2",
122
- "@deepseek-ai/dsh-experimental-tool-agent-team": "^0.1.6-alpha.2",
123
- "@deepseek-ai/dsh-fs-observation-policy": "^0.1.6-alpha.2",
124
- "@deepseek-ai/dsh-fs-sandbox": "^0.1.6-alpha.2",
125
- "@deepseek-ai/dsh-host-frontend-static": "npm:@crazx/dsh-host-frontend-static@0.1.6-alpha.2.zw.2",
126
- "@deepseek-ai/dsh-host-webserver": "^0.1.6-alpha.2",
127
- "@deepseek-ai/dsh-llm": "^0.1.6-alpha.2",
128
- "@deepseek-ai/dsh-llm-deepseek": "^0.1.6-alpha.2",
129
- "@deepseek-ai/dsh-llm-mock-server": "^0.1.6-alpha.2",
130
- "@deepseek-ai/dsh-llm-pi-ai": "npm:@crazx/dsh-llm-pi-ai@0.1.6-alpha.2.zw.2",
131
- "@deepseek-ai/dsh-llm-replay": "^0.1.6-alpha.2",
132
- "@deepseek-ai/dsh-loader-smoke": "^0.1.6-alpha.2",
133
- "@deepseek-ai/dsh-plugin-package-inventory-deepseek": "^0.1.6-alpha.2",
134
- "@deepseek-ai/dsh-sandbox-local": "^0.1.6-alpha.2",
135
- "@deepseek-ai/dsh-sandbox-policy": "^0.1.6-alpha.2",
136
- "@deepseek-ai/dsh-session": "^0.1.6-alpha.2",
137
- "@deepseek-ai/dsh-session-checkpoint-policy": "^0.1.6-alpha.2",
138
- "@deepseek-ai/dsh-session-log-deepseek": "^0.1.6-alpha.2",
139
- "@deepseek-ai/dsh-session-persistence-jsonl": "^0.1.6-alpha.2",
140
- "@deepseek-ai/dsh-session-query": "^0.1.6-alpha.2",
141
- "@deepseek-ai/dsh-shell-env": "^0.1.6-alpha.2",
142
- "@deepseek-ai/dsh-settings": "^0.1.6-alpha.2",
143
- "@deepseek-ai/dsh-settings-file": "^0.1.6-alpha.2",
144
- "@deepseek-ai/dsh-subagent": "^0.1.6-alpha.2",
145
- "@deepseek-ai/dsh-subagent-fork-in-process": "^0.1.6-alpha.2",
146
- "@deepseek-ai/dsh-subagent-spawn-in-process": "^0.1.6-alpha.2",
147
- "@deepseek-ai/dsh-subprocess-local": "^0.1.6-alpha.2",
148
- "@deepseek-ai/dsh-system-prompt": "^0.1.6-alpha.2",
149
- "@deepseek-ai/dsh-tools": "^0.1.6-alpha.2",
150
- "@deepseek-ai/dsh-user-approval": "^0.1.6-alpha.2",
118
+ "@deepseek-ai/dsh-acp": "0.2.1-rc.2",
119
+ "@deepseek-ai/dsh-agent": "0.2.1-rc.2",
120
+ "@deepseek-ai/dsh-agent-loop": "0.2.1-rc.2",
121
+ "@deepseek-ai/dsh-agent-loop-testkit": "0.2.1-rc.2",
122
+ "@deepseek-ai/dsh-attachment-local": "0.2.1-rc.2",
123
+ "@deepseek-ai/dsh-bash-local": "0.2.1-rc.2",
124
+ "@deepseek-ai/dsh-credentials-local": "0.2.1-rc.2",
125
+ "@deepseek-ai/dsh-deepseek-llm-api-extensions": "0.2.1-rc.2",
126
+ "@deepseek-ai/dsh-experimental-agent-team": "0.2.1-rc.2",
127
+ "@deepseek-ai/dsh-experimental-ptc-runtime-python": "0.2.1-rc.2",
128
+ "@deepseek-ai/dsh-experimental-tool-agent-team": "0.2.1-rc.2",
129
+ "@deepseek-ai/dsh-fs-observation-policy": "0.2.1-rc.2",
130
+ "@deepseek-ai/dsh-fs-sandbox": "0.2.1-rc.2",
131
+ "@deepseek-ai/dsh-host-frontend-static": "npm:@crazx/dsh-host-frontend-static@0.2.1-rc.2.zw.2",
132
+ "@deepseek-ai/dsh-host-webserver": "0.2.1-rc.2",
133
+ "@deepseek-ai/dsh-llm": "0.2.1-rc.2",
134
+ "@deepseek-ai/dsh-llm-deepseek": "0.2.1-rc.2",
135
+ "@deepseek-ai/dsh-llm-deepseek-api-key": "0.2.1-rc.2",
136
+ "@deepseek-ai/dsh-llm-deepseek-account": "0.2.1-rc.2",
137
+ "@deepseek-ai/dsh-llm-mock-server": "0.2.1-rc.2",
138
+ "@deepseek-ai/dsh-llm-pi-ai": "npm:@crazx/dsh-llm-pi-ai@0.2.1-rc.2.zw.2",
139
+ "@deepseek-ai/dsh-llm-replay": "0.2.1-rc.2",
140
+ "@deepseek-ai/dsh-loader-smoke": "0.2.1-rc.2",
141
+ "@deepseek-ai/dsh-plugin-package-inventory-deepseek": "0.2.1-rc.2",
142
+ "@deepseek-ai/dsh-sandbox-local": "0.2.1-rc.2",
143
+ "@deepseek-ai/dsh-sandbox-policy": "0.2.1-rc.2",
144
+ "@deepseek-ai/dsh-sdk-client": "0.2.1-rc.2",
145
+ "@deepseek-ai/dsh-session": "0.2.1-rc.2",
146
+ "@deepseek-ai/dsh-session-checkpoint-policy": "0.2.1-rc.2",
147
+ "@deepseek-ai/dsh-session-log-deepseek": "0.2.1-rc.2",
148
+ "@deepseek-ai/dsh-session-persistence-jsonl": "0.2.1-rc.2",
149
+ "@deepseek-ai/dsh-session-query": "0.2.1-rc.2",
150
+ "@deepseek-ai/dsh-shell-env": "0.2.1-rc.2",
151
+ "@deepseek-ai/dsh-settings": "0.2.1-rc.2",
152
+ "@deepseek-ai/dsh-subagent": "0.2.1-rc.2",
153
+ "@deepseek-ai/dsh-subagent-fork-in-process": "0.2.1-rc.2",
154
+ "@deepseek-ai/dsh-subagent-spawn-in-process": "0.2.1-rc.2",
155
+ "@deepseek-ai/dsh-subprocess-local": "0.2.1-rc.2",
156
+ "@deepseek-ai/dsh-system-prompt": "0.2.1-rc.2",
157
+ "@deepseek-ai/dsh-tools": "0.2.1-rc.2",
158
+ "@deepseek-ai/dsh-user-approval": "0.2.1-rc.2",
151
159
  "@types/js-yaml": "^4.0.9",
152
160
  "@types/ws": "8.18.1",
153
- "execa": "^10.0.0",
154
- "ws": "8.21.0"
161
+ "ajv": "^8.20.0",
162
+ "execa": "^10.0.1",
163
+ "ws": "8.21.3"
155
164
  },
156
165
  "exports": {
157
166
  "./profile-boot": {
package/LICENSE DELETED
@@ -1,21 +0,0 @@
1
- MIT License
2
-
3
- Copyright (c) 2026 DeepSeek
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.
@@ -1,31 +0,0 @@
1
- import { t as INSTALL_ANCHOR } from "./profile-boot-BNu17Y9U.js";
2
- import { resolveProfileDir } from "@deepseek-ai/dsh-app-boot";
3
- import { join } from "node:path";
4
- import { runPluginCommand } from "@deepseek-ai/dsh-plugin-manager/operations";
5
- //#region lib/types/plugin.js
6
- /** dsh plugin forwards pnpm through the shared profile package operations. */
7
- /** Run package management for a profile.
8
- * @param profile Profile name.
9
- * @param args Pnpm arguments relative to the invoking directory.
10
- * @returns Pnpm exit code.
11
- */
12
- async function runPlugin(profile, args) {
13
- const result = await runPluginCommand({
14
- profile,
15
- installAnchor: INSTALL_ANCHOR,
16
- cwd: process.cwd()
17
- }, args, {
18
- execution: "cli",
19
- outputBytes: 16384,
20
- lockWaitMs: 12e4,
21
- onOutput: (text, stream) => {
22
- process[stream].write(text);
23
- }
24
- });
25
- if (result.exitCode === 127) process.stderr.write("dsh: pnpm was not found; install pnpm and make it available on PATH.\n");
26
- if (result.exitCode !== 0) process.stderr.write(`dsh: pnpm failed; diagnostics: ${result.logPath}\n`);
27
- if (result.exitCode !== 0 && args.some((argument) => /^git\+|^github:|\.git(?:#|$)/.test(argument))) process.stderr.write(`dsh: git-hosted plugins build on install via their prepare script, which pnpm blocks until allowed — add the exact key pnpm printed above under allowBuilds in ${join(resolveProfileDir(profile), "pnpm-workspace.yaml")}, then re-run\n`);
28
- return result.exitCode;
29
- }
30
- //#endregion
31
- export { runPlugin };
@@ -1,5 +1,5 @@
1
- import { createWriteStream, mkdirSync, rmSync, symlinkSync } from "node:fs";
2
1
  import { join } from "node:path";
2
+ import { createWriteStream, mkdirSync, rmSync, symlinkSync } from "node:fs";
3
3
  import { spawn } from "node:child_process";
4
4
  import { homedir, tmpdir } from "node:os";
5
5
  //#region lib/types/web-log.js