@fish-under-sea/dsh-agent-teams-fish 2.0.2 → 2.1.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.en.md +8 -7
- package/README.md +8 -7
- package/compatibility.json +90 -82
- package/cordis.patch.yml +5 -0
- package/lib/capabilities.js +6 -1
- package/lib/client/AgentTeamToggle.js +54 -0
- package/lib/client/index.js +10 -0
- package/lib/client/locales.js +8 -0
- package/lib/client/slot-declarations.js +1 -0
- package/lib/client.js +127 -15
- package/lib/client.js.map +1 -1
- package/lib/git-artifact-stamp.json +2 -2
- package/lib/harness-compat.js +123 -5
- package/lib/index.js +88 -0
- package/lib/mailbox.js +3 -5
- package/lib/members.js +7 -1
- package/lib/tools.js +17 -14
- package/lib/types/capabilities.d.ts +2 -0
- package/lib/types/client/AgentTeamToggle.d.ts +18 -0
- package/lib/types/client/locales.d.ts +8 -0
- package/lib/types/client/slot-declarations.d.ts +17 -0
- package/lib/types/harness-compat.d.ts +4 -0
- package/lib/types/index.d.ts +14 -0
- package/lib/types/tools.d.ts +6 -0
- package/package.json +55 -51
- package/scripts/agentteam-mode-tdd.mjs +47 -0
- package/src/capabilities.ts +6 -1
- package/src/client/AgentTeamToggle.module.css +52 -0
- package/src/client/AgentTeamToggle.tsx +85 -0
- package/src/client/index.tsx +12 -0
- package/src/client/locales.ts +8 -0
- package/src/client/slot-declarations.ts +26 -0
- package/src/harness-compat.ts +156 -5
- package/src/index.ts +91 -0
- package/src/mailbox.ts +3 -5
- package/src/members.ts +10 -1
- package/src/tools.ts +27 -15
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fish-under-sea/dsh-agent-teams-fish",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.1.1",
|
|
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
|
|
126
|
-
"@deepseek-ai/dsh-agent": "0.2.2-rc.
|
|
127
|
-
"@deepseek-ai/dsh-api-session-controller": "0.2.2-rc.
|
|
128
|
-
"@deepseek-ai/dsh-client-connection": "0.2.2-rc.
|
|
129
|
-
"@deepseek-ai/dsh-client-locale": "0.2.2-rc.
|
|
130
|
-
"@deepseek-ai/dsh-client-store": "0.2.2-rc.
|
|
131
|
-
"@deepseek-ai/dsh-client-ui-chat": "0.2.2-rc.
|
|
132
|
-
"@deepseek-ai/dsh-client-ui-conversation": "0.2.2-rc.
|
|
133
|
-
"@deepseek-ai/dsh-client-ui-layout": "0.2.2-rc.
|
|
134
|
-
"@deepseek-ai/dsh-client-ui-model-selection": "0.2.2-rc.
|
|
135
|
-
"@deepseek-ai/dsh-client-ui-primitives": "0.2.2-rc.
|
|
136
|
-
"@deepseek-ai/dsh-client-ui-renderer": "0.2.2-rc.
|
|
137
|
-
"@deepseek-ai/dsh-client-ui-session": "0.2.2-rc.
|
|
138
|
-
"@deepseek-ai/dsh-client-ui-slots": "0.2.2-rc.
|
|
139
|
-
"@deepseek-ai/dsh-commands": "0.2.2-rc.
|
|
140
|
-
"@deepseek-ai/dsh-llm": "0.2.2-rc.
|
|
141
|
-
"@deepseek-ai/dsh-session": "0.2.2-rc.
|
|
142
|
-
"@deepseek-ai/dsh-session-projection": "0.2.2-rc.
|
|
143
|
-
"@deepseek-ai/dsh-subagent": "0.2.2-rc.
|
|
144
|
-
"@deepseek-ai/dsh-system-prompt": "0.2.2-rc.
|
|
145
|
-
"@deepseek-ai/dsh-tools": "0.2.2-rc.
|
|
146
|
-
"@deepseek-ai/dsh-util-values": "0.2.2-rc.
|
|
147
|
-
"@deepseek-ai/schemastery": "^3.
|
|
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
|
|
226
|
-
"@deepseek-ai/dsh": "0.2.2-rc.
|
|
227
|
-
"@deepseek-ai/dsh-agent": "0.2.2-rc.
|
|
228
|
-
"@deepseek-ai/dsh-api-session-controller": "0.2.2-rc.
|
|
229
|
-
"@deepseek-ai/dsh-client-connection": "0.2.2-rc.
|
|
230
|
-
"@deepseek-ai/dsh-client-locale": "0.2.2-rc.
|
|
231
|
-
"@deepseek-ai/dsh-client-store": "0.2.2-rc.
|
|
232
|
-
"@deepseek-ai/dsh-client-ui-chat": "0.2.2-rc.
|
|
233
|
-
"@deepseek-ai/dsh-client-ui-conversation": "0.2.2-rc.
|
|
234
|
-
"@deepseek-ai/dsh-client-ui-layout": "0.2.2-rc.
|
|
235
|
-
"@deepseek-ai/dsh-client-ui-model-selection": "0.2.2-rc.
|
|
236
|
-
"@deepseek-ai/dsh-client-ui-primitives": "0.2.2-rc.
|
|
237
|
-
"@deepseek-ai/dsh-client-ui-renderer": "0.2.2-rc.
|
|
238
|
-
"@deepseek-ai/dsh-client-ui-session": "0.2.2-rc.
|
|
239
|
-
"@deepseek-ai/dsh-client-ui-sidebar-right": "0.2.2-rc.
|
|
240
|
-
"@deepseek-ai/dsh-client-ui-slots": "0.2.2-rc.
|
|
241
|
-
"@deepseek-ai/dsh-commands": "0.2.2-rc.
|
|
242
|
-
"@deepseek-ai/dsh-llm": "0.2.2-rc.
|
|
243
|
-
"@deepseek-ai/dsh-llm-retry": "0.2.2-rc.
|
|
244
|
-
"@deepseek-ai/dsh-session": "0.2.2-rc.
|
|
245
|
-
"@deepseek-ai/dsh-session-projection": "0.2.2-rc.
|
|
246
|
-
"@deepseek-ai/dsh-subagent": "0.2.2-rc.
|
|
247
|
-
"@deepseek-ai/dsh-system-prompt": "0.2.2-rc.
|
|
248
|
-
"@deepseek-ai/dsh-tools": "0.2.2-rc.
|
|
249
|
-
"@deepseek-ai/dsh-util-values": "0.2.2-rc.
|
|
250
|
-
"@deepseek-ai/dsh-workspace": "0.2.2-rc.
|
|
251
|
-
"@deepseek-ai/schemastery": "3.
|
|
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",
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Regression: the optional native team-mode service must be looked up through
|
|
3
|
+
* `ctx.get`, never through the `ctx.agentTeams` property. Cordis throws
|
|
4
|
+
* "cannot get property \"agentTeams\" without inject" when an optional service
|
|
5
|
+
* is read as a property during tool-availability resolution, which broke every
|
|
6
|
+
* `agent_teams_*` tool in Hosts that mount neither the service nor our inject.
|
|
7
|
+
*/
|
|
8
|
+
import assert from 'node:assert/strict'
|
|
9
|
+
import { test } from 'node:test'
|
|
10
|
+
import { nativeTeamMode } from '../lib/index.js'
|
|
11
|
+
|
|
12
|
+
const service = {
|
|
13
|
+
isEnabled: agent => agent.id === 'enabled-captain',
|
|
14
|
+
setEnabled: async () => undefined,
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
/** A Cordis-like context: only `get` is safe before an optional service is injected. */
|
|
18
|
+
function optionalServiceContext(value) {
|
|
19
|
+
return new Proxy({ get(name) { return name === 'agentTeams' ? value : undefined } }, {
|
|
20
|
+
get(target, property, receiver) {
|
|
21
|
+
if (property in target) return Reflect.get(target, property, receiver)
|
|
22
|
+
throw new Error(`cannot get property "${String(property)}" without inject`)
|
|
23
|
+
},
|
|
24
|
+
})
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
test('optional team-mode service is resolved through ctx.get without inject', () => {
|
|
28
|
+
const ctx = optionalServiceContext(service)
|
|
29
|
+
assert.equal(nativeTeamMode(ctx), service)
|
|
30
|
+
// The exact expression the tool `when` callback evaluates must not throw.
|
|
31
|
+
assert.doesNotThrow(() => nativeTeamMode(ctx)?.isEnabled({ id: 'enabled-captain' }))
|
|
32
|
+
assert.equal(nativeTeamMode(ctx)?.isEnabled({ id: 'enabled-captain' }), true)
|
|
33
|
+
assert.equal(nativeTeamMode(ctx)?.isEnabled({ id: 'other' }), false)
|
|
34
|
+
})
|
|
35
|
+
|
|
36
|
+
test('absent optional service resolves to undefined and remains legacy-enabled', () => {
|
|
37
|
+
const ctx = optionalServiceContext(undefined)
|
|
38
|
+
assert.equal(nativeTeamMode(ctx), undefined)
|
|
39
|
+
assert.doesNotThrow(() => nativeTeamMode(ctx)?.isEnabled({ id: 'any' }))
|
|
40
|
+
})
|
|
41
|
+
|
|
42
|
+
test('contexts without ctx.get never touch the service property', () => {
|
|
43
|
+
const ctx = new Proxy({}, { get(_target, property) {
|
|
44
|
+
throw new Error(`cannot get property "${String(property)}" without inject`)
|
|
45
|
+
} })
|
|
46
|
+
assert.equal(nativeTeamMode(ctx), undefined)
|
|
47
|
+
})
|
package/src/capabilities.ts
CHANGED
|
@@ -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
|
-
|
|
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
|
+
}
|
package/src/client/index.tsx
CHANGED
|
@@ -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)}`)
|
package/src/client/locales.ts
CHANGED
|
@@ -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
|
+
}
|