@monotykamary/dsh 0.1.0-rc.5

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,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 DeepSeek
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -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: c475fb62e420cad707777697bdd5336ac4531ba5
6
+ README.zh.md: 3a43608196c6848cf4aff90040a579a5547dd8d1
package/README.md ADDED
@@ -0,0 +1,47 @@
1
+ # `@monotykamary/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 "job"` | 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> # example, assuming the tui profile is installed; --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).
33
+
34
+ The tree composes over an empty root:
35
+ - each bundle's patch in `dsh.profile.bundles` order
36
+ - then the profile's `cordis.patch.yml`, then the home-level `$DSH_HOME/cordis.patch.yml`
37
+ - then `--patch` overlays
38
+
39
+ Bundles named in `dsh.profile.bundles` resolve from the dsh installation first (`@monotykamary/dsh-base`, `@monotykamary/dsh-web-app`, `@monotykamary/dsh-headless`), then from the profile's own `node_modules`, where pnpm installs out-of-tree plugins.
40
+
41
+ Use `--dump-default-config` and `--dump-config` to inspect the composed tree without booting it.
42
+
43
+ The [CLI behavior reference](reference/README.md) owns exact layer precedence, flags, shutdown behavior, deployment defaults, and source execution.
44
+
45
+ ## Development
46
+
47
+ Production runs require built package and frontend artifacts. From the repository root, run `pnpm run build` separately, then use `pnpm dsh <args...>` to run the TypeScript entry and forward every argument; the [source-execution reference](reference/README.md#source-execution) owns the module-resolution contract.
package/README.zh.md ADDED
@@ -0,0 +1,47 @@
1
+ # `@monotykamary/dsh`
2
+
3
+ [English](README.md) | 中文
4
+
5
+ `dsh` 是 DeepSeek Harness 中用于启动 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 "job"` | 运行一个全新的持久化会话,打印最终答案并退出。 |
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;注入该 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> # example, assuming the tui profile is installed; --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 层。
33
+
34
+ 配置树以空根为起点,依次叠加以下配置层:
35
+ - `dsh.profile.bundles` 中各组合包的 patch
36
+ - profile 自身的 `cordis.patch.yml`,然后是 home 级的 `$DSH_HOME/cordis.patch.yml`
37
+ - `--patch` 指定的覆盖层
38
+
39
+ `dsh.profile.bundles` 中列出的组合包先从 dsh 安装目录解析(`@monotykamary/dsh-base`、`@monotykamary/dsh-web-app`、`@monotykamary/dsh-headless`),再从 profile 自身的 `node_modules` 解析;pnpm 会将树外插件安装到该目录。
40
+
41
+ 使用 `--dump-default-config` 和 `--dump-config` 可在不启动的情况下检查组合后的配置树。
42
+
43
+ 层的确切优先级、flag、关闭行为、部署默认值和源码执行方式,以 [CLI(命令行界面)行为参考](reference/README.md)为准。
44
+
45
+ ## 开发
46
+
47
+ 生产运行需要已构建的包与前端产物。请在仓库根目录单独运行 `pnpm run build`,然后使用 `pnpm dsh <args...>` 运行 TypeScript 入口并转发所有参数;模块解析约定以[源码执行参考](reference/README.md#source-execution)为准。
@@ -0,0 +1,262 @@
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-presentation`
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: '@monotykamary/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: agent-instructions
38
+ name: '@monotykamary/dsh-agent-instructions'
39
+ config:
40
+ maxBytes: 65536
41
+
42
+ # ── shell ───────────────────────────────────────────────────────────────────
43
+
44
+ # `shell-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. Both shell tools consume the host
49
+ # registry from here; their executors (`bash-sandbox`/`pwsh-sandbox`) are
50
+ # host-plane too.
51
+ - id: tool-bash
52
+ name: '@monotykamary/dsh-tool-bash'
53
+ disabled: !!js process.platform === 'win32'
54
+
55
+ - id: tool-pwsh
56
+ name: '@monotykamary/dsh-tool-pwsh'
57
+ disabled: !!js process.platform !== 'win32'
58
+
59
+ # ── filesystem ──────────────────────────────────────────────────────────────
60
+
61
+ # Both register into the host `tools` registry and provide nothing, so
62
+ # they need no realm. The `fs` service and its policy stay in the host.
63
+ - id: tool-fs
64
+ name: '@monotykamary/dsh-tool-fs'
65
+
66
+ - id: tool-fs-search
67
+ name: '@monotykamary/dsh-tool-fs-search'
68
+ config:
69
+ sampleOverCapGlobResults: false
70
+
71
+ # ── background jobs ────────────────────────────────────────────────────────
72
+
73
+ # Only the model-facing controls. The task REGISTRY stays on the host plane:
74
+ # its producers sit outside any realm this file could put it in — `tool-bash`
75
+ # above resolves it with `ctx.get`, and an entry-local realm here is invisible
76
+ # to every sibling row, so `run_in_background` would answer "background jobs
77
+ # unavailable" while these controls sat in the catalog. The registry is keyed by
78
+ # owning agent anyway, so one host instance serves every session. What a preset
79
+ # chooses is whether its agent can collect and stop background work at all.
80
+ - id: tool-jobs
81
+ name: '@monotykamary/dsh-tool-jobs'
82
+
83
+ # ── skills ──────────────────────────────────────────────────────────────────
84
+
85
+ # The skill REGISTRY lives in the host composition and is layered per scope:
86
+ # these rows register into THIS preset's layer of it, so they need no realm.
87
+ # `skill-filesystem` contributes local-root discovery for agents on this preset, and
88
+ # `tool-skill` gives them the catalog and loader; the merged catalog also
89
+ # carries whatever the deployment registered globally (repository plugins).
90
+ - id: skill-filesystem
91
+ name: '@monotykamary/dsh-skill-filesystem'
92
+
93
+ - id: tool-skill
94
+ name: '@monotykamary/dsh-tool-skill'
95
+
96
+ # ── goals ───────────────────────────────────────────────────────────────────
97
+
98
+ # Only the model-facing tool. The goal SERVICE, its session driver, and the
99
+ # `/goal` command stay on the host plane: the Gateway serves the goal domain as
100
+ # Remote endpoints whose receiver comes from a generated descriptor, so it
101
+ # resolves `goals` on the host and an entry-local realm here would hide it. The
102
+ # registry is keyed by session anyway, so one host instance serves every
103
+ # session. What a preset chooses is whether its agent can call the goal tool.
104
+ - id: tool-goal
105
+ name: '@monotykamary/dsh-tool-goal'
106
+
107
+ # ── plan mode ───────────────────────────────────────────────────────────────
108
+
109
+ # Plan state is per-agent by nature, so an entry-local realm is not a
110
+ # workaround here — it is the correct lifetime.
111
+ - id: planning
112
+ name: cordis:group
113
+ group: true
114
+ isolate:
115
+ planMode: true
116
+ config:
117
+ - id: plan-mode
118
+ name: '@monotykamary/dsh-plan-mode'
119
+ config:
120
+ section: |
121
+ 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.
122
+
123
+ 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.
124
+
125
+ 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.
126
+
127
+ 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.
128
+
129
+ 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.
130
+
131
+ 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.
132
+
133
+ # ── compaction ──────────────────────────────────────────────────────────────
134
+
135
+ # `compaction-basic` reads `toolResultPrune` through `ctx.get`, so the pruner must
136
+ # share this realm rather than sit outside it.
137
+ #
138
+ # `tokenMeter` is deliberately NOT in this realm: the meter stays on the HOST
139
+ # plane, and the rows here resolve that one instance. It takes no configuration,
140
+ # keys every fold by Session, and owns the context-meter projection units the
141
+ # browser reads for every session — behind a realm those units would come and go
142
+ # with whichever presets happen to be mounted. What a preset chooses is whether
143
+ # its agent compacts at all, which is `compaction-basic` below.
144
+ - id: compaction
145
+ name: cordis:group
146
+ group: true
147
+ isolate:
148
+ compaction: true
149
+ toolResultPruner: true
150
+ config:
151
+ - id: compaction-basic
152
+ name: '@monotykamary/dsh-compaction-basic'
153
+
154
+ - id: command-compact
155
+ name: '@monotykamary/dsh-command-compact'
156
+
157
+ - id: tool-result-pruner
158
+ name: '@monotykamary/dsh-compaction-tool-result-pruner'
159
+ config:
160
+ thresholdChars: 8192
161
+ headChars: 4096
162
+ tailChars: 1024
163
+
164
+ # ── delegation and workflows ────────────────────────────────────────────────
165
+
166
+ # The `subagents` registry and its spawn/fork backends live in the HOST
167
+ # composition: the registry is a process singleton whose cross-session queries
168
+ # the api-proxy serves to the browser, and a provider name may only be
169
+ # registered once. This preset contributes the delegation TOOLS, which resolve
170
+ # that host registry.
171
+ #
172
+ # `workflows` is different — nothing outside an agent reads it — so every row
173
+ # that reaches it shares one entry-local realm here, and a consumer left
174
+ # outside would resolve a host registry this preset does not populate.
175
+ - id: delegation
176
+ name: cordis:group
177
+ group: true
178
+ isolate:
179
+ workflowEngine: true
180
+ config:
181
+ - id: tool-subagent-control
182
+ name: '@monotykamary/dsh-tool-subagent-control'
183
+
184
+ - id: tool-subagent-list-agents
185
+ name: '@monotykamary/dsh-tool-subagent-control/list-agents'
186
+
187
+ - id: tool-subagent
188
+ name: '@monotykamary/dsh-tool-subagent'
189
+ config:
190
+ provider: spawn
191
+ toolName: subagent
192
+ backgroundMode: continuable
193
+
194
+ - id: tool-subagent-fork
195
+ name: '@monotykamary/dsh-tool-subagent'
196
+ config:
197
+ provider: fork
198
+ toolName: subagent_fork
199
+ backgroundMode: continuable
200
+
201
+ # Product providers are host-plane singletons. Copy this preset, then
202
+ # remove `disabled` from either ordinary tool row to expose that product
203
+ # only to agents composed from the copy.
204
+ - id: tool-subagent-codex
205
+ name: '@monotykamary/dsh-tool-subagent'
206
+ disabled: true
207
+ config:
208
+ provider: codex
209
+ toolName: subagent_codex
210
+ enableRunInBackground: false
211
+ maxDepth: provider-managed
212
+
213
+ - id: tool-subagent-claude-code
214
+ name: '@monotykamary/dsh-tool-subagent'
215
+ disabled: true
216
+ config:
217
+ provider: claude-code
218
+ toolName: subagent_claude_code
219
+ enableRunInBackground: false
220
+ maxDepth: provider-managed
221
+
222
+ - id: workflow-worker-thread
223
+ name: '@monotykamary/dsh-workflow-worker-thread'
224
+ config:
225
+ provider: spawn
226
+
227
+ - id: tool-workflow
228
+ name: '@monotykamary/dsh-tool-workflow'
229
+
230
+ - id: tool-ralph
231
+ name: '@monotykamary/dsh-tool-ralph'
232
+ config:
233
+ subagentProvider: spawn
234
+ maxRounds: 64
235
+
236
+ # ── remaining model-facing rows ─────────────────────────────────────────────
237
+
238
+ - id: tool-ask-user
239
+ name: '@monotykamary/dsh-tool-ask-user'
240
+
241
+ - id: tool-todo
242
+ name: '@monotykamary/dsh-tool-todo'
243
+ config:
244
+ allowParallelInProgress: true
245
+
246
+ # The `web` service and its search provider stay in the host composition; only
247
+ # the model-facing tool is per-session.
248
+ - id: tool-web
249
+ name: '@monotykamary/dsh-tool-web'
250
+ config:
251
+ fetch: false
252
+ searchTimeoutMs: 60000
253
+
254
+ # ── presentation ────────────────────────────────────────────────────────────
255
+
256
+ # Code Mode for this agent alone. The row waits for the host's `codeRuntime`
257
+ # rather than assuming it: a deployment that composes no TypeScript runtime
258
+ # fails this preset at mount, naming this id, instead of at the first request.
259
+ - id: tool-presentation
260
+ name: '@monotykamary/dsh-agent-tool-presentation'
261
+ config:
262
+ mode: code
@@ -0,0 +1,3 @@
1
+ name: PTC 模式
2
+ description: 具备标准模式的全部能力,并通过 Code Mode SDK 呈现工具,让模型用一个 TypeScript 程序组合多步操作。
3
+ order: 2
@@ -0,0 +1,262 @@
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: '@monotykamary/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 one directory per preset under `${DSH_HOME:-$HOME/.dsh}/.agent-presets/<id>/`; the roster reports each preset's real path, so take the one you edit from there. 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: agent-instructions
32
+ name: '@monotykamary/dsh-agent-instructions'
33
+ config:
34
+ maxBytes: 65536
35
+
36
+ # ── shell ───────────────────────────────────────────────────────────────────
37
+
38
+ # `shell-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. Both shell tools consume the host
43
+ # registry from here; their executors (`bash-sandbox`/`pwsh-sandbox`) are
44
+ # host-plane too.
45
+ - id: tool-bash
46
+ name: '@monotykamary/dsh-tool-bash'
47
+ disabled: !!js process.platform === 'win32'
48
+
49
+ - id: tool-pwsh
50
+ name: '@monotykamary/dsh-tool-pwsh'
51
+ disabled: !!js process.platform !== 'win32'
52
+
53
+ # ── filesystem ──────────────────────────────────────────────────────────────
54
+
55
+ # Both register into the host `tools` registry and provide nothing, so
56
+ # they need no realm. The `fs` service and its policy stay in the host.
57
+ - id: tool-fs
58
+ name: '@monotykamary/dsh-tool-fs'
59
+
60
+ - id: tool-fs-search
61
+ name: '@monotykamary/dsh-tool-fs-search'
62
+ config:
63
+ sampleOverCapGlobResults: false
64
+
65
+ # ── background jobs ────────────────────────────────────────────────────────
66
+
67
+ # Only the model-facing controls. The task REGISTRY stays on the host plane:
68
+ # its producers sit outside any realm this file could put it in — `tool-bash`
69
+ # above resolves it with `ctx.get`, and an entry-local realm here is invisible
70
+ # to every sibling row, so `run_in_background` would answer "background jobs
71
+ # unavailable" while these controls sat in the catalog. The registry is keyed by
72
+ # owning agent anyway, so one host instance serves every session. What a preset
73
+ # chooses is whether its agent can collect and stop background work at all.
74
+ - id: tool-jobs
75
+ name: '@monotykamary/dsh-tool-jobs'
76
+
77
+ # ── goals ───────────────────────────────────────────────────────────────────
78
+
79
+ # Only the model-facing tool. The goal SERVICE, its session driver, and the
80
+ # `/goal` command stay on the host plane: the Gateway serves the goal domain as
81
+ # Remote endpoints whose receiver comes from a generated descriptor, so it
82
+ # resolves `goals` on the host and an entry-local realm here would hide it. The
83
+ # registry is keyed by session anyway, so one host instance serves every
84
+ # session. What a preset chooses is whether its agent can call the goal tool.
85
+ - id: tool-goal
86
+ name: '@monotykamary/dsh-tool-goal'
87
+
88
+ # ── plan mode ───────────────────────────────────────────────────────────────
89
+
90
+ # Plan state is per-agent by nature, so an entry-local realm is not a
91
+ # workaround here — it is the correct lifetime.
92
+ - id: planning
93
+ name: cordis:group
94
+ group: true
95
+ isolate:
96
+ planMode: true
97
+ config:
98
+ - id: plan-mode
99
+ name: '@monotykamary/dsh-plan-mode'
100
+ config:
101
+ section: |
102
+ 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.
103
+
104
+ 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.
105
+
106
+ 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.
107
+
108
+ 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.
109
+
110
+ 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.
111
+
112
+ 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.
113
+
114
+ # ── compaction ──────────────────────────────────────────────────────────────
115
+
116
+ # `compaction-basic` reads `toolResultPrune` through `ctx.get`, so the pruner must
117
+ # share this realm rather than sit outside it.
118
+ #
119
+ # `tokenMeter` is deliberately NOT in this realm: the meter stays on the HOST
120
+ # plane, and the rows here resolve that one instance. It takes no configuration,
121
+ # keys every fold by Session, and owns the context-meter projection units the
122
+ # browser reads for every session — behind a realm those units would come and go
123
+ # with whichever presets happen to be mounted. What a preset chooses is whether
124
+ # its agent compacts at all, which is `compaction-basic` below.
125
+ - id: compaction
126
+ name: cordis:group
127
+ group: true
128
+ isolate:
129
+ compaction: true
130
+ toolResultPruner: true
131
+ config:
132
+ - id: compaction-basic
133
+ name: '@monotykamary/dsh-compaction-basic'
134
+
135
+ - id: command-compact
136
+ name: '@monotykamary/dsh-command-compact'
137
+
138
+ - id: tool-result-pruner
139
+ name: '@monotykamary/dsh-compaction-tool-result-pruner'
140
+ config:
141
+ thresholdChars: 8192
142
+ headChars: 4096
143
+ tailChars: 1024
144
+
145
+ # ── delegation and workflows ────────────────────────────────────────────────
146
+
147
+ # The `subagents` registry and its spawn/fork backends live in the HOST
148
+ # composition: the registry is a process singleton whose cross-session queries
149
+ # the api-proxy serves to the browser, and a provider name may only be
150
+ # registered once. This preset contributes the delegation TOOLS, which resolve
151
+ # that host registry.
152
+ #
153
+ # `workflows` is different — nothing outside an agent reads it — so every row
154
+ # that reaches it shares one entry-local realm here, and a consumer left
155
+ # outside would resolve a host registry this preset does not populate.
156
+ #
157
+ # `tool-subagent-report` is host-plane for the same reason as the registry,
158
+ # not because a preset may not want it: it registers a CONTINUABLE SETUP on
159
+ # that singleton rather than a tool this agent calls, and the setup list is
160
+ # not scope-aware — one copy per mounted preset means every child gets
161
+ # `report` registered once per live session, which throws on the second.
162
+ - id: delegation
163
+ name: cordis:group
164
+ group: true
165
+ isolate:
166
+ workflowEngine: true
167
+ config:
168
+ - id: tool-subagent-control
169
+ name: '@monotykamary/dsh-tool-subagent-control'
170
+
171
+ - id: tool-subagent-list-agents
172
+ name: '@monotykamary/dsh-tool-subagent-control/list-agents'
173
+
174
+ - id: tool-subagent
175
+ name: '@monotykamary/dsh-tool-subagent'
176
+ config:
177
+ provider: spawn
178
+ toolName: subagent
179
+ backgroundMode: continuable
180
+
181
+ - id: tool-subagent-fork
182
+ name: '@monotykamary/dsh-tool-subagent'
183
+ config:
184
+ provider: fork
185
+ toolName: subagent_fork
186
+ backgroundMode: continuable
187
+
188
+ # Product providers are host-plane singletons. Copy this preset, then
189
+ # remove `disabled` from either ordinary tool row to expose that product
190
+ # only to agents composed from the copy.
191
+ - id: tool-subagent-codex
192
+ name: '@monotykamary/dsh-tool-subagent'
193
+ disabled: true
194
+ config:
195
+ provider: codex
196
+ toolName: subagent_codex
197
+ enableRunInBackground: false
198
+ maxDepth: provider-managed
199
+
200
+ - id: tool-subagent-claude-code
201
+ name: '@monotykamary/dsh-tool-subagent'
202
+ disabled: true
203
+ config:
204
+ provider: claude-code
205
+ toolName: subagent_claude_code
206
+ enableRunInBackground: false
207
+ maxDepth: provider-managed
208
+
209
+ - id: workflow-worker-thread
210
+ name: '@monotykamary/dsh-workflow-worker-thread'
211
+ config:
212
+ provider: spawn
213
+
214
+ - id: tool-workflow
215
+ name: '@monotykamary/dsh-tool-workflow'
216
+
217
+ - id: tool-ralph
218
+ name: '@monotykamary/dsh-tool-ralph'
219
+ config:
220
+ subagentProvider: spawn
221
+ maxRounds: 64
222
+
223
+ # ── remaining model-facing rows ─────────────────────────────────────────────
224
+
225
+ - id: tool-ask-user
226
+ name: '@monotykamary/dsh-tool-ask-user'
227
+
228
+ - id: tool-todo
229
+ name: '@monotykamary/dsh-tool-todo'
230
+ config:
231
+ allowParallelInProgress: true
232
+
233
+ # The `web` service and its search provider stay in the host composition; only
234
+ # the model-facing tool is per-session.
235
+ - id: tool-web
236
+ name: '@monotykamary/dsh-tool-web'
237
+ config:
238
+ fetch: false
239
+ searchTimeoutMs: 60000
240
+
241
+ # ── self-modification ───────────────────────────────────────────────────────
242
+
243
+ # Read the live runtime, mount a temporary plugin, unmount it. The toolset is a
244
+ # trust boundary, not a sandbox — see this file's header.
245
+ - id: tool-cordis
246
+ name: '@monotykamary/dsh-tool-cordis'
247
+
248
+ # The composition-authoring skill travels with this preset rather than living
249
+ # in the user's skill root: it documents THIS deployment's two planes, and a
250
+ # preset is the unit that gets copied and edited. `baseUrl` is the preset's
251
+ # own directory, so the root resolves wherever the preset is installed.
252
+ # Both rows register into THIS preset's layer of the host skill registry, so
253
+ # they need no realm; the agent's merged catalog also carries whatever the
254
+ # deployment registered globally (repository plugins).
255
+ - id: skill-filesystem
256
+ name: '@monotykamary/dsh-skill-filesystem'
257
+ config:
258
+ customSkillDirs:
259
+ - !!js "process.getBuiltinModule('node:url').fileURLToPath(new URL('skills/', baseUrl))"
260
+
261
+ - id: tool-skill
262
+ name: '@monotykamary/dsh-tool-skill'
@@ -0,0 +1,3 @@
1
+ name: 创造模式
2
+ description: 用于创建自定义 Agent preset:具备标准模式的全部能力,并提供运行时检查、插件实验和 preset 创作指导。
3
+ order: 4