dsh-plugin-dev-kb 1.5.1 → 1.5.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/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # Changelog
2
2
 
3
+ ## [1.5.2] - 2026-10-21
4
+
5
+ - `dsh-dev-sandbox` 技能去掉固定 `dev` profile 约定:**沙箱 profile 名由 agent 按任务自定**
6
+ (建议 `sb-<插件名>`),建前检查不与现有 profile(尤其主力)重名,端口同样自选空闲高位端口;
7
+ 新增沙箱「用完即删、不留残留」的收尾说明。
8
+
3
9
  ## [1.5.1] - 2026-10-21
4
10
 
5
11
  - **知识库同步上游 master `687f282e`(2026-10-17)**:
package/README.md CHANGED
@@ -17,8 +17,8 @@
17
17
  **写 dsh 插件时的随身辅助**:① 把 DeepSeek Harness 官方文档站点
18
18
  <https://deepseek-harness.github.io/deepseek-harness/> 的全部内容整理为 dsh 原生可用的形态——
19
19
  装了这个插件,agent 写插件时自动加载知识库,按任务场景定位文档,不用再翻网页;
20
- ② 附带 `dsh-dev-sandbox` 技能:独立 dev profile 开发沙箱工作流,开发中的插件隔离运行,
21
- agent 自主启动 / 重启 / 冒烟验证,插件崩了不影响主力 dsh。
20
+ ② 附带 `dsh-dev-sandbox` 技能:自建独立沙箱 profile 开发沙箱工作流(沙箱名由 agent 按任务自定),
21
+ 开发中的插件隔离运行,agent 自主启动 / 重启 / 冒烟验证,插件崩了不影响主力 dsh。
22
22
 
23
23
  ## 这是什么
24
24
 
@@ -27,8 +27,8 @@ agent 自主启动 / 重启 / 冒烟验证,插件崩了不影响主力 dsh。
27
27
  - **补充文档**:仓库 `docs/` 中未发布到站点的 439 篇开发参考(术语表、防御模式、模块图、测试策略、事故复盘、i18n 规范、升级指南、持久化变更等)。
28
28
  - **agent 友好**:`skills/dsh-plugin-dev-kb.md` 技能让 dsh 在插件开发任务中自动加载,获知知识库位置、
29
29
  主题导航与检索策略;`kb/meta/topics.md` 按任务场景映射要读的文件;`kb/meta/search-index.json` 提供全量检索。
30
- - **开发沙箱**:`skills/dsh-dev-sandbox.md` 技能提供独立 dev profile(`~/.dsh/profiles/dev`,可自定义)
31
- 沙箱工作流——初始化(兼容闸门 / link: 挂载)、后台启动(独立端口)、自主重启、headless 冒烟验证,
30
+ - **开发沙箱**:`skills/dsh-dev-sandbox.md` 技能提供自建独立沙箱 profile 工作流(沙箱名 agent 按任务
31
+ 自定,不与主力 profile 重名)——初始化(兼容闸门 / link: 挂载)、后台启动(自选空闲端口)、自主重启、headless 冒烟验证,
32
32
  全程 agent 闭环,不要求用户重启。
33
33
 
34
34
  ## 功能
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "dsh-plugin-dev-kb",
3
- "description": "dsh 插件辅助:① dsh-plugin-dev-kb 技能 = DeepSeek Harness 官方文档站完整 Markdown 镜像(中英双语 188 页)+ 182 篇仓库补充开发参考 + 主题导航与 373 文件全量搜索索引;② dsh-dev-sandbox 技能 = 独立 dev profile 开发沙箱工作流,开发中的插件隔离运行,agent 自主启动/重启/冒烟验证,插件崩了不影响主力 dsh。零运行时依赖。",
4
- "version": "1.5.1",
3
+ "description": "dsh 插件辅助:① dsh-plugin-dev-kb 技能 = DeepSeek Harness 官方文档站完整 Markdown 镜像(中英双语 192 页)+ 439 篇仓库补充开发参考 + 主题导航与 634 文件全量搜索索引;② dsh-dev-sandbox 技能 = 自建独立沙箱 profile 开发沙箱工作流(沙箱名由 agent 按任务自定),开发中的插件隔离运行,agent 自主启动/重启/冒烟验证,插件崩了不影响主力 dsh。零运行时依赖。",
4
+ "version": "1.5.2",
5
5
  "type": "module",
6
6
  "main": "lib/index.js",
7
7
  "exports": {
@@ -1,24 +1,25 @@
1
1
  ---
2
2
  name: dsh-dev-sandbox
3
- description: dsh 插件开发沙箱:用独立 dev profile 隔离开发中的插件,插件崩了只崩沙箱、绝不影响主力 dsh。所有启动 / 重启 / 看日志 / 冒烟验证都由 agent 自己完成,不要求用户重启。开发或调试 dsh 插件、需要验证插件能否加载、插件改完要重启验证时加载本技能。
3
+ description: dsh 插件开发沙箱:agent 自建独立沙箱 profile 隔离开发中的插件,插件崩了只崩沙箱、绝不影响主力 dsh。所有启动 / 重启 / 看日志 / 冒烟验证都由 agent 自己完成,不要求用户重启。开发或调试 dsh 插件、需要验证插件能否加载、插件改完要重启验证时加载本技能。
4
4
  whenToUse: 开发/调试 dsh 插件需要启动、重启、验证插件加载,或插件疑似把 dsh 搞挂时
5
5
  ---
6
6
  # dsh 插件开发沙箱(dsh-dev-sandbox)
7
7
 
8
8
  核心原则:**开发中的插件永远装在独立沙箱 profile 里,不进主力 profile**。
9
- 插件写崩 → 只有沙箱起不来,主力 dsh(desktop)照常运行,agent 还活着就能自己看日志、改代码、重启沙箱、再验证——闭环不需要用户参与。
9
+ 插件写崩 → 只有沙箱起不来,主力 dsh 照常运行,agent 还活着就能自己看日志、改代码、重启沙箱、再验证——闭环不需要用户参与。
10
10
 
11
- ## 1. profile 约定
11
+ ## 1. 沙箱 profile:名字由 agent 自定
12
12
 
13
- - **默认沙箱 profile 名:`dev`**,目录 `%USERPROFILE%\.dsh\profiles\dev`(与 `desktop` / `web` 平级)。
14
- - **用户指定了别的名字就用用户的**(如「用 test 沙箱」→ `profiles\test`),下文的 `dev` 全部替换。
13
+ - **不要使用固定名字**。每次建沙箱时按任务起一个可辨识的名字,如 `sb-<插件名或简称>`(`sb-image-tools`、`sb-table-zoom`),目录为 `$DSH_HOME/profiles/<名字>/`(Windows 默认 `%USERPROFILE%\.dsh\profiles\<名字>\`)。
14
+ - 建之前先列 `~/.dsh/profiles/`:**不得与现有 profile 重名**(尤其 `web` / `desktop` 这类主力 profile,绝不复用、绝不写入);重名就换一个名字。
15
+ - 一次性验证可用完即删(删 profile 目录即可,沙箱与主力完全隔离);跨天持续开发的插件保留同名沙箱复用。
15
16
  - 沙箱与主力 profile 完全隔离:插件、patch、会话、设置各一份;provider/模型配置可从主力 profile 的 `cordis.patch.yml` 拷贝 provider 段过来(用编辑工具,UTF-8 无 BOM,勿用 PowerShell 重定向写)。
16
17
 
17
18
  ## 2. 沙箱不存在时:初始化(一次)
18
19
 
19
20
  ```powershell
20
21
  # 版本与目标 dsh 对齐:先用主力安装的实际版本号替换下面的 <ver>(插件自身 peerDependencies 也要覆盖它)
21
- npx -y "@deepseek-ai/dsh@<ver>" plugin --profile dev add file:/绝对路径/插件目录
22
+ npx -y "@deepseek-ai/dsh@<ver>" plugin --profile <沙箱名> add file:/绝对路径/插件目录
22
23
  ```
23
24
 
24
25
  - `add` 走兼容闸门:peerDependencies 不覆盖当前 dsh 版本会整体拒绝并回滚——这不是网络问题,改 peer 或按提示 `allow-version` 豁免。
@@ -29,30 +30,32 @@ npx -y "@deepseek-ai/dsh@<ver>" plugin --profile dev add file:/绝对路径/插
29
30
 
30
31
  ```powershell
31
32
  # 后台启动(run_in_background),端口避开主力;日志里找 token 行与报错
32
- npx -y "@deepseek-ai/dsh@<ver>" web --profile dev --port 3081
33
+ npx -y "@deepseek-ai/dsh@<ver>" web --profile <沙箱名> --port <空闲端口>
33
34
  ```
34
35
 
35
- - 启动日志含 `dsh web: http://127.0.0.1:3081/?token=…`(token 每次启动轮换,用它开 GUI 验证 UI 类插件)。
36
+ - 端口自选一个空闲高位端口(如 3081 起,被占就换下一个);记住本次用的端口,后续重启/探活都用它。
37
+ - 启动日志含 `dsh web: http://127.0.0.1:<port>/?token=…`(token 每次启动轮换,用它开 GUI 验证 UI 类插件)。
36
38
  - **逐条看 stderr 的 `dsh: skipping profile bundle "X"`**——被跳过 = 插件静默失效(不崩但功能没了),立即修,别当没看见。
37
39
  - **自主重启循环**(改代码 / 改配置后):
38
- 1. 找进程:`Get-NetTCPConnection -LocalPort 3081 -State Listen | Select OwningProcess`;
40
+ 1. 找进程:`Get-NetTCPConnection -LocalPort <port> -State Listen | Select OwningProcess`;
39
41
  2. 核对 PID 后 `Stop-Process -Id <pid> -Force`;
40
42
  3. 重新后台启动,读日志验证(无 skipping 警告、无崩溃栈、端口起来)。
41
- - **红线:沙箱操作只允许碰沙箱端口/profile;绝不 Stop 主力 dsh 进程、绝不改 `profiles\desktop` 下的东西。**
43
+ - **红线:沙箱操作只允许碰沙箱端口/profile;绝不 Stop 主力 dsh 进程、绝不改主力 profile 下的东西。**
42
44
 
43
45
  ## 4. 冒烟验证(不起 GUI)
44
46
 
45
47
  一次性 headless 跑同 profile,验证插件能加载、工具能注册:
46
48
 
47
49
  ```powershell
48
- npx -y "@deepseek-ai/dsh@<ver>" --profile dev "列出你当前可用的工具,并调用 <插件工具名> 做一次最小调用"
50
+ npx -y "@deepseek-ai/dsh@<ver>" --profile <沙箱名> "列出你当前可用的工具,并调用 <插件工具名> 做一次最小调用"
49
51
  ```
50
52
 
51
53
  启动即崩(exit 非 0 / 打印异常栈)= 插件破坏了 profile 启动,直接读栈修代码,主 dsh 无恙。
52
54
 
53
- ## 5. 收尾:进主力 profile
55
+ ## 5. 收尾
54
56
 
55
- 插件在沙箱里稳定后,才走正常流程挪进主力 profile:同步版本与 peerDependencies → 改主力 profile → `pnpm install` → 自检 → 由用户重启主力 dsh(主力重启永远由用户决定)。发布流程遵循该插件仓库自己的发布规范/CI。
57
+ - 插件在沙箱里稳定后,才走正常流程挪进主力 profile:同步版本与 peerDependencies → 改主力 profile → `pnpm install` → 自检 → 由用户重启主力 dsh(主力重启永远由用户决定)。发布流程遵循该插件仓库自己的发布规范/CI。
58
+ - 沙箱功成身退:删除对应 profile 目录即完全清理,不留残留。
56
59
 
57
60
  ## 6. 常见坑速查
58
61