@fish-under-sea/dsh-agent-teams-fish 2.0.1 → 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/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 +77 -2
- package/lib/mailbox.js +3 -5
- package/lib/members.js +35 -7
- 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/tools.d.ts +6 -0
- package/package.json +57 -52
- package/scripts/model-policy-tdd.mjs +70 -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 +81 -2
- package/src/mailbox.ts +3 -5
- package/src/members.ts +40 -6
- package/src/tools.ts +27 -15
|
@@ -139,6 +139,10 @@ export declare function assertMemberModelSelection(ctx: Context, captain: Agent,
|
|
|
139
139
|
provider: string;
|
|
140
140
|
model: string;
|
|
141
141
|
}): void;
|
|
142
|
+
/** rc.2 summaries use tree names; the new structured reason owns the outcome. */
|
|
143
|
+
export declare function successfulSubagentSettlement(source: MessageSource | undefined): source is Extract<MessageSource, {
|
|
144
|
+
kind: 'subagent-settled';
|
|
145
|
+
}>;
|
|
142
146
|
/** Install before the first request, including cold resume, with HMR cleanup. */
|
|
143
147
|
export declare function installContinuableMemberSetup(ctx: Context, setup: Setup): void;
|
|
144
148
|
/** Queue a distinct host-authored turn; never substitute model-message steer. */
|
package/lib/types/tools.d.ts
CHANGED
|
@@ -36,6 +36,12 @@ export interface ToolsConfig {
|
|
|
36
36
|
profiles: Record<string, import('./profiles.ts').TeamProfileConfig>;
|
|
37
37
|
/** Owner-declared reusable member tool policies, keyed by policy id (#59). */
|
|
38
38
|
toolPolicies: Record<string, MemberToolPolicy>;
|
|
39
|
+
/**
|
|
40
|
+
* Per-agent gate: the session's model-menu 「启用AgentTeam」 switch must be on
|
|
41
|
+
* for AgentTeams tools and prompt to participate. Omitted keeps the legacy
|
|
42
|
+
* always-on behavior for hosts without the native team-mode service.
|
|
43
|
+
*/
|
|
44
|
+
isTeamEnabled?: (agent: Agent) => boolean;
|
|
39
45
|
}
|
|
40
46
|
/** Browser/UI mutations allowed while a plan is waiting for approval. */
|
|
41
47
|
export type StagedPlanMutation = {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fish-under-sea/dsh-agent-teams-fish",
|
|
3
|
-
"version": "2.0
|
|
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",
|
|
@@ -97,8 +101,9 @@
|
|
|
97
101
|
"sync:skill": "node scripts/sync-skill.mjs",
|
|
98
102
|
"update:skills": "node scripts/update-skills.mjs",
|
|
99
103
|
"test:skills-updater": "node --test scripts/update-skills.test.mjs",
|
|
104
|
+
"verify:model-policy": "node --test scripts/model-policy-tdd.mjs",
|
|
100
105
|
"verify:skill": "node scripts/sync-skill.mjs --check",
|
|
101
|
-
"verify": "node scripts/verify.mjs && node scripts/fallback-tdd.mjs && node scripts/inline-plan-blank-optional-tdd.mjs && node scripts/member-failure-tdd.mjs && pnpm verify:issue-regressions && pnpm verify:quality-gates && node scripts/lifecycle-verify.mjs && node scripts/stress-verify.mjs && node --test scripts/issue-159.test.mjs && pnpm verify:issue-203 && pnpm verify:corrupt-state && pnpm verify:web-routes && pnpm verify:release && pnpm verify:readme && pnpm verify:skill && pnpm verify:harness-contract && pnpm verify:http-body && pnpm verify:compatibility && pnpm verify:capabilities && pnpm verify:tool-policies && pnpm verify:member-spawn-recovery && pnpm test:git-install && pnpm verify:source-runner && pnpm verify:lineage-identity && pnpm verify:legacy-session-repair && pnpm verify:git-artifact",
|
|
106
|
+
"verify": "node scripts/verify.mjs && node scripts/fallback-tdd.mjs && node scripts/inline-plan-blank-optional-tdd.mjs && node scripts/member-failure-tdd.mjs && pnpm verify:issue-regressions && pnpm verify:quality-gates && node scripts/lifecycle-verify.mjs && node scripts/stress-verify.mjs && node --test scripts/issue-159.test.mjs && pnpm verify:issue-203 && pnpm verify:corrupt-state && pnpm verify:web-routes && pnpm verify:release && pnpm verify:readme && pnpm verify:skill && pnpm verify:harness-contract && pnpm verify:http-body && pnpm verify:compatibility && pnpm verify:capabilities && pnpm verify:tool-policies && pnpm verify:member-spawn-recovery && pnpm test:git-install && pnpm verify:source-runner && pnpm verify:lineage-identity && pnpm verify:legacy-session-repair && pnpm verify:model-policy && pnpm verify:git-artifact",
|
|
102
107
|
"verify:quality-gates": "node scripts/quality-gates-tdd.mjs && node --test scripts/quality-gates-repair-scope.test.mjs scripts/quality-gates-amend.test.mjs scripts/quality-gates-content-bound.test.mjs scripts/quality-gates-work-order.test.mjs scripts/quality-gates-repair-wiring.test.mjs scripts/quality-gates-excluded-scope.test.mjs scripts/quality-gates-cross-binding.test.mjs",
|
|
103
108
|
"verify:issue-203": "node --test scripts/issue-203-card.test.mjs",
|
|
104
109
|
"verify:corrupt-state": "node --test scripts/corrupt-teamjson.test.mjs",
|
|
@@ -121,29 +126,29 @@
|
|
|
121
126
|
"verify:lineage-identity": "node --test scripts/lineage-identity.test.mjs"
|
|
122
127
|
},
|
|
123
128
|
"peerDependencies": {
|
|
124
|
-
"@deepseek-ai/cordis": "^4.0
|
|
125
|
-
"@deepseek-ai/dsh-agent": "0.2.2-rc.
|
|
126
|
-
"@deepseek-ai/dsh-api-session-controller": "0.2.2-rc.
|
|
127
|
-
"@deepseek-ai/dsh-client-connection": "0.2.2-rc.
|
|
128
|
-
"@deepseek-ai/dsh-client-locale": "0.2.2-rc.
|
|
129
|
-
"@deepseek-ai/dsh-client-store": "0.2.2-rc.
|
|
130
|
-
"@deepseek-ai/dsh-client-ui-chat": "0.2.2-rc.
|
|
131
|
-
"@deepseek-ai/dsh-client-ui-conversation": "0.2.2-rc.
|
|
132
|
-
"@deepseek-ai/dsh-client-ui-layout": "0.2.2-rc.
|
|
133
|
-
"@deepseek-ai/dsh-client-ui-model-selection": "0.2.2-rc.
|
|
134
|
-
"@deepseek-ai/dsh-client-ui-primitives": "0.2.2-rc.
|
|
135
|
-
"@deepseek-ai/dsh-client-ui-renderer": "0.2.2-rc.
|
|
136
|
-
"@deepseek-ai/dsh-client-ui-session": "0.2.2-rc.
|
|
137
|
-
"@deepseek-ai/dsh-client-ui-slots": "0.2.2-rc.
|
|
138
|
-
"@deepseek-ai/dsh-commands": "0.2.2-rc.
|
|
139
|
-
"@deepseek-ai/dsh-llm": "0.2.2-rc.
|
|
140
|
-
"@deepseek-ai/dsh-session": "0.2.2-rc.
|
|
141
|
-
"@deepseek-ai/dsh-session-projection": "0.2.2-rc.
|
|
142
|
-
"@deepseek-ai/dsh-subagent": "0.2.2-rc.
|
|
143
|
-
"@deepseek-ai/dsh-system-prompt": "0.2.2-rc.
|
|
144
|
-
"@deepseek-ai/dsh-tools": "0.2.2-rc.
|
|
145
|
-
"@deepseek-ai/dsh-util-values": "0.2.2-rc.
|
|
146
|
-
"@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",
|
|
147
152
|
"react": "^18.2.0"
|
|
148
153
|
},
|
|
149
154
|
"peerDependenciesMeta": {
|
|
@@ -221,33 +226,33 @@
|
|
|
221
226
|
}
|
|
222
227
|
},
|
|
223
228
|
"devDependencies": {
|
|
224
|
-
"@deepseek-ai/cordis": "4.0
|
|
225
|
-
"@deepseek-ai/dsh": "0.2.2-rc.
|
|
226
|
-
"@deepseek-ai/dsh-agent": "0.2.2-rc.
|
|
227
|
-
"@deepseek-ai/dsh-api-session-controller": "0.2.2-rc.
|
|
228
|
-
"@deepseek-ai/dsh-client-connection": "0.2.2-rc.
|
|
229
|
-
"@deepseek-ai/dsh-client-locale": "0.2.2-rc.
|
|
230
|
-
"@deepseek-ai/dsh-client-store": "0.2.2-rc.
|
|
231
|
-
"@deepseek-ai/dsh-client-ui-chat": "0.2.2-rc.
|
|
232
|
-
"@deepseek-ai/dsh-client-ui-conversation": "0.2.2-rc.
|
|
233
|
-
"@deepseek-ai/dsh-client-ui-layout": "0.2.2-rc.
|
|
234
|
-
"@deepseek-ai/dsh-client-ui-model-selection": "0.2.2-rc.
|
|
235
|
-
"@deepseek-ai/dsh-client-ui-primitives": "0.2.2-rc.
|
|
236
|
-
"@deepseek-ai/dsh-client-ui-renderer": "0.2.2-rc.
|
|
237
|
-
"@deepseek-ai/dsh-client-ui-session": "0.2.2-rc.
|
|
238
|
-
"@deepseek-ai/dsh-client-ui-sidebar-right": "0.2.2-rc.
|
|
239
|
-
"@deepseek-ai/dsh-client-ui-slots": "0.2.2-rc.
|
|
240
|
-
"@deepseek-ai/dsh-commands": "0.2.2-rc.
|
|
241
|
-
"@deepseek-ai/dsh-llm": "0.2.2-rc.
|
|
242
|
-
"@deepseek-ai/dsh-llm-retry": "0.2.2-rc.
|
|
243
|
-
"@deepseek-ai/dsh-session": "0.2.2-rc.
|
|
244
|
-
"@deepseek-ai/dsh-session-projection": "0.2.2-rc.
|
|
245
|
-
"@deepseek-ai/dsh-subagent": "0.2.2-rc.
|
|
246
|
-
"@deepseek-ai/dsh-system-prompt": "0.2.2-rc.
|
|
247
|
-
"@deepseek-ai/dsh-tools": "0.2.2-rc.
|
|
248
|
-
"@deepseek-ai/dsh-util-values": "0.2.2-rc.
|
|
249
|
-
"@deepseek-ai/dsh-workspace": "0.2.2-rc.
|
|
250
|
-
"@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",
|
|
251
256
|
"@types/node": "^24.13.3",
|
|
252
257
|
"@types/react": "~18.3.1",
|
|
253
258
|
"@types/react-dom": "^18.3.7",
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
/** 官方 subagent 策略是成员路由与 fallback 的唯一名单来源。 */
|
|
2
|
+
import assert from 'node:assert/strict'
|
|
3
|
+
import { test } from 'node:test'
|
|
4
|
+
import { resolveMemberLlmSelection } from '../lib/members.js'
|
|
5
|
+
|
|
6
|
+
const POLICY = [
|
|
7
|
+
{ provider: 'magpie', model: 'group/deepseek' },
|
|
8
|
+
{ provider: 'magpie', model: 'group/qwen-p' },
|
|
9
|
+
{ provider: 'magpie', model: 'group/glm' },
|
|
10
|
+
]
|
|
11
|
+
|
|
12
|
+
function fixture(policy = POLICY) {
|
|
13
|
+
const captain = {
|
|
14
|
+
id: 'captain',
|
|
15
|
+
options: { provider: 'magpie', model: 'group/deepseek' },
|
|
16
|
+
session: {
|
|
17
|
+
requestHeader: () => ({ config: { provider: 'magpie', model: 'group/deepseek' } }),
|
|
18
|
+
append() {},
|
|
19
|
+
},
|
|
20
|
+
}
|
|
21
|
+
const ctx = {
|
|
22
|
+
get: (name) => name === 'sessionProjections'
|
|
23
|
+
? { stateOf: () => policy }
|
|
24
|
+
: undefined,
|
|
25
|
+
llm: {
|
|
26
|
+
resolveCallConfig: async (route) => route,
|
|
27
|
+
},
|
|
28
|
+
}
|
|
29
|
+
return { ctx, captain }
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
test('名单内 fallback 保留原值', async () => {
|
|
33
|
+
const { ctx, captain } = fixture()
|
|
34
|
+
const selection = await resolveMemberLlmSelection(ctx, captain, {
|
|
35
|
+
fallback: { provider: 'magpie', model: 'group/qwen-p' },
|
|
36
|
+
})
|
|
37
|
+
assert.equal(selection.provider, 'magpie')
|
|
38
|
+
assert.equal(selection.model, 'group/deepseek')
|
|
39
|
+
assert.deepEqual(selection.fallback, { provider: 'magpie', model: 'group/qwen-p' })
|
|
40
|
+
})
|
|
41
|
+
|
|
42
|
+
test('名单外 fallback 自动改成名单内另一条路由', async () => {
|
|
43
|
+
const { ctx, captain } = fixture()
|
|
44
|
+
const selection = await resolveMemberLlmSelection(ctx, captain, {
|
|
45
|
+
fallback: { provider: 'magpie', model: 'group/hy4-m' },
|
|
46
|
+
})
|
|
47
|
+
assert.deepEqual(selection.fallback, { provider: 'magpie', model: 'group/qwen-p' })
|
|
48
|
+
})
|
|
49
|
+
|
|
50
|
+
test('captain 默认路由不在名单内时自动改用名单首项(未配置 fallback 则不降级)', async () => {
|
|
51
|
+
const { ctx, captain } = fixture([
|
|
52
|
+
{ provider: 'magpie', model: 'group/qwen-p' },
|
|
53
|
+
{ provider: 'magpie', model: 'group/glm' },
|
|
54
|
+
])
|
|
55
|
+
const selection = await resolveMemberLlmSelection(ctx, captain, {})
|
|
56
|
+
assert.equal(selection.provider, 'magpie')
|
|
57
|
+
assert.equal(selection.model, 'group/qwen-p')
|
|
58
|
+
assert.equal(selection.fallback, undefined)
|
|
59
|
+
})
|
|
60
|
+
|
|
61
|
+
test('显式选择名单外路由仍然报错,不静默改路', async () => {
|
|
62
|
+
const { ctx, captain } = fixture()
|
|
63
|
+
await assert.rejects(
|
|
64
|
+
() => resolveMemberLlmSelection(ctx, captain, {
|
|
65
|
+
provider: 'magpie',
|
|
66
|
+
model: 'group/hy4-m',
|
|
67
|
+
}),
|
|
68
|
+
/not allowed for this Session/,
|
|
69
|
+
)
|
|
70
|
+
})
|
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
|
+
}
|