dsh-subagent-profile 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +18 -0
- package/README.md +100 -0
- package/README.zh.md +100 -0
- package/cordis.patch.yml +10 -0
- package/docs/screenshots/dispatch-card.png +0 -0
- package/docs/screenshots/settings-page1.png +0 -0
- package/docs/screenshots/settings-page2.png +0 -0
- package/index.mjs +1239 -0
- package/lib/client.js +556 -0
- package/package.json +74 -0
- package/presets/orchestrator/NOTICE +3 -0
- package/presets/orchestrator/agent.cordis.yml +273 -0
- package/presets/orchestrator/preset.yml +2 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 muzyLink
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and
|
|
6
|
+
associated documentation files (the "Software"), to deal in the Software without restriction, including
|
|
7
|
+
without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
8
|
+
copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the
|
|
9
|
+
following conditions:
|
|
10
|
+
|
|
11
|
+
The above copyright notice and this permission notice shall be included in all copies or substantial
|
|
12
|
+
portions of the Software.
|
|
13
|
+
|
|
14
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT
|
|
15
|
+
LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO
|
|
16
|
+
EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
|
|
17
|
+
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
|
|
18
|
+
USE OR OTHER DEALINGS IN THE SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
# dsh-subagent-profile
|
|
2
|
+
|
|
3
|
+
<!-- Hero -->
|
|
4
|
+
<div align="center">
|
|
5
|
+
<b style="font-size: 1.15em;">子 Agent 派发方案化插件 —— 用对的人(预设 / 模型 / 推理强度)干对的事</b><br /><br />
|
|
6
|
+
<img alt="License: MIT" src="https://img.shields.io/badge/License-MIT-yellow.svg" />
|
|
7
|
+
<img alt="Version: 0.1.0" src="https://img.shields.io/badge/version-0.1.0-blue.svg" />
|
|
8
|
+
<img alt="DSH" src="https://img.shields.io/badge/DSH-0.1.0--rc.6%20~%20rc.8-blue.svg" />
|
|
9
|
+
</div>
|
|
10
|
+
|
|
11
|
+
<div align="center">English · <a href="README.zh.md">中文</a></div>
|
|
12
|
+
|
|
13
|
+
For [DeepSeek Harness](https://github.com/deepseek-ai/dsh) (DSH).
|
|
14
|
+
|
|
15
|
+
> *Thinking, Fast and Slow*: System 1 is fast and cheap, System 2 is slow and careful. The built-in `subagent` gives every subtask the same brain as its parent — no way to tell them apart. `dsh-subagent-profile` lets you pick per subtask: research with a fast brain, deep work with a careful one, saved as named **profiles**.
|
|
16
|
+
|
|
17
|
+
## Why the built-in `subagent` isn't enough
|
|
18
|
+
|
|
19
|
+
| | Built-in `subagent` | `dsh-subagent-profile` |
|
|
20
|
+
|---|---|---|
|
|
21
|
+
| Per-subtask model / preset | ❌ same brain for every subtask | ✅ pick per subtask |
|
|
22
|
+
| Reusable named setups | ❌ | ✅ profiles |
|
|
23
|
+
| Tool-scope narrowing | ❌ | ✅ whitelist ∩ parent, `run_code` always removed |
|
|
24
|
+
| Cost guardrails | ❌ | ✅ model / effort / tokens / depth capped |
|
|
25
|
+
| GUI management | ❌ | ✅ settings page |
|
|
26
|
+
|
|
27
|
+
## What it solves
|
|
28
|
+
|
|
29
|
+
- **Per-subtask control over the child's brain.** `dispatch` sets, per subtask: which preset (composition), which model, which reasoning effort, which tools, and the token cap. A research subtask and a coding subtask can run with completely different setups — something the plain `subagent` tool can't do (it only inherits the parent).
|
|
30
|
+
- **Named, reusable profiles.** A profile is one bundle of preset + model + reasoning effort + tool scope + persona. Save "research" as `researcher` (reasoning off, search-only tools) and dispatch with `dispatch(profile="researcher")`; two built-ins ship (`swap-standard` = full standard coding toolkit, `researcher`), and you can add/edit/remove your own in the settings page.
|
|
31
|
+
- **Fully observable.** Every result reports the effective profile / preset / model / reasoning effort; logs are tagged `[dsh-subagent-profile]`.
|
|
32
|
+
|
|
33
|
+
## Quick start
|
|
34
|
+
|
|
35
|
+
```bash
|
|
36
|
+
dsh plugin --profile web add dsh-subagent-profile # published package
|
|
37
|
+
dsh plugin --profile web add ./dsh-subagent-profile # from a local checkout
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
Restart `dsh web`. This is a standard **bundle plugin**: it provides the `dispatch` tool, the profile provider, the `subagent-profiles` service, the `/subagent-profiles/*` loopback management routes, the settings page (「子 Agent 方案」), and the `dispatch` tool-call card in the web GUI. On startup it also **self-installs an agent preset** — **`orchestrator`** (「编排者模式」) — pick it in the new-session preset picker. The sync is idempotent and re-runs on every startup, so upgrading the plugin updates the preset.
|
|
41
|
+
|
|
42
|
+
## Usage
|
|
43
|
+
|
|
44
|
+
### 1. Configure sub-agent profiles
|
|
45
|
+
|
|
46
|
+
Profiles are managed in the settings page — each one bundles preset + model + reasoning effort + tool scope (and optionally a persona), and can be enabled, disabled, edited, or reset individually.
|
|
47
|
+
|
|
48
|
+

|
|
49
|
+
|
|
50
|
+

|
|
51
|
+
|
|
52
|
+
### 2. Dispatch per subtask — the `dispatch` tool
|
|
53
|
+
|
|
54
|
+
```js
|
|
55
|
+
dispatch(
|
|
56
|
+
profile: "researcher", // preset + model + reasoning effort + tool scope
|
|
57
|
+
prompt: "Survey the DSH plugin ecosystem and compare direct competitors",
|
|
58
|
+
run_in_background: true
|
|
59
|
+
)
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+

|
|
63
|
+
|
|
64
|
+
## Profiles
|
|
65
|
+
|
|
66
|
+
Profiles live in `~/.dsh/subagent-profiles.json` and take effect immediately (edits are made from the settings page).
|
|
67
|
+
|
|
68
|
+
| Profile | Purpose |
|
|
69
|
+
|---|---|
|
|
70
|
+
| `swap-standard` | switch the child to the full standard coding toolkit |
|
|
71
|
+
| `researcher` | deep reasoning off, search-only tools |
|
|
72
|
+
|
|
73
|
+
## Safety model
|
|
74
|
+
|
|
75
|
+
Delegation never lets a subagent gain more power than you already have — this is the default, with no configuration:
|
|
76
|
+
|
|
77
|
+
- **Tools only shrink.** A child's tool set is the intersection of the profile's tools and the parent's tools, and `run_code` is always removed.
|
|
78
|
+
- **Approval is always "never".** A child cannot widen its own permissions; operations that need approval are rejected automatically.
|
|
79
|
+
- **Cost is capped.** Model, reasoning effort, tokens, and recursion depth are all bounded; out-of-range values fail loudly instead of silently downgrading.
|
|
80
|
+
|
|
81
|
+
## Data
|
|
82
|
+
|
|
83
|
+
- `~/.dsh/subagent-profiles.json` — the profile registry (edited from the settings page).
|
|
84
|
+
- `~/.dsh/subagent-profiles.state.json` — the plugin's enable/disable switch (default enabled).
|
|
85
|
+
- `~/.dsh/.agent-presets/orchestrator/` — the self-installed `orchestrator` agent preset (synced from the bundled `presets/orchestrator/` on every startup).
|
|
86
|
+
|
|
87
|
+
`DSH_HOME` is respected and defaults to `~/.dsh`.
|
|
88
|
+
|
|
89
|
+
## Known limitations
|
|
90
|
+
|
|
91
|
+
- **Background** one-shot dispatch requires `@deepseek-ai/dsh-jobs` and `@deepseek-ai/dsh-tool-jobs` to be loaded; otherwise it fails with "background jobs unavailable".
|
|
92
|
+
- **Continuable** mode goes through the DSH standard composition path, so the `preset` swap and `reasoningEffort` are ignored (the child inherits the parent preset at the default reasoning effort).
|
|
93
|
+
|
|
94
|
+
## Credits
|
|
95
|
+
|
|
96
|
+
The bundled `orchestrator` agent preset was inspired by [dsh-liangshen](https://github.com/zhu1090093659/dsh-web-ui/tree/main/packages/dsh-liangshen) (梁神模式) from [dsh-web-ui](https://github.com/zhu1090093659/dsh-web-ui), licensed under Apache-2.0. Thanks to its author for the great work.
|
|
97
|
+
|
|
98
|
+
## License
|
|
99
|
+
|
|
100
|
+
[MIT](LICENSE) — Copyright (c) 2026 muzyLink
|
package/README.zh.md
ADDED
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
# dsh-subagent-profile
|
|
2
|
+
|
|
3
|
+
<!-- Hero -->
|
|
4
|
+
<div align="center">
|
|
5
|
+
<b style="font-size: 1.15em;">子 Agent 派发方案化插件 —— 用对的人(预设 / 模型 / 推理强度)干对的事</b><br /><br />
|
|
6
|
+
<img alt="License: MIT" src="https://img.shields.io/badge/License-MIT-yellow.svg" />
|
|
7
|
+
<img alt="Version: 0.1.0" src="https://img.shields.io/badge/version-0.1.0-blue.svg" />
|
|
8
|
+
<img alt="DSH" src="https://img.shields.io/badge/DSH-0.1.0--rc.6%20~%20rc.8-blue.svg" />
|
|
9
|
+
</div>
|
|
10
|
+
|
|
11
|
+
<div align="center"><a href="README.md">English</a> · 中文</div>
|
|
12
|
+
|
|
13
|
+
为 [DeepSeek Harness](https://github.com/deepseek-ai/dsh)(DSH)打造。
|
|
14
|
+
|
|
15
|
+
> 《思考,快与慢》:系统 1 快而省,系统 2 慢而稳。内置的 `subagent` 给所有子任务同一个「大脑」,分不出快慢;`dsh-subagent-profile` 让你按任务指定——调研用快思考,攻坚用慢思考,常用搭配存成命名**方案**。
|
|
16
|
+
|
|
17
|
+
## 为什么内置 `subagent` 不够用
|
|
18
|
+
|
|
19
|
+
| | 内置 `subagent` | `dsh-subagent-profile` |
|
|
20
|
+
|---|---|---|
|
|
21
|
+
| 按子任务指定模型/预设 | ❌ 每个子任务同一个大脑 | ✅ 每个子任务单独指定 |
|
|
22
|
+
| 常用组合复用 | ❌ | ✅ 命名方案(profiles) |
|
|
23
|
+
| 收窄工具范围 | ❌ | ✅ 白名单 ∩ 父工具,`run_code` 一律移除 |
|
|
24
|
+
| 成本护栏 | ❌ | ✅ 模型/推理强度/token/深度上限 |
|
|
25
|
+
| GUI 管理 | ❌ | ✅ 设置页 |
|
|
26
|
+
|
|
27
|
+
## 解决什么问题
|
|
28
|
+
|
|
29
|
+
- **按子任务指定子 Agent 的「大脑」。** `dispatch` 给每个子任务单独指定:用哪个预设(composition)、哪个模型、哪种推理强度、只开哪些工具、给多少 token 上限。查资料和写代码两个子任务可以用完全不同的配置——这是内置 `subagent` 做不到的(它只能让子任务继承父 Agent 的同一套配置)。
|
|
30
|
+
- **把常用搭配存成命名方案,按名调用。** 「方案」= 预设 + 模型 + 推理强度 + 工具范围 + 人设的一揽子配置。把「调研」存成 `researcher`(关深度推理、只留检索工具),以后 `dispatch(profile="researcher")` 即可;内置 `swap-standard`(切到 standard 全套编码工具)和 `researcher` 两个现成方案,也能在设置页自己增删改。
|
|
31
|
+
- **每次派发都看得见实际用了什么。** 结果里标注实际生效的方案/预设/模型/推理强度,日志带 `[dsh-subagent-profile]` 标记,方便排查。
|
|
32
|
+
|
|
33
|
+
## 快速开始
|
|
34
|
+
|
|
35
|
+
```bash
|
|
36
|
+
dsh plugin --profile web add dsh-subagent-profile # 发布包
|
|
37
|
+
dsh plugin --profile web add ./dsh-subagent-profile # 本地检出
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
装完**重启 `dsh web`**。这是一个标准 **bundle 插件**,装好后自动提供:`dispatch` 派发工具、profile provider、`subagent-profiles` 服务、`/subagent-profiles/*` 本机管理接口,以及 Web 界面里的「子 Agent 方案」设置页与 `dispatch` 工具调用卡片。插件启动时还会**自动装好一个 agent 预设**——**`orchestrator`「编排者模式」**,在「新建会话」的预设选择器里选它即可。同步幂等、每次启动都执行,升级插件即更新预设。
|
|
41
|
+
|
|
42
|
+
## 用法
|
|
43
|
+
|
|
44
|
+
### 1. 配置子 Agent 方案
|
|
45
|
+
|
|
46
|
+
在设置页管理命名方案——每个方案打包预设 + 模型 + 推理强度 + 工具范围(可选人设),可单独启用、禁用、编辑或批量重置。
|
|
47
|
+
|
|
48
|
+

|
|
49
|
+
|
|
50
|
+

|
|
51
|
+
|
|
52
|
+
### 2. 按任务派发 —— `dispatch` 工具
|
|
53
|
+
|
|
54
|
+
```js
|
|
55
|
+
dispatch(
|
|
56
|
+
profile: "researcher", // 预设 + 模型 + 推理强度 + 工具范围
|
|
57
|
+
prompt: "调研 DSH 插件生态,列出直接竞品并对比",
|
|
58
|
+
run_in_background: true
|
|
59
|
+
)
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+

|
|
63
|
+
|
|
64
|
+
## 方案(Profiles)
|
|
65
|
+
|
|
66
|
+
方案保存在 `~/.dsh/subagent-profiles.json`,改完立即生效(在设置页编辑)。
|
|
67
|
+
|
|
68
|
+
| 方案 | 用途 |
|
|
69
|
+
|---|---|
|
|
70
|
+
| `swap-standard` | 子 Agent 切换为 standard 全套编码工具 |
|
|
71
|
+
| `researcher` | 关深度推理、只留检索工具 |
|
|
72
|
+
|
|
73
|
+
## 安全模型
|
|
74
|
+
|
|
75
|
+
委派绝不会让子 Agent 拿到比你更多的权限,默认生效、无需配置:
|
|
76
|
+
|
|
77
|
+
- **工具只减不增。** 子 Agent 最终能用的工具,是「方案允许的工具」和「主 Agent 已有工具」的交集,且 `run_code`(运行代码)一律移除。
|
|
78
|
+
- **审批恒为「永不」。** 子 Agent 无法扩大自己的权限,需要审批的操作会被自动拒绝。
|
|
79
|
+
- **成本设上限。** 模型、推理强度、token、递归深度都有限制,越界直接报错、不会悄悄降级。
|
|
80
|
+
|
|
81
|
+
## 数据
|
|
82
|
+
|
|
83
|
+
- `~/.dsh/subagent-profiles.json` —— 方案注册表(由设置页编辑)。
|
|
84
|
+
- `~/.dsh/subagent-profiles.state.json` —— 插件的启用/禁用开关(默认启用)。
|
|
85
|
+
- `~/.dsh/.agent-presets/orchestrator/` —— 自动安装的 `orchestrator` 编排者预设(每次启动由打包的 `presets/orchestrator/` 同步)。
|
|
86
|
+
|
|
87
|
+
尊重 `DSH_HOME`,默认 `~/.dsh`。
|
|
88
|
+
|
|
89
|
+
## 已知限制
|
|
90
|
+
|
|
91
|
+
- **后台**一次性派发需要加载 `@deepseek-ai/dsh-jobs` 与 `@deepseek-ai/dsh-tool-jobs`,否则报「background jobs unavailable」。
|
|
92
|
+
- **可续跑**模式走 DSH 标准组合路径,因此 `preset` 换用与 `reasoningEffort` 会被忽略(继承父预设、使用默认推理强度)。
|
|
93
|
+
|
|
94
|
+
## 致谢
|
|
95
|
+
|
|
96
|
+
内置的 `orchestrator` 编排者预设的构成方式参考了 [dsh-liangshen(梁神模式)](https://github.com/zhu1090093659/dsh-web-ui/tree/main/packages/dsh-liangshen)(出自 [dsh-web-ui](https://github.com/zhu1090093659/dsh-web-ui),Apache-2.0 许可)。感谢作者的出色工作。
|
|
97
|
+
|
|
98
|
+
## License
|
|
99
|
+
|
|
100
|
+
[MIT](LICENSE) — Copyright (c) 2026 muzyLink
|
package/cordis.patch.yml
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
# dsh-subagent-profile bundle patch: inserts the dual-face plugin row into the
|
|
2
|
+
# profile roster. The node half (exports ".") runs in the host process — it
|
|
3
|
+
# registers the dispatch tool, the profile provider, the subagent-profiles
|
|
4
|
+
# service, and the /subagent-profiles/* loopback HTTP routes; the `dsh.client`
|
|
5
|
+
# declaration in package.json makes the browser half (exports "./client", served
|
|
6
|
+
# at /plugins/<id>/client.js) load in the web GUI as the settings page and the
|
|
7
|
+
# dispatch tool-call card.
|
|
8
|
+
- insert:
|
|
9
|
+
- id: subagent-profile
|
|
10
|
+
name: dsh-subagent-profile
|
|
Binary file
|
|
Binary file
|
|
Binary file
|