@wenaixi/dsh-superpower 7.5.8 → 7.7.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.
@@ -89,6 +89,7 @@ class SuperpowersProvider {
89
89
  control;
90
90
  currentSwitches;
91
91
  hostLanguageCache;
92
+ hostLanguageResolved = false;
92
93
  constructor(ctx, control, config) {
93
94
  assertNotRuntimeProvider(config.providerName);
94
95
  this.ctx = ctx;
@@ -105,12 +106,13 @@ class SuperpowersProvider {
105
106
  * 由调用方回退到 zh。结果缓存,locale preference 变更经 loader/volatile-update 清空。
106
107
  */
107
108
  hostLanguage() {
108
- if (this.hostLanguageCache !== undefined)
109
+ if (this.hostLanguageResolved)
109
110
  return this.hostLanguageCache;
110
111
  let locale;
111
112
  try {
112
- const forms = (this.ctx.get('settings')?.describe() ?? []);
113
- const entry = forms.find((d) => d.ns === 'locale');
113
+ const described = this.ctx.get('settings')?.describe();
114
+ const forms = (Array.isArray(described) ? described : described?.namespaces ?? []);
115
+ const entry = forms.find((d) => d !== null && typeof d === 'object' && d.ns === 'locale');
114
116
  const preference = entry?.value?.preference;
115
117
  locale = preference === 'en' ? 'en' : preference === 'zh' ? 'zh' : undefined;
116
118
  }
@@ -119,6 +121,7 @@ class SuperpowersProvider {
119
121
  }
120
122
  // ponytail: 结果缓存 + volatile-update 失效;describe 每次全量扫描,缓存避免每轮 list 重扫
121
123
  this.hostLanguageCache = locale;
124
+ this.hostLanguageResolved = true;
122
125
  return locale;
123
126
  }
124
127
  /**
@@ -129,6 +132,7 @@ class SuperpowersProvider {
129
132
  this.control.invalidate();
130
133
  this.catalog.invalidate();
131
134
  this.hostLanguageCache = undefined;
135
+ this.hostLanguageResolved = false;
132
136
  }
133
137
  async list(options) {
134
138
  const switches = this.currentSwitches();
@@ -140,14 +144,15 @@ class SuperpowersProvider {
140
144
  return candidates.map((candidate) => applySwitches(candidate, switches));
141
145
  }
142
146
  async get(candidate, options) {
147
+ const switches = this.currentSwitches();
143
148
  const definition = await this.catalog.getDefinition(candidate, this.name, {
144
149
  signal: options.signal,
145
150
  logger: this.ctx.logger,
146
- language: this.currentSwitches().language ?? this.hostLanguage(),
151
+ language: switches.language ?? this.hostLanguage(),
147
152
  });
148
153
  // 加载路径同样套用:skill 工具在 get 之后二次校验 isModelInvocable,
149
154
  // 只改 list 的候选会让模型目录消失但工具调用仍成功,语义撕裂。
150
- return definition === undefined ? undefined : applySwitches(definition, this.currentSwitches());
155
+ return definition === undefined ? undefined : applySwitches(definition, switches);
151
156
  }
152
157
  }
153
158
  // ---------------------------------------------------------------------------
@@ -174,8 +179,17 @@ export function apply(ctx, config) {
174
179
  ctx.logger.debug('[superpowers] skill switches updated, invalidating catalog');
175
180
  activeProvider?.invalidate();
176
181
  });
182
+ // 宿主语言变更的收敛点:locale.preference 属另一个 profile 条目,它的 loader/volatile-update
183
+ // 只在那条插件自己的 fiber 上广播,本插件收不到。宿主每次应用补丁后广播
184
+ // app-boot/config-reload,在此让技能目录失效并清空 hostLanguageCache:
185
+ // 未配置语言的用户切换宿主语言后,模型侧目录与斜杠菜单才跟着换语言。
186
+ const disposeReload = ctx.on('app-boot/config-reload', () => {
187
+ ctx.logger.debug('[superpowers] host config reloaded, invalidating catalog (host language may have changed)');
188
+ activeProvider?.invalidate();
189
+ });
177
190
  return () => {
178
191
  // 逆序释放:先摘监听,再注销 provider,最后清理自身快照
192
+ disposeReload();
179
193
  disposeVolatile();
180
194
  disposeListener();
181
195
  disposeProvider();
@@ -1 +1 @@
1
- {"version":3,"file":"superpowers.js","sourceRoot":"","sources":["../src/superpowers.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AAC5C,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAA;AASxC,OAAO,MAAM,MAAM,0BAA0B,CAAA;AAC7C,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAA;AAC3C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CAAA"}
1
+ {"version":3,"file":"switches.d.ts","sourceRoot":"","sources":["../src/switches.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,wBAAwB,CAAA;AAEnE,uCAAuC;AACvC,MAAM,WAAW,aAAa;IAC5B,2DAA2D;IAC3D,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;IACjC,sDAAsD;IACtD,QAAQ,EAAE,IAAI,GAAG,IAAI,GAAG,SAAS,CAAA;CAClC;AA8BD,wBAAgB,YAAY,CAAC,MAAM,EAAE,OAAO,GAAG,aAAa,CAS3D;AAED;;;;;;GAMG;AACH,wBAAgB,aAAa,CAAC,CAAC,SAAS;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,UAAU,EAAE,qBAAqB,CAAA;CAAE,EACzF,KAAK,EAAE,CAAC,EACR,QAAQ,EAAE,aAAa,GACtB,CAAC,CAMH;AAcD;;GAEG;AACH,eAAO,MAAM,aAAa;IACxB;;;;OAIG;gBACe,OAAO,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,EAAE,EAAE,OAAO,CAAC;QAAC,KAAK,CAAC,EAAE,MAAM,CAAA;KAAE,EAAE,CAAC;CA4E3E,CAAA"}
package/lib/switches.js CHANGED
@@ -75,9 +75,7 @@ export function applySwitches(entry, switches) {
75
75
  * @returns 普通对象字典;非对象或缺省时为空字典
76
76
  */
77
77
  function unwrapDictionary(value) {
78
- const unwrapped = typeof value?.get === 'function'
79
- ? value.get()
80
- : value;
78
+ const unwrapped = unwrapValue(value);
81
79
  if (typeof unwrapped !== 'object' || unwrapped === null || Array.isArray(unwrapped))
82
80
  return {};
83
81
  return { ...unwrapped };
@@ -1 +1 @@
1
- {"version":3,"file":"switches.js","sourceRoot":"","sources":["../src/switches.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAiBH;;;;;;;;;GAS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,CAAC,CAAC,IAAI,EAAE,CAAA;YAC7C,IAAI,IAAI,CAAC,MAAM,KAAK,CAAC,IAAI,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,KAAK,OAAO,EAAE,CAAC;gBACpD,MAAM,IAAI,KAAK,CAAC,aAAa,GAAG,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAA;YACjD,CAAC;QACH,CAAC,CAAC,CAAA;QAEF,OAAO,OAAO,CAAA;IAChB,CAAC;CACF,CAAA"}
package/locale/en.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "meta": {
3
3
  "title": "Superpowers Skill Suite",
4
- "description": "DSH port of 15 engineering-discipline skills: brainstorming, planning, TDD, systematic debugging, verification before completion."
4
+ "description": "DeepSeek Harness plugin: 15 obra/superpowers engineering skills, bilingual descriptions, per-skill toggles"
5
5
  }
6
6
  }
package/locale/zh.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "meta": {
3
3
  "title": "Superpowers 技能套件",
4
- "description": "15 个工程纪律技能的 DSH 移植版:头脑风暴、写计划、测试驱动、系统化调试、完成前验证。"
4
+ "description": "DeepSeek Harness 插件:15 个 obra/superpowers 工程纪律技能,技能描述中英双语自由切换,每一个技能本身自由开关"
5
5
  }
6
6
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@wenaixi/dsh-superpower",
3
- "version": "7.5.8",
4
- "description": "obra/superpowers 的 DSH 移植版:15 个工程纪律技能(中英双语正文)注入 ctx.skills,含技能开关与语言切换面板",
3
+ "version": "7.7.0",
4
+ "description": "DeepSeek Harness plugin: 15 obra/superpowers engineering skills, bilingual descriptions, per-skill toggles | DeepSeek Harness 插件:15 个 obra/superpowers 工程纪律技能,技能描述中英双语自由切换,每一个技能本身自由开关",
5
5
  "type": "module",
6
6
  "main": "lib/superpowers.js",
7
7
  "types": "lib/superpowers.d.ts",
@@ -12,6 +12,7 @@
12
12
  "icon.png",
13
13
  "cordis.patch.yml",
14
14
  "README.md",
15
+ "README.zh.md",
15
16
  "LICENSE"
16
17
  ],
17
18
  "publishConfig": {
@@ -20,10 +21,11 @@
20
21
  "scripts": {
21
22
  "build": "tsc -p tsconfig.build.json && node scripts/build-client.mjs",
22
23
  "typecheck": "tsc --noEmit",
24
+ "test": "node --test scripts/*.test.mjs",
23
25
  "lint": "eslint src --ext .ts 2>&1 || echo \"(no eslint config — skipped)\"",
24
26
  "prepare": "npm run build",
25
27
  "prepack": "npm run build",
26
- "verify": "node scripts/verify.mjs && node scripts/check-skill-switches.mjs"
28
+ "verify": "pnpm test && node scripts/verify.mjs && node scripts/check-skill-switches.mjs"
27
29
  },
28
30
  "dsh": {
29
31
  "bundle": {
@@ -64,7 +64,7 @@ Toggles take effect immediately; the current turn is unaffected, and the next tu
64
64
 
65
65
  This bundle is designed natively for **DSH (DeepSeek Harness)** and supports only the DSH platform:
66
66
 
67
- - DSH tool mapping: `references/dsh-tools.md` — every skill in this bundle assumes DSH tools (Bash -> pwsh/bash, Read/Write/Edit -> fs, Glob/Grep -> fs-search, Task/Subagent -> subagent/workflow, TodoWrite -> todo, AskUserQuestion -> ask-user, Skill -> skill).
67
+ - DSH tool mapping: `references/dsh-tools.md` — every skill in this bundle assumes DSH tools (Bash -> pwsh, Read/Write/Edit -> fs, Glob/Grep -> fs-search, Task/Subagent -> subagent/subagent_fork, TodoWrite -> todo_write, AskUserQuestion -> ask_user_question, Skill -> skill, WebSearch/WebFetch -> web_search/web_fetch). The `workflow` tool is not part of the default assembly; use `subagent` fan-out or enable the workflow row explicitly.
68
68
  ## User Instructions
69
69
 
70
70
  User instructions (CLAUDE.md, AGENTS.md, GEMINI.md, etc, direct requests) take precedence over skills, which in turn override default behavior. Only skip skill workflows or instructions when your human partner has explicitly told you to.
@@ -1,38 +1,209 @@
1
1
  # DSH Tools Reference for Superpowers
2
2
 
3
- > Model-facing DSH tool quick reference. Native tool equivalents and behavior conventions for Superpowers skills on the DSH platform.
4
- > When a skill directs a specific tool action, execute it with the native DSH tool from this table.
3
+ > Model-facing DSH tool reference, verified against the installed runtime:
4
+ > **DSH 0.2.0-rc.2 (desktop-runtime), cordis 4.0.4, every @deepseek-ai/* package at 0.2.0-rc.2**.
5
+ > Tool *availability* depends on assembly (bundle layers + profile patch); this page lists every registered
6
+ > tool name, its owning package, and the assembly condition that decides whether it appears in a session.
7
+ > The desktop profile anchor below is what a stock DSH desktop session actually exposes.
8
+ > Before trusting any row here against a different DSH version, re-verify it: follow the dsh-plugin-dev skill's
9
+ > source-verification-and-caches.md (layer 1 first: installed package sources, hit-and-stop), and read the
10
+ > owning package's lib/*.js for the exact schema and behavior.
5
11
 
6
12
  ## Core Mapping
7
13
 
14
+ The left column is the generic action name Superpowers skills use; the right column is the DSH tool that implements it.
15
+
8
16
  | Skill action | DSH equivalent | Notes |
9
17
  |---|---|---|
10
- | `Bash` / `bash` | `pwsh` (preferred, Windows-friendly) or `bash` | Long-running commands use `run_in_background: true`; collect with `job_output` / `job_list` |
11
- | `Read` / `Write` / `Edit` | `fs` tool's `read` / `write` / `edit` | No `fs/observed` check needed before `read`; `write`/`edit` trigger `fs/observed` invalidation automatically |
12
- | `Glob` / `Grep` / `Grep -R` | `fs-search` tool's `glob` / `grep` | `glob` finds files, `grep` searches content; use `include` filters on large repos |
13
- | `Task` / `Subagent` | `subagent` / `subagent_fork` / `workflow` | Single-task dispatch uses `subagent`; multi-stage fan-out uses `workflow` (`agent`/`pipeline`/`parallel`) |
14
- | `AskUserQuestion` | `ask-user` | Blocking question, obeying `userQuestions` policy |
15
- | `TodoWrite` | `todo` | Always provide the full list; at least one `in_progress` |
16
- | `Skill` | `skill` | `skill(name)` loads `<skill_content>`, same source as `ctx.skills.get()` |
17
- | `WebSearch` / `WebFetch` | `web` tool | `web_search` + `web_fetch` wrapped into one `web` |
18
- | `/skill <name>` | `skill` tool or the user's explicit `/skill` command | Both paths render the same `<skill_content>` |
19
- | `git worktree` | run `git worktree` directly in `bash` / `pwsh` | DSH has no worktree-specific wrapper; run the plain command |
20
-
21
- ## DSH-Specific Capabilities (no direct original equivalent)
22
-
23
- | DSH capability | When to use |
24
- |---|---|
25
- | `goal` / `ralph` | Creating, resuming, or blocking on long-horizon goals |
26
- | `workflow` scripts | Orchestrating dozens of subagents for audits/migrations/bulk rewrites |
27
- | `jobs` | Querying and terminating managed background jobs |
28
- | `plan-mode` | Read-only planning lock, complementing writing-plans' fine-grained slicing |
29
- | `cordis` dynamic plugins | Extending capabilities mid-session (outside this bundle's scope) |
18
+ | `Bash` / `bash` | `pwsh` | `pwsh` is the shell tool on Windows; `bash` registers only in non-Windows assemblies. Long-running commands use `run_in_background: true` (when the `ctx.jobs` service is assembled) and are collected with `job_output` / `job_list`; a foreground call that outlives `timeoutMs` is promoted to a background job instead of being killed (`promoteOnTimeout`, default true). |
19
+ | `Read` / `Write` / `Edit` | `read` / `write` / `edit` | fs-observation-policy applies: `read` needs no prior check, but `write` and `edit` require the target to have been observed first (read, read_image, write, or edit records an observation). Writing an existing file that was never read fails with `FS_NOT_OBSERVED`; a file that changed since it was read fails with `FS_STALE_VERSION`. Successful writes/edits record the new version automatically. |
20
+ | `Glob` / `Grep` / `Grep -R` | `glob` / `grep` | `glob` finds paths by pattern (hidden and ignored files included), `grep` searches content (ripgrep syntax, up to 250 matches, overflow spilled to a saved file). Use `include` filters on large repos. |
21
+ | `Task` / `Subagent` | `subagent` / `subagent_fork` | Two instances of the same plugin (`dsh-tool-subagent`): `subagent` rides the `spawn` provider, `subagent_fork` rides `fork` (inherits this conversation's completed history). There is no always-on `workflow` tool: `workflow` registers only when a `workflowEngine` service is assembled (see delegated tools below). |
22
+ | `AskUserQuestion` | `ask_user_question` | Blocking by default; a `mode: timed` assembly adds `wait_seconds` (default 120, -1 to wait indefinitely) and a pending/answer duality. Obey the `userQuestions` channel always. |
23
+ | `TodoWrite` | `todo_write` | Whole-list replacement, logged per call. Content must be non-empty and unique; at most one `in_progress` item unless `allowParallelInProgress: true` is assembled. |
24
+ | `Skill` | `skill` | `skill(name)` resolves through `ctx.skills.list/get` — the same catalog the `/skill` user command and the session skill catalog read. A user slash invocation injects the identical `<skill_content>`. |
25
+ | `WebSearch` / `WebFetch` | `web_search` / `web_fetch` | Two independent tools — there is no combined `web` tool. Both execute through the `ctx.web` seam; the search backend is pluggable (deepseek-official by default, modsearch as a provider bounce). |
26
+ | `/skill <name>` | `skill` tool or the user's explicit `/skill` command | Both paths render the same `<skill_content>`; a user invocation also marks the skill's catalog entry as user-invocable. |
27
+ | `git worktree` | run `git worktree` directly in `pwsh` | DSH has no worktree-specific wrapper; run the plain command. |
28
+
29
+ ## Complete Tool Catalog
30
+
31
+ Every model-facing tool registered by the DSH platform packages, with its owning package (all at 0.2.0-rc.2 unless noted),
32
+ its repository path (from `package.json` `repository.directory`), and the assembly condition. The desktop anchor is
33
+ the tool set actually visible in a stock desktop session (PTC presentation; 41 tools).
34
+
35
+ ```text
36
+ run_code @deepseek-ai/dsh-tools (packages/core/tools)
37
+ pwsh / bash @deepseek-ai/dsh-tool-pwsh|dsh-tool-bash (packages/shell/tool-*)
38
+ load_workspace_dependencies @deepseek-ai/dsh-tool-workspace-dependencies (packages/skill/tool-workspace-dependencies)
39
+ read / write / edit / read_image @deepseek-ai/dsh-tool-fs (packages/fs/tool-fs)
40
+ glob / grep @deepseek-ai/dsh-tool-fs-search (packages/fs/tool-fs-search)
41
+ skill @deepseek-ai/dsh-tool-skill (packages/skill/tool-skill)
42
+ subagent / subagent_fork @deepseek-ai/dsh-tool-subagent (packages/subagent/tool-subagent)
43
+ send_message / interrupt_agent (agent_id form) @deepseek-ai/dsh-tool-subagent-control (packages/subagent/tool-subagent-control)
44
+ list_agents @deepseek-ai/dsh-tool-subagent-control/list-agents (same package, sub-entry)
45
+ list_subagent_models @deepseek-ai/dsh-tool-subagent (only with modelSelectionSettings)
46
+ spawn_teammate / wait_agent / team_task_create|get|list|update @deepseek-ai/dsh-experimental-tool-agent-team (packages/experimental/tool-agent-team)
47
+ workflow @deepseek-ai/dsh-tool-workflow (packages/workflow/tool-workflow, conditional)
48
+ ralph @deepseek-ai/dsh-tool-ralph (packages/workflow/tool-ralph, disabled by default)
49
+ job_output / job_list / job_kill @deepseek-ai/dsh-tool-jobs (packages/jobs/tool-jobs)
50
+ create_goal / get_goal / update_goal @deepseek-ai/dsh-tool-goal (packages/goal/tool-goal)
51
+ exit_plan_mode @deepseek-ai/dsh-plan-mode (packages/plan/plan-mode)
52
+ ask_user_question @deepseek-ai/dsh-tool-ask-user (packages/interaction/tool-ask-user)
53
+ todo_write @deepseek-ai/dsh-tool-todo (packages/todo/tool-todo)
54
+ web_search / web_fetch @deepseek-ai/dsh-tool-web (packages/web/tool-web)
55
+ present @deepseek-ai/dsh-tool-present (packages/deliverables/tool-present)
56
+ schedule_create|list|delete|update @deepseek-ai/dsh-schedule (packages/schedule/schedule)
57
+ list_mcp_resources / list_mcp_resource_templates / read_mcp_resource @deepseek-ai/dsh-mcp-resources (packages/mcp/mcp-resources)
58
+ read_page / x_search @liustack/modsearch@5.10.5 (third-party bridge, raw JSON-Schema registration)
59
+ cordis_inspect_list / cordis_inspect_query @deepseek-ai/dsh-tool-cordis (packages/extensions/tool-cordis)
60
+ ```
61
+
62
+ ### Desktop session anchor (verified tool set, PTC presentation)
63
+
64
+ ```text
65
+ ask_user_question create_goal edit exit_plan_mode get_goal glob grep
66
+ interrupt_agent job_kill job_list job_output list_agents
67
+ list_mcp_resource_templates list_mcp_resources load_workspace_dependencies
68
+ present pwsh read read_image read_mcp_resource
69
+ read_page schedule_create schedule_delete schedule_list schedule_update
70
+ send_message skill spawn_teammate subagent subagent_fork
71
+ team_task_create team_task_get team_task_list team_task_update
72
+ todo_write update_goal wait_agent web_fetch web_search write x_search
73
+ ```
74
+
75
+ Notably absent from the desktop anchor: `bash` (non-Windows only), `run_code` (PTC transport — it is the only
76
+ directly callable tool in PTC mode but is never listed in the catalog), `workflow` and `ralph` (see below),
77
+ and `list_subagent_models` (registration also requires the model-selection policy to resolve).
78
+
79
+ ## Behavior Contracts and Mode Details
80
+
81
+ ### fs-observation-policy (read/write/edit)
82
+
83
+ Owned by `@deepseek-ai/dsh-fs-observation-policy` + `@deepseek-ai/dsh-fs-local`. A per-session gate records each
84
+ authoritative presence/absence observation (emit `fs/observed`) and derives write/edit guards from it:
85
+
86
+ - `read` and `read_image`: no prior observation required; both record an observation.
87
+ - `write`: an unseen target or a confirmed-absent target becomes `createIfAbsent` (no prior read needed to create a new file);
88
+ a confirmed-present target becomes `replaceIfVersion` at the observed version — writing an existing file that was never
89
+ read fails with `FS_NOT_OBSERVED` ("cannot overwrite existing ... without reading it first"). A file changed since the
90
+ observation fails with `FS_STALE_VERSION`.
91
+ - `edit`: always requires a prior observation of the target — unseen fails with `FS_NOT_OBSERVED`, confirmed-absent with
92
+ `FS_NOT_FOUND`. The observed version is the CAS basis; drift fails with `FS_STALE_VERSION`.
93
+ - Successful writes/edits emit `fs/observed` with the new version, so subsequent edits stay valid.
94
+
95
+ The tool's guidance text encodes the same rule: "Read an existing file before overwriting it with write" /
96
+ "Read a file before editing it (the default fs-observation-policy requires it)".
97
+
98
+ ### Background execution and jobs
99
+
100
+ - `pwsh`/`bash` (and `subagent`, `workflow`) expose `run_in_background: true` only when the `ctx.jobs` service is
101
+ assembled (base layer: `dsh-jobs-local` + `dsh-tool-jobs`). The parameter then returns a job id immediately.
102
+ - A foreground call whose `timeoutMs` expires is *promoted* to a background job (`promoteOnTimeout`, default true when
103
+ backgrounding is enabled) instead of being killed; the result carries `kind: promoted` + `jobId`.
104
+ - `job_output` reads the output delta since the previous read for stream jobs, or the settled result of a final-output job;
105
+ output beyond the ring retention spills to files named in the result. `job_list` lists the caller's jobs with status;
106
+ `job_kill` terminates one. Completed jobs deliver an in-session notice ("Done; job_output.") — do not busy-poll.
107
+
108
+ ### Delegated tools: two competing families
109
+
110
+ - **Subagent continuable family** (`dsh-tool-subagent-control` + `/list-agents`): `send_message`/`interrupt_agent`
111
+ take `agent_id` (your direct continuable child, or your parent when you are a resident child); `list_agents` lists
112
+ direct descendants with `scope: children|descendants`. One-shot children are omitted (they accept neither continuation
113
+ nor delivery).
114
+ - **Agent Teams family** (`dsh-experimental-tool-agent-team`): `spawn_teammate`, `wait_agent`,
115
+ `team_task_create|get|list|update`, and *re-registered same-name* `send_message`/`list_agents`/`interrupt_agent`
116
+ taking `target` = member name ("lead" included). The agent-team-profile bundle layer *disables* the
117
+ subagent-control rows, so the two families never coexist: one session exposes either the `agent_id` form or the
118
+ `target` form. Desktop (with the experimental agent-team-profile bundle) exposes the target form.
119
+ - `subagent`/`subagent_fork` (the delegation tools themselves) are `dsh-tool-subagent` instances configured with
120
+ `provider: spawn|fork` and distinct `toolName`. `subagent_fork` omits model selection so children inherit the
121
+ parent's route; both support `backgroundMode: continuable`.
122
+
123
+ ### workflow and ralph (conditional)
124
+
125
+ - `workflow` (`dsh-tool-workflow`) injects `workflowEngine`; the engine is provided by `dsh-workflow-ptc`
126
+ (requires the Node TypeScript PTC runtime). When the engine is absent, the tool does not register. Its description
127
+ restricts use to work that actually fans out ("Use the workflow tool ONLY when the user explicitly asks for a workflow
128
+ or for large multi-agent orchestration").
129
+ - `ralph` (`dsh-tool-ralph`) is disabled by default in the base assembly and in the desktop profile; enable it as an
130
+ explicit row before relying on it.
131
+
132
+ ### plan mode and exit_plan_mode
133
+
134
+ - `dsh-plan-mode` provides the `plan` session projection (logged per-agent collaboration state), the `plan:policy`
135
+ prompt section, and the `/plan` command. The tool catalog stays identical across modes (request-cache stability);
136
+ entering/leaving plan mode changes only the prompt section, not the tool set.
137
+ - `exit_plan_mode` stays registered while plan mode is inactive but errors outside it ("only available in plan mode").
138
+ It requires a markdown plan starting with a `#` heading, presents the plan through the user-questions channel as a
139
+ `plan-review` card, and leaves plan mode only on approval. "Keep planning" returns the user's feedback and keeps the
140
+ session in plan mode. Sandbox and approval policy are independent of plan mode and neither read nor write it.
141
+
142
+ ### ask_user_question: blocking vs timed
143
+
144
+ - Default assembly: blocking — the tool pauses until a UI provider returns a human answer; the answer feeds back into the
145
+ agent loop as an ordinary tool result.
146
+ - `mode: timed` assembly: adds `wait_seconds` (default 120, -1 requires an answer before proceeding). On timeout the
147
+ call resolves with `selected: []`, `pending: true`, a pending-notice message, and the questions stay answerable; the
148
+ user's later reply arrives as an `answer_to_pending_question` user message. Pending is not permission to proceed.
149
+
150
+ ### PTC vs native presentation
151
+
152
+ - `run_code` is the PTC-mode presentation transport: a reserved name owned by `dsh-tools` that cannot be registered,
153
+ shadowed, or restricted by plugins. In PTC mode the catalog exposes only `run_code` as a directly callable tool —
154
+ "a tool call naming any other tool fails" — and every other tool is reached from inside the program through the SDK
155
+ bindings (`tools.<name>`). In native mode all tool schemas go into the request directly.
156
+ - `tools.presentAs` switches a scope between native/PTC; `tools.restrict`/`tools.guard` narrow/guard global tools for
157
+ a calling agent scope and are registration-plane abilities (skill/plugin author view), not model-facing tools.
158
+
159
+ ### Skills and the /skill command
160
+
161
+ - The `skill` tool executes through `ctx.skills.list/get` with the caller's cwd/signal/scope. It returns
162
+ `{ name, provider, resourceBase?, content }`, where `content` is the rendered `<skill_content>`.
163
+ - A user slash invocation (message contains the skill name and user-invocable) injects the same rendered content as a
164
+ user message at `agent/pre-step`.
165
+ - The available-skill catalog section in the system prompt is refreshed per step from `ctx.skills.snapshot` filtered by
166
+ model-invocability; when the catalog is empty the guidance instructs the model not to reuse names from earlier catalogs.
167
+
168
+ ### Scheduling, MCP resources, and third-party bridges
169
+
170
+ - `schedule_*` come from `dsh-schedule`, assembled by the `@deepseek-ai/dsh-experimental-schedule-bundle`
171
+ (experimental). Reminders are host-persisted; a due occurrence is delivered as a follow-up in its original session.
172
+ - `list_mcp_resources` / `list_mcp_resource_templates` / `read_mcp_resource` come from `dsh-mcp-resources` and
173
+ register into the consumer's tool scope per MCP server (`resources/list`, `resources/templates/list`,
174
+ `resources/read`).
175
+ - `read_page` and `x_search` are registered by the third-party `@liustack/modsearch` bridge as raw JSON-Schema tool
176
+ definitions (no `output` schema) and are not part of the `@deepseek-ai/*` platform set; their presence depends on
177
+ the modsearch bundle being installed.
178
+
179
+ ### Tool output shape
180
+
181
+ - `defineTool` tools return a validated value against an `output.schema`; `output.render` maps `(args, value)` to the
182
+ human-facing content, and `output.presentationMeta` projects card metadata. The Web GUI derives cards from the call
183
+ record and the rendered content; `presentCall`/`presentResult` (when declared) are optional pure-render descriptors for
184
+ host-local consumers and are never invoked by the scheduler.
185
+
186
+ ## How Assembly Decides the Tool Set
187
+
188
+ Three layers, applied in order — later layers override earlier ones:
189
+
190
+ ```text
191
+ 1. bundle layers: each bundle's package.json "dsh.bundle" patch (e.g. @deepseek-ai/dsh-base/cordis.patch.yml,
192
+ @deepseek-ai/dsh-web-app/cordis.patch.yml + presets/*.patch.yml, experimental bundles)
193
+ 2. session preset: dsh-web-app presets (minimal / standard / ptc) mounted per session
194
+ 3. profile patch: <dshHome>/profiles/<profile>/cordis.patch.yml
195
+ ```
196
+
197
+ - `tool-bash` is disabled on Windows and `tool-pwsh` is disabled off Windows (via `!!js process.platform` guards).
198
+ - The web surface keeps the skill registry, goal service, session driver, subagent registry, and its backends on the
199
+ host plane and lets each session mount a preset for the model-facing tools.
200
+ - Agent-team profile replaces the subagent-control rows by disabling them (see the delegated-tools family note).
30
201
 
31
202
  ## Constraints and Habits
32
203
 
33
204
  - Sandbox defaults to `danger-full-access`, but still annotate file paths in skills as absolute or resolvable relative to `cwd`.
34
205
  - Unix aliases like `ls -la` / `head` are unavailable in PowerShell; use `Get-ChildItem` / `Select-Object -First N`.
35
- - Tool `execute` returns structured JSON; human-facing rendering lives in `output.render` (for skill authors).
206
+ - `pwsh` paths use native Windows form (`C:\...`), read env with `$env:NAME`; managed `DSH_*` variables expose harness facts. A force-killed command settles as `[exit code: 1]` without a signal marker — treat it as an interruption, not a failure.
36
207
  - Every `waterfall` event listener must call `next()`, or downstream short-circuits.
37
208
 
38
209
  ## Minimal Example
@@ -43,5 +214,13 @@ Model: Using brainstorming to clarify requirements
43
214
  -> call skill(name="brainstorming")
44
215
  -> follow the skill's flow to ask questions, classify Spike/Bounded/Architectural
45
216
  -> after design approval, call skill(name="writing-plans") to slice
46
- -> dispatch subagent(prompt="implement task-03...") per slice and track with todo
47
- ```
217
+ -> dispatch subagent(prompt="implement task-03...") per slice and track with todo_write
218
+ ```
219
+
220
+ ## Re-verification Notes (edit this page, not the runtime)
221
+
222
+ - Every row above was read from the installed package sources listed in the catalog (layer 1) at DSH 0.2.0-rc.2.
223
+ - When a DSH upgrade changes a package, re-check that package's `lib/*.js` for the tool name, schema, and assembly
224
+ condition before trusting this page; on conflict, update this page.
225
+ - The desktop anchor is a runtime measurement, not a guarantee: it is the tool set of a stock desktop session with the
226
+ experimental bundles enabled, at the stated version.