@deepseek-ai/dsh 0.0.1-rc.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/LICENSE ADDED
@@ -0,0 +1,28 @@
1
+ BSD 3-Clause License
2
+
3
+ Copyright (c) 2026, DeepSeek
4
+
5
+ Redistribution and use in source and binary forms, with or without
6
+ modification, are permitted provided that the following conditions are met:
7
+
8
+ 1. Redistributions of source code must retain the above copyright notice, this
9
+ list of conditions and the following disclaimer.
10
+
11
+ 2. Redistributions in binary form must reproduce the above copyright notice,
12
+ this list of conditions and the following disclaimer in the documentation
13
+ and/or other materials provided with the distribution.
14
+
15
+ 3. Neither the name of the copyright holder nor the names of its
16
+ contributors may be used to endorse or promote products derived from
17
+ this software without specific prior written permission.
18
+
19
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
20
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
21
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
22
+ DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
23
+ FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
24
+ DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
25
+ SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
26
+ CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
27
+ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
28
+ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
@@ -0,0 +1,6 @@
1
+ # Bilingual-pair consistency record (docs/i18n/README.md): the git blob hash of each
2
+ # side as of the last confirmed-consistent state. Both languages carry equal authority;
3
+ # after editing either side, bring the other along and re-record with:
4
+ # pnpm run verify-translation-pairing --write apps/cli/README.md
5
+ README.md: 4fae5338a89ce12c2620e123530acf883ae9efff
6
+ README.zh.md: a2d086b8ff12fb07f2446fc4162de09739bcdeab
package/README.md ADDED
@@ -0,0 +1,38 @@
1
+ # `@deepseek-ai/dsh`
2
+
3
+ English | [中文](README.zh.md)
4
+
5
+ The `dsh` command is the product launcher for profiles: ordered stacks of plugin-bundle patch layers under the user's own overrides. [`src/args.ts`](src/args.ts) owns the command grammar, and [`src/bin.ts`](src/bin.ts) loads only the selected runner. Invalid commands, options from another mode, configuration errors, and boot failures exit nonzero.
6
+
7
+ ## Entry modes
8
+
9
+ | Command | Purpose |
10
+ |---|---|
11
+ | `dsh --profile <name>` | Boot the named profile under `$DSH_HOME/profiles/<name>`. |
12
+ | `dsh --profile headless "task"` | Run one fresh persisted session, print the final answer, and exit. |
13
+ | `dsh web` | Alias of `--profile web`. |
14
+ | `dsh plugin --profile <name> <pnpm args>` | Manage a profile's plugins by forwarding to pnpm in the profile directory. |
15
+
16
+ The invoking directory is the default workspace root. The `web` and `headless` profiles auto-initialize on first use from shipped templates; any other profile must be created through `dsh plugin`.
17
+
18
+ ## App arguments
19
+
20
+ The launcher parses only its own flags and hands everything after them to the booted profile, where any injected app plugin may parse the shared immutable snapshot ([`dsh-cmdline`](../../packages/boot/cmdline/README.md)). Launcher flags therefore come first, and the first token the launcher does not recognize starts the app's arguments:
21
+
22
+ ```sh
23
+ dsh --profile web --port 8080 # --port belongs to the web app
24
+ dsh --profile tui --resume <id> # --resume belongs to the terminal app
25
+ dsh --profile headless "run the tests"
26
+ dsh --profile web --help # the web app's flags, not the launcher's
27
+ dsh --help # the launcher's own help
28
+ ```
29
+
30
+ ## Profiles
31
+
32
+ A profile directory holds a `package.json` (out-of-tree plugin dependencies plus the profile manifest `dsh.profile` with its ordered `bundles` list) and a `cordis.patch.yml` (the user's own patch layer, hot-reloaded on long-lived surfaces). The tree composes over an empty root: each bundle's patch in `dsh.profile.bundles` order, then the profile's `cordis.patch.yml`, then the home-level `$DSH_HOME/cordis.patch.yml`, then `--patch` overlays. Bundles named in `dsh.profile.bundles` resolve from the dsh installation first (`@deepseek-ai/dsh-base`, `@deepseek-ai/dsh-web-app`, `@deepseek-ai/dsh-headless`), then from the profile's own `node_modules`, where pnpm installs out-of-tree plugins. Use `--dump-default-config` and `--dump-config` to inspect the composed tree without booting it.
33
+
34
+ The [CLI behavior reference](reference/README.md) owns exact layer precedence, flags, shutdown behavior, deployment defaults, and the source launcher.
35
+
36
+ ## Development
37
+
38
+ Production runs require built package and frontend artifacts. From a checkout, `pnpm run dsh` runs the TypeScript entry and forwards arguments; the [source-launcher reference](reference/README.md#source-launcher) describes the PATH symlink and module-resolution contract.
package/README.zh.md ADDED
@@ -0,0 +1,38 @@
1
+ # `@deepseek-ai/dsh`
2
+
3
+ [English](README.md) | 中文
4
+
5
+ `dsh` 命令是 profile 的产品启动器:profile 是按序叠放的插件组合包 patch 层,之上再叠加用户自己的覆盖层。[`src/args.ts`](src/args.ts) 负责命令语法,[`src/bin.ts`](src/bin.ts) 只加载选中的运行器。无效命令、来自其他模式的选项、配置错误和启动失败都会以非零状态退出。
6
+
7
+ ## 入口模式
8
+
9
+ | 命令 | 用途 |
10
+ |---|---|
11
+ | `dsh --profile <name>` | 启动位于 `$DSH_HOME/profiles/<name>` 的指定 profile。 |
12
+ | `dsh --profile headless "task"` | 运行一个新的持久化会话,打印最终答案并退出。 |
13
+ | `dsh web` | `--profile web` 的别名。 |
14
+ | `dsh plugin --profile <name> <pnpm args>` | 通过在 profile 目录中转发给 pnpm 来管理该 profile 的插件。 |
15
+
16
+ 调用目录是默认 workspace 根目录。`web` 和 `headless` profile 在首次使用时会从随附模板自动初始化;其他任何 profile 都必须通过 `dsh plugin` 创建。
17
+
18
+ ## 应用参数
19
+
20
+ 启动器只解析属于自己的 flag,并把其后的一切交给启动起来的 profile,任何注入它的应用插件都可以解析这份共享的不可变快照([`dsh-cmdline`](../../packages/boot/cmdline/README.md))。因此启动器的 flag 必须写在前面,而启动器不认识的第一个 token 就是应用参数的起点:
21
+
22
+ ```sh
23
+ dsh --profile web --port 8080 # --port belongs to the web app
24
+ dsh --profile tui --resume <id> # --resume belongs to the terminal app
25
+ dsh --profile headless "run the tests"
26
+ dsh --profile web --help # the web app's flags, not the launcher's
27
+ dsh --help # the launcher's own help
28
+ ```
29
+
30
+ ## Profile
31
+
32
+ profile 目录包含一个 `package.json`(树外插件依赖,加上 profile manifest(元数据清单)`dsh.profile` 及其有序的 `bundles` 列表)和一个 `cordis.patch.yml`(用户自己的 patch 层,在长期运行的 surface 上热重载)。配置树在空根之上组合:先按 `dsh.profile.bundles` 顺序应用各组合包的 patch,然后是 profile 的 `cordis.patch.yml`,然后是 home 级的 `$DSH_HOME/cordis.patch.yml`,然后是 `--patch` overlay。`dsh.profile.bundles` 中列出的组合包先从 dsh 安装目录解析(`@deepseek-ai/dsh-base`、`@deepseek-ai/dsh-web-app`、`@deepseek-ai/dsh-headless`),再从 profile 自己的 `node_modules` 解析;pnpm 把树外插件安装在后者。使用 `--dump-default-config` 和 `--dump-config` 可在不启动的情况下检查组合后的配置树。
33
+
34
+ [CLI(命令行界面)行为参考](reference/README.md)负责确切的层优先级、flag、关闭行为、部署默认值和源码启动器。
35
+
36
+ ## 开发
37
+
38
+ 生产运行需要已构建的包与前端产物。在 checkout 中,`pnpm run dsh` 会运行 TypeScript 入口并转发参数;[源码启动器参考](reference/README.md#source-launcher)说明 PATH 符号链接和模块解析契约。
@@ -0,0 +1,254 @@
1
+ # The `code` agent preset: the standard coding agent, presented as Code Mode.
2
+ #
3
+ # Everything in `standard` is here unchanged. What is added is the `tool-mode`
4
+ # row: instead of one tool call per action, the model writes a TypeScript
5
+ # program against a generated SDK and `run_code` executes it, so a sequence
6
+ # that would be five round trips becomes one.
7
+ #
8
+ # The registry itself stays on the host plane — the agent loop's scheduler and
9
+ # the API proxy's presenters are its consumers — so what this preset owns is
10
+ # the PRESENTATION of that registry for this agent alone. Native sessions run
11
+ # beside this one in the same process, each seeing its own catalog.
12
+ #
13
+ # This file is an AGENT-PLANE composition. It is mounted under one agent's
14
+ # scope context, so every tool and prompt section it registers belongs to that
15
+ # session alone. The host composition (`base.cordis.yml` + `web.cordis.yml`)
16
+ # keeps everything a preset must not own: the registries themselves, the
17
+ # sandbox and approval stack, persistence, and the model route.
18
+ #
19
+ # A service row here MUST sit inside a group carrying an `isolate` realm.
20
+ # Without one it publishes into the root realm, where it is process-global
21
+ # rather than per-session and the second session mounting this preset collides
22
+ # with the first; `dsh-agent-presets` rejects that at mount. `true` means an
23
+ # entry-local realm — one private instance per mounted session, which is the
24
+ # default this deployment wants. A shared label would instead pool one instance
25
+ # across every session naming it.
26
+
27
+ # ── identity ────────────────────────────────────────────────────────────────
28
+
29
+ # The preset's own persona, shadowing the deployment default for this agent.
30
+ # `{{model}}` and `{{cwd}}` resolve from the agent's own route and workspace.
31
+ - id: persona
32
+ name: '@deepseek-ai/dsh-persona'
33
+ config:
34
+ text: >-
35
+ You are a coding agent powered by the {{model}} model. Your working directory is {{cwd}}.
36
+
37
+ - id: workspace-context
38
+ name: '@deepseek-ai/dsh-workspace-context'
39
+ config:
40
+ maxBytes: 65536
41
+
42
+ # ── shell ───────────────────────────────────────────────────────────────────
43
+
44
+ # `bash-env` stays in the HOST composition: `apps/cli/src/web.ts` injects it to
45
+ # publish `DSH_WEB_URL`/`DSH_WEB_MODE`, and a host row that injects a service is
46
+ # the criterion for host-plane ownership — injection resolves before any session
47
+ # exists, so there is no agent to key by. Behind a preset realm those variables
48
+ # never reached the model's shell at all. `tool-bash` consumes the host registry
49
+ # from here; the executor behind it (`bash-sandbox`) is host-plane too, where the
50
+ # sandbox policy owns it.
51
+ - id: tool-bash
52
+ name: '@deepseek-ai/dsh-tool-bash'
53
+
54
+ # ── filesystem ──────────────────────────────────────────────────────────────
55
+
56
+ # Both register into the host `tools` registry and provide nothing, so
57
+ # they need no realm. The `fs` service and its policy stay in the host.
58
+ - id: tool-fs
59
+ name: '@deepseek-ai/dsh-tool-fs'
60
+
61
+ - id: tool-fs-search
62
+ name: '@deepseek-ai/dsh-tool-fs-search'
63
+ config:
64
+ sampleOverCapGlobResults: false
65
+
66
+ # ── background tasks ────────────────────────────────────────────────────────
67
+
68
+ # Only the model-facing controls. The task REGISTRY stays on the host plane:
69
+ # its producers sit outside any realm this file could put it in — `tool-bash`
70
+ # above resolves it with `ctx.get`, and an entry-local realm here is invisible
71
+ # to every sibling row, so `run_in_background` would answer "background tasks
72
+ # unavailable" while these controls sat in the catalog. The registry is keyed by
73
+ # owning agent anyway, so one host instance serves every session. What a preset
74
+ # chooses is whether its agent can collect and stop background work at all.
75
+ - id: tool-tasks
76
+ name: '@deepseek-ai/dsh-tool-tasks'
77
+
78
+ # ── skills ──────────────────────────────────────────────────────────────────
79
+
80
+ # The skill REGISTRY lives in the host composition and is layered per scope:
81
+ # these rows register into THIS preset's layer of it, so they need no realm.
82
+ # `skill-local` contributes local-root discovery for agents on this preset, and
83
+ # `tool-skill` gives them the catalog and loader; the merged catalog also
84
+ # carries whatever the deployment registered globally (repository plugins).
85
+ - id: skill-local
86
+ name: '@deepseek-ai/dsh-skill-local'
87
+
88
+ - id: tool-skill
89
+ name: '@deepseek-ai/dsh-tool-skill'
90
+
91
+ # ── goals ───────────────────────────────────────────────────────────────────
92
+
93
+ # Only the model-facing tool. The goal SERVICE, its session driver, and the
94
+ # `/goal` command stay on the host plane: the Gateway serves the goal domain as
95
+ # Remote endpoints whose receiver comes from a generated descriptor, so it
96
+ # resolves `goals` on the host and an entry-local realm here would hide it. The
97
+ # registry is keyed by session anyway, so one host instance serves every
98
+ # session. What a preset chooses is whether its agent can call the goal tool.
99
+ - id: tool-goal
100
+ name: '@deepseek-ai/dsh-tool-goal'
101
+
102
+ # ── plan mode ───────────────────────────────────────────────────────────────
103
+
104
+ # Plan state is per-agent by nature, so an entry-local realm is not a
105
+ # workaround here — it is the correct lifetime.
106
+ - id: planning
107
+ name: cordis:group
108
+ group: true
109
+ isolate:
110
+ planMode: true
111
+ config:
112
+ - id: plan-mode
113
+ name: '@deepseek-ai/dsh-plan-mode'
114
+ config:
115
+ section: |
116
+ 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.
117
+
118
+ 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.
119
+
120
+ 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.
121
+
122
+ 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.
123
+
124
+ 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.
125
+
126
+ 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.
127
+
128
+ # ── compaction ──────────────────────────────────────────────────────────────
129
+
130
+ # `compact-basic` reads `toolResultPrune` through `ctx.get`, so the pruner must
131
+ # share this realm rather than sit outside it.
132
+ - id: compaction
133
+ name: cordis:group
134
+ group: true
135
+ isolate:
136
+ tokenMeter: true
137
+ compact: true
138
+ toolResultPrune: true
139
+ config:
140
+ - id: token-meter
141
+ name: '@deepseek-ai/dsh-token-meter'
142
+
143
+ - id: compact-basic
144
+ name: '@deepseek-ai/dsh-compact-basic'
145
+
146
+ - id: command-compact
147
+ name: '@deepseek-ai/dsh-command-compact'
148
+
149
+ - id: tool-result-prune
150
+ name: '@deepseek-ai/dsh-compact-tool-result-prune'
151
+ config:
152
+ thresholdChars: 8192
153
+ headChars: 4096
154
+ tailChars: 1024
155
+
156
+ # ── delegation and workflows ────────────────────────────────────────────────
157
+
158
+ # The `subagents` registry and its spawn/fork backends live in the HOST
159
+ # composition: the registry is a process singleton whose cross-session queries
160
+ # the api-proxy serves to the browser, and a provider name may only be
161
+ # registered once. This preset contributes the delegation TOOLS, which resolve
162
+ # that host registry.
163
+ #
164
+ # `workflows` is different — nothing outside an agent reads it — so every row
165
+ # that reaches it shares one entry-local realm here, and a consumer left
166
+ # outside would resolve a host registry this preset does not populate.
167
+ - id: delegation
168
+ name: cordis:group
169
+ group: true
170
+ isolate:
171
+ workflows: true
172
+ config:
173
+ - id: tool-subagent-control
174
+ name: '@deepseek-ai/dsh-tool-subagent-control'
175
+
176
+ - id: tool-subagent-list-agents
177
+ name: '@deepseek-ai/dsh-tool-subagent-control/list-agents'
178
+
179
+ - id: tool-subagent
180
+ name: '@deepseek-ai/dsh-tool-subagent'
181
+ config:
182
+ provider: spawn
183
+ toolName: subagent
184
+ backgroundMode: continuable
185
+
186
+ - id: tool-subagent-fork
187
+ name: '@deepseek-ai/dsh-tool-subagent'
188
+ config:
189
+ provider: fork
190
+ toolName: subagent_fork
191
+ backgroundMode: continuable
192
+
193
+ # Product providers are host-plane singletons. Copy this preset, then
194
+ # remove `disabled` from either ordinary tool row to expose that product
195
+ # only to agents composed from the copy.
196
+ - id: tool-subagent-codex
197
+ name: '@deepseek-ai/dsh-tool-subagent'
198
+ disabled: true
199
+ config:
200
+ provider: codex
201
+ toolName: subagent_codex
202
+ enableRunInBackground: false
203
+ maxDepth: provider-managed
204
+
205
+ - id: tool-subagent-claude-code
206
+ name: '@deepseek-ai/dsh-tool-subagent'
207
+ disabled: true
208
+ config:
209
+ provider: claude-code
210
+ toolName: subagent_claude_code
211
+ enableRunInBackground: false
212
+ maxDepth: provider-managed
213
+
214
+ - id: workflow-workerthread
215
+ name: '@deepseek-ai/dsh-workflow-workerthread'
216
+ config:
217
+ provider: spawn
218
+
219
+ - id: tool-workflow
220
+ name: '@deepseek-ai/dsh-tool-workflow'
221
+
222
+ - id: tool-ralph
223
+ name: '@deepseek-ai/dsh-tool-ralph'
224
+ config:
225
+ subagentProvider: spawn
226
+ maxRounds: 64
227
+
228
+ # ── remaining model-facing rows ─────────────────────────────────────────────
229
+
230
+ - id: tool-ask-user
231
+ name: '@deepseek-ai/dsh-tool-ask-user'
232
+
233
+ - id: tool-todo
234
+ name: '@deepseek-ai/dsh-tool-todo'
235
+ config:
236
+ allowParallelInProgress: true
237
+
238
+ # The `web` service and its search provider stay in the host composition; only
239
+ # the model-facing tool is per-session.
240
+ - id: tool-web
241
+ name: '@deepseek-ai/dsh-tool-web'
242
+ config:
243
+ fetch: false
244
+ searchTimeoutMs: 60000
245
+
246
+ # ── presentation ────────────────────────────────────────────────────────────
247
+
248
+ # Code Mode for this agent alone. The row waits for the host's `codeRuntime`
249
+ # rather than assuming it: a deployment that composes no TypeScript runtime
250
+ # fails this preset at mount, naming this id, instead of at the first request.
251
+ - id: tool-mode
252
+ name: '@deepseek-ai/dsh-agent-tool-mode'
253
+ config:
254
+ mode: code
@@ -0,0 +1,3 @@
1
+ name: 代码模式
2
+ description: 具备标准模式的全部能力,并通过 Code Mode SDK 呈现工具,让模型用一个 TypeScript 程序组合多步操作。
3
+ order: 2
@@ -0,0 +1,254 @@
1
+ # The `cordis` agent preset: the standard coding agent, plus the ability to
2
+ # read and write the runtime it is running in.
3
+ #
4
+ # It exists so a person can ask an agent to author another agent. Everything in
5
+ # `standard` is here unchanged; what is added is the self-referential Cordis
6
+ # toolset, a skill that teaches composition authoring, and a persona that says
7
+ # which of the two planes an edit belongs to.
8
+ #
9
+ # TRUST: `cordis_mount` evaluates model-written JavaScript against the live
10
+ # runtime, and a composition this agent writes becomes a preset other sessions
11
+ # mount. Treat a session on this preset as shell access — the toolset's own
12
+ # documentation makes the same statement.
13
+
14
+
15
+ # The preset's own persona, shadowing the deployment default for this agent.
16
+ # `{{model}}` and `{{cwd}}` resolve from the agent's own route and workspace.
17
+ - id: persona
18
+ name: '@deepseek-ai/dsh-persona'
19
+ config:
20
+ text: |-
21
+ You are a coding agent powered by the {{model}} model, running on the DeepSeek Harness. Your working directory is {{cwd}}.
22
+
23
+ You can read and modify the harness you run on. Its composition is Cordis: every capability is a plugin row in a `cordis.yml`, and an agent preset is one such file mounted for a single session.
24
+
25
+ Two planes decide where an edit belongs. The HOST composition holds the registries and anything shared across sessions — persistence, the sandbox and approval stack, the model route, the subagent registry and its backends. An AGENT PRESET holds what one session contributes to those registries: its tools, its persona, its prompt sections. A row that publishes a service belongs in the host composition, or inside an `isolate` realm if the preset genuinely owns that service and nothing outside one agent reads it.
26
+
27
+ Presets you author live under `${DSH_HOME:-$HOME/.dsh}/.agent-presets/<id>/`, one directory per preset. NEVER edit or delete the shipped preset install (the `agent-presets` directory beside the deployment's own config): it belongs to the deployment, an upgrade overwrites it, and corrupting the `cordis` preset would disable this very mode. To change what a shipped preset does, copy its composition into a new preset directory and edit the copy.
28
+
29
+ Load the `editing-cordis-compositions` skill before writing or changing a composition.
30
+
31
+ - id: workspace-context
32
+ name: '@deepseek-ai/dsh-workspace-context'
33
+ config:
34
+ maxBytes: 65536
35
+
36
+ # ── shell ───────────────────────────────────────────────────────────────────
37
+
38
+ # `bash-env` stays in the HOST composition: `apps/cli/src/web.ts` injects it to
39
+ # publish `DSH_WEB_URL`/`DSH_WEB_MODE`, and a host row that injects a service is
40
+ # the criterion for host-plane ownership — injection resolves before any session
41
+ # exists, so there is no agent to key by. Behind a preset realm those variables
42
+ # never reached the model's shell at all. `tool-bash` consumes the host registry
43
+ # from here; the executor behind it (`bash-sandbox`) is host-plane too, where the
44
+ # sandbox policy owns it.
45
+ - id: tool-bash
46
+ name: '@deepseek-ai/dsh-tool-bash'
47
+
48
+ # ── filesystem ──────────────────────────────────────────────────────────────
49
+
50
+ # Both register into the host `tools` registry and provide nothing, so
51
+ # they need no realm. The `fs` service and its policy stay in the host.
52
+ - id: tool-fs
53
+ name: '@deepseek-ai/dsh-tool-fs'
54
+
55
+ - id: tool-fs-search
56
+ name: '@deepseek-ai/dsh-tool-fs-search'
57
+ config:
58
+ sampleOverCapGlobResults: false
59
+
60
+ # ── background tasks ────────────────────────────────────────────────────────
61
+
62
+ # Only the model-facing controls. The task REGISTRY stays on the host plane:
63
+ # its producers sit outside any realm this file could put it in — `tool-bash`
64
+ # above resolves it with `ctx.get`, and an entry-local realm here is invisible
65
+ # to every sibling row, so `run_in_background` would answer "background tasks
66
+ # unavailable" while these controls sat in the catalog. The registry is keyed by
67
+ # owning agent anyway, so one host instance serves every session. What a preset
68
+ # chooses is whether its agent can collect and stop background work at all.
69
+ - id: tool-tasks
70
+ name: '@deepseek-ai/dsh-tool-tasks'
71
+
72
+ # ── goals ───────────────────────────────────────────────────────────────────
73
+
74
+ # Only the model-facing tool. The goal SERVICE, its session driver, and the
75
+ # `/goal` command stay on the host plane: the Gateway serves the goal domain as
76
+ # Remote endpoints whose receiver comes from a generated descriptor, so it
77
+ # resolves `goals` on the host and an entry-local realm here would hide it. The
78
+ # registry is keyed by session anyway, so one host instance serves every
79
+ # session. What a preset chooses is whether its agent can call the goal tool.
80
+ - id: tool-goal
81
+ name: '@deepseek-ai/dsh-tool-goal'
82
+
83
+ # ── plan mode ───────────────────────────────────────────────────────────────
84
+
85
+ # Plan state is per-agent by nature, so an entry-local realm is not a
86
+ # workaround here — it is the correct lifetime.
87
+ - id: planning
88
+ name: cordis:group
89
+ group: true
90
+ isolate:
91
+ planMode: true
92
+ config:
93
+ - id: plan-mode
94
+ name: '@deepseek-ai/dsh-plan-mode'
95
+ config:
96
+ section: |
97
+ 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.
98
+
99
+ 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.
100
+
101
+ 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.
102
+
103
+ 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.
104
+
105
+ 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.
106
+
107
+ 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.
108
+
109
+ # ── compaction ──────────────────────────────────────────────────────────────
110
+
111
+ # `compact-basic` reads `toolResultPrune` through `ctx.get`, so the pruner must
112
+ # share this realm rather than sit outside it.
113
+ - id: compaction
114
+ name: cordis:group
115
+ group: true
116
+ isolate:
117
+ tokenMeter: true
118
+ compact: true
119
+ toolResultPrune: true
120
+ config:
121
+ - id: token-meter
122
+ name: '@deepseek-ai/dsh-token-meter'
123
+
124
+ - id: compact-basic
125
+ name: '@deepseek-ai/dsh-compact-basic'
126
+
127
+ - id: command-compact
128
+ name: '@deepseek-ai/dsh-command-compact'
129
+
130
+ - id: tool-result-prune
131
+ name: '@deepseek-ai/dsh-compact-tool-result-prune'
132
+ config:
133
+ thresholdChars: 8192
134
+ headChars: 4096
135
+ tailChars: 1024
136
+
137
+ # ── delegation and workflows ────────────────────────────────────────────────
138
+
139
+ # The `subagents` registry and its spawn/fork backends live in the HOST
140
+ # composition: the registry is a process singleton whose cross-session queries
141
+ # the api-proxy serves to the browser, and a provider name may only be
142
+ # registered once. This preset contributes the delegation TOOLS, which resolve
143
+ # that host registry.
144
+ #
145
+ # `workflows` is different — nothing outside an agent reads it — so every row
146
+ # that reaches it shares one entry-local realm here, and a consumer left
147
+ # outside would resolve a host registry this preset does not populate.
148
+ #
149
+ # `tool-subagent-report` is host-plane for the same reason as the registry,
150
+ # not because a preset may not want it: it registers a CONTINUABLE SETUP on
151
+ # that singleton rather than a tool this agent calls, and the setup list is
152
+ # not scope-aware — one copy per mounted preset means every child gets
153
+ # `report` registered once per live session, which throws on the second.
154
+ - id: delegation
155
+ name: cordis:group
156
+ group: true
157
+ isolate:
158
+ workflows: true
159
+ config:
160
+ - id: tool-subagent-control
161
+ name: '@deepseek-ai/dsh-tool-subagent-control'
162
+
163
+ - id: tool-subagent-list-agents
164
+ name: '@deepseek-ai/dsh-tool-subagent-control/list-agents'
165
+
166
+ - id: tool-subagent
167
+ name: '@deepseek-ai/dsh-tool-subagent'
168
+ config:
169
+ provider: spawn
170
+ toolName: subagent
171
+ backgroundMode: continuable
172
+
173
+ - id: tool-subagent-fork
174
+ name: '@deepseek-ai/dsh-tool-subagent'
175
+ config:
176
+ provider: fork
177
+ toolName: subagent_fork
178
+ backgroundMode: continuable
179
+
180
+ # Product providers are host-plane singletons. Copy this preset, then
181
+ # remove `disabled` from either ordinary tool row to expose that product
182
+ # only to agents composed from the copy.
183
+ - id: tool-subagent-codex
184
+ name: '@deepseek-ai/dsh-tool-subagent'
185
+ disabled: true
186
+ config:
187
+ provider: codex
188
+ toolName: subagent_codex
189
+ enableRunInBackground: false
190
+ maxDepth: provider-managed
191
+
192
+ - id: tool-subagent-claude-code
193
+ name: '@deepseek-ai/dsh-tool-subagent'
194
+ disabled: true
195
+ config:
196
+ provider: claude-code
197
+ toolName: subagent_claude_code
198
+ enableRunInBackground: false
199
+ maxDepth: provider-managed
200
+
201
+ - id: workflow-workerthread
202
+ name: '@deepseek-ai/dsh-workflow-workerthread'
203
+ config:
204
+ provider: spawn
205
+
206
+ - id: tool-workflow
207
+ name: '@deepseek-ai/dsh-tool-workflow'
208
+
209
+ - id: tool-ralph
210
+ name: '@deepseek-ai/dsh-tool-ralph'
211
+ config:
212
+ subagentProvider: spawn
213
+ maxRounds: 64
214
+
215
+ # ── remaining model-facing rows ─────────────────────────────────────────────
216
+
217
+ - id: tool-ask-user
218
+ name: '@deepseek-ai/dsh-tool-ask-user'
219
+
220
+ - id: tool-todo
221
+ name: '@deepseek-ai/dsh-tool-todo'
222
+ config:
223
+ allowParallelInProgress: true
224
+
225
+ # The `web` service and its search provider stay in the host composition; only
226
+ # the model-facing tool is per-session.
227
+ - id: tool-web
228
+ name: '@deepseek-ai/dsh-tool-web'
229
+ config:
230
+ fetch: false
231
+ searchTimeoutMs: 60000
232
+
233
+ # ── self-modification ───────────────────────────────────────────────────────
234
+
235
+ # Read the live runtime, mount a temporary plugin, unmount it. The toolset is a
236
+ # trust boundary, not a sandbox — see this file's header.
237
+ - id: tool-cordis
238
+ name: '@deepseek-ai/dsh-tool-cordis'
239
+
240
+ # The composition-authoring skill travels with this preset rather than living
241
+ # in the user's skill root: it documents THIS deployment's two planes, and a
242
+ # preset is the unit that gets copied and edited. `baseUrl` is the preset's
243
+ # own directory, so the root resolves wherever the preset is installed.
244
+ # Both rows register into THIS preset's layer of the host skill registry, so
245
+ # they need no realm; the agent's merged catalog also carries whatever the
246
+ # deployment registered globally (repository plugins).
247
+ - id: skill-local
248
+ name: '@deepseek-ai/dsh-skill-local'
249
+ config:
250
+ customSkillDirs:
251
+ - !!js "process.getBuiltinModule('node:url').fileURLToPath(new URL('skills/', baseUrl))"
252
+
253
+ - id: tool-skill
254
+ name: '@deepseek-ai/dsh-tool-skill'
@@ -0,0 +1,3 @@
1
+ name: 创造模式
2
+ description: 用于创建自定义 Agent preset:具备标准模式的全部能力,并提供运行时检查、插件实验和 preset 创作指导。
3
+ order: 4