dsh-subagent-dispatch-control 1.0.0 → 1.0.1
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.md
CHANGED
|
@@ -1,15 +1,17 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
</p>
|
|
1
|
+
# dsh-subagent-dispatch-control
|
|
2
|
+
|
|
4
3
|
|
|
5
4
|
<p align="center">
|
|
6
|
-
<img alt="
|
|
5
|
+
<img alt="npm" src="https://img.shields.io/npm/v/dsh-subagent-dispatch-control?style=flat-square">
|
|
6
|
+
<img alt="version" src="https://img.shields.io/badge/version-1.0.1-6c5ce7?style=flat-square">
|
|
7
7
|
<img alt="license" src="https://img.shields.io/badge/license-MIT-3da639?style=flat-square">
|
|
8
8
|
<img alt="DSH" src="https://img.shields.io/badge/DSH-0.2.2--0_~_0.3.0-4b6fff?style=flat-square">
|
|
9
9
|
<img alt="platform" src="https://img.shields.io/badge/platform-web-0b7285?style=flat-square">
|
|
10
10
|
</p>
|
|
11
11
|
|
|
12
|
-
|
|
12
|
+
<p align="center">
|
|
13
|
+
<img src="docs/images/header.png" alt="dsh-subagent-dispatch-control:会话头部徽标与进度面板" width="900">
|
|
14
|
+
</p>
|
|
13
15
|
|
|
14
16
|
dsh-subagent-dispatch-control 是 DSH 子代理派发的决策与控制平面,单个插件包交付,低改动面、低侵入性,不替换官方任何能力。决策层回答「派不派、派几路、用谁、怎么拆」,控制层保证「不越界、可观测、可终止、可追溯」。它不新增子代理运行时,也不改写官方数据,只把官方预留的会话头部槽位与宿主投影接到一层可配置、可审计的控制面上。
|
|
15
17
|
|
|
@@ -22,8 +24,9 @@ dsh-subagent-dispatch-control 是 DSH 子代理派发的决策与控制平面,
|
|
|
22
24
|
- 三道硬闸:计划闸要求显式路数,进度闸要求 todo 就绪,派发闸要求多路任务建立共享任务。
|
|
23
25
|
- 模型与思考强度按白名单校验,选择结果按会话保存。
|
|
24
26
|
- **控制层**
|
|
27
|
+
- **手动叫停(核心差异)**:官方原生派发之后无法叫停,只能等子代理把结果跑完;本项目用 `send_interrupt` 手动叫停,按子代理名或 id 指定目标,三通道(宿主中断 + 中断标志 + 消息)同时生效,子代理在下一次工具调用前收尾,并把已完成部分写入报告;叫停事实写进 `ledger.jsonl`,面板同步显示「已暂停 · 用户叫停」。用法见下文「手动叫停」。
|
|
25
28
|
- 参数注入:按会话把选定路由注入子代理调用,不必每次在调用参数里手写 provider/model。
|
|
26
|
-
-
|
|
29
|
+
- 并发限流:同时运行的子代理数受计划路数约束,超出的派发不进入运行。
|
|
27
30
|
- 台账:`ledger.jsonl` 记录派发事实,`epochs.jsonl` 记录确认纪元,宿主重启后可重建进度、可复盘。
|
|
28
31
|
- **界面**
|
|
29
32
|
- 徽标注册在 `conversation.session.header.actions` 槽位,order 11:显示当前子代理路由,点开即可按会话选择模型与思考强度。
|
|
@@ -46,7 +49,7 @@ DSH 官方提供了 `subagent` 与 Team 能力:主代理可以把任务派给
|
|
|
46
49
|
| 并发发起 | 无计划入口,由模型自行判断 | `/dispatch` 评分、计划模式、批准后按路数派发 |
|
|
47
50
|
| 并发边界 | 无 | 计划闸、进度闸、派发闸三道硬闸 |
|
|
48
51
|
| 运行观测 | 仅主代理 todo | 子代理真实完成度、共享任务、本轮计划 |
|
|
49
|
-
| 终止 | 无 | `send_interrupt`
|
|
52
|
+
| 终止 | 无 | `send_interrupt` 手动硬叫停(按名字/id 指定目标,下一次工具调用前收尾) |
|
|
50
53
|
| 可追溯 | 无持久记录 | 磁盘台账,重启后可重建、可复盘 |
|
|
51
54
|
|
|
52
55
|
<p align="center">
|
|
@@ -61,9 +64,17 @@ DSH 官方提供了 `subagent` 与 Team 能力:主代理可以把任务派给
|
|
|
61
64
|
|
|
62
65
|
## 安装、更新、卸载
|
|
63
66
|
|
|
64
|
-
前提:DSH `>=0.2.2-0 <0.3.0`,Node.js `>=24.9.0
|
|
67
|
+
前提:DSH `>=0.2.2-0 <0.3.0`,Node.js `>=24.9.0`。插件已发布到 npm,推荐用 DSH CLI 一键安装;也可以手动以本地目录形式链接进 profile。
|
|
68
|
+
|
|
69
|
+
### npm 安装(推荐)
|
|
70
|
+
|
|
71
|
+
```console
|
|
72
|
+
dsh plugin --profile desktop add dsh-subagent-dispatch-control
|
|
73
|
+
```
|
|
65
74
|
|
|
66
|
-
|
|
75
|
+
需要可用的 DSH CLI。桌面端用宿主自带的 CLI:`<安装目录>\resources\runtime\cli\bin\dsh.cmd`。装完后从系统托盘退出 DSH 再启动,新插件才会加载。
|
|
76
|
+
|
|
77
|
+
### 手动安装(备选)
|
|
67
78
|
|
|
68
79
|
1. 把解压后的 `dsh-subagent-dispatch-control/` 放到 `~/.dsh/plugins/dsh-subagent-dispatch-control/`。
|
|
69
80
|
2. 在 `~/.dsh/profiles/desktop/package.json` 的 `dependencies` 中加入链接依赖:
|
|
@@ -95,7 +106,15 @@ JSON.parse(localStorage.getItem('tp-batch-idle-diag:last') || '{}').rev
|
|
|
95
106
|
|
|
96
107
|
### 更新
|
|
97
108
|
|
|
98
|
-
|
|
109
|
+
npm 安装的用 CLI 拉最新版:
|
|
110
|
+
|
|
111
|
+
```console
|
|
112
|
+
dsh plugin --profile desktop add dsh-subagent-dispatch-control@latest
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
也可以重跑上面的 `add` 命令;随后从系统托盘退出 DSH 再启动。
|
|
116
|
+
|
|
117
|
+
手动安装的用新版本整体替换 `~/.dsh/plugins/dsh-subagent-dispatch-control/` 目录内容,profile 的 `dependencies` 与 `cordis.patch.yml` 不需要改动,然后托盘重启。建议先备份旧目录,替换后按上面的方式确认 rev。
|
|
99
118
|
|
|
100
119
|
### 卸载
|
|
101
120
|
|
|
@@ -133,6 +152,29 @@ JSON.parse(localStorage.getItem('tp-batch-idle-diag:last') || '{}').rev
|
|
|
133
152
|
<img src="docs/images/panel.png" width="650" alt="进度面板:最近派遣、共享任务、本轮计划">
|
|
134
153
|
</p>
|
|
135
154
|
|
|
155
|
+
### 手动叫停
|
|
156
|
+
|
|
157
|
+
官方原生派发之后没有叫停手段:派出去的子代理只能等它自己跑完,跑偏了也得等结果回来再收拾。本插件补上这一环——用 `send_interrupt` 手动叫停,按子代理名或 id 指定目标,随时可停。
|
|
158
|
+
|
|
159
|
+
```text
|
|
160
|
+
停掉 demo-run2
|
|
161
|
+
或由模型调用 send_interrupt({ name: "demo-run2", reason: "方向不对" })
|
|
162
|
+
```
|
|
163
|
+
|
|
164
|
+
叫停不是「断开连接」,而是三通道同时生效:宿主中断、中断标志、消息。子代理在下一次工具调用前看到停止请求,先收尾、把已完成部分写入报告,再停下,不会留下跑到一半的状态。
|
|
165
|
+
|
|
166
|
+
叫停之后三处同步可见:
|
|
167
|
+
|
|
168
|
+
- 头部进度条出现橙色角标,计数旁显示「N 已暂停」;
|
|
169
|
+
- 面板该行变为「已暂停 · 用户叫停」,进度条上同样带橙色角标;
|
|
170
|
+
- `ledger.jsonl` 留下一条 interrupt 记录,谁、何时、为什么叫停都可事后复盘。
|
|
171
|
+
|
|
172
|
+
<p align="center">
|
|
173
|
+
<img src="docs/images/pair-panel.png" width="650" alt="进度面板:运行中与已暂停(用户叫停)两个子代理">
|
|
174
|
+
</p>
|
|
175
|
+
|
|
176
|
+
<p align="center"><em>同一次派发:一个子代理正在运行,另一个已被用户叫停,面板标注「已暂停 · 用户叫停」。</em></p>
|
|
177
|
+
|
|
136
178
|
## 文档
|
|
137
179
|
|
|
138
180
|
- [安装与升级](docs/wiki/安装与升级.md):安装三步、验证、升级与回滚
|
|
@@ -56,6 +56,25 @@
|
|
|
56
56
|
|
|
57
57
|

|
|
58
58
|
|
|
59
|
+
## 手动叫停
|
|
60
|
+
|
|
61
|
+
官方原生派发之后无法叫停:子代理派出去只能等它自己跑完,方向跑偏了也得等结果回来再收拾。本插件用 `send_interrupt` 手动叫停,按子代理名或 id 指定目标,随时可停。
|
|
62
|
+
|
|
63
|
+
```text
|
|
64
|
+
停掉 demo-run2
|
|
65
|
+
或由模型调用 send_interrupt({ name: "demo-run2", reason: "方向不对" })
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
三通道同时生效:宿主中断、中断标志、消息。子代理在下一次工具调用前看到停止请求,先收尾、把已完成部分写入报告,再停下,不会留下跑到一半的状态。
|
|
69
|
+
|
|
70
|
+
叫停之后三处同步可见:
|
|
71
|
+
|
|
72
|
+
- 头部进度条出现橙色角标,计数旁显示「N 已暂停」;
|
|
73
|
+
- 面板该行变为「已暂停 · 用户叫停」;
|
|
74
|
+
- `ledger.jsonl` 留下一条 interrupt 记录,谁、何时、为什么叫停都可事后复盘。
|
|
75
|
+
|
|
76
|
+

|
|
77
|
+
|
|
59
78
|
## /dispatch
|
|
60
79
|
|
|
61
80
|

|
|
@@ -5,7 +5,15 @@
|
|
|
5
5
|
- DSH 桌面版 `>=0.2.2-0 <0.3.0`
|
|
6
6
|
- Node.js `>=24.9.0`
|
|
7
7
|
|
|
8
|
-
##
|
|
8
|
+
## npm 安装(推荐)
|
|
9
|
+
|
|
10
|
+
```console
|
|
11
|
+
dsh plugin --profile desktop add dsh-subagent-dispatch-control
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
需要可用的 DSH CLI:桌面端用宿主自带的 CLI,路径为 `<安装目录>\resources\runtime\cli\bin\dsh.cmd`。装完后从系统托盘退出 DSH 再启动。
|
|
15
|
+
|
|
16
|
+
## 手动安装(3 步)
|
|
9
17
|
|
|
10
18
|
### 第 1 步:放置插件并链接 profile
|
|
11
19
|
|
|
@@ -58,6 +66,14 @@
|
|
|
58
66
|
|
|
59
67
|
## 升级
|
|
60
68
|
|
|
69
|
+
npm 安装的用 CLI 拉最新版,再托盘重启:
|
|
70
|
+
|
|
71
|
+
```console
|
|
72
|
+
dsh plugin --profile desktop add dsh-subagent-dispatch-control@latest
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
手动安装的按下面步骤:
|
|
76
|
+
|
|
61
77
|
1. 备份当前目录:
|
|
62
78
|
|
|
63
79
|
```bash
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dsh-subagent-dispatch-control",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.1",
|
|
4
4
|
"description": "单包子代理派发管控:会话头部子代理路由徽标(order 11)+ 常驻动画进度面板(order 12),并发建议与用户确认(suggest_concurrency)、硬叫停(send_interrupt)、共享任务/轮次进度与磁盘台账。合并自 01-route-badge v1.3.1 + 02-team-preflight v1.4.3。",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -38,6 +38,9 @@
|
|
|
38
38
|
"dsh": {
|
|
39
39
|
"manifestVersion": 1,
|
|
40
40
|
"kind": "plugin",
|
|
41
|
+
"bundle": {
|
|
42
|
+
"patch": "./cordis.patch.yml"
|
|
43
|
+
},
|
|
41
44
|
"capabilities": [
|
|
42
45
|
"tools:register",
|
|
43
46
|
"system-prompt:write"
|
|
@@ -53,33 +56,5 @@
|
|
|
53
56
|
"@deepseek-ai/dsh-client-ui-conversation"
|
|
54
57
|
]
|
|
55
58
|
}
|
|
56
|
-
},
|
|
57
|
-
"scripts": {
|
|
58
|
-
"test": "node test/test.mjs",
|
|
59
|
-
"test:client": "node test/test-client.mjs",
|
|
60
|
-
"test:integration": "node test/test-integration.mjs",
|
|
61
|
-
"test:functional": "node test/test-functional.mjs",
|
|
62
|
-
"test:contract": "node test/test-contract.mjs",
|
|
63
|
-
"test:late-service": "node test/test-late-service.mjs",
|
|
64
|
-
"test:notice-cap": "node test/test-notice-cap.mjs",
|
|
65
|
-
"test:agent-error": "node test/test-agent-error.mjs",
|
|
66
|
-
"test:badge-sync": "node test/test-badge-sync.mjs",
|
|
67
|
-
"test:badge-client": "node test/test-badge-client.mjs",
|
|
68
|
-
"test:badge-integration": "node test/test-badge-integration.mjs",
|
|
69
|
-
"test:concurrency-count": "node test/test-concurrency-count.mjs",
|
|
70
|
-
"test:plan-gate": "node test/test-plan-gate.mjs",
|
|
71
|
-
"test:resume": "node test/test-resume.mjs",
|
|
72
|
-
"test:tier-card": "node test/test-tier-card.mjs",
|
|
73
|
-
"test:tier-command": "node test/test-tier-command.mjs",
|
|
74
|
-
"test:tier-config": "node test/test-tier-config.mjs",
|
|
75
|
-
"test:tier-inject": "node test/test-tier-inject.mjs",
|
|
76
|
-
"test:tier-ledger": "node test/test-tier-ledger.mjs",
|
|
77
|
-
"test:tier-policy": "node test/test-tier-policy.mjs",
|
|
78
|
-
"test:dispatch": "node test/test-command-dispatch.mjs",
|
|
79
|
-
"test:mutation": "node test/test-mutation.mjs",
|
|
80
|
-
"test:effects": "node scripts/effect-probe.mjs",
|
|
81
|
-
"test:fast": "node test/test.mjs && node test/test-client.mjs && node test/test-badge-client.mjs && node test/test-badge-integration.mjs && node test/test-integration.mjs && node test/test-functional.mjs && node test/test-contract.mjs && node test/test-late-service.mjs && node test/test-notice-cap.mjs && node test/test-agent-error.mjs && node test/test-badge-sync.mjs && node test/test-concurrency-count.mjs && node test/test-plan-gate.mjs && node test/test-resume.mjs && node test/test-tier-card.mjs && node test/test-tier-command.mjs && node test/test-tier-config.mjs && node test/test-tier-inject.mjs && node test/test-tier-ledger.mjs && node test/test-tier-policy.mjs && node test/test-command-dispatch.mjs && node scripts/effect-probe.mjs",
|
|
82
|
-
"test:all": "npm run test:fast && npm run test:mutation",
|
|
83
|
-
"test:counts": "node scripts/test-counts.mjs"
|
|
84
59
|
}
|
|
85
60
|
}
|