dsh-paoding 0.4.2 → 0.4.4

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
@@ -22,10 +22,11 @@ dsh-paoding(中文品牌「庖丁」,典出《庄子》——庖丁顺纹理
22
22
  - **保存前先体检**:预览/应用时自动过一遍检查——配置了但未挂载的工具、零工具角色、查无此名的模型、预设落后于配置,分级提示一目了然;CLI 侧 `dsh-paoding doctor` 六项只读自检(配置可解析、安装轨道、声明行托管块、孤儿目录、版本标记、预设漂移),一条命令查全身。
23
23
  - **场景模板一键换班底**:轻量(只留实现)、调研(只留检索)、全开(全员到齐、主 agent 带满检测库存)三档点一下就切,只动「谁在场 + 主 agent 额外带什么」,精调过的角色配置分毫不动。
24
24
  - **配置可导出可导入**:面板「更多」菜单一键下载 `dsh-paoding.config.yml`,换机迁移、备份整份拷走;导入先验格式,覆盖整体配置(含工作区段)需二次确认。
25
+ - **HTTP 接口直连配置**:预设的列举、新增、更新、删除走 `/api/paoding/presets` 四条接口,随 DSH Web 服务同进程挂载、本机回环直调;与面板「保存并应用」同一条生成管线、同一把写盘互斥闸——脚本和自动化工具改班底,不必开浏览器。
25
26
  - **面板中英双语**:界面文案 zh/en 全覆盖,语言自动识别(显式选择 → 中文信号优先:浏览器语言、宿主页面语言、中文时区),「更多」菜单一键切换并记住。
26
- - **版本更新有提醒,面板一键升级**:面板会对比 npm registry(npmmirror 镜像、GitHub release 依次兜底)上的最新版本,发现新版就地提示并附上发布页链接;点「升级」就地换上新版(profile 自动探测:普通 profile 走 `dsh plugin update dsh-paoding`;desktop profile 被 dsh CLI 的 Electron 专属守卫挡住,改在 profile 目录直跑 `pnpm add dsh-paoding@<版本>`),重启 DSH 后生效,编排预设会在重启时按新版自动重生成。开发检出的 link 形态无法就地升级,面板会提示切回 registry 版的办法;检测失败时页头留一行「版本检测失败 · 重试」(完整原因与代理排查提示在悬浮提示里),不弹窗打扰。
27
+ - **版本更新有提醒,面板一键升级**:面板会对比 npm registry(npmmirror 镜像、GitHub release 依次兜底)上的最新版本,发现新版就地提示并附上发布页链接;点「升级」就地换上新版(profile 自动探测:普通 profile 走 `dsh plugin update dsh-paoding`;desktop profile 被 dsh CLI 的 Electron 专属守卫挡住,改在 profile 目录直跑 `pnpm add dsh-paoding@<版本>`,pnpm 找不到时自动回落 `corepack pnpm`),重启 DSH 后生效,编排预设会在重启时按新版自动重生成。开发检出的 link 形态无法就地升级,面板会提示切回 registry 版的办法;检测失败时页头留一行「版本检测失败 · 重试」(完整原因与代理排查提示在悬浮提示里),不弹窗打扰。
27
28
  - **来去自由**:不改 DSH 一行源码;装完新会话即用,卸载即删目录。
28
- - **两代宿主都兼容**:DSH 0.1.5 – 0.2.0-rc.2 全支持(0.1.5 / 0.1.6 / 0.1.7-rc.1 / 0.1.7-rc.2 / 0.2.0-rc.1 / 0.2.0-rc.2)——两代宿主发现预设的机制不同(目录扫描 vs patch 声明行),安装器自动检测宿主版本选对落点;编排组合里的 workflow worker 行也按宿主版本自动适配(0.1.5 用 workflow-worker-thread,0.1.6+ 换 workflow-ptc——旧包 0.1.6 起已删除,残留行正是 0.2.0 面板上「加载失败」的元凶),宿主升级、降级后的首次保存/自愈自动迁移,全程无感。
29
+ - **两代宿主都兼容**:DSH 0.1.5 – 0.2.1 全支持(0.1.5 / 0.1.6 / 0.1.7-rc.1 / 0.1.7-rc.2 / 0.2.0-rc.1 / 0.2.0-rc.2 / 0.2.1-rc.2+)——两代宿主发现预设的机制不同(目录扫描 vs patch 声明行),安装器自动检测宿主版本选对落点;编排组合里的 workflow worker 行也按宿主版本自动适配(0.1.5 用 workflow-worker-thread,0.1.6+ 换 workflow-ptc——旧包 0.1.6 起已删除,残留行正是 0.2.0 面板上「加载失败」的元凶);DSH 0.2.1 起角色委派行同步换代(0.2.1 的 dsh-tool-subagent 拒绝内联 persona/toolFilter——人设与工具面改挂各角色的 AgentPreset,spawn 子代理按 agentPreset 选择子预设;0.2.0 及以下保持内联形状),宿主升级、降级后的首次保存/自愈自动迁移(工作区专属预设 orchestrator-<slug> 随同轮自愈一并换代),全程无感;0.2.1 的 prerelease 再细分——tool-subagent 守卫自 0.2.1-rc.2 落地,rc.0/rc.1 仍按内联形状生成。
29
30
 
30
31
  ## 插件截图
31
32
 
@@ -33,7 +34,7 @@ dsh-paoding(中文品牌「庖丁」,典出《庄子》——庖丁顺纹理
33
34
 
34
35
  ## 快速开始
35
36
 
36
- 前置:**Node.js ≥ 18**、**pnpm** 与一台已装好的 DSH host(**@deepseek-ai/dsh 0.1.5 – 0.2.0-rc.2** 全支持,预设落点自动适配两代宿主机制)。
37
+ 前置:**Node.js ≥ 18**、**pnpm** 与一台已装好的 DSH host(**@deepseek-ai/dsh 0.1.5 – 0.2.1** 全支持,预设落点与角色委派行形态自动适配宿主版本)。
37
38
 
38
39
  **官方插件通道(唯一安装入口)**——不用克隆仓库,一条命令,装完重启即用:
39
40
 
@@ -62,7 +63,7 @@ git clone https://github.com/lifangjin/dsh-paoding.git
62
63
  dsh plugin --profile web add link:"$PWD/dsh-paoding"
63
64
  ```
64
65
 
65
- 升级走面板「升级」按钮(普通 profile 等价 `dsh plugin update dsh-paoding`;desktop profile 则在 profile 目录直跑 `pnpm add` 精确版本)。详细步骤、升级与排查见 [安装文档](docs/installation.md)。
66
+ 升级走面板「升级」按钮(普通 profile 等价 `dsh plugin update dsh-paoding`;desktop profile 则在 profile 目录直跑 `pnpm add` 精确版本,无裸 pnpm 时自动用 `corepack pnpm`)。详细步骤、升级与排查见 [安装文档](docs/installation.md)。
66
67
 
67
68
  ## 怎么用
68
69
 
@@ -81,14 +82,22 @@ dsh plugin --profile web add link:"$PWD/dsh-paoding"
81
82
 
82
83
  所有偏好都写在 `~/.dsh/dsh-paoding.config.yml`:角色增删改、技能分配、专用模型、会话模式(one-shot / continuable)、启动方式(fresh / fork)、主 agent 的工具与技能……改完打开左侧栏底部的「庖丁配置」入口,点「保存并应用」即同步生效。预设每次由「静态源 + 配置」重新生成,不攒手工补丁。全部配置键说明见 [配置文档](docs/configuration.md);背后机制与成本账见 [架构文档](docs/architecture.md)。
83
84
 
85
+ 偏好走脚本的,还有一套 HTTP 接口:`/api/paoding/presets` 覆盖预设的列举 / 新增 / 更新 / 删除,随 DSH Web 服务同进程(端口即浏览器打开 DSH 的那个端口),本机回环直调即可:
86
+
87
+ ```bash
88
+ curl http://127.0.0.1:19387/api/paoding/presets
89
+ ```
90
+
91
+ 写操作与面板「保存并应用」同一条生成管线与写盘互斥。方法、请求体与错误语义见 [配置文档](docs/configuration.md)第 13 节。
92
+
84
93
  ## 文档
85
94
 
86
95
  | 文档 | 内容 |
87
96
  |---|---|
88
97
  | [架构](docs/architecture.md) | 为什么这样设计——概述、成本账、角色与工具、对应 DSH 原生机制、Token 治理、已知边界。 |
89
- | [安装](docs/installation.md) | 官方插件通道一条命令安装、版本支持与预设落点双轨(DSH 0.1.5 – 0.2.0-rc.2)、首装自动化与版本标记、升级、开发检出自装、host patch 检测机制、庖丁配置面板、卸载、排查。 |
98
+ | [安装](docs/installation.md) | 官方插件通道一条命令安装、版本支持与预设落点双轨(DSH 0.1.5 – 0.2.1)、首装自动化与版本标记、升级、开发检出自装、host patch 检测机制、庖丁配置面板、卸载、排查。 |
90
99
  | [编排](docs/orchestration.md) | 编排总览、失败如何呈现与三层处理、one-shot vs continuable、上下文隔离。 |
91
- | [配置](docs/configuration.md) | 配置键全参考、内置角色微调、主 agent 工具与技能、自定义角色、按角色分模型、角色会话模式。 |
100
+ | [配置](docs/configuration.md) | 配置键全参考、工具条目通配符、内置角色微调、主 agent 工具与技能、自定义角色、按角色分模型、角色会话与启动方式、场景模板、配置导出导入、检查提示、HTTP 接口。 |
92
101
 
93
102
  ## 贡献
94
103
 
package/README_en.md CHANGED
@@ -22,10 +22,11 @@ dsh-paoding (Chinese brand 「庖丁」/ Pao Ding, from the Zhuangzi parable of
22
22
  - **A health check before every save**: preview/apply runs a built-in check — tools configured but not mounted, zero-tool roles, unknown model names, a preset lagging behind the config — each flagged by severity; on the CLI side, `dsh-paoding doctor` runs six read-only checks (config parses, install track, managed declaration block, orphan directories, version marker, preset drift) in one command.
23
23
  - **Scenario templates swap the roster in one click**: Lite (implement only), Research (search roles only), and Full (everyone on deck, main agent carrying the whole detected inventory) — templates only touch who is present and what the main agent carries; hand-tuned role settings are never touched.
24
24
  - **Config export & import**: download `dsh-paoding.config.yml` from the panel's More menu for migration or backup; imports are validated first, and overwriting the whole config (workspaces included) asks for confirmation.
25
+ - **Config over HTTP**: list, create, update, and delete presets through the four `/api/paoding/presets` endpoints, served in-process by the DSH web service and callable over loopback; they ride the panel's Save & Apply generation pipeline and share its write lock, so scripts and automation tools can reshape the roster without opening a browser.
25
26
  - **Panel in English and Chinese**: every UI string ships in both languages, auto-detected (explicit choice first, then Chinese signals — browser language, host page language, Chinese time zones — outrank English ones, since the Electron shell pins navigator to en-US regardless of the OS), switchable from the More menu and remembered.
26
- - **Notified of new releases, one-click upgrade in the panel**: the panel compares your local version against the latest npm registry publish (npmmirror and GitHub release as successive fallbacks) and points to the release page when a newer one is out. The Upgrade button swaps in the new version in place (profile auto-detected): regular profiles go through `dsh plugin update dsh-paoding`, while the Electron-owned desktop profile — which the dsh CLI guards against — gets a direct `pnpm add dsh-paoding@<version>` run in the profile directory; 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), a subdued "version check failed · retry" row stays in the header (full causes and proxy hints in its tooltip) without popping anything up.
27
+ - **Notified of new releases, one-click upgrade in the panel**: the panel compares your local version against the latest npm registry publish (npmmirror and GitHub release as successive fallbacks) and points to the release page when a newer one is out. The Upgrade button swaps in the new version in place (profile auto-detected): regular profiles go through `dsh plugin update dsh-paoding`, while the Electron-owned desktop profile — which the dsh CLI guards against — gets a direct `pnpm add dsh-paoding@<version>` run in the profile directory, falling back to `corepack pnpm` when no bare pnpm is on PATH; 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), a subdued "version check failed · retry" row stays in the header (full causes and proxy hints in its tooltip) without popping anything up.
27
28
  - **Installs and uninstalls cleanly**: no DSH source changes; active in a new session right after install, gone when you delete one directory.
28
- - **Works on both host generations**: DSH 0.1.5 through 0.2.0-rc.2 are all supported (0.1.5 / 0.1.6 / 0.1.7-rc.1 / 0.1.7-rc.2 / 0.2.0-rc.1 / 0.2.0-rc.2) — the two generations discover presets differently (directory scan vs patch declaration rows), and the installer picks the right landing automatically; from 0.2.0 the workflow worker row in the orchestration composition also adapts to the host version at generation time (0.1.5 uses workflow-worker-thread, 0.1.6+ swaps to workflow-ptc). Migration happens on the first save/self-heal after a host upgrade or downgrade, all without user action.
29
+ - **Works on both host generations**: DSH 0.1.5 through 0.2.1 are all supported (0.1.5 / 0.1.6 / 0.1.7-rc.1 / 0.1.7-rc.2 / 0.2.0-rc.1 / 0.2.0-rc.2 / 0.2.1-rc.2+) — the two generations discover presets differently (directory scan vs patch declaration rows), and the installer picks the right landing automatically; from 0.2.0 the workflow worker row in the orchestration composition also adapts to the host version at generation time (0.1.5 uses workflow-worker-thread, 0.1.6+ swaps to workflow-ptc); from DSH 0.2.1 the role delegation rows migrate too (0.2.1's dsh-tool-subagent rejects inline persona/toolFilter — each role gets an AgentPreset holding its persona and a role-restrict tool-surface plugin, selected via agentPreset on the spawn delegation; 0.2.0 and below keep the inline shape). Migration happens on the first save/self-heal after a host upgrade or downgrade (workspace presets, orchestrator-<slug>, are regenerated in the same self-heal pass), all without user action; the 0.2.1 prereleases are subdivided further — the tool-subagent guard landed in 0.2.1-rc.2, so rc.0/rc.1 keep the inline shape.
29
30
 
30
31
  ## Screenshots
31
32
 
@@ -33,7 +34,7 @@ dsh-paoding (Chinese brand 「庖丁」/ Pao Ding, from the Zhuangzi parable of
33
34
 
34
35
  ## Quick Start
35
36
 
36
- Prerequisites: **Node.js ≥ 18**, **pnpm**, and a working DSH host (**@deepseek-ai/dsh 0.1.5 – 0.2.0-rc.2**, all supported — the preset landing adapts to the host generation automatically).
37
+ Prerequisites: **Node.js ≥ 18**, **pnpm**, and a working DSH host (**@deepseek-ai/dsh 0.1.5 – 0.2.1**, all supported — the preset landing and role-row shape adapt to the host version automatically).
37
38
 
38
39
  **The official plugin channel (the only install route)** — no clone needed; one command, then a restart:
39
40
 
@@ -62,7 +63,7 @@ git clone https://github.com/lifangjin/dsh-paoding.git
62
63
  dsh plugin --profile web add link:"$PWD/dsh-paoding"
63
64
  ```
64
65
 
65
- Upgrades go through the panel's Upgrade button (regular profiles: equivalent to `dsh plugin update dsh-paoding`; the desktop profile: a direct `pnpm add` of the exact version in the profile directory). Full steps, upgrading, and troubleshooting are in the [installation guide](docs/installation_en.md).
66
+ Upgrades go through the panel's Upgrade button (regular profiles: equivalent to `dsh plugin update dsh-paoding`; the desktop profile: a direct `pnpm add` of the exact version in the profile directory, via `corepack pnpm` when no bare pnpm exists). Full steps, upgrading, and troubleshooting are in the [installation guide](docs/installation_en.md).
66
67
 
67
68
  ## How It Works in Practice
68
69
 
@@ -81,14 +82,22 @@ While a helper runs, the main agent can send follow-ups, check progress, or stop
81
82
 
82
83
  All preferences live in `~/.dsh/dsh-paoding.config.yml`: role add/remove/tweak, skill assignment, per-role models, per-role session modes (one-shot / continuable), per-role start modes (fresh / fork), the main agent's tools and skills… Edit it, open the 庖丁配置 (Paoding Config) entry at the bottom of the sidebar, and hit Save & Apply — the preset syncs. It is regenerated from "static source + config" every time, so no manual patches pile up. The full key reference is in the [configuration guide](docs/configuration_en.md); the rationale and the cost ledger are in the [architecture guide](docs/architecture_en.md).
83
84
 
85
+ Prefer driving it from a script? An HTTP API covers the same ground: `/api/paoding/presets` lists, creates, updates, and deletes presets. It rides the DSH web service (same port you open DSH at in the browser) and answers loopback calls directly:
86
+
87
+ ```bash
88
+ curl http://127.0.0.1:19387/api/paoding/presets
89
+ ```
90
+
91
+ Writes go through the same generation pipeline and write lock as the panel's Save & Apply. Methods, request bodies, and error semantics are in [section 13 of the configuration guide](docs/configuration_en.md).
92
+
84
93
  ## Documentation
85
94
 
86
95
  | Document | Contents |
87
96
  |---|---|
88
97
  | [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. |
89
- | [Installation](docs/installation_en.md) | The single official channel (`dsh plugin add`), version support and the dual preset landing (DSH 0.1.5 – 0.2.0-rc.2), first-install automation and the version marker, upgrading, dev-checkout install, host patch detection, the Paoding Config panel, uninstalling, troubleshooting. |
98
+ | [Installation](docs/installation_en.md) | The single official channel (`dsh plugin add`), version support and the dual preset landing (DSH 0.1.5 – 0.2.1), first-install automation and the version marker, upgrading, dev-checkout install, host patch detection, the Paoding Config panel, uninstalling, troubleshooting. |
90
99
  | [Orchestration](docs/orchestration_en.md) | Orchestration overview, how failures surface and the three recovery layers, one-shot vs continuable, context isolation. |
91
- | [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. |
100
+ | [Configuration](docs/configuration_en.md) | The full key reference, tool-entry wildcards, tuning built-in roles, main-agent tools and skills, custom roles, per-role models, per-role session and start modes, scenario templates, config export/import, health-check hints, the HTTP API. |
92
101
 
93
102
  ## Contributing
94
103
 
@@ -750,3 +750,20 @@ workspaces:
750
750
  | `generation` | warn | 生成器自身的提示信息(如默认值回退) |
751
751
 
752
752
  作废口径:**预览**产生的提示随配置草稿的任何改动一并作废(与预览同一逻辑);**应用**产生的提示描述的是已落盘结果,保留到下一次预览或应用。应用失败时错误 toast 照旧,同时卡片给出每条失败原因;应用成功但存在 warn/error 级提示时,成功 toast 会换成琥珀档「有 N 条检查提示,见下方」。
753
+
754
+ ## 13. HTTP 接口
755
+
756
+ 插件的 Web 后端随 DSH Web 服务同进程挂载在 `/api/paoding/*` 前缀下(回环地址 + 端口随部署,信任围栏与面板一致),面板能做的配置读写,脚本与自动化工具也能照做。预设对象的完整 CRUD 四条:
757
+
758
+ | 方法与路径 | 语义 |
759
+ | --- | --- |
760
+ | `GET /api/paoding/presets` | 列举预设。返回 `{ ok, presets: [...] }`:全局 `orchestrator` 恒在首位(`scope: 'global'`、`workspacePath: null`,`assignments` = 配置顶层剥掉 `profile` / `workspaces` 后的目标字段),其后按配置 `workspaces` 段逐个工作区项(`scope: 'workspace'`);每项带 `installed`(落盘产物是否在场) |
761
+ | `POST /api/paoding/presets` | 新增(或幂等更新)工作区预设。body:`{ workspace: <绝对路径>, assignments: <目标字段对象> }`。等价「保存并应用」勾上该工作区:同一条生成管线落 `orchestrator-<slug>` 并把条目并进配置 `workspaces` 段;响应在 apply 字段(`wrote` / `roleResults` / `text` / `presetId` / `configFile` / `warnings`)之外附 `created`(此前配置里是否还没有该条目)与 `workspace`(归一后的绝对路径) |
762
+ | `PUT /api/paoding/presets/<id>` | 更新既有预设。body:`{ assignments }`;`<id>` 取 `orchestrator`(全局更新,等价 apply 不带 workspace)或 `orchestrator-<slug>`(按 id 反查到的工作区)。响应同 POST,但没有 `created` |
763
+ | `DELETE /api/paoding/presets/<id>` | 删除工作区预设:配置 `workspaces` 条目、`~/.dsh/.agent-presets/orchestrator-<slug>` 目录、声明行轨的声明行一次清干净。全局 `orchestrator` 拒绝删除(403)——插件启动自愈会自动重装,卸载请移除 dsh-paoding 插件 |
764
+
765
+ 几点约定:
766
+
767
+ - **同管线同体检**:写操作(POST / PUT)与面板「保存并应用」走同一条生成管线,响应的 `warnings` 字段即 §12 的结构化体检结果;并共用同一把写盘互斥闸——任一写操作进行中,其余写请求收到 409,稍后重试即可。
768
+ - **错误语义**:请求体缺失 / 工作区目录不存在等 422;目标预设不存在 404;删除全局预设 403;其余服务端错误 500,响应统一为 `{ error }`(生成失败时另带 `warnings`)。
769
+ - **删除只清配置层**:DELETE 清的是配置 `workspaces` 条目与预设产物(目录 + 声明行),不动宿主工作区注册表——注册/注销工作区仍走面板「添加工作区」对应的接口。
@@ -762,3 +762,20 @@ Entries come from the structured health review (`tools/lib/health.mjs`); codes a
762
762
  | `generation` | warn | Generator's own notices (e.g. default-value fallbacks) |
763
763
 
764
764
  Invalidation scope: messages from a **preview** are discarded together with the draft on any config edit (same rule as the preview itself); messages from an **apply** describe what has already been written and survive until the next preview or apply. When an apply fails, the error toast stays as usual and the card lists every reason; when an apply succeeds but warn/error-level findings exist, the success toast switches to the amber variant "N check messages, see below".
765
+
766
+ ## 13. HTTP API
767
+
768
+ The plugin's web backend is mounted under the `/api/paoding/*` prefix inside the DSH web server itself (loopback address + port per your deployment; the same trust fence as the panel). Anything the panel can do to the config, scripts and automation can do too. Full CRUD for preset objects:
769
+
770
+ | Method & path | Semantics |
771
+ | --- | --- |
772
+ | `GET /api/paoding/presets` | List presets. Returns `{ ok, presets: [...] }`: the global `orchestrator` always comes first (`scope: 'global'`, `workspacePath: null`, `assignments` = the config's top-level target fields minus `profile` / `workspaces`), followed by one entry per configured workspace (`scope: 'workspace'`); every entry carries `installed` (whether the on-disk preset exists) |
773
+ | `POST /api/paoding/presets` | Create (or idempotently update) a workspace preset. Body: `{ workspace: <absolute path>, assignments: <target-fields object> }`. Equivalent to "save & apply" with that workspace selected: the same generation pipeline writes `orchestrator-<slug>` and merges the entry into the config's `workspaces` section; the response adds `created` (whether the config lacked this entry before) and `workspace` (the normalized absolute path) on top of the apply fields (`wrote` / `roleResults` / `text` / `presetId` / `configFile` / `warnings`) |
774
+ | `PUT /api/paoding/presets/<id>` | Update an existing preset. Body: `{ assignments }`; `<id>` is either `orchestrator` (global update, equivalent to apply without a workspace) or `orchestrator-<slug>` (the workspace resolved from the id). Response as POST, but without `created` |
775
+ | `DELETE /api/paoding/presets/<id>` | Delete a workspace preset: the config `workspaces` entry, the `~/.dsh/.agent-presets/orchestrator-<slug>` directory, and its declarative-track row are removed in one go. The global `orchestrator` refuses deletion (403) — the plugin's startup self-heal reinstalls it; uninstall the dsh-paoding plugin instead |
776
+
777
+ Ground rules:
778
+
779
+ - **Same pipeline, same health review**: writes (POST / PUT) run through the same generation pipeline as the panel's "save & apply"; the response's `warnings` field is the §12 structured health review. They also share the same in-flight write gate — while any write is running, other writes answer 409; retry shortly.
780
+ - **Error semantics**: missing body fields or a non-existent workspace directory answer 422; an unknown preset id answers 404; deleting the global preset answers 403; anything else answers 500. Responses are uniformly `{ error }` (generation failures additionally carry `warnings`).
781
+ - **Deletion only touches the config layer**: DELETE removes the `workspaces` config entry and the preset artifacts (directory + declarative row), not the host workspace registry — registering/unregistering workspaces remains the job of the API behind the panel's "add workspace".
@@ -12,7 +12,7 @@
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 – 0.2.0-rc.2** 全支持,安装器自动适配两代预设机制,详见第 2 节「版本支持与预设落点双轨」)。本插件不改 DSH 源码,只往 DSH 的 preset roster 写入编排预设、并把「庖丁配置」面板挂进 Web 左侧栏,因此先要有可用的 DSH 家目录。
15
+ - **已安装 DSH host**(`dsh` 可用,含其 Web/agent 运行时;**@deepseek-ai/dsh 0.1.5 – 0.2.1** 全支持,安装器自动适配宿主版本(预设落点与角色委派行形态),详见第 2 节「版本支持与预设落点双轨」)。本插件不改 DSH 源码,只往 DSH 的 preset roster 写入编排预设、并把「庖丁配置」面板挂进 Web 左侧栏,因此先要有可用的 DSH 家目录。
16
16
  - **路径事实**(生成管线内建常量,写死前先了解它们):
17
17
 
18
18
  | 项 | 默认值 | 说明 |
@@ -50,9 +50,9 @@ dsh plugin --profile web add dsh-paoding
50
50
 
51
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
52
 
53
- ### 版本支持与预设落点双轨(DSH 0.1.5 – 0.2.0-rc.2)
53
+ ### 版本支持与预设落点双轨(DSH 0.1.5 – 0.2.1)
54
54
 
55
- 本插件兼容两代宿主:**DSH 0.1.5 / 0.1.6 / 0.1.7-rc.1 / 0.1.7-rc.2 / 0.2.0-rc.1 / 0.2.0-rc.2 全部支持**,安装与使用流程完全一致。插件 0.3.4 起,package.json 显式声明 `peerDependencies: @deepseek-ai/dsh >= 0.1.5`——0.1.7 起宿主装插件前做兼容性预检,无声明等于默认放行,显式声明后按真实兼容面把关;0.1.5 / 0.1.6 不读这个字段,声明纯属元数据,不影响安装。
55
+ 本插件兼容两代宿主:**DSH 0.1.5 / 0.1.6 / 0.1.7-rc.1 / 0.1.7-rc.2 / 0.2.0-rc.1 / 0.2.0-rc.2 / 0.2.1-rc.2+ 全部支持**,安装与使用流程完全一致。插件 0.3.4 起,package.json 显式声明 `peerDependencies: @deepseek-ai/dsh >= 0.1.5`——0.1.7 起宿主装插件前做兼容性预检,无声明等于默认放行,显式声明后按真实兼容面把关;0.1.5 / 0.1.6 不读这个字段,声明纯属元数据,不影响安装。
56
56
 
57
57
  两代宿主发现「本地 authored preset」的机制不同,安装器据此分双轨落点,宿主检测全自动、用户无感:
58
58
 
@@ -70,6 +70,7 @@ dsh plugin --profile web add dsh-paoding
70
70
 
71
71
  - **降级自愈(0.1.7 → 0.1.6)**:0.1.6 不认识声明行,声明行留在 patch 里会让 profile 启动失败——安装器自动撤下 home patch 里的托管块;目录轨产物本就齐全,预设无缝回到目录扫描。
72
72
  - **升级迁移(0.1.6 → 0.1.7)**:安装器自动补写托管块;`.agent-presets/` 里按旧轨生成的 preset 会话(`agentPreset: orchestrator`)在新轨下按 `config.id` 继续对上,老会话恢复不断档。
73
+ - **角色委派行换代(0.2.0 → 0.2.1)**:0.2.1 起 dsh-tool-subagent 拒绝配置里的内联 persona / toolFilter(出现即抛错,挂编排预设的新建会话直接失败),自愈整盘重生成把人设与工具面迁到各角色的 AgentPreset(`agentPreset: paoding-role-<角色名>`);工作区专属预设(orchestrator-<slug>)随同轮自愈一并换代。0.2.1 的 prerelease 再细分——守卫自 0.2.1-rc.2 落地,rc.0 / rc.1 仍按内联形状生成。
73
74
 
74
75
  另有两处跨版本行为对齐,同样自动完成、无需用户动作:
75
76
 
@@ -117,7 +118,7 @@ dsh plugin --profile <name> update dsh-paoding
117
118
 
118
119
  (profile 自动探测,通常无需手填。)升级只换 profile 里的插件包本体,当前进程的代码不变;成功后提示**重启 DSH**,重启时 preset 按 `.generator-version` 标记自动按新版重生成。只升级 dsh 本体(不动插件)同理:重启即触发轨道迁移自愈,无需重装或重新应用。
119
120
 
120
- 手动升级等价:普通 profile 直接在终端跑上面这条 `dsh plugin update` 命令;desktop profile 被 dsh CLI 独占守卫挡住,等价命令是 `cd ~/.dsh/profiles/desktop && pnpm add dsh-paoding@latest`,同样重启生效。
121
+ 手动升级等价:普通 profile 直接在终端跑上面这条 `dsh plugin update` 命令;desktop profile 被 dsh CLI 独占守卫挡住,等价命令是 `cd ~/.dsh/profiles/desktop && pnpm add dsh-paoding@latest`(机器上没有裸 `pnpm` 命令时用 `corepack pnpm add`,见第 8 节排查),同样重启生效。
121
122
 
122
123
  **开发 link 形态**(见第 4 节)版本比较照常(更新卡有新版照常提示),但无法就地升级——升级器要求包真实装在某个 profile 的 node_modules 下,link 直连仓库匹配不到;点「升级」会如实报这一点,并提示手动跑 `dsh plugin add dsh-paoding@latest` 切回 registry 版。
123
124
 
@@ -190,7 +191,7 @@ patch 与配置文件用 **`yaml` 包**解析——通过 `createRequire` 从 `$
190
191
 
191
192
  ### 数据接口与安全
192
193
 
193
- 面板数据走**同源 `/api/paoding/*`**:Node 侧注册前缀路由——`GET /api/paoding/state`(带缓存的检测状态)、`GET /api/paoding/version`(最新版检测,版本/更新卡的数据源)、`GET /api/paoding/models`(宿主模型运行时的模型清单)、`GET` + `POST /api/paoding/workspaces`(工作区列表 / 添加工作区)、`POST /api/paoding/rescan`(强制重检测,含 MCP 握手)、`POST /api/paoding/preview`(不写盘生成)、`POST /api/paoding/apply`(安装并保存配置)、`POST /api/paoding/upgrade`(就地升级:普通 profile 走 `dsh plugin update`,desktop profile 直跑 `pnpm add`)、`GET /api/paoding/client.css`(面板样式静态下发)——复用 `tools/` 的检测与生成管线(`plugins/paoding-config-ui/api-core.mjs`)。路由自带**浏览器信任围栏**:Host 必须回环或落在 `webRuntime.trustedHosts`,并拒绝 cross-site 请求(复刻 DSH `/api` 网关围栏语义,因为 `/api/paoding` 前缀更长会命中本插件而绕开网关)。面板**没有独立服务端/端口**:DSH Web 端口只监听 `127.0.0.1`,不对外网暴露。
194
+ 面板数据走**同源 `/api/paoding/*`**:Node 侧注册前缀路由——`GET /api/paoding/state`(带缓存的检测状态)、`GET /api/paoding/version`(最新版检测,版本/更新卡的数据源)、`GET /api/paoding/models`(宿主模型运行时的模型清单)、`GET` + `POST /api/paoding/workspaces`(工作区列表 / 添加工作区)、`POST /api/paoding/rescan`(强制重检测,含 MCP 握手)、`POST /api/paoding/preview`(不写盘生成)、`POST /api/paoding/apply`(安装并保存配置)、`POST /api/paoding/upgrade`(就地升级:普通 profile 走 `dsh plugin update`,desktop profile 直跑 `pnpm add`,pnpm 按「裸 pnpm → `corepack pnpm` → PNPM_HOME 落位」候选链解析)、`GET /api/paoding/config/export`(配置文件原文导出,下载/备份用)、`POST /api/paoding/config/import`(整份导入:先验格式、与「保存并应用」共用写盘闸)、`GET /api/paoding/client.css`(面板样式静态下发)——复用 `tools/` 的检测与生成管线(`plugins/paoding-config-ui/api-core.mjs`)。路由自带**浏览器信任围栏**:Host 必须回环或落在 `webRuntime.trustedHosts`,并拒绝 cross-site 请求(复刻 DSH `/api` 网关围栏语义,因为 `/api/paoding` 前缀更长会命中本插件而绕开网关)。面板**没有独立服务端/端口**:DSH Web 端口只监听 `127.0.0.1`,不对外网暴露。
194
195
 
195
196
  ### 面板能力
196
197
 
@@ -199,6 +200,9 @@ patch 与配置文件用 **`yaml` 包**解析——通过 `createRequire` 从 `$
199
200
  - **技能分配**:每个 skill 一行,勾选分配给哪些 agent(写入对应 persona 的 `Available skills` 软引导;角色技能软引导,主 agent 技能另有 read 按需/内联两组)。
200
201
  - **预览生成**:不写盘生成 `agent.cordis.yml`,显示每个角色 allow 的 intent → kept 计数与生成全文。
201
202
  - **保存并应用**:确认后写入 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 比生成结果新时提示重启后生效)。打开面板时会加载既有配置文件作为当前值——手编过的选择直接可见、可改。
203
+ - **场景模板**:页头三档切换(轻量:只留实现角色;调研:只留检索角色;全开:全员到齐、主 agent 额外工具带满检测库存),一键换「班底」;只动 `roles_remove` 与 `main_agent_extra`,各角色精调过的工具面、persona、模型、启动方式分毫不动,切回即原样复原。
204
+ - **检查提示卡**:每次「预览生成 / 保存并应用」自动过一遍体检(配置了未挂载的工具、零工具角色、查无此名的模型、预设落后于配置),分级提示以卡片形式贴在页头下方,处理完再保存不迟。
205
+ - **「更多」菜单**:配置导出(下载 `dsh-paoding.config.yml` 原文)/ 导入(先验格式,整份覆盖含工作区段,需二次确认)与面板语言切换(中英自动识别、手动选择优先并记住)。
202
206
 
203
207
  ## 7. 卸载
204
208
 
@@ -12,7 +12,7 @@ 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 – 0.2.0-rc.2**, 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.
15
+ - **A working DSH host** (the `dsh` command, including its Web/agent runtime; **@deepseek-ai/dsh 0.1.5 – 0.2.1**, all supported — the installer adapts to the host version automatically (preset landing and role-row shape); 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 |
@@ -50,9 +50,9 @@ The orchestrator preset needs no separate install — the plugin fills it in aut
50
50
 
51
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
52
 
53
- ### Version support and the dual preset landing (DSH 0.1.5 – 0.2.0-rc.2)
53
+ ### Version support and the dual preset landing (DSH 0.1.5 – 0.2.1)
54
54
 
55
- The plugin supports two host generations: **DSH 0.1.5 / 0.1.6 / 0.1.7-rc.1 / 0.1.7-rc.2 / 0.2.0-rc.1 / 0.2.0-rc.2 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.
55
+ The plugin supports two host generations: **DSH 0.1.5 / 0.1.6 / 0.1.7-rc.1 / 0.1.7-rc.2 / 0.2.0-rc.1 / 0.2.0-rc.2 / 0.2.1-rc.2+ 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
56
 
57
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
58
 
@@ -70,6 +70,7 @@ The first save/self-heal after the host version changes migrates automatically,
70
70
 
71
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
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
+ - **Role delegation row migration (0.2.0 → 0.2.1)**: from 0.2.1 dsh-tool-subagent rejects inline persona / toolFilter in the configuration (present means thrown error; new sessions on the orchestrator preset fail outright), and self-heal regenerates the whole preset, moving each role's persona and tool surface into a per-role AgentPreset (`agentPreset: paoding-role-<role>`); workspace presets (orchestrator-<slug>) are regenerated in the same self-heal pass. The 0.2.1 prereleases are subdivided further — the guard landed in 0.2.1-rc.2, so rc.0 / rc.1 keep the inline shape.
73
74
 
74
75
  Two cross-version behavior alignments happen the same automatic way, with no user action:
75
76
 
@@ -117,7 +118,7 @@ dsh plugin --profile <name> update dsh-paoding
117
118
 
118
119
  (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.
119
120
 
120
- Manual equivalent: run the `dsh plugin update` command above yourself (for the desktop profile, which the dsh CLI guards: `cd ~/.dsh/profiles/desktop && pnpm add dsh-paoding@latest`), restart, done.
121
+ Manual equivalent: run the `dsh plugin update` command above yourself (for the desktop profile, which the dsh CLI guards: `cd ~/.dsh/profiles/desktop && pnpm add dsh-paoding@latest`, or `corepack pnpm add` on machines without a bare `pnpm` — see the troubleshooting section), restart, done.
121
122
 
122
123
  A **dev link: checkout** (see §4) still gets version checks (the update card appears when a newer version exists) but cannot be upgraded in place — the upgrader requires the package to really live under a profile's node_modules, which a link straight into the repo never matches. Hitting Upgrade reports exactly that and suggests running `dsh plugin add dsh-paoding@latest` to switch back to the registry version.
123
124
 
@@ -190,7 +191,7 @@ If you'd rather not hand-edit `dsh-paoding.config.yml`, open the **庖丁配置
190
191
 
191
192
  ### Data interface and security
192
193
 
193
- Panel data goes over the **same-origin `/api/paoding/*`**: the Node side registers prefix routes — `GET /api/paoding/state` (cached detection state), `GET /api/paoding/version` (latest-version check, the data source of the version/update card), `GET /api/paoding/models` (model list from the host LLM runtime), `GET` + `POST /api/paoding/workspaces` (list / add workspaces), `POST /api/paoding/rescan` (forced re-detection, MCP handshakes included), `POST /api/paoding/preview` (generate without writing), `POST /api/paoding/apply` (install and save config), `POST /api/paoding/upgrade` (in-place upgrade: `dsh plugin update` for regular profiles, a direct `pnpm add` for the desktop profile), `GET /api/paoding/client.css` (statically served panel stylesheet) — reusing the detection/generation pipeline in `tools/` (`plugins/paoding-config-ui/api-core.mjs`). The routes carry a **browser trust fence**: the Host must be loopback or listed in `webRuntime.trustedHosts`, and cross-site requests are rejected (mirroring DSH's `/api` gateway fence semantics, since the longer `/api/paoding` prefix would otherwise hit this plugin and bypass the gateway). The panel has **no separate server or port**: the DSH Web port listens on `127.0.0.1` only and is never exposed to the outside.
194
+ Panel data goes over the **same-origin `/api/paoding/*`**: the Node side registers prefix routes — `GET /api/paoding/state` (cached detection state), `GET /api/paoding/version` (latest-version check, the data source of the version/update card), `GET /api/paoding/models` (model list from the host LLM runtime), `GET` + `POST /api/paoding/workspaces` (list / add workspaces), `POST /api/paoding/rescan` (forced re-detection, MCP handshakes included), `POST /api/paoding/preview` (generate without writing), `POST /api/paoding/apply` (install and save config), `POST /api/paoding/upgrade` (in-place upgrade: `dsh plugin update` for regular profiles, a direct `pnpm add` for the desktop profile — pnpm is resolved through a candidate chain: bare `pnpm` → `corepack pnpm` → PNPM_HOME locations), `GET /api/paoding/config/export` (raw config file for download/backup), `POST /api/paoding/config/import` (whole-file import: validated first, shares the apply write mutex), `GET /api/paoding/client.css` (statically served panel stylesheet) — reusing the detection/generation pipeline in `tools/` (`plugins/paoding-config-ui/api-core.mjs`). The routes carry a **browser trust fence**: the Host must be loopback or listed in `webRuntime.trustedHosts`, and cross-site requests are rejected (mirroring DSH's `/api` gateway fence semantics, since the longer `/api/paoding` prefix would otherwise hit this plugin and bypass the gateway). The panel has **no separate server or port**: the DSH Web port listens on `127.0.0.1` only and is never exposed to the outside.
194
195
 
195
196
  ### Panel capabilities
196
197
 
@@ -199,6 +200,9 @@ Panel data goes over the **same-origin `/api/paoding/*`**: the Node side registe
199
200
  - **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).
200
201
  - **Preview**: generates `agent.cordis.yml` without writing, showing each role's intent → kept counts plus the full generated text.
201
202
  - **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.
203
+ - **Scenario templates**: three one-click presets in the header (Lite: implement role only; Research: search roles only; Full: everyone on deck with the main agent carrying the whole detected inventory) swap the roster — they only touch `roles_remove` and `main_agent_extra`; each role's hand-tuned tools, persona, model, and start mode stay untouched and restore as-is when you switch back.
204
+ - **Health-check card**: every Preview / Save & Apply runs a check pass (tools configured but not mounted, zero-tool roles, unknown model names, a preset lagging behind the config); findings show as a severity-tagged card under the header so you can fix them before saving.
205
+ - **"More" menu**: config export (download the raw `dsh-paoding.config.yml`) / import (validated first; overwrites the whole file, workspaces included, with confirmation) and the panel language toggle (English/Chinese auto-detected, manual choice wins and is remembered).
202
206
 
203
207
  ## 7. Uninstalling
204
208
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dsh-paoding",
3
- "version": "0.4.2",
3
+ "version": "0.4.4",
4
4
  "description": "庖丁 — DSH (DeepSeek Harness) 编排模式安装器:host 感知的角色工具过滤 + Web 设置页可视化配置器",
5
5
  "type": "module",
6
6
  "license": "MIT",