dsh-subagent-library 0.3.5 → 0.3.6

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/CHANGELOG.md CHANGED
@@ -4,6 +4,13 @@
4
4
 
5
5
  This file documents user-facing changes. Format loosely follows [Keep a Changelog]; versions follow [SemVer].
6
6
 
7
+ ## [0.3.6] — 2026-11-06
8
+
9
+ ### 修复 / Fixed
10
+
11
+ - 通过 DSH 0.2.2 的原生设置图标插槽显示子代理库机器人图标,修复新版设置侧栏中的图标回退;尺寸与颜色随宿主显示。
12
+ - Use the native DSH 0.2.2 settings icon slot to restore the library's robot icon in the updated sidebar, with host-controlled sizing and theme colors.
13
+
7
14
  ## [0.3.5] — 2026-10-17
8
15
 
9
16
  ### 修复 / Fixed
package/README.en.md CHANGED
@@ -14,7 +14,7 @@
14
14
 
15
15
  ## Overview
16
16
 
17
- A named subagent roster plugin for the [DeepSeek Harness](https://github.com/deepseek-ai/deepseek-harness) (DSH) Web GUI: 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
+ 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:
18
18
 
19
19
  - `list_subagents` — lists roster entries (id / role description / model) so the model can pick a suitable one;
20
20
  - `delegate` — dispatches work by `library_id`: foreground wait, background one-shot, or a continuable (resumable) subagent, per the entry's configuration.
@@ -27,6 +27,117 @@ Adding entries needs no hand-written config either: ask the main agent to do it,
27
27
 
28
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
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.
37
+
38
+ ## Install
39
+
40
+ ### Desktop client (recommended)
41
+
42
+ Desktop and Web have separate plugin installations and activation states; installing for Web does not enable the desktop plugin. The desktop GUI route needs no PATH setup.
43
+
44
+ 1. In the desktop sidebar, open **Plugins** → **Add plugin**.
45
+ 2. Enter the npm package name `dsh-subagent-library@latest` and install it.
46
+ 3. Click **Enable now** when installation finishes. Closing the completed-install dialog leaves the plugin disabled.
47
+ 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
+
49
+ Once enabled, find **子代理库 (Subagent Library)** in Settings; the top of the page shows entry counts and the roster directory.
50
+
51
+ <details>
52
+ <summary>Alternative: use the desktop-bundled CLI (Windows / macOS)</summary>
53
+
54
+ Start the desktop client once to initialize it. In the application menu, open **Manage dsh Command…** → **Install** to register its bundled `dsh` command, then open a new terminal. If the UI reports a PATH conflict, follow its instructions first.
55
+
56
+ Fully exit the desktop client with **Quit**, then use the newly registered desktop-bundled CLI:
57
+
58
+ ```sh
59
+ dsh plugin --profile desktop add dsh-subagent-library@latest
60
+ dsh plugin --profile desktop list
61
+ ```
62
+
63
+ Reopen the desktop client afterwards. An npm-installed `dsh` or `npx` cannot manage the `desktop` profile. See the [official desktop command documentation](https://github.com/deepseek-ai/deepseek-harness/blob/dsh-v0.2.1-rc.2/apps/desktop/README.md#bundled-command-runtime).
64
+
65
+ </details>
66
+
67
+ ### Web
68
+
69
+ These commands manage Web plugins only. Use the same `dsh` CLI that starts your Web instance, matching that host's version, to install the stable release from npm:
70
+
71
+ ```sh
72
+ dsh plugin --profile web add dsh-subagent-library@latest
73
+ ```
74
+
75
+ After installation, stop the running `dsh web` process, start `dsh web` again with the same CLI, and refresh the page.
76
+
77
+ Other install sources:
78
+
79
+ ```sh
80
+ # From GitHub (lib/ build artifacts are committed; no local build needed)
81
+ dsh plugin --profile web add github:MaRi23333/dsh-subagent-library
82
+
83
+ # From a local checkout
84
+ git clone https://github.com/MaRi23333/dsh-subagent-library.git
85
+ cd dsh-subagent-library
86
+ pnpm install && pnpm run build
87
+ dsh plugin --profile web add /absolute/path/to/dsh-subagent-library
88
+ ```
89
+
90
+ > The repo commits `lib/` build artifacts, so git installs need no local build; after
91
+ > changing sources run `pnpm run build` and restart Web.
92
+ > Roster edits (files under `~/.dsh/subagents/`) are **hot-reloaded** — no restart.
93
+ >
94
+ > **Switching channels** — if you previously installed from GitHub or a local checkout and want npm-release upgrades, re-add with `dsh plugin --profile web add dsh-subagent-library@latest` to force the latest npm version.
95
+
96
+ ## Your first delegation
97
+
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.
103
+
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.
116
+ ```
117
+
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).
121
+
122
+ ### 3. If it does not work
123
+
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.
127
+
128
+ <details>
129
+ <summary>Optional: create the same minimal role with YAML</summary>
130
+
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):
132
+
133
+ ```yaml
134
+ description: Organize short text supplied by the main conversation.
135
+ ```
136
+
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
+
30
141
  ## Screenshots
31
142
 
32
143
  <p align="center">
@@ -44,6 +155,36 @@ Adding entries needs no hand-written config either: ask the main agent to do it,
44
155
  <em>Roster output example: one-line role description + model route + continuable marker per entry</em>
45
156
  </p>
46
157
 
158
+ ## Settings page
159
+
160
+ A **子代理库 (Subagent Library)** page appears under Settings. **Each entry is a card, closed by
161
+ default**; click its name to open the editor.
162
+
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.
179
+
180
+ Saved changes are written back to `<id>.yaml` in the roster directory and hot-reloaded.
181
+
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.
187
+
47
188
  ## Configuration
48
189
 
49
190
  Since 0.3 the roster is a directory with **one file per named subagent** (hot-reloaded, no restart needed):
@@ -122,71 +263,6 @@ The 0.2.8 legacy `entries` fallback is for DSH ≤0.1.6 only; on DSH ≥0.1.7 th
122
263
  > Mind the two provider concepts: `provider` is the LLM route (`agentOptions.provider`),
123
264
  > while `subagentProvider` is the subagent transport (`ctx.subagents` registration name, e.g. `spawn`/`fork`/`acp`).
124
265
 
125
- ## Host and desktop compatibility
126
-
127
- **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 the notice and field table above for role-prompt and tool-filter limitations, and [CHANGELOG.md](./CHANGELOG.md) for the full update.
128
-
129
- 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.
130
-
131
- ## Install
132
-
133
- One command, from npm (recommended):
134
-
135
- ```sh
136
- npx @deepseek-ai/dsh plugin --profile web add dsh-subagent-library
137
- ```
138
-
139
- Then **restart `dsh web`** (stop the process, run `dsh web` again) and refresh the page.
140
-
141
- Other install sources:
142
-
143
- ```sh
144
- # From GitHub (git-hosted plugin; lib/ build artifacts are committed, no local build needed)
145
- npx @deepseek-ai/dsh plugin --profile web add github:MaRi23333/dsh-subagent-library
146
-
147
- # From a local checkout
148
- git clone https://github.com/MaRi23333/dsh-subagent-library.git
149
- cd dsh-subagent-library
150
- pnpm install && pnpm run build
151
- npx @deepseek-ai/dsh plugin --profile web add /absolute/path/to/dsh-subagent-library
152
- ```
153
-
154
- > The repo commits `lib/` build artifacts, so git installs need no local build; after
155
- > changing sources run `pnpm run build` and restart.
156
- > Roster edits (files under `~/.dsh/subagents/`) are **hot-reloaded** — no restart.
157
- >
158
- > **Switching channels** — if you previously installed from GitHub or a local checkout and want npm-release upgrades, re-add with `npx @deepseek-ai/dsh plugin --profile web add dsh-subagent-library@latest` to force the latest npm version.
159
-
160
- ## Settings page
161
-
162
- A **Subagent Library** page appears under Settings. **Each entry is a card, closed by
163
- default**; click its name to open the editor.
164
-
165
- - **Layered cards** separate the name and enable switch, a description of up to two lines,
166
- the model and provider, and a wrapping group of execution settings. Long names and model
167
- routes wrap without squeezing the description or hiding the switch.
168
- - A **summary band** stays at the top of the page: entry / enabled / disabled / unsaved counts
169
- plus the roster directory.
170
- - A **filter box** matches id, description, model and more; Expand/collapse all helps in a long
171
- roster.
172
- - **Expanded**, fields are grouped as Overview (description) / Routing & execution (provider,
173
- model, transport, background mode, reasoning effort, depth, output cap) / Tools & prompt
174
- (denied tools, persona), with Revert / Delete / Save at the bottom. Fields use two columns
175
- in wider panels and one in narrow panels, with host light/dark themes and keyboard support.
176
- - Toggling enable state creates a draft. The collapsed card exposes an unsaved badge and
177
- Revert / Save changes; the setting takes effect only after saving. Saving one entry does
178
- not submit other drafts, and Revert restores the entire saved entry.
179
- - Disabled entries appear last; entries marked as legacy are promoted to files on save.
180
- Storage and backup details are available in a disclosure at the bottom of the page.
181
-
182
- Saved changes are written back to `<id>.yaml` in the roster directory and hot-reloaded.
183
-
184
- > **Security note:** the roster settings endpoint (`/subagent-library/api`) follows the
185
- > DSH Web Host's local trust boundary — the plugin itself adds no separate authentication
186
- > layer. If you bind DSH Web to a LAN, the public internet, or a reverse proxy, put proper
187
- > authentication and access control in front of it; do not expose this endpoint to
188
- > untrusted clients — subagent personas and configuration may contain internal working rules.
189
-
190
266
  ## Design notes
191
267
 
192
268
  - Tools register on the **host plane**: no dependency on any agent preset, and switching presets never loses them;
package/README.md CHANGED
@@ -13,7 +13,7 @@
13
13
  </p>
14
14
 
15
15
  > **English:** dsh-subagent-library is a named subagent roster plugin for the
16
- > [DeepSeek Harness](https://github.com/deepseek-ai/deepseek-harness) Web GUI —
16
+ > [DeepSeek Harness](https://github.com/deepseek-ai/deepseek-harness) desktop and Web interfaces —
17
17
  > manage role entries (model / role prompt / depth / background mode)
18
18
  > from a settings page, hot-reloaded, then let any conversation pick one with
19
19
  > `list_subagents` and dispatch work with `delegate`. See
@@ -34,6 +34,116 @@ DeepSeek Harness 的具名子代理库插件:把常用角色(代码审查、
34
34
 
35
35
  > **从 0.2.x 升级?** 0.3 起名册目录化(一个子代理一个 YAML 文件),旧配置**自动迁移**;确认无误后可按宿主版本清除旧 `entries` 段。配置位置、失败重试和回滚边界见 [MIGRATION.md](./MIGRATION.md),完整变更见 [CHANGELOG.md](./CHANGELOG.md)。
36
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 路由和迁移规则不变,无需重新迁移。
44
+
45
+ ## 安装
46
+
47
+ ### 桌面客户端(推荐)
48
+
49
+ 桌面客户端与 Web 的插件安装和启用状态各自独立;在 Web 安装不会自动在桌面端启用。桌面图形界面安装无需配置 PATH。
50
+
51
+ 1. 打开桌面客户端,进入侧栏 **插件(Plugins)** → **添加插件(Add plugin)**。
52
+ 2. 输入 npm 包名 `dsh-subagent-library@latest` 并安装。
53
+ 3. 安装完成后点击 **立即启用(Enable now)**;只关闭安装完成对话框会让插件保持停用。
54
+ 4. 仅在界面提示需要重启时,通过应用菜单 **退出(Quit)** 完整退出再重开。关闭窗口可能只是隐藏应用。
55
+
56
+ 启用后可在设置中找到 **子代理库** 页面;页面顶部显示条目计数和名册目录。
57
+
58
+ <details>
59
+ <summary>备用:使用桌面随附 CLI(Windows / macOS)</summary>
60
+
61
+ 先启动桌面客户端一次以完成初始化。在应用菜单打开 **Manage dsh Command…** → **Install**,注册桌面随附的 `dsh` 命令,再打开新终端;若界面报告 PATH 冲突,先按其提示处理。
62
+
63
+ 通过 **Quit** 完整退出桌面客户端后,使用刚注册的桌面随附 CLI:
64
+
65
+ ```sh
66
+ dsh plugin --profile desktop add dsh-subagent-library@latest
67
+ dsh plugin --profile desktop list
68
+ ```
69
+
70
+ 完成后重开桌面客户端。npm 安装的 `dsh` 和 `npx` 不能管理 `desktop` profile。命令注册说明见[官方桌面文档](https://github.com/deepseek-ai/deepseek-harness/blob/dsh-v0.2.1-rc.2/apps/desktop/README.md#bundled-command-runtime)。
71
+
72
+ </details>
73
+
74
+ ### Web
75
+
76
+ 以下命令只管理 Web 的插件。使用启动该 Web 实例的同一套、与宿主版本匹配的 `dsh` CLI,从 npm 安装稳定版本:
77
+
78
+ ```sh
79
+ dsh plugin --profile web add dsh-subagent-library@latest
80
+ ```
81
+
82
+ 安装后停止当前 `dsh web` 进程,用同一套 CLI 重新运行 `dsh web`,再刷新页面。
83
+
84
+ 其他安装来源:
85
+
86
+ ```sh
87
+ # 从 GitHub 安装(仓库已提交 lib/ 构建产物,安装无需本地构建)
88
+ dsh plugin --profile web add github:MaRi23333/dsh-subagent-library
89
+
90
+ # 从本地目录安装
91
+ git clone https://github.com/MaRi23333/dsh-subagent-library.git
92
+ cd dsh-subagent-library
93
+ pnpm install && pnpm run build
94
+ dsh plugin --profile web add /absolute/path/to/dsh-subagent-library
95
+ ```
96
+
97
+ > 仓库已提交 `lib/` 构建产物,git 安装无需本地构建;改源码后运行 `pnpm run build` 再重启 Web。
98
+ > 名册(`~/.dsh/subagents/` 下的条目文件)**热生效**,无需重启。
99
+ >
100
+ > **渠道切换**:之前从 GitHub / 本地目录安装、现在想跟随 npm 发布升级时,用 `dsh plugin --profile web add dsh-subagent-library@latest` 显式取 npm 最新版。
101
+
102
+ ## 第一次委派
103
+
104
+ 先确认当前主会话能正常与模型对话。本例沿用该会话的模型,只整理一段给定文字,无需另外配置 Provider 或文件、网页工具。
105
+
106
+ ### 1. 创建最小角色
107
+
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
+ 拿到子代理结果后转给我。
122
+ ```
123
+
124
+ 应看到 `list_subagents` 返回 `text-helper`,随后有一次 `delegate` 调用并返回子代理的编号列表。只有主会话直接回答、没有委派调用,还不能确认流程已经走通。`/subagent` 可以查看名册,但不会代替这次委派。
125
+
126
+ 这次委派仍会调用模型服务;“不调用其他工具”是任务要求,工具权限由宿主控制。DSH 0.2.1 的逐条目 `toolFilter` 暂不可用,角色名或提示词也不是只读权限保证,详见[配置中的限制](#配置)。
127
+
128
+ ### 3. 没走通时先看这几处
129
+
130
+ - **找不到条目**:确认已点“创建子代理”,在设置页点击“刷新”并检查诊断。若条目已停用,切为“已启用”后保存。
131
+ - **没有这两个工具**:确认插件在当前桌面或 Web 实例中启用,再检查当前会话的工具可用设置。
132
+ - **模型启动失败**:先确认主会话能正常回复;角色的 Provider 与模型均留空。不要把输入框里的灰色示例当成自己的路由;服务端鉴权、额度等错误按实际报错处理。
133
+
134
+ <details>
135
+ <summary>可选:用 YAML 创建同一个最小角色</summary>
136
+
137
+ 文件方式和上面的界面方式二选一。在设置页显示的名册目录里新建 `text-helper.yaml`(目录不存在时先创建;不要覆盖已有同名条目):
138
+
139
+ ```yaml
140
+ description: 整理主会话提供的短文本。
141
+ ```
142
+
143
+ ID 来自文件名;其他字段省略即可继承会话模型并默认启用。保存后热生效,无需重启。更多字段见[配置](#配置)。
144
+
145
+ </details>
146
+
37
147
  ## 界面
38
148
 
39
149
  <p align="center">
@@ -51,6 +161,21 @@ DeepSeek Harness 的具名子代理库插件:把常用角色(代码审查、
51
161
  <em>名册输出示例:每个条目一句话角色描述 + 模型路由 + 可续聊标记</em>
52
162
  </p>
53
163
 
164
+ ## 设置页
165
+
166
+ 打开 **设置 → 子代理库**:**每个条目是一张默认收起的卡片**,点击名称展开编辑。
167
+
168
+ - **分层卡片**:名称与启用开关位于首行,角色描述独占一段(最多两行),模型与 Provider 单独展示;可续聊、思考强度、深度、输出上限、角色提示词与工具限制统一排在下方。长名称和模型路由自动换行,标签不再挤占描述空间。
169
+ - **摘要带**常驻页面顶部:条目 / 启用 / 已停用 / 未保存计数 + 名册目录。
170
+ - **筛选框**匹配 id、描述、模型等,配合 全部展开 / 收起 在长名册里定位。
171
+ - **展开后**字段分组为「概述 / 路由与执行 / 工具与提示词」,宽面板两列、窄面板单列;底部是 还原 / 删除 / 保存。界面随宿主切换明暗主题,并支持键盘操作。
172
+ - 开关修改先保留为草稿:折叠卡片上会出现「未保存」提示和「还原 / 保存修改」,保存后才生效。保存一个条目不会提交其他条目的草稿;还原会完整恢复该条目的已保存配置。
173
+ - 停用条目在列表末尾显示;带「旧版条目」徽标的条目保存时自动晋升为文件。页面底部可展开存储与备份说明。
174
+
175
+ 保存后的改动写回名册目录下的 `<id>.yaml`,热生效。
176
+
177
+ > **安全提示**:子代理库的设置接口(`/subagent-library/api`)遵循 DSH Web Host 的本地可信边界,插件自身不含独立身份验证层。若将 DSH Web 绑定到局域网 / 公网 / 反向代理,请在外层配置认证与访问控制,不要把该接口暴露给不可信客户端——子代理 persona 与配置可能包含内部工作规则。
178
+
54
179
  ## 配置
55
180
 
56
181
  0.3 起,名册是一个目录,**一个具名子代理一个文件**(热生效,无需重启):
@@ -127,55 +252,6 @@ backgroundMode: continuable
127
252
  > 注意区分两个 provider 概念:`provider` 指 LLM 路由(`agentOptions.provider`),
128
253
  > `subagentProvider` 指子代理传输层(`ctx.subagents` 注册名,如 `spawn`/`fork`/`acp`)。
129
254
 
130
- ## 宿主与桌面端兼容
131
-
132
- **0.3.5 对齐 DSH `0.2.1-rc.2`**:修复可续聊子代理与一次性委派无法启动,以及后台任务取消未能停止子代理的问题。前台一次性、可续聊、后台启动及运行中取消已在该版桌面宿主中复验。角色提示词与工具过滤的限制见上方提示和字段表,完整变化见 [CHANGELOG.md](./CHANGELOG.md)。
133
-
134
- 桌面客户端沿用 Web 插件界面,无需另装桌面专用包。旧宿主的启动分支仍保留,但本轮实际运行验证以 `0.2.1-rc.2` 为准;模型调用仍取决于各 Provider 的配置与服务。名册目录、profile 路由和迁移规则不变,无需重新迁移。
135
-
136
- ## 安装
137
-
138
- 一条命令,从 npm 安装(推荐):
139
-
140
- ```sh
141
- npx @deepseek-ai/dsh plugin --profile web add dsh-subagent-library
142
- ```
143
-
144
- 然后**重启 dsh web**(关掉终端重新运行 `dsh web`)并刷新页面。
145
-
146
- 其他安装方式:
147
-
148
- ```sh
149
- # 从 GitHub 安装(git-hosted 插件;仓库已提交 lib/ 构建产物,安装无需本地构建)
150
- npx @deepseek-ai/dsh plugin --profile web add github:MaRi23333/dsh-subagent-library
151
-
152
- # 从本地目录安装
153
- git clone https://github.com/MaRi23333/dsh-subagent-library.git
154
- cd dsh-subagent-library
155
- pnpm install && pnpm run build
156
- npx @deepseek-ai/dsh plugin --profile web add /absolute/path/to/dsh-subagent-library
157
- ```
158
-
159
- > 仓库已提交 `lib/` 构建产物,git 安装无需本地构建;改源码后运行 `pnpm run build` 再重启即可。
160
- > 名册(`~/.dsh/subagents/` 下的条目文件)**热生效**,无需重启。
161
- >
162
- > **渠道切换**:之前从 GitHub / 本地目录安装、现在想跟随 npm 发布升级时,用 `npx @deepseek-ai/dsh plugin --profile web add dsh-subagent-library@latest` 显式取 npm 最新版。
163
-
164
- ## 设置页
165
-
166
- Settings → 设置 里新增「子代理库」页面:**每个条目是一张默认收起的卡片**,点击名称展开编辑。
167
-
168
- - **分层卡片**:名称与启用开关位于首行,角色描述独占一段(最多两行),模型与 Provider 单独展示;可续聊、思考强度、深度、输出上限、角色提示词与工具限制统一排在下方。长名称和模型路由自动换行,标签不再挤占描述空间。
169
- - **摘要带**常驻页面顶部:条目 / 启用 / 已停用 / 未保存计数 + 名册目录。
170
- - **筛选框**匹配 id、描述、模型等,配合 全部展开 / 收起 在长名册里定位。
171
- - **展开后**字段分组为「概述 / 路由与执行 / 工具与提示词」,宽面板两列、窄面板单列;底部是 还原 / 删除 / 保存。界面随宿主切换明暗主题,并支持键盘操作。
172
- - 开关修改先保留为草稿:折叠卡片上会出现「未保存」提示和「还原 / 保存修改」,保存后才生效。保存一个条目不会提交其他条目的草稿;还原会完整恢复该条目的已保存配置。
173
- - 停用条目在列表末尾显示;带「旧版条目」徽标的条目保存时自动晋升为文件。页面底部可展开存储与备份说明。
174
-
175
- 保存后的改动写回名册目录下的 `<id>.yaml`,热生效。
176
-
177
- > **安全提示**:子代理库的设置接口(`/subagent-library/api`)遵循 DSH Web Host 的本地可信边界,插件自身不含独立身份验证层。若将 DSH Web 绑定到局域网 / 公网 / 反向代理,请在外层配置认证与访问控制,不要把该接口暴露给不可信客户端——子代理 persona 与配置可能包含内部工作规则。
178
-
179
255
  ## 设计说明
180
256
 
181
257
  - 工具注册在 **host 平面**:不依赖任何 agent preset,切 preset 不会丢;
package/lib/client.js CHANGED
@@ -1824,44 +1824,49 @@ function LibrarySettings(props) {
1824
1824
  });
1825
1825
  }
1826
1826
 
1827
+ //#endregion
1828
+ //#region src/client/icon.tsx
1829
+ /** Robot-head glyph for the library's settings row. */
1830
+ function LibraryNavIcon({ size = 16 }) {
1831
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("svg", {
1832
+ viewBox: "0 0 16 16",
1833
+ width: size,
1834
+ height: size,
1835
+ fill: "none",
1836
+ stroke: "currentColor",
1837
+ strokeWidth: 1.2,
1838
+ strokeLinecap: "round",
1839
+ strokeLinejoin: "round",
1840
+ "aria-hidden": "true",
1841
+ children: [
1842
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("path", { d: "M8 6.5V3.9" }),
1843
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("circle", {
1844
+ cx: "8",
1845
+ cy: "2.6",
1846
+ r: "0.85"
1847
+ }),
1848
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("rect", {
1849
+ x: "3.25",
1850
+ y: "6.5",
1851
+ width: "9.5",
1852
+ height: "6.5",
1853
+ rx: "1.5"
1854
+ }),
1855
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("path", { d: "M5.75 9.25v1.25" }),
1856
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("path", { d: "M10.25 9.25v1.25" }),
1857
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("path", { d: "M1.75 9.25h1.5" }),
1858
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("path", { d: "M12.75 9.25h1.5" })
1859
+ ]
1860
+ });
1861
+ }
1862
+
1827
1863
  //#endregion
1828
1864
  //#region src/client/nav-icon.ts
1829
- /**
1830
- * Settings-nav icon decoration for this plugin's own row (子代理库).
1831
- *
1832
- * The official settings shell's navIcon(id) table is closed — official ids
1833
- * get drawn icons and everything else falls back to a generic gear. This
1834
- * replaces that fallback <svg> inside OUR nav button (matched by our own
1835
- * registered label text) with the drawn robot-head icon. A MutationObserver
1836
- * re-applies the icon when the panel re-renders; gated on the settings
1837
- * dialog being present so idle chat streams never pay the query cost.
1838
- */
1839
- const NAV_ICON_INNER = "<path d=\"M8 6.5V3.9\"/><circle cx=\"8\" cy=\"2.6\" r=\"0.85\"/><rect x=\"3.25\" y=\"6.5\" width=\"9.5\" height=\"6.5\" rx=\"1.5\"/><path d=\"M5.75 9.25v1.25\"/><path d=\"M10.25 9.25v1.25\"/><path d=\"M1.75 9.25h1.5\"/><path d=\"M12.75 9.25h1.5\"/>";
1840
- const NAV_LABELS = new Set(["子代理库"]);
1841
- function decorateSettingsNavIcon(ctx) {
1842
- ctx.effect(() => {
1843
- const decorate = () => {
1844
- if (document.querySelector("[role=\"dialog\"]") === null) return;
1845
- for (const button$1 of Array.from(document.querySelectorAll("button"))) {
1846
- const label = button$1.querySelector(":scope > span");
1847
- if (label === null || !NAV_LABELS.has(label.textContent ?? "")) continue;
1848
- const existing = button$1.firstElementChild;
1849
- if (existing instanceof SVGElement) {
1850
- if (existing.dataset.navIcon === "1") continue;
1851
- const template = document.createElement("template");
1852
- template.innerHTML = `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16" fill="none" stroke="currentColor" stroke-width="1.2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" data-nav-icon="1">${NAV_ICON_INNER}</svg>`;
1853
- existing.replaceWith(template.content.firstElementChild);
1854
- }
1855
- }
1856
- };
1857
- const observer = new MutationObserver(() => decorate());
1858
- observer.observe(document.body, {
1859
- childList: true,
1860
- subtree: true
1861
- });
1862
- decorate();
1863
- return () => observer.disconnect();
1864
- }, "subagent-library: nav icon decoration");
1865
+ function registerSettingsNavIcon(ctx) {
1866
+ ctx.slots.inject("settings.section.icon", () => ctx.slots.register({
1867
+ name: "settings.section.icon",
1868
+ id: "subagent-library"
1869
+ }, LibraryNavIcon));
1865
1870
  }
1866
1871
 
1867
1872
  //#endregion
@@ -2017,7 +2022,7 @@ function apply(ctx) {
2017
2022
  subscribeRefresh
2018
2023
  })
2019
2024
  }, LibrarySettings));
2020
- decorateSettingsNavIcon(ctx);
2025
+ registerSettingsNavIcon(ctx);
2021
2026
  }
2022
2027
 
2023
2028
  //#endregion
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dsh-subagent-library",
3
- "version": "0.3.5",
3
+ "version": "0.3.6",
4
4
  "description": "Named subagent library for DeepSeek Harness: a directory-backed roster with model, role prompt, depth and background-mode settings, exposed through list_subagents, delegate, a /subagent command and a Settings page.",
5
5
  "keywords": [
6
6
  "deepseek-harness",