dsh-rolegroup 0.6.1 → 0.8.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.
- package/README.en.md +149 -21
- package/README.md +129 -19
- package/lib/client.js +113 -3
- package/lib/command.js +151 -9
- package/lib/config-info.js +9 -0
- package/lib/config.js +3 -0
- package/lib/doctor.js +14 -0
- package/lib/index.js +117 -23
- package/lib/init.js +191 -0
- package/lib/roles.js +135 -2
- package/lib/settings-table.js +14 -2
- package/package.json +1 -1
- package/src/client/card.jsx +12 -0
- package/src/client/controller.js +89 -1
- package/src/client/locales.js +4 -0
package/README.en.md
CHANGED
|
@@ -7,7 +7,7 @@ instance, so the tool name is the role name.
|
|
|
7
7
|
The role/category binding is inspired by
|
|
8
8
|
[oh-my-openagent](https://github.com/code-yeongyu/oh-my-openagent) ("omo"); see §10.
|
|
9
9
|
|
|
10
|
-
> Version **0.
|
|
10
|
+
> Version **0.8.0** | dsh **≥ 0.2.1-rc.1** (verified on 0.2.1-rc.3) | MIT
|
|
11
11
|
|
|
12
12
|
---
|
|
13
13
|
|
|
@@ -33,6 +33,21 @@ Two other things:
|
|
|
33
33
|
- You can check the result. `/rolegroup doctor` lists the model each role is actually using, and whether it
|
|
34
34
|
is available (see §6).
|
|
35
35
|
|
|
36
|
+
### Scope: what we deliberately do not do
|
|
37
|
+
|
|
38
|
+
In an ecosystem where everything is a plugin, staying focused is a choice and a red line. The items below are
|
|
39
|
+
**deliberate decisions, not missing features**:
|
|
40
|
+
|
|
41
|
+
| We do not | Why |
|
|
42
|
+
|---|---|
|
|
43
|
+
| **Orchestrate** (DAGs, multi-round collaboration, team pipelines) | That is the official Agent Teams' job; two orchestrators fight each other |
|
|
44
|
+
| **Register an MCP server** | Dozens of tools inflate the tool list, the permission surface, and the prompt budget |
|
|
45
|
+
| **Write a project-level state directory** (`.rolegroup/`) | We route work; we are not a runtime state machine — state belongs to the orchestration layer |
|
|
46
|
+
| **Take over the main session's Agent Preset** | An explicit preset **replaces** the parent composition (§4); taking over means choosing for the user |
|
|
47
|
+
| **Keep dual-shape branches for old dsh lines** | Since v0.6 we support ≥0.2.1 only; older lines get a clear error instead of half-working |
|
|
48
|
+
|
|
49
|
+
When you need orchestration, state, or an MCP tool chain, compose other plugins — they do not replace this one.
|
|
50
|
+
|
|
36
51
|
## 2. Quick start
|
|
37
52
|
|
|
38
53
|
### Official plugin manager
|
|
@@ -87,25 +102,43 @@ one; do not use both.
|
|
|
87
102
|
dsh --profile web --dump-config | grep -A1 dsh-rolegroup # should show - id: dsh-rolegroup
|
|
88
103
|
```
|
|
89
104
|
|
|
90
|
-
Restart `dsh web` and open a new session. The
|
|
105
|
+
Restart `dsh web` and open a new session. The eight role tools should be in the tool list; you can also run
|
|
91
106
|
`/rolegroup doctor` from the new session.
|
|
92
107
|
|
|
93
108
|
After changing code or `rolegroup.jsonc`, restart and open a new session. For panel saves, see §5.
|
|
94
109
|
|
|
95
110
|
## 3. Built-in roles
|
|
96
111
|
|
|
97
|
-
With no configuration, the plugin registers
|
|
98
|
-
`rolegroup.jsonc` or the panel can override them.
|
|
112
|
+
With no configuration, the plugin registers eight roles. The models below are initial values;
|
|
113
|
+
`rolegroup.jsonc` or the panel can override them.
|
|
114
|
+
|
|
115
|
+
The table names models only: one model usually has several routes (subscription plan, pay-as-you-go, gateway),
|
|
116
|
+
and the provider is up to your configuration. The built-in default points at the built-in table's providers (the
|
|
117
|
+
author's subscriptions) — on your machine run `/rolegroup init` to generate routes that actually work, or edit
|
|
118
|
+
them in the panel. Model ids and the effective routes are whatever `/rolegroup doctor` prints.
|
|
99
119
|
|
|
100
120
|
| Role | Built-in model | Responsibility |
|
|
101
121
|
|---|---|---|
|
|
102
|
-
| `analyst` |
|
|
103
|
-
| `planner` |
|
|
104
|
-
| `coder` |
|
|
105
|
-
| `reviewer` |
|
|
106
|
-
| `scout` |
|
|
107
|
-
| `scribe` |
|
|
108
|
-
| `
|
|
122
|
+
| `analyst` | Qwen3.8 Max | Requirement clarification, path classification, plan review (do it / how), architecture decisions |
|
|
123
|
+
| `planner` | Kimi K3 | Plan design: file layout, task breakdown, interface contracts, writing `plans.md` |
|
|
124
|
+
| `coder` | Kimi K3 | Implementation: TDD red-green-refactor following `plans.md` steps |
|
|
125
|
+
| `reviewer` | Qwen3.8 Max | Closing review: check acceptance criteria against evidence (was it actually done) |
|
|
126
|
+
| `scout` | DeepSeek V4.1 Flash | Exploration and bulk search (returns `file:line` evidence) |
|
|
127
|
+
| `scribe` | Qwen3.8 Flash | Documentation backfill, reports, spec maintenance |
|
|
128
|
+
| `vision` | Qwen3.8 Flash | Vision: image analysis, UI review, prototype reading, OCR (**the bound model must accept images**) |
|
|
129
|
+
| `fallback` | DeepSeek V4.1 Flash | Catch-all for unclassified lightweight tasks |
|
|
130
|
+
|
|
131
|
+
> **Why `vision` is bound to `qwen3.8-flash`** (evidence, not guesswork): ① the author used it for image
|
|
132
|
+
> analysis / UI review in omo for a long time; ② this project's delegation-path probe (`scout-02` in `evals`,
|
|
133
|
+
> a pixel-font OCR run **inside a child session**) scored it 10/10, while `MiniMax-M3` scored 4/10 and
|
|
134
|
+
> **fabricated** candidate strings in the same batch. Its fallback chain therefore only carries
|
|
135
|
+
> `deepseek-flash` (also 10/10, and the one provider dsh always registers); `M3` is excluded and `v4-pro` is
|
|
136
|
+
> left out because its vision support is untested.
|
|
137
|
+
>
|
|
138
|
+
> **How to use it**: delegation carries text only, so put the **image path** in the brief, e.g.
|
|
139
|
+
> "have vision analyze `/tmp/ui.png` for spacing and contrast". The role calls `read_image` itself.
|
|
140
|
+
> Upstream exposes no "vision capability" flag, so the plugin **cannot validate it at startup** — if you bind
|
|
141
|
+
> another model, run it once on an image with known text and check that it reads the text correctly.
|
|
109
142
|
|
|
110
143
|
Each role is a delegation-tool instance plus an auto-generated Agent Preset. The preset copies your default
|
|
111
144
|
session mode, replaces the persona, and removes the delegation group. That is why Settings → Agent presets
|
|
@@ -132,6 +165,7 @@ The plugin looks for config in this order and stops at the first hit:
|
|
|
132
165
|
"provider": "qwen-token-plan-cn", // optional; inherits the built-in provider
|
|
133
166
|
"model": "qwen3.8-flash",
|
|
134
167
|
"reasoningEffort": "medium", // optional; omit to use the model default
|
|
168
|
+
"fallbackModels": ["deepseek-official/deepseek-flash"], // optional; tried in order when the primary is unavailable
|
|
135
169
|
"persona": "file://./personas/analyst.md", // optional; file:// link (relative to this file) or inline
|
|
136
170
|
"summary": "Requirement clarification and plan review" // optional; one line
|
|
137
171
|
}
|
|
@@ -139,9 +173,34 @@ The plugin looks for config in this order and stops at the first hit:
|
|
|
139
173
|
}
|
|
140
174
|
```
|
|
141
175
|
|
|
142
|
-
The role name is the JSON key. Each role can set `provider`, `model`, `reasoningEffort` (optional),
|
|
143
|
-
(optional), and `summary` (optional). `reasoningEffort` must be a level
|
|
144
|
-
use the model default (see §5).
|
|
176
|
+
The role name is the JSON key. Each role can set `provider`, `model`, `reasoningEffort` (optional),
|
|
177
|
+
`fallbackModels` (optional), `persona` (optional), and `summary` (optional). `reasoningEffort` must be a level
|
|
178
|
+
the model supports; leave it out to use the model default (see §5).
|
|
179
|
+
|
|
180
|
+
### Fallback chains
|
|
181
|
+
|
|
182
|
+
Every built-in role bound to a provider other than `deepseek-official` carries a fallback chain, so a machine
|
|
183
|
+
without a qwen or Kimi subscription still gets a working table:
|
|
184
|
+
|
|
185
|
+
```jsonc
|
|
186
|
+
"analyst": {
|
|
187
|
+
"provider": "qwen-token-plan-cn",
|
|
188
|
+
"model": "qwen3.8-max",
|
|
189
|
+
"fallbackModels": ["deepseek-official/deepseek-flash", "deepseek-official/deepseek-v4-pro"]
|
|
190
|
+
}
|
|
191
|
+
```
|
|
192
|
+
|
|
193
|
+
Built-in chains are **cheap-first** (`deepseek-flash` → `deepseek-v4-pro`); v4-pro is only the last resort when
|
|
194
|
+
flash itself is unavailable. At startup the plugin takes the first route whose provider is registered and whose model is advertised
|
|
195
|
+
(primary first, then the chain). A degraded role is called out in the startup log and by
|
|
196
|
+
`/rolegroup doctor` (`⚠️ analyst: primary … unavailable, using built-in fallback …`).
|
|
197
|
+
|
|
198
|
+
**Explicit configuration never degrades on its own**: once a role appears in your `rolegroup.jsonc` (or was
|
|
199
|
+
saved from the panel), that route is executed as written. If it is unavailable the role is not registered and
|
|
200
|
+
doctor prints an actionable hint. Add `fallbackModels` to that role yourself if you want a chain.
|
|
201
|
+
|
|
202
|
+
For now chains are read from the config file only; the Settings panel does not edit them (and a panel save
|
|
203
|
+
takes over the whole layer, so file chains do not carry over).
|
|
145
204
|
|
|
146
205
|
### Precedence
|
|
147
206
|
|
|
@@ -164,13 +223,23 @@ To see which layer is active, read the "config source" line from `/rolegroup doc
|
|
|
164
223
|
|
|
165
224
|
### Runtime
|
|
166
225
|
|
|
167
|
-
- At startup, routes are checked
|
|
168
|
-
|
|
169
|
-
|
|
226
|
+
- At startup, routes are checked: the first route whose provider is registered and whose model is advertised
|
|
227
|
+
wins (primary, then the fallback chain). Built-in roles carry chains, so a machine without qwen / Kimi
|
|
228
|
+
subscriptions still runs; an **explicitly configured role never degrades** — an unregistered provider means
|
|
229
|
+
it is not registered, with a repair hint in the log and doctor. A model missing from the advertised list
|
|
230
|
+
only produces a warning; the role is still registered and delegation checks it again.
|
|
170
231
|
- `maxDepth` is 1: the main session can delegate, role subagents cannot. Setting it to 0 also blocks
|
|
171
232
|
top-level delegation.
|
|
233
|
+
Implementation detail (measured, easy to misread): the role preset drops the **delegation group**, so
|
|
234
|
+
`subagent` / `subagent_fork` / `workflow` do not appear in child sessions. The eight **role tools** are
|
|
235
|
+
registered on the host plane, though, so they still show up in a child's tool list; calling one is
|
|
236
|
+
rejected at runtime by `maxDepth`. Upstream 0.2.1 removed `toolFilter`, so the plugin cannot hide host
|
|
237
|
+
tools from children — a known limitation (noise, not an escape).
|
|
172
238
|
- Changes to `rolegroup.jsonc` are not hot-applied; restart and open a new session. Panel saves apply to new
|
|
173
239
|
sessions (see §5).
|
|
240
|
+
- Chains resolve at **startup only**: a dsh role tool fixes its model when it is registered, so a chain picks
|
|
241
|
+
one route per start rather than switching at runtime like omo's 429 fallback; `llm/adapters-updated` makes
|
|
242
|
+
the plugin recompose and resolve again.
|
|
174
243
|
- Delegation returns a subagent id immediately. You get a completion notice when the task finishes; no
|
|
175
244
|
polling.
|
|
176
245
|
|
|
@@ -183,15 +252,38 @@ inherited by delegations); express a role's read-only lean in its persona.
|
|
|
183
252
|
Settings → 角色配置 edits roles and model bindings: add or remove roles, change provider/model,
|
|
184
253
|
persona/summary, and reasoning effort. Save, Discard, and Reset to file config are at the bottom.
|
|
185
254
|
|
|
255
|
+
When some roles name a provider that is not registered on this machine, the panel shows
|
|
256
|
+
"N roles use a provider that is not registered" with a **Fill with available models** button: those rows are
|
|
257
|
+
pointed at the deployment default route (or the first available model when there is no default). Only the draft
|
|
258
|
+
changes — you still click Save.
|
|
259
|
+
|
|
186
260
|
The panel does not take over by itself. Before takeover it reads the active table (jsonc or built-in) and
|
|
187
261
|
pre-fills the editor. Save becomes available after you change something; saving writes `enabled=true` and the
|
|
188
262
|
whole table, and the panel takes over. If the read fails, the panel falls back to an empty table with manual
|
|
189
263
|
add, an inline error, and a retry. Reset to file config clears both fields and exits takeover.
|
|
190
264
|
|
|
265
|
+
**After takeover the panel shows the whole effective table**: built-in roles that are missing from your
|
|
266
|
+
override table (for example, a role added by a later plugin version) are filled in as normal rows carrying the
|
|
267
|
+
built-in route and fallback chain, and can be edited like any other row. Built-in rows have **no remove
|
|
268
|
+
button** (because `mergeRoles` always seeds the built-in table, removing one only reverts it to the built-in
|
|
269
|
+
default); custom rows can be removed.
|
|
270
|
+
|
|
271
|
+
Every row is saved **with its `fallbackModels`** (the panel does not offer an editor for it, but passes it
|
|
272
|
+
through unchanged). That matters: a panel save is an explicit configuration, and explicit configurations do
|
|
273
|
+
**not** inherit the built-in chain — dropping it would silently disable degradation (the role would be pruned
|
|
274
|
+
when its primary route is unavailable).
|
|
275
|
+
|
|
191
276
|
The header shows the plugin name and version, plus a GitHub link. The Config file button opens the active
|
|
192
277
|
`rolegroup.jsonc` in the right sidebar's document preview. It closes Settings first so the sidebar is visible.
|
|
193
|
-
If there is no config file, it shows a one-line notice in the page instead of a popup.
|
|
194
|
-
|
|
278
|
+
If there is no config file, it shows a one-line notice in the page instead of a popup. Host-side code changes
|
|
279
|
+
need a `dsh web` restart.
|
|
280
|
+
|
|
281
|
+
> **Endpoint exposure (explicit)**: `GET|HEAD /api/dsh-rolegroup/config` — **loopback only, no authentication,
|
|
282
|
+
> read-only**. It returns the **in-memory snapshot** read at startup (one of the project/user `rolegroup.jsonc`)
|
|
283
|
+
> and **never reads files based on request parameters**, so there is no arbitrary-file-read or path-traversal
|
|
284
|
+
> surface. Any process that can reach the local loopback can already read `~/.dsh`, so this endpoint widens no
|
|
285
|
+
> trust boundary; in multi-user or untrusted-host setups, keep `dsh web` bound to loopback (the default).
|
|
286
|
+
> Responses carry `nosniff`, so they cannot be executed via `<script>`.
|
|
195
287
|
|
|
196
288
|
Reasoning effort can be left empty, which means the model's default (Kimi K3, for example, defaults to
|
|
197
289
|
`high`). A higher level is usually slower and more expensive, but it reasons more thoroughly. The dropdown options come from
|
|
@@ -209,11 +301,25 @@ install entry.
|
|
|
209
301
|
|
|
210
302
|
`/rolegroup doctor` reads the `$DSH_HOME/plugins/dsh-rolegroup/last-startup.json` snapshot and compares it
|
|
211
303
|
with the live llm service. It lists each role's name, bound model, provider, and whether the model is
|
|
212
|
-
available, with repair hints when something is wrong.
|
|
304
|
+
available, with repair hints when something is wrong. When a built-in fallback is in effect it says so
|
|
305
|
+
("primary X unavailable, using built-in fallback Y").
|
|
213
306
|
|
|
214
307
|
- `/rolegroup doctor`: diagnose.
|
|
308
|
+
- `/rolegroup init`: print a starter config that overrides only the roles whose primary route is unavailable
|
|
309
|
+
on this machine (nothing is written) and show the active layer (panel / project jsonc / user jsonc / built-in).
|
|
310
|
+
- `/rolegroup init --write`: write the user-level `$DSH_HOME/rolegroup.jsonc`; refuses to overwrite, and
|
|
311
|
+
**refuses while the panel has taken over or a project-level config exists** — a file written then would not
|
|
312
|
+
be read.
|
|
313
|
+
- `/rolegroup init --write --project`: write the project-level `<cwd>/.dsh/rolegroup.jsonc`; warns when the
|
|
314
|
+
user-level file is the active layer and would be shadowed.
|
|
315
|
+
- `/rolegroup init --diff`: list which roles in the existing file would be replaced or dropped (the generated
|
|
316
|
+
file replaces the whole file).
|
|
317
|
+
- `/rolegroup init --write --force`: overwrite, after backing the existing file up to `<path>.bak-<timestamp>`.
|
|
215
318
|
- Bare `/rolegroup` or an unknown subcommand: print usage.
|
|
216
319
|
|
|
320
|
+
> On a fresh machine, run `/rolegroup init` first to see which routes actually work, then decide whether to
|
|
321
|
+
> `--write`. The generated file overrides only the unavailable roles and keeps each fallback chain.
|
|
322
|
+
|
|
217
323
|
Note: pasting text starting with `/` into the GUI composer sends it as a normal message, not a command. Type
|
|
218
324
|
it by hand or pick it from the completion list.
|
|
219
325
|
|
|
@@ -255,7 +361,7 @@ fails to activate goes into `invalid[]` and is not registered.
|
|
|
255
361
|
```sh
|
|
256
362
|
npm run link:deps # first after cloning: create the schemastery symlink
|
|
257
363
|
npm install # then install the esbuild devDependency
|
|
258
|
-
npm test # offline smoke suite,
|
|
364
|
+
npm test # offline smoke suite, 156 cases; pretest runs link:deps
|
|
259
365
|
npm run build:client # after editing src/client/** or lib/roles.js
|
|
260
366
|
```
|
|
261
367
|
|
|
@@ -306,6 +412,28 @@ Preset name (the header role label reads e.g. `角色:scout · deepseek-flash`
|
|
|
306
412
|
(the task title, e.g. `Login validation · kimi-coding/k3`). A dedicated model chip requires upstream subagent UI
|
|
307
413
|
support.
|
|
308
414
|
|
|
415
|
+
**Want an image-understanding role?**
|
|
416
|
+
Custom roles are supported — add one to `rolegroup.jsonc` (or the panel):
|
|
417
|
+
|
|
418
|
+
```jsonc
|
|
419
|
+
{
|
|
420
|
+
"roles": {
|
|
421
|
+
"looker": {
|
|
422
|
+
"provider": "opencode-go",
|
|
423
|
+
"model": "qwen3.7-plus",
|
|
424
|
+
"summary": "Images: screenshots, UI, charts, error shots",
|
|
425
|
+
"persona": "You are looker, a vision role. Open the given image path with read_image and return a structured description (layout, text, colors, anomalies). Read-only; say when you cannot see clearly instead of guessing.",
|
|
426
|
+
"fallbackModels": ["deepseek-official/deepseek-flash"]
|
|
427
|
+
}
|
|
428
|
+
}
|
|
429
|
+
}
|
|
430
|
+
```
|
|
431
|
+
|
|
432
|
+
Three catches: the image must be a **file on disk** (the parent puts the path in the brief; the child opens it
|
|
433
|
+
with `read_image`); keep text-only models (e.g. `deepseek-v4-pro`) out of the fallback chain or the degraded
|
|
434
|
+
route cannot see images; the model itself must accept image input (Qwen3.7 Plus / Qwen3.8 Flash / Kimi K3.1 Pro /
|
|
435
|
+
DeepSeek V4.1 Flash all do).
|
|
436
|
+
|
|
309
437
|
**I switched the session mode (PTC / minimal / creative). Why does the role tool surface stay the same?**
|
|
310
438
|
Role sub-sessions are based on your default mode, not on the per-session mode. If you only use the standard
|
|
311
439
|
mode, there is no difference.
|
package/README.md
CHANGED
|
@@ -6,7 +6,7 @@ dsh 的角色化委派插件。先定义角色(名字、绑定模型、persona
|
|
|
6
6
|
角色/类别绑定的思路参考了 [oh-my-openagent](https://github.com/code-yeongyu/oh-my-openagent)(omo),
|
|
7
7
|
详见 §10。
|
|
8
8
|
|
|
9
|
-
> 版本 **0.
|
|
9
|
+
> 版本 **0.8.0** | 要求 dsh **≥ 0.2.1-rc.1**(本机实测 0.2.1-rc.3)| MIT
|
|
10
10
|
|
|
11
11
|
---
|
|
12
12
|
|
|
@@ -28,6 +28,21 @@ dsh 的角色化委派插件。先定义角色(名字、绑定模型、persona
|
|
|
28
28
|
- 角色就是工具名。`analyst`、`coder`、`scout` 直接出现在工具列表里,委派时不用想模型。
|
|
29
29
|
- 能查。`/rolegroup doctor` 会列出当前每个角色实际用的模型和可用性(见 §6)。
|
|
30
30
|
|
|
31
|
+
### 边界:我们明确不做什么
|
|
32
|
+
|
|
33
|
+
在 dsh 这种「一切插件化」的生态里,专注是一种选择,也是一条红线。以下是**刻意不做**的(每条都是
|
|
34
|
+
设计决策,不是尚未实现):
|
|
35
|
+
|
|
36
|
+
| 不做 | 为什么 |
|
|
37
|
+
|---|---|
|
|
38
|
+
| **不做编排**(DAG / 多轮协作 / 团队流水线) | 那是官方智能体团队的职责;两套编排会互相踩 |
|
|
39
|
+
| **不注册 MCP server** | 几十个工具会把工具列表、权限面、prompt 预算一起撑大 |
|
|
40
|
+
| **不写项目级状态目录**(`.rolegroup/`) | 我们做的是「路由」,不是「运行时状态机」;状态属于编排层 |
|
|
41
|
+
| **不接管主会话的会话模式(Agent Preset)** | 显式 preset 是**替换**父组合(§4),接管等于替用户做选择 |
|
|
42
|
+
| **不为旧 dsh 线保留双形态分支** | v0.6 起只支持 ≥0.2.1;旧线明确报错而不是半残运行 |
|
|
43
|
+
|
|
44
|
+
需要编排、状态、MCP 工具链时,请组合其它插件——它们与本插件互不替代。
|
|
45
|
+
|
|
31
46
|
## 2. 快速开始
|
|
32
47
|
|
|
33
48
|
### 官方插件管理器
|
|
@@ -80,28 +95,42 @@ home 层不会被 profile 重写覆盖,但不会出现在「已安装」组,
|
|
|
80
95
|
dsh --profile web --dump-config | grep -A1 dsh-rolegroup # 应出现 - id: dsh-rolegroup
|
|
81
96
|
```
|
|
82
97
|
|
|
83
|
-
重启 `dsh web`,开一个新会话。工具列表里应该出现
|
|
98
|
+
重启 `dsh web`,开一个新会话。工具列表里应该出现 8 个角色工具;也可以在新会话里跑
|
|
84
99
|
`/rolegroup doctor`。
|
|
85
100
|
|
|
86
101
|
改代码或 `rolegroup.jsonc` 后需要重启并开新会话。面板保存怎么生效,见 §5。
|
|
87
102
|
|
|
88
103
|
## 3. 内置角色
|
|
89
104
|
|
|
90
|
-
没有任何配置时,插件会注册这
|
|
91
|
-
|
|
105
|
+
没有任何配置时,插件会注册这 8 个角色。下表是内置初值,可以被 `rolegroup.jsonc` 或面板覆盖。
|
|
106
|
+
|
|
107
|
+
表里只写**模型名称**:同一个模型往往有多条路由(订阅套餐、按量计费、聚合网关),具体 provider 由你的配置
|
|
108
|
+
决定。内置默认绑定指向内置表里的 provider(作者的订阅),在你的机器上可用 `/rolegroup init` 生成一套本机
|
|
109
|
+
可用的路由,或在面板里直接改。模型 ID 与实际生效路由以 `/rolegroup doctor` 为准。
|
|
92
110
|
|
|
93
111
|
| 角色 | 内置绑定模型 | 职责 |
|
|
94
112
|
|---|---|---|
|
|
95
|
-
| `analyst` |
|
|
96
|
-
| `planner` |
|
|
97
|
-
| `coder` |
|
|
98
|
-
| `reviewer` |
|
|
99
|
-
| `scout` |
|
|
100
|
-
| `scribe` |
|
|
101
|
-
| `
|
|
113
|
+
| `analyst` | Qwen3.8 Max | 需求澄清、路径分类、方案评审(做不做/怎么做)、架构决策 |
|
|
114
|
+
| `planner` | Kimi K3 | 计划设计:文件结构、任务拆分、接口契约、`plans.md` 落笔 |
|
|
115
|
+
| `coder` | Kimi K3 | 编码执行:按 `plans.md` 步骤 TDD 红-绿-重构 |
|
|
116
|
+
| `reviewer` | Qwen3.8 Max | 收口审查:逐项核对验收标准与证据(做没做到) |
|
|
117
|
+
| `scout` | DeepSeek V4.1 Flash | 探索定位、批量搜索(返回 `文件:行号` 证据) |
|
|
118
|
+
| `scribe` | Qwen3.8 Flash | 文档回填、报告、spec 维护 |
|
|
119
|
+
| `vision` | Qwen3.8 Flash | 看图:图片分析、UI 评审、原型识别、OCR(**要求绑定模型支持图片输入**) |
|
|
120
|
+
| `fallback` | DeepSeek V4.1 Flash | 未分类的轻量任务兜底 |
|
|
121
|
+
|
|
122
|
+
> **`vision` 的选型依据**(不是推断):① 作者在 omo 里长期用 `qwen3.8-flash` 做图片分析/UI 评审;
|
|
123
|
+
> ② 本项目委托链路探针(`evals` 的 `scout-02`,子会话跑像素字体 OCR)中 `qwen3.8-flash` 得 10/10,
|
|
124
|
+
> 而同批 `MiniMax-M3` 只有 4/10 且**编造**了候选字符串——所以它的备用链只放 `deepseek-flash`(同样 10/10
|
|
125
|
+
> 且是唯一保证注册的 provider),`M3` 明确排除、`v4-pro` 因视觉未测也不放。
|
|
126
|
+
>
|
|
127
|
+
> **怎么用**:委派只能传文字,所以把**图片路径**写进简报,例如
|
|
128
|
+
> 「用 vision 分析 `/tmp/ui.png`,检查间距与对比度」。角色会自己调 `read_image`。
|
|
129
|
+
> 上游没有「视觉能力位」,插件**无法在启动期校验**模型是否支持图片——换成自己的模型后,
|
|
130
|
+
> 先用一张含明确文字的图跑一次,能正确读出文字即视为可用。
|
|
102
131
|
|
|
103
132
|
每个角色由一个委派工具实例和一个自动生成的 Agent Preset 组成。Preset 复制你默认会话模式的组合,
|
|
104
|
-
换掉 persona,再去掉委派组。所以「设置 → Agent 预设」里会看到
|
|
133
|
+
换掉 persona,再去掉委派组。所以「设置 → Agent 预设」里会看到 8 个「角色:xxx · 模型」。这些 preset 是自动
|
|
105
134
|
生成的,不要删除或改名,也不要把主会话选成它们。
|
|
106
135
|
|
|
107
136
|
## 4. 配置
|
|
@@ -124,6 +153,7 @@ dsh --profile web --dump-config | grep -A1 dsh-rolegroup # 应出现 - id: dsh
|
|
|
124
153
|
"provider": "qwen-token-plan-cn", // 可省略,继承内置表的 provider
|
|
125
154
|
"model": "qwen3.8-flash",
|
|
126
155
|
"reasoningEffort": "medium", // 可选,留空用模型默认档位
|
|
156
|
+
"fallbackModels": ["deepseek-official/deepseek-flash"], // 可选,主路由不可用时按顺序试
|
|
127
157
|
"persona": "file://./personas/analyst.md", // 可选,file:// 外链(相对本文件)或内联字符串
|
|
128
158
|
"summary": "需求澄清与方案评审" // 可选,一句话职责
|
|
129
159
|
}
|
|
@@ -131,8 +161,32 @@ dsh --profile web --dump-config | grep -A1 dsh-rolegroup # 应出现 - id: dsh
|
|
|
131
161
|
}
|
|
132
162
|
```
|
|
133
163
|
|
|
134
|
-
角色名就是 JSON 的 key。每个角色可以写 `provider`、`model`、`reasoningEffort
|
|
135
|
-
|
|
164
|
+
角色名就是 JSON 的 key。每个角色可以写 `provider`、`model`、`reasoningEffort`(可选)、
|
|
165
|
+
`fallbackModels`(可选)、`persona`(可选)、`summary`(可选)。`reasoningEffort` 必须是模型支持的档位;
|
|
166
|
+
留空就用模型默认(见 §5)。
|
|
167
|
+
|
|
168
|
+
### 备用模型链
|
|
169
|
+
|
|
170
|
+
内置表里,绑定了非 `deepseek-official` 的角色都带一条备用链,所以新机器上没有 qwen / Kimi 订阅时也不会
|
|
171
|
+
整片失效:
|
|
172
|
+
|
|
173
|
+
```jsonc
|
|
174
|
+
"analyst": {
|
|
175
|
+
"provider": "qwen-token-plan-cn",
|
|
176
|
+
"model": "qwen3.8-max",
|
|
177
|
+
"fallbackModels": ["deepseek-official/deepseek-flash", "deepseek-official/deepseek-v4-pro"]
|
|
178
|
+
}
|
|
179
|
+
```
|
|
180
|
+
|
|
181
|
+
内置链一律**便宜档优先**(`deepseek-flash` → `deepseek-v4-pro`),v4-pro 只作为 flash 也不可用时的最后兜底。
|
|
182
|
+
启动时按「主路由 → 备用链」的顺序挑第一个 provider 已注册、模型在广告列表的路由;用了备用档会在启动
|
|
183
|
+
日志和 `/rolegroup doctor` 里明确写出来(`⚠️ analyst:主路由 … 不可用,已用内置备用档 …`)。
|
|
184
|
+
|
|
185
|
+
**显式配置不自动降级**:只要某个角色出现在你的 `rolegroup.jsonc`(或面板保存过),插件就严格按你写的
|
|
186
|
+
路由执行,不会偷偷换成备用档——真不可用时该角色不注册,doctor 给出可执行提示。想让它有备用档,就把
|
|
187
|
+
`fallbackModels` 一并写进那条角色配置。
|
|
188
|
+
|
|
189
|
+
目前备用链只从配置文件读;设置面板不编辑它(面板保存还会接管整层,链不会跟着搬过去)。
|
|
136
190
|
|
|
137
191
|
### 和面板的优先级
|
|
138
192
|
|
|
@@ -152,10 +206,17 @@ dsh --profile web --dump-config | grep -A1 dsh-rolegroup # 应出现 - id: dsh
|
|
|
152
206
|
|
|
153
207
|
### 运行时
|
|
154
208
|
|
|
155
|
-
-
|
|
156
|
-
|
|
209
|
+
- 启动时检查路由:按「主路由 → 备用链」挑第一个 provider 已注册、模型在广告列表的路由。内置角色都带链,
|
|
210
|
+
所以没有 qwen / Kimi 订阅时也能跑;**显式配置的角色不自动降级**,provider 不在册就不注册,日志和
|
|
211
|
+
doctor 给出修复提示。模型不在可用列表里只警告,委派时再校验。
|
|
157
212
|
- `maxDepth` 是 1:主会话可以委派,角色子代理不能再委派。配成 0 会把顶层委派也挡掉。
|
|
213
|
+
实现细节(实测,别误解):角色 preset 剔除了**委派组**,所以子会话里看不到 `subagent` /
|
|
214
|
+
`subagent_fork` / `workflow`;但 8 个**角色工具是 host 平面**注册的,子会话的工具列表里仍能看到它们,
|
|
215
|
+
调用会在运行期被 `maxDepth` 拒绝。上游 0.2.1 移除了 `toolFilter`,插件无法把 host 工具从子会话隐藏——
|
|
216
|
+
这是已知限制(噪音,不是逃逸)。
|
|
158
217
|
- 改 `rolegroup.jsonc` 不会热生效,需要重启并开新会话。面板保存对新会话生效(见 §5)。
|
|
218
|
+
- 备用链只在**启动期**解析:dsh 的角色工具在注册时就固定了模型,所以链是「启动挑一条」,不是 omo 那种
|
|
219
|
+
运行时按 429 切换;`llm/adapters-updated` 会让插件重组装并重新解析。
|
|
159
220
|
- 委派会立即返回 subagent id,任务完成后收到通知,不用轮询。
|
|
160
221
|
|
|
161
222
|
`readonly` 是废弃字段。老配置里如果还写着,会收到迁移提示,但不会生效。只读请用会话级 permission
|
|
@@ -167,13 +228,29 @@ persona 表达。
|
|
|
167
228
|
在「设置 → 角色配置」里编辑角色和模型绑定:增删角色、改 provider/model、persona/summary、推理档位,
|
|
168
229
|
底部有保存、放弃、重置为文件配置。
|
|
169
230
|
|
|
231
|
+
如果某些角色的 provider 在本机未注册,面板顶部会提示「N 个角色的 provider 在本机未注册」,并提供
|
|
232
|
+
「按当前可用模型补齐」:把这几行改成部署默认路由(没有默认路由时取第一个可用模型),只改草稿,
|
|
233
|
+
你仍需点「保存」才生效。
|
|
234
|
+
|
|
170
235
|
面板不会自动接管。未接管时,它先读取当前生效表(jsonc 或内置表)并预填;你改过之后保存按钮才可用。
|
|
171
236
|
保存会写入 `enabled=true` 和整张表,从此由面板接管。读取失败时,面板降级为空表,可以手动新增,页内
|
|
172
237
|
会给出错误和重试。想退出接管,点「重置为文件配置」,它会清掉这两个字段。
|
|
173
238
|
|
|
239
|
+
**接管后,面板显示的是整张生效表**:内置表里有、但你的覆盖表里没有的角色(例如后来版本新增的内置
|
|
240
|
+
角色),会自动补成普通行(带内置路由与备用链),可以像其它行一样编辑。内置角色的行**没有删除按钮**
|
|
241
|
+
(因为 `mergeRoles` 恒以内置表为底,删掉只会回落内置),自定义行可以删除。
|
|
242
|
+
|
|
243
|
+
保存时**每行都会带上 `fallbackModels`**(面板不提供编辑入口,但会原样回传)。这一点很关键:面板保存 =
|
|
244
|
+
显式配置,而显式配置**不继承**内置链——不回传就等于把降级能力弄丢(主路由不可用时会被直接剪枝)。
|
|
245
|
+
|
|
174
246
|
面板顶部显示插件名和版本号,右上角有 GitHub 链接。「配置文件」按钮会在右侧栏的文档预览里打开当前
|
|
175
247
|
生效的 `rolegroup.jsonc`,打开前会先关掉设置面板,好让右侧栏露出来。没有配置文件时,页内给一行提示,
|
|
176
|
-
|
|
248
|
+
不弹窗。改了 host 侧代码,要重启 `dsh web` 才会生效。
|
|
249
|
+
|
|
250
|
+
> **接口暴露面(明示)**:`GET|HEAD /api/dsh-rolegroup/config`——**仅回环可访问、无认证、只读**,
|
|
251
|
+
> 返回的是启动时读入的**内存快照**(项目/用户 `rolegroup.jsonc` 二者之一),**不按请求参数读盘**,
|
|
252
|
+
> 因此没有任意文件读取/路径穿越面。能连到本机回环的进程本来就能读 `~/.dsh`,此接口不额外扩大信任面;
|
|
253
|
+
> 多用户或不可信本机环境请确保 dsh web 只监听回环(默认如此)。响应带 `nosniff`,不可被 `<script>` 引用执行。
|
|
177
254
|
|
|
178
255
|
推理档位可以留空,留空就用模型默认档位(比如 Kimi K3 默认 `high`)。档位越高,通常越慢、越贵,但推理
|
|
179
256
|
更充分。下拉里的选项来自模型目录,只列这个模型支持的档位。填了不支持的值会标红,保存也会被拦住;
|
|
@@ -187,11 +264,23 @@ persona 表达。
|
|
|
187
264
|
## 6. 诊断
|
|
188
265
|
|
|
189
266
|
`/rolegroup doctor` 会读取 `$DSH_HOME/plugins/dsh-rolegroup/last-startup.json` 快照,再和运行时的 llm
|
|
190
|
-
服务比对,逐项列出角色名、绑定模型、provider
|
|
267
|
+
服务比对,逐项列出角色名、绑定模型、provider 和模型是否可用;有异常时附上修复建议。内置备用档生效时,
|
|
268
|
+
doctor 会写明「主路由 X 不可用,已用内置备用档 Y」。
|
|
191
269
|
|
|
192
270
|
- `/rolegroup doctor`:诊断。
|
|
271
|
+
- `/rolegroup init`:按本机**实际可用**的路由,打印一份只覆盖「主路由不可用」角色的起始配置(不落盘),
|
|
272
|
+
并显示当前生效层(面板 / 项目 jsonc / 用户 jsonc / 内置表)。
|
|
273
|
+
- `/rolegroup init --write`:写入用户级 `$DSH_HOME/rolegroup.jsonc`;已存在则拒绝。
|
|
274
|
+
**面板已接管或项目级配置存在时会拒绝**——这两种情况下写文件不会生效。
|
|
275
|
+
- `/rolegroup init --write --project`:写入项目级 `<cwd>/.dsh/rolegroup.jsonc`;若当前生效的是用户级配置,
|
|
276
|
+
会提示新文件将遮蔽它。
|
|
277
|
+
- `/rolegroup init --diff`:显示已有文件里哪些角色会被覆盖、哪些会被丢弃(生成的是整份文件)。
|
|
278
|
+
- `/rolegroup init --write --force`:确认覆盖;覆盖前自动备份为 `<路径>.bak-<时间戳>`。
|
|
193
279
|
- 裸 `/rolegroup` 或未知子命令:显示用法。
|
|
194
280
|
|
|
281
|
+
> 新机器上第一次用,建议先跑 `/rolegroup init` 看看本机能跑哪些模型组合,再决定是否 `--write`。
|
|
282
|
+
> 生成的配置只覆盖不可用的角色,其余继续走内置表;每条都保留了备用链。
|
|
283
|
+
|
|
195
284
|
注意:在 GUI 输入框里粘贴以 `/` 开头的文本,会当成普通消息发出去,不会触发命令。请手动输入,或者从
|
|
196
285
|
补全列表里点。
|
|
197
286
|
|
|
@@ -231,7 +320,7 @@ fallback deepseek-official/deepseek-flash ✅ ✅
|
|
|
231
320
|
```sh
|
|
232
321
|
npm run link:deps # 首次 clone 后先跑:建 schemastery 软链
|
|
233
322
|
npm install # 再装 devDependency esbuild
|
|
234
|
-
npm test # 离线 smoke test,
|
|
323
|
+
npm test # 离线 smoke test,156 项;pretest 会自动跑 link:deps
|
|
235
324
|
npm run build:client # 改了 src/client/** 或 lib/roles.js 后重建 lib/client.js
|
|
236
325
|
```
|
|
237
326
|
|
|
@@ -276,6 +365,27 @@ DSH 的子代理页没有独立的模型 chip。本插件把模型写进两个
|
|
|
276
365
|
会显示 `角色:scout · deepseek-flash`)和委派 `description`(任务标题,如 `登录校验实现 · kimi-coding/k3`)。
|
|
277
366
|
要像 Agent Teams 那样单独显示模型 chip,需要上游子代理 UI 支持。
|
|
278
367
|
|
|
368
|
+
**想加一个「看图」角色?**
|
|
369
|
+
插件支持自定义角色,加到 `rolegroup.jsonc`(或面板)即可:
|
|
370
|
+
|
|
371
|
+
```jsonc
|
|
372
|
+
{
|
|
373
|
+
"roles": {
|
|
374
|
+
"looker": {
|
|
375
|
+
"provider": "opencode-go",
|
|
376
|
+
"model": "qwen3.7-plus",
|
|
377
|
+
"summary": "看图:截图、UI、图表、报错画面",
|
|
378
|
+
"persona": "你是 looker——视觉理解角色。用 read_image 打开给定路径的图片,返回结构化描述(布局、文字、颜色、异常)。只读;看不清就说看不清,不猜。",
|
|
379
|
+
"fallbackModels": ["deepseek-official/deepseek-flash"]
|
|
380
|
+
}
|
|
381
|
+
}
|
|
382
|
+
}
|
|
383
|
+
```
|
|
384
|
+
|
|
385
|
+
注意三点:图片必须是**磁盘上的文件**(父模型把路径写进任务简报,子会话用 `read_image` 打开);
|
|
386
|
+
备用链里不要放纯文本模型(例如 `deepseek-v4-pro`),否则降级后看不了图;模型本身要支持图片输入
|
|
387
|
+
(Qwen3.7 Plus / Qwen3.8 Flash / Kimi K3.1 Pro / DeepSeek V4.1 Flash 都可以)。
|
|
388
|
+
|
|
279
389
|
**我换了会话模式(PTC / 最小 / 创造),角色工具面为什么不变?**
|
|
280
390
|
角色子会话的基底是你的默认模式,不跟随单会话选择的模式。只用标准模式时没有区别。
|
|
281
391
|
|