@morlay/dsh-agent-team 0.0.0-stage → 0.2.0-alpha.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/LICENSE +21 -0
- package/README.md +34 -2
- package/dist/decorate-g56z_1VW.mjs +8 -0
- package/dist/index.d.mts +2 -0
- package/dist/index.mjs +1 -0
- package/dist/server.d.mts +3 -0
- package/dist/server.mjs +10 -0
- package/dist/team.service-C6Xf0LMZ.d.mts +33 -0
- package/dist/team.service-g8Nnhh0t.mjs +42 -0
- package/dist/ui.d.mts +12 -0
- package/dist/ui.mjs +25 -0
- package/package.json +55 -3
- package/src/index.ts +5 -0
- package/src/server/agent-team.provide.ts +14 -0
- package/src/server/index.ts +3 -0
- package/src/server/team.service.ts +74 -0
- package/src/ui/agent-team.provide.ts +8 -0
- package/src/ui/agent-team.ui.ts +38 -0
- package/src/ui/index.ts +3 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 morlay
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,3 +1,35 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @morlay/dsh-agent-team
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Agent Teams 的宿主行与工具集:接管上游 `TeamService`(服务名 `agentTeams`)与它那套团队工具,让 Lead 能派发队友、
|
|
4
|
+
共享任务板并等待结果。
|
|
5
|
+
|
|
6
|
+
## 用法
|
|
7
|
+
|
|
8
|
+
```ts
|
|
9
|
+
import { provideAgentTeam } from "@morlay/dsh-agent-team/server";
|
|
10
|
+
|
|
11
|
+
...provideAgentTeam(),
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
`provideAgentTeam()` 的清单两行(顺序即清单内顺序):
|
|
15
|
+
|
|
16
|
+
| 行 | 上游 | 做什么 |
|
|
17
|
+
| -------------------- | ---------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
18
|
+
| `TeamServiceDefault` | `@deepseek-ai/dsh-agent-team` | 团队服务(成员、任务板、消息) |
|
|
19
|
+
| `ToolAgentTeam` | `@deepseek-ai/dsh-tool-agent-team` | 模型面那套工具:`send_message` / `list_agents` / `wait_agent` / `interrupt_agent` / `team_task_*`;派生队友用上游 `subagent` / `subagent_fork`(`spawn_teammate` 在 v0.2.1-rc.2 已移除) |
|
|
20
|
+
|
|
21
|
+
## 依赖
|
|
22
|
+
|
|
23
|
+
服务行的 `deps`:`AgentDirectory` / `SessionStore` / `SessionPersistenceStore` / `SessionProjectionStore` /
|
|
24
|
+
`SubagentRegistry`。
|
|
25
|
+
|
|
26
|
+
工具行按「这个 agent 是不是 Team 成员」在 `agent/created` 上装工具:**没加入团队的会话不会有团队工具**;
|
|
27
|
+
上游普通 `subagent` / `subagent_fork` 本包不动(上游那套 profile 会禁掉它们,本包不禁)。
|
|
28
|
+
|
|
29
|
+
## 出口
|
|
30
|
+
|
|
31
|
+
`.`:`TeamServiceDefault` / `ToolAgentTeam`;`./server`:`provideAgentTeam`;`./ui`:Agent Teams 的浏览器行。本包不拥有装配清单与行间取舍。
|
|
32
|
+
|
|
33
|
+
## 设计
|
|
34
|
+
|
|
35
|
+
包内子域怎么分、契约与行各放哪,见[包内子域拆分与注册抽象](../.agents/designs/20261028-包内子域拆分与注册抽象.md)。
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
// \0@oxc-project+runtime@0.160.0/helpers/esm/decorate.js
|
|
2
|
+
function __decorate(decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
}
|
|
8
|
+
export { __decorate as t };
|
package/dist/index.d.mts
ADDED
package/dist/index.mjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { t as TeamServiceDefault, n as ToolAgentTeam } from "./team.service-g8Nnhh0t.mjs";
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { n as ToolAgentTeam, t as TeamServiceDefault } from "./team.service-C6Xf0LMZ.mjs";
|
|
2
|
+
export declare const provideAgentTeam: (...features: import("@morlay/zephyr").ProviderFeature[]) => readonly [typeof TeamServiceDefault, typeof ToolAgentTeam, import("@morlay/zephyr-app").RemoteDescriptorEntry];
|
|
3
|
+
export { TeamServiceDefault, ToolAgentTeam };
|
package/dist/server.mjs
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { n as ToolAgentTeam, t as TeamServiceDefault } from "./team.service-g8Nnhh0t.mjs";
|
|
2
|
+
import { provide } from "@morlay/zephyr";
|
|
3
|
+
import { remoteDescriptor } from "@morlay/zephyr-app";
|
|
4
|
+
// src/server/agent-team.provide.ts
|
|
5
|
+
const provideAgentTeam = provide([
|
|
6
|
+
TeamServiceDefault,
|
|
7
|
+
ToolAgentTeam,
|
|
8
|
+
remoteDescriptor(() => import("@deepseek-ai/dsh-agent-team/remote"))
|
|
9
|
+
]);
|
|
10
|
+
export { TeamServiceDefault, ToolAgentTeam, provideAgentTeam };
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import TeamService from "@deepseek-ai/dsh-agent-team";
|
|
2
|
+
import * as ToolAgentTeamPlugin from "@deepseek-ai/dsh-tool-agent-team";
|
|
3
|
+
import { Context } from "@morlay/zephyr";
|
|
4
|
+
declare const TeamServiceDefault_base: import("@morlay/zephyr/compat").AdaptedClass<import("@morlay/zephyr").TokenClass<unknown>, typeof TeamService>;
|
|
5
|
+
/**
|
|
6
|
+
* `agentTeams` 服务:上游 `TeamService` 经 `fromCordis` 接管。
|
|
7
|
+
*
|
|
8
|
+
* 五件依赖都由装配面显式交进去(`mount` 的 deps):上游按 `this.ctx.<name>` 严格读,
|
|
9
|
+
* 名字对不上时读到 `undefined` 然后在运行期炸。
|
|
10
|
+
*/
|
|
11
|
+
declare class TeamServiceDefault extends TeamServiceDefault_base {
|
|
12
|
+
private readonly agents;
|
|
13
|
+
private readonly sessions;
|
|
14
|
+
private readonly persistence;
|
|
15
|
+
private readonly projections;
|
|
16
|
+
private readonly subagents;
|
|
17
|
+
onInit(ctx: Context): Promise<void>;
|
|
18
|
+
}
|
|
19
|
+
declare const ToolAgentTeam_base: import("@morlay/zephyr/compat").AdaptedClass<import("@morlay/zephyr").TokenClass<unknown>, typeof ToolAgentTeamPlugin>;
|
|
20
|
+
/**
|
|
21
|
+
* 团队工具行:上游 `tool-agent-team` 经 `fromCordis` 接管。
|
|
22
|
+
*
|
|
23
|
+
* 四件依赖里 `agentTeams` 是**上一条适配行的契约面**(装配顺序保证它已经 mount 过,
|
|
24
|
+
* 注入拿到的是上游实例而不是适配行空壳);`tools` / `systemPrompt` 是本仓契约。
|
|
25
|
+
*/
|
|
26
|
+
declare class ToolAgentTeam extends ToolAgentTeam_base {
|
|
27
|
+
private readonly agents;
|
|
28
|
+
private readonly teams;
|
|
29
|
+
private readonly tools;
|
|
30
|
+
private readonly systemPrompt;
|
|
31
|
+
onInit(ctx: Context): Promise<void>;
|
|
32
|
+
}
|
|
33
|
+
export { ToolAgentTeam as n, TeamServiceDefault as t };
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import TeamService from "@deepseek-ai/dsh-agent-team";
|
|
2
|
+
import * as ToolAgentTeamPlugin from "@deepseek-ai/dsh-tool-agent-team";
|
|
3
|
+
import { AgentDirectory, SubagentRegistry, SystemPrompt, ToolRegistry } from "@morlay/dsh-agent";
|
|
4
|
+
import { SessionProjectionStore, SessionStore } from "@morlay/dsh-session";
|
|
5
|
+
import { SessionPersistence } from "@morlay/dsh-session-persistence";
|
|
6
|
+
import { Injectable, inject } from "@morlay/zephyr";
|
|
7
|
+
import { fromCordis } from "@morlay/zephyr/compat";
|
|
8
|
+
import { t as __decorate } from "./decorate-g56z_1VW.mjs";
|
|
9
|
+
// src/server/team.service.ts
|
|
10
|
+
let TeamServiceDefault = class TeamServiceDefault extends fromCordis(TeamService) {
|
|
11
|
+
agents = inject(AgentDirectory);
|
|
12
|
+
sessions = inject(SessionStore);
|
|
13
|
+
persistence = inject(SessionPersistence);
|
|
14
|
+
projections = inject(SessionProjectionStore);
|
|
15
|
+
subagents = inject(SubagentRegistry);
|
|
16
|
+
async onInit(ctx) {
|
|
17
|
+
await this.mount(ctx, void 0, {
|
|
18
|
+
agents: this.agents,
|
|
19
|
+
sessions: this.sessions,
|
|
20
|
+
sessionPersistence: this.persistence,
|
|
21
|
+
sessionProjections: this.projections,
|
|
22
|
+
subagents: this.subagents
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
};
|
|
26
|
+
TeamServiceDefault = __decorate([Injectable()], TeamServiceDefault);
|
|
27
|
+
let ToolAgentTeam = class ToolAgentTeam extends fromCordis(ToolAgentTeamPlugin) {
|
|
28
|
+
agents = inject(AgentDirectory);
|
|
29
|
+
teams = inject(TeamServiceDefault);
|
|
30
|
+
tools = inject(ToolRegistry);
|
|
31
|
+
systemPrompt = inject(SystemPrompt);
|
|
32
|
+
async onInit(ctx) {
|
|
33
|
+
await this.mount(ctx, void 0, {
|
|
34
|
+
agents: this.agents,
|
|
35
|
+
agentTeams: this.teams,
|
|
36
|
+
tools: this.tools,
|
|
37
|
+
systemPrompt: this.systemPrompt
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
};
|
|
41
|
+
ToolAgentTeam = __decorate([Injectable()], ToolAgentTeam);
|
|
42
|
+
export { ToolAgentTeam as n, TeamServiceDefault as t };
|
package/dist/ui.d.mts
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import * as ClientUiAgentTeam from "@deepseek-ai/dsh-client-ui-agent-team/client";
|
|
2
|
+
import { Context } from "@morlay/zephyr";
|
|
3
|
+
declare const AgentTeamUi_base: import("@morlay/zephyr/compat").AdaptedClass<import("@morlay/zephyr").TokenClass<unknown>, typeof ClientUiAgentTeam>;
|
|
4
|
+
/** 团队动作行(浏览器半)。 */
|
|
5
|
+
export declare class AgentTeamUi extends AgentTeamUi_base {
|
|
6
|
+
private readonly remote;
|
|
7
|
+
private readonly slots;
|
|
8
|
+
private readonly locale;
|
|
9
|
+
onInit(ctx: Context): Promise<void>;
|
|
10
|
+
}
|
|
11
|
+
export declare const provideAgentTeamUi: (...features: import("@morlay/zephyr").ProviderFeature[]) => readonly [typeof AgentTeamUi];
|
|
12
|
+
export {};
|
package/dist/ui.mjs
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { TYPERT_REMOTE } from "@deepseek-ai/dsh-agent-team/remote";
|
|
2
|
+
import * as ClientUiAgentTeam from "@deepseek-ai/dsh-client-ui-agent-team/client";
|
|
3
|
+
import { Injectable, inject, provide } from "@morlay/zephyr";
|
|
4
|
+
import { fromCordis } from "@morlay/zephyr/compat";
|
|
5
|
+
import { Locale, Remote, Slots } from "@morlay/zephyr-app/client";
|
|
6
|
+
import { t as __decorate } from "./decorate-g56z_1VW.mjs";
|
|
7
|
+
// src/ui/agent-team.ui.ts
|
|
8
|
+
let AgentTeamUi = class AgentTeamUi extends fromCordis(ClientUiAgentTeam) {
|
|
9
|
+
remote = inject(Remote);
|
|
10
|
+
slots = inject(Slots);
|
|
11
|
+
locale = inject(Locale);
|
|
12
|
+
async onInit(ctx) {
|
|
13
|
+
const dispose = await this.remote.$mount(TYPERT_REMOTE);
|
|
14
|
+
ctx.effect(() => dispose);
|
|
15
|
+
await this.mount(ctx, void 0, {
|
|
16
|
+
remote: this.remote,
|
|
17
|
+
slots: this.slots,
|
|
18
|
+
locale: this.locale
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
};
|
|
22
|
+
AgentTeamUi = __decorate([Injectable()], AgentTeamUi);
|
|
23
|
+
// src/ui/agent-team.provide.ts
|
|
24
|
+
const provideAgentTeamUi = provide([AgentTeamUi]);
|
|
25
|
+
export { AgentTeamUi, provideAgentTeamUi };
|
package/package.json
CHANGED
|
@@ -1,6 +1,58 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@morlay/dsh-agent-team",
|
|
3
|
-
"version": "0.0.0
|
|
4
|
-
"
|
|
5
|
-
"description": "
|
|
3
|
+
"version": "0.2.0-alpha.0",
|
|
4
|
+
"private": false,
|
|
5
|
+
"description": "Agent Teams:接管上游 TeamService(服务名 agentTeams)与它那套团队工具(send_message / list_agents / wait_agent / interrupt_agent / team_task_*),让 Lead 能派发队友、共享任务板并等待结果。派生用上游的 subagent / subagent_fork(spawn_teammate 已在 v0.2.1-rc.2 移除)。",
|
|
6
|
+
"files": [
|
|
7
|
+
"dist",
|
|
8
|
+
"src",
|
|
9
|
+
"!**/__tests__"
|
|
10
|
+
],
|
|
11
|
+
"type": "module",
|
|
12
|
+
"exports": {
|
|
13
|
+
".": {
|
|
14
|
+
"types": "./dist/index.d.mts",
|
|
15
|
+
"default": "./dist/index.mjs"
|
|
16
|
+
},
|
|
17
|
+
"./server": {
|
|
18
|
+
"types": "./dist/server.d.mts",
|
|
19
|
+
"default": "./dist/server.mjs"
|
|
20
|
+
},
|
|
21
|
+
"./ui": {
|
|
22
|
+
"types": "./dist/ui.d.mts",
|
|
23
|
+
"default": "./dist/ui.mjs"
|
|
24
|
+
},
|
|
25
|
+
"./package.json": "./package.json"
|
|
26
|
+
},
|
|
27
|
+
"dependencies": {
|
|
28
|
+
"@morlay/dsh-agent": "^0.2.0-alpha.0",
|
|
29
|
+
"@morlay/dsh-session": "^0.2.0-alpha.0",
|
|
30
|
+
"@morlay/dsh-session-persistence": "^0.2.0-alpha.0",
|
|
31
|
+
"@morlay/zephyr": "^0.2.0-alpha.0",
|
|
32
|
+
"@morlay/zephyr-app": "^0.2.0-alpha.0"
|
|
33
|
+
},
|
|
34
|
+
"devDependencies": {
|
|
35
|
+
"@morlay/dsh-agent": "^0.2.0-alpha.0",
|
|
36
|
+
"@morlay/dsh-agent-loop": "^0.2.0-alpha.0",
|
|
37
|
+
"@morlay/dsh-sandbox": "^0.2.0-alpha.0",
|
|
38
|
+
"@morlay/dsh-session": "^0.2.0-alpha.0",
|
|
39
|
+
"@morlay/dsh-session-persistence": "^0.2.0-alpha.0",
|
|
40
|
+
"@morlay/dsh-shell": "^0.2.0-alpha.0",
|
|
41
|
+
"@morlay/session-mode": "^0.2.0-alpha.0",
|
|
42
|
+
"@morlay/zephyr-app": "^0.2.0-alpha.0"
|
|
43
|
+
},
|
|
44
|
+
"peerDependencies": {
|
|
45
|
+
"@deepseek-ai/dsh-agent-team": "^0.2.3-alpha.3",
|
|
46
|
+
"@deepseek-ai/dsh-client-ui-agent-team": "^0.2.3-alpha.3",
|
|
47
|
+
"@deepseek-ai/dsh-tool-agent-team": "^0.2.3-alpha.3"
|
|
48
|
+
},
|
|
49
|
+
"engines": {
|
|
50
|
+
"dsh": ">= 0.2.3-alpha.3 < 0.2.4"
|
|
51
|
+
},
|
|
52
|
+
"repository": {
|
|
53
|
+
"type": "git",
|
|
54
|
+
"url": "https://github.com/morlay/zephyr.git",
|
|
55
|
+
"directory": "packages/agent/dsh-agent-team"
|
|
56
|
+
},
|
|
57
|
+
"scripts": {}
|
|
6
58
|
}
|
package/src/index.ts
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { provide } from "@morlay/zephyr";
|
|
2
|
+
import { remoteDescriptor } from "@morlay/zephyr-app";
|
|
3
|
+
import { TeamServiceDefault, ToolAgentTeam } from "./team.service.ts";
|
|
4
|
+
|
|
5
|
+
// 顺序即依赖:工具行按 `agentTeams` 判断成员身份,服务行必须在前。
|
|
6
|
+
export const provideAgentTeam = provide([
|
|
7
|
+
TeamServiceDefault,
|
|
8
|
+
ToolAgentTeam,
|
|
9
|
+
// `agentTeams` 这组 descriptor 的**提供者登记**(与 `provideApiSession()` 同形):
|
|
10
|
+
// 浏览器半的 `ui-agent-team` 按名字读 `remote.agentTeams`,而浏览器里没有全局 remotes 装载——
|
|
11
|
+
// 客户端那半由 `AgentTeamUi` 自己 `$mount` 这一份;这条登记喂的是 dev/preview 的宿主聚合清单
|
|
12
|
+
// (`ClientModulesDefault` 用 `inject.all(RemoteDescriptor)` 聚合后逐个挂)。
|
|
13
|
+
remoteDescriptor(() => import("@deepseek-ai/dsh-agent-team/remote")),
|
|
14
|
+
]);
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
// Agent Teams:把上游 `TeamService`(服务名 `agentTeams`)与它那套团队工具装进本仓装配。
|
|
2
|
+
//
|
|
3
|
+
// 上游是 experimental 包,我们不 fork——直接 `fromCordis` 接管,换实现时只改这一处。
|
|
4
|
+
//
|
|
5
|
+
// 两半的分工:
|
|
6
|
+
// - `TeamService` 是 cordis `Service` 子类(`super(ctx, 'agentTeams')`),由适配行 `mount` 时 `new` 出来;
|
|
7
|
+
// - `tool-agent-team` 是**函数插件**(`export function apply`),注册 `send_message` / `list_agents` /
|
|
8
|
+
// `wait_agent` / `interrupt_agent` / `team_task_*` 那一套;派生队友用上游 `subagent` / `subagent_fork`
|
|
9
|
+
// (`spawn_teammate` 在 v0.2.1-rc.2 已移除)。
|
|
10
|
+
//
|
|
11
|
+
// 工具**按会话**注册:上游 `apply` 在 `agent/created` 上判断这个 agent 是不是 Team 成员,是才装工具。
|
|
12
|
+
import TeamService from "@deepseek-ai/dsh-agent-team";
|
|
13
|
+
import * as ToolAgentTeamPlugin from "@deepseek-ai/dsh-tool-agent-team";
|
|
14
|
+
import { AgentDirectory, SystemPrompt, ToolRegistry } from "@morlay/dsh-agent";
|
|
15
|
+
import { SessionProjectionStore, SessionStore } from "@morlay/dsh-session";
|
|
16
|
+
import { SessionPersistence } from "@morlay/dsh-session-persistence";
|
|
17
|
+
import { SubagentRegistry } from "@morlay/dsh-agent";
|
|
18
|
+
import { Injectable, inject, type Context } from "@morlay/zephyr";
|
|
19
|
+
import { fromCordis } from "@morlay/zephyr/compat";
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* `agentTeams` 服务:上游 `TeamService` 经 `fromCordis` 接管。
|
|
23
|
+
*
|
|
24
|
+
* 五件依赖都由装配面显式交进去(`mount` 的 deps):上游按 `this.ctx.<name>` 严格读,
|
|
25
|
+
* 名字对不上时读到 `undefined` 然后在运行期炸。
|
|
26
|
+
*/
|
|
27
|
+
@Injectable()
|
|
28
|
+
export class TeamServiceDefault extends fromCordis(TeamService) {
|
|
29
|
+
private readonly agents = inject(AgentDirectory);
|
|
30
|
+
|
|
31
|
+
private readonly sessions = inject(SessionStore);
|
|
32
|
+
|
|
33
|
+
private readonly persistence = inject(SessionPersistence);
|
|
34
|
+
|
|
35
|
+
private readonly projections = inject(SessionProjectionStore);
|
|
36
|
+
|
|
37
|
+
private readonly subagents = inject(SubagentRegistry);
|
|
38
|
+
|
|
39
|
+
override async onInit(ctx: Context): Promise<void> {
|
|
40
|
+
await this.mount(ctx, undefined, {
|
|
41
|
+
agents: this.agents,
|
|
42
|
+
sessions: this.sessions,
|
|
43
|
+
sessionPersistence: this.persistence,
|
|
44
|
+
sessionProjections: this.projections,
|
|
45
|
+
subagents: this.subagents,
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
/**
|
|
51
|
+
* 团队工具行:上游 `tool-agent-team` 经 `fromCordis` 接管。
|
|
52
|
+
*
|
|
53
|
+
* 四件依赖里 `agentTeams` 是**上一条适配行的契约面**(装配顺序保证它已经 mount 过,
|
|
54
|
+
* 注入拿到的是上游实例而不是适配行空壳);`tools` / `systemPrompt` 是本仓契约。
|
|
55
|
+
*/
|
|
56
|
+
@Injectable()
|
|
57
|
+
export class ToolAgentTeam extends fromCordis(ToolAgentTeamPlugin) {
|
|
58
|
+
private readonly agents = inject(AgentDirectory);
|
|
59
|
+
|
|
60
|
+
private readonly teams = inject(TeamServiceDefault);
|
|
61
|
+
|
|
62
|
+
private readonly tools = inject(ToolRegistry);
|
|
63
|
+
|
|
64
|
+
private readonly systemPrompt = inject(SystemPrompt);
|
|
65
|
+
|
|
66
|
+
override async onInit(ctx: Context): Promise<void> {
|
|
67
|
+
await this.mount(ctx, undefined, {
|
|
68
|
+
agents: this.agents,
|
|
69
|
+
agentTeams: this.teams,
|
|
70
|
+
tools: this.tools,
|
|
71
|
+
systemPrompt: this.systemPrompt,
|
|
72
|
+
});
|
|
73
|
+
}
|
|
74
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { provide } from "@morlay/zephyr";
|
|
2
|
+
import { AgentTeamUi } from "./agent-team.ui.ts";
|
|
3
|
+
|
|
4
|
+
// 浏览器半:团队命令行(`conversation.chat.commandview`)、会话面板里的共享任务一节
|
|
5
|
+
// (`conversation.session.panel.section` 的 `shared-tasks`)、字典,以及模型菜单里的
|
|
6
|
+
// 「启用智能体团队协作」开关(`conversation.input.model.options`)。位置都由上游 0.2.3 的行自己注册;
|
|
7
|
+
// 它要 `slots` / `locale` / `remote` 就位,所以排在会话界面之后。
|
|
8
|
+
export const provideAgentTeamUi = provide([AgentTeamUi]);
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
// Agent Teams 的浏览器半:上游 `client-ui-agent-team` 经 `fromCordis` 接管。
|
|
2
|
+
//
|
|
3
|
+
// 它做三件事:注册 `agent-team` 字典、往 `conversation.chat.commandview` 挂团队命令行、把
|
|
4
|
+
// **模型菜单里的「启用智能体团队协作」开关**注册进 `conversation.input.model.options`(共享任务板在
|
|
5
|
+
// `conversation.session.panel.section` 的 `shared-tasks` 下)。**不重写组件**——上游那份照用。
|
|
6
|
+
//
|
|
7
|
+
// 它按名字读 `locale` / `slots` / `remote`(+ `remote.agentTeams`)。
|
|
8
|
+
//
|
|
9
|
+
// **`remote.agentTeams` 要自己挂**:浏览器里没有全局的 remotes 装载,每个域各自 `$mount` 自己那份
|
|
10
|
+
// `TYPERT_REMOTE`(同 `dsh-workspace` 的「工作区文件组」、`dsh-conversation` 的「会话引用组」)。
|
|
11
|
+
// 少了这一步,上游的 `ctx.inject(['remote','remote.agentTeams'], …)` 永远停在待激活——开关静默不出现,
|
|
12
|
+
// 且没有任何报错(那整块注册都在那个 scope 里)。
|
|
13
|
+
import { TYPERT_REMOTE as AGENT_TEAM_REMOTE } from "@deepseek-ai/dsh-agent-team/remote";
|
|
14
|
+
import * as ClientUiAgentTeam from "@deepseek-ai/dsh-client-ui-agent-team/client";
|
|
15
|
+
import { inject, Injectable, type Context } from "@morlay/zephyr";
|
|
16
|
+
import { fromCordis } from "@morlay/zephyr/compat";
|
|
17
|
+
import { Locale, Remote, Slots } from "@morlay/zephyr-app/client";
|
|
18
|
+
|
|
19
|
+
/** 团队动作行(浏览器半)。 */
|
|
20
|
+
@Injectable()
|
|
21
|
+
export class AgentTeamUi extends fromCordis(ClientUiAgentTeam) {
|
|
22
|
+
private readonly remote = inject(Remote);
|
|
23
|
+
|
|
24
|
+
private readonly slots = inject(Slots);
|
|
25
|
+
|
|
26
|
+
private readonly locale = inject(Locale);
|
|
27
|
+
|
|
28
|
+
override async onInit(ctx: Context): Promise<void> {
|
|
29
|
+
// 先挂面再装行:上游的 `ctx.inject(['remote','remote.agentTeams'])` 等这个名字,先挂上才当场成立。
|
|
30
|
+
const dispose = await this.remote.$mount(AGENT_TEAM_REMOTE);
|
|
31
|
+
ctx.effect(() => dispose);
|
|
32
|
+
await this.mount(ctx, undefined, {
|
|
33
|
+
remote: this.remote,
|
|
34
|
+
slots: this.slots,
|
|
35
|
+
locale: this.locale,
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
}
|
package/src/ui/index.ts
ADDED