@nanmicoder/dsh-agent-teams 0.1.12 → 0.1.14

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.
Files changed (39) hide show
  1. package/README.md +43 -7
  2. package/README_ZH.md +20 -7
  3. package/lib/client/ActivityPanel.js +219 -50
  4. package/lib/client/StagingPlanEditor.js +493 -0
  5. package/lib/client/activity-model.js +71 -0
  6. package/lib/client/activity-monitor.js +39 -13
  7. package/lib/client/index.js +2 -2
  8. package/lib/client/locales.js +224 -2
  9. package/lib/client.js +1808 -250
  10. package/lib/client.js.map +1 -1
  11. package/lib/command.js +116 -99
  12. package/lib/index.js +286 -14
  13. package/lib/members.js +137 -16
  14. package/lib/profiles.js +572 -0
  15. package/lib/quality-gates.js +777 -0
  16. package/lib/scheduler.js +215 -18
  17. package/lib/snapshot.js +25 -1
  18. package/lib/state.js +116 -10
  19. package/lib/tools.js +1230 -38
  20. package/lib/types/client/ActivityPanel.d.ts +3 -1
  21. package/lib/types/client/StagingPlanEditor.d.ts +17 -0
  22. package/lib/types/client/activity-model.d.ts +67 -0
  23. package/lib/types/client/activity-monitor.d.ts +32 -7
  24. package/lib/types/client/locales.d.ts +222 -0
  25. package/lib/types/command.d.ts +11 -56
  26. package/lib/types/event-types.d.ts +35 -1
  27. package/lib/types/index.d.ts +9 -0
  28. package/lib/types/members.d.ts +48 -3
  29. package/lib/types/profiles.d.ts +124 -0
  30. package/lib/types/quality-gates.d.ts +148 -0
  31. package/lib/types/scheduler.d.ts +48 -1
  32. package/lib/types/snapshot.d.ts +18 -1
  33. package/lib/types/state.d.ts +8 -3
  34. package/lib/types/tools.d.ts +73 -9
  35. package/lib/types/types.d.ts +118 -0
  36. package/lib/types.js +11 -0
  37. package/package.json +10 -4
  38. package/release-notes/v0.1.13.md +60 -0
  39. package/release-notes/v0.1.14.md +68 -0
package/README.md CHANGED
@@ -7,16 +7,22 @@
7
7
  </p>
8
8
 
9
9
  <p align="center">
10
- <a href="https://www.npmjs.com/package/@nanmicoder/dsh-agent-teams"><img src="https://img.shields.io/npm/v/@nanmicoder/dsh-agent-teams.svg" alt="npm version"></a>
11
- <a href="./LICENSE"><img src="https://img.shields.io/npm/l/@nanmicoder/dsh-agent-teams.svg" alt="MIT license"></a>
12
- <img src="https://img.shields.io/badge/DeepSeek%20Harness-plugin-202724" alt="DeepSeek Harness plugin">
10
+ <a href="https://dshfind.com/en/plugins/NanmiCoder/dsh-agent-teams?ref=badge"><img src="https://img.shields.io/badge/recommended%20by-dshfind-FFD700?style=flat-square" alt="Recommended by dshfind"></a>
11
+ <a href="https://dshfind.com/en/plugins/NanmiCoder/dsh-agent-teams?ref=badge"><img src="https://dshfind.com/api/badge/NanmiCoder/dsh-agent-teams?lang=en" alt="dshfind score"></a>
12
+ <a href="https://dshfind.com/en/plugins/NanmiCoder/dsh-agent-teams?ref=badge"><img src="https://dshfind.com/api/badge/NanmiCoder/dsh-agent-teams?metric=downloads&amp;lang=en" alt="dshfind downloads"></a>
13
+ </p>
14
+
15
+ <p align="center">
16
+ <a href="https://www.npmjs.com/package/@nanmicoder/dsh-agent-teams"><img src="https://img.shields.io/npm/v/@nanmicoder/dsh-agent-teams?style=flat-square&amp;color=5B4CF0" alt="npm version"></a>
17
+ <a href="./LICENSE"><img src="https://img.shields.io/badge/license-MIT-0B7285?style=flat-square" alt="MIT license"></a>
18
+ <a href="./cordis.patch.yml"><img src="https://img.shields.io/badge/DSH-Web%20%2B%20Headless-5B4CF0?style=flat-square" alt="DSH Web and Headless"></a>
13
19
  </p>
14
20
 
15
21
  ## One prompt. A working team.
16
22
 
17
23
  `dsh-agent-teams` turns the current DeepSeek Harness session into a captain that can assemble durable sub-agents, split a goal into dependency-aware tasks, and coordinate work through direct messages.
18
24
 
19
- Ask in natural language. The plugin provides the team protocol, ten coordination tools, persistent state, an automatic shared-task scheduler, and a live Web UI—without requiring a separate workflow engine.
25
+ Ask in natural language. The plugin provides the team protocol, eleven coordination tools, persistent state, an automatic shared-task scheduler, and a live Web UI—without requiring a separate workflow engine.
20
26
 
21
27
  <p align="center">
22
28
  <img src="./assets/ui.png" width="100%" alt="DeepSeek Harness conversation with the AgentTeams live activity panel, members, tasks, dependencies, and reports">
@@ -35,7 +41,9 @@ Read the [latest release notes](https://github.com/NanmiCoder/dsh-agent-teams/re
35
41
  | **Dependency-aware tasks** | Tasks move through explicit states and cannot be claimed before their dependencies finish. |
36
42
  | **Automatic reuse and safe takeover** | Idle members claim the next ready task; reassignment revokes stale attempts before new work starts, and cold recovery retries stranded open attempts. |
37
43
  | **Direct messaging** | Members send durable mailbox messages directly to teammates or the captain—no relay required. |
38
- | **Live activity panel** | The Web UI combines segmented progress, a collapsible roster, and an interactive task DAG; completed archives retain their full member and task history. |
44
+ | **Live activity panel** | The Web UI combines segmented progress, a collapsible roster, and an interactive task DAG; running tasks show the member's model, and completed archives retain their full member and task history. |
45
+ | **Plan before execution** | Normal `/agent-teams` runs stage an unspawned roster and DAG first. The Web panel uses the host model catalog for member routes. Returning to chat stops the planning turn, asks what should change, and revises the same draft; discarding archives the draft, aborts the turn, and explicitly prevents automatic recreation. Only **Approve & Run** creates members and starts scheduling. |
46
+ | **Quality gates** | Opt-in quality tasks support requirements → implementation → verification → review → integration contracts, automatic repair/re-review, and explicit resume. Scope control is a completion-time audit, not host write interception. See [docs/quality-gates.md](./docs/quality-gates.md). |
39
47
 
40
48
  The conversation card and activity panel use Harness's official locale service. They follow live language changes between English and Simplified Chinese—including status labels, dynamic summaries, controls, archive markers, and accessibility text—without a page reload or a separate plugin setting.
41
49
 
@@ -78,7 +86,7 @@ Then ask for a team directly:
78
86
  1. The current session creates a team and becomes its captain.
79
87
  2. The captain adds role-specific members backed by continuable sub-agents.
80
88
  3. The goal becomes tasks with owners and explicit dependencies.
81
- 4. The shared scheduler uses real `running / idle / ready` state to atomically claim one ready task per idle member and wake it. If an idle/ready member still owns an open task after an interrupted turn or process restart, the scheduler retries it with a fresh attempt.
89
+ 4. The shared scheduler uses real `running / idle / ready` state to atomically claim one ready task per idle member and wake it. An interrupted resident attempt stays parked and can resume through a direct message without losing its capability; after a cold process restart, the scheduler retries stranded open work with a fresh attempt.
82
90
  5. Members update with the current `attempt_id`; reassignment or captain takeover revokes the old attempt and waits for the old worker to quiesce before a new attempt starts.
83
91
  6. The captain presents the combined result, then archives the complete team record.
84
92
 
@@ -129,7 +137,7 @@ Defaults work without extra setup. A trusted profile can override member behavio
129
137
  ## Boundaries
130
138
 
131
139
  - One captain leads one active team at a time.
132
- - Idle members are automatically reused for ready work; messages that cannot be delivered live remain durable and are retried at a later status boundary.
140
+ - Idle members with no open task are automatically reused for ready work. An idle member that still owns an open attempt is parked until messaged or explicitly reassigned; messages that cannot be delivered live remain durable and are retried at a later status boundary.
133
141
  - State is file-backed and serialized within one DSH process; concurrent processes editing the same team are not coordinated.
134
142
  - The activity panel reports persisted state as-is. Models may occasionally finish work without performing the expected task-state update.
135
143
 
@@ -160,6 +168,34 @@ pnpm build
160
168
  pnpm verify
161
169
  ```
162
170
 
171
+ ## Named multi-role profiles
172
+
173
+ Configure one or more complete team profiles in `cordis.patch.yml`. A profile always supplies the roster (independent provider/model/role/reasoning effort). Set `taskPlanning: captain` when the Captain should derive the DAG from the user's goal; omit it or set `taskPlanning: seed` to keep a fixed template workflow:
174
+
175
+ ```yaml
176
+ profiles:
177
+ demo-delivery:
178
+ description: Ship a small feature
179
+ protocol: Discuss requirements, review, test, then prepare release; do not deploy automatically.
180
+ members:
181
+ - name: analyst
182
+ model: gpt-5.6-sol
183
+ role: Analyze requirements
184
+ - name: implementer
185
+ model: gpt-5.6-terra
186
+ role: Implement the approved solution
187
+ tasks:
188
+ - id: requirements
189
+ subject: Requirements discussion
190
+ assignee: analyst
191
+ - id: implementation
192
+ subject: Implement solution
193
+ assignee: implementer
194
+ dependencies: [requirements]
195
+ ```
196
+
197
+ Use an explicit profile flag: `/agent-teams --profile demo-delivery implement the feature`. The first ordinary token is never treated as an implicit profile. Normal command runs call `agent_teams_create({ profile, approval: "required" })`: the roster and seed/Captain-designed DAG remain staged, no child session is created, and no task is claimed. Edit the plan in the activity panel using the host model catalog, return to chat so the Captain asks what to revise and then atomically updates the same draft, discard it, or click **Approve & Run**. Return/discard actions cancel any planning turn still running; discard also parks model-facing context that forbids silently creating a replacement team. Approval resolves the final provider/model/reasoning choices, atomically spawns the roster, and starts only ready tasks. A running team is stopped from its own panel header through a confirmation dialog rather than from the composer. Direct tool clients may pass `approval: "automatic"` for the legacy immediate path. Failed review/test tasks do not unlock downstream work; automatic repair/review tasks do not depend on the failed review.
198
+
163
199
  ## License
164
200
 
165
201
  [MIT](./LICENSE)
package/README_ZH.md CHANGED
@@ -7,16 +7,22 @@
7
7
  </p>
8
8
 
9
9
  <p align="center">
10
- <a href="https://www.npmjs.com/package/@nanmicoder/dsh-agent-teams"><img src="https://img.shields.io/npm/v/@nanmicoder/dsh-agent-teams.svg" alt="npm 版本"></a>
11
- <a href="./LICENSE"><img src="https://img.shields.io/npm/l/@nanmicoder/dsh-agent-teams.svg" alt="MIT 许可证"></a>
12
- <img src="https://img.shields.io/badge/DeepSeek%20Harness-plugin-202724" alt="DeepSeek Harness 插件">
10
+ <a href="https://dshfind.com/zh/plugins/NanmiCoder/dsh-agent-teams?ref=badge"><img src="https://img.shields.io/badge/%E7%94%B1%20dshfind-%E6%8E%A8%E8%8D%90-FFD700?style=flat-square" alt=" dshfind 推荐"></a>
11
+ <a href="https://dshfind.com/zh/plugins/NanmiCoder/dsh-agent-teams?ref=badge"><img src="https://dshfind.com/api/badge/NanmiCoder/dsh-agent-teams?lang=zh" alt="dshfind 评分"></a>
12
+ <a href="https://dshfind.com/zh/plugins/NanmiCoder/dsh-agent-teams?ref=badge"><img src="https://dshfind.com/api/badge/NanmiCoder/dsh-agent-teams?metric=downloads&amp;lang=zh" alt="dshfind 下载量"></a>
13
+ </p>
14
+
15
+ <p align="center">
16
+ <a href="https://www.npmjs.com/package/@nanmicoder/dsh-agent-teams"><img src="https://img.shields.io/npm/v/@nanmicoder/dsh-agent-teams?style=flat-square&amp;color=5B4CF0" alt="npm 版本"></a>
17
+ <a href="./LICENSE"><img src="https://img.shields.io/badge/license-MIT-0B7285?style=flat-square" alt="MIT 许可证"></a>
18
+ <a href="./cordis.patch.yml"><img src="https://img.shields.io/badge/DSH-Web%20%2B%20Headless-5B4CF0?style=flat-square" alt="DSH Web 与 Headless"></a>
13
19
  </p>
14
20
 
15
21
  ## 一句话,拉起一支真正协作的团队
16
22
 
17
23
  `dsh-agent-teams` 让当前 DeepSeek Harness 会话成为队长:创建可续聊的子 Agent、把目标拆成有依赖的任务,并通过直达消息协调成员工作。
18
24
 
19
- 你只需用自然语言提出目标。插件会提供团队协议、10 个协作工具、持久化状态、自动共享任务调度和实时 Web UI,不需要额外的 Workflow 引擎。
25
+ 你只需用自然语言提出目标。插件会提供团队协议、11 个协作工具、持久化状态、自动共享任务调度和实时 Web UI,不需要额外的 Workflow 引擎。
20
26
 
21
27
  <p align="center">
22
28
  <img src="./assets/ui.png" width="100%" alt="DeepSeek Harness 对话与 AgentTeams 实时活动面板,展示成员、任务依赖和回报">
@@ -35,7 +41,8 @@
35
41
  | **带依赖的任务** | 任务有明确状态;依赖未完成时不能领取。 |
36
42
  | **自动续领与安全接管** | 成员空闲后自动领取下一项就绪任务;转派会撤销旧 attempt,冷恢复会重试遗留任务,迟到结果无法覆盖。 |
37
43
  | **成员直达消息** | 成员通过持久化邮箱直接联系队友或队长,不需要队长中转。 |
38
- | **实时活动面板** | Web UI 用分段进度、可折叠成员树和可交互 DAG 展示实时工作;团队结束后仍保留完整成员与任务历史。 |
44
+ | **实时活动面板** | Web UI 用分段进度、可折叠成员树和可交互 DAG 展示实时工作;运行中的子任务会标出使用的模型,团队结束后仍保留完整成员与任务历史。 |
45
+ | **质量门禁** | 人只提供目标和约束。默认任务顺序是需求 → 实现 → 验证 → 审查 → 集成,失败后自动修复/复审,恢复团队必须显式 resume。第一版范围控制是完成时审计,不是 host 写入拦截。详见 [docs/quality-gates.md](./docs/quality-gates.md)。 |
39
46
 
40
47
  对话卡片与活动面板接入 Harness 官方多语言服务,会随宿主在简体中文和英文之间实时切换;任务/成员状态、动态摘要、操作按钮、历史归档标识和无障碍文案都会同步更新,无需刷新页面,也不增加插件自己的语言设置。
41
48
 
@@ -78,7 +85,7 @@ dsh web
78
85
  1. 当前会话创建团队并成为队长。
79
86
  2. 队长按角色添加由可续聊子 Agent 驱动的成员。
80
87
  3. 目标被拆成有负责人和显式依赖的任务。
81
- 4. 共享调度器依据真实 `running / idle / ready` 状态,为每个空闲成员原子领取一项就绪任务并唤醒它;成员在中断或进程重启后仍持有开放任务时,会以新 attempt 自动恢复执行。
88
+ 4. 共享调度器依据真实 `running / idle / ready` 状态,为每个空闲成员原子领取一项就绪任务并唤醒它;驻留成员被中断时会停驻当前 attempt,可通过直接消息继续而不丢 capability;只有冷进程重启后的遗留任务才会生成新 attempt 恢复。
82
89
  5. 成员携带当前 `attempt_id` 更新任务;转派或队长接管会先撤销旧 attempt、等待原成员安静,再启动新 attempt。
83
90
  6. 队长汇总结果,随后归档完整团队记录。
84
91
 
@@ -119,7 +126,7 @@ dsh web
119
126
  ## 使用边界
120
127
 
121
128
  - 一个队长同一时间只能带一个活动团队。
122
- - 成员空闲后由共享调度器自动续领就绪任务;中断/冷重启遗留的开放任务会生成新 attempt 并重新唤醒原成员;暂时无法实时投递的消息会持久保存在邮箱中并在后续状态边界重投。
129
+ - 没有开放任务的空闲成员会自动续领就绪任务;仍持有开放 attempt 的空闲成员会停驻,队长可发消息让其沿用原 attempt 继续,或显式转派;冷重启遗留的开放任务才会生成新 attempt。暂时无法实时投递的消息会持久保存在邮箱中并在后续状态边界重投。
123
130
  - 状态使用文件持久化,并在单个 DSH 进程内串行操作;多个进程同时修改同一团队不保证一致。
124
131
  - 活动面板如实展示持久化状态;模型偶尔可能完成工作却没有按协议更新任务状态。
125
132
 
@@ -150,6 +157,12 @@ pnpm build
150
157
  pnpm verify
151
158
  ```
152
159
 
160
+ ## 命名多角色团队配置
161
+
162
+ 在 `cordis.patch.yml` 的 `profiles` 中配置完整团队模板。每个 profile 都提供成员阵容,可独立指定 provider、model、role、reasoning_effort。`taskPlanning: captain` 表示只提供阵容和约束,由 Captain 根据用户目标设计 DAG;省略该字段或设为 `seed` 时,展开模板中的固定任务图。使用 `/agent-teams --profile <名称> <目标>` 显式激活;不会把首个普通 token 隐式识别为 profile。
163
+
164
+ 普通 `/agent-teams` 流程会调用 `agent_teams_create({ profile, approval: "required" })`:只落盘可编辑的成员占位和 DAG,不创建子会话、不领取任务。成员模型和推理等级直接读取 Harness 的模型目录。「返回对话修改」会终止仍在运行的规划轮次,让队长先追问修改方向,再用一次原子操作更新同一份草案;「放弃本次计划」经二次确认后会归档草案、中止轮次,并向模型注入不得自动重建团队的控制上下文。只有点击「确认并启动团队」才会按最终配置原子创建成员并启动就绪任务。运行中团队的停止入口位于该团队的面板标题,点击后需要二次确认,不再占用输入区域。直接工具调用方可显式传 `approval: "automatic"` 保留旧的立即执行路径。审查或测试失败不会解锁下游;自动 repair/review 不依赖 failed review。
165
+
153
166
  ## 许可证
154
167
 
155
168
  [MIT](./LICENSE)