dsh-plugin-tool-management 0.5.1 → 0.6.0

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.
Files changed (43) hide show
  1. package/README.md +300 -238
  2. package/README_EN.md +300 -304
  3. package/cordis.patch.yml +9 -55
  4. package/docs/Changelog.md +108 -481
  5. package/docs/images/1/345/234/272/346/231/257.png +0 -0
  6. package/docs/images/1/345/234/272/346/231/257_en.png +0 -0
  7. package/docs/images/2MCP.png +0 -0
  8. package/docs/images/2MCP_en.png +0 -0
  9. package/docs/images/3/346/212/200/350/203/275.png +0 -0
  10. package/docs/images/3/346/212/200/350/203/275_en.png +0 -0
  11. package/docs/images/4/345/255/220/346/231/272/350/203/275/344/275/223.png +0 -0
  12. package/docs/images/4/345/255/220/346/231/272/350/203/275/344/275/223_en.png +0 -0
  13. package/docs/images/5/346/217/220/347/244/272/350/257/215.png +0 -0
  14. package/docs/images/5/346/217/220/347/244/272/350/257/215_en.png +0 -0
  15. package/docs/images/6/350/256/260/345/277/206.png +0 -0
  16. package/docs/images/6/350/256/260/345/277/206_en.png +0 -0
  17. package/docs/images/7/344/274/232/350/257/235.png +0 -0
  18. package/docs/images/7/344/274/232/350/257/235_en.png +0 -0
  19. package/docs/images/8/345/205/274/345/256/271.png +0 -0
  20. package/docs/images/8/345/205/274/345/256/271_en.png +0 -0
  21. package/docs/update.md +54 -0
  22. package/lib/agents-md/preset-id.js +49 -0
  23. package/lib/agents-md/service.js +138 -56
  24. package/lib/client.js +4142 -3560
  25. package/lib/compat/probe.js +665 -0
  26. package/lib/history/bridge.js +293 -0
  27. package/lib/history/workspace.js +498 -52
  28. package/lib/http-fence.js +73 -0
  29. package/lib/index.js +511 -126
  30. package/lib/rules/provider.js +3 -3
  31. package/lib/rules/service.js +264 -30
  32. package/lib/scene-prompt-sync.js +112 -0
  33. package/lib/skills/core.js +112 -35
  34. package/lib/skills/service.js +6 -1
  35. package/package.json +5 -3
  36. package/screenshots.json +8 -7
  37. package/docs/images/MCP.png +0 -0
  38. package/docs/images//344/274/232/350/257/235.png +0 -0
  39. package/docs/images//345/234/272/346/231/257.png +0 -0
  40. package/docs/images//345/255/220/346/231/272/350/203/275/344/275/223.png +0 -0
  41. package/docs/images//346/212/200/350/203/275.png +0 -0
  42. package/docs/images//346/217/220/347/244/272/350/257/215.png +0 -0
  43. package/docs/images//350/256/260/345/277/206.png +0 -0
package/cordis.patch.yml CHANGED
@@ -1,60 +1,14 @@
1
- # Bundle patch layer for the official CLI install:
1
+ # Install only this plugin. History composes the already active host services.
2
+ # Do NOT disable workspace/session-projection-cache, insert competing service
3
+ # providers, or infer capabilities from another package's name.
4
+ # Existing explicit user-layer overrides remain the user's responsibility.
2
5
  #
3
- # dsh plugin --profile web add dsh-plugin-tool-management@latest
6
+ # Double-mount guard: inspect raw options only. Entry.disabled is a computed
7
+ # getter and reading it from another disabled expression can recurse at boot.
4
8
  #
5
- # `dsh plugin add` reconciles `dsh.profile.bundles` against installed packages
6
- # and, seeing the `dsh.bundle.patch` declaration in package.json, appends
7
- # `dsh-plugin-tool-management` to the bundle stack. The profile boot then merges
8
- # THIS patch (a single `insert` of the plugin row). No profile file edits
9
- # needed — one command installs and mounts.
10
- #
11
- # Double-mount guard: an aggregate bundle (or a hand-written loader row) may
12
- # already mount this plugin under a different entry id. Two mounts both register the
13
- # /dsh-plugin-tool-management/api route and fail the whole plugin tree at boot
14
- # ("duplicate prefix route"). The `!!js` disabled expression backs THIS row
15
- # off when another *enabled* entry already mounts the plugin; the existing
16
- # instance then owns the API. The loader evaluates the expression at entry
17
- # activation — the full entry tree is composed by then, so user-layer
18
- # (profile cordis.patch.yml) rows are visible too.
19
- #
20
- # ORDER MATTERS — do not move `!e.disabled` ahead of the id/name checks.
21
- # `Entry.disabled` is an uncached getter that re-evaluates the expression,
22
- # so touching `e.disabled` of THIS entry re-enters this very expression
23
- # (infinite recursion → "Maximum call stack size exceeded" at boot). The
24
- # `id !==` check short-circuits on our own row and the `name` check
25
- # short-circuits on every unrelated entry (e.g. dsh-better-sidebar's own
26
- # guard), so `!e.disabled` is only ever read on a genuinely matching
27
- # legacy/aggregate row (a plain boolean, no re-entry).
28
- # 折叠 dsh-archive-manager:替换官方 workspace 与 session-projection-cache
29
- # 服务为归档感知子类(永久删除 + unarchive + 批量 + archivedAt 保留期账本)。
30
- # 官方 ui-workspace 保持启用;归档菜单仍由官方 UI 提供,删除/恢复/保留期
31
- # 由本插件的 TOOLS → History 页面经 HTTP API 驱动。
32
- #
33
- # 冲突告警:不要同时安装独立的 @michengai/dsh-archive-manager——两个补丁都
34
- # 禁用官方 workspace 行并插入替换,会导致重复服务注册、启动失败。
35
- #
36
- # spawn provider(子智能体)挂载:本文件**故意不**插入
37
- # `@deepseek-ai/dsh-subagent-spawn-in-process` 行。取舍理由:
38
- # 1) insert 行在启动期解析:换台没有该包的宿主会因单行加载失败拖垮整棵插件树,
39
- # 而缺 provider 时受影响面只有一个 subagent_run 调用;
40
- # 2) 该行与本插件运行时的 ctx.plugin 兜底挂载存在双挂载窗口(同名 provider 重复注册)。
41
- # 改由 src/subagents/service.ts 走官方通道:ctx.subagents.list() 探测到 spawn 即跳过;
42
- # 缺失才经 createRequire + apply(ctx, {providerName:'spawn'}) 挂载;失败把原因原样抛给模型。
43
- # 该包在 package.json 声明为**可选** peerDependency(peerDependenciesMeta.optional)——
44
- # 宿主/profile 自带时可以照常挂载。设计 §3.2 字面要求「挂载声明进 cordis.patch.yml」,
45
- # 这里按上述风险裁定为有意偏离(记录见 docs/审查/2026-09-13-场景档案v2双轴评审.md)。
46
- - id: workspace
47
- disabled: true
48
- - id: session-projection-cache
49
- disabled: true
9
+ # The optional subagent spawn provider is resolved at runtime by the subagent
10
+ # service; an unavailable optional package must not prevent the host from booting.
50
11
  - insert:
51
12
  - id: dsh-plugin-tool-management
52
13
  name: 'dsh-plugin-tool-management'
53
- disabled: !!js "[...ctx.loader.entries()].some((e) => e.options.id !== 'dsh-plugin-tool-management' && e.options.name === 'dsh-plugin-tool-management' && !e.disabled)"
54
- - id: workspace-tool-management-history
55
- name: 'dsh-plugin-tool-management/workspace'
56
- - id: session-projection-cache-tool-management-history
57
- name: 'dsh-plugin-tool-management/projcache'
58
- config:
59
- writeEveryEvents: 200
60
- writeIntervalMs: 5000
14
+ disabled: !!js "[...ctx.loader.entries()].some((e) => e.options.id !== 'dsh-plugin-tool-management' && e.options.name === 'dsh-plugin-tool-management' && e.options.disabled !== true && typeof e.options.disabled !== 'object')"