dsh-subagent-library 0.2.0 → 0.2.3
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 +144 -0
- package/README.md +49 -5
- package/THIRD_PARTY_NOTICES.md +96 -0
- package/assets/readme/hero.svg +43 -0
- package/assets/readme/screenshot-command-palette.png +0 -0
- package/assets/readme/screenshot-roster.png +0 -0
- package/assets/readme/screenshot-settings.png +0 -0
- package/lib/index.js +7 -7
- package/package.json +17 -11
- package/lib/client.js.map +0 -1
- package/lib/index.js.map +0 -1
package/README.en.md
ADDED
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
# dsh-subagent-library
|
|
2
|
+
|
|
3
|
+
**[中文](./README.md) | English**
|
|
4
|
+
|
|
5
|
+
<p align="center">
|
|
6
|
+
<img src="./assets/readme/hero.svg" width="100%" alt="dsh-subagent-library — named subagent roster plugin for DeepSeek Harness" />
|
|
7
|
+
</p>
|
|
8
|
+
|
|
9
|
+
<p align="center">
|
|
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.1.1--rc.1-4d6bfe?style=flat-square" alt="DeepSeek Harness 0.1.1-rc.1" />
|
|
13
|
+
</p>
|
|
14
|
+
|
|
15
|
+
## Overview
|
|
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 (model + persona + tool filter). Then **just tell the main agent "do this with xxx"** — the model picks and dispatches through two tools by itself:
|
|
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.
|
|
21
|
+
|
|
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.
|
|
23
|
+
|
|
24
|
+
Adding entries needs no hand-written YAML either: ask the main agent to do it (it edits `$DSH_HOME/settings.yaml`, hot-reloaded), or edit visually in the settings page.
|
|
25
|
+
|
|
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`.
|
|
27
|
+
|
|
28
|
+
## Screenshots
|
|
29
|
+
|
|
30
|
+
<p align="center">
|
|
31
|
+
<img src="./assets/readme/screenshot-settings.png" width="75%" alt="Subagent Library settings card: edit roster entries visually" /><br>
|
|
32
|
+
<em>The Subagent Library settings card: add/edit/remove entries visually (model / transport / depth / denied tools / persona)</em>
|
|
33
|
+
</p>
|
|
34
|
+
|
|
35
|
+
<p align="center">
|
|
36
|
+
<img src="./assets/readme/screenshot-command-palette.png" alt="The /subagent command in the command palette" /><br>
|
|
37
|
+
<em>The <code>/subagent</code> command (quick roster viewer)</em>
|
|
38
|
+
</p>
|
|
39
|
+
|
|
40
|
+
<p align="center">
|
|
41
|
+
<img src="./assets/readme/screenshot-roster.png" width="75%" alt="/subagent output: the named subagent roster" /><br>
|
|
42
|
+
<em>Roster output example: one-line role description + model route + continuable marker per entry</em>
|
|
43
|
+
</p>
|
|
44
|
+
|
|
45
|
+
## Configuration
|
|
46
|
+
|
|
47
|
+
`$DSH_HOME/settings.yaml` (hot-reloaded, no restart needed):
|
|
48
|
+
|
|
49
|
+
```yaml
|
|
50
|
+
subagent-library:
|
|
51
|
+
entries:
|
|
52
|
+
k3-reviewer:
|
|
53
|
+
description: Independent read-only review on Kimi K3-256K, with image walkthroughs
|
|
54
|
+
provider: kimi-coding
|
|
55
|
+
model: k3-256k
|
|
56
|
+
persona: |
|
|
57
|
+
You are an independent review agent running on Kimi K3-256K…
|
|
58
|
+
toolFilter:
|
|
59
|
+
deny: [write, edit, todo_write, create_goal, update_goal, subagent, subagent_fork, send_message, interrupt_agent, workflow, ralph, list_subagents, delegate]
|
|
60
|
+
maxDepth: 1
|
|
61
|
+
backgroundMode: continuable
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
Entry fields:
|
|
65
|
+
|
|
66
|
+
| Field | Required | Notes |
|
|
67
|
+
|---|---|---|
|
|
68
|
+
| `id` (dict key) | yes | `[a-z0-9][a-z0-9-]*`, e.g. `k3-reviewer` |
|
|
69
|
+
| `description` | yes | Role description, shown to the model by `list_subagents` |
|
|
70
|
+
| `provider` | no | **LLM route** (e.g. `deepseek-official`, `kimi-coding`); defaults to the caller's default |
|
|
71
|
+
| `model` | no | LLM model id; defaults to the caller's session model |
|
|
72
|
+
| `subagentProvider` | no | **Subagent transport** (a `ctx.subagents` provider such as `spawn`); defaults to the plugin-level default `spawn` |
|
|
73
|
+
| `maxTokens` | no | Subagent output cap |
|
|
74
|
+
| `persona` | no | Subagent system prompt. Personas go through strict `{{…}}` template interpolation (same semantics as deployment personas) — an unregistered variable (e.g. `{{user}}`) fails child activation |
|
|
75
|
+
| `toolFilter` | no | `allow`/`deny` tool-name lists (deny write-class tools for read-only roles; every name must be a registered tool or the save is rejected). **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 |
|
|
76
|
+
| `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 |
|
|
77
|
+
| `backgroundMode` | no | `one-shot` (default) / `continuable` (resumable) |
|
|
78
|
+
|
|
79
|
+
> Mind the two provider concepts: `provider` is the LLM route (`agentOptions.provider`),
|
|
80
|
+
> while `subagentProvider` is the subagent transport (`ctx.subagents` registration name, e.g. `spawn`/`fork`/`acp`).
|
|
81
|
+
|
|
82
|
+
## Install
|
|
83
|
+
|
|
84
|
+
One command, from npm (recommended):
|
|
85
|
+
|
|
86
|
+
```sh
|
|
87
|
+
npx @deepseek-ai/dsh plugin --profile web add dsh-subagent-library
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
Then **restart `dsh web`** (stop the process, run `dsh web` again) and refresh the page.
|
|
91
|
+
|
|
92
|
+
Other install sources:
|
|
93
|
+
|
|
94
|
+
```sh
|
|
95
|
+
# From GitHub (git-hosted plugin; lib/ build artifacts are committed, no local build needed)
|
|
96
|
+
npx @deepseek-ai/dsh plugin --profile web add github:MaRi23333/dsh-subagent-library
|
|
97
|
+
|
|
98
|
+
# From a local checkout
|
|
99
|
+
git clone https://github.com/MaRi23333/dsh-subagent-library.git
|
|
100
|
+
cd dsh-subagent-library
|
|
101
|
+
pnpm install && pnpm run build
|
|
102
|
+
npx @deepseek-ai/dsh plugin --profile web add /absolute/path/to/dsh-subagent-library
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
> The repo commits `lib/` build artifacts, so git installs need no local build; after
|
|
106
|
+
> changing sources run `pnpm run build` and restart.
|
|
107
|
+
> Adding/removing/editing roster entries (`$DSH_HOME/settings.yaml`) is **hot-reloaded** — no restart.
|
|
108
|
+
|
|
109
|
+
## Settings page
|
|
110
|
+
|
|
111
|
+
A **Subagent Library** card appears under Settings: visually add/edit/remove entries
|
|
112
|
+
(description / provider / model / subagentProvider transport / maxTokens / denied tools /
|
|
113
|
+
depth / background mode / persona), written back to `$DSH_HOME/settings.yaml`, hot-reloaded.
|
|
114
|
+
The add card takes the common fields (ID / description / provider / model / transport /
|
|
115
|
+
output cap); the rest (denied tools / depth / background mode / persona) are edited inside
|
|
116
|
+
the entry card.
|
|
117
|
+
|
|
118
|
+
> **Security note:** the roster settings endpoint (`/subagent-library/api`) follows the
|
|
119
|
+
> DSH Web Host's local trust boundary — the plugin itself adds no separate authentication
|
|
120
|
+
> layer. If you bind DSH Web to a LAN, the public internet, or a reverse proxy, put proper
|
|
121
|
+
> authentication and access control in front of it; do not expose this endpoint to
|
|
122
|
+
> untrusted clients — subagent personas and configuration may contain internal working rules.
|
|
123
|
+
|
|
124
|
+
## Design notes
|
|
125
|
+
|
|
126
|
+
- Tools register on the **host plane**: no dependency on any agent preset, and switching presets never loses them;
|
|
127
|
+
- 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;
|
|
128
|
+
- Entries are re-resolved from settings on every operation — hot edits take effect immediately.
|
|
129
|
+
|
|
130
|
+
## Development
|
|
131
|
+
|
|
132
|
+
```sh
|
|
133
|
+
pnpm install
|
|
134
|
+
pnpm run typecheck
|
|
135
|
+
pnpm run build # host: lib/index.js; client: lib/client.js
|
|
136
|
+
```
|
|
137
|
+
|
|
138
|
+
- Dev dependencies are pinned to DSH `0.1.0-rc.6` (see package.json devDependencies); verified compatible up to `0.1.1-rc.1`. If the interfaces drift on other versions, adjust against the corresponding tag of the [deepseek-harness repo](https://github.com/deepseek-ai/deepseek-harness).
|
|
139
|
+
|
|
140
|
+
## License
|
|
141
|
+
|
|
142
|
+
[MIT](./LICENSE). Third-party license notices for code inlined into the build artifacts are in [THIRD_PARTY_NOTICES.md](./THIRD_PARTY_NOTICES.md).
|
|
143
|
+
|
|
144
|
+
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
|
@@ -1,14 +1,54 @@
|
|
|
1
1
|
# dsh-subagent-library
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
**中文 | [English](./README.en.md)**
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
<p align="center">
|
|
6
|
+
<img src="./assets/readme/hero.svg" width="100%" alt="dsh-subagent-library — DeepSeek Harness 具名子代理库插件" />
|
|
7
|
+
</p>
|
|
8
|
+
|
|
9
|
+
<p align="center">
|
|
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.1.1--rc.1-4d6bfe?style=flat-square" alt="DeepSeek Harness 0.1.1-rc.1" />
|
|
13
|
+
</p>
|
|
14
|
+
|
|
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 —
|
|
17
|
+
> manage role entries (model / persona / tool filter / 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.
|
|
21
|
+
|
|
22
|
+
## 简介
|
|
23
|
+
|
|
24
|
+
DeepSeek Harness 的具名子代理库插件:把常用角色(代码审查、红队、多模态理解……)配成一份持久化的具名子代理名册(模型 + persona + 工具过滤),之后**只需告诉主会话 agent「用 xxx 做这件事」**——模型自己通过两个工具完成选人和派活:
|
|
25
|
+
|
|
26
|
+
- `list_subagents` — 列出名册条目(id / 角色描述 / 模型),模型据此挑选;
|
|
6
27
|
- `delegate` — 按 `library_id` 派活:前台等待、后台 one-shot 任务、或 continuable 可续聊子代理(按条目配置)。
|
|
7
28
|
|
|
8
|
-
|
|
29
|
+
任何会话(任意 agent preset)直接可用,**不需要 slash 命令**;`/subagent` 命令只是给人类在命令面板里快速查看名册用的。
|
|
30
|
+
|
|
31
|
+
新增条目也不用手写 YAML:直接让主会话 agent 帮你配(它编辑 `$DSH_HOME/settings.yaml`,热生效),或在设置页里可视化编辑。
|
|
9
32
|
|
|
10
33
|
> 与官方能力的区分:官方 `subagent` 工具是临时派活(每次现场描述任务),官方 `list_agents` 列的是正在运行的子代实例;本插件维护的是**持久化的具名角色名册**(设置页可视化编辑、热生效),模型用 `list_subagents` 选人、`delegate` 按 id 派活。
|
|
11
34
|
|
|
35
|
+
## 界面
|
|
36
|
+
|
|
37
|
+
<p align="center">
|
|
38
|
+
<img src="./assets/readme/screenshot-settings.png" width="75%" alt="设置页「子代理库」卡片:可视化编辑名册条目" /><br>
|
|
39
|
+
<em>设置页「子代理库」卡片:可视化增删改条目(模型 / 传输层 / 深度 / 禁用工具 / persona)</em>
|
|
40
|
+
</p>
|
|
41
|
+
|
|
42
|
+
<p align="center">
|
|
43
|
+
<img src="./assets/readme/screenshot-command-palette.png" alt="命令面板里的 /subagent 命令" /><br>
|
|
44
|
+
<em><code>/subagent</code> 命令(快速查看子代理库名册)</em>
|
|
45
|
+
</p>
|
|
46
|
+
|
|
47
|
+
<p align="center">
|
|
48
|
+
<img src="./assets/readme/screenshot-roster.png" width="75%" alt="/subagent 输出:具名子代理名册一览" /><br>
|
|
49
|
+
<em>名册输出示例:每个条目一句话角色描述 + 模型路由 + 可续聊标记</em>
|
|
50
|
+
</p>
|
|
51
|
+
|
|
12
52
|
## 配置
|
|
13
53
|
|
|
14
54
|
`$DSH_HOME/settings.yaml`(热生效,无需重启):
|
|
@@ -78,6 +118,8 @@ Settings → 设置 里新增「子代理库」卡片:可视化增删改条目
|
|
|
78
118
|
传输层 subagentProvider / 输出上限 maxTokens / 禁用工具 / 深度 / 后台模式 / 角色提示词),写回 `$DSH_HOME/settings.yaml`,热生效。
|
|
79
119
|
新增卡只收常用字段(ID / 描述 / Provider / 模型 / 传输层 / 输出上限),其余字段(禁用工具 / 深度 / 后台模式 / 角色提示词)在条目卡内编辑。
|
|
80
120
|
|
|
121
|
+
> **安全提示**:子代理库的设置接口(`/subagent-library/api`)遵循 DSH Web Host 的本地可信边界,插件自身不含独立身份验证层。若将 DSH Web 绑定到局域网 / 公网 / 反向代理,请在外层配置认证与访问控制,不要把该接口暴露给不可信客户端——子代理 persona 与配置可能包含内部工作规则。
|
|
122
|
+
|
|
81
123
|
## 设计说明
|
|
82
124
|
|
|
83
125
|
- 工具注册在 **host 平面**:不依赖任何 agent preset,切 preset 不会丢;
|
|
@@ -92,8 +134,10 @@ pnpm run typecheck
|
|
|
92
134
|
pnpm run build # host: lib/index.js;client: lib/client.js
|
|
93
135
|
```
|
|
94
136
|
|
|
95
|
-
-
|
|
137
|
+
- 开发依赖锁定 DSH `0.1.0-rc.6`(见 package.json devDependencies),实机验证兼容至 `0.1.1-rc.1`;其他版本如接口漂移请对照 [deepseek-harness 仓库](https://github.com/deepseek-ai/deepseek-harness) 相应 tag 调整。
|
|
96
138
|
|
|
97
139
|
## License
|
|
98
140
|
|
|
99
|
-
[MIT](./LICENSE)
|
|
141
|
+
[MIT](./LICENSE)。本仓库内联构建产物的第三方许可证声明见 [THIRD_PARTY_NOTICES.md](./THIRD_PARTY_NOTICES.md)。
|
|
142
|
+
|
|
143
|
+
本插件是独立社区项目,与 DeepSeek 无任何隶属或背书关系;`DeepSeek Harness` 名称仅用于标明兼容平台。
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
# Third-Party Notices
|
|
2
|
+
|
|
3
|
+
This distribution (`dsh-subagent-library`) bundles third-party code **inlined into
|
|
4
|
+
`lib/index.js`** by the build toolchain (tsdown / rolldown). The list below was
|
|
5
|
+
extracted from the shipped bundle's `//#region node_modules/...` comments exactly —
|
|
6
|
+
**not from the lockfile** — and each entry's license was verified against the
|
|
7
|
+
corresponding `LICENSE` file in the vendored package. Packages that never enter the
|
|
8
|
+
bundle (only `@deepseek-ai/cordis` / `@deepseek-ai/schemastery`, which are kept as
|
|
9
|
+
external `peerDependencies`) are deliberately not listed.
|
|
10
|
+
|
|
11
|
+
`lib/client.js` contains **no third-party package code**: the browser side loads
|
|
12
|
+
React / React DOM via external `require("react")` from the host runtime, and the
|
|
13
|
+
`rolldown:runtime` block is generic bundler-generated helper code, not a package.
|
|
14
|
+
|
|
15
|
+
## Bundled third-party packages / 进 bundle 的第三方包
|
|
16
|
+
|
|
17
|
+
| Package | Version | License | Copyright notice(版权声明原文) |
|
|
18
|
+
|---|---|---|---|
|
|
19
|
+
| `@deepseek-ai/dsh-scope` | 0.1.0-rc.6 | MIT | Copyright (c) 2026 DeepSeek |
|
|
20
|
+
| `@deepseek-ai/dsh-timeout` | 0.1.0-rc.6 | MIT | Copyright (c) 2026 DeepSeek |
|
|
21
|
+
| `@deepseek-ai/dsh-llm` | 0.1.0-rc.6 | MIT | Copyright (c) 2026 DeepSeek |
|
|
22
|
+
| `@deepseek-ai/dsh-session` | 0.1.0-rc.6 | MIT | Copyright (c) 2026 DeepSeek |
|
|
23
|
+
| `@deepseek-ai/dsh-tools` | 0.1.0-rc.6 | MIT | Copyright (c) 2026 DeepSeek |
|
|
24
|
+
| `@deepseek-ai/dsh-subagent` | 0.1.0-rc.6 | MIT | Copyright (c) 2026 DeepSeek |
|
|
25
|
+
| `@deepseek-ai/dsh-settings` | 0.1.0-rc.6 | MIT | Copyright (c) 2026 DeepSeek |
|
|
26
|
+
| `zod` | 4.4.3 | MIT | Copyright (c) 2025 Colin McDonnell |
|
|
27
|
+
|
|
28
|
+
## Verification / 查证说明
|
|
29
|
+
|
|
30
|
+
- All 8 packages are **MIT License**. None is Apache-2.0; no upstream package ships a
|
|
31
|
+
`NOTICE` file, so there are no additional NOTICE obligations beyond keeping the
|
|
32
|
+
copyright + permission notice.
|
|
33
|
+
- The per-package `LICENSE` texts are reproduced verbatim below (two copyright holders:
|
|
34
|
+
DeepSeek 2026 for the seven `@deepseek-ai/*` packages, Colin McDonnell 2025 for zod).
|
|
35
|
+
- `lib/client.js` is excluded from the list by design: React 等浏览器端依赖由宿主运行时以
|
|
36
|
+
外部 `require("react")` 提供,不随本包分发。
|
|
37
|
+
|
|
38
|
+
## License texts(许可证原文,逐字摘自各上游包 LICENSE 文件)
|
|
39
|
+
|
|
40
|
+
### MIT License — Copyright (c) 2026 DeepSeek
|
|
41
|
+
|
|
42
|
+
(`@deepseek-ai/dsh-scope`、`@deepseek-ai/dsh-timeout`、`@deepseek-ai/dsh-llm`、
|
|
43
|
+
`@deepseek-ai/dsh-session`、`@deepseek-ai/dsh-tools`、`@deepseek-ai/dsh-subagent`、
|
|
44
|
+
`@deepseek-ai/dsh-settings` 七个包,文本完全相同)
|
|
45
|
+
|
|
46
|
+
```text
|
|
47
|
+
MIT License
|
|
48
|
+
|
|
49
|
+
Copyright (c) 2026 DeepSeek
|
|
50
|
+
|
|
51
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
52
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
53
|
+
in the Software without restriction, including without limitation the rights
|
|
54
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
55
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
56
|
+
furnished to do so, subject to the following conditions:
|
|
57
|
+
|
|
58
|
+
The above copyright notice and this permission notice shall be included in all
|
|
59
|
+
copies or substantial portions of the Software.
|
|
60
|
+
|
|
61
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
62
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
63
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
64
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
65
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
66
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
67
|
+
SOFTWARE.
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
### MIT License — Copyright (c) 2025 Colin McDonnell
|
|
71
|
+
|
|
72
|
+
(`zod`)
|
|
73
|
+
|
|
74
|
+
```text
|
|
75
|
+
MIT License
|
|
76
|
+
|
|
77
|
+
Copyright (c) 2025 Colin McDonnell
|
|
78
|
+
|
|
79
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
80
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
81
|
+
in the Software without restriction, including without limitation the rights
|
|
82
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
83
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
84
|
+
furnished to do so, subject to the following conditions:
|
|
85
|
+
|
|
86
|
+
The above copyright notice and this permission notice shall be included in all
|
|
87
|
+
copies or substantial portions of the Software.
|
|
88
|
+
|
|
89
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
90
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
91
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
92
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
93
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
94
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
95
|
+
SOFTWARE.
|
|
96
|
+
```
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1200 320" width="1200" height="320">
|
|
2
|
+
<defs>
|
|
3
|
+
<linearGradient id="bg" x1="0" y1="0" x2="1" y2="1">
|
|
4
|
+
<stop offset="0" stop-color="#f8faff"/>
|
|
5
|
+
<stop offset="1" stop-color="#eef2fe"/>
|
|
6
|
+
</linearGradient>
|
|
7
|
+
</defs>
|
|
8
|
+
|
|
9
|
+
<!-- canvas -->
|
|
10
|
+
<rect x="0.5" y="0.5" width="1199" height="319" rx="18" fill="url(#bg)" stroke="#dfe6fb"/>
|
|
11
|
+
|
|
12
|
+
<!-- brand badge: roster glyph (one coordinator node dispatching to three named agents) -->
|
|
13
|
+
<g transform="translate(100,124) scale(4.5)">
|
|
14
|
+
<rect x="-2.2" y="-2.2" width="20.4" height="20.4" rx="4.6" fill="#4d6bfe"/>
|
|
15
|
+
<g fill="none" stroke="#ffffff" stroke-linecap="round" stroke-linejoin="round">
|
|
16
|
+
<circle cx="5" cy="8" r="1.9" stroke-width="1.05"/>
|
|
17
|
+
<circle cx="12.4" cy="4.6" r="1.6" stroke-width="1"/>
|
|
18
|
+
<circle cx="12.4" cy="8" r="1.6" stroke-width="1"/>
|
|
19
|
+
<circle cx="12.4" cy="11.4" r="1.6" stroke-width="1"/>
|
|
20
|
+
<path d="M6.7 7.1L10.9 5.1M6.9 8h3.9M6.7 8.9l4.2 2" stroke-width="0.9"/>
|
|
21
|
+
</g>
|
|
22
|
+
</g>
|
|
23
|
+
|
|
24
|
+
<!-- title / tagline -->
|
|
25
|
+
<text x="248" y="148" font-family="ui-monospace, 'Cascadia Code', Consolas, 'Courier New', monospace"
|
|
26
|
+
font-size="42" font-weight="700" fill="#16204a" letter-spacing="-0.5">dsh-subagent-library</text>
|
|
27
|
+
<text x="248" y="192" font-family="'Segoe UI', 'Microsoft YaHei', system-ui, sans-serif"
|
|
28
|
+
font-size="23" fill="#3d4468">DeepSeek Harness 具名子代理库 · 设置页可视化管理</text>
|
|
29
|
+
<text x="248" y="228" font-family="'Segoe UI', 'Microsoft YaHei', system-ui, sans-serif"
|
|
30
|
+
font-size="16" fill="#7c84a8">list_subagents 选人 · delegate 派活 · 模型 / persona / 工具过滤 / 深度可配</text>
|
|
31
|
+
<text x="248" y="254" font-family="'Segoe UI', 'Microsoft YaHei', system-ui, sans-serif"
|
|
32
|
+
font-size="16" fill="#7c84a8">named subagent roster for the DSH Web GUI</text>
|
|
33
|
+
|
|
34
|
+
<!-- roster tree, right side -->
|
|
35
|
+
<g stroke="#4d6bfe" fill="none" stroke-linecap="round">
|
|
36
|
+
<path d="M970 160h40M1010 160c25 0 25-64 50-64M1010 160h50M1010 160c25 0 25 64 50 64M1010 160c25 0 25 128 50 128" stroke-width="3" opacity="0.45"/>
|
|
37
|
+
<circle cx="950" cy="160" r="20" stroke-width="4"/>
|
|
38
|
+
<circle cx="1082" cy="96" r="15" stroke-width="3.5" opacity="0.9"/>
|
|
39
|
+
<circle cx="1082" cy="160" r="15" stroke-width="3.5" opacity="0.7"/>
|
|
40
|
+
<circle cx="1082" cy="224" r="15" stroke-width="3.5" opacity="0.55"/>
|
|
41
|
+
<circle cx="1082" cy="288" r="15" stroke-width="3.5" opacity="0.4"/>
|
|
42
|
+
</g>
|
|
43
|
+
</svg>
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/lib/index.js
CHANGED
|
@@ -2,7 +2,7 @@ import { createRequire } from "node:module";
|
|
|
2
2
|
import z from "@deepseek-ai/schemastery";
|
|
3
3
|
import { Context, Service } from "@deepseek-ai/cordis";
|
|
4
4
|
|
|
5
|
-
//#region node_modules/.pnpm/@deepseek-ai+dsh-scope@0.1.
|
|
5
|
+
//#region node_modules/.pnpm/@deepseek-ai+dsh-scope@0.1.0-rc.6_@deepseek-ai+cordis@4.0.1_@deepseek-ai+dsh-invariants_6f3351786c779449c277f079a737f571/node_modules/@deepseek-ai/dsh-scope/lib/index.js
|
|
6
6
|
/**
|
|
7
7
|
* Shared insertion-ordered storage and effect ownership for scope-aware registries.
|
|
8
8
|
*
|
|
@@ -282,12 +282,12 @@ function scopeTarget(base, key) {
|
|
|
282
282
|
}
|
|
283
283
|
|
|
284
284
|
//#endregion
|
|
285
|
-
//#region node_modules/.pnpm/@deepseek-ai+dsh-timeout@0.
|
|
285
|
+
//#region node_modules/.pnpm/@deepseek-ai+dsh-timeout@0.1.0-rc.6_@deepseek-ai+cordis@4.0.1_@deepseek-ai+dsh-invarian_8c173ab999b05cf1db05d479dd44e888/node_modules/@deepseek-ai/dsh-timeout/lib/index.js
|
|
286
286
|
/** Largest delay Node schedules without clamping it to one millisecond. */
|
|
287
287
|
const MAX_TIMER_DELAY_MS = 2147483647;
|
|
288
288
|
|
|
289
289
|
//#endregion
|
|
290
|
-
//#region node_modules/.pnpm/@deepseek-ai+dsh-llm@0.1.0-
|
|
290
|
+
//#region node_modules/.pnpm/@deepseek-ai+dsh-llm@0.1.0-rc.6_@deepseek-ai+cordis@4.0.1_@deepseek-ai+dsh-attachment@0_4ed4e5c71eb965b0bd6912871e829940/node_modules/@deepseek-ai/dsh-llm/lib/index.js
|
|
291
291
|
/**
|
|
292
292
|
* Brand a string as a {@link CallId}.
|
|
293
293
|
* @param id - the provider-issued (or synthesized) call id.
|
|
@@ -442,7 +442,7 @@ function assertNever(value, context) {
|
|
|
442
442
|
}
|
|
443
443
|
|
|
444
444
|
//#endregion
|
|
445
|
-
//#region node_modules/.pnpm/@deepseek-ai+dsh-session@0.
|
|
445
|
+
//#region node_modules/.pnpm/@deepseek-ai+dsh-session@0.1.0-rc.6_6fd26f59436a18b115f326d6060415e6/node_modules/@deepseek-ai/dsh-session/lib/index.js
|
|
446
446
|
/** Lossless-JSON validation and detached snapshots for durable session data. @module @deepseek-ai/dsh-session/json */
|
|
447
447
|
/** Whether a realm-owned intrinsic prototype is backed by its native constructor. */
|
|
448
448
|
function hasIntrinsicConstructor$1(prototype, name$1) {
|
|
@@ -647,7 +647,7 @@ var SessionPreparation = class SessionPreparation$1 {
|
|
|
647
647
|
};
|
|
648
648
|
|
|
649
649
|
//#endregion
|
|
650
|
-
//#region node_modules/.pnpm/@deepseek-ai+dsh-tools@0.1.
|
|
650
|
+
//#region node_modules/.pnpm/@deepseek-ai+dsh-tools@0.1.0-rc.6_f8724372086ccc1457fc84e7becee2e0/node_modules/@deepseek-ai/dsh-tools/lib/index.js
|
|
651
651
|
/**
|
|
652
652
|
* Enforced JSON Schema subset shared by tool outputs, generated Code Mode
|
|
653
653
|
* types, subagents, and workflows. The subset accepts any JSON root, an
|
|
@@ -8261,7 +8261,7 @@ const describe = describe$1;
|
|
|
8261
8261
|
const meta = meta$1;
|
|
8262
8262
|
|
|
8263
8263
|
//#endregion
|
|
8264
|
-
//#region node_modules/.pnpm/@deepseek-ai+dsh-subagent@
|
|
8264
|
+
//#region node_modules/.pnpm/@deepseek-ai+dsh-subagent@0.1.0-rc.6_8b00c1f8ce51e08c328cf93c42b529f7/node_modules/@deepseek-ai/dsh-subagent/lib/index.js
|
|
8265
8265
|
/**
|
|
8266
8266
|
* Reject a recursion cap that cannot represent an exact delegation depth.
|
|
8267
8267
|
* @param maxDepth - the optional runtime value to validate.
|
|
@@ -8451,7 +8451,7 @@ async function settleRun(run) {
|
|
|
8451
8451
|
}
|
|
8452
8452
|
|
|
8453
8453
|
//#endregion
|
|
8454
|
-
//#region node_modules/.pnpm/@deepseek-ai+dsh-settings@0_52495af71738a1095726249ceff4fd7b/node_modules/@deepseek-ai/dsh-settings/lib/index.js
|
|
8454
|
+
//#region node_modules/.pnpm/@deepseek-ai+dsh-settings@0.1.0-rc.6_@deepseek-ai+cordis@4.0.1_@deepseek-ai+dsh-brand@0_52495af71738a1095726249ceff4fd7b/node_modules/@deepseek-ai/dsh-settings/lib/index.js
|
|
8455
8455
|
/**
|
|
8456
8456
|
* Structural secret redaction for settings values. `role('secret')` fields are
|
|
8457
8457
|
* removed from a value before it crosses a wire boundary; a sidecar records
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dsh-subagent-library",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.3",
|
|
4
4
|
"description": "Named subagent library for DeepSeek Harness: a settings-driven roster of role subagents (model + persona + tool filter), exposed to every session through the list_subagents and delegate tools, a /subagent command, and a Settings page.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"deepseek-harness",
|
|
@@ -11,6 +11,7 @@
|
|
|
11
11
|
],
|
|
12
12
|
"type": "module",
|
|
13
13
|
"main": "lib/index.js",
|
|
14
|
+
"packageManager": "pnpm@11.21.0",
|
|
14
15
|
"engines": {
|
|
15
16
|
"node": ">=22"
|
|
16
17
|
},
|
|
@@ -33,10 +34,14 @@
|
|
|
33
34
|
"./package.json": "./package.json"
|
|
34
35
|
},
|
|
35
36
|
"files": [
|
|
36
|
-
"lib",
|
|
37
|
+
"lib/index.js",
|
|
38
|
+
"lib/client.js",
|
|
37
39
|
"cordis.patch.yml",
|
|
38
40
|
"README.md",
|
|
39
|
-
"
|
|
41
|
+
"README.en.md",
|
|
42
|
+
"LICENSE",
|
|
43
|
+
"THIRD_PARTY_NOTICES.md",
|
|
44
|
+
"assets/readme"
|
|
40
45
|
],
|
|
41
46
|
"dsh": {
|
|
42
47
|
"bundle": {
|
|
@@ -52,6 +57,14 @@
|
|
|
52
57
|
"platform": "web"
|
|
53
58
|
}
|
|
54
59
|
},
|
|
60
|
+
"scripts": {
|
|
61
|
+
"build": "tsdown",
|
|
62
|
+
"typecheck": "tsc --noEmit",
|
|
63
|
+
"test": "tsx --test tests/api.test.ts tests/tools.test.ts",
|
|
64
|
+
"smoke": "node scripts/smoke-host.mjs && node scripts/smoke-client.mjs",
|
|
65
|
+
"check:pack": "node scripts/check-pack.mjs",
|
|
66
|
+
"prepack": "pnpm run build"
|
|
67
|
+
},
|
|
55
68
|
"license": "MIT",
|
|
56
69
|
"peerDependencies": {
|
|
57
70
|
"@deepseek-ai/cordis": "^4.0.1",
|
|
@@ -84,12 +97,5 @@
|
|
|
84
97
|
"tsdown": "^0.15.0",
|
|
85
98
|
"tsx": "^4.19.0",
|
|
86
99
|
"typescript": "^5.7.0"
|
|
87
|
-
},
|
|
88
|
-
"scripts": {
|
|
89
|
-
"build": "tsdown",
|
|
90
|
-
"typecheck": "tsc --noEmit",
|
|
91
|
-
"test": "tsx --test tests/api.test.ts tests/tools.test.ts",
|
|
92
|
-
"smoke": "node scripts/smoke-host.mjs && node scripts/smoke-client.mjs",
|
|
93
|
-
"check:pack": "node scripts/check-pack.mjs"
|
|
94
100
|
}
|
|
95
|
-
}
|
|
101
|
+
}
|
package/lib/client.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"client.js","names":["readView","writeView","clean: StoredEntry","zh: Record<SubagentLibraryKey, string>","en: Record<SubagentLibraryKey, string>","ERROR_TEXT: Record<string, string>","body: unknown"],"sources":["../src/client/LibrarySettings.tsx","../src/client/locales.ts","../src/client/index.tsx"],"sourcesContent":["/**\n * Settings section: edit the subagent library document through the plugin's\n * own host routes. A `settings-conflict` (409) reloads instead of clobbering\n * a concurrent change.\n */\nimport { useEffect, useRef, useState } from 'react'\nimport type { InjectFace, PropsRuntime } from '@deepseek-ai/dsh-client-ui-slots'\nimport type {} from '@deepseek-ai/dsh-client-ui-settings/client'\nimport type { LibraryView, LibraryWrite, LibraryWriteResult, StoredEntry } from './index.tsx'\n\nexport interface LibrarySettingsInjected {\n readView: () => Promise<LibraryView>\n writeView: (write: LibraryWrite) => Promise<LibraryWriteResult>\n /** Re-run the loader on any pushed `settings/document-updated` for this\n * namespace; the push's revision lets the section skip its own echo. */\n subscribeRefresh: (fn: (revision?: number) => void) => () => void\n}\n\nexport type LibrarySettingsProps =\n PropsRuntime<'settings.section'>\n & InjectFace<LibrarySettingsInjected>\n\nexport function LibrarySettings(props: LibrarySettingsProps): React.ReactElement {\n const { readView, writeView, subscribeRefresh } = props\n\n const [view, setView] = useState<LibraryView | null>(null)\n const [entries, setEntries] = useState<Record<string, StoredEntry>>({})\n const [busy, setBusy] = useState(false)\n const [status, setStatus] = useState<{ kind: 'ok' | 'error'; text: string } | null>(null)\n const [newId, setNewId] = useState('')\n const [newEntry, setNewEntry] = useState<StoredEntry>({ description: '', provider: '', model: '', backgroundMode: 'one-shot' })\n\n const alive = useRef(true)\n /** Synchronous busy flag (see applyWrite's re-entry guard). */\n const busyRef = useRef(false)\n useEffect(() => () => { alive.current = false }, [])\n\n /** Revision of the last committed server state (successful write or load).\n * document-updated pushes at or below it are our own write's echo and are\n * skipped — applyWrite already merged the touched row, and a full reload\n * here would wipe unsaved drafts in other rows. External pushes (higher\n * revisions) still reload. */\n const lastCommitted = useRef<number | null>(null)\n /** True while a write request is in flight: the push and the HTTP response\n * travel on independent channels, so a push may arrive before the response\n * commits our state. Everything in this window is skipped and the newest\n * skipped revision is re-checked after the response. */\n const pendingSelfWrite = useRef(false)\n const skippedWhilePending = useRef<number | null>(null)\n\n const load = (): void => {\n void (async () => {\n try {\n const next = await readView()\n if (!alive.current) return\n lastCommitted.current = next.revision\n setView(next)\n setEntries(structuredClone(next.entries))\n } catch (error) {\n if (alive.current) setStatus({ kind: 'error', text: String(error) })\n }\n })()\n }\n\n useEffect(() => {\n load()\n return subscribeRefresh((revision) => {\n if (pendingSelfWrite.current) {\n if (revision !== undefined) skippedWhilePending.current = Math.max(skippedWhilePending.current ?? -1, revision)\n return\n }\n if (revision !== undefined && lastCommitted.current !== null && revision <= lastCommitted.current) return\n load()\n })\n }, [subscribeRefresh])\n\n const applyWrite = async (write: LibraryWrite, touchedId: string): Promise<boolean> => {\n // Synchronous re-entry guard: setBusy is async state, so two clicks in the\n // same frame would both fire applyWrite with one expectedRevision and the\n // second would 409 — then reload and wipe drafts in other rows.\n if (busyRef.current) return false\n busyRef.current = true\n setBusy(true)\n setStatus(null)\n pendingSelfWrite.current = true\n try {\n const result = await writeView(write)\n if (!alive.current) return false\n pendingSelfWrite.current = false\n const skipped = skippedWhilePending.current\n skippedWhilePending.current = null\n if (result.ok) {\n lastCommitted.current = result.view.revision\n setView(result.view)\n // Merge only the row this write touched (fresh server value);\n // unsaved drafts in other rows survive — they are never persisted,\n // because save bases on view.entries.\n setEntries((current) => {\n const next = { ...current }\n const fresh = result.view.entries[touchedId]\n if (fresh !== undefined) next[touchedId] = structuredClone(fresh)\n else delete next[touchedId]\n return next\n })\n setStatus({ kind: 'ok', text: '已保存' })\n // A push skipped while the write was in flight may have carried a\n // newer external change; reload to pick it up.\n if (skipped !== null && skipped > result.view.revision) load()\n return true\n }\n skippedWhilePending.current = null\n if (result.conflict) {\n setStatus({ kind: 'error', text: '配置已被其他窗口修改,已重新加载,请重试。' })\n load()\n } else {\n // A push skipped while the failed write was in flight may have\n // carried a newer external change; our write did not advance the\n // revision, so reload when that skipped change is beyond what we\n // last committed.\n if (skipped !== null && lastCommitted.current !== null && skipped > lastCommitted.current) load()\n setStatus({ kind: 'error', text: result.message ?? '保存失败' })\n }\n return false\n } finally {\n pendingSelfWrite.current = false\n busyRef.current = false\n if (alive.current) setBusy(false)\n }\n }\n\n /** Normalize one entry for persistence: empty optional fields are dropped\n * (they then fall back to their defaults instead of being stored as '' or\n * stale values), and toolFilter survives only while it still scopes\n * something — an allow list alone must NOT be deleted by an editor that\n * only shows deny. */\n const cleanEntry = (entry: StoredEntry): StoredEntry => {\n const clean: StoredEntry = { ...entry }\n if (clean.provider === '') delete clean.provider\n if (clean.model === '') delete clean.model\n if (clean.subagentProvider === '') delete clean.subagentProvider\n if (clean.persona === '') delete clean.persona\n if (clean.description === '') delete clean.description\n if (clean.maxDepth === undefined) delete clean.maxDepth\n if (clean.maxTokens === undefined) delete clean.maxTokens\n const filter = clean.toolFilter\n if (filter !== undefined\n && (filter.allow === undefined || filter.allow.length === 0)\n && (filter.deny === undefined || filter.deny.length === 0)) {\n delete clean.toolFilter\n }\n return clean\n }\n\n const updateEntry = (id: string, entry: StoredEntry): void => {\n if ((entry.description ?? '').trim() === '') {\n setStatus({ kind: 'error', text: '描述不能为空。' })\n return\n }\n if (entry.maxDepth !== undefined && (!Number.isInteger(entry.maxDepth) || entry.maxDepth < 1)) {\n setStatus({ kind: 'error', text: '深度上限需为 ≥1 的整数。' })\n return\n }\n if (entry.maxTokens !== undefined && (!Number.isInteger(entry.maxTokens) || entry.maxTokens < 1)) {\n setStatus({ kind: 'error', text: '输出上限需为 ≥1 的整数。' })\n return\n }\n // Save against the server truth, not the local snapshot: an unsaved draft\n // in another row must never be silently persisted by this row's button.\n void applyWrite({ op: 'save', entries: { ...(view?.entries ?? {}), [id]: cleanEntry(entry) }, expectedRevision: view?.revision }, id)\n }\n\n const removeEntry = (id: string): void => {\n if (!window.confirm(`确认删除子代理 \"${id}\"?该操作立即写入 settings.yaml。`)) return\n void applyWrite({ op: 'delete', id, expectedRevision: view?.revision }, id)\n }\n\n const addEntry = (): void => {\n const id = newId.trim()\n if (!/^[a-z0-9][a-z0-9-]*$/.test(id) || (newEntry.description ?? '').trim() === '') {\n setStatus({ kind: 'error', text: 'ID 需为小写字母/数字/连字符,且必须有描述。' })\n return\n }\n const serverEntries = view?.entries ?? {}\n if (serverEntries[id] !== undefined) {\n setStatus({ kind: 'error', text: `ID \"${id}\" 已存在。` })\n return\n }\n if (newEntry.maxTokens !== undefined && (!Number.isInteger(newEntry.maxTokens) || newEntry.maxTokens < 1)) {\n setStatus({ kind: 'error', text: '输出上限需为 ≥1 的整数。' })\n return\n }\n void applyWrite({ op: 'save', entries: { ...serverEntries, [id]: cleanEntry(newEntry) }, expectedRevision: view?.revision }, id).then((ok) => {\n if (alive.current && ok) {\n setNewId('')\n setNewEntry({ description: '', provider: '', model: '', backgroundMode: 'one-shot' })\n }\n })\n }\n\n const rowStyle = { display: 'flex', alignItems: 'center', gap: '8px' } as const\n /** Shrinkable multi-column row: min-width 0 lets inputs shrink below their\n * intrinsic width instead of overflowing the settings card (form controls\n * otherwise keep their default width as a flex minimum). */\n const colStyle = { ...rowStyle, flex: 1, minWidth: 0 } as const\n const labelStyle = { fontSize: '13px', opacity: 0.85, minWidth: '72px' } as const\n const inputStyle = {\n flex: 1,\n minWidth: 0,\n fontSize: '13px',\n fontFamily: 'monospace',\n padding: '4px 8px',\n border: '1px solid var(--dsh-color-border, #3a3f4b)',\n borderRadius: '4px',\n background: 'transparent',\n color: 'inherit',\n } as const\n const buttonStyle = {\n padding: '3px 12px',\n fontSize: '12px',\n cursor: 'pointer',\n opacity: busy ? 0.55 : 1,\n } as const\n const cardStyle = {\n display: 'flex',\n flexDirection: 'column',\n gap: '6px',\n padding: '10px 12px',\n border: '1px solid var(--dsh-color-border, #3a3f4b)',\n borderRadius: '6px',\n } as const\n const hintStyle = { fontSize: '11px', opacity: 0.6, marginTop: '2px' } as const\n\n if (view === null) {\n return (\n <div style={{ display: 'flex', flexDirection: 'column', gap: '8px', padding: '12px 4px' }}>\n <div style={{ display: 'flex', alignItems: 'center', gap: '10px' }}>\n <div style={{ fontSize: '15px', fontWeight: 600 }}>子代理库</div>\n <button type=\"button\" onClick={load} style={{ ...buttonStyle, opacity: 0.7 }}>重试</button>\n </div>\n {status !== null && (\n <div style={{ fontSize: '12px', color: status.kind === 'ok' ? 'var(--dsh-color-success, #30a46c)' : 'var(--dsh-color-danger, #e5484d)', whiteSpace: 'pre-wrap' }}>\n {status.text}\n </div>\n )}\n {status === null && <div style={{ fontSize: '13px', opacity: 0.8 }}>正在加载…(若长时间无响应,请重试或检查插件是否加载)</div>}\n </div>\n )\n }\n\n const ids = Object.keys(entries)\n\n return (\n <div style={{ display: 'flex', flexDirection: 'column', gap: '10px', padding: '12px 4px', maxWidth: '720px' }}>\n <div style={{ display: 'flex', flexDirection: 'column', gap: '2px' }}>\n <div style={{ display: 'flex', alignItems: 'center', gap: '10px' }}>\n <div style={{ fontSize: '15px', fontWeight: 600 }}>子代理库</div>\n <button type=\"button\" onClick={load} style={{ ...buttonStyle, opacity: 0.7 }}>刷新</button>\n </div>\n <span style={hintStyle}>管理具名角色子代理。保存后热生效:模型可在任意会话通过 list_subagents / delegate 使用。</span>\n </div>\n\n {!view.writable && <div style={{ fontSize: '12px', opacity: 0.7 }}>(当前设置只读)</div>}\n\n {ids.length === 0 && (\n <div style={{ fontSize: '13px', opacity: 0.8 }}>库为空。添加第一个条目开始使用。</div>\n )}\n\n {ids.map((id) => {\n const entry = entries[id]\n return (\n <div key={id} style={cardStyle}>\n <div style={{ display: 'flex', alignItems: 'center', gap: '10px' }}>\n <span style={{ fontSize: '13px', fontWeight: 600, fontFamily: 'monospace' }}>{id}</span>\n <span style={{ fontSize: '11px', opacity: 0.7 }}>\n {entry.provider || '默认路由'}/{entry.model || '默认模型'}\n {entry.backgroundMode === 'continuable' ? ' · 可续聊' : ''}\n {entry.maxDepth !== undefined ? ` · 深度${entry.maxDepth}` : ''}\n {entry.maxTokens !== undefined ? ` · ${entry.maxTokens}tok` : ''}\n </span>\n <span style={{ flex: 1 }} />\n <button type=\"button\" disabled={busy || !view.writable} onClick={() => removeEntry(id)} style={buttonStyle}>删除</button>\n <button type=\"button\" disabled={busy || !view.writable} onClick={() => updateEntry(id, entry)} style={buttonStyle}>保存</button>\n </div>\n\n <div style={rowStyle}>\n <span style={labelStyle}>描述</span>\n <input\n value={entry.description ?? ''}\n onChange={(event) => setEntries({ ...entries, [id]: { ...entry, description: event.target.value } })}\n placeholder=\"角色描述(模型可见)\"\n style={inputStyle}\n />\n </div>\n\n <div style={{ display: 'flex', flexWrap: 'wrap', gap: '8px' }}>\n <div style={colStyle}>\n <span style={labelStyle}>Provider</span>\n <input\n value={entry.provider ?? ''}\n onChange={(event) => setEntries({ ...entries, [id]: { ...entry, provider: event.target.value } })}\n placeholder=\"deepseek-official / kimi-coding\"\n style={inputStyle}\n />\n </div>\n <div style={colStyle}>\n <span style={labelStyle}>模型</span>\n <input\n value={entry.model ?? ''}\n onChange={(event) => setEntries({ ...entries, [id]: { ...entry, model: event.target.value } })}\n placeholder=\"k3-256k\"\n style={inputStyle}\n />\n </div>\n </div>\n\n <div style={{ display: 'flex', flexWrap: 'wrap', gap: '8px' }}>\n <div style={colStyle}>\n <span style={labelStyle}>传输层</span>\n <input\n value={entry.subagentProvider ?? ''}\n onChange={(event) => setEntries({ ...entries, [id]: { ...entry, subagentProvider: event.target.value } })}\n placeholder=\"spawn(默认)\"\n style={inputStyle}\n />\n </div>\n <div style={colStyle}>\n <span style={labelStyle}>输出上限</span>\n <input\n type=\"number\"\n min={1}\n value={entry.maxTokens ?? ''}\n onChange={(event) => setEntries({ ...entries, [id]: { ...entry, maxTokens: event.target.value === '' ? undefined : Number(event.target.value) } })}\n placeholder=\"tokens\"\n style={{ ...inputStyle, maxWidth: '110px' }}\n />\n </div>\n </div>\n\n <div style={{ display: 'flex', flexWrap: 'wrap', gap: '8px' }}>\n <div style={colStyle}>\n <span style={labelStyle}>深度上限</span>\n <input\n type=\"number\"\n min={1}\n value={entry.maxDepth ?? ''}\n onChange={(event) => setEntries({ ...entries, [id]: { ...entry, maxDepth: event.target.value === '' ? undefined : Number(event.target.value) } })}\n style={{ ...inputStyle, maxWidth: '80px' }}\n />\n </div>\n <div style={colStyle}>\n <span style={labelStyle}>后台模式</span>\n <select\n value={entry.backgroundMode ?? 'one-shot'}\n onChange={(event) => setEntries({ ...entries, [id]: { ...entry, backgroundMode: event.target.value as 'one-shot' | 'continuable' } })}\n style={{ ...inputStyle, maxWidth: '140px' }}\n >\n <option value=\"one-shot\">one-shot</option>\n <option value=\"continuable\">continuable</option>\n </select>\n </div>\n <div style={{ ...colStyle, flex: 2 }}>\n <span style={labelStyle}>禁用工具</span>\n <input\n value={(entry.toolFilter?.deny ?? []).join(', ')}\n onChange={(event) => {\n const deny = event.target.value.split(',').map((item) => item.trim()).filter(Boolean)\n // The editor only shows deny; a hand-written allow list is\n // preserved so an edit to deny cannot silently drop it.\n const allow = entry.toolFilter?.allow\n setEntries({\n ...entries,\n [id]: {\n ...entry,\n toolFilter: (allow !== undefined && allow.length > 0) || deny.length > 0\n ? {\n ...(allow !== undefined && allow.length > 0 ? { allow } : {}),\n ...(deny.length > 0 ? { deny } : {}),\n }\n : undefined,\n },\n })\n }}\n placeholder=\"write, edit, todo_write, …\"\n style={inputStyle}\n />\n </div>\n </div>\n\n <div style={rowStyle}>\n <span style={labelStyle}>角色提示词</span>\n <textarea\n value={entry.persona ?? ''}\n onChange={(event) => setEntries({ ...entries, [id]: { ...entry, persona: event.target.value } })}\n placeholder=\"子代理的系统提示词(可选)\"\n rows={3}\n style={{ ...inputStyle, resize: 'vertical', fontFamily: 'inherit' }}\n />\n </div>\n </div>\n )\n })}\n\n {/* Add-card mirrors the entry-card rhythm: header row with the action\n button on the right, then one label row per field group. */}\n <div style={cardStyle}>\n <div style={{ display: 'flex', alignItems: 'center', gap: '10px' }}>\n <span style={{ fontSize: '13px', fontWeight: 600 }}>新增子代理</span>\n <span style={{ flex: 1 }} />\n <button type=\"button\" disabled={busy || !view.writable} onClick={addEntry} style={buttonStyle}>添加</button>\n </div>\n <div style={rowStyle}>\n <span style={labelStyle}>ID</span>\n <input value={newId} onChange={(event) => setNewId(event.target.value)} placeholder=\"k3-reviewer\" style={{ ...inputStyle, maxWidth: '200px' }} />\n </div>\n <div style={rowStyle}>\n <span style={labelStyle}>描述</span>\n <input\n value={newEntry.description ?? ''}\n onChange={(event) => setNewEntry({ ...newEntry, description: event.target.value })}\n placeholder=\"角色描述(模型可见)\"\n style={inputStyle}\n />\n </div>\n <div style={{ display: 'flex', flexWrap: 'wrap', gap: '8px' }}>\n <div style={colStyle}>\n <span style={labelStyle}>Provider</span>\n <input value={newEntry.provider ?? ''} onChange={(event) => setNewEntry({ ...newEntry, provider: event.target.value })} placeholder=\"kimi-coding\" style={inputStyle} />\n </div>\n <div style={colStyle}>\n <span style={labelStyle}>模型</span>\n <input value={newEntry.model ?? ''} onChange={(event) => setNewEntry({ ...newEntry, model: event.target.value })} placeholder=\"k3-256k\" style={inputStyle} />\n </div>\n </div>\n <div style={{ display: 'flex', flexWrap: 'wrap', gap: '8px' }}>\n <div style={colStyle}>\n <span style={labelStyle}>传输层</span>\n <input value={newEntry.subagentProvider ?? ''} onChange={(event) => setNewEntry({ ...newEntry, subagentProvider: event.target.value })} placeholder=\"spawn(默认)\" style={inputStyle} />\n </div>\n <div style={colStyle}>\n <span style={labelStyle}>输出上限</span>\n <input\n type=\"number\"\n min={1}\n value={newEntry.maxTokens ?? ''}\n onChange={(event) => setNewEntry({ ...newEntry, maxTokens: event.target.value === '' ? undefined : Number(event.target.value) })}\n placeholder=\"tokens(可选)\"\n style={{ ...inputStyle, maxWidth: '110px' }}\n />\n </div>\n </div>\n </div>\n\n {status !== null && (\n <div style={{ fontSize: '12px', color: status.kind === 'ok' ? 'var(--dsh-color-success, #30a46c)' : 'var(--dsh-color-danger, #e5484d)' }}>\n {status.text}\n </div>\n )}\n\n <div style={{ fontSize: '11px', opacity: 0.55, paddingTop: '4px' }}>配置存储于 $DSH_HOME/settings.yaml 的 subagent-library.entries。</div>\n </div>\n )\n}\n","/**\n * 子代理库设置词典(最少化:zh 主、en 兜底)。\n * The namespace merge into LocaleNamespaceMap is what makes the slot-level\n * `locale` seat and the typed `t` prop work.\n */\nimport type {} from '@deepseek-ai/dsh-client-ui-slots'\n\ndeclare module '@deepseek-ai/dsh-client-ui-slots' {\n interface LocaleNamespaceMap {\n 'subagent-library': SubagentLibraryKey\n }\n}\n\nexport type SubagentLibraryKey =\n | 'settings.title'\n | 'settings.hint'\n | 'settings.empty'\n | 'settings.missing'\n | 'settings.add'\n | 'settings.addNew'\n | 'settings.delete'\n | 'settings.save'\n | 'settings.saved'\n | 'settings.conflict'\n | 'settings.error'\n | 'settings.id'\n | 'settings.description'\n | 'settings.model'\n | 'settings.persona'\n | 'settings.toolFilter'\n | 'settings.maxDepth'\n | 'settings.background'\n | 'settings.provider'\n | 'settings.sourceHint'\n\nexport const zh: Record<SubagentLibraryKey, string> = {\n 'settings.title': '子代理库',\n 'settings.hint': '管理具名角色子代理。保存后热生效:模型可在任意会话通过 list_subagents / delegate 使用。',\n 'settings.empty': '库为空。添加第一个条目开始使用。',\n 'settings.missing': '未找到 subagent-library 配置段(插件未加载?)。',\n 'settings.add': '添加',\n 'settings.addNew': '新增子代理',\n 'settings.delete': '删除',\n 'settings.save': '保存',\n 'settings.saved': '已保存',\n 'settings.conflict': '配置已被其他窗口修改,已重新加载,请重试。',\n 'settings.error': '保存失败:',\n 'settings.id': 'ID',\n 'settings.description': '描述',\n 'settings.model': '模型',\n 'settings.persona': '角色提示词',\n 'settings.toolFilter': '禁用工具',\n 'settings.maxDepth': '深度上限',\n 'settings.background': '后台模式',\n 'settings.provider': 'Provider',\n 'settings.sourceHint': '配置存储于 $DSH_HOME/settings.yaml 的 subagent-library.entries。',\n}\n\nexport const en: Record<SubagentLibraryKey, string> = {\n 'settings.title': 'Subagent Library',\n 'settings.hint': 'Manage named role subagents. Changes apply live: models use them via list_subagents / delegate in any session.',\n 'settings.empty': 'Library is empty. Add the first entry to get started.',\n 'settings.missing': 'No subagent-library section found (plugin not loaded?).',\n 'settings.add': 'Add',\n 'settings.addNew': 'New subagent',\n 'settings.delete': 'Delete',\n 'settings.save': 'Save',\n 'settings.saved': 'Saved',\n 'settings.conflict': 'Config changed elsewhere; reloaded — please retry.',\n 'settings.error': 'Save failed: ',\n 'settings.id': 'ID',\n 'settings.description': 'Description',\n 'settings.model': 'Model',\n 'settings.persona': 'Persona',\n 'settings.toolFilter': 'Denied tools',\n 'settings.maxDepth': 'Max depth',\n 'settings.background': 'Background',\n 'settings.provider': 'Provider',\n 'settings.sourceHint': 'Stored at $DSH_HOME/settings.yaml under subagent-library.entries.',\n}\n","/**\n * dsh-subagent-library — browser half.\n *\n * A Settings section card (\"子代理库\") that reads and edits the\n * `subagent-library` settings namespace through the plugin's own host routes\n * (`/subagent-library/api`). The standard `api.settings.*` wire face cannot\n * serve a third-party namespace in this harness build (the gateway only\n * exposes its own allowlist), so the editor talks to the host directly,\n * exactly like dsh-plugin-fish-tts does.\n */\nimport type { ClientContext } from '@deepseek-ai/dsh-client-runtime/client'\nimport type {} from '@deepseek-ai/dsh-client-ui-settings/client'\nimport type {} from '@deepseek-ai/dsh-client-locale/client'\nimport type {} from '@deepseek-ai/dsh-api-remotes/client'\nimport { LibrarySettings, type LibrarySettingsInjected } from './LibrarySettings.tsx'\nimport { en, zh } from './locales.ts'\n\nconst NS = 'subagent-library'\nconst API_PATH = '/subagent-library/api'\n\n/** Wire view of one library entry as stored in the settings document. */\nexport interface StoredEntry {\n description?: string\n provider?: string\n model?: string\n subagentProvider?: string\n maxTokens?: number\n persona?: string\n toolFilter?: { allow?: string[]; deny?: string[] }\n maxDepth?: number\n backgroundMode?: 'one-shot' | 'continuable'\n}\n\nexport interface LibraryView {\n writable: boolean\n revision: number\n entries: Record<string, StoredEntry>\n}\n\nexport type LibraryWrite =\n | { op: 'save'; entries: Record<string, StoredEntry>; expectedRevision?: number }\n | { op: 'delete'; id: string; expectedRevision?: number }\n\nexport type LibraryWriteResult =\n | { ok: true; view: LibraryView }\n | { ok: false; conflict?: boolean; message?: string }\n\n/** Host error codes that carry no `message`; map them to user-facing text. */\nconst ERROR_TEXT: Record<string, string> = {\n 'not-ready': '设置服务尚未就绪,请稍后重试。',\n 'readonly': '设置当前为只读,无法写入。',\n 'content-type-json-required': '请求被拒绝:写入只接受 JSON。',\n 'cross-origin-forbidden': '请求被拒绝:跨源写入。',\n 'body-too-large': '请求体超过 1 MiB 上限。',\n 'bad-json': '请求体不是合法 JSON。',\n 'entries-object-required': '缺少 entries 对象。',\n 'invalid-id': '条目 ID 非法。',\n 'unknown-op': '未知操作。',\n}\n\nasync function readView(): Promise<LibraryView> {\n const response = await fetch(API_PATH, { cache: 'no-store' })\n const body: unknown = await response.json()\n if (!response.ok || typeof body !== 'object' || body === null || (body as { ok?: boolean }).ok !== true) {\n const error = (body as { error?: string } | null)?.error\n // A diagnostic `message` (e.g. settings-seam registration failure) wins\n // over the generic per-code text.\n const message = (body as { message?: string } | null)?.message\n throw new Error(message ?? (error !== undefined ? ERROR_TEXT[error] : undefined) ?? '子代理库接口不可用(插件未加载?)')\n }\n const value = body as { writable: boolean; revision: number; entries: Record<string, StoredEntry> }\n return { writable: value.writable, revision: value.revision, entries: value.entries ?? {} }\n}\n\nasync function writeView(write: LibraryWrite): Promise<LibraryWriteResult> {\n try {\n const response = await fetch(API_PATH, {\n method: 'POST',\n headers: { 'content-type': 'application/json' },\n body: JSON.stringify(write),\n cache: 'no-store',\n })\n const body: unknown = await response.json()\n if (response.status === 409) return { ok: false, conflict: true }\n if (!response.ok || typeof body !== 'object' || body === null || (body as { ok?: boolean }).ok !== true) {\n const message = (body as { message?: string } | null)?.message\n const error = (body as { error?: string } | null)?.error\n return { ok: false, message: message ?? (error !== undefined ? ERROR_TEXT[error] : undefined) ?? '保存失败' }\n }\n const value = body as { writable: boolean; revision: number; entries: Record<string, StoredEntry> }\n return { ok: true, view: { writable: value.writable, revision: value.revision, entries: value.entries ?? {} } }\n } catch (error) {\n return { ok: false, message: String(error) }\n }\n}\n\nexport const inject = ['slots', 'locale', 'remote']\n\nexport function apply(ctx: ClientContext): void {\n ctx.effect(() => ctx.locale.register(NS, { zh, en }), 'subagent-library: dictionaries')\n\n // Pushed invalidation: any committed change to the subagent-library\n // namespace re-reads the document. The push carries the new revision so a\n // subscriber can tell its own write's echo (≤ last committed) from an\n // external change without racing the write response.\n const listeners = new Set<(revision?: number) => void>()\n const subscribeRefresh = (fn: (revision?: number) => void): (() => void) => {\n listeners.add(fn)\n return () => { listeners.delete(fn) }\n }\n const refresh = (revision?: number): void => {\n for (const fn of listeners) {\n try {\n fn(revision)\n } catch {\n // one stale subscriber must not break the others\n }\n }\n }\n ctx.effect(() => ctx.remote.$on('settings/document-updated', (ns: string, revision?: number) => {\n if (ns === NS) refresh(revision)\n }), 'subagent-library: settings invalidation')\n\n // ── settings section card ──────────────────────────────────────────────────\n ctx.slots.inject('settings.section', () => ctx.slots.register({\n name: 'settings.section',\n id: NS,\n order: 40,\n label: () => '子代理库',\n inject: (): LibrarySettingsInjected => ({ readView, writeView, subscribeRefresh }),\n }, LibrarySettings))\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAsBA,SAAgB,gBAAgB,OAAiD;CAC/E,MAAM,EAAE,sBAAU,wBAAW,qBAAqB;CAElD,MAAM,CAAC,MAAM,+BAAwC,KAAK;CAC1D,MAAM,CAAC,SAAS,kCAAoD,EAAE,CAAC;CACvE,MAAM,CAAC,MAAM,+BAAoB,MAAM;CACvC,MAAM,CAAC,QAAQ,iCAAqE,KAAK;CACzF,MAAM,CAAC,OAAO,gCAAqB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