dsh-subagent-profile 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,273 @@
1
+ # The `orchestrator` agent preset: the main-agent coordinator mode.
2
+ #
3
+ # A full coding agent — identical to the shipped `standard` preset row-for-row —
4
+ # whose persona turns it into the MAIN orchestrator: decompose work, delegate
5
+ # each subtask to the right subagent via the host-registered `dispatch` tool
6
+ # (per-scenario profile / preset / model / reasoning-effort) plus the ordinary
7
+ # `subagent` / `subagent_fork` / `workflow` / `ralph` delegation tools, then
8
+ # integrate the results. The `dispatch` tool itself is registered by the
9
+ # dsh-subagent-profile host row, so it is already visible to every preset
10
+ # including this one; this preset only adds the delegation tools below.
11
+ #
12
+ # Adapted from the builtin `standard` preset (the persona section is the only
13
+ # change). This file is an AGENT-PLANE composition. The roster mounts it ONCE
14
+ # under a standing scope; every session naming it joins by scope parentage, so
15
+ # the tools and prompt sections registered here cover each joined agent while a
16
+ # session's own state stays keyed per Session/Agent inside the plugins. The
17
+ # host composition (`base.cordis.yml` + `web.cordis.yml`) keeps everything a
18
+ # preset must not own: the registries themselves, the sandbox and approval
19
+ # stack, persistence, and the model route.
20
+ #
21
+ # A service row here MUST sit inside a group carrying an `isolate` realm.
22
+ # Without one it publishes into the root realm, where it is process-global —
23
+ # another preset publishing the same name collides, and a host reader would
24
+ # resolve one preset's instance for every session; `dsh-agent-presets` rejects
25
+ # that at mount. `true` means an entry-local realm: this standing mount's own
26
+ # private instance, apart from every other preset's. (A shared label does NOT
27
+ # pool instances — `provide()` throws on the second registration under the
28
+ # same realm symbol; labels join REALMS, and are not what this file needs.)
29
+
30
+ # ── identity ────────────────────────────────────────────────────────────────
31
+
32
+ # The orchestrator persona, shadowing the deployment default for this agent.
33
+ # `{{model}}` and `{{cwd}}` resolve from the agent's own route and workspace.
34
+ - id: persona
35
+ name: '@deepseek-ai/dsh-persona'
36
+ config:
37
+ text: |-
38
+ 你是主协调 Agent(Orchestrator),由 {{model}} 驱动,工作目录是 {{cwd}}。
39
+
40
+ 你的职责是「拆解 → 委派 → 集成」,把复杂任务交给合适的子 Agent 并行或串行完成,而不是事事亲力亲为:
41
+ 1. 先规划:用 todo_write 记下总体计划,把任务拆成彼此独立、边界清晰的子任务,标注依赖与并行关系。
42
+ 2. 再委派:优先用 dispatch 工具按场景选方案派发(dispatch.profile 内置 swap-standard=标准编码、researcher=调研检索,可在「子 Agent 方案」设置页自定义)。多轮可续探索用 subagent / subagent_fork,多路批量并行用 workflow,需要从头反复迭代的长任务才用 ralph。能后台并行就 run_in_background,不要串行干等。
43
+ 3. 自包含 prompt:每个子 Agent 都看不到你的对话,prompt 必须写全背景、目标、期望产出、验收标准与禁止事项,别让它回头猜。
44
+ 4. 亲自兜底与集成:读文件、搜索、小改动等比委派更便宜的事自己直接做;收集子 Agent 产出后亲自核对质量,整合成一份连贯的最终交付,不要原样堆砌。
45
+ 5. 失败处理:子 Agent 失败或超出权限时,自己接手重做,或用 ask_user_question 向用户澄清。
46
+ 6. 边界:子 Agent 的能力 ⊆ 你的能力,审批恒为「永不」;不要委派你也没有权限做的事,也不要让子 Agent 提权。
47
+
48
+ - id: agent-instructions
49
+ name: '@deepseek-ai/dsh-agent-instructions'
50
+ config:
51
+ maxBytes: 65536
52
+
53
+ # ── shell ───────────────────────────────────────────────────────────────────
54
+
55
+ # `shell-env` stays in the HOST composition: `apps/cli/src/web.ts` injects it to
56
+ # publish `DSH_WEB_URL`/`DSH_WEB_MODE`, and a host row that injects a service is
57
+ # the criterion for host-plane ownership — injection resolves before any session
58
+ # exists, so there is no agent to key by. Behind a preset realm those variables
59
+ # never reached the model's shell at all. Both shell tools consume the host
60
+ # registry from here; their executors (`bash-sandbox`/`pwsh-sandbox`) are
61
+ # host-plane too.
62
+ - id: tool-bash
63
+ name: '@deepseek-ai/dsh-tool-bash'
64
+ disabled: !!js process.platform === 'win32'
65
+
66
+ - id: tool-pwsh
67
+ name: '@deepseek-ai/dsh-tool-pwsh'
68
+ disabled: !!js process.platform !== 'win32'
69
+
70
+ # ── filesystem ──────────────────────────────────────────────────────────────
71
+
72
+ # Both register into the host `tools` registry and provide nothing, so
73
+ # they need no realm. The `fs` service and its policy stay in the host.
74
+ - id: tool-fs
75
+ name: '@deepseek-ai/dsh-tool-fs'
76
+
77
+ - id: tool-fs-search
78
+ name: '@deepseek-ai/dsh-tool-fs-search'
79
+ config:
80
+ sampleOverCapGlobResults: false
81
+
82
+ # ── background jobs ────────────────────────────────────────────────────────
83
+
84
+ # Only the model-facing controls. The task REGISTRY stays on the host plane:
85
+ # its producers sit outside any realm this file could put it in — `tool-bash`
86
+ # above resolves it with `ctx.get`, and an entry-local realm here is invisible
87
+ # to every sibling row, so `run_in_background` would answer "background jobs
88
+ # unavailable" while these controls sat in the catalog. The registry is keyed by
89
+ # owning agent anyway, so one host instance serves every session. What a preset
90
+ # chooses is whether its agent can collect and stop background work at all.
91
+ - id: tool-jobs
92
+ name: '@deepseek-ai/dsh-tool-jobs'
93
+
94
+ # ── skills ──────────────────────────────────────────────────────────────────
95
+
96
+ # The skill REGISTRY lives in the host composition and is layered per scope:
97
+ # these rows register into THIS preset's layer of it, so they need no realm.
98
+ # `skill-filesystem` contributes local-root discovery for agents on this preset, and
99
+ # `tool-skill` gives them the catalog and loader; the merged catalog also
100
+ # carries whatever the deployment registered globally (repository plugins).
101
+ - id: skill-filesystem
102
+ name: '@deepseek-ai/dsh-skill-filesystem'
103
+
104
+ - id: tool-skill
105
+ name: '@deepseek-ai/dsh-tool-skill'
106
+
107
+ # ── goals ───────────────────────────────────────────────────────────────────
108
+
109
+ # Only the model-facing tool. The goal SERVICE, its session driver, and the
110
+ # `/goal` command stay on the host plane: the Gateway serves the goal domain as
111
+ # Remote endpoints whose receiver comes from a generated descriptor, so it
112
+ # resolves `goals` on the host and an entry-local realm here would hide it. The
113
+ # registry is keyed by session anyway, so one host instance serves every
114
+ # session. What a preset chooses is whether its agent can call the goal tool.
115
+ - id: tool-goal
116
+ name: '@deepseek-ai/dsh-tool-goal'
117
+
118
+ # ── plan mode ───────────────────────────────────────────────────────────────
119
+
120
+ # Plan state is per-agent by nature, so an entry-local realm is not a
121
+ # workaround here — it is the correct lifetime.
122
+ - id: planning
123
+ name: cordis:group
124
+ group: true
125
+ isolate:
126
+ planMode: true
127
+ config:
128
+ - id: plan-mode
129
+ name: '@deepseek-ai/dsh-plan-mode'
130
+ config:
131
+ section: |
132
+ 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.
133
+
134
+ 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.
135
+
136
+ 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.
137
+
138
+ 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.
139
+
140
+ 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.
141
+
142
+ 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.
143
+
144
+ # ── compaction ──────────────────────────────────────────────────────────────
145
+
146
+ # `compaction-basic` reads `toolResultPrune` through `ctx.get`, so the pruner must
147
+ # share this realm rather than sit outside it.
148
+ #
149
+ # `tokenMeter` is deliberately NOT in this realm: the meter stays on the HOST
150
+ # plane, and the rows here resolve that one instance. It takes no configuration,
151
+ # keys every fold by Session, and owns the context-meter projection units the
152
+ # browser reads for every session — behind a realm those units would come and go
153
+ # with whichever presets happen to be mounted. What a preset chooses is whether
154
+ # its agent compacts at all, which is `compaction-basic` below.
155
+ - id: compaction
156
+ name: cordis:group
157
+ group: true
158
+ isolate:
159
+ compaction: true
160
+ toolResultPruner: true
161
+ config:
162
+ - id: compaction-basic
163
+ name: '@deepseek-ai/dsh-compaction-basic'
164
+
165
+ - id: command-compact
166
+ name: '@deepseek-ai/dsh-command-compact'
167
+
168
+ - id: tool-result-pruner
169
+ name: '@deepseek-ai/dsh-compaction-tool-result-pruner'
170
+ config:
171
+ thresholdChars: 8192
172
+ headChars: 4096
173
+ tailChars: 1024
174
+
175
+ # ── delegation and workflows ────────────────────────────────────────────────
176
+
177
+ # The `subagents` registry and its spawn/fork backends live in the HOST
178
+ # composition: the registry is a process singleton whose cross-session queries
179
+ # the api-proxy serves to the browser, and a provider name may only be
180
+ # registered once. This preset contributes the delegation TOOLS, which resolve
181
+ # that host registry. The `dispatch` tool (and the `profile` provider it
182
+ # drives) are registered by the dsh-subagent-profile host row, so they are
183
+ # host-global and already visible here; this group adds the ordinary
184
+ # subagent/workflow tools so the orchestrator can choose the cheapest fit.
185
+ #
186
+ # `workflows` is different — nothing outside an agent reads it — so every row
187
+ # that reaches it shares one entry-local realm here, and a consumer left
188
+ # outside would resolve a host registry this preset does not populate.
189
+ #
190
+ # `tool-subagent-report` is host-plane for the same reason as the registry,
191
+ # not because a preset may not want it: it registers a CONTINUABLE SETUP on
192
+ # that singleton rather than a tool this agent calls, and the setup list is
193
+ # not scope-aware — one copy per mounted preset means every child gets
194
+ # `report` registered once per live session, which throws on the second.
195
+ - id: delegation
196
+ name: cordis:group
197
+ group: true
198
+ isolate:
199
+ workflowEngine: true
200
+ config:
201
+ - id: tool-subagent-control
202
+ name: '@deepseek-ai/dsh-tool-subagent-control'
203
+
204
+ - id: tool-subagent-list-agents
205
+ name: '@deepseek-ai/dsh-tool-subagent-control/list-agents'
206
+
207
+ - id: tool-subagent
208
+ name: '@deepseek-ai/dsh-tool-subagent'
209
+ config:
210
+ provider: spawn
211
+ toolName: subagent
212
+ backgroundMode: continuable
213
+
214
+ - id: tool-subagent-fork
215
+ name: '@deepseek-ai/dsh-tool-subagent'
216
+ config:
217
+ provider: fork
218
+ toolName: subagent_fork
219
+ backgroundMode: continuable
220
+
221
+ # Production dsh does not install these optional providers. Install the
222
+ # matching Bundle in this Profile and restart the Host, then copy this
223
+ # preset and remove `disabled` from the matching tool row. Host availability
224
+ # alone grants no tool.
225
+ - id: tool-subagent-codex
226
+ name: '@deepseek-ai/dsh-tool-subagent'
227
+ disabled: true
228
+ config:
229
+ provider: codex
230
+ toolName: subagent_codex
231
+ backgroundMode: one-shot
232
+ maxDepth: provider-managed
233
+
234
+ - id: tool-subagent-claude-code
235
+ name: '@deepseek-ai/dsh-tool-subagent'
236
+ disabled: true
237
+ config:
238
+ provider: claude-code
239
+ toolName: subagent_claude_code
240
+ backgroundMode: one-shot
241
+ maxDepth: provider-managed
242
+
243
+ - id: workflow-worker-thread
244
+ name: '@deepseek-ai/dsh-workflow-worker-thread'
245
+ config:
246
+ provider: spawn
247
+
248
+ - id: tool-workflow
249
+ name: '@deepseek-ai/dsh-tool-workflow'
250
+
251
+ - id: tool-ralph
252
+ name: '@deepseek-ai/dsh-tool-ralph'
253
+ config:
254
+ subagentProvider: spawn
255
+ maxRounds: 64
256
+
257
+ # ── remaining model-facing rows ─────────────────────────────────────────────
258
+
259
+ - id: tool-ask-user
260
+ name: '@deepseek-ai/dsh-tool-ask-user'
261
+
262
+ - id: tool-todo
263
+ name: '@deepseek-ai/dsh-tool-todo'
264
+ config:
265
+ allowParallelInProgress: true
266
+
267
+ # The `web` service and its search provider stay in the host composition; only
268
+ # the model-facing tool is per-session.
269
+ - id: tool-web
270
+ name: '@deepseek-ai/dsh-tool-web'
271
+ config:
272
+ fetch: false
273
+ searchTimeoutMs: 60000
@@ -0,0 +1,2 @@
1
+ name: 编排者模式
2
+ description: 主 Agent 协调模式:把复杂任务拆解后,用 dispatch / subagent / workflow 按场景委派给合适的子 Agent(预设/模型/推理强度/工具白名单可逐个覆盖),收集并整合结果。适合需要多路并行、按场景配子 Agent 的复杂任务。