@fish-under-sea/dsh-agent-teams-fish 2.0.2 → 2.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fish-under-sea/dsh-agent-teams-fish",
3
- "version": "2.0.2",
3
+ "version": "2.1.0",
4
4
  "description": "AgentTeams 多智能体团队协作(DeepSeek Harness 插件):自然语言组队、成员与任务依赖 DAG、信箱通信、右侧栏树状监测 —— 上游 NanmiCoder/dsh-agent-teams 的补充版,新增自定义美术目录、十八厂商头像(十个有厂商 × 岗位全套)与厂商商标徽标。",
5
5
  "type": "module",
6
6
  "main": "lib/index.js",
@@ -73,6 +73,9 @@
73
73
  "registry": "https://registry.npmjs.org/"
74
74
  },
75
75
  "dsh": {
76
+ "engines": {
77
+ "dsh": ">=0.2.2-rc.3"
78
+ },
76
79
  "bundle": {
77
80
  "patch": "./cordis.patch.yml"
78
81
  },
@@ -81,6 +84,7 @@
81
84
  "@deepseek-ai/dsh-client-locale",
82
85
  "@deepseek-ai/dsh-client-ui-conversation",
83
86
  "@deepseek-ai/dsh-client-ui-layout",
87
+ "@deepseek-ai/dsh-client-ui-primitives",
84
88
  "@deepseek-ai/dsh-client-ui-sidebar-right",
85
89
  "@deepseek-ai/dsh-client-ui-model-selection",
86
90
  "@deepseek-ai/dsh-api-session-controller",
@@ -122,29 +126,29 @@
122
126
  "verify:lineage-identity": "node --test scripts/lineage-identity.test.mjs"
123
127
  },
124
128
  "peerDependencies": {
125
- "@deepseek-ai/cordis": "^4.0.2",
126
- "@deepseek-ai/dsh-agent": "0.2.2-rc.1 || 0.2.1-alpha.2 || 0.2.0-rc.2 || 0.1.7-rc.2 || 0.1.5-rc.3 || 0.1.5-rc.2 || 0.1.5-rc.1 || 0.1.2-rc.1 || 0.1.2-alpha.5 || 0.1.2-alpha.2 || 0.2.1-rc.2",
127
- "@deepseek-ai/dsh-api-session-controller": "0.2.2-rc.1 || 0.2.1-alpha.2 || 0.2.0-rc.2 || 0.1.7-rc.2 || 0.1.5-rc.3 || 0.1.5-rc.2 || 0.1.5-rc.1 || 0.1.2-rc.1 || 0.1.2-alpha.5 || 0.1.2-alpha.2 || 0.2.1-rc.2",
128
- "@deepseek-ai/dsh-client-connection": "0.2.2-rc.1 || 0.2.1-alpha.2 || 0.2.0-rc.2 || 0.1.7-rc.2 || 0.1.5-rc.3 || 0.1.5-rc.2 || 0.1.5-rc.1 || 0.1.2-rc.1 || 0.1.2-alpha.5 || 0.1.2-alpha.2 || 0.2.1-rc.2",
129
- "@deepseek-ai/dsh-client-locale": "0.2.2-rc.1 || 0.2.1-alpha.2 || 0.2.0-rc.2 || 0.1.7-rc.2 || 0.1.5-rc.3 || 0.1.5-rc.2 || 0.1.5-rc.1 || 0.1.2-rc.1 || 0.1.2-alpha.5 || 0.1.2-alpha.2 || 0.2.1-rc.2",
130
- "@deepseek-ai/dsh-client-store": "0.2.2-rc.1 || 0.2.1-alpha.2 || 0.2.0-rc.2 || 0.1.7-rc.2 || 0.1.5-rc.3 || 0.1.5-rc.2 || 0.1.5-rc.1 || 0.1.2-rc.1 || 0.1.2-alpha.5 || 0.1.2-alpha.2 || 0.2.1-rc.2",
131
- "@deepseek-ai/dsh-client-ui-chat": "0.2.2-rc.1 || 0.2.1-alpha.2 || 0.2.0-rc.2 || 0.1.7-rc.2 || 0.1.5-rc.3 || 0.1.5-rc.2 || 0.1.5-rc.1 || 0.1.2-rc.1 || 0.1.2-alpha.5 || 0.1.2-alpha.2 || 0.2.1-rc.2",
132
- "@deepseek-ai/dsh-client-ui-conversation": "0.2.2-rc.1 || 0.2.1-alpha.2 || 0.2.0-rc.2 || 0.1.7-rc.2 || 0.1.5-rc.3 || 0.1.5-rc.2 || 0.1.5-rc.1 || 0.1.2-rc.1 || 0.1.2-alpha.5 || 0.1.2-alpha.2 || 0.2.1-rc.2",
133
- "@deepseek-ai/dsh-client-ui-layout": "0.2.2-rc.1 || 0.2.1-alpha.2 || 0.2.0-rc.2 || 0.1.7-rc.2 || 0.1.5-rc.3 || 0.1.5-rc.2 || 0.1.5-rc.1 || 0.1.2-rc.1 || 0.1.2-alpha.5 || 0.1.2-alpha.2 || 0.2.1-rc.2",
134
- "@deepseek-ai/dsh-client-ui-model-selection": "0.2.2-rc.1 || 0.2.1-alpha.2 || 0.2.0-rc.2 || 0.1.7-rc.2 || 0.1.5-rc.3 || 0.1.5-rc.2 || 0.1.5-rc.1 || 0.1.2-rc.1 || 0.1.2-alpha.5 || 0.1.2-alpha.2 || 0.2.1-rc.2",
135
- "@deepseek-ai/dsh-client-ui-primitives": "0.2.2-rc.1 || 0.2.1-alpha.2 || 0.2.0-rc.2 || 0.1.7-rc.2 || 0.1.5-rc.3 || 0.1.5-rc.2 || 0.1.5-rc.1 || 0.1.2-rc.1 || 0.1.2-alpha.5 || 0.1.2-alpha.2 || 0.2.1-rc.2",
136
- "@deepseek-ai/dsh-client-ui-renderer": "0.2.2-rc.1 || 0.2.1-alpha.2 || 0.2.0-rc.2 || 0.1.7-rc.2 || 0.1.5-rc.3 || 0.1.5-rc.2 || 0.1.5-rc.1 || 0.1.2-rc.1 || 0.1.2-alpha.5 || 0.1.2-alpha.2 || 0.2.1-rc.2",
137
- "@deepseek-ai/dsh-client-ui-session": "0.2.2-rc.1 || 0.2.1-alpha.2 || 0.2.0-rc.2 || 0.1.7-rc.2 || 0.1.5-rc.3 || 0.1.5-rc.2 || 0.1.5-rc.1 || 0.1.2-rc.1 || 0.1.2-alpha.5 || 0.1.2-alpha.2 || 0.2.1-rc.2",
138
- "@deepseek-ai/dsh-client-ui-slots": "0.2.2-rc.1 || 0.2.1-alpha.2 || 0.2.0-rc.2 || 0.1.7-rc.2 || 0.1.5-rc.3 || 0.1.5-rc.2 || 0.1.5-rc.1 || 0.1.2-rc.1 || 0.1.2-alpha.5 || 0.1.2-alpha.2 || 0.2.1-rc.2",
139
- "@deepseek-ai/dsh-commands": "0.2.2-rc.1 || 0.2.1-alpha.2 || 0.2.0-rc.2 || 0.1.7-rc.2 || 0.1.5-rc.3 || 0.1.5-rc.2 || 0.1.5-rc.1 || 0.1.2-rc.1 || 0.1.2-alpha.5 || 0.1.2-alpha.2 || 0.2.1-rc.2",
140
- "@deepseek-ai/dsh-llm": "0.2.2-rc.1 || 0.2.1-alpha.2 || 0.2.0-rc.2 || 0.1.7-rc.2 || 0.1.5-rc.3 || 0.1.5-rc.2 || 0.1.5-rc.1 || 0.1.2-rc.1 || 0.1.2-alpha.5 || 0.1.2-alpha.2 || 0.2.1-rc.2",
141
- "@deepseek-ai/dsh-session": "0.2.2-rc.1 || 0.2.1-alpha.2 || 0.2.0-rc.2 || 0.1.7-rc.2 || 0.1.5-rc.3 || 0.1.5-rc.2 || 0.1.5-rc.1 || 0.1.2-rc.1 || 0.1.2-alpha.5 || 0.1.2-alpha.2 || 0.2.1-rc.2",
142
- "@deepseek-ai/dsh-session-projection": "0.2.2-rc.1 || 0.2.1-alpha.2 || 0.2.0-rc.2 || 0.1.7-rc.2 || 0.1.5-rc.3 || 0.1.5-rc.2 || 0.1.5-rc.1 || 0.1.2-rc.1 || 0.1.2-alpha.5 || 0.1.2-alpha.2 || 0.2.1-rc.2",
143
- "@deepseek-ai/dsh-subagent": "0.2.2-rc.1 || 0.2.1-alpha.2 || 0.2.0-rc.2 || 0.1.7-rc.2 || 0.1.5-rc.3 || 0.1.5-rc.2 || 0.1.5-rc.1 || 0.1.2-rc.1 || 0.1.2-alpha.5 || 0.1.2-alpha.2 || 0.2.1-rc.2",
144
- "@deepseek-ai/dsh-system-prompt": "0.2.2-rc.1 || 0.2.1-alpha.2 || 0.2.0-rc.2 || 0.1.7-rc.2 || 0.1.5-rc.3 || 0.1.5-rc.2 || 0.1.5-rc.1 || 0.1.2-rc.1 || 0.1.2-alpha.5 || 0.1.2-alpha.2 || 0.2.1-rc.2",
145
- "@deepseek-ai/dsh-tools": "0.2.2-rc.1 || 0.2.1-alpha.2 || 0.2.0-rc.2 || 0.1.7-rc.2 || 0.1.5-rc.3 || 0.1.5-rc.2 || 0.1.5-rc.1 || 0.1.2-rc.1 || 0.1.2-alpha.5 || 0.1.2-alpha.2 || 0.2.1-rc.2",
146
- "@deepseek-ai/dsh-util-values": "0.2.2-rc.1 || 0.2.1-alpha.2 || 0.2.0-rc.2 || 0.1.7-rc.2 || 0.1.5-rc.3 || 0.1.5-rc.2 || 0.1.5-rc.1 || 0.1.2-rc.1 || 0.1.2-alpha.5 || 0.1.2-alpha.2 || 0.2.1-rc.2",
147
- "@deepseek-ai/schemastery": "^3.18.2",
129
+ "@deepseek-ai/cordis": "^4.1.0",
130
+ "@deepseek-ai/dsh-agent": "0.2.2-rc.3 || 0.2.1-alpha.2 || 0.2.0-rc.2 || 0.1.7-rc.2 || 0.1.5-rc.3 || 0.1.5-rc.2 || 0.1.5-rc.1 || 0.1.2-rc.1 || 0.1.2-alpha.5 || 0.1.2-alpha.2 || 0.2.1-rc.2",
131
+ "@deepseek-ai/dsh-api-session-controller": "0.2.2-rc.3 || 0.2.1-alpha.2 || 0.2.0-rc.2 || 0.1.7-rc.2 || 0.1.5-rc.3 || 0.1.5-rc.2 || 0.1.5-rc.1 || 0.1.2-rc.1 || 0.1.2-alpha.5 || 0.1.2-alpha.2 || 0.2.1-rc.2",
132
+ "@deepseek-ai/dsh-client-connection": "0.2.2-rc.3 || 0.2.1-alpha.2 || 0.2.0-rc.2 || 0.1.7-rc.2 || 0.1.5-rc.3 || 0.1.5-rc.2 || 0.1.5-rc.1 || 0.1.2-rc.1 || 0.1.2-alpha.5 || 0.1.2-alpha.2 || 0.2.1-rc.2",
133
+ "@deepseek-ai/dsh-client-locale": "0.2.2-rc.3 || 0.2.1-alpha.2 || 0.2.0-rc.2 || 0.1.7-rc.2 || 0.1.5-rc.3 || 0.1.5-rc.2 || 0.1.5-rc.1 || 0.1.2-rc.1 || 0.1.2-alpha.5 || 0.1.2-alpha.2 || 0.2.1-rc.2",
134
+ "@deepseek-ai/dsh-client-store": "0.2.2-rc.3 || 0.2.1-alpha.2 || 0.2.0-rc.2 || 0.1.7-rc.2 || 0.1.5-rc.3 || 0.1.5-rc.2 || 0.1.5-rc.1 || 0.1.2-rc.1 || 0.1.2-alpha.5 || 0.1.2-alpha.2 || 0.2.1-rc.2",
135
+ "@deepseek-ai/dsh-client-ui-chat": "0.2.2-rc.3 || 0.2.1-alpha.2 || 0.2.0-rc.2 || 0.1.7-rc.2 || 0.1.5-rc.3 || 0.1.5-rc.2 || 0.1.5-rc.1 || 0.1.2-rc.1 || 0.1.2-alpha.5 || 0.1.2-alpha.2 || 0.2.1-rc.2",
136
+ "@deepseek-ai/dsh-client-ui-conversation": "0.2.2-rc.3 || 0.2.1-alpha.2 || 0.2.0-rc.2 || 0.1.7-rc.2 || 0.1.5-rc.3 || 0.1.5-rc.2 || 0.1.5-rc.1 || 0.1.2-rc.1 || 0.1.2-alpha.5 || 0.1.2-alpha.2 || 0.2.1-rc.2",
137
+ "@deepseek-ai/dsh-client-ui-layout": "0.2.2-rc.3 || 0.2.1-alpha.2 || 0.2.0-rc.2 || 0.1.7-rc.2 || 0.1.5-rc.3 || 0.1.5-rc.2 || 0.1.5-rc.1 || 0.1.2-rc.1 || 0.1.2-alpha.5 || 0.1.2-alpha.2 || 0.2.1-rc.2",
138
+ "@deepseek-ai/dsh-client-ui-model-selection": "0.2.2-rc.3 || 0.2.1-alpha.2 || 0.2.0-rc.2 || 0.1.7-rc.2 || 0.1.5-rc.3 || 0.1.5-rc.2 || 0.1.5-rc.1 || 0.1.2-rc.1 || 0.1.2-alpha.5 || 0.1.2-alpha.2 || 0.2.1-rc.2",
139
+ "@deepseek-ai/dsh-client-ui-primitives": "0.2.2-rc.3 || 0.2.1-alpha.2 || 0.2.0-rc.2 || 0.1.7-rc.2 || 0.1.5-rc.3 || 0.1.5-rc.2 || 0.1.5-rc.1 || 0.1.2-rc.1 || 0.1.2-alpha.5 || 0.1.2-alpha.2 || 0.2.1-rc.2",
140
+ "@deepseek-ai/dsh-client-ui-renderer": "0.2.2-rc.3 || 0.2.1-alpha.2 || 0.2.0-rc.2 || 0.1.7-rc.2 || 0.1.5-rc.3 || 0.1.5-rc.2 || 0.1.5-rc.1 || 0.1.2-rc.1 || 0.1.2-alpha.5 || 0.1.2-alpha.2 || 0.2.1-rc.2",
141
+ "@deepseek-ai/dsh-client-ui-session": "0.2.2-rc.3 || 0.2.1-alpha.2 || 0.2.0-rc.2 || 0.1.7-rc.2 || 0.1.5-rc.3 || 0.1.5-rc.2 || 0.1.5-rc.1 || 0.1.2-rc.1 || 0.1.2-alpha.5 || 0.1.2-alpha.2 || 0.2.1-rc.2",
142
+ "@deepseek-ai/dsh-client-ui-slots": "0.2.2-rc.3 || 0.2.1-alpha.2 || 0.2.0-rc.2 || 0.1.7-rc.2 || 0.1.5-rc.3 || 0.1.5-rc.2 || 0.1.5-rc.1 || 0.1.2-rc.1 || 0.1.2-alpha.5 || 0.1.2-alpha.2 || 0.2.1-rc.2",
143
+ "@deepseek-ai/dsh-commands": "0.2.2-rc.3 || 0.2.1-alpha.2 || 0.2.0-rc.2 || 0.1.7-rc.2 || 0.1.5-rc.3 || 0.1.5-rc.2 || 0.1.5-rc.1 || 0.1.2-rc.1 || 0.1.2-alpha.5 || 0.1.2-alpha.2 || 0.2.1-rc.2",
144
+ "@deepseek-ai/dsh-llm": "0.2.2-rc.3 || 0.2.1-alpha.2 || 0.2.0-rc.2 || 0.1.7-rc.2 || 0.1.5-rc.3 || 0.1.5-rc.2 || 0.1.5-rc.1 || 0.1.2-rc.1 || 0.1.2-alpha.5 || 0.1.2-alpha.2 || 0.2.1-rc.2",
145
+ "@deepseek-ai/dsh-session": "0.2.2-rc.3 || 0.2.1-alpha.2 || 0.2.0-rc.2 || 0.1.7-rc.2 || 0.1.5-rc.3 || 0.1.5-rc.2 || 0.1.5-rc.1 || 0.1.2-rc.1 || 0.1.2-alpha.5 || 0.1.2-alpha.2 || 0.2.1-rc.2",
146
+ "@deepseek-ai/dsh-session-projection": "0.2.2-rc.3 || 0.2.1-alpha.2 || 0.2.0-rc.2 || 0.1.7-rc.2 || 0.1.5-rc.3 || 0.1.5-rc.2 || 0.1.5-rc.1 || 0.1.2-rc.1 || 0.1.2-alpha.5 || 0.1.2-alpha.2 || 0.2.1-rc.2",
147
+ "@deepseek-ai/dsh-subagent": "0.2.2-rc.3 || 0.2.1-alpha.2 || 0.2.0-rc.2 || 0.1.7-rc.2 || 0.1.5-rc.3 || 0.1.5-rc.2 || 0.1.5-rc.1 || 0.1.2-rc.1 || 0.1.2-alpha.5 || 0.1.2-alpha.2 || 0.2.1-rc.2",
148
+ "@deepseek-ai/dsh-system-prompt": "0.2.2-rc.3 || 0.2.1-alpha.2 || 0.2.0-rc.2 || 0.1.7-rc.2 || 0.1.5-rc.3 || 0.1.5-rc.2 || 0.1.5-rc.1 || 0.1.2-rc.1 || 0.1.2-alpha.5 || 0.1.2-alpha.2 || 0.2.1-rc.2",
149
+ "@deepseek-ai/dsh-tools": "0.2.2-rc.3 || 0.2.1-alpha.2 || 0.2.0-rc.2 || 0.1.7-rc.2 || 0.1.5-rc.3 || 0.1.5-rc.2 || 0.1.5-rc.1 || 0.1.2-rc.1 || 0.1.2-alpha.5 || 0.1.2-alpha.2 || 0.2.1-rc.2",
150
+ "@deepseek-ai/dsh-util-values": "0.2.2-rc.3 || 0.2.1-alpha.2 || 0.2.0-rc.2 || 0.1.7-rc.2 || 0.1.5-rc.3 || 0.1.5-rc.2 || 0.1.5-rc.1 || 0.1.2-rc.1 || 0.1.2-alpha.5 || 0.1.2-alpha.2 || 0.2.1-rc.2",
151
+ "@deepseek-ai/schemastery": "^3.19.0",
148
152
  "react": "^18.2.0"
149
153
  },
150
154
  "peerDependenciesMeta": {
@@ -222,33 +226,33 @@
222
226
  }
223
227
  },
224
228
  "devDependencies": {
225
- "@deepseek-ai/cordis": "4.0.5",
226
- "@deepseek-ai/dsh": "0.2.2-rc.1",
227
- "@deepseek-ai/dsh-agent": "0.2.2-rc.1",
228
- "@deepseek-ai/dsh-api-session-controller": "0.2.2-rc.1",
229
- "@deepseek-ai/dsh-client-connection": "0.2.2-rc.1",
230
- "@deepseek-ai/dsh-client-locale": "0.2.2-rc.1",
231
- "@deepseek-ai/dsh-client-store": "0.2.2-rc.1",
232
- "@deepseek-ai/dsh-client-ui-chat": "0.2.2-rc.1",
233
- "@deepseek-ai/dsh-client-ui-conversation": "0.2.2-rc.1",
234
- "@deepseek-ai/dsh-client-ui-layout": "0.2.2-rc.1",
235
- "@deepseek-ai/dsh-client-ui-model-selection": "0.2.2-rc.1",
236
- "@deepseek-ai/dsh-client-ui-primitives": "0.2.2-rc.1",
237
- "@deepseek-ai/dsh-client-ui-renderer": "0.2.2-rc.1",
238
- "@deepseek-ai/dsh-client-ui-session": "0.2.2-rc.1",
239
- "@deepseek-ai/dsh-client-ui-sidebar-right": "0.2.2-rc.1",
240
- "@deepseek-ai/dsh-client-ui-slots": "0.2.2-rc.1",
241
- "@deepseek-ai/dsh-commands": "0.2.2-rc.1",
242
- "@deepseek-ai/dsh-llm": "0.2.2-rc.1",
243
- "@deepseek-ai/dsh-llm-retry": "0.2.2-rc.1",
244
- "@deepseek-ai/dsh-session": "0.2.2-rc.1",
245
- "@deepseek-ai/dsh-session-projection": "0.2.2-rc.1",
246
- "@deepseek-ai/dsh-subagent": "0.2.2-rc.1",
247
- "@deepseek-ai/dsh-system-prompt": "0.2.2-rc.1",
248
- "@deepseek-ai/dsh-tools": "0.2.2-rc.1",
249
- "@deepseek-ai/dsh-util-values": "0.2.2-rc.1",
250
- "@deepseek-ai/dsh-workspace": "0.2.2-rc.1",
251
- "@deepseek-ai/schemastery": "3.18.5",
229
+ "@deepseek-ai/cordis": "4.1.0",
230
+ "@deepseek-ai/dsh": "0.2.2-rc.3",
231
+ "@deepseek-ai/dsh-agent": "0.2.2-rc.3",
232
+ "@deepseek-ai/dsh-api-session-controller": "0.2.2-rc.3",
233
+ "@deepseek-ai/dsh-client-connection": "0.2.2-rc.3",
234
+ "@deepseek-ai/dsh-client-locale": "0.2.2-rc.3",
235
+ "@deepseek-ai/dsh-client-store": "0.2.2-rc.3",
236
+ "@deepseek-ai/dsh-client-ui-chat": "0.2.2-rc.3",
237
+ "@deepseek-ai/dsh-client-ui-conversation": "0.2.2-rc.3",
238
+ "@deepseek-ai/dsh-client-ui-layout": "0.2.2-rc.3",
239
+ "@deepseek-ai/dsh-client-ui-model-selection": "0.2.2-rc.3",
240
+ "@deepseek-ai/dsh-client-ui-primitives": "0.2.2-rc.3",
241
+ "@deepseek-ai/dsh-client-ui-renderer": "0.2.2-rc.3",
242
+ "@deepseek-ai/dsh-client-ui-session": "0.2.2-rc.3",
243
+ "@deepseek-ai/dsh-client-ui-sidebar-right": "0.2.2-rc.3",
244
+ "@deepseek-ai/dsh-client-ui-slots": "0.2.2-rc.3",
245
+ "@deepseek-ai/dsh-commands": "0.2.2-rc.3",
246
+ "@deepseek-ai/dsh-llm": "0.2.2-rc.3",
247
+ "@deepseek-ai/dsh-llm-retry": "0.2.2-rc.3",
248
+ "@deepseek-ai/dsh-session": "0.2.2-rc.3",
249
+ "@deepseek-ai/dsh-session-projection": "0.2.2-rc.3",
250
+ "@deepseek-ai/dsh-subagent": "0.2.2-rc.3",
251
+ "@deepseek-ai/dsh-system-prompt": "0.2.2-rc.3",
252
+ "@deepseek-ai/dsh-tools": "0.2.2-rc.3",
253
+ "@deepseek-ai/dsh-util-values": "0.2.2-rc.3",
254
+ "@deepseek-ai/dsh-workspace": "0.2.2-rc.3",
255
+ "@deepseek-ai/schemastery": "3.19.0",
252
256
  "@types/node": "^24.13.3",
253
257
  "@types/react": "~18.3.1",
254
258
  "@types/react-dom": "^18.3.7",
@@ -22,6 +22,8 @@ interface CapabilityConfig {
22
22
  isPendingMember: (agent: Agent) => boolean
23
23
  captainPrompt: () => string
24
24
  order?: number
25
+ /** Session model-menu switch; omitted keeps the legacy always-on prompt. */
26
+ isTeamEnabled?: (agent: Agent) => boolean
25
27
  }
26
28
 
27
29
  function stateRoot(agent: Agent, config: CapabilityConfig): string {
@@ -101,7 +103,10 @@ export function installTeamCapabilities(ctx: Context, config: CapabilityConfig):
101
103
  ctx.systemPrompt.section({
102
104
  name: 'agent-teams:usage', order: config.order ?? 117,
103
105
  text: ({ agent }) => {
104
- return agent !== undefined && states.get(agent)?.member ? TEAM_MEMBER_PROMPT : captainPrompt
106
+ if (agent === undefined) return ''
107
+ if (states.get(agent)?.member) return TEAM_MEMBER_PROMPT
108
+ // 开关关闭时不下发队长协议,模型就不会驱动 AgentTeams。
109
+ return config.isTeamEnabled === undefined || config.isTeamEnabled(agent) ? captainPrompt : ''
105
110
  },
106
111
  })
107
112
  onAgentReady(ctx, agent => { attach(agent) })
@@ -0,0 +1,52 @@
1
+ /* 与官方 TeamModeToggle 完全同一套尺寸与色令牌:只接管功能,不改按钮样式。 */
2
+ .row {
3
+ position: relative;
4
+ display: flex;
5
+ align-items: center;
6
+ justify-content: space-between;
7
+ gap: 16px;
8
+ min-height: 34px;
9
+ padding: 0 8px;
10
+ border-radius: var(--dsw-radius-md);
11
+ color: var(--dsw-alias-label-primary);
12
+ font-size: 13px;
13
+ line-height: 20px;
14
+ }
15
+
16
+ .label {
17
+ display: inline-flex;
18
+ align-items: center;
19
+ gap: 4px;
20
+ min-width: 0;
21
+ }
22
+
23
+ .infoButton {
24
+ position: relative;
25
+ z-index: 1;
26
+ flex: none;
27
+ width: 20px;
28
+ height: 20px;
29
+ padding: 0;
30
+ color: var(--dsw-alias-label-caption);
31
+ }
32
+
33
+ .row .toggle {
34
+ position: static;
35
+ }
36
+
37
+ .toggle::after {
38
+ content: '';
39
+ position: absolute;
40
+ inset: 0;
41
+ border-radius: var(--dsw-radius-md);
42
+ }
43
+
44
+ .row:has(.toggle:focus-visible) {
45
+ background: var(--dsw-alias-interactive-bg-hover);
46
+ }
47
+
48
+ @media (hover: hover) {
49
+ .row:has(.toggle:not(:disabled)):hover {
50
+ background: var(--dsw-alias-interactive-bg-hover);
51
+ }
52
+ }
@@ -0,0 +1,85 @@
1
+ /**
2
+ * 「启用AgentTeam」开关,占据官方模型与推理菜单的 `conversation.input.model.options`
3
+ * 列表槽位。样式、开关与信息按钮完全复用官方 TeamModeToggle;功能改为控制
4
+ * Fish AgentTeams 的会话开关(官方任务工具与官方团队 UI 行由 bundle 停用)。
5
+ *
6
+ * 开关状态读取原生 `agentTeam` 投影(持久化在 Session 日志),写入走 Fish 自己的
7
+ * `/plugins/dsh-agent-teams/mode` 路由;该路由只调用原生服务的 setEnabled,因此
8
+ * 关闭后 Fish 的 agent_teams_* 工具与提示词在下一个模型步骤就不再参与。
9
+ */
10
+ import { useState, type ReactNode } from 'react'
11
+ import { Button, IconInfoOutlineRegular, Switch, Tooltip } from '@deepseek-ai/dsh-client-ui-primitives'
12
+ import type { PropsRuntime } from '@deepseek-ai/dsh-client-ui-slots'
13
+ import type {} from '@deepseek-ai/dsh-client-ui-session/client'
14
+ import type {} from '@deepseek-ai/dsh-client-ui-conversation/client'
15
+ import type {} from '@deepseek-ai/dsh-api-session-controller/client'
16
+ import type { AgentTeamsTranslate } from './locales.js'
17
+ import css from './AgentTeamToggle.module.css'
18
+
19
+ /** Props supplied by the official model-options list slot plus our locale. */
20
+ export type AgentTeamToggleProps = PropsRuntime<'conversation.input.model.options'> & {
21
+ t: AgentTeamsTranslate
22
+ }
23
+
24
+ interface AgentTeamModeProjection {
25
+ readonly enabled?: boolean
26
+ }
27
+
28
+ /** Persist the switch through Fish's own host route. */
29
+ async function selectTeamMode(sessionId: string, enabled: boolean): Promise<string | null> {
30
+ try {
31
+ const response = await fetch('/plugins/dsh-agent-teams/mode', {
32
+ method: 'POST',
33
+ credentials: 'same-origin',
34
+ headers: { 'content-type': 'application/json' },
35
+ body: JSON.stringify({ sessionId, enabled }),
36
+ })
37
+ if (response.ok) return null
38
+ const body = (await response.json().catch(() => null)) as { error?: unknown } | null
39
+ return typeof body?.error === 'string' ? body.error : `HTTP ${response.status}`
40
+ } catch (error: unknown) {
41
+ return error instanceof Error ? error.message : String(error)
42
+ }
43
+ }
44
+
45
+ /** Read and change the Fish AgentTeams selection for root Sessions only. */
46
+ export function AgentTeamToggle(props: AgentTeamToggleProps): ReactNode {
47
+ const { sessionId, t } = props
48
+ const addressedChild = props.useSession(snapshot => (snapshot as { subagent?: unknown }).subagent !== null)
49
+ const listedChild = props.useSessions((state) =>
50
+ (state as { byId?: Record<string, { origin?: string } | undefined> }).byId?.[sessionId]?.origin === 'subagent')
51
+ if (addressedChild === true || listedChild === true) return null
52
+ const readProjection = props.useProjection as unknown as (key: string) => AgentTeamModeProjection | undefined
53
+ const mode = readProjection('agentTeam')
54
+ const [pending, setPending] = useState(false)
55
+ if (mode === undefined) return null
56
+
57
+ const select = (enabled: boolean): void => {
58
+ setPending(true)
59
+ void selectTeamMode(sessionId, enabled).then((failure) => {
60
+ if (failure !== null) props.reportFailure(t('mode.failed', { message: failure }))
61
+ }, (error: unknown) => {
62
+ props.reportFailure(t('mode.failed', { message: error instanceof Error ? error.message : String(error) }))
63
+ }).finally(() => { setPending(false) })
64
+ }
65
+
66
+ return (
67
+ <div className={css.row}>
68
+ <span className={css.label}>
69
+ <span>{t('mode.label')}</span>
70
+ <Tooltip label={t('mode.description')} side="top" delayMs={300} maxWidth={300} portal openOnClick>
71
+ <Button variant="ghost" size="sm" className={css.infoButton} aria-label={t('mode.infoLabel')}>
72
+ <IconInfoOutlineRegular size={11} aria-hidden="true" />
73
+ </Button>
74
+ </Tooltip>
75
+ </span>
76
+ <Switch
77
+ className={css.toggle}
78
+ checked={mode.enabled === true}
79
+ disabled={props.locked || pending}
80
+ label={t('mode.label')}
81
+ onChange={select}
82
+ />
83
+ </div>
84
+ )
85
+ }
@@ -28,6 +28,8 @@ import {
28
28
  AGENT_TEAMS_LOCALE_NAMESPACE, en, zh, type AgentTeamsLocaleKey,
29
29
  } from './locales.ts'
30
30
  import { openAgentTeamMember, type AgentTeamsLayoutNavigator, type AgentTeamsWorkspaceNavigator } from './session-navigation.ts'
31
+ import { AgentTeamToggle } from './AgentTeamToggle.tsx'
32
+ import type {} from './slot-declarations.js'
31
33
 
32
34
  declare module '@deepseek-ai/dsh-client-ui-slots' {
33
35
  interface LocaleNamespaceMap {
@@ -63,6 +65,16 @@ export function apply(ctx: ClientContext): void {
63
65
  'agent-teams: dictionaries',
64
66
  )
65
67
 
68
+ // 「启用AgentTeam」开关:占用官方模型与推理菜单的选项列表槽位。priority -1
69
+ // 让本项在旧 profile 仍残留官方 ui-agent-team 时压过它(同 id 低优先级渲染);
70
+ // 新 profile 已在 bundle 层停用官方行,因此这里就是唯一开关。
71
+ ctx.slots.inject('conversation.input.model.options', () => ctx.slots.register({
72
+ name: 'conversation.input.model.options',
73
+ id: 'agent-team',
74
+ priority: -1,
75
+ locale: AGENT_TEAMS_LOCALE_NAMESPACE,
76
+ }, AgentTeamToggle))
77
+
66
78
  const openMember = (parentId: SessionId, childId: SessionId): void => {
67
79
  void openAgentTeamMember(ctx.sessions, parentId, childId, ctx.layout as AgentTeamsLayoutNavigator, ctx.get('uiWorkspace') as AgentTeamsWorkspaceNavigator | undefined).catch((error: unknown) => {
68
80
  console.warn(`agent-teams: failed to open member transcript ${childId}: ${String(error)}`)
@@ -7,6 +7,10 @@ export const AGENT_TEAMS_LOCALE_NAMESPACE = 'agentTeams'
7
7
  export const zh = {
8
8
  'workspace.dependencies': '从左到右:完成前置后解锁 · 点击查看详情',
9
9
  'workspace.title': '团队协作',
10
+ 'mode.label': '启用AgentTeam',
11
+ 'mode.description': '开启后由 Fish AgentTeams 接管多智能体团队协作:模型获得 agent_teams_* 工具与队长协议;官方团队协作保持关闭以避免冲突。关闭后本会话不再启用。',
12
+ 'mode.infoLabel': '关于启用AgentTeam',
13
+ 'mode.failed': '切换失败:{message}',
10
14
  'workspace.guide': '查看成员分工、任务依赖与执行进度',
11
15
  'workspace.eyebrow': 'AGENT TEAMS',
12
16
  'workspace.description': '队长统筹分工,成员按任务依赖并行协作。',
@@ -244,6 +248,10 @@ export type AgentTeamsLocaleKey = keyof typeof zh
244
248
  export const en = {
245
249
  'workspace.dependencies': 'Left to right: prerequisites unlock tasks · Select for details',
246
250
  'workspace.title': 'Team workspace',
251
+ 'mode.label': 'Enable AgentTeam',
252
+ 'mode.description': 'When on, Fish AgentTeams takes over multi-agent collaboration: the model receives the agent_teams_* tools and captain protocol, while the official team runtime stays off to avoid conflicts. When off, this Session does not enable it.',
253
+ 'mode.infoLabel': 'About Enable AgentTeam',
254
+ 'mode.failed': 'Switch failed: {message}',
247
255
  'workspace.guide': 'Members, task dependencies, and execution progress',
248
256
  'workspace.eyebrow': 'AGENT TEAMS',
249
257
  'workspace.description': 'The captain coordinates. Members work in parallel as dependencies clear.',
@@ -0,0 +1,26 @@
1
+ /**
2
+ * Type-only declaration of the official model-menu options list slot.
3
+ *
4
+ * The runtime owner ships it in `@deepseek-ai/dsh-client-ui-model-selection`
5
+ * 0.2.2-rc.3; this workspace's development types are pinned one patch line
6
+ * behind, so the plugin declares the same shape locally. A later type line
7
+ * that also declares it merges to an identical member.
8
+ */
9
+ import type {} from '@deepseek-ai/dsh-client-ui-slots'
10
+
11
+ declare module '@deepseek-ai/dsh-client-ui-slots' {
12
+ interface SlotMap {
13
+ 'conversation.input.model.options': {
14
+ kind: 'list'
15
+ scope: 'session'
16
+ owner: {
17
+ /** Whether the composer currently refuses selection changes. */
18
+ locked: boolean
19
+ /** Close the menu and focus its trigger synchronously before opening another overlay. */
20
+ dismiss: () => void
21
+ /** Report a failed selection through the menu owner's persistent toast. */
22
+ reportFailure: (message: string) => void
23
+ }
24
+ }
25
+ }
26
+ }
@@ -43,6 +43,85 @@ interface RuntimeBoundary {
43
43
  [hostPromptDeliver]?: Deliver
44
44
  }
45
45
 
46
+ /**
47
+ * Audited 0.2.2-rc.2 tree manager seam. Upstream removed the symbol adapter
48
+ * without a public host-authored FIFO replacement. All native model/browser
49
+ * delivery converges on deliverToMember; keep that receiver, authorization,
50
+ * cancellation, provenance and wake/restore transaction intact.
51
+ * Source: dsh-v0.2.2-rc.2 subagent/src/{index,manager}.ts.
52
+ */
53
+ interface TreeActivation {
54
+ childId: SessionId
55
+ root: Agent
56
+ ancestors: readonly SessionId[]
57
+ }
58
+ interface TreeDeliveryOptions {
59
+ source: MessageSource
60
+ signal: AbortSignal
61
+ delivery: 'queue' | 'steer'
62
+ authorize?: () => void
63
+ }
64
+ type TreeDeliver = (root: Agent, childId: SessionId, content: ContentBlock[], options: TreeDeliveryOptions) => Promise<MessageId>
65
+ interface TreeManager {
66
+ deliverToMember: TreeDeliver
67
+ resident: ReadonlyMap<SessionId, TreeActivation>
68
+ dispose: (activation: TreeActivation) => Promise<void>
69
+ }
70
+ interface TreeBoundary {
71
+ rootOf: (caller: Agent) => Agent
72
+ manager: TreeManager
73
+ }
74
+ interface TreeWork {
75
+ root: Agent
76
+ branch: readonly SessionId[]
77
+ controller: AbortController
78
+ settled: Promise<void>
79
+ }
80
+ const treeWork = new WeakMap<TreeManager, Set<TreeWork>>()
81
+
82
+ function treeBoundary(runtime: Context['subagents']): TreeBoundary | undefined {
83
+ const tree = runtime as unknown as TreeBoundary & { prompt?: unknown }
84
+ if (typeof tree.rootOf !== 'function' || typeof tree.prompt !== 'function') return undefined
85
+ if (typeof tree.manager?.deliverToMember !== 'function' || typeof tree.manager.dispose !== 'function'
86
+ || !(tree.manager.resident instanceof Map)) return unsupported('missing audited tree delivery manager')
87
+ return tree
88
+ }
89
+
90
+ /** Track exact branch work before its first await so a targeted stop can join it. */
91
+ function trackTreeWork<T>(
92
+ manager: TreeManager, root: Agent, branch: readonly SessionId[], signal: AbortSignal,
93
+ operation: (signal: AbortSignal) => Promise<T>,
94
+ ): Promise<T> {
95
+ const pending = treeWork.get(manager) ?? new Set<TreeWork>()
96
+ treeWork.set(manager, pending)
97
+ const controller = new AbortController()
98
+ let finish!: () => void
99
+ const settled = new Promise<void>(resolve => { finish = resolve })
100
+ const work = { root, branch, controller, settled }
101
+ pending.add(work)
102
+ try {
103
+ return operation(AbortSignal.any([signal, controller.signal])).finally(() => { pending.delete(work); finish() })
104
+ } catch (error) {
105
+ pending.delete(work)
106
+ finish()
107
+ throw error
108
+ }
109
+ }
110
+
111
+ function deliverTreePrompt(
112
+ runtime: Context['subagents'], tree: TreeBoundary, parent: Agent, childId: SessionId,
113
+ content: ContentBlock[], source: MessageSource, signal: AbortSignal, delivery: 'queue' | 'steer',
114
+ ): Promise<MessageId> {
115
+ const root = tree.rootOf.call(runtime, parent)
116
+ return tree.manager.deliverToMember.call(tree.manager, root, childId, content, {
117
+ source, signal, delivery,
118
+ // Recheck the exact live caller immediately before native inbox acceptance.
119
+ authorize: () => {
120
+ if (tree.rootOf.call(runtime, parent) !== root) throw new SubagentError('AgentTeams caller left its subagent tree', 'UNAUTHORIZED')
121
+ },
122
+ })
123
+ }
124
+
46
125
  /** Version-independent creation contract; legacy-only options stay at this seam. */
47
126
  export interface MemberStartSpec {
48
127
  provider: string
@@ -72,7 +151,9 @@ export async function startMember(runtime: Context['subagents'], spec: MemberSta
72
151
  const host = runtime as unknown as CreationBoundary
73
152
  if (typeof host.startActivation === 'function') {
74
153
  const { persona: _persona, toolFilter: _filter, ...request } = spec.request
75
- const activation = await host.startActivation.call(runtime, { ...spec, request, delivery: 'parent' })
154
+ const activation = await Reflect.apply(host.startActivation, runtime, [treeBoundary(runtime) === undefined
155
+ ? { ...spec, request, delivery: 'parent' }
156
+ : { provider: spec.provider, label: spec.label, ...request, signal: spec.signal, delivery: 'parent' }]) as { childId: SessionId; result: Promise<unknown> }
76
157
  // Preserve native settlement as the missing-report/error fallback on both
77
158
  // fresh and resumed activations. mailbox.ts deduplicates successful reports.
78
159
  void activation.result.catch(() => undefined)
@@ -85,6 +166,7 @@ export async function startMember(runtime: Context['subagents'], spec: MemberSta
85
166
  /** Wrap every available creation API, restoring only this plugin's own methods. */
86
167
  export function guardSubagentCreation(ctx: Context, check: (parent: Agent) => void): void {
87
168
  const runtime = ctx.subagents as unknown as CreationBoundary
169
+ const tree = treeBoundary(ctx.subagents)
88
170
  ctx.effect(() => {
89
171
  const disposers: (() => void)[] = []
90
172
  for (const key of ['start', 'startContinuable', 'startActivation'] as const) {
@@ -92,8 +174,17 @@ export function guardSubagentCreation(ctx: Context, check: (parent: Agent) => vo
92
174
  if (typeof original !== 'function') continue
93
175
  const descriptor = Object.getOwnPropertyDescriptor(runtime, key)
94
176
  const guarded = async (...args: unknown[]): Promise<unknown> => {
95
- const request = key === 'start' ? args[1] : (args[0] as MemberStartSpec).request
96
- check((request as MemberStartSpec['request']).parent)
177
+ const request = key === 'start' ? args[1] : key === 'startActivation' && tree !== undefined
178
+ ? args[0] : (args[0] as MemberStartSpec).request
179
+ const parent = (request as MemberStartSpec['request']).parent
180
+ check(parent)
181
+ if (key === 'startActivation' && tree !== undefined) {
182
+ const spec = args[0] as { signal: AbortSignal }
183
+ const root = tree.rootOf.call(ctx.subagents, parent)
184
+ const branch = [parent.id, ...tree.manager.resident.get(parent.id)?.ancestors ?? []]
185
+ return trackTreeWork(tree.manager, root, branch, spec.signal, signal =>
186
+ Reflect.apply(original, ctx.subagents, [{ ...spec, signal }]) as Promise<unknown>)
187
+ }
97
188
  return Reflect.apply(original, ctx.subagents, args)
98
189
  }
99
190
  Object.defineProperty(runtime, key, { value: guarded, writable: true, configurable: true })
@@ -124,7 +215,9 @@ export function installMemberModelSelection(
124
215
  ref: { current: ModelSelection; assembled?: ModelSelection },
125
216
  ): () => void {
126
217
  const install = installModelSelection as unknown as (ctx: Context, ref?: unknown) => () => void
127
- return install.length >= 2 ? install(childCtx, ref) : install(childCtx)
218
+ // 0.2.2-rc.3 keeps the caller-owned selection ref; older hosts ignore the
219
+ // extra argument, so always forward it instead of guessing by arity.
220
+ return install(childCtx, ref)
128
221
  }
129
222
 
130
223
  function boundary(runtime: Context['subagents']): RuntimeBoundary {
@@ -292,6 +385,15 @@ export function assertMemberModelSelection(ctx: Context, captain: Agent, route:
292
385
  }
293
386
  }
294
387
 
388
+ /** rc.2 summaries use tree names; the new structured reason owns the outcome. */
389
+ export function successfulSubagentSettlement(source: MessageSource | undefined): source is Extract<MessageSource, { kind: 'subagent-settled' }> {
390
+ if (source?.kind !== 'subagent-settled') return false
391
+ const current = source as typeof source & { stopReason?: string }
392
+ return current.stopReason === undefined
393
+ ? source.summary === `Background subagent ${source.senderSessionId} finished and will do no further work unless you send it more.`
394
+ : current.stopReason === 'completed'
395
+ }
396
+
295
397
  /** Install before the first request, including cold resume, with HMR cleanup. */
296
398
  export function installContinuableMemberSetup(ctx: Context, setup: Setup): void {
297
399
  const runtime = boundary(ctx.subagents)
@@ -305,7 +407,7 @@ export function installContinuableMemberSetup(ctx: Context, setup: Setup): void
305
407
  })
306
408
  return
307
409
  }
308
- if ((typeof runtime[hostPromptQueue] !== 'function' && typeof runtime[hostPromptDeliver] !== 'function') || typeof runtime.sendMessage !== 'function') {
410
+ if (treeBoundary(ctx.subagents) === undefined && ((typeof runtime[hostPromptQueue] !== 'function' && typeof runtime[hostPromptDeliver] !== 'function') || typeof runtime.sendMessage !== 'function')) {
309
411
  return unsupported('missing continuable setup and modern host queue')
310
412
  }
311
413
  const installed = new WeakSet<Agent>()
@@ -369,6 +471,8 @@ export async function queueMemberPrompt(
369
471
  ): Promise<MessageId> {
370
472
  const host = boundary(runtime)
371
473
  const source = agentTeamsSource({ kind: 'agent-teams' }, observedSessionFormatVersion(parent))
474
+ const tree = treeBoundary(runtime)
475
+ if (tree !== undefined) return deliverTreePrompt(runtime, tree, parent, childId, content, source, signal, 'queue')
372
476
  if (typeof host.followup === 'function') {
373
477
  return host.followup.call(runtime, parent, childId, content, { source, signal })
374
478
  }
@@ -386,6 +490,8 @@ export async function steerMemberPrompt(
386
490
  ): Promise<MessageId> {
387
491
  const host = boundary(runtime)
388
492
  const source = agentTeamsSource({ kind: 'agent-teams' }, observedSessionFormatVersion(live ?? parent))
493
+ const tree = treeBoundary(runtime)
494
+ if (tree !== undefined) return deliverTreePrompt(runtime, tree, parent, childId, content, source, signal, 'steer')
389
495
  const deliver = host[hostPromptDeliver]
390
496
  if (typeof deliver === 'function') return deliver.call(runtime, parent, childId, content, source, signal, 'steer')
391
497
  if (typeof host.sendMessage === 'function') return host.sendMessage.call(runtime, parent, childId, content, { signal })
@@ -405,6 +511,35 @@ export function guardSubagentDelivery(
405
511
  ctx: Context, isRetired: (sender: Agent, targetId: SessionId) => Promise<boolean>,
406
512
  ): void {
407
513
  const runtime = ctx.subagents
514
+ const tree = treeBoundary(runtime)
515
+ if (tree !== undefined) {
516
+ const manager = tree.manager
517
+ ctx.effect(() => {
518
+ const original = manager.deliverToMember
519
+ const descriptor = Object.getOwnPropertyDescriptor(manager, 'deliverToMember')
520
+ let active = true
521
+ const guarded: TreeDeliver = async (root, childId, content, options) => {
522
+ if (!active) return original.call(manager, root, childId, content, options)
523
+ const branch = [childId, ...manager.resident.get(childId)?.ancestors ?? []]
524
+ return trackTreeWork(manager, root, branch, options.signal, async signal => {
525
+ signal.throwIfAborted()
526
+ if (await isRetired(root, childId)) {
527
+ throw new SubagentError(`AgentTeams member "${childId}" was retired and cannot be resumed`, 'NOT_RESUMABLE')
528
+ }
529
+ signal.throwIfAborted()
530
+ return original.call(manager, root, childId, content, { ...options, signal })
531
+ })
532
+ }
533
+ manager.deliverToMember = guarded
534
+ return () => {
535
+ active = false
536
+ if (Object.getOwnPropertyDescriptor(manager, 'deliverToMember')?.value !== guarded) return
537
+ if (descriptor === undefined) Reflect.deleteProperty(manager, 'deliverToMember')
538
+ else Object.defineProperty(manager, 'deliverToMember', descriptor)
539
+ }
540
+ }, 'agent-teams: tree retired member guard')
541
+ return
542
+ }
408
543
  const host = boundary(runtime)
409
544
  const legacy = host.followup
410
545
  const queue = host[hostPromptQueue]
@@ -567,6 +702,22 @@ export async function startMemberWithLenientFilter<T>(
567
702
 
568
703
  /** Targeted recursive cancellation renamed with the unified activation manager. */
569
704
  export async function drainMemberChildren(runtime: Context['subagents'], parent: Agent, ids: readonly SessionId[]): Promise<void> {
705
+ const tree = treeBoundary(runtime)
706
+ if (tree !== undefined) {
707
+ const root = tree.rootOf.call(runtime, parent)
708
+ const selected = new Set(ids)
709
+ // The native tree-wide drain also stops unrelated siblings and permanently
710
+ // closes the captain. Join only work in the selected creation branches.
711
+ const pending = [...treeWork.get(tree.manager) ?? []].filter(work => work.root === root && work.branch.some(id => selected.has(id)))
712
+ for (const work of pending) work.controller.abort()
713
+ await Promise.all(pending.map(work => work.settled))
714
+ const targets = [...tree.manager.resident.values()].filter(item => item.root === root
715
+ && item.ancestors.includes(parent.id) && (selected.has(item.childId) || item.ancestors.some(id => selected.has(id))))
716
+ const results = await Promise.allSettled(targets.map(item => tree.manager.dispose.call(tree.manager, item)))
717
+ const failures = results.flatMap(result => result.status === 'rejected' ? [result.reason as unknown] : [])
718
+ if (failures.length) throw new AggregateError(failures, 'AgentTeams member teardown failed')
719
+ return
720
+ }
570
721
  const host = runtime as unknown as {
571
722
  drainChildren?: (parent: Agent, ids: readonly SessionId[]) => Promise<void>
572
723
  drainContinuableChildren?: (parent: Agent, ids: readonly SessionId[]) => Promise<void>