@wenaixi/dsh-superpower 7.5.8 → 7.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.
@@ -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.