dsh-paoding 0.3.3 → 0.3.5

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.md CHANGED
@@ -19,6 +19,7 @@ dsh-paoding(中文品牌「庖丁」,典出《庄子》——庖丁顺纹理
19
19
  - **图形界面配置**:不习惯改配置文件的话,点开左侧栏底部动作条(设置行上方)的「庖丁配置」入口,整页点选即可,「保存并应用」即时重生成预设——与首装自动化同一条生成管线。
20
20
  - **版本更新有提醒,面板一键升级**:面板会对比 npm registry(GitHub release 兜底)上的最新版本,发现新版就地提示并附上发布页链接;点「升级」就地执行 `dsh plugin update dsh-paoding`(profile 自动探测)换上新版,重启 DSH 后生效,编排预设会在重启时按新版自动重生成。开发检出的 link 形态无法就地升级,面板会提示切回 registry 版的办法;检测失败(比如断网)就静默跳过,不影响任何使用。
21
21
  - **来去自由**:不改 DSH 一行源码;装完新会话即用,卸载即删目录。
22
+ - **两代宿主都兼容**:DSH 0.1.5 / 0.1.6 / 0.1.7-rc.1 全支持——两代宿主发现预设的机制不同(目录扫描 vs patch 声明行),安装器自动检测宿主版本选对落点,宿主升级、降级后的首次保存/自愈自动迁移,全程无感。
22
23
 
23
24
  ## 插件截图
24
25
 
@@ -26,7 +27,7 @@ dsh-paoding(中文品牌「庖丁」,典出《庄子》——庖丁顺纹理
26
27
 
27
28
  ## 快速开始
28
29
 
29
- 前置:**Node.js ≥ 18**、**pnpm** 与一台已装好的 DSH host(**@deepseek-ai/dsh ≥ 0.1.5**,最低支持版本)。
30
+ 前置:**Node.js ≥ 18**、**pnpm** 与一台已装好的 DSH host(**@deepseek-ai/dsh 0.1.5 – 0.1.7-rc.1** 全支持,预设落点自动适配两代宿主机制)。
30
31
 
31
32
  **官方插件通道(唯一安装入口)**——不用克隆仓库,一条命令,装完重启即用:
32
33
 
@@ -36,7 +37,7 @@ dsh plugin --profile web add dsh-paoding
36
37
 
37
38
  等价捷径:`npx dsh-paoding@latest`(内部转成上面这条命令,默认 profile web,需本机已装 dsh)。npx 拉到哪版就装哪版:实际安装的是 `dsh-paoding@<npx 拉取到的版本>`。
38
39
 
39
- `dsh plugin` 是 pnpm 的透明转发器:包被 pnpm 装进 profile,包内声明的 bundle patch 把「庖丁配置」面板挂进 DSH Web 左侧栏。**重启 DSH(`dsh web`)**即完成全部安装——插件启动时会自动检测,编排预设缺失或版本不符就自动生成一次(有 `~/.dsh/dsh-paoding.config.yml` 按配置应用,没有则写基础模板),无需再点任何按钮。新会话的预设选择器里选「编排模式 (Orchestrator)」即可;要设为默认,在 Settings → Agent Presets 里选。
40
+ `dsh plugin` 是 pnpm 的透明转发器:包被 pnpm 装进 profile,包内声明的 bundle patch 把「庖丁配置」面板挂进 DSH Web 左侧栏。**重启 DSH(`dsh web`)**即完成全部安装——插件启动时会自动检测,编排预设缺失或版本不符就自动生成一次(有 `~/.dsh/dsh-paoding.config.yml` 按配置应用,没有则写基础模板),无需再点任何按钮。DSH 0.1.7 起宿主改用 patch 声明行发现预设,插件会自动改写登记方式,装法不变。新会话的预设选择器里选「编排模式 (Orchestrator)」即可;要设为默认,在 Settings → Agent Presets 里选。
40
41
 
41
42
  开箱默认只带 DSH 自带的基础工具,检测到的 MCP/host 工具不会自动写入——装完点开左侧栏的**「庖丁配置」**按需勾选工具与角色,「保存并应用」即生效。不想要了,三条命令卸干净(按工作区配置生成的各工作区预设也一并删除):
42
43
 
@@ -46,6 +47,8 @@ rm -rf "${DSH_HOME:-$HOME/.dsh}/.agent-presets/orchestrator"
46
47
  rm -rf "${DSH_HOME:-$HOME/.dsh}/.agent-presets"/orchestrator-*
47
48
  ```
48
49
 
50
+ 宿主是 DSH 0.1.7+ 时再补一步:删去 `~/.dsh/cordis.patch.yml` 里的 dsh-paoding 托管块(带 auto-generated 起止标记),免得留下指向已删目录的声明行(详见[安装文档](docs/installation.md)第 7 节)。
51
+
49
52
  **开发检出自装**——想改插件或预设源码时,用 link 形态直连仓库(改动经 HMR/重启生效):
50
53
 
51
54
  ```bash
@@ -77,7 +80,7 @@ dsh plugin --profile web add link:"$PWD/dsh-paoding"
77
80
  | 文档 | 内容 |
78
81
  |---|---|
79
82
  | [架构](docs/architecture.md) | 为什么这样设计——概述、成本账、角色与工具、对应 DSH 原生机制、Token 治理、已知边界。 |
80
- | [安装](docs/installation.md) | 官方插件通道一条命令安装、首装自动化与版本标记、升级、开发检出自装、host patch 检测机制、庖丁配置面板、卸载、排查。 |
83
+ | [安装](docs/installation.md) | 官方插件通道一条命令安装、版本支持与预设落点双轨(DSH 0.1.5 – 0.1.7-rc.1)、首装自动化与版本标记、升级、开发检出自装、host patch 检测机制、庖丁配置面板、卸载、排查。 |
81
84
  | [编排](docs/orchestration.md) | 编排总览、失败如何呈现与三层处理、one-shot vs continuable、上下文隔离。 |
82
85
  | [配置](docs/configuration.md) | 配置键全参考、内置角色微调、主 agent 工具与技能、自定义角色、按角色分模型、角色会话模式。 |
83
86
 
package/README_en.md CHANGED
@@ -19,6 +19,7 @@ dsh-paoding (Chinese brand 「庖丁」/ Pao Ding, from the Zhuangzi parable of
19
19
  - **A visual configurator**: prefer clicking to editing YAML? the 庖丁配置 (Paoding Config) entry in the sidebar bottom action bar (above the Settings row) covers everything; Save & Apply regenerates the preset on the spot — the same generation pipeline as first-install automation.
20
20
  - **Notified of new releases, one-click upgrade in the panel**: the panel compares your local version against the latest npm registry publish (GitHub release as fallback) and points to the release page when a newer one is out. The Upgrade button runs `dsh plugin update dsh-paoding` in place (profile auto-detected) to swap in the new version; a DSH restart applies it, and the orchestrator preset regenerates itself against the new version on startup. A dev checkout in link: form cannot be upgraded in place — the panel tells you how to switch back to the registry version. If the check fails (offline, rate-limited), it stays silent and nothing is interrupted.
21
21
  - **Installs and uninstalls cleanly**: no DSH source changes; active in a new session right after install, gone when you delete one directory.
22
+ - **Works on both host generations**: DSH 0.1.5 / 0.1.6 / 0.1.7-rc.1 are all supported — the two generations discover presets differently (directory scan vs patch declaration rows), and the installer picks the right landing automatically, then migrates on the first save/self-heal after a host upgrade or downgrade, all without user action.
22
23
 
23
24
  ## Screenshots
24
25
 
@@ -26,7 +27,7 @@ dsh-paoding (Chinese brand 「庖丁」/ Pao Ding, from the Zhuangzi parable of
26
27
 
27
28
  ## Quick Start
28
29
 
29
- Prerequisites: **Node.js ≥ 18**, **pnpm**, and a working DSH host (**@deepseek-ai/dsh >= 0.1.5**, the minimum supported version).
30
+ Prerequisites: **Node.js ≥ 18**, **pnpm**, and a working DSH host (**@deepseek-ai/dsh 0.1.5 – 0.1.7-rc.1**, all supported — the preset landing adapts to the host generation automatically).
30
31
 
31
32
  **The official plugin channel (the only install route)** — no clone needed; one command, then a restart:
32
33
 
@@ -36,7 +37,7 @@ dsh plugin --profile web add dsh-paoding
36
37
 
37
38
  Equivalent shortcut: `npx dsh-paoding@latest` (delegates to the command above; default profile web; requires dsh on PATH). Whichever version npx pulls is what gets installed: the actual install is `dsh-paoding@<the version npx resolved>`.
38
39
 
39
- `dsh plugin` is a transparent pass-through to pnpm: the package is installed into the profile by pnpm, and the bundle patch declared inside it mounts the 庖丁配置 (Paoding Config) page into the DSH Web left sidebar. **Restart DSH (`dsh web`)** and the install is complete — on startup the plugin checks itself, and if the orchestrator preset is missing or carries an outdated version marker it regenerates it once (applying `~/.dsh/dsh-paoding.config.yml` when present, writing the base template otherwise). Nothing else to click. Pick "编排模式 (Orchestrator)" in the new-session preset selector; to make it the default, choose it in Settings → Agent Presets.
40
+ `dsh plugin` is a transparent pass-through to pnpm: the package is installed into the profile by pnpm, and the bundle patch declared inside it mounts the 庖丁配置 (Paoding Config) page into the DSH Web left sidebar. **Restart DSH (`dsh web`)** and the install is complete — on startup the plugin checks itself, and if the orchestrator preset is missing or carries an outdated version marker it regenerates it once (applying `~/.dsh/dsh-paoding.config.yml` when present, writing the base template otherwise). Nothing else to click. From DSH 0.1.7 the host discovers presets through patch declaration rows instead, and the plugin switches the registration over by itself — the install steps stay the same. Pick "编排模式 (Orchestrator)" in the new-session preset selector; to make it the default, choose it in Settings → Agent Presets.
40
41
 
41
42
  Out of the box only DSH's built-in base tools are enabled — detected MCP/host tools are not written in automatically. Open **庖丁配置 (Paoding Config)** in the sidebar, opt into the tools and roles you need, and hit Save & Apply. When you no longer want it, three commands uninstall it for good — the per-workspace presets created by workspace-specific configs are removed too:
42
43
 
@@ -46,6 +47,8 @@ rm -rf "${DSH_HOME:-$HOME/.dsh}/.agent-presets/orchestrator"
46
47
  rm -rf "${DSH_HOME:-$HOME/.dsh}/.agent-presets"/orchestrator-*
47
48
  ```
48
49
 
50
+ On a DSH 0.1.7+ host there is one extra step: delete the dsh-paoding managed block from `~/.dsh/cordis.patch.yml` (the auto-generated marker comments), so no declaration rows are left pointing at the removed directories (see §7 of the [installation guide](docs/installation_en.md)).
51
+
49
52
  **Dev checkout install** — to hack on the plugin or the preset sources, link the repository directly (changes go live via HMR or a restart):
50
53
 
51
54
  ```bash
@@ -77,7 +80,7 @@ All preferences live in `~/.dsh/dsh-paoding.config.yml`: role add/remove/tweak,
77
80
  | Document | Contents |
78
81
  |---|---|
79
82
  | [Architecture](docs/architecture_en.md) | Why it is designed this way — overview, the cost ledger, roles and tools, mapping to DSH's native mechanisms, token governance, known limits. |
80
- | [Installation](docs/installation_en.md) | The single official channel (`dsh plugin add`), first-install automation and the version marker, upgrading, dev-checkout install, host patch detection, the Paoding Config panel, uninstalling, troubleshooting. |
83
+ | [Installation](docs/installation_en.md) | The single official channel (`dsh plugin add`), version support and the dual preset landing (DSH 0.1.5 – 0.1.7-rc.1), first-install automation and the version marker, upgrading, dev-checkout install, host patch detection, the Paoding Config panel, uninstalling, troubleshooting. |
81
84
  | [Orchestration](docs/orchestration_en.md) | Orchestration overview, how failures surface and the three recovery layers, one-shot vs continuable, context isolation. |
82
85
  | [Configuration](docs/configuration_en.md) | The full key reference, tuning built-in roles, main-agent tools and skills, custom roles, per-role models, per-role session modes. |
83
86
 
@@ -246,6 +246,8 @@ SOP(按 stop reason 分流:error 重委派一次 / max-tokens 拆小 / refus
246
246
 
247
247
  **⑦ 热插拔 = preset 是静态目录 + 插件通道挂载。** 插件本体经 `dsh plugin add`(pnpm + 包内 bundle patch)装入 profile,侧栏面板即挂即卸;编排预设本身是一个静态目录——生成器把静态源复制/改写为
248
248
  `$DSH_HOME/.agent-presets/orchestrator`,编辑 YAML / mjs、面板「保存并应用」重新生成、重启 host 或新建会话即生效;
249
+ 产物路径两代宿主一致,登记机制按宿主版本双轨——DSH ≤ 0.1.6 目录扫描即注册,DSH ≥ 0.1.7 由 `$DSH_HOME/cordis.patch.yml`
250
+ 托管块里的 `@deepseek-ai/dsh-agent-preset` 声明行注册,安装器自动适配与迁移(见[安装](installation.md)第 2 节);
249
251
  卸载 = `dsh plugin remove` 加删目录(见[安装](installation.md))。DSH 源码零改动,preset 可整体移除、不残留。
250
252
 
251
253
  ## Web 配置页 client bundle:源头多文件,产物单文件
@@ -266,7 +268,8 @@ grep inline cap 与对照同设计)后,根因锁定为:**默认压缩从
266
268
  **已落地配置。** `agent.cordis.yml` 的 compaction-basic 已设 `thresholdRatio: 0.45`(≈117,965 tokens
267
269
  触发),配合 retainRatio 默认保留约 16% 尾部(≈42K)+ 摘要 checkpoint,稳态平均回落到 ~80K 量级。
268
270
  压缩每次触发调用一次 LLM 摘要——复用前缀缓存,成本极低——因此触发频繁一点也几乎不额外花钱;
269
- 0.45 是「省 token 与不频繁摘要」之间的平衡点。
271
+ 0.45 是「省 token 与不频繁摘要」之间的平衡点。compaction-basic 另显式钉了 `maxTokens: 8192`:
272
+ DSH 0.1.7 起宿主默认升到 65536,显式值让 0.1.5 – 0.1.7-rc.1 全系的摘要预算行为保持一致。
270
273
 
271
274
  **参数与效果。**
272
275
 
@@ -318,7 +318,11 @@ integration summary) — see [docs/orchestration_en.md](orchestration_en.md).
318
318
  into a profile via `dsh plugin add` (pnpm plus the in-package bundle patch), so the sidebar panel mounts and
319
319
  unmounts with it; the orchestrator preset is a static directory — the generator copies/rewrites the static
320
320
  sources into `$DSH_HOME/.agent-presets/orchestrator`; editing the YAML / mjs, hitting Save & Apply in the
321
- panel to regenerate, and restarting the host or opening a new session takes effect. Uninstall = `dsh plugin
321
+ panel to regenerate, and restarting the host or opening a new session takes effect. The artifact path is the
322
+ same on both host generations, while registration is dual-track by host version — DSH ≤ 0.1.6 registers by
323
+ directory scan, DSH ≥ 0.1.7 registers through `@deepseek-ai/dsh-agent-preset` declaration rows in the managed
324
+ block of `$DSH_HOME/cordis.patch.yml`, with the installer adapting and migrating automatically (see §2 of the
325
+ [Installation guide](installation_en.md)). Uninstall = `dsh plugin
322
326
  remove` plus deleting the directory (see [Installation](installation_en.md)). No DSH source changes; the
323
327
  preset leaves nothing behind when removed.
324
328
 
@@ -346,7 +350,9 @@ history periodically compressed back down.
346
350
  (≈42K) plus a summary checkpoint; the steady-state average falls to the ~80K range. Each compaction run
347
351
  performs one LLM summarization call that reuses the prefix cache, so its cost is negligible — triggering
348
352
  somewhat more often costs almost nothing extra; 0.45 is the balance point between saving tokens and not
349
- summarizing too frequently.
353
+ summarizing too frequently. compaction-basic also pins `maxTokens: 8192` explicitly: from DSH 0.1.7 the host
354
+ default rises to 65536, and the explicit value keeps the summary-budget behavior identical across
355
+ 0.1.5 – 0.1.7-rc.1.
350
356
 
351
357
  **Parameters and effect.**
352
358
 
@@ -4,7 +4,7 @@
4
4
 
5
5
  # 配置
6
6
 
7
- dsh-paoding 把「按角色分工的编排 preset」做成**配置驱动**:你手编(或在「庖丁配置」面板里点选)一个 YAML 配置文件,生成器(`tools/`,面板「保存并应用」与仓库内兜底 CLI 共用同一生成管线 `collectState` / `generateAndInstall`)在应用时据此重写目标 preset —— `~/.dsh/.agent-presets/orchestrator/agent.cordis.yml`,覆盖角色 allow、角色 persona、主 agent 白名单(`config.allow` 注入)、主 agent persona 的技能行/内联与人设追加。
7
+ dsh-paoding 把「按角色分工的编排 preset」做成**配置驱动**:你手编(或在「庖丁配置」面板里点选)一个 YAML 配置文件,生成器(`tools/`,面板「保存并应用」与仓库内兜底 CLI 共用同一生成管线 `collectState` / `generateAndInstall`)在应用时据此重写目标 preset —— `~/.dsh/.agent-presets/orchestrator/agent.cordis.yml`,覆盖角色 allow、角色 persona、主 agent 白名单(`config.allow` 注入)、主 agent persona 的技能行/内联与人设追加。产物路径在两代宿主上一致;两代宿主发现 preset 的机制不同(≤ 0.1.6 目录扫描 / ≥ 0.1.7 patch 声明行托管块),安装器自动适配,见[安装](installation.md)的「版本支持与预设落点双轨」。
8
8
 
9
9
  配置文件描述的是**声明式意图**。目标文件每次都由「源码 preset + 本配置文件」重新生成:改配置 → 在面板点「保存并应用」= 幂等同步,不会累积手工补丁。
10
10
 
@@ -19,7 +19,7 @@ dsh-paoding 把「按角色分工的编排 preset」做成**配置驱动**:你
19
19
  | 场景 | 行为 |
20
20
  |---|---|
21
21
  | Web 面板(左侧栏「庖丁配置」入口) | **主路径**:打开面板会把既有配置加载为当前值,点「保存并应用」写入 preset 并把分配保存到配置文件(默认 `~/.dsh/dsh-paoding.config.yml`,以 `0o600` 权限写入)。手编过配置文件的话,先开面板再应用即可 |
22
- | 首装自动化 | 插件启动时发现 preset 缺失或版本标记不符,自动按配置文件应用一次(无配置则写基础模板)——日常无需手动触发 |
22
+ | 首装自动化 | 插件启动时发现 preset 缺失、版本标记不符、或宿主预设轨道翻转(只升 dsh 不动插件),自动自愈一次:前者按配置文件重生成(无配置则写基础模板),轨道翻转只按磁盘产物补写缺失的声明行、不重生成内容——日常无需手动触发 |
23
23
  | 兜底 CLI(仅限克隆仓库的开发者) | `node tools/install.mjs --auto`:有配置文件则幂等应用,没有则写基础模板;`--dry-run` 只打印检测报告与将生成的 allow / persona 变化,不写任何文件(含配置文件),适合先预览再动手;`--config <file>` 用指定文件替代默认位置 |
24
24
 
25
25
  配置文件**存在但解析失败**是硬错误(直接报错退出);**不存在**则视为无配置(写基础模板)。`profile`、`roles` 等顶层键的语义见下节。
@@ -632,7 +632,7 @@ workspaces:
632
632
  ### 9.4 生效方式与边界
633
633
 
634
634
  - **预设选择发生在新建会话时**:新建会话界面选好工作区后,在预设选择器里选对应的 `orchestrator-<slug>`。全局默认预设不受任何影响。预设生效需要新会话(或 DSH 重启后可见)。
635
- - 预设目录落在 `$DSH_HOME/.agent-presets/` 下,全机共享:同一台机器上不同项目各起的 DSH 实例,因 slug 不同互不覆盖。
635
+ - 预设目录落在 `$DSH_HOME/.agent-presets/` 下,全机共享:同一台机器上不同项目各起的 DSH 实例,因 slug 不同互不覆盖。DSH ≥ 0.1.7 上这些预设另经 `$DSH_HOME/cordis.patch.yml` 托管块里的声明行登记(`config.id` 即 `orchestrator` / `orchestrator-<slug>`),同一套 slug 命名两代宿主通用,见[安装](installation.md)的「版本支持与预设落点双轨」。
636
636
  - 兜底 CLI 本次仍只作用于全局条目;`workspaces` 段在 CLI 应用后原样保留,不会被冲掉。
637
637
  - 运行中的会话不会换预设——子 agent 的角色与工具面在会话创建时随预设组装定型,会话内不可变;要换套班底,开新会话选新预设。
638
638
 
@@ -4,7 +4,7 @@
4
4
 
5
5
  # Configuration
6
6
 
7
- dsh-paoding makes the role-based orchestration preset **configuration-driven**: you hand-write (or click together in the 庖丁配置 panel) a YAML config file, and the generator (`tools/`; the panel's Save & Apply and the in-repo fallback CLI share the same generation pipeline, `collectState` / `generateAndInstall`) rewrites the target preset — `~/.dsh/.agent-presets/orchestrator/agent.cordis.yml` — when it is applied, covering the role allows, role personas, the main-agent allow list (`config.allow` injection) and the main-agent persona's skill rows / inlines and persona extra.
7
+ dsh-paoding makes the role-based orchestration preset **configuration-driven**: you hand-write (or click together in the 庖丁配置 panel) a YAML config file, and the generator (`tools/`; the panel's Save & Apply and the in-repo fallback CLI share the same generation pipeline, `collectState` / `generateAndInstall`) rewrites the target preset — `~/.dsh/.agent-presets/orchestrator/agent.cordis.yml` — when it is applied, covering the role allows, role personas, the main-agent allow list (`config.allow` injection) and the main-agent persona's skill rows / inlines and persona extra. The artifact path is the same on both host generations; the generations discover the preset differently (≤ 0.1.6 directory scan / ≥ 0.1.7 declaration managed block in the patch), and the installer adapts automatically — see "Version support and the dual preset landing" in the [installation guide](installation_en.md).
8
8
 
9
9
  The config file describes **declarative intent**. The target file is regenerated from scratch every time — "source preset + this config file": edit the config → hit Save & Apply in the panel = idempotent sync, with no accumulating hand patches.
10
10
 
@@ -642,7 +642,7 @@ With a workspace selected, preview and apply target it alone; the success note r
642
642
  ### 9.4 How it takes effect, and boundaries
643
643
 
644
644
  - **Preset choice happens at session creation**: pick the workspace on the new-session screen, then pick the matching `orchestrator-<slug>` in the preset selector. The global default preset is untouched. A new session (or a DSH restart) is needed for a freshly generated preset to appear.
645
- - Preset directories live under `$DSH_HOME/.agent-presets/` and are shared machine-wide: separate DSH instances launched from different projects never clobber each other, because their slugs differ.
645
+ - Preset directories live under `$DSH_HOME/.agent-presets/` and are shared machine-wide: separate DSH instances launched from different projects never clobber each other, because their slugs differ. On DSH ≥ 0.1.7 these presets are additionally registered through declaration rows in the managed block of `$DSH_HOME/cordis.patch.yml` (`config.id` being `orchestrator` / `orchestrator-<slug>`); the same slug naming works on both generations — see "Version support and the dual preset landing" in the [installation guide](installation_en.md).
646
646
  - The fallback CLI still targets the global entry only; the `workspaces` section survives a CLI apply unchanged.
647
647
  - A running session never switches presets — a session's roles and tool surfaces are assembled at creation and fixed for its lifetime; to change the lineup, start a new session with the new preset.
648
648
 
@@ -12,14 +12,15 @@
12
12
 
13
13
  - **Node.js ≥ 18**。DSH host 与插件链路都跑在 Node 上;版本过低时 `dsh` 本身就起不来。可用 `node --version` 自查。
14
14
  - **pnpm 可用**。`dsh plugin` 是 pnpm 的透明转发器:插件包装进 profile 时由 pnpm 完成。缺失时安装命令会报 pnpm 相关错误,装好 pnpm(`npm i -g pnpm` 或 `corepack enable`)后重试。
15
- - **已安装 DSH host**(`dsh` 可用,含其 Web/agent 运行时;**@deepseek-ai/dsh ≥ 0.1.5**,最低支持版本)。本插件不改 DSH 源码,只往 DSH 的 preset roster 写入编排预设、并把「庖丁配置」面板挂进 Web 左侧栏,因此先要有可用的 DSH 家目录。
15
+ - **已安装 DSH host**(`dsh` 可用,含其 Web/agent 运行时;**@deepseek-ai/dsh 0.1.5 – 0.1.7-rc.1** 全支持,安装器自动适配两代预设机制,详见第 2 节「版本支持与预设落点双轨」)。本插件不改 DSH 源码,只往 DSH 的 preset roster 写入编排预设、并把「庖丁配置」面板挂进 Web 左侧栏,因此先要有可用的 DSH 家目录。
16
16
  - **路径事实**(生成管线内建常量,写死前先了解它们):
17
17
 
18
18
  | 项 | 默认值 | 说明 |
19
19
  |---|---|---|
20
20
  | `$DSH_HOME` | `~/.dsh` | DSH 家目录(认环境变量 `DSH_HOME`,缺省 `$HOME/.dsh`)。host 层配置 `cordis.patch.yml`、`node_modules`、`profiles/<name>/cordis.patch.yml`、插件 profile 目录都在其下 |
21
- | preset roster 根目录 | `$DSH_HOME/.agent-presets/` | `dsh-agent-presets` 扫描本地 authored presets 的目录 |
22
- | 本预设安装目标 | `$DSH_HOME/.agent-presets/orchestrator` | 生成产物:`agent.cordis.yml`(重写后的角色配置)、`preset.yml`、`restrict.mjs`、`.generator-version` 版本标记,是一个静态目录 |
21
+ | preset roster 根目录 | `$DSH_HOME/.agent-presets/` | DSH ≤ 0.1.6 由 `dsh-agent-presets` 扫描此目录发现本地 authored presets;DSH ≥ 0.1.7 宿主不再扫目录,此目录退为预设文件存放处(见第 2 节「版本支持与预设落点双轨」) |
22
+ | 本预设安装目标 | `$DSH_HOME/.agent-presets/orchestrator` | 生成产物:`agent.cordis.yml`(重写后的角色配置)、`preset.yml`、`restrict.mjs`、`.generator-version` 版本与轨道标记,是一个静态目录;按工作区配置生成的预设落同一父目录下的 `orchestrator-<slug>` |
23
+ | 声明行托管块(仅 DSH ≥ 0.1.7) | `$DSH_HOME/cordis.patch.yml` 内的托管块 | 以 `# --- dsh-paoding presets (auto-generated; do not edit) ---` 起始、配套 end 标记收尾,块内 `- insert:` 写 `@deepseek-ai/dsh-agent-preset` 声明行;安装器自动维护,详见第 2 节 |
23
24
  | 配置文件 | `$DSH_HOME/dsh-paoding.config.yml` | 「庖丁配置」面板「保存并应用」写入的角色与工具分配(`0o600`,可手编);首装自动化同样读写它 |
24
25
 
25
26
  - **环境变量**:`DSH_HOME` 覆盖 DSH 家目录(默认 `~/.dsh`);`DSH_PAODING_CONFIG` 覆盖配置文件路径(面板认它;仓库内兜底 CLI 则用 `--config <file>` 指定)。
@@ -47,17 +48,49 @@ dsh plugin --profile web add dsh-paoding
47
48
 
48
49
  ### profile 语义
49
50
 
50
- `--profile web` 决定插件装进哪个 profile:「庖丁配置」面板只在以该 profile 启动的 DSH Web 里出现。`web` 是 `dsh web` 的默认 profile,多数机器无需改动;多 profile 用户对每个需要的 profile 各执行一次 `dsh plugin add`。编排预设本体落在 `$DSH_HOME/.agent-presets/`,全机共享、不随 profile 走——在任何 profile 的面板里「保存并应用」,写的都是同一份预设。
51
+ `--profile web` 决定插件装进哪个 profile:「庖丁配置」面板只在以该 profile 启动的 DSH Web 里出现。`web` 是 `dsh web` 的默认 profile,多数机器无需改动;多 profile 用户对每个需要的 profile 各执行一次 `dsh plugin add`。编排预设本体落在 `$DSH_HOME/.agent-presets/`,全机共享、不随 profile 走——DSH ≥ 0.1.7 的声明行写在 home 层 `$DSH_HOME/cordis.patch.yml`,同样与 profile 无关——在任何 profile 的面板里「保存并应用」,写的都是同一份预设。
52
+
53
+ ### 版本支持与预设落点双轨(DSH 0.1.5 – 0.1.7-rc.1)
54
+
55
+ 本插件兼容两代宿主:**DSH 0.1.5 / 0.1.6 / 0.1.7-rc.1 全部支持**,安装与使用流程完全一致。插件 0.3.4 起,package.json 显式声明 `peerDependencies: @deepseek-ai/dsh >= 0.1.5`——0.1.7 起宿主装插件前做兼容性预检,无声明等于默认放行,显式声明后按真实兼容面把关;0.1.5 / 0.1.6 不读这个字段,声明纯属元数据,不影响安装。
56
+
57
+ 两代宿主发现「本地 authored preset」的机制不同,安装器据此分双轨落点,宿主检测全自动、用户无感:
58
+
59
+ - **目录轨(DSH ≤ 0.1.6)**:宿主扫描 `$DSH_HOME/.agent-presets/` 下的目录来发现 preset,目录即注册。安装器照旧把产物写成 `$DSH_HOME/.agent-presets/orchestrator/`(`agent.cordis.yml` + `preset.yml` + `restrict.mjs`);按工作区配置生成的预设落同目录下的 `orchestrator-<slug>`。
60
+ - **声明行轨(DSH ≥ 0.1.7)**:宿主不再扫目录,改为读取 patch 里的 `@deepseek-ai/dsh-agent-preset` 声明行。安装器在 `$DSH_HOME/cordis.patch.yml` 里维护一个托管块——以 `# --- dsh-paoding presets (auto-generated; do not edit) ---` 起始、以配套的 end 标记收尾——块内用 `- insert:` 写声明行:全局预设 `config.id: orchestrator`,工作区预设 `config.id: orchestrator-<slug>`,各自的 `plugins` 内联全部插件行;`restrict.mjs` 以绝对 `file:` URL 引用。产物三件套仍落在 `.agent-presets/<id>/`,只是从「目录即注册」变成「文件存放处」。托管块之外的用户内容一字节不动;块内带 do not edit 标记,手改块内内容会在下次保存时被覆盖。
61
+
62
+ 安装器按下面的顺序判定走哪条轨:
63
+
64
+ 1. Web 面板运行时探测优先——`agentPresets` 服务的 `register` 方法 0.1.7 才有,探测到即在声明行轨;
65
+ 2. CLI 侧 `dsh --version`;
66
+ 3. 兜底探测 `$DSH_HOME/node_modules/@deepseek-ai/dsh-agent-preset`(这个单数包在,即为 0.1.7+);
67
+ 4. 都失败时默认按 ≤ 0.1.6 处理(安全侧)。
68
+
69
+ 宿主版本变化后的首次保存/自愈会自动迁移,双向都不用手动干预:
70
+
71
+ - **降级自愈(0.1.7 → 0.1.6)**:0.1.6 不认识声明行,声明行留在 patch 里会让 profile 启动失败——安装器自动撤下 home patch 里的托管块;目录轨产物本就齐全,预设无缝回到目录扫描。
72
+ - **升级迁移(0.1.6 → 0.1.7)**:安装器自动补写托管块;`.agent-presets/` 里按旧轨生成的 preset 会话(`agentPreset: orchestrator`)在新轨下按 `config.id` 继续对上,老会话恢复不断档。
73
+
74
+ 另有两处跨版本行为对齐,同样自动完成、无需用户动作:
75
+
76
+ - **摘要预算**:0.1.7 起宿主把 compaction 的 `maxTokens` 默认升到 65536;本 preset 对 `dsh-compaction-basic` 显式钉 `maxTokens: 8192`,0.1.5 / 0.1.6 的摘要预算行为原样保持,两代宿主上一致。
77
+ - **面板图标**:0.1.7 改了 ui-primitives 的图标命名,面板图标已做跨版本兜底,同一 bundle 在两代宿主上都能正常渲染;面板功能在两代宿主上一致。
51
78
 
52
79
  ### 首装自动化:重启即完整安装
53
80
 
54
81
  插件启动时自动检测编排预设是否就位:`$DSH_HOME/.agent-presets/orchestrator` 目录缺失,或其中的 `.generator-version` 标记与插件包版本不符时,自动执行一次等价 `--auto` 的安装——`~/.dsh/dsh-paoding.config.yml` 已存在就按配置应用;没有就写基础模板(只含 DSH 自带的基础工具,见下)。它走的是与面板「保存并应用」同一条检测/生成管线(`collectState` / `generateAndInstall`)——同一管线,但启动自愈的检测是纯文件扫描、不带运行时检测事实,面板则带;host 上装有 bundle 形态插件时,两者的检测库存可能不同,产物随之略有差异。
55
82
 
56
- 所以 **`dsh plugin add` + 重启 = 完整安装**:预设生成、配置模板落盘、面板可点,一步到位。自动生成失败不会拖垮插件启动——只在 DSH 日志里记一条告警,可到面板手动「保存并应用」补上。
83
+ 所以 **`dsh plugin add` + 重启 = 完整安装**:预设生成、配置模板落盘、面板可点,一步到位。自动生成失败不会拖垮插件启动——只在 DSH 日志里记一条告警,可到面板手动「保存并应用」补上。启动自愈同时负责双轨落点的维护与跨版本迁移——宿主在 0.1.6 与 0.1.7 之间升级、降级后,首次自愈会自动补写或撤下 `$DSH_HOME/cordis.patch.yml` 里的托管块(见上节「版本支持与预设落点双轨」)。**只升级 dsh、不动插件**时同样如此:宿主轨道翻转后首次启动,自愈按磁盘上已有的预设产物补写缺失的声明行——preset 内容一字节不重生成,各工作区预设一并恢复。
57
84
 
58
85
  ### 版本标记与自动重生成
59
86
 
60
- `.generator-version` 标记(内容 = 生成器版本)由插件启动自愈在生成 preset 后写入。面板「保存并应用」与兜底 CLI 的生成走整目录重建、不写回标记——重建即移除旧标记,下次 DSH 启动自愈发现标记缺失会多补跑一次生成并重写标记(产物相同,只是多跑一轮)。版本不符触发重生成的语义不变:插件升级后标记与包版本不符,下次 DSH 启动自动按新版重生成,「升级后 preset 还是旧版产物」的漂移就此消除。标记只在缺失或版本不符时触发重生成,面板不监视配置文件改动;想立刻按当前配置重新生成,点面板「保存并应用」。
87
+ `.generator-version` 标记由插件启动自愈在生成 preset 后写入,内容两行:**生成器版本 + 预设安装轨道**(旧版只写版本一行,读到时按「轨道未知」处理,恰是宿主升级后的迁移触发态)。三类触发:
88
+
89
+ - **标记缺失 / 版本不符**(首装、插件升级)→ 整盘重生成。面板「保存并应用」与兜底 CLI 的生成走整目录重建、不写回标记——重建即移除旧标记,下次 DSH 启动自愈发现标记缺失会多补跑一次生成并重写标记(产物相同,只是多跑一轮)。插件升级后标记与包版本不符,下次 DSH 启动自动按新版重生成,「升级后 preset 还是旧版产物」的漂移就此消除。
90
+ - **版本一致、轨道翻转**(只升 dsh 不动插件——升级最常见路径)→ 轻量迁移,不重生成内容:声明轨上按磁盘产物补写缺失的声明行(含各工作区预设),directory 轨上若有残留声明行则整盘重生成撤下(残留会让 0.1.6 profile 启动失败)。
91
+ - **版本轨道都一致** → 对账声明行:缺行补行、目录已删的孤儿行撤行,齐则什么都不动。
92
+
93
+ 面板不监视配置文件改动;想立刻按当前配置重新生成,点面板「保存并应用」。
61
94
 
62
95
  ### 基础模板与工具勾选
63
96
 
@@ -81,7 +114,7 @@ dsh plugin --profile web add dsh-paoding
81
114
  dsh plugin --profile <name> update dsh-paoding
82
115
  ```
83
116
 
84
- (profile 自动探测,通常无需手填。)升级只换 profile 里的插件包本体,当前进程的代码不变;成功后提示**重启 DSH**,重启时 preset 按 `.generator-version` 标记自动按新版重生成。
117
+ (profile 自动探测,通常无需手填。)升级只换 profile 里的插件包本体,当前进程的代码不变;成功后提示**重启 DSH**,重启时 preset 按 `.generator-version` 标记自动按新版重生成。只升级 dsh 本体(不动插件)同理:重启即触发轨道迁移自愈,无需重装或重新应用。
85
118
 
86
119
  手动升级等价:直接在终端跑上面这条 `dsh plugin update` 命令,同样重启生效。
87
120
 
@@ -164,7 +197,7 @@ patch 与配置文件用 **`yaml` 包**解析——通过 `createRequire` 从 `$
164
197
  - **Agent 工具分配卡片**:主 agent 一张固定卡(基础工具取消勾选 = 加入 `main_agent_remove` 从主 agent 剔除;MCP / 插件工具勾选 = 加入 `main_agent_extra`;技能「read 按需」与「内联全文」两组勾选;另有「人设追加」编辑区,可改、清空、恢复默认)+ `search_external` / `design` / `implement` 三张内置角色卡 + 任意自定义角色卡(带删除按钮);每张角色卡把工具按「基础工具 / MCP 工具 / 插件工具」三组呈现、可逐项勾选,并可编辑 persona。底部「新建自定义 agent 角色」。
165
198
  - **技能分配**:每个 skill 一行,勾选分配给哪些 agent(写入对应 persona 的 `Available skills` 软引导;角色技能软引导,主 agent 技能另有 read 按需/内联两组)。
166
199
  - **预览生成**:不写盘生成 `agent.cordis.yml`,显示每个角色 allow 的 intent → kept 计数与生成全文。
167
- - **保存并应用**:确认后写入 preset(覆盖 `$DSH_HOME/.agent-presets/orchestrator`)并把当前分配保存到 `$DSH_HOME/dsh-paoding.config.yml`;应用成功后提示重启 DSH 或新建会话生效(检测到 patch 比生成结果新时提示重启后生效)。打开面板时会加载既有配置文件作为当前值——手编过的选择直接可见、可改。
200
+ - **保存并应用**:确认后写入 preset(覆盖 `$DSH_HOME/.agent-presets/orchestrator`)并按宿主版本同步登记——≤ 0.1.6 目录扫描即生效,≥ 0.1.7 同步维护 `$DSH_HOME/cordis.patch.yml` 里的声明行托管块(见第 2 节)——再把当前分配保存到 `$DSH_HOME/dsh-paoding.config.yml`;应用成功后提示重启 DSH 或新建会话生效(检测到 patch 比生成结果新时提示重启后生效)。打开面板时会加载既有配置文件作为当前值——手编过的选择直接可见、可改。
168
201
 
169
202
  ## 7. 卸载
170
203
 
@@ -178,6 +211,8 @@ rm -rf "${DSH_HOME:-$HOME/.dsh}/.agent-presets"/orchestrator-*
178
211
 
179
212
  第一条摘掉插件与侧栏面板(只影响指定 profile),第二条删掉编排预设目录,第三条清掉按工作区配置时生成的各工作区预设目录(`orchestrator-<目录名>`;没用过按工作区配置就没有这类目录,通配不命中、无害)——基础 `orchestrator` 目录已由上一条命令删掉,不含在这个通配里。配置文件 `~/.dsh/dsh-paoding.config.yml` 不随之上删——留着或删掉都不影响 DSH 其它配置,重装时首装自动化会再次按它应用。
180
213
 
214
+ 宿主为 DSH ≥ 0.1.7 时再多看一眼:`$DSH_HOME/cordis.patch.yml` 里可能还留着 dsh-paoding 托管块(起止标记注释包着 `- insert:` 声明行)。预设目录删掉后,块内声明行就成了指向已删目录的悬空引用,请把整个托管块(从 `# --- dsh-paoding presets (auto-generated; do not edit) ---` 起始行到 end 标记行)一并删去——块外内容不受影响。
215
+
181
216
  卸载不影响 host 的其它内容(MCP、插件、会话等),与 DSH 源码零耦合;之后新建会话时「编排模式 (Orchestrator)」不再出现在预设选择器里。
182
217
 
183
218
  ## 8. 常见问题与排查
@@ -188,7 +223,7 @@ rm -rf "${DSH_HOME:-$HOME/.dsh}/.agent-presets"/orchestrator-*
188
223
 
189
224
  **装了插件,预设列表里却没有「编排模式 (Orchestrator)」**
190
225
 
191
- 预设由插件启动时自动生成:先确认装完后**重启过 DSH**;预设在新会话创建时装载,重启后还要新建一个会话才会出现在选择器里。仍没有就查 DSH 日志里 `paoding-config-ui` 的告警(自动生成失败会记日志,可到面板手动「保存并应用」补上),再检查 `ls "${DSH_HOME:-$HOME/.dsh}/.agent-presets/orchestrator"`——目录为空多半是插件运行时的 `$DSH_HOME` 与你以为的家目录不一致(启动 DSH 前显式 `export DSH_HOME=…`)。
226
+ 预设由插件启动时自动生成:先确认装完后**重启过 DSH**;预设在新会话创建时装载,重启后还要新建一个会话才会出现在选择器里。仍没有就查 DSH 日志里 `paoding-config-ui` 的告警(自动生成失败会记日志,可到面板手动「保存并应用」补上),再检查 `ls "${DSH_HOME:-$HOME/.dsh}/.agent-presets/orchestrator"`——目录为空多半是插件运行时的 `$DSH_HOME` 与你以为的家目录不一致(启动 DSH 前显式 `export DSH_HOME=…`)。目录在、宿主又是 0.1.7+ 而选择器里仍没有时,再查 `$DSH_HOME/cordis.patch.yml` 里有无 dsh-paoding 托管块——0.1.7 靠块内声明行发现预设,缺块就到面板点一次「保存并应用」补写(见第 2 节「版本支持与预设落点双轨」)。
192
227
 
193
228
  **`tools.restrict()` 报 unknown tools / 子 agent 创建被拒**
194
229
 
@@ -12,14 +12,15 @@ Check the following before installing:
12
12
 
13
13
  - **Node.js ≥ 18**. The DSH host and the plugin chain both run on Node; with an older version `dsh` won't start in the first place. Check with `node --version`.
14
14
  - **pnpm available**. `dsh plugin` is a transparent pass-through to pnpm: installing a plugin package into a profile is done by pnpm. If pnpm is missing the install command fails with a pnpm error — install pnpm (`npm i -g pnpm` or `corepack enable`) and retry.
15
- - **A working DSH host** (the `dsh` command, including its Web/agent runtime; **@deepseek-ai/dsh ≥ 0.1.5**, the minimum supported version). This plugin does not modify DSH source code; it only writes the orchestrator preset into DSH's preset roster and mounts the Paoding Config page into the Web sidebar, so a usable DSH home directory must exist first.
15
+ - **A working DSH host** (the `dsh` command, including its Web/agent runtime; **@deepseek-ai/dsh 0.1.5 – 0.1.7-rc.1**, all supported — the installer adapts to the two preset mechanisms automatically; see §2 "Version support and the dual preset landing"). This plugin does not modify DSH source code; it only writes the orchestrator preset into DSH's preset roster and mounts the Paoding Config page into the Web sidebar, so a usable DSH home directory must exist first.
16
16
  - **Path facts** (constants built into the generation pipeline; know them before customizing):
17
17
 
18
18
  | Item | Default | Description |
19
19
  |---|---|---|
20
20
  | `$DSH_HOME` | `~/.dsh` | The DSH home directory (the `DSH_HOME` environment variable is honored, defaulting to `$HOME/.dsh`). The home-layer `cordis.patch.yml`, `node_modules`, `profiles/<name>/cordis.patch.yml`, and plugin profile directories live under it |
21
- | preset roster root | `$DSH_HOME/.agent-presets/` | The directory `dsh-agent-presets` scans for locally authored presets |
22
- | Install target of this preset | `$DSH_HOME/.agent-presets/orchestrator` | The generated artifact: `agent.cordis.yml` (rewritten role config), `preset.yml`, `restrict.mjs`, and the `.generator-version` marker — a static directory |
21
+ | preset roster root | `$DSH_HOME/.agent-presets/` | Under DSH ≤ 0.1.6, `dsh-agent-presets` scans this directory for locally authored presets; under DSH ≥ 0.1.7 the host no longer scans it and the directory is just where the preset files live (see §2 "Version support and the dual preset landing") |
22
+ | Install target of this preset | `$DSH_HOME/.agent-presets/orchestrator` | The generated artifact: `agent.cordis.yml` (rewritten role config), `preset.yml`, `restrict.mjs`, and the `.generator-version` version-and-track marker — a static directory; per-workspace presets land in sibling `orchestrator-<slug>` directories |
23
+ | Declaration managed block (DSH ≥ 0.1.7 only) | a managed block inside `$DSH_HOME/cordis.patch.yml` | Opens with `# --- dsh-paoding presets (auto-generated; do not edit) ---` and closes with the matching end marker; the `- insert:` rows inside carry `@deepseek-ai/dsh-agent-preset` declarations, maintained by the installer — see §2 |
23
24
  | Config file | `$DSH_HOME/dsh-paoding.config.yml` | Role/tool assignments written by the Paoding Config panel's Save & Apply (`0o600`, hand-editable); first-install automation reads and writes it too |
24
25
 
25
26
  - **Environment variables**: `DSH_HOME` overrides the DSH home directory (default `~/.dsh`); `DSH_PAODING_CONFIG` overrides the config-file path (honored by the panel; the in-repo fallback CLI uses `--config <file>` instead).
@@ -47,17 +48,49 @@ The orchestrator preset needs no separate install — the plugin fills it in aut
47
48
 
48
49
  ### Profile semantics
49
50
 
50
- `--profile web` decides which profile the plugin is installed into: the Paoding Config page appears only in a DSH Web launched with that profile. `web` is the default profile of `dsh web`, so most machines need no change; multi-profile users run `dsh plugin add` once per profile they want it in. The orchestrator preset itself lives under `$DSH_HOME/.agent-presets/` and is shared machine-wide, independent of profiles — Save & Apply from any profile's panel writes the same preset.
51
+ `--profile web` decides which profile the plugin is installed into: the Paoding Config page appears only in a DSH Web launched with that profile. `web` is the default profile of `dsh web`, so most machines need no change; multi-profile users run `dsh plugin add` once per profile they want it in. The orchestrator preset itself lives under `$DSH_HOME/.agent-presets/` and is shared machine-wide, independent of profiles — under DSH ≥ 0.1.7 the declaration rows go into the home-layer `$DSH_HOME/cordis.patch.yml`, equally profile-independent — Save & Apply from any profile's panel writes the same preset.
52
+
53
+ ### Version support and the dual preset landing (DSH 0.1.5 – 0.1.7-rc.1)
54
+
55
+ The plugin supports two host generations: **DSH 0.1.5 / 0.1.6 / 0.1.7-rc.1 are all supported**, with an identical install and usage flow. As of plugin 0.3.4, package.json declares `peerDependencies: @deepseek-ai/dsh >= 0.1.5` explicitly — from 0.1.7 the host runs a plugin-compatibility precheck before installing: no declaration meant a default pass, an explicit one gets checked against the real compatibility surface; 0.1.5 / 0.1.6 never read the field, where the declaration is pure metadata and changes nothing about the install.
56
+
57
+ The two generations discover "local authored presets" differently, so the installer maintains a dual landing, detecting the host automatically — nothing for the user to do:
58
+
59
+ - **Directory track (DSH ≤ 0.1.6)**: the host discovers presets by scanning directories under `$DSH_HOME/.agent-presets/` — the directory is the registration. The installer writes the artifacts to `$DSH_HOME/.agent-presets/orchestrator/` (`agent.cordis.yml` + `preset.yml` + `restrict.mjs`) as before; workspace-specific presets land in sibling `orchestrator-<slug>` directories.
60
+ - **Declaration track (DSH ≥ 0.1.7)**: the host no longer scans directories; it reads `@deepseek-ai/dsh-agent-preset` declaration rows from the patch instead. The installer maintains a managed block in `$DSH_HOME/cordis.patch.yml` — opening with `# --- dsh-paoding presets (auto-generated; do not edit) ---` and closing with the matching end marker — whose `- insert:` rows write the declarations: the global preset gets `config.id: orchestrator`, a workspace preset gets `config.id: orchestrator-<slug>`, each with all plugin rows inlined under `plugins`; `restrict.mjs` is referenced by an absolute `file:` URL. The artifact trio still lands in `.agent-presets/<id>/` — demoted from "the directory is the registration" to "a place where the files live". User content outside the block is left untouched, byte for byte; the block carries a do-not-edit marker, and anything hand-edited inside it is overwritten by the next save.
61
+
62
+ The installer decides which track to take in this order:
63
+
64
+ 1. runtime probe from the Web panel first — the `agentPresets` service's `register` method exists only since 0.1.7; finding it means the declaration track;
65
+ 2. `dsh --version` on the CLI side;
66
+ 3. a last-resort probe of `$DSH_HOME/node_modules/@deepseek-ai/dsh-agent-preset` (that singular package being present means 0.1.7+);
67
+ 4. if all fail, default to ≤ 0.1.6 (the safe side).
68
+
69
+ The first save/self-heal after the host version changes migrates automatically, in both directions, with no manual steps:
70
+
71
+ - **Downgrade self-heal (0.1.7 → 0.1.6)**: 0.1.6 does not understand declaration rows — leaving them in the patch breaks profile startup — so the installer removes the managed block from the home patch automatically; the directory-track artifacts are already complete, and the preset slips back to directory scanning seamlessly.
72
+ - **Upgrade migration (0.1.6 → 0.1.7)**: the installer writes the managed block automatically; sessions on presets generated under the old track (`.agent-presets/`, `agentPreset: orchestrator`) keep matching under the new track by `config.id`, so old sessions resume without a gap.
73
+
74
+ Two cross-version behavior alignments happen the same automatic way, with no user action:
75
+
76
+ - **Summary budget**: from 0.1.7 the host raises the compaction `maxTokens` default to 65536; this preset pins `maxTokens: 8192` on `dsh-compaction-basic` explicitly, so the 0.1.5 / 0.1.6 summary-budget behavior is preserved identically on both generations.
77
+ - **Panel icons**: 0.1.7 changed the ui-primitives icon naming; the panel's icons carry a cross-version fallback, so one bundle renders correctly on both host generations and the panel behaves identically on either.
51
78
 
52
79
  ### First-install automation: restart = full install
53
80
 
54
81
  At startup the plugin checks whether the orchestrator preset is in place: if the `$DSH_HOME/.agent-presets/orchestrator` directory is missing, or its `.generator-version` marker does not match the plugin package version, it automatically performs one install equivalent to `--auto` — applying `~/.dsh/dsh-paoding.config.yml` when it exists, writing the base template otherwise (DSH base tools only; see below). It runs the same detection/generation pipeline as the panel's Save & Apply (`collectState` / `generateAndInstall`) — the same pipeline, but the startup self-heal detects with a pure file scan and no runtime detection facts while the panel detects with them; when a bundle-form plugin is installed on the host, the two detection inventories may differ, and the outputs differ slightly with them.
55
82
 
56
- So **`dsh plugin add` + restart = a complete install**: preset generated, config template on disk, panel ready — all in one step. If the automatic generation fails it never takes the plugin down — a warning is logged, and you can apply manually from the panel.
83
+ So **`dsh plugin add` + restart = a complete install**: preset generated, config template on disk, panel ready — all in one step. If the automatic generation fails it never takes the plugin down — a warning is logged, and you can apply manually from the panel. The startup self-heal also maintains the dual landing and the cross-version migration: after the host moves between 0.1.6 and 0.1.7, the first self-heal writes or removes the managed block in `$DSH_HOME/cordis.patch.yml` automatically (see "Version support and the dual preset landing" above). The same holds when **only dsh is upgraded and the plugin untouched**: after the host's preset system flips, the first startup backfills the missing declaration rows from the preset artifacts already on disk — no preset content is regenerated, and per-workspace presets are restored along with the base one.
57
84
 
58
85
  ### The version marker and auto-regeneration
59
86
 
60
- The `.generator-version` marker (its content = the generator version) is written by the plugin's startup self-heal after it generates the preset. The panel's Save & Apply (and the fallback CLI) do a full-directory rebuild and write no marker — the rebuild removes the old marker, so the next DSH start's self-heal finds it missing, runs one extra generation, and rewrites the marker (same output, just one extra round). The version-mismatch trigger is unchanged: after a plugin upgrade the marker no longer matches the package version, so the next DSH start regenerates the preset against the new version — the "upgraded the plugin but the preset is stale" drift is eliminated. The marker triggers regeneration only when missing or version-mismatched, and the panel does not watch the config file; to regenerate from the current config right away, hit Save & Apply.
87
+ The `.generator-version` marker is written by the plugin's startup self-heal after it generates the preset. Its content is two lines: **the generator version and the preset system track** (older releases wrote only the version; such markers read back as "track unknown", which is exactly the migration trigger after a host upgrade). Three triggers:
88
+
89
+ - **Marker missing or version-mismatched** (first install, plugin upgrade) → full regeneration. The panel's Save & Apply (and the fallback CLI) do a full-directory rebuild and write no marker — the rebuild removes the old marker, so the next DSH start's self-heal finds it missing, runs one extra generation, and rewrites the marker (same output, just one extra round). After a plugin upgrade the marker no longer matches the package version, so the next DSH start regenerates the preset against the new version — the "upgraded the plugin but the preset is stale" drift is eliminated.
90
+ - **Version matching but the track flipped** (dsh upgraded, plugin untouched — the most common upgrade path) → lightweight migration with no content regeneration: on the declarative track, missing declaration rows are backfilled from the on-disk artifacts (per-workspace presets included); on the directory track, any leftover declaration rows force a full regeneration that strips them (leftovers would break 0.1.6 profile startup).
91
+ - **Version and track both matching** → declaration-row reconciliation: missing rows are backfilled, orphan rows whose directories are gone are removed; if everything lines up, nothing is touched.
92
+
93
+ The panel does not watch the config file; to regenerate from the current config right away, hit Save & Apply.
61
94
 
62
95
  ### Base template and tool opt-in
63
96
 
@@ -81,7 +114,7 @@ Once installed:
81
114
  dsh plugin --profile <name> update dsh-paoding
82
115
  ```
83
116
 
84
- (the profile is auto-detected; usually nothing to fill in). The upgrade only swaps the plugin package inside the profile — the running process's code is untouched; on success it asks you to **restart DSH**, and at restart the preset regenerates itself against the new version via the `.generator-version` marker.
117
+ (the profile is auto-detected; usually nothing to fill in). The upgrade only swaps the plugin package inside the profile — the running process's code is untouched; on success it asks you to **restart DSH**, and at restart the preset regenerates itself against the new version via the `.generator-version` marker. Upgrading only the dsh host (plugin untouched) works the same way: the restart triggers the track-migration self-heal — no reinstall or manual re-apply needed.
85
118
 
86
119
  Manual equivalent: run the `dsh plugin update` command above yourself, restart, done.
87
120
 
@@ -164,7 +197,7 @@ Panel data goes over the **same-origin `/api/paoding/*`**: the Node side registe
164
197
  - **Agent tool-assignment cards**: one fixed card for the main agent (unchecking a base tool adds it to `main_agent_remove`, dropping it from the main agent; checking an MCP / plugin tool adds it to `main_agent_extra`; skills in two groups, "read on demand" and "inline full text"; plus a "persona extra" editor — edit, clear, or restore the default) + three built-in role cards (`search_external` / `design` / `implement`) + any number of custom role cards (with a delete button); every role card presents its tools in three groups — base / MCP / plugin — with per-item checkboxes, and the persona is editable. "Create a custom agent role" at the bottom.
165
198
  - **Skill assignment**: one row per skill, check which agents it goes to (written into the matching personas as `Available skills` soft guidance; role skills are soft guidance, main-agent skills have the read-on-demand/inline groups).
166
199
  - **Preview**: generates `agent.cordis.yml` without writing, showing each role's intent → kept counts plus the full generated text.
167
- - **Save & Apply**: after confirmation, writes the preset (overwriting `$DSH_HOME/.agent-presets/orchestrator`) and saves the current assignments to `$DSH_HOME/dsh-paoding.config.yml`; success asks you to restart DSH or start a new session (and flags when a patch is newer than the generated output). Opening the panel loads the existing config file as the current values — hand-edited choices are visible and editable right away.
200
+ - **Save & Apply**: after confirmation, writes the preset (overwriting `$DSH_HOME/.agent-presets/orchestrator`) and registers it per host generation — on ≤ 0.1.6 the directory scan picks it up as-is, on ≥ 0.1.7 the declaration managed block in `$DSH_HOME/cordis.patch.yml` is maintained in the same pass (see §2) — then saves the current assignments to `$DSH_HOME/dsh-paoding.config.yml`; success asks you to restart DSH or start a new session (and flags when a patch is newer than the generated output). Opening the panel loads the existing config file as the current values — hand-edited choices are visible and editable right away.
168
201
 
169
202
  ## 7. Uninstalling
170
203
 
@@ -178,6 +211,8 @@ rm -rf "${DSH_HOME:-$HOME/.dsh}/.agent-presets"/orchestrator-*
178
211
 
179
212
  The first removes the plugin and the sidebar panel (scoped to the given profile), the second deletes the orchestrator preset directory, and the third removes the per-workspace preset directories (`orchestrator-<basename>`) created when you configured individual workspaces (if you never did, the glob matches nothing and it's harmless) — the base `orchestrator` directory is already gone with the previous command and is not covered by that glob. The config file `~/.dsh/dsh-paoding.config.yml` is not removed with them — keep it or delete it, it does not affect any other DSH configuration, and a reinstall's first-install automation would apply it again.
180
213
 
214
+ On a DSH ≥ 0.1.7 host, check one more place: `$DSH_HOME/cordis.patch.yml` may still carry the dsh-paoding managed block (the `- insert:` declaration rows wrapped in marker comments). Once the preset directories are gone those declaration rows dangle, pointing at deleted directories — remove the whole managed block (from the `# --- dsh-paoding presets (auto-generated; do not edit) ---` opening line through the end marker) as well; content outside the block is untouched.
215
+
181
216
  Uninstalling touches nothing else on the host (MCP, plugins, sessions), and stays decoupled from DSH source code; "编排模式 (Orchestrator)" disappears from the preset selector for new sessions.
182
217
 
183
218
  ## 8. Troubleshooting
@@ -188,7 +223,7 @@ Uninstalling touches nothing else on the host (MCP, plugins, sessions), and stay
188
223
 
189
224
  **The plugin is installed but "编排模式 (Orchestrator)" is not in the preset list**
190
225
 
191
- The preset is generated automatically when the plugin starts: first make sure you **restarted DSH** after installing; presets load when a session is created, so after the restart you also need a new session for it to appear in the selector. Still nothing? Check the DSH log for `paoding-config-ui` warnings (a failed auto-generation is logged; apply manually from the panel), then check `ls "${DSH_HOME:-$HOME/.dsh}/.agent-presets/orchestrator"` — an empty directory usually means the plugin's runtime `$DSH_HOME` differs from the home directory you assumed (export `DSH_HOME=…` explicitly before launching DSH).
226
+ The preset is generated automatically when the plugin starts: first make sure you **restarted DSH** after installing; presets load when a session is created, so after the restart you also need a new session for it to appear in the selector. Still nothing? Check the DSH log for `paoding-config-ui` warnings (a failed auto-generation is logged; apply manually from the panel), then check `ls "${DSH_HOME:-$HOME/.dsh}/.agent-presets/orchestrator"` — an empty directory usually means the plugin's runtime `$DSH_HOME` differs from the home directory you assumed (export `DSH_HOME=…` explicitly before launching DSH). If the directory is there, the host is 0.1.7+, and the selector still shows nothing, check `$DSH_HOME/cordis.patch.yml` for the dsh-paoding managed block — 0.1.7 discovers presets through the declaration rows inside it; if the block is missing, hit Save & Apply once in the panel to write it (see §2 "Version support and the dual preset landing").
192
227
 
193
228
  **`tools.restrict()` reports unknown tools / subagent creation is rejected**
194
229
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dsh-paoding",
3
- "version": "0.3.3",
3
+ "version": "0.3.5",
4
4
  "description": "庖丁 — DSH (DeepSeek Harness) 编排模式安装器:host 感知的角色工具过滤 + Web 设置页可视化配置器",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -19,6 +19,9 @@
19
19
  "engines": {
20
20
  "node": ">=18"
21
21
  },
22
+ "peerDependencies": {
23
+ "@deepseek-ai/dsh": ">=0.1.5"
24
+ },
22
25
  "scripts": {
23
26
  "prepublishOnly": "node scripts/build-client.mjs --check"
24
27
  },
@@ -46,7 +49,6 @@
46
49
  "client": {
47
50
  "platform": "web",
48
51
  "inject": [
49
- "@deepseek-ai/dsh-client-runtime",
50
52
  "@deepseek-ai/dsh-client-ui-settings",
51
53
  "@deepseek-ai/dsh-client-connection"
52
54
  ]