dsh-plugin-prompt-tool 0.1.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.
@@ -0,0 +1,280 @@
1
+ # dsh-anchored-standard
2
+
3
+ [中文说明](./README.zh-CN.md)
4
+
5
+ An experimental DeepSeek Harness agent preset that bootstraps the first model
6
+ request with a Minimal-aligned prompt, the Minimal preset's real tool schema
7
+ (`bash` + `str_replace_editor`), and no auto-injected workspace/skill context,
8
+ then exposes the complete Standard tool catalog after the first durable tool
9
+ call or reply.
10
+
11
+ This is a community project. It is not an official DeepSeek preset and is not
12
+ affiliated with or endorsed by DeepSeek.
13
+
14
+ ## Why
15
+
16
+ DeepSeek V4 Pro conditions strongly on the API-visible tool catalog. In the
17
+ Project2 evaluation, Standard and PTC produced scores of 91 and 92, while the
18
+ official Minimal preset produced 99 and 96. Permanently staying on Minimal,
19
+ however, gives up the Standard preset's broader tool set.
20
+
21
+ Anchored Standard separates initial trajectory selection from later tool use:
22
+
23
+ 1. Keep the Minimal complete system prompt.
24
+ 2. Expose the Minimal preset's REAL tool schemas — persistent `bash` +
25
+ `str_replace_editor`, byte-identical to the official Minimal composition —
26
+ on the first model request. Issue #11 measured this exact schema anchoring
27
+ 5/5 runs at the adapter-default maxTokens (256000) with zero `let me`
28
+ first-lines, while every standard-family schema (pwsh/read, pwsh only,
29
+ sandboxed bash/read) fell into standard-like behavior 11/11. The tool
30
+ schema identity is the decisive first-request variable at 256000, so no
31
+ output cap is needed.
32
+ 3. Strip the auto-injected context on that first request as well — the
33
+ AGENTS.md/CLAUDE.md workspace digest and the available-skills reminder that
34
+ true Minimal never mounts (`suppressedContextSources` in the
35
+ `tool-bootstrap` row). User-initiated skill gestures are not filtered, and
36
+ both injections return unchanged from request #2 on.
37
+ 4. After the session records its first durable promotion signal — a `tool/call`
38
+ or the first `assistant/message`, whichever comes first — expose all
39
+ Standard tools. Request #1 always sees the bootstrap catalog; request #2
40
+ always sees the full catalog, so a text-only first reply can no longer trap
41
+ the session in bootstrap. (`promoteOn` in the `tool-bootstrap` row selects
42
+ the trigger: `either` default, `tool-call`, or `assistant-message`.)
43
+ 5. Derive the phase from durable session events so resume and reload preserve it.
44
+
45
+ The bootstrap catalog is the same on every platform: the Minimal pair
46
+ (`bash`/`str_replace_editor`). The preset's shell is the persistent PTY bash
47
+ (the sandboxed Standard `bash` row is disabled — both register the `bash` name
48
+ into the same layer, and the tools registry rejects duplicates; Windows never
49
+ had the sandboxed bash anyway). `pwsh` remains available in the promoted
50
+ catalog on Windows.
51
+
52
+ ## Results
53
+
54
+ Project2 V4.1b, DeepSeek V4 Pro, `reasoningEffort=max`, Windows native:
55
+
56
+ | Run | Ability | Reasoning blocks | `we` | `let's` | `let me` | Visible replies |
57
+ |---|---:|---:|---:|---:|---:|---:|
58
+ | r1 | 98 | 193 | 179 | 88 | 1 | 1 |
59
+ | r2 | 99 | 162 | 165 | 98 | 0 | 1 |
60
+
61
+ Both runs emitted exactly two tool-catalog snapshots: the two-tool Minimal
62
+ bootstrap, followed by the 25-tool Standard catalog. The result is reproducible
63
+ evidence for this task, not a claim of universal improvement across models or
64
+ workloads.
65
+
66
+ Cross-version evidence (issue #11, Windows + official endpoint, first-request
67
+ trajectory only): at the adapter-default maxTokens the Minimal tool schema
68
+ anchored 5/5 (`We need modify…` first lines, `we` 1.4, `let me` 0.0), while
69
+ pwsh/read, pwsh-only, and sandboxed bash/read all produced standard-like
70
+ first lines 11/11 — the tool schema, not the output cap, is the decisive
71
+ first-request variable at 256000.
72
+
73
+ Full methodology and aggregate evidence are in
74
+ [`xiaobright/modeltest`](https://github.com/xiaobright/modeltest).
75
+
76
+ ## Compatibility
77
+
78
+ Developed and tested against:
79
+
80
+ - DeepSeek Harness `0.1.0-rc.5`
81
+ - repository commit [`47f9438`](https://github.com/deepseek-ai/deepseek-harness/tree/47f943859bef60e4160492346772ded9b24f765a)
82
+ - Node.js 24 on Windows
83
+
84
+ On the `0.1.0-rc.5` source checkout, `bootstrapMaxTokens` reaches the actual
85
+ first request (the first `request/header` records the cap, `adapterDefaults`
86
+ stays empty), because `llm.prepareCall` only materializes a default maxTokens
87
+ when the proposed config has none. One prebuilt profile package observed in
88
+ issue #11 (CLI launcher reporting `0.1.0-rc.6`) overwrote the proposed cap
89
+ with `adapterDefaults.maxTokens`; there the cap is a no-op. The default
90
+ composition therefore relies on the Minimal tool schema alone (which anchors
91
+ at the adapter default with no cap) and leaves `bootstrapMaxTokens` as an
92
+ opt-in for standard-schema bootstraps.
93
+
94
+ DeepSeek Harness is currently a developer preview and explicitly permits
95
+ breaking changes. This preset is a full snapshot of the Standard composition,
96
+ so review upstream changes before using it with a newer release.
97
+
98
+ ## Install
99
+
100
+ Clone this repository, then copy the entire `preset` directory into the user
101
+ preset root under the id `anchored-standard`.
102
+
103
+ PowerShell:
104
+
105
+ ```powershell
106
+ $target = Join-Path $env:USERPROFILE '.dsh\.agent-presets\anchored-standard'
107
+ if (Test-Path -LiteralPath $target) { throw "Preset already exists: $target" }
108
+ New-Item -ItemType Directory -Force -Path (Split-Path -Parent $target) | Out-Null
109
+ Copy-Item -Recurse -LiteralPath '.\preset' -Destination $target
110
+ ```
111
+
112
+ Linux/macOS:
113
+
114
+ ```sh
115
+ dsh_home="${DSH_HOME:-$HOME/.dsh}"
116
+ mkdir -p "$dsh_home/.agent-presets"
117
+ test ! -e "$dsh_home/.agent-presets/anchored-standard"
118
+ cp -R preset "$dsh_home/.agent-presets/anchored-standard"
119
+ ```
120
+
121
+ Fully restart DeepSeek Harness, create a blank session, and select
122
+ **Anchored Standard (experimental)**. Do not switch an active session from a
123
+ different preset.
124
+
125
+ ## Verify
126
+
127
+ Export the session JSONL and inspect `request/header` events. Reproduction
128
+ checklist (issue #11 asks for the first two explicitly, because both are the
129
+ variables that decide the anchor):
130
+
131
+ - **First-request `config.maxTokens` value**: with `bootstrapMaxTokens` unset
132
+ (the default), the first header records the adapter default (e.g. 256000
133
+ with `adapterDefaults.maxTokens: true`); with a cap configured it records
134
+ the cap (e.g. 1024 with no maxTokens adapterDefault).
135
+ - **First-request tool schema source**: the first header's `tools` array must
136
+ be exactly `["bash", "str_replace_editor"]` — the official Minimal preset's
137
+ real schemas, not Standard's `pwsh`/`read`.
138
+ - the first request's messages should contain no AGENTS.md/CLAUDE.md digest and
139
+ no available-skills reminder — only the user message and the minimal persona
140
+ system prompt;
141
+ - after the first tool call or the first assistant reply, the next changed
142
+ header should contain the full Standard catalog;
143
+ - subsequent requests should keep that full catalog and restore the standard
144
+ context injections.
145
+
146
+ Run the local zero-dependency tests with:
147
+
148
+ ```sh
149
+ npm test
150
+ ```
151
+
152
+ ## Important behavior
153
+
154
+ - With the default `promoteOn: either`, the session promotes after its first
155
+ durable `tool/call` OR its first `assistant/message`, whichever comes first —
156
+ request #1 sees the bootstrap catalog and every later request sees the full
157
+ catalog. A text-only first reply therefore still promotes at request #2;
158
+ set `promoteOn: tool-call` to restore the original behavior, where a first
159
+ response that makes no tool call never promotes.
160
+ - A failed tool execution still promotes the session because the durable
161
+ `tool/call` already exists.
162
+ - The first request's output budget is NOT capped by default: the Minimal tool
163
+ schema anchors at the adapter-default maxTokens, so `bootstrapMaxTokens` is
164
+ opt-in. When set, the first request is capped and the cap is explicitly
165
+ stripped after promotion (the next request's seed proposal carries the
166
+ previous header's maxTokens forward).
167
+ - The Minimal pair stays mounted after promotion, so the promoted catalog is
168
+ the Standard catalog plus `bash` (persistent) and `str_replace_editor` —
169
+ and the Standard sandboxed `bash` row is disabled in favor of the persistent
170
+ shell (same tool name, same layer; see Why). The `read`/`write`/`edit` tools
171
+ keep the sandboxed filesystem while `str_replace_editor` uses the preset's
172
+ local fs.
173
+ - A missing bootstrap tool degrades to the full catalog with a one-time
174
+ warning instead of failing requests, so a composition drift cannot brick a
175
+ session; invalid `promoteOn` values fail at preset mount instead.
176
+ - Promotion decisions are memoized per session for the process lifetime; the
177
+ durable event scan runs once per session per process.
178
+ - While a session is unpromoted, the pre-step filter strips messages whose
179
+ `source.kind` is listed in `suppressedContextSources` (default:
180
+ `agent-instructions` and `skill-catalog`, the two automatic injections
181
+ Standard adds over Minimal). Set the list to `[]` to disable the context
182
+ filter; add other `source.kind` values to suppress more. A filter failure
183
+ degrades to keeping every message rather than eating context.
184
+ - The tool catalog changes once, so request-prefix cache continuity also changes
185
+ once between the first and second model requests.
186
+ - The preset has the same trust level as shell access. Review its files before
187
+ installation.
188
+ - The plugin performs no network requests and adds no telemetry.
189
+
190
+ ## Zero-Anchored Standard (experimental)
191
+
192
+ An extra test mode that does not change the Anchored Standard logic above. It
193
+ uses the same Minimal-aligned system prompt, but instead of exposing two tools
194
+ on the first request it injects one fixed zero-tool anchor turn:
195
+
196
+ 1. When the user sends their first message, the `anchor-turn` plugin prepends a
197
+ fixed user message — "This round is a test. Tools are not open yet; all
198
+ tools will open next round." — ahead of it.
199
+ 2. The first real model request carries ZERO tools, so the session's first
200
+ reasoning chain follows the zero-injection "we" trajectory.
201
+ 3. Once that anchor response is durable, the full Standard catalog is exposed
202
+ and the real message proceeds with all tools.
203
+
204
+ Anchoring on the first message — not on session creation — keeps the
205
+ blank-session preset switcher usable. Subagents always see the full catalog.
206
+
207
+ Measured behavior (opencode-go, DeepSeek V4 Pro, `reasoningEffort=max`): the
208
+ anchor request is stable "we"-style with zero `let me`; the following
209
+ tool-bearing requests return to the "The user wants…/Let me" style. This mode
210
+ is a comparison point for whether the zero-tool first turn is worth the extra
211
+ model call — not a claim that tool rounds stay "we"-style.
212
+
213
+ Install as a separate preset id:
214
+
215
+ ```sh
216
+ dsh_home="${DSH_HOME:-$HOME/.dsh}"
217
+ mkdir -p "$dsh_home/.agent-presets"
218
+ test ! -e "$dsh_home/.agent-presets/zero-anchored-standard"
219
+ cp -R zero-anchored-standard "$dsh_home/.agent-presets/zero-anchored-standard"
220
+ ```
221
+
222
+ Restart DeepSeek Harness, create a blank session, select **Zero-Anchored
223
+ Standard (experimental)**, then send your first message.
224
+
225
+ ## Whoami Standard (experimental)
226
+
227
+ A usability-oriented variant of the zero-tool anchor idea: the first turn is a
228
+ natural self-introduction prompt instead of a fixed test message, and the
229
+ user's real first message is deferred to the next turn. Whatever the user types
230
+ first, the session warms up exactly one round and everything is ready when the
231
+ real message is processed:
232
+
233
+ 1. When the user sends their first message, the `whoami-turn` plugin prepends a
234
+ fixed user message — "你是谁" (who are you) — ahead of it in the `next-turn`
235
+ inbox queue.
236
+ 2. dsh claims exactly ONE `next-turn` message per turn, so the first model
237
+ request sees only the anchor on an EMPTY tool surface and replies with a
238
+ self-introduction; that reply is the promotion signal.
239
+ 3. The real message is claimed by the NEXT turn, with the promoted resident
240
+ catalog (shells, `str_replace_editor`, the discovery tools) already
241
+ unlocked — heavier Standard tools are one `dev_tool_search` away.
242
+
243
+ The anchor text is configurable via the `whoami-turn` row's `text` option
244
+ (default "你是谁"). Anchoring on the first message — not session creation —
245
+ keeps the blank-session preset switcher usable; subagents always see the full
246
+ catalog. The trade-off is one extra model call per session: the anchor turn is
247
+ always taken, even when the first message is urgent.
248
+
249
+ The preset shares plugin modules with the anchored `preset/` directory via
250
+ `../preset/` references, so install that directory as well (see the Install
251
+ section above).
252
+
253
+ Install as a separate preset id:
254
+
255
+ ```sh
256
+ dsh_home="${DSH_HOME:-$HOME/.dsh}"
257
+ mkdir -p "$dsh_home/.agent-presets"
258
+ test ! -e "$dsh_home/.agent-presets/whoami-standard"
259
+ cp -R whoami-standard "$dsh_home/.agent-presets/whoami-standard"
260
+ ```
261
+
262
+ Restart DeepSeek Harness, create a blank session, select **Whoami Standard
263
+ (experimental)**, then send your first message — the self-introduction round
264
+ runs first, and your message is answered with the full tooling on the next
265
+ turn.
266
+
267
+ ## Official ecosystem guidance
268
+
269
+ DeepSeek currently asks community plugin authors to publish plugins in their own
270
+ GitHub projects and add the [`dsh-plugin`](https://github.com/topics/dsh-plugin)
271
+ repository topic for discovery. The official repository does not currently
272
+ accept external pull requests and does not mandate a community repository
273
+ template. See the official
274
+ [`CONTRIBUTING.md`](https://github.com/deepseek-ai/deepseek-harness/blob/47f943859bef60e4160492346772ded9b24f765a/CONTRIBUTING.md).
275
+
276
+ ## License
277
+
278
+ MIT. `preset/agent.cordis.yml` is derived from the DeepSeek Harness Standard
279
+ preset; the original DeepSeek copyright and MIT notice are retained in
280
+ [`NOTICE`](./NOTICE).
@@ -0,0 +1,400 @@
1
+ # The `anchored-standard` experimental preset: Standard capabilities with the
2
+ # Minimal mode system-prompt condition used by the V4 trajectory evaluation.
3
+ #
4
+ # This file is an AGENT-PLANE composition. The roster mounts it ONCE under a
5
+ # standing scope; every session naming it joins by scope parentage, so the
6
+ # tools and prompt sections registered here cover each joined agent while a
7
+ # session's own state stays keyed per Session/Agent inside the plugins. The
8
+ # host composition (`base.cordis.yml` + `web.cordis.yml`) keeps everything a
9
+ # preset must not own: the registries themselves, the sandbox and approval
10
+ # stack, persistence, and the model route.
11
+ #
12
+ # A service row here MUST sit inside a group carrying an `isolate` realm.
13
+ # Without one it publishes into the root realm, where it is process-global —
14
+ # another preset publishing the same name collides, and a host reader would
15
+ # resolve one preset's instance for every session; `dsh-agent-presets` rejects
16
+ # that at mount. `true` means an entry-local realm: this standing mount's own
17
+ # private instance, apart from every other preset's. (A shared label does NOT
18
+ # pool instances — `provide()` throws on the second registration under the
19
+ # same realm symbol; labels join REALMS, and are not what this file needs.)
20
+
21
+ # ── bootstrap (must stay FIRST) ─────────────────────────────────────────────
22
+
23
+ # This row deliberately sits before every other row: dsh-agent-instructions and
24
+ # dsh-tool-skill inject workspace instructions and the skill catalog into the
25
+ # first request via the agent/pre-step waterfall, and waterfall after-next
26
+ # transforms apply in reverse registration order. Registering first (plus the
27
+ # plugin empty inject list and the listener's `prepend` flag) makes this filter
28
+ # strip the final transform, so request #1 stays Minimal-exact (see issue #6).
29
+ #
30
+ # V4 Pro conditions strongly on the API tool catalog AND the first request
31
+ # output budget. Bootstrap request #1 with the OFFICIAL Minimal preset's real
32
+ # tool pair — persistent `bash` + `str_replace_editor` — which anchors at the
33
+ # adapter-default maxTokens (256000) with no output cap needed (issue #11:
34
+ # 5/5 anchored vs 11/11 standard-like for every standard-family schema);
35
+ # after the session records its first durable promotion signal (a tool call OR
36
+ # the first assistant message, default `promoteOn: either`), later steps
37
+ # narrow to the minimal RESIDENT set (see below). `bootstrapMaxTokens` is
38
+ # opt-in for standard-schema bootstraps; unset, the adapter default flows. See
39
+ # tool-bootstrap.mjs for the other triggers.
40
+ #
41
+ # The same phase gate suppresses AUTO-INJECTED context on request #1:
42
+ # `suppressedContextSources` lists the `agent/pre-step` message sources the
43
+ # bootstrap filter strips while the session is unpromoted. The defaults are the
44
+ # two automatic injections Standard adds over Minimal — the available-skills
45
+ # reminder (`skill-catalog`) and the workspace instruction digest
46
+ # (`agent-instructions`). User-initiated skill gestures are not filtered, and
47
+ # both injections return unchanged from request #2 on. Set the list to [] to
48
+ # disable the context filter while keeping the tool bootstrap.
49
+ #
50
+ # POST-PROMOTION (local addition): the promoted catalog is NOT the full
51
+ # Standard dump — it stays on the bootstrap pair + the three discovery tools
52
+ # (dev_tool_search / skill_search / skill_load) + whatever the model unlocked
53
+ # via dev_tool_search. Heavier tools are one dev_tool_search away; the
54
+ # trajectory is not pulled back to standard-like behavior by a 25-tool dump.
55
+ #
56
+ # COMPACTION (local addition): after `compaction/end` the session falls back
57
+ # to the controlled phase — bootstrap pair + `compactionTools` — until a NEW
58
+ # durable promotion signal exists past the boundary (epoch-aware, see
59
+ # compaction-epoch.mjs).
60
+ - id: tool-bootstrap
61
+ name: ./tool-bootstrap.mjs
62
+ config:
63
+ bootstrapTools: [bash, str_replace_editor]
64
+ promoteOn: either
65
+ suppressedContextSources: [agent-instructions, skill-catalog]
66
+ # Post-compaction core work set: the model is mid-task and needs to keep
67
+ # working, but faces a small catalog instead of the full Standard set.
68
+ compactionTools: [read, write, edit, glob, grep, todo_write, ask_user_question]
69
+
70
+ # ── identity ────────────────────────────────────────────────────────────────
71
+
72
+ # Keep this text byte-identical to the Minimal preset. `complete` prevents the
73
+ # Harness identity and per-tool guidance from changing the system prompt, while
74
+ # runtime-context suppression leaves task and repository rules to user messages
75
+ # and explicit file reads. Tool schemas and their runtime enforcement remain.
76
+ - id: persona
77
+ name: '@deepseek-ai/dsh-persona'
78
+ config:
79
+ text: You are a helpful software engineer assistant.
80
+ complete: true
81
+ includeRuntimeContext: false
82
+
83
+ # Instruction FILES are NOT injected (replaces dsh-agent-instructions, local
84
+ # addition): the full AGENTS.md/CLAUDE.md digest is a large injected block
85
+ # that perturbs the trajectory even after promotion. Instead, after promotion
86
+ # ONE short hint is injected once per session — "these instruction files
87
+ # exist; read them before acting" — and the model reads the files itself via
88
+ # the filesystem tools when relevant.
89
+ - id: instruction-hint
90
+ name: ./instruction-hint.mjs
91
+ config:
92
+ promoteOn: either
93
+
94
+ # On-demand tool discovery (the tool-search pattern, local addition): the
95
+ # promoted catalog keeps a minimal resident set; heavier Standard tools
96
+ # (web_search, subagent, workflow, …) are unlocked on demand via
97
+ # dev_tool_search.
98
+ - id: dev-tool-search
99
+ name: ./dev-tool-search.mjs
100
+
101
+ # ── shell ───────────────────────────────────────────────────────────────────
102
+
103
+ # `shell-env` stays in the HOST composition: `apps/cli/src/web.ts` injects it to
104
+ # publish `DSH_WEB_URL`/`DSH_WEB_MODE`, and a host row that injects a service is
105
+ # the criterion for host-plane ownership — injection resolves before any session
106
+ # exists, so there is no agent to key by. Behind a preset realm those variables
107
+ # never reached the model's shell at all. Both shell tools consume the host
108
+ # registry from here; their executors (`bash-sandbox`/`pwsh-sandbox`) are
109
+ # host-plane too.
110
+ - id: tool-bash
111
+ name: '@deepseek-ai/dsh-tool-bash'
112
+ # Disabled on EVERY platform, not just Windows: `dsh-tool-bash-persistent`
113
+ # below registers the same `bash` tool name into this same preset layer, and
114
+ # the tools registry rejects duplicates within one layer. The persistent
115
+ # shell (the Minimal preset's own shell) is the preset's bash; it consumes
116
+ # the host sandbox policy through the terminals realm.
117
+ disabled: true
118
+
119
+ - id: tool-pwsh
120
+ name: '@deepseek-ai/dsh-tool-pwsh'
121
+ disabled: !!js process.platform !== 'win32'
122
+
123
+ # The Minimal preset's shell: a PTY-backed persistent bash, byte-identical in
124
+ # configuration to the official `minimal` preset's `persistent-shell` group so
125
+ # the first request exposes exactly Minimal's real `bash` schema. The PTY
126
+ # registry is an agent-owned service, so it lives in an entry-local realm; the
127
+ # backend still consumes the host sandbox policy and subprocess implementation,
128
+ # while the tool registers into this agent's scoped catalog.
129
+ #
130
+ # DISABLED ON WINDOWS: DSH's PTY backend is linux/darwin-only, so the
131
+ # persistent shell cannot serve win32. The `custom-bash` row below registers
132
+ # the same `bash` tool name there instead (platform-exclusive).
133
+ - id: persistent-shell
134
+ name: cordis:group
135
+ group: true
136
+ disabled: !!js process.platform === 'win32'
137
+ isolate:
138
+ terminals: true
139
+ config:
140
+ - id: pty
141
+ name: '@deepseek-ai/dsh-terminal'
142
+
143
+ - id: terminal-bash
144
+ name: '@deepseek-ai/dsh-terminal-bash'
145
+ config:
146
+ timeoutMs: 300000
147
+
148
+ - id: persistent-bash
149
+ name: '@deepseek-ai/dsh-tool-bash-persistent'
150
+ config:
151
+ timeoutMs: 300000
152
+ description: |-
153
+ Run commands in a bash shell
154
+ * When invoking this tool, the contents of the "command" parameter does NOT need to be XML-escaped.
155
+ * You don't have access to the internet via this tool.
156
+ * You do have access to a mirror of common linux and python packages via apt and pip.
157
+ * State is persistent across command calls and discussions with the user.
158
+ * To inspect a particular line range of a file, e.g. lines 10-25, try 'sed -n 10,25p /path/to/the/file'.
159
+ * Please avoid commands that may produce a very large amount of output.
160
+ * Please run long lived commands in the background, e.g. 'sleep 10 &' or start a server in the background.
161
+
162
+ # Windows-only `bash` tool (see preset/custom-bash.mjs): registers the SAME
163
+ # tool name as the persistent shell with a Minimal-compatible description, but
164
+ # executes through the ordinary cross-platform subprocess seam (`bash -c`)
165
+ # instead of a PTY. `bashPath` defaults to `bash` on PATH; point it at Git
166
+ # Bash explicitly when the WSL shim would otherwise be picked up. No OS
167
+ # sandbox confinement on Windows (landlock is linux-only); the tool
168
+ # description says so.
169
+ - id: custom-bash
170
+ name: ./custom-bash.mjs
171
+ disabled: !!js process.platform !== 'win32'
172
+ config:
173
+ bashPath: 'C:\Program Files\Git\bin\bash.exe'
174
+
175
+ # ── filesystem ──────────────────────────────────────────────────────────────
176
+
177
+ # Both register into the host `tools` registry and provide nothing, so
178
+ # they need no realm. The `fs` service and its policy stay in the host.
179
+ - id: tool-fs
180
+ name: '@deepseek-ai/dsh-tool-fs'
181
+
182
+ - id: tool-fs-search
183
+ name: '@deepseek-ai/dsh-tool-fs-search'
184
+ config:
185
+ sampleOverCapGlobResults: false
186
+
187
+ # The Minimal preset's second tool: `str_replace_editor` over a bare local
188
+ # filesystem, byte-identical in configuration to the official `minimal`
189
+ # preset's `filesystem` group. The editor's own realm shadows the host's
190
+ # sandboxed `fs` provider only inside this group, so the standard `read`/
191
+ # `write`/`edit` tools keep the sandboxed fs while the bootstrap editor uses
192
+ # the local one.
193
+ - id: bootstrap-filesystem
194
+ name: cordis:group
195
+ group: true
196
+ isolate:
197
+ fs: true
198
+ config:
199
+ - id: fs-local
200
+ name: '@deepseek-ai/dsh-fs-local'
201
+ config:
202
+ cwd: !!js process.env.DSH_CWD ?? process.cwd()
203
+
204
+ - id: str-replace-editor
205
+ name: '@deepseek-ai/dsh-tool-str-replace-editor'
206
+ config:
207
+ maxOutputChars: 16000
208
+
209
+ # ── background jobs ────────────────────────────────────────────────────────
210
+
211
+ # Only the model-facing controls. The task REGISTRY stays on the host plane:
212
+ # its producers sit outside any realm this file could put it in — `tool-bash`
213
+ # above resolves it with `ctx.get`, and an entry-local realm here is invisible
214
+ # to every sibling row, so `run_in_background` would answer "background jobs
215
+ # unavailable" while these controls sat in the catalog. The registry is keyed by
216
+ # owning agent anyway, so one host instance serves every session. What a preset
217
+ # chooses is whether its agent can collect and stop background work at all.
218
+ - id: tool-jobs
219
+ name: '@deepseek-ai/dsh-tool-jobs'
220
+
221
+ # ── skills ──────────────────────────────────────────────────────────────────
222
+
223
+ # The skill REGISTRY lives in the host composition and is layered per scope:
224
+ # these rows register into THIS preset's layer of it, so they need no realm.
225
+ # `skill-filesystem` contributes local-root discovery for agents on this
226
+ # preset. The full skill CATALOG injection (`dsh-tool-skill`, the ~9KB
227
+ # `<available_skills>` reminder) is REMOVED (local addition): it perturbs the
228
+ # trajectory (issue #6: 0/9 anchored with the catalog present vs ~81%
229
+ # without). Instead `skill-search` exposes two small on-demand tools —
230
+ # skill_search (list matching summaries) and skill_load (inject one skill's
231
+ # full instructions) — the tool-search pattern.
232
+ - id: skill-filesystem
233
+ name: '@deepseek-ai/dsh-skill-filesystem'
234
+
235
+ - id: skill-search
236
+ name: ./skill-search.mjs
237
+
238
+ # ── goals ───────────────────────────────────────────────────────────────────
239
+
240
+ # Only the model-facing tool. The goal SERVICE, its session driver, and the
241
+ # `/goal` command stay on the host plane: the Gateway serves the goal domain as
242
+ # Remote endpoints whose receiver comes from a generated descriptor, so it
243
+ # resolves `goals` on the host and an entry-local realm here would hide it. The
244
+ # registry is keyed by session anyway, so one host instance serves every
245
+ # session. What a preset chooses is whether its agent can call the goal tool.
246
+ - id: tool-goal
247
+ name: '@deepseek-ai/dsh-tool-goal'
248
+
249
+ # ── plan mode ───────────────────────────────────────────────────────────────
250
+
251
+ # Plan state is per-agent by nature, so an entry-local realm is not a
252
+ # workaround here — it is the correct lifetime.
253
+ - id: planning
254
+ name: cordis:group
255
+ group: true
256
+ isolate:
257
+ planMode: true
258
+ config:
259
+ - id: plan-mode
260
+ name: '@deepseek-ai/dsh-plan-mode'
261
+ config:
262
+ section: |
263
+ You are in plan mode. Stay in plan mode until exit_plan_mode succeeds or the user switches the session mode. Imperative language to implement changes means plan the implementation, not execute it. A user's conversational agreement — including an answer confirming something you asked — approves nothing and does not end plan mode; fold the confirmed decision into the plan and submit it through exit_plan_mode.
264
+
265
+ Explore first. Use non-mutating reads, searches, static analysis, and checks to ground the plan in the actual repository. Do not edit or write files, change configuration, run formatters or code generation that rewrites tracked files, commit, or otherwise carry out the plan. Prefer existing functions and patterns over new machinery.
266
+
267
+ The tool catalog stays the same across modes for request-cache stability. These plan-mode rules override any later tool description or guidance that suggests using mutation tools; those tools remain listed to keep the tool catalog unchanged. Do not use todo_write to track this planning phase: it tracks implementation after an approved plan, while the plan itself belongs in exit_plan_mode.
268
+
269
+ Resolve discoverable facts by inspection. Use ask_user_question only for user-owned choices or material ambiguity that inspection cannot answer. Do not ask the user where code lives or how current behavior works when you can find out.
270
+
271
+ Make the plan decision-complete: state the goal and success criteria; group implementation changes by subsystem; identify public API, schema, and data-flow changes; cover edge cases, failure modes, tests, acceptance criteria, and explicit assumptions. Keep it concise enough to review but detailed enough that another engineer can implement it without making design decisions.
272
+
273
+ When ready, call exit_plan_mode with the complete plan markdown, starting with a # title. Make exit_plan_mode the only and final tool call in that assistant response: it presents the plan for approval, and implementation begins only in a later step after approval. Do not paste the final plan as a plain reply or ask "should I proceed?" through prose or ask_user_question. If review rejects it, incorporate the feedback and present again. If the review channel is unavailable or aborted, stay in plan mode and ask the user to switch modes manually; do not proceed with implementation.
274
+
275
+ # ── compaction ──────────────────────────────────────────────────────────────
276
+
277
+ # `compaction-basic` reads `toolResultPrune` through `ctx.get`, so the pruner must
278
+ # share this realm rather than sit outside it.
279
+ #
280
+ # `tokenMeter` is deliberately NOT in this realm: the meter stays on the HOST
281
+ # plane, and the rows here resolve that one instance. It takes no configuration,
282
+ # keys every fold by Session, and owns the context-meter projection units the
283
+ # browser reads for every session — behind a realm those units would come and go
284
+ # with whichever presets happen to be mounted. What a preset chooses is whether
285
+ # its agent compacts at all, which is `compaction-basic` below.
286
+ - id: compaction
287
+ name: cordis:group
288
+ group: true
289
+ isolate:
290
+ compaction: true
291
+ toolResultPruner: true
292
+ config:
293
+ - id: compaction-basic
294
+ name: '@deepseek-ai/dsh-compaction-basic'
295
+
296
+ - id: command-compact
297
+ name: '@deepseek-ai/dsh-command-compact'
298
+
299
+ - id: tool-result-pruner
300
+ name: '@deepseek-ai/dsh-compaction-tool-result-pruner'
301
+ config:
302
+ thresholdChars: 8192
303
+ headChars: 4096
304
+ tailChars: 1024
305
+
306
+ # ── delegation and workflows ────────────────────────────────────────────────
307
+
308
+ # The `subagents` registry and its spawn/fork backends live in the HOST
309
+ # composition: the registry is a process singleton whose cross-session queries
310
+ # the api-proxy serves to the browser, and a provider name may only be
311
+ # registered once. This preset contributes the delegation TOOLS, which resolve
312
+ # that host registry.
313
+ #
314
+ # `workflows` is different — nothing outside an agent reads it — so every row
315
+ # that reaches it shares one entry-local realm here, and a consumer left
316
+ # outside would resolve a host registry this preset does not populate.
317
+ #
318
+ # `tool-subagent-report` is host-plane for the same reason as the registry,
319
+ # not because a preset may not want it: it registers a CONTINUABLE SETUP on
320
+ # that singleton rather than a tool this agent calls, and the setup list is
321
+ # not scope-aware — one copy per mounted preset means every child gets
322
+ # `report` registered once per live session, which throws on the second.
323
+ - id: delegation
324
+ name: cordis:group
325
+ group: true
326
+ isolate:
327
+ workflowEngine: true
328
+ config:
329
+ - id: tool-subagent-control
330
+ name: '@deepseek-ai/dsh-tool-subagent-control'
331
+
332
+ - id: tool-subagent-list-agents
333
+ name: '@deepseek-ai/dsh-tool-subagent-control/list-agents'
334
+
335
+ - id: tool-subagent
336
+ name: '@deepseek-ai/dsh-tool-subagent'
337
+ config:
338
+ provider: spawn
339
+ toolName: subagent
340
+ backgroundMode: continuable
341
+
342
+ - id: tool-subagent-fork
343
+ name: '@deepseek-ai/dsh-tool-subagent'
344
+ config:
345
+ provider: fork
346
+ toolName: subagent_fork
347
+ backgroundMode: continuable
348
+
349
+ # Product providers are host-plane singletons. Copy this preset, then
350
+ # remove `disabled` from either ordinary tool row to expose that product
351
+ # only to agents composed from the copy.
352
+ - id: tool-subagent-codex
353
+ name: '@deepseek-ai/dsh-tool-subagent'
354
+ disabled: true
355
+ config:
356
+ provider: codex
357
+ toolName: subagent_codex
358
+ enableRunInBackground: false
359
+ maxDepth: provider-managed
360
+
361
+ - id: tool-subagent-claude-code
362
+ name: '@deepseek-ai/dsh-tool-subagent'
363
+ disabled: true
364
+ config:
365
+ provider: claude-code
366
+ toolName: subagent_claude_code
367
+ enableRunInBackground: false
368
+ maxDepth: provider-managed
369
+
370
+ - id: workflow-worker-thread
371
+ name: '@deepseek-ai/dsh-workflow-worker-thread'
372
+ config:
373
+ provider: spawn
374
+
375
+ - id: tool-workflow
376
+ name: '@deepseek-ai/dsh-tool-workflow'
377
+
378
+ - id: tool-ralph
379
+ name: '@deepseek-ai/dsh-tool-ralph'
380
+ config:
381
+ subagentProvider: spawn
382
+ maxRounds: 64
383
+
384
+ # ── remaining model-facing rows ─────────────────────────────────────────────
385
+
386
+ - id: tool-ask-user
387
+ name: '@deepseek-ai/dsh-tool-ask-user'
388
+
389
+ - id: tool-todo
390
+ name: '@deepseek-ai/dsh-tool-todo'
391
+ config:
392
+ allowParallelInProgress: true
393
+
394
+ # The `web` service and its search provider stay in the host composition; only
395
+ # the model-facing tool is per-session.
396
+ - id: tool-web
397
+ name: '@deepseek-ai/dsh-tool-web'
398
+ config:
399
+ fetch: false
400
+ searchTimeoutMs: 60000