dsh-subagent-library 0.3.6 → 0.4.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 CHANGED
@@ -8,32 +8,23 @@
8
8
 
9
9
  <p align="center">
10
10
  <img src="https://img.shields.io/github/actions/workflow/status/MaRi23333/dsh-subagent-library/ci.yml?style=flat-square&label=CI" alt="CI" />
11
- <img src="https://img.shields.io/github/license/MaRi23333/dsh-subagent-library?style=flat-square" alt="License: MIT" />
12
- <img src="https://img.shields.io/badge/DeepSeek%20Harness-0.2.1--rc.2-4d6bfe?style=flat-square" alt="DeepSeek Harness 0.2.1-rc.2" />
11
+ <img src="https://img.shields.io/github/license/MaRi23333/dsh-subagent-library?style=flat-square" alt="License: Apache-2.0" />
12
+ <img src="https://img.shields.io/badge/DeepSeek%20Harness-0.2.2--rc.5-4d6bfe?style=flat-square" alt="DeepSeek Harness 0.2.2-rc.5" />
13
13
  </p>
14
14
 
15
- ## Overview
15
+ ## Save a group for work you do often
16
16
 
17
- A named subagent roster plugin for the [DeepSeek Harness](https://github.com/deepseek-ai/deepseek-harness) (DSH) desktop and Web interfaces: turn your recurring roles (code review, red team, multimodal understanding…) into a persistent named roster with model, role prompt, depth and background-mode settings. Then **just tell the main agent "do this with xxx"** — the model picks and dispatches through two tools by itself:
17
+ When you review an announcement, you might want one assistant to spot missing details and another to suggest a rewrite. Save those roles, their assignments, and any shared instructions as a group. The next time you have an announcement, give it to the main agent and ask for that group by name.
18
18
 
19
- - `list_subagents` — lists roster entries (id / role description / model) so the model can pick a suitable one;
20
- - `delegate` — dispatches work by `library_id`: foreground wait, background one-shot, or a continuable (resumable) subagent, per the entry's configuration.
19
+ > Ask the review group to look at “The meeting has moved to Friday afternoon.” Have `grok-reviewer` use its default model to flag missing information. For this task, have `glm-adversary` use DeepSeek Flash to suggest a one-sentence rewrite.
21
20
 
22
- Available in every conversation (any agent preset), **no slash command needed**; the `/subagent` command is only for humans to peek at the roster in the command palette.
21
+ ![Two members dispatched in the same turn. Grok 4.7 flags the missing start time. The other role uses DeepSeek Flash for this dispatch and suggests a rewrite.](./assets/readme/group-dispatch.png)
23
22
 
24
- Adding entries needs no hand-written config either: ask the main agent to do it, or edit visually in the settings page. Since 0.3 the roster is stored as **one YAML file per named subagent** (default directory `~/.dsh/subagents/`), hot-reloaded, comment-friendly and versionable per file.
23
+ **Choose a model for one assignment.** Whether you name a role directly or pick a member from a group, you can ask for a model authorized in the current session. The role keeps its usual model for future dispatches.
25
24
 
26
- > Distinction from the official capabilities: the official `subagent` tool dispatches ad-hoc tasks (you describe the task each time), and the official `list_agents` lists *running* child instances; this plugin maintains a **persistent named roster** (edited visually in a settings page, hot-reloaded). The model picks an entry with `list_subagents` and dispatches by id with `delegate`.
25
+ Groups work with Agent Teams switched off. The main agent dispatches one member per call. It can start independent assignments in the same turn or wait for one member’s findings and pass them to the next. Enabling Agent Teams also gives members access to the host’s shared task board.
27
26
 
28
- > **Upgrading from 0.2.x?** Since 0.3 the roster is directory-backed (one YAML file per subagent). Your legacy config **migrates automatically**; after verifying it, clear the old `entries` section for your host generation. [MIGRATION.md](./MIGRATION.md) documents the config locations, failure/retry behavior, and rollback limits; [CHANGELOG.md](./CHANGELOG.md) lists all changes.
29
-
30
- [Install](#install) · [Your first delegation](#your-first-delegation) · [Configuration reference](#configuration)
31
-
32
- ## Host and desktop compatibility
33
-
34
- **0.3.5 targets DSH `0.2.1-rc.2`:** fixes startup failures for continuable and one-shot subagents, and cancellation that failed to stop background children. Foreground one-shot, continuable, background startup and cancellation of running jobs have been checked on that desktop host. See [Configuration](#configuration) for role-prompt and tool-filter limitations, and [CHANGELOG.md](./CHANGELOG.md) for the full update.
35
-
36
- The desktop client uses the Web plugin UI, so no separate desktop-specific package is needed. The legacy start paths remain, but this release's live checks target `0.2.1-rc.2`; model calls still depend on each provider's configuration and service. Roster directories, profile routes and migration rules are unchanged, so no new migration is needed.
27
+ Version 0.4.0 targets DSH `0.2.2-rc.5` and requires native subagents that can be addressed by name for follow-up messages. To upgrade from an earlier version, see the [migration guide](./MIGRATION.md) and [changelog](./CHANGELOG.md).
37
28
 
38
29
  ## Install
39
30
 
@@ -46,7 +37,7 @@ Desktop and Web have separate plugin installations and activation states; instal
46
37
  3. Click **Enable now** when installation finishes. Closing the completed-install dialog leaves the plugin disabled.
47
38
  4. Restart only if the UI asks you to: fully exit with **Quit** in the application menu, then reopen the app. Closing a window may only hide it.
48
39
 
49
- Once enabled, find **子代理库 (Subagent Library)** in Settings; the top of the page shows entry counts and the roster directory.
40
+ Once enabled, open **子代理库 (Subagent Library)** in Settings and choose the role roster or groups tab. The storage and backup section shows the roster directory.
50
41
 
51
42
  <details>
52
43
  <summary>Alternative: use the desktop-bundled CLI (Windows / macOS)</summary>
@@ -95,179 +86,74 @@ dsh plugin --profile web add /absolute/path/to/dsh-subagent-library
95
86
 
96
87
  ## Your first delegation
97
88
 
98
- Start with a main conversation whose model already replies normally. This example uses that session's model to reorganize supplied text; it needs no separate provider setup or file/web tools. The settings UI currently uses Chinese labels; their English meanings are given below.
99
-
100
- ### 1. Create a minimal role
101
-
102
- Without existing roster files or legacy configuration, the roster starts empty. The plugin does not add sample roles automatically.
89
+ Open the Subagent Library in Settings, switch to the role roster, and create a role with ID `text-helper` and a description. Leave the route empty to use the session model. You can also create the equivalent `text-helper.yaml` in the roster directory (default `~/.dsh/subagents/`).
103
90
 
104
- 1. Open **Settings → 子代理库 (Subagent Library)**. An empty roster shows the creation form immediately; otherwise click **+ 新增子代理 (Add subagent)**.
105
- 2. Set **ID** to `text-helper` and **描述(模型可见) (Description, visible to the model)** to `Organize short text supplied by the main conversation.` If that ID already exists, choose an unused one and replace it in the example below too.
106
- 3. Leave **模型 (Model), Provider, 角色提示词 (Role prompt), 禁用工具 (Denied tools), and the other optional fields blank**. Keep **后台模式 (Background mode)** at `one-shot`, then click **创建子代理 (Create subagent)**. This button saves immediately and enables the new entry; no second save is needed.
107
-
108
- ### 2. Ask the main agent to list and delegate
109
-
110
- Back in the main conversation, send:
111
-
112
- ```text
113
- Call list_subagents first and confirm that text-helper is available. Then use delegate to give it this task in the foreground:
114
- Turn "apple, banana, pear" into a numbered list, keeping that order. Use only this text and do not call other tools.
115
- Pass the subagent's result back to me.
91
+ ```yaml
92
+ description: Organize text supplied by the parent.
93
+ persona: Preserve proper names from the source.
116
94
  ```
117
95
 
118
- Look for `text-helper` in the `list_subagents` result, followed by a `delegate` call returning the child's numbered list. A direct answer from the main agent without a delegation call does not confirm that this flow worked. `/subagent` can display the roster, but does not perform the delegation.
119
-
120
- Delegation still calls the model service. "Do not call other tools" is a task instruction; the host controls tool permissions. Per-entry `toolFilter` is unavailable on DSH 0.2.1, and a role name or prompt does not guarantee read-only access. See the [configuration limitations](#configuration).
96
+ Ask the main agent to call `list_subagents()`, then `delegate({library_id:"text-helper", prompt:"Number apple, banana and pear in their original order."})`. The receipt's `name` addresses the native member. The parent receives the result separately. You can also manage roles in Settings.
121
97
 
122
- ### 3. If it does not work
98
+ ## Groups and slots
123
99
 
124
- - **Entry missing:** confirm you clicked **创建子代理 (Create subagent)**, then use **刷新 (Refresh)** in Settings and check diagnostics. If the entry is disabled, switch it to **已启用 (Enabled)** and save.
125
- - **Tools missing:** confirm the plugin is enabled in the desktop or Web instance you are using, then check tool availability for the current conversation.
126
- - **Model startup fails:** first check that the main conversation can reply; leave both Provider and Model blank on the entry. Gray placeholder examples are not your configured routes. Follow the actual error for service authentication or quota issues.
100
+ Open the Groups tab, create a group with an ID and description, then select a role and give each member a unique code. A role can appear more than once, with a different assignment for each member. Save the group to make it available for dispatch.
127
101
 
128
- <details>
129
- <summary>Optional: create the same minimal role with YAML</summary>
102
+ ![The Groups tab in Settings shows an enabled two-member review group.](./assets/readme/group-settings.png)
130
103
 
131
- Use either this file method or the UI steps above. Create `text-helper.yaml` in the roster directory shown in Settings (create the directory if needed; do not overwrite an existing entry):
104
+ To define the `facts` and `questions` example in YAML, use `_groups/text-review.yaml` under the roster directory. The YAML field `slot` holds the member code.
132
105
 
133
106
  ```yaml
134
- description: Organize short text supplied by the main conversation.
107
+ description: Extract facts and open questions from supplied material.
108
+ instructions: Include the source for each finding.
109
+ members:
110
+ - slot: facts
111
+ role: text-helper
112
+ assignment: Extract facts supported by the source.
113
+ - slot: questions
114
+ role: text-helper
115
+ assignment: Identify missing information.
135
116
  ```
136
117
 
137
- The filename supplies the ID. Omitting the other fields keeps the entry enabled and uses the session's model. Changes take effect without a restart. See [Configuration](#configuration) for more fields.
138
-
139
- </details>
140
-
141
- ## Screenshots
142
-
143
- <p align="center">
144
- <img src="./assets/readme/screenshot-settings.png" width="75%" alt="Subagent Library settings: layered, collapsible cards and roster filtering" /><br>
145
- <em>Cards start collapsed for a quick view of roles, models and execution settings. Filter and expand to edit; enable-state changes take effect after saving.</em>
146
- </p>
147
-
148
- <p align="center">
149
- <img src="./assets/readme/screenshot-command-palette.png" alt="The /subagent command in the command palette" /><br>
150
- <em>The <code>/subagent</code> command (quick roster viewer)</em>
151
- </p>
152
-
153
- <p align="center">
154
- <img src="./assets/readme/screenshot-roster.png" width="75%" alt="/subagent output: the named subagent roster" /><br>
155
- <em>Roster output example: one-line role description + model route + continuable marker per entry</em>
156
- </p>
157
-
158
- ## Settings page
118
+ | Action | Tool call |
119
+ | --- | --- |
120
+ | Browse groups | `list_subagents({kind:"groups"})` |
121
+ | Inspect member keys, model settings and assignments | `list_subagents({group_id:"text-review"})` |
122
+ | Dispatch one member | `delegate({group_id:"text-review", slot:"facts", prompt:"Check the paragraph above."})` |
159
123
 
160
- A **子代理库 (Subagent Library)** page appears under Settings. **Each entry is a card, closed by
161
- default**; click its name to open the editor.
124
+ Browsing starts zero agents. The `questions` slot starts only on a separate call selecting it. A direct dispatch sends the role persona and task. A group dispatch also includes group instructions and the selected slot's assignment in the child's first message. Each start resolves the current role and profile route. Existing children keep their own sessions. Use `/subagent` to inspect the roster and groups from the command palette.
162
125
 
163
- - **Layered cards** separate the name and enable switch, a description of up to two lines,
164
- the model and provider, and a wrapping group of execution settings. Long names and model
165
- routes wrap without squeezing the description or hiding the switch.
166
- - A **summary band** stays at the top of the page: entry / enabled / disabled / unsaved counts
167
- plus the roster directory.
168
- - A **filter box** matches id, description, model and more; Expand/collapse all helps in a long
169
- roster.
170
- - **Expanded**, fields are grouped as Overview (description) / Routing & execution (provider,
171
- model, transport, background mode, reasoning effort, depth, output cap) / Tools & prompt
172
- (denied tools, persona), with Revert / Delete / Save at the bottom. Fields use two columns
173
- in wider panels and one in narrow panels, with host light/dark themes and keyboard support.
174
- - Toggling enable state creates a draft. The collapsed card exposes an unsaved badge and
175
- Revert / Save changes; the setting takes effect only after saving. Saving one entry does
176
- not submit other drafts, and Revert restores the entire saved entry.
177
- - Disabled entries appear last; entries marked as legacy are promoted to files on save.
178
- Storage and backup details are available in a disclosure at the bottom of the page.
126
+ Use `/subagent groups text-review` to see which members have a configured model and which inherit the parent model. A role can inherit the model and set its own reasoning effort. After dispatch, the native subagent menu and `list_agents` show the launch model and known effort in the member description, for example `text-review/facts [model-a · high]`. Expand the `delegate` receipt for the full `provider`, `model` and `reasoningEffort` values when available.
179
127
 
180
- Saved changes are written back to `<id>.yaml` in the roster directory and hot-reloaded.
128
+ To change the model for one dispatch, open Plugins in the DSH sidebar, open the built-in Subagent configuration and enable Model selection. Select the allowed models, save, and start a new parent session. Ask the parent to use the role default for one member and an authorized model for the other. It can discover choices with the native `list_subagent_models` tool and pass both `provider` and `model` to `delegate`. The optional `reasoning_effort` selects an effort for that model. Omitting it uses the selected model's default. Subsequent dispatches use the saved role settings again.
181
129
 
182
- > **Security note:** the roster settings endpoint (`/subagent-library/api`) follows the
183
- > DSH Web Host's local trust boundary — the plugin itself adds no separate authentication
184
- > layer. If you bind DSH Web to a LAN, the public internet, or a reverse proxy, put proper
185
- > authentication and access control in front of it; do not expose this endpoint to
186
- > untrusted clients — subagent personas and configuration may contain internal working rules.
130
+ In a session without a recorded allowlist, an explicit selection is limited to the current parent provider and model. On a host that cannot read authorization, dispatch with the saved role settings remains available. Agent Teams is optional.
187
131
 
188
- ## Configuration
132
+ ## Configuration and migration
189
133
 
190
- Since 0.3 the roster is a directory with **one file per named subagent** (hot-reloaded, no restart needed):
191
-
192
- ```
193
- ~/.dsh/subagents/
194
- k3-reviewer.yaml # id = file name
195
- glm-reader.yaml
196
- _backups/ # backup area: copy the original here before editing (ignored by the plugin)
197
- README.md # optional: conventions for agents operating in this directory
198
- ...
199
- ```
134
+ | Location or field | Behavior |
135
+ | --- | --- |
136
+ | `<entriesDir>/<role-id>.yaml` | Shared role with required `description`. Optional fields include `persona`, `enabled`, model route, `maxTokens`, `maxDepth` and `subagentProvider`. |
137
+ | `_profiles/<profile>/<role-id>.yaml` | Profile route with `provider`, `model`, `reasoningEffort` or explicit inheritance. A shared provider missing from the current profile falls back to the session model. An invalid explicit profile route blocks the affected role. |
138
+ | `_groups/<group-id>.yaml` | Required description and ordered nonempty `members`. Optional `name`, `enabled` and `instructions`. A member has a `slot`, a `role` and an optional `assignment`. |
139
+ | `maxDepth` | Defaults to the host limit. An explicit value can tighten it. Zero blocks delegation. |
140
+ | `subagentProvider` | Defaults to the `spawn` transport. `fork` can inherit completed turns from the parent. The LLM provider is configured separately. |
141
+ | Legacy `backgroundMode` and `toolFilter` | Both former execution modes now start a resumable child asynchronously. Roles carrying a tool filter remain blocked until its removal is explicit. Set any required permission boundaries in the host. |
200
142
 
201
- > **Backup convention** — the plugin never auto-backs up. By convention, agents (or humans) copy the original file into `_backups/` before editing (suggested name `<id>.<yyyymmdd-hhmm>.yaml`). Anything `_`-prefixed is treated as non-roster content and silently ignored.
143
+ On hosts with profiles, Settings saves model edits in the current profile. On hosts without profiles, the same editor changes the shared default route. Clear it to follow the session model. Profile overrides bound to the old shared route need to be set again after the default changes.
202
144
 
203
- Where the plugin-level options live **depends on the host version**. Use one of these two shapes:
145
+ IDs and slot keys use lowercase letters, digits and hyphens, start with a letter or digit, and are at most 64 characters. Windows reserved device names are excluded. Disabling a group leaves its enabled roles available for direct use. Remove all group references before deleting a role. Settings detect stale writes. Hand-edited YAML is read on the next operation.
204
146
 
205
- **DSH ≤0.1.6:** edit `~/.dsh/settings.yaml`.
206
-
207
- ```yaml
208
- subagent-library:
209
- entriesDir: ~/.dsh/subagents
210
- subagentProvider: spawn
211
- # entries: (optional, legacy) the 0.2.x inline roster remains a read-only
212
- # fallback throughout 0.3.x — files win; removal planned for 0.4
213
- ```
214
-
215
- **DSH ≥0.1.7:** edit the **current profile's** (`web` or `desktop`) `cordis.patch.yml`, under `config` on its `- id: subagent-library` entry. Desktop and web do not call each other's model routes: a shared-roster `provider` that is not registered in the current profile is not used, and the child inherits this session's model. Provider/model saved on the settings page is stored for the current profile only.
147
+ Configure the base directory and default transport on the plugin row of the current profile's `cordis.patch.yml`:
216
148
 
217
149
  ```yaml
218
150
  - id: subagent-library
219
151
  config:
220
152
  entriesDir: ~/.dsh/subagents
221
153
  subagentProvider: spawn
222
- # entries: (optional, legacy) the 0.2.x inline roster remains a read-only
223
- # fallback throughout 0.3.x — files win; removal planned for 0.4
224
- ```
225
-
226
- One entry file (`k3-reviewer.yaml`):
227
-
228
- ```yaml
229
- description: Code review on Kimi K3-256K, with image walkthroughs
230
- provider: kimi-coding
231
- model: k3-256k
232
- persona: |
233
- You are an independent review agent running on Kimi K3-256K…
234
- maxDepth: 1
235
- backgroundMode: continuable
236
154
  ```
237
155
 
238
- > **DSH 0.2.1-series limitations:** the role prompt is sent in the first task message, not enforced as a system-level permission boundary. Per-entry `toolFilter` is unavailable, and entries containing it are refused. The example above therefore omits tool filtering and **does not guarantee read-only access**. Configure the required permissions in the host for read-only or tool-isolated work; a role name or prompt alone is not enough. The field table below also covers older hosts.
239
-
240
- Entry fields:
241
-
242
- | Field | Required | Notes |
243
- |---|---|---|
244
- | `id` (= file name) | yes | `<id>.yaml`; the id must match `[a-z0-9][a-z0-9-]*`, length ≤ 64 (Windows reserved device names con/nul/aux… are rejected) |
245
- | `description` | yes | Role description, shown to the model by `list_subagents` |
246
- | `provider` | no | **LLM route** (e.g. `deepseek-official`, `kimi-coding`); defaults to the caller's default |
247
- | `model` | no | LLM model id; defaults to the caller's session model |
248
- | `reasoningEffort` | no | Thinking effort: adapter-owned id (e.g. `max` / `high` / `medium` / `low`); empty follows the parent session default. Rides the official `agentOptions.reasoningEffort` override; when the child model route differs, the harness auto-drops the inherited effort, so unset values never leak across models. Only id-shaped values (alphanumerics and `._-`) are accepted; anything else is rejected on save |
249
- | `subagentProvider` | no | **Subagent transport** (a `ctx.subagents` provider such as `spawn`); defaults to the plugin-level default `spawn` |
250
- | `maxTokens` | no | Subagent output cap |
251
- | `persona` | no | Subagent role prompt. **DSH ≤0.2.0 hosts**: deployed as a system persona with strict `{{…}}` template interpolation (same semantics as deployment personas) — an unregistered variable (e.g. `{{user}}`) fails child activation. **DSH ≥0.2.1 hosts**: the start request has no persona field; the role is folded into the first task message under a `Role persona:` prefix — effective for the first turn, does NOT shadow a deployment persona, is not guaranteed to survive continuation turns or context compaction, and `{{…}}` is no longer interpolated (raw concatenation). A standalone `agentPreset` is deliberately not used to carry the role: an independent preset replaces the parent preset composition and drops the parent session's tools |
252
- | `toolFilter` | no | `allow`/`deny` tool-name lists (deny write-class tools for read-only roles). **Read-only/restricted roles should also deny `list_subagents`/`delegate`** so children are not taught by the global prompt to re-delegate in a chain. Names are resolved against the **calling session's restrictable set** at delegation (not "visibility"): names that session cannot apply are ignored and annotated with the reason (`本会话不存在` / `本会话专属工具`) in the delegate result and the `list_subagents` catalog — one shared entry never fails a whole delegation because a session lacks a tool. **An `allow` list that no name applies to refuses the delegation** (otherwise "keep only these" would silently become "keep nothing"). Registries without `view()` fall back to visibility, where scope-local names still make delegation fail loudly. Saves are not pre-validated. **DSH ≥0.2.1 hosts cannot enforce per-entry tool filters**: entries carrying `toolFilter` are refused at delegate time (marked undelegable in the catalog, warned at save time); such entries only work on ≤0.2.0 hosts |
253
- | `maxDepth` | no | Delegation depth cap; **when unset, defaults to 3 when the transport supports depthLimit** (aligned with the official subagent tool to prevent chained recursive delegation; the harness itself has no global depth cap). Transports without depthLimit stay uncapped |
254
- | `backgroundMode` | no | `one-shot` (default, omitted in files) / `continuable` (resumable) |
255
- | `enabled` | no | Write `enabled: false` to disable an entry (it stays visible in the directory and the settings page; `delegate` refuses it); omit or set `true` to enable |
256
-
257
- **Broken files never brick the roster**: files that fail to parse or validate are skipped, and the reason is surfaced as diagnostics in `list_subagents`, the `/subagent` command, and the settings page; `.yaml`/`.yml` duplicate ids and wrongly-cased file names are reported the same way.
258
-
259
- **Migrating from 0.2.x**: on first roster use, the old `entries` section is exported **entry by entry** to `<id>.yaml` (ids with an existing file are skipped — hand-written files are never overwritten); legacy copies are KEPT as a rollback, and files take precedence. When saving through the settings page, an unchanged canonical `.yaml` row is skipped so its hand-written comments stay intact; an unchanged `.yml` row is still rewritten as generated `.yaml` and loses its comments. A write/convergence failure returns HTTP 500 and may leave a partial result. If the canonical `.yaml` skip path cannot sweep a same-id `.yml`, the save returns 200 with a warning and the duplicate diagnostic remains until a retry succeeds. Once confirmed, clear only the legacy `entries` key and keep the other keys on that same config row (reading is removed in 0.4).
260
-
261
- The 0.2.8 legacy `entries` fallback is for DSH ≤0.1.6 only; on DSH ≥0.1.7 the plugin cannot be downgraded by itself. Host downgrade and restoration of `settings.yaml.imported` data are unverified, so no downgrade sequence is prescribed. To restore roster content, use your own `_backups/` copies and verify them manually.
262
-
263
- > Mind the two provider concepts: `provider` is the LLM route (`agentOptions.provider`),
264
- > while `subagentProvider` is the subagent transport (`ctx.subagents` registration name, e.g. `spawn`/`fork`/`acp`).
265
-
266
- ## Design notes
267
-
268
- - Tools register on the **host plane**: no dependency on any agent preset, and switching presets never loses them;
269
- - Dispatch goes through the standard `ctx.subagents` seam (providers such as `spawn`), so subagents keep harness semantics: approval pinned to never, sandbox inherited from the parent session, depth caps, continuable support;
270
- - Entries are re-resolved from the roster directory on every operation (no cache, no watcher) — file edits take effect immediately; single-entry writes are atomic (temp file + rename with retries), concurrent writers are last-write-wins.
156
+ Include the role files, `_profiles/` and `_groups/` in backups. The Settings endpoint `/subagent-library/api` shares the DSH Web Host access boundary. Configure host or reverse-proxy authentication when exposing it to other devices.
271
157
 
272
158
  ## Development
273
159
 
@@ -277,10 +163,10 @@ pnpm run typecheck
277
163
  pnpm run build # host: lib/index.js; client: lib/client.js
278
164
  ```
279
165
 
280
- - Dev dependencies remain pinned to DSH `0.1.0-rc.6` (see package.json devDependencies); this is not the current runtime host version. See "Host and desktop compatibility" above for current support and usage feedback. If the interfaces drift on other versions, adjust against the corresponding tag of the [deepseek-harness repo](https://github.com/deepseek-ai/deepseek-harness).
166
+ - Dev dependencies remain pinned to DSH `0.1.0-rc.6` (see package.json devDependencies); this is not the current runtime host version. If the interfaces drift on other versions, adjust against the corresponding tag of the [deepseek-harness repo](https://github.com/deepseek-ai/deepseek-harness).
281
167
 
282
168
  ## License
283
169
 
284
- [MIT](./LICENSE). Third-party license notices for code inlined into the build artifacts are in [THIRD_PARTY_NOTICES.md](./THIRD_PARTY_NOTICES.md).
170
+ [Apache-2.0](./LICENSE). Third-party license notices for code inlined into the build artifacts are in [THIRD_PARTY_NOTICES.md](./THIRD_PARTY_NOTICES.md).
285
171
 
286
172
  This is an independent community project, not affiliated with or endorsed by DeepSeek; the `DeepSeek Harness` name is used only to identify the compatible platform.
package/README.md CHANGED
@@ -8,39 +8,23 @@
8
8
 
9
9
  <p align="center">
10
10
  <img src="https://img.shields.io/github/actions/workflow/status/MaRi23333/dsh-subagent-library/ci.yml?style=flat-square&label=CI" alt="CI" />
11
- <img src="https://img.shields.io/github/license/MaRi23333/dsh-subagent-library?style=flat-square" alt="License: MIT" />
12
- <img src="https://img.shields.io/badge/DeepSeek%20Harness-0.2.1--rc.2-4d6bfe?style=flat-square" alt="DeepSeek Harness 0.2.1-rc.2" />
11
+ <img src="https://img.shields.io/github/license/MaRi23333/dsh-subagent-library?style=flat-square" alt="License: Apache-2.0" />
12
+ <img src="https://img.shields.io/badge/DeepSeek%20Harness-0.2.2--rc.5-4d6bfe?style=flat-square" alt="DeepSeek Harness 0.2.2-rc.5" />
13
13
  </p>
14
14
 
15
- > **English:** dsh-subagent-library is a named subagent roster plugin for the
16
- > [DeepSeek Harness](https://github.com/deepseek-ai/deepseek-harness) desktop and Web interfaces —
17
- > manage role entries (model / role prompt / depth / background mode)
18
- > from a settings page, hot-reloaded, then let any conversation pick one with
19
- > `list_subagents` and dispatch work with `delegate`. See
20
- > [README.en.md](./README.en.md) for the full English version.
15
+ ## 把常用的分工存成编队
21
16
 
22
- ## 简介
17
+ 写公告时,你可能习惯让一位助手找出遗漏,再让另一位给出改写。把这两个角色、各自的分工和共用的要求保存为一个编队,下次把新公告交给主会话,点名这个编队就能沿用同一套分工。
23
18
 
24
- DeepSeek Harness 的具名子代理库插件:把常用角色(代码审查、红队、多模态理解……)配成一份持久化的具名子代理名册(模型、角色提示词、深度与后台模式),之后**只需告诉主会话 agent「用 xxx 做这件事」**——模型自己通过两个工具完成选人和派活:
19
+ > 请用复核组看看这句公告:“会议改到周五下午。”让 `grok-reviewer` 用默认模型找出缺少的信息,让 `glm-adversary` 这次用 DeepSeek Flash 改写一句。
25
20
 
26
- - `list_subagents` — 列出名册条目(id / 角色描述 / 模型),模型据此挑选;
27
- - `delegate` — 按 `library_id` 派活:前台等待、后台 one-shot 任务、或 continuable 可续聊子代理(按条目配置)。
21
+ ![主会话同一轮派出两名成员。grok-reviewer 用默认的 Grok 4.7 指出缺少开始时间,glm-adversary 临时用 DeepSeek Flash 给出改写。](./assets/readme/group-dispatch.png)
28
22
 
29
- 任何会话(任意 agent preset)直接可用,**不需要 slash 命令**;`/subagent` 命令只是给人类在命令面板里快速查看名册用的。
23
+ **模型可以随任务换。** 无论单独点名一个角色,还是从编队中选人,都可以为这次派遣选用当前会话已授权的模型。角色保留原来的默认设置,下次照常派遣即可。
30
24
 
31
- 新增条目也不用手写配置:直接让主会话 agent 帮你配,或在设置页里可视化编辑;0.3 起 名册存储为**一个具名子代理一个 YAML 文件**(默认目录 `~/.dsh/subagents/`),热生效、可单独注释与版本管理。
25
+ 关闭 DSH 的「智能体团队」也能使用编队。主会话每次点名一位成员,可以在同一轮分派互不依赖的任务,也可以等前一位汇报后,把它的结论交给下一位。开启智能体团队后,成员还可以使用宿主的共享任务板。
32
26
 
33
- > 与官方能力的区分:官方 `subagent` 工具是临时派活(每次现场描述任务),官方 `list_agents` 列的是正在运行的子代实例;本插件维护的是**持久化的具名角色名册**(设置页可视化编辑、热生效),模型用 `list_subagents` 选人、`delegate` 按 id 派活。
34
-
35
- > **从 0.2.x 升级?** 0.3 起名册目录化(一个子代理一个 YAML 文件),旧配置**自动迁移**;确认无误后可按宿主版本清除旧 `entries` 段。配置位置、失败重试和回滚边界见 [MIGRATION.md](./MIGRATION.md),完整变更见 [CHANGELOG.md](./CHANGELOG.md)。
36
-
37
- [安装](#安装) · [第一次委派](#第一次委派) · [配置参考](#配置)
38
-
39
- ## 宿主与桌面端兼容
40
-
41
- **0.3.5 对齐 DSH `0.2.1-rc.2`**:修复可续聊子代理与一次性委派无法启动,以及后台任务取消未能停止子代理的问题。前台一次性、可续聊、后台启动及运行中取消已在该版桌面宿主中复验。角色提示词与工具过滤的限制见[配置](#配置),完整变化见 [CHANGELOG.md](./CHANGELOG.md)。
42
-
43
- 桌面客户端沿用 Web 插件界面,无需另装桌面专用包。旧宿主的启动分支仍保留,但本轮实际运行验证以 `0.2.1-rc.2` 为准;模型调用仍取决于各 Provider 的配置与服务。名册目录、profile 路由和迁移规则不变,无需重新迁移。
27
+ 0.4.0 面向 DSH `0.2.2-rc.5`,需要宿主支持可按名称继续对话的原生子代理。从旧版升级请参阅[迁移指南](./MIGRATION.md)和[更新日志](./CHANGELOG.md)。
44
28
 
45
29
  ## 安装
46
30
 
@@ -53,7 +37,7 @@ DeepSeek Harness 的具名子代理库插件:把常用角色(代码审查、
53
37
  3. 安装完成后点击 **立即启用(Enable now)**;只关闭安装完成对话框会让插件保持停用。
54
38
  4. 仅在界面提示需要重启时,通过应用菜单 **退出(Quit)** 完整退出再重开。关闭窗口可能只是隐藏应用。
55
39
 
56
- 启用后可在设置中找到 **子代理库** 页面;页面顶部显示条目计数和名册目录。
40
+ 启用后打开 **设置 → 子代理库**,选择「角色名册」或「编队」。名册目录可在「存储与备份说明」中查看。
57
41
 
58
42
  <details>
59
43
  <summary>备用:使用桌面随附 CLI(Windows / macOS)</summary>
@@ -101,162 +85,74 @@ dsh plugin --profile web add /absolute/path/to/dsh-subagent-library
101
85
 
102
86
  ## 第一次委派
103
87
 
104
- 先确认当前主会话能正常与模型对话。本例沿用该会话的模型,只整理一段给定文字,无需另外配置 Provider 或文件、网页工具。
105
-
106
- ### 1. 创建最小角色
88
+ 打开 **设置 → 子代理库 → 角色名册**,点「新建角色」,填写角色 ID `text-helper` 和描述,保存即可。模型留空会继承会话模型。也可以在名册目录创建等效的 `text-helper.yaml`(默认位于 `~/.dsh/subagents/`)。
107
89
 
108
- 没有已有名册或旧配置时,列表为空,插件不会自动添加示例角色。
109
-
110
- 1. 打开 **设置 → 子代理库**。空库会直接显示新增表单;已有条目时点击 **+ 新增子代理**。
111
- 2. 填写 **ID** 为 `text-helper`,**描述(模型可见)** 为 `整理主会话提供的短文本。`。若该 ID 已存在,换一个未使用的 ID,并同步替换下文示例。
112
- 3. **模型、Provider、角色提示词、禁用工具及其他选填项留空**,**后台模式**保持 `one-shot`,点击 **创建子代理**。这个按钮会直接保存,新条目默认启用,无需再点一次保存。
113
-
114
- ### 2. 让主会话列出并委派
115
-
116
- 回到主会话,发送:
117
-
118
- ```text
119
- 请先调用 list_subagents,确认有 text-helper;然后用 delegate 以前台方式将任务交给它:
120
- 把“苹果、香蕉、梨”按原顺序改成编号列表。只处理这段文字,不调用其他工具。
121
- 拿到子代理结果后转给我。
90
+ ```yaml
91
+ description: 整理主会话给出的文字。
92
+ persona: 保留原文中的专有名词。
122
93
  ```
123
94
 
124
- 应看到 `list_subagents` 返回 `text-helper`,随后有一次 `delegate` 调用并返回子代理的编号列表。只有主会话直接回答、没有委派调用,还不能确认流程已经走通。`/subagent` 可以查看名册,但不会代替这次委派。
95
+ 让主会话查询 `list_subagents()`,再调用 `delegate({library_id:"text-helper", prompt:"把苹果、香蕉、梨按原顺序编号。"})`。回执中的 `name` 可直接交给官方控制工具。完整结果随后到达父会话。角色也可以从设置里的「子代理库」管理。
125
96
 
126
- 这次委派仍会调用模型服务;“不调用其他工具”是任务要求,工具权限由宿主控制。DSH 0.2.1 的逐条目 `toolFilter` 暂不可用,角色名或提示词也不是只读权限保证,详见[配置中的限制](#配置)。
97
+ ## 编队成员与分工
127
98
 
128
- ### 3. 没走通时先看这几处
99
+ 在 **子代理库 → 编队** 中点「新建编队」。编队描述帮助主代理选组,共享说明会随任务发给从这组选中的每位成员。选好角色后,可以直接用角色 ID 填写空白的成员代号,也可以为这项分工起个名字。下面两位都用 `text-helper`,其中 `facts` 负责提取事实,`questions` 负责列出待确认的问题。
129
100
 
130
- - **找不到条目**:确认已点“创建子代理”,在设置页点击“刷新”并检查诊断。若条目已停用,切为“已启用”后保存。
131
- - **没有这两个工具**:确认插件在当前桌面或 Web 实例中启用,再检查当前会话的工具可用设置。
132
- - **模型启动失败**:先确认主会话能正常回复;角色的 Provider 与模型均留空。不要把输入框里的灰色示例当成自己的路由;服务端鉴权、额度等错误按实际报错处理。
101
+ ![设置中的编队列表。“复审组”已启用,包含两名成员。](./assets/readme/group-settings.png)
133
102
 
134
- <details>
135
- <summary>可选:用 YAML 创建同一个最小角色</summary>
136
-
137
- 文件方式和上面的界面方式二选一。在设置页显示的名册目录里新建 `text-helper.yaml`(目录不存在时先创建;不要覆盖已有同名条目):
103
+ 也可以在名册目录下的 `_groups/text-review.yaml` 中定义前面例子里的 `facts` 和 `questions` 两项分工。其中 `slot` 对应界面里的“成员代号”。
138
104
 
139
105
  ```yaml
140
- description: 整理主会话提供的短文本。
106
+ description: 整理材料中的事实与待确认事项。
107
+ instructions: 发回结论时注明依据。
108
+ members:
109
+ - slot: facts
110
+ role: text-helper
111
+ assignment: 提取有原文依据的事实。
112
+ - slot: questions
113
+ role: text-helper
114
+ assignment: 列出需要补充的信息。
141
115
  ```
142
116
 
143
- ID 来自文件名;其他字段省略即可继承会话模型并默认启用。保存后热生效,无需重启。更多字段见[配置](#配置)。
144
-
145
- </details>
146
-
147
- ## 界面
117
+ | 操作 | 主会话调用 |
118
+ | --- | --- |
119
+ | 浏览编队 | `list_subagents({kind:"groups"})` |
120
+ | 查看成员代号、模型配置和分工 | `list_subagents({group_id:"text-review"})` |
121
+ | 派一人核对事实 | `delegate({group_id:"text-review", slot:"facts", prompt:"核对刚才这段文字。"})` |
148
122
 
149
- <p align="center">
150
- <img src="./assets/readme/screenshot-settings.png" width="75%" alt="子代理库设置页:分层折叠卡片与名册筛选" /><br>
151
- <em>默认收起的名册卡片:一眼查看角色、模型与执行设置,筛选后展开编辑;启停修改保存后生效。</em>
152
- </p>
123
+ 查询不会启动成员。在上例中,`questions` 只有被另一次调用明确选中才会启动。直接按角色 ID 派遣只带角色人设与本次任务。从编队点名时,首条子代理消息还会带上编队说明和这位成员的分工。再次派遣时会重新读取当前角色和 profile 路由,已启动的成员继续使用原会话。人类也可以用 `/subagent` 查看名册和编队。
153
124
 
154
- <p align="center">
155
- <img src="./assets/readme/screenshot-command-palette.png" alt="命令面板里的 /subagent 命令" /><br>
156
- <em><code>/subagent</code> 命令(快速查看子代理库名册)</em>
157
- </p>
158
-
159
- <p align="center">
160
- <img src="./assets/readme/screenshot-roster.png" width="75%" alt="/subagent 输出:具名子代理名册一览" /><br>
161
- <em>名册输出示例:每个条目一句话角色描述 + 模型路由 + 可续聊标记</em>
162
- </p>
125
+ 用 `/subagent groups text-review` 可以看到哪些成员指定了模型,哪些跟随主会话。角色也可以跟随主会话模型、单独指定思考等级。派发后,顶部子代理列表和官方 `list_agents` 的成员描述显示启动时的模型与已知思考等级,例如 `text-review/facts [model-a · high]`。展开 `delegate` 回执可以查看完整的模型渠道(`provider`)、模型(`model`)和思考等级(`reasoningEffort`)。宿主未提供的值会省略。
163
126
 
164
- ## 设置页
127
+ **临时换模型**时,可以直接告诉主会话:“派 facts 和 questions 分别复核,facts 照常,questions 这次用我授权的 B 模型。”打开 DSH 左侧的「插件」,在「内置插件配置 → 子智能体 → 模型选择」打开「允许 Agent 为子智能体选择模型」。勾选所需模型,点「保存」,再点左上角「新会话」。主代理可用官方 `list_subagent_models` 查询选项,调用 `delegate` 时一起传入 `provider` 和 `model`,也可以指定 `reasoning_effort`。省略档位会采用所选模型的默认值。下次按角色或成员代号派遣时仍用角色原配置。
165
128
 
166
- 打开 **设置 → 子代理库**:**每个条目是一张默认收起的卡片**,点击名称展开编辑。
129
+ 会话没有已记录的模型名单时,显式选模仅可指定父会话当前的渠道和模型。宿主无法提供授权状态时,仍可按角色默认配置派遣。智能体团队开关不影响这两种用法。
167
130
 
168
- - **分层卡片**:名称与启用开关位于首行,角色描述独占一段(最多两行),模型与 Provider 单独展示;可续聊、思考强度、深度、输出上限、角色提示词与工具限制统一排在下方。长名称和模型路由自动换行,标签不再挤占描述空间。
169
- - **摘要带**常驻页面顶部:条目 / 启用 / 已停用 / 未保存计数 + 名册目录。
170
- - **筛选框**匹配 id、描述、模型等,配合 全部展开 / 收起 在长名册里定位。
171
- - **展开后**字段分组为「概述 / 路由与执行 / 工具与提示词」,宽面板两列、窄面板单列;底部是 还原 / 删除 / 保存。界面随宿主切换明暗主题,并支持键盘操作。
172
- - 开关修改先保留为草稿:折叠卡片上会出现「未保存」提示和「还原 / 保存修改」,保存后才生效。保存一个条目不会提交其他条目的草稿;还原会完整恢复该条目的已保存配置。
173
- - 停用条目在列表末尾显示;带「旧版条目」徽标的条目保存时自动晋升为文件。页面底部可展开存储与备份说明。
131
+ ## 配置与迁移
174
132
 
175
- 保存后的改动写回名册目录下的 `<id>.yaml`,热生效。
133
+ | 位置或字段 | 行为 |
134
+ | --- | --- |
135
+ | `<entriesDir>/<role-id>.yaml` | 共享角色,`description` 必填。支持 `persona`、`enabled`、模型路由、`maxTokens`、`maxDepth` 和 `subagentProvider`。 |
136
+ | `_profiles/<profile>/<role-id>.yaml` | 当前 profile 的模型路由。可指定 `provider`、`model`、`reasoningEffort` 或显式继承。共享 provider 未在该 profile 注册时沿用会话模型;显式 profile 路由有误会给出诊断。 |
137
+ | `_groups/<group-id>.yaml` | 必填组描述和非空、有序的 `members`,可选 `name`、`enabled` 和 `instructions`。每位成员填写代号 `slot` 和角色 `role`,可用 `assignment` 写下默认分工。 |
138
+ | `maxDepth` | 不填时采用宿主上限;角色可以进一步收紧,设为 0 时禁止派遣。 |
139
+ | `subagentProvider` | 传输默认使用 `spawn`。`fork` 可继承父会话已完成轮次的历史。LLM provider 单独配置。 |
140
+ | 旧 `backgroundMode`、`toolFilter` | 旧运行模式统一按异步可续聊执行。带有旧工具限制的角色会保留配置并阻止派遣;确实需要硬限制的角色应先在宿主落实权限。 |
176
141
 
177
- > **安全提示**:子代理库的设置接口(`/subagent-library/api`)遵循 DSH Web Host 的本地可信边界,插件自身不含独立身份验证层。若将 DSH Web 绑定到局域网 / 公网 / 反向代理,请在外层配置认证与访问控制,不要把该接口暴露给不可信客户端——子代理 persona 与配置可能包含内部工作规则。
142
+ 有 profile 的宿主将设置页中的模型修改保存到当前 profile。没有 profile 的宿主可以在同一页编辑共享默认模型,清空后跟随会话。更改共享模型后,绑定旧默认路由的 profile 设置需要重新指定。
178
143
 
179
- ## 配置
144
+ 角色 ID、编队 ID 和成员代号采用小写字母、数字和短横线,以字母或数字开头,最长 64 字符,并避开 Windows 设备保留名。停用编队后,启用的角色仍可单派。被编队引用的角色需先移除引用才能删除。设置写入保留并发冲突检查,手工修改 YAML 对下次查询和派遣生效。
180
145
 
181
- 0.3 起,名册是一个目录,**一个具名子代理一个文件**(热生效,无需重启):
182
-
183
- ```
184
- ~/.dsh/subagents/
185
- k3-reviewer.yaml # id = 文件名
186
- glm-reader.yaml
187
- _backups/ # 备份区:agent/人改条目前先把原文件复制到这里(`_` 前缀内容插件忽略)
188
- README.md # 可选:给操作本目录的 agent 看的约定说明
189
- ...
190
- ```
191
-
192
- > **备份约定**:插件不做自动备份;按惯例,agent(或人)在修改条目前先把原文件复制进 `_backups/`(命名建议 `<id>.<yyyymmdd-hhmm>.yaml`)。`_` 前缀的文件/目录一律视为非名册内容,插件静默忽略。名册目录里可放一份 `README.md` 给操作该目录的 agent 立规矩。
193
-
194
- 上面的插件级配置存放位置**随宿主版本不同**。两种正确的配置形状如下:
195
-
196
- **DSH ≤0.1.6:**编辑 `~/.dsh/settings.yaml`。
197
-
198
- ```yaml
199
- subagent-library:
200
- entriesDir: ~/.dsh/subagents
201
- subagentProvider: spawn
202
- # entries:(可选,遗留)0.2.x 的内联名册在 0.3.x 仍只读兜底,文件优先生效;0.4 移除
203
- ```
204
-
205
- **DSH ≥0.1.7:**编辑**当前 profile**(`web` 或 `desktop`)的 `cordis.patch.yml`,在 `- id: subagent-library` 的 `config` 下配置。desktop 与 web 的模型路由互不影响:共享名册里的 `provider` 若未在当前 profile 注册,调用会改用本会话模型;设置页保存的 Provider/模型只写入当前 profile。
146
+ 在当前 profile 的 `cordis.patch.yml` 中可以指定名册位置和默认传输:
206
147
 
207
148
  ```yaml
208
149
  - id: subagent-library
209
150
  config:
210
151
  entriesDir: ~/.dsh/subagents
211
152
  subagentProvider: spawn
212
- # entries:(可选,遗留)0.2.x 的内联名册在 0.3.x 仍只读兜底,文件优先生效;0.4 移除
213
- ```
214
-
215
- 单个条目文件(`k3-reviewer.yaml`):
216
-
217
- ```yaml
218
- description: Kimi K3-256K 代码审查,支持图片视觉走查
219
- provider: kimi-coding
220
- model: k3-256k
221
- persona: |
222
- 你是运行在 Kimi K3-256K 上的独立审核 agent……
223
- maxDepth: 1
224
- backgroundMode: continuable
225
153
  ```
226
154
 
227
- > **DSH 0.2.1 系列的限制**:角色提示词随首条任务消息发送,不是系统级权限约束;逐条目 `toolFilter` 暂不可用,含该字段的条目会拒绝委派。上面的示例因此不含工具过滤,**不保证只读**。有只读或工具隔离需求时,应先在宿主中配置相应权限,不能只靠角色名称或提示词。旧宿主的字段行为见下表。
228
-
229
- 条目字段:
230
-
231
- | 字段 | 必填 | 说明 |
232
- |---|---|---|
233
- | `id`(= 文件名) | 是 | `<id>.yaml`,id 须匹配 `[a-z0-9][a-z0-9-]*`,长度 ≤ 64(Windows 保留设备名 con/nul/aux… 不可用) |
234
- | `description` | 是 | 角色描述,`list_subagents` 展示给模型 |
235
- | `provider` | 否 | **LLM 路由**(如 `deepseek-official`、`kimi-coding`);缺省用调用方默认 |
236
- | `model` | 否 | LLM 模型 id;缺省用调用方的会话默认模型 |
237
- | `reasoningEffort` | 否 | 思考强度:适配器自有值(如 `max` / `high` / `medium` / `low`),留空随父会话默认。走官方 `agentOptions.reasoningEffort` 覆盖通道;子代理换了模型路由时官方会自动丢弃继承值,未显式设置不会跨模型泄漏。只接受 id 形态(字母数字与 `._-`),其他值保存时被拒绝 |
238
- | `subagentProvider` | 否 | **子代理传输层**(`spawn` 等 `ctx.subagents` provider);默认取插件级默认 `spawn` |
239
- | `maxTokens` | 否 | 子代理输出上限 |
240
- | `persona` | 否 | 子代理角色提示词。**DSH ≤0.2.0 宿主**:作为系统 persona 部署,走严格的 `{{…}}` 模板插值(与部署 persona 同语义)——出现未注册的变量(如 `{{user}}`)会让子代理激活失败。**DSH ≥0.2.1 宿主**:启动请求已无 persona 字段,角色以 `Role persona:` 前缀折叠进首条任务消息——首轮生效,但不遮蔽部署 persona;续聊回合与上下文压缩后不保证角色仍在;`{{…}}` 不再插值(原文拼接)。不采用独立 `agentPreset` 承载角色:独立 preset 会替换父 preset 组合、丢掉父会话工具 |
241
- | `toolFilter` | 否 | `allow`/`deny` 工具名单(只读角色用 deny 禁写类工具)。**只读/受限角色建议把 `list_subagents`/`delegate` 也列入 deny**,防止子代理被全局提示词教去链式再派活。名单在**委派时按调用方会话的可限制集合**解析(不是"可见"):不可应用的名字被忽略,并在派活结果与 `list_subagents` 目录里标注原因(`本会话不存在` / `本会话专属工具`)——共享条目不会因为某个会话缺该工具而整次派活失败。**`allow` 名单若在本会话全部不可应用则拒绝委派**(否则"只留这些"会变成"什么都不留")。旧注册表无 `view()` 时退回可见性判定,此时 scope-local 名仍会让委派明确报错。保存阶段不做校验。**DSH ≥0.2.1 宿主无法强制执行逐条目工具过滤**:带 `toolFilter` 的条目会被委派直接拒绝(目录标注「无法强制执行」,保存时附警告);这类条目只适用于 ≤0.2.0 宿主 |
242
- | `maxDepth` | 否 | 委派深度上限;**缺省 = 传输层支持 depthLimit 时默认 3**(与官方 subagent 工具对齐,防链式递归派活;harness 自身无全局深度上限),不支持 depthLimit 的传输层则不设上限 |
243
- | `backgroundMode` | 否 | `one-shot`(默认,文件中省略)/ `continuable`(可续聊) |
244
- | `enabled` | 否 | 文件内写 `enabled: false` 停用该条目(目录与设置页仍可见,`delegate` 拒绝派活);省略或 `true` 为启用 |
245
-
246
- **坏文件不炸名册**:解析/校验失败的文件被跳过,错误进入 `list_subagents` 输出、`/subagent` 命令与设置页的 diagnostics;`.yaml`/`.yml` 同名冲突、大写文件名等也会以诊断形式报出。
247
-
248
- **从 0.2.x 迁移**:首次使用名册时,旧配置里的 `entries` 会**逐条**导出为 `<id>.yaml`(已存在同名文件的条目跳过,绝不覆盖手写文件);旧条目保留作回滚副本,文件优先生效。通过设置页保存时,规范 `.yaml` 内容未变时会跳过写入并保留手写注释;`.yml` 内容即使未变也会重写为生成的 `.yaml` 并移除 `.yml`,原注释会丢失。写入或收敛失败返回 HTTP 500,可能已有部分文件完成;规范 `.yaml` 的跳过路径若清扫同名 `.yml` 失败则返回 200 并带 warning,冲突诊断会持续到下次重试成功。确认无误后按宿主版本清除旧 `entries` 段(0.4 将停止读取)。
249
-
250
- 清理时只删除 `entries` 键:旧宿主保留同一 `subagent-library` 行的 `subagentProvider` / `entriesDir` 等其他键;新宿主保留同一 `config` 行的这些键,不要删除整个配置条目。0.2.8 的旧 `entries` 回滚副本只适用于 DSH ≤0.1.6;在 DSH ≥0.1.7 上不能单独降级插件。宿主降级和 `settings.yaml.imported` 数据恢复均未验证;如果需要恢复 0.3 名册内容,请从你自己建立的名册 `_backups/` 备份恢复并自行核对。
251
-
252
- > 注意区分两个 provider 概念:`provider` 指 LLM 路由(`agentOptions.provider`),
253
- > `subagentProvider` 指子代理传输层(`ctx.subagents` 注册名,如 `spawn`/`fork`/`acp`)。
254
-
255
- ## 设计说明
256
-
257
- - 工具注册在 **host 平面**:不依赖任何 agent preset,切 preset 不会丢;
258
- - 派发走标准 `ctx.subagents` 缝(spawn 等 provider),子代理沿用 harness 语义:审批固定 never、沙箱继承父会话、深度上限、continuable 支持;
259
- - 名册每次操作实时读目录(无缓存、无 watcher),改文件立即生效;单条目写入为原子操作(临时文件 + rename 重试),多写者后写赢。
155
+ 备份时一起保留角色、`_profiles/` 和 `_groups/`。设置接口 `/subagent-library/api` 使用 DSH Web Host 的访问边界。将宿主开放给其他设备时,在宿主或反向代理配置访问控制。
260
156
 
261
157
  ## 开发
262
158
 
@@ -266,10 +162,10 @@ pnpm run typecheck
266
162
  pnpm run build # host: lib/index.js;client: lib/client.js
267
163
  ```
268
164
 
269
- - 开发依赖仍锁定 DSH `0.1.0-rc.6`(见 package.json devDependencies),不等于当前使用宿主版本;当前兼容范围与反馈见上方「宿主与桌面端兼容」。其他版本如接口漂移请对照 [deepseek-harness 仓库](https://github.com/deepseek-ai/deepseek-harness) 相应 tag 调整。
165
+ - 开发依赖仍锁定 DSH `0.1.0-rc.6`(见 package.json devDependencies),不等于当前使用宿主版本。其他版本如接口漂移请对照 [deepseek-harness 仓库](https://github.com/deepseek-ai/deepseek-harness) 相应 tag 调整。
270
166
 
271
167
  ## License
272
168
 
273
- [MIT](./LICENSE)。本仓库内联构建产物的第三方许可证声明见 [THIRD_PARTY_NOTICES.md](./THIRD_PARTY_NOTICES.md)。
169
+ [Apache-2.0](./LICENSE)。本仓库内联构建产物的第三方许可证声明见 [THIRD_PARTY_NOTICES.md](./THIRD_PARTY_NOTICES.md)。
274
170
 
275
171
  本插件是独立社区项目,与 DeepSeek 无任何隶属或背书关系;`DeepSeek Harness` 名称仅用于标明兼容平台。