@wowyuarm/dsh-agent-team 0.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/LICENSE +21 -0
- package/README.md +103 -0
- package/README.zh.md +103 -0
- package/cordis.patch.yml +36 -0
- package/package.json +152 -0
- package/packages/agent-team/README.md +58 -0
- package/packages/agent-team/README.zh.md +57 -0
- package/packages/agent-team/lib/index.js +841 -0
- package/packages/agent-team/lib/invariant.js +24 -0
- package/packages/agent-team/lib/ledger.js +2161 -0
- package/packages/agent-team/lib/member-context.js +69 -0
- package/packages/agent-team/lib/preset-roster.js +14 -0
- package/packages/agent-team/lib/spec.js +347 -0
- package/packages/agent-team/lib/typert.host.d.ts +3 -0
- package/packages/agent-team/lib/typert.host.js +2084 -0
- package/packages/agent-team/lib/typert.remote-client.d.ts +54 -0
- package/packages/agent-team/lib/typert.remote-client.d.ts.map +1 -0
- package/packages/agent-team/lib/typert.remote-client.js +1218 -0
- package/packages/agent-team/lib/types/index.d.ts +156 -0
- package/packages/agent-team/lib/types/index.d.ts.map +1 -0
- package/packages/agent-team/lib/types/invariant.d.ts +13 -0
- package/packages/agent-team/lib/types/invariant.d.ts.map +1 -0
- package/packages/agent-team/lib/types/ledger.d.ts +271 -0
- package/packages/agent-team/lib/types/ledger.d.ts.map +1 -0
- package/packages/agent-team/lib/types/member-context.d.ts +7 -0
- package/packages/agent-team/lib/types/member-context.d.ts.map +1 -0
- package/packages/agent-team/lib/types/preset-roster.d.ts +5 -0
- package/packages/agent-team/lib/types/preset-roster.d.ts.map +1 -0
- package/packages/agent-team/lib/types/spec.d.ts +13 -0
- package/packages/agent-team/lib/types/spec.d.ts.map +1 -0
- package/packages/agent-team/lib/types/types.d.ts +818 -0
- package/packages/agent-team/lib/types/types.d.ts.map +1 -0
- package/packages/agent-team/lib/types.js +1 -0
- package/packages/agent-team/preset/team-member/agent.cordis.yml +89 -0
- package/packages/client-agent-team/README.md +39 -0
- package/packages/client-agent-team/README.zh.md +39 -0
- package/packages/client-agent-team/lib/client.js +9633 -0
- package/packages/client-agent-team/lib/client.js.map +1 -0
- package/packages/client-agent-team/lib/index.js +5 -0
- package/packages/client-agent-team/lib/types/client/TeamAgentsPanel.d.ts +20 -0
- package/packages/client-agent-team/lib/types/client/TeamAgentsPanel.d.ts.map +1 -0
- package/packages/client-agent-team/lib/types/client/TeamAgentsPanel.js +274 -0
- package/packages/client-agent-team/lib/types/client/TeamChannelPage.d.ts +19 -0
- package/packages/client-agent-team/lib/types/client/TeamChannelPage.d.ts.map +1 -0
- package/packages/client-agent-team/lib/types/client/TeamChannelPage.js +243 -0
- package/packages/client-agent-team/lib/types/client/TeamChannelsPanel.d.ts +21 -0
- package/packages/client-agent-team/lib/types/client/TeamChannelsPanel.d.ts.map +1 -0
- package/packages/client-agent-team/lib/types/client/TeamChannelsPanel.js +196 -0
- package/packages/client-agent-team/lib/types/client/TeamComposer.d.ts +15 -0
- package/packages/client-agent-team/lib/types/client/TeamComposer.d.ts.map +1 -0
- package/packages/client-agent-team/lib/types/client/TeamComposer.js +144 -0
- package/packages/client-agent-team/lib/types/client/TeamConversation.d.ts +3 -0
- package/packages/client-agent-team/lib/types/client/TeamConversation.d.ts.map +1 -0
- package/packages/client-agent-team/lib/types/client/TeamConversation.js +20 -0
- package/packages/client-agent-team/lib/types/client/TeamFooterAction.d.ts +3 -0
- package/packages/client-agent-team/lib/types/client/TeamFooterAction.d.ts.map +1 -0
- package/packages/client-agent-team/lib/types/client/TeamFooterAction.js +19 -0
- package/packages/client-agent-team/lib/types/client/TeamInboxPanel.d.ts +13 -0
- package/packages/client-agent-team/lib/types/client/TeamInboxPanel.d.ts.map +1 -0
- package/packages/client-agent-team/lib/types/client/TeamInboxPanel.js +90 -0
- package/packages/client-agent-team/lib/types/client/TeamMemberAvatar.d.ts +12 -0
- package/packages/client-agent-team/lib/types/client/TeamMemberAvatar.d.ts.map +1 -0
- package/packages/client-agent-team/lib/types/client/TeamMemberAvatar.js +15 -0
- package/packages/client-agent-team/lib/types/client/TeamMembersAction.d.ts +5 -0
- package/packages/client-agent-team/lib/types/client/TeamMembersAction.d.ts.map +1 -0
- package/packages/client-agent-team/lib/types/client/TeamMembersAction.js +32 -0
- package/packages/client-agent-team/lib/types/client/TeamMessage.d.ts +19 -0
- package/packages/client-agent-team/lib/types/client/TeamMessage.d.ts.map +1 -0
- package/packages/client-agent-team/lib/types/client/TeamMessage.js +24 -0
- package/packages/client-agent-team/lib/types/client/TeamPresenceDot.d.ts +11 -0
- package/packages/client-agent-team/lib/types/client/TeamPresenceDot.d.ts.map +1 -0
- package/packages/client-agent-team/lib/types/client/TeamPresenceDot.js +20 -0
- package/packages/client-agent-team/lib/types/client/TeamRowMenu.d.ts +15 -0
- package/packages/client-agent-team/lib/types/client/TeamRowMenu.d.ts.map +1 -0
- package/packages/client-agent-team/lib/types/client/TeamRowMenu.js +23 -0
- package/packages/client-agent-team/lib/types/client/TeamSettings.d.ts +3 -0
- package/packages/client-agent-team/lib/types/client/TeamSettings.d.ts.map +1 -0
- package/packages/client-agent-team/lib/types/client/TeamSettings.js +5 -0
- package/packages/client-agent-team/lib/types/client/TeamSidebarSection.d.ts +9 -0
- package/packages/client-agent-team/lib/types/client/TeamSidebarSection.d.ts.map +1 -0
- package/packages/client-agent-team/lib/types/client/TeamSidebarSection.js +9 -0
- package/packages/client-agent-team/lib/types/client/TeamThreadPage.d.ts +22 -0
- package/packages/client-agent-team/lib/types/client/TeamThreadPage.d.ts.map +1 -0
- package/packages/client-agent-team/lib/types/client/TeamThreadPage.js +464 -0
- package/packages/client-agent-team/lib/types/client/TeamWorkspaceBrowser.d.ts +3 -0
- package/packages/client-agent-team/lib/types/client/TeamWorkspaceBrowser.d.ts.map +1 -0
- package/packages/client-agent-team/lib/types/client/TeamWorkspaceBrowser.js +39 -0
- package/packages/client-agent-team/lib/types/client/TeamWorkspaceRow.d.ts +11 -0
- package/packages/client-agent-team/lib/types/client/TeamWorkspaceRow.d.ts.map +1 -0
- package/packages/client-agent-team/lib/types/client/TeamWorkspaceRow.js +6 -0
- package/packages/client-agent-team/lib/types/client/index.d.ts +19 -0
- package/packages/client-agent-team/lib/types/client/index.d.ts.map +1 -0
- package/packages/client-agent-team/lib/types/client/index.js +113 -0
- package/packages/client-agent-team/lib/types/client/locales.d.ts +224 -0
- package/packages/client-agent-team/lib/types/client/locales.d.ts.map +1 -0
- package/packages/client-agent-team/lib/types/client/locales.js +222 -0
- package/packages/client-agent-team/lib/types/client/navigation.d.ts +39 -0
- package/packages/client-agent-team/lib/types/client/navigation.d.ts.map +1 -0
- package/packages/client-agent-team/lib/types/client/navigation.js +96 -0
- package/packages/client-agent-team/lib/types/client/slots.d.ts +74 -0
- package/packages/client-agent-team/lib/types/client/slots.d.ts.map +1 -0
- package/packages/client-agent-team/lib/types/client/slots.js +1 -0
- package/packages/client-agent-team/lib/types/client/team-changes.d.ts +28 -0
- package/packages/client-agent-team/lib/types/client/team-changes.d.ts.map +1 -0
- package/packages/client-agent-team/lib/types/client/team-changes.js +70 -0
- package/packages/client-agent-team/lib/types/client/team-formatters.d.ts +53 -0
- package/packages/client-agent-team/lib/types/client/team-formatters.d.ts.map +1 -0
- package/packages/client-agent-team/lib/types/client/team-formatters.js +128 -0
- package/packages/client-agent-team/lib/types/client/team-membership.d.ts +25 -0
- package/packages/client-agent-team/lib/types/client/team-membership.d.ts.map +1 -0
- package/packages/client-agent-team/lib/types/client/team-membership.js +39 -0
- package/packages/client-agent-team/lib/types/client/team-separators.d.ts +23 -0
- package/packages/client-agent-team/lib/types/client/team-separators.d.ts.map +1 -0
- package/packages/client-agent-team/lib/types/client/team-separators.js +52 -0
- package/packages/client-agent-team/lib/types/client/timeline-scroll.d.ts +18 -0
- package/packages/client-agent-team/lib/types/client/timeline-scroll.d.ts.map +1 -0
- package/packages/client-agent-team/lib/types/client/timeline-scroll.js +54 -0
- package/packages/client-agent-team/lib/types/index.d.ts +3 -0
- package/packages/client-agent-team/lib/types/index.d.ts.map +1 -0
- package/packages/client-agent-team/lib/types/index.js +2 -0
- package/packages/tool-agent-team/README.md +23 -0
- package/packages/tool-agent-team/README.zh.md +23 -0
- package/packages/tool-agent-team/lib/index.js +294 -0
- package/packages/tool-agent-team/lib/types/index.d.ts +5 -0
- package/packages/tool-agent-team/lib/types/index.d.ts.map +1 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 wowyuarm
|
|
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
ADDED
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
# DeepSeek Harness Agent Team
|
|
2
|
+
|
|
3
|
+
[English](README.md) | [简体中文](README.zh.md)
|
|
4
|
+
|
|
5
|
+
An Agent Team plugin for [DeepSeek Harness](https://github.com/deepseek-ai/deepseek-harness): persistent Workspaces, Channels, Threads, Tasks, and managed Agent members in one DSH home.
|
|
6
|
+
|
|
7
|
+
Opt-in by design: install it only where Team mode is needed; ordinary DSH sessions keep their normal preset roster.
|
|
8
|
+
|
|
9
|
+
## Preview
|
|
10
|
+
|
|
11
|
+

|
|
12
|
+
|
|
13
|
+
## Quick start
|
|
14
|
+
|
|
15
|
+
### 1. Check DSH
|
|
16
|
+
|
|
17
|
+
This release is certified against DSH `0.1.1-rc.2`. If `dsh` is not installed yet, start DSH with the official package:
|
|
18
|
+
|
|
19
|
+
```sh
|
|
20
|
+
npx @deepseek-ai/dsh web
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
Stop it, then install Agent Team into the `web` profile:
|
|
24
|
+
|
|
25
|
+
```sh
|
|
26
|
+
dsh plugin --profile web add @wowyuarm/dsh-agent-team
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
### 2. Start the Web UI
|
|
30
|
+
|
|
31
|
+
```sh
|
|
32
|
+
dsh web
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
Agent Team is opt-in. Installing it adds the bundle to the `web` profile; it does not modify the Harness installation or shipped defaults.
|
|
36
|
+
|
|
37
|
+
### 3. Verify and try it
|
|
38
|
+
|
|
39
|
+
Before starting the UI, you can inspect the composed profile:
|
|
40
|
+
|
|
41
|
+
```sh
|
|
42
|
+
dsh --profile web --dump-config
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
The output should include Team rows such as `wowyuarm-agent-team-scope` and `wowyuarm-agent-team-client`. In the browser, enter **Team mode** from the DSH navigation. The first useful path is:
|
|
46
|
+
|
|
47
|
+
```text
|
|
48
|
+
Team mode
|
|
49
|
+
└── select a Workspace
|
|
50
|
+
├── Channels -> New Channel -> send the first message
|
|
51
|
+
└── Agents -> Add Agent -> choose its initial Channels
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
Create an Agent only in a trusted Workspace. The Team Member preset intentionally grants managed Agent Sessions `danger-full-access`.
|
|
55
|
+
|
|
56
|
+
## What it adds
|
|
57
|
+
|
|
58
|
+
- A durable single-host Team with Channels, Messages, Tasks, Threads, Claims, and Agent membership.
|
|
59
|
+
- A Web Client for Human control: create Channels and Agents, manage membership, send Messages, open Threads, and handle Tasks.
|
|
60
|
+
- An isolated `team-member` preset with five model-facing tools: `team_inbox`, `team_thread`, `team_message`, `team_claim`, and `team_view`.
|
|
61
|
+
- A pull-based collaboration protocol. Agent Inbox admission is durable, but it does not claim that the model has already processed the update.
|
|
62
|
+
|
|
63
|
+
The Team is one collaboration domain per DSH home. Its append-only operation ledger is the authority; UI, Remote responses, tools, Inbox, and other projections derive from committed operations. Ordinary DSH Sessions keep the profile's normal preset roster and do not receive Team tools or guidance.
|
|
64
|
+
|
|
65
|
+
## Install from a local checkout
|
|
66
|
+
|
|
67
|
+
For development, install the local bundle into the same profile:
|
|
68
|
+
|
|
69
|
+
```sh
|
|
70
|
+
dsh plugin --profile web add /absolute/path/to/dsh-agent-team
|
|
71
|
+
dsh web
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
Published packages include built artifacts. A local checkout needs the adjacent Harness repository only for development checks, not for end-user installation.
|
|
75
|
+
|
|
76
|
+
## Compatibility and limits
|
|
77
|
+
|
|
78
|
+
- This release is certified against DSH `0.1.1-rc.2`.
|
|
79
|
+
- The bundle is single-host. It does not provide distributed consensus, Team direct messages, nested Threads, or semantic Direction deduplication.
|
|
80
|
+
- The current DSH SQLite Session schema rejects databases from older DSH versions. Delete the old Session database and start fresh when upgrading across that boundary; this bundle does not migrate it.
|
|
81
|
+
- Team-managed Agent Sessions use `danger-full-access`. Use them only in trusted Workspaces.
|
|
82
|
+
|
|
83
|
+
## Development
|
|
84
|
+
|
|
85
|
+
Read [`docs/README.md`](docs/README.md) for the maintained documentation index. The usual checks are:
|
|
86
|
+
|
|
87
|
+
```sh
|
|
88
|
+
corepack pnpm install
|
|
89
|
+
npm run typecheck
|
|
90
|
+
npm test
|
|
91
|
+
npm run build
|
|
92
|
+
npm run lint
|
|
93
|
+
npm run test:browser
|
|
94
|
+
npm pack --dry-run
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
`npm run test:browser` uses the adjacent `../deepseek-harness` checkout, an isolated temporary profile, and `/usr/bin/google-chrome` (override with `CHROME_PATH`). It does not need provider credentials. For manual checks, `npm run preview:ui` loads Team fixtures without model streaming; `DEEPSEEK_API_KEY=... npm run preview` starts the real provider preview. Both preview commands clean up their temporary state on `Ctrl+C`.
|
|
98
|
+
|
|
99
|
+
Architecture and the collaboration contract are documented in [`docs/architecture.md`](docs/architecture.md) and [`docs/team-collaboration.md`](docs/team-collaboration.md).
|
|
100
|
+
|
|
101
|
+
## License
|
|
102
|
+
|
|
103
|
+
[MIT](LICENSE)
|
package/README.zh.md
ADDED
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
# DeepSeek Harness Agent Team
|
|
2
|
+
|
|
3
|
+
[English](README.md) | 简体中文
|
|
4
|
+
|
|
5
|
+
这是一个为 [DeepSeek Harness](https://github.com/deepseek-ai/deepseek-harness) 提供的 Agent Team 插件:在一个 DSH home 中组织持久化的 Workspace、Channel、Thread、Task 和由 Team 管理的 Agent 成员。
|
|
6
|
+
|
|
7
|
+
按需启用:只在需要 Team mode 的 profile 中安装;普通 DSH Session 保持原有 preset roster。
|
|
8
|
+
|
|
9
|
+
## 预览
|
|
10
|
+
|
|
11
|
+

|
|
12
|
+
|
|
13
|
+
## 快速开始
|
|
14
|
+
|
|
15
|
+
### 1. 检查 DSH
|
|
16
|
+
|
|
17
|
+
当前版本已针对 DSH `0.1.1-rc.2` 完成认证。如果还没有安装 `dsh`,先使用官方 package 启动 DSH:
|
|
18
|
+
|
|
19
|
+
```sh
|
|
20
|
+
npx @deepseek-ai/dsh web
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
先停止它,再把 Agent Team 安装到 `web` profile:
|
|
24
|
+
|
|
25
|
+
```sh
|
|
26
|
+
dsh plugin --profile web add @wowyuarm/dsh-agent-team
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
### 2. 启动 Web UI
|
|
30
|
+
|
|
31
|
+
```sh
|
|
32
|
+
dsh web
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
Agent Team 是显式 opt-in 的。安装只会把 bundle 加入 `web` profile,不会修改 Harness 安装,也不会修改 shipped defaults。
|
|
36
|
+
|
|
37
|
+
### 3. 验证并开始使用
|
|
38
|
+
|
|
39
|
+
启动 UI 前可以检查 profile 的实际组装结果:
|
|
40
|
+
|
|
41
|
+
```sh
|
|
42
|
+
dsh --profile web --dump-config
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
输出中应包含 Team rows,例如 `wowyuarm-agent-team-scope` 和 `wowyuarm-agent-team-client`。打开浏览器后,从 DSH 导航进入 **Team mode**。第一次可以按下面的路径操作:
|
|
46
|
+
|
|
47
|
+
```text
|
|
48
|
+
Team mode
|
|
49
|
+
└── 选择一个 Workspace
|
|
50
|
+
├── Channels -> 新建频道 -> 发送第一条消息
|
|
51
|
+
└── Agents -> 添加 Agent -> 选择初始频道
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
只在可信 Workspace 中创建 Agent。Team Member preset 会给被管理的 Agent Session 授予 `danger-full-access`。
|
|
55
|
+
|
|
56
|
+
## 提供的能力
|
|
57
|
+
|
|
58
|
+
- 持久化的单 Host Team,包含 Channel、Message、Task、Thread、Claim 和 Agent membership。
|
|
59
|
+
- Web Client 人工控制界面:创建 Channel 和 Agent、管理成员、发送 Message、打开 Thread、处理 Task。
|
|
60
|
+
- 隔离的 `team-member` preset,以及五个面向模型的工具:`team_inbox`、`team_thread`、`team_message`、`team_claim`、`team_view`。
|
|
61
|
+
- 拉取式协作协议。Agent Inbox admission 是持久化事实,但不表示模型已经处理了更新。
|
|
62
|
+
|
|
63
|
+
一个 DSH home 对应一个 Team 协作域。append-only operation ledger 是权威;UI、Remote response、tools、Inbox 和其他 projection 都从已提交的 operation 派生。普通 DSH Session 继续使用 profile 原有 preset roster,不会获得 Team tools 或 guidance。
|
|
64
|
+
|
|
65
|
+
## 从本地 checkout 安装
|
|
66
|
+
|
|
67
|
+
开发时,可以把本地 bundle 安装到同一个 profile:
|
|
68
|
+
|
|
69
|
+
```sh
|
|
70
|
+
dsh plugin --profile web add /absolute/path/to/dsh-agent-team
|
|
71
|
+
dsh web
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
发布包已经包含构建产物。只有开发检查需要相邻的 Harness repository,终端用户安装不需要它。
|
|
75
|
+
|
|
76
|
+
## 兼容性与限制
|
|
77
|
+
|
|
78
|
+
- 当前版本已针对 DSH `0.1.1-rc.2` 完成认证。
|
|
79
|
+
- Bundle 是单 Host,不提供分布式共识、Team direct message、嵌套 Thread 或 Direction 语义去重。
|
|
80
|
+
- 当前 DSH SQLite Session schema 不接受旧版 DSH 的数据库。跨越该边界升级时,删除旧 Session 数据库并重新开始;本 bundle 不负责迁移。
|
|
81
|
+
- Team 管理的 Agent Session 使用 `danger-full-access`。只在可信 Workspace 中使用。
|
|
82
|
+
|
|
83
|
+
## 开发
|
|
84
|
+
|
|
85
|
+
维护中的文档入口是 [`docs/README.md`](docs/README.md)。常用检查命令:
|
|
86
|
+
|
|
87
|
+
```sh
|
|
88
|
+
corepack pnpm install
|
|
89
|
+
npm run typecheck
|
|
90
|
+
npm test
|
|
91
|
+
npm run build
|
|
92
|
+
npm run lint
|
|
93
|
+
npm run test:browser
|
|
94
|
+
npm pack --dry-run
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
`npm run test:browser` 使用相邻的 `../deepseek-harness` checkout、隔离临时 profile 和 `/usr/bin/google-chrome`(可用 `CHROME_PATH` 覆盖),不需要 provider credentials。手动检查时,`npm run preview:ui` 会加载不调用模型的 Team fixture;`DEEPSEEK_API_KEY=... npm run preview` 会启动真实 provider preview。两个 preview 命令都会在 `Ctrl+C` 后清理临时状态。
|
|
98
|
+
|
|
99
|
+
架构和协作协议见 [`docs/architecture.md`](docs/architecture.md) 与 [`docs/team-collaboration.md`](docs/team-collaboration.md)。
|
|
100
|
+
|
|
101
|
+
## 许可证
|
|
102
|
+
|
|
103
|
+
[MIT](LICENSE)
|
package/cordis.patch.yml
ADDED
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
- insert:
|
|
2
|
+
- id: wowyuarm-agent-team-scope
|
|
3
|
+
name: cordis:group
|
|
4
|
+
group: true
|
|
5
|
+
isolate:
|
|
6
|
+
agentPresets: true
|
|
7
|
+
config:
|
|
8
|
+
- id: wowyuarm-agent-team-presets
|
|
9
|
+
name: '@wowyuarm/dsh-agent-team/preset-roster'
|
|
10
|
+
- id: wowyuarm-agent-team-host
|
|
11
|
+
name: '@wowyuarm/dsh-agent-team/host'
|
|
12
|
+
- id: wowyuarm-agent-team-client
|
|
13
|
+
name: '@wowyuarm/dsh-agent-team'
|
|
14
|
+
- id: wowyuarm-agent-team-invariants
|
|
15
|
+
name: '@deepseek-ai/dsh-invariants'
|
|
16
|
+
- id: wowyuarm-agent-team-invariant
|
|
17
|
+
name: '@wowyuarm/dsh-agent-team/invariant'
|
|
18
|
+
# Team ledger medium backend. A plain dependency of this bundle, mounted
|
|
19
|
+
# as an ordinary storage provider row beside the shipped JSON backend.
|
|
20
|
+
- id: storage-sqlite
|
|
21
|
+
name: '@deepseek-ai/dsh-storage-sqlite'
|
|
22
|
+
config:
|
|
23
|
+
path: !!js dshHomePath('storages', 'agent_team.sqlite')
|
|
24
|
+
|
|
25
|
+
# Only the agent_team domain routes to SQLite; every other domain keeps the
|
|
26
|
+
# JSON default. This row is a top-level override, NOT an insert-list entry:
|
|
27
|
+
# insert lists append new rows, so a colliding id here would duplicate the
|
|
28
|
+
# shipped storage-domain row and fail the boot sweep. A patch replaces the
|
|
29
|
+
# targeted row's whole config, so `backend: json` must be restated and this
|
|
30
|
+
# override follows the shipped row's keys — update it when upstream adds one.
|
|
31
|
+
- id: storage-domain
|
|
32
|
+
name: '@deepseek-ai/dsh-storage-domain'
|
|
33
|
+
config:
|
|
34
|
+
backend: json
|
|
35
|
+
routes:
|
|
36
|
+
agent_team: sqlite
|
package/package.json
ADDED
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@wowyuarm/dsh-agent-team",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "Agent Team plugin for DeepSeek Harness",
|
|
5
|
+
"repository": {
|
|
6
|
+
"type": "git",
|
|
7
|
+
"url": "https://github.com/wowyuarm/dsh-agent-team.git"
|
|
8
|
+
},
|
|
9
|
+
"private": false,
|
|
10
|
+
"type": "module",
|
|
11
|
+
"files": [
|
|
12
|
+
"cordis.patch.yml",
|
|
13
|
+
"packages/agent-team/lib/**/*",
|
|
14
|
+
"packages/agent-team/preset/**/*",
|
|
15
|
+
"packages/tool-agent-team/lib/**/*",
|
|
16
|
+
"packages/client-agent-team/lib/**/*",
|
|
17
|
+
"README.md",
|
|
18
|
+
"README.zh.md"
|
|
19
|
+
],
|
|
20
|
+
"scripts": {
|
|
21
|
+
"generate:typert": "cd ../deepseek-harness && node --import tsx ../dsh-agent-team/scripts/generate-typert.mjs",
|
|
22
|
+
"prepack": "npm run build",
|
|
23
|
+
"test": "npm run generate:typert && vitest run",
|
|
24
|
+
"test:browser": "npm run build && node scripts/run-browser-test.mjs",
|
|
25
|
+
"preview": "node scripts/check-preview-credentials.mjs && npm run build && node scripts/run-preview.mjs",
|
|
26
|
+
"preview:ui": "npm run build && node scripts/run-ui-preview.mjs",
|
|
27
|
+
"lint": "corepack pnpm dlx oxlint@1.76.0 --disable-typescript-plugin packages scripts",
|
|
28
|
+
"typecheck": "npm run generate:typert && tsc -p packages/agent-team/tsconfig.json && tsc -p packages/tool-agent-team/tsconfig.json && tsc -p packages/client-agent-team/tsconfig.json",
|
|
29
|
+
"build": "npm run generate:typert && tsc -p packages/agent-team/tsconfig.build.json && tsc -p packages/tool-agent-team/tsconfig.build.json && tsc -p packages/client-agent-team/tsconfig.build.json && node scripts/build-client.mjs"
|
|
30
|
+
},
|
|
31
|
+
"dsh": {
|
|
32
|
+
"bundle": {
|
|
33
|
+
"patch": "./cordis.patch.yml"
|
|
34
|
+
},
|
|
35
|
+
"client": {
|
|
36
|
+
"platform": "web",
|
|
37
|
+
"inject": [
|
|
38
|
+
"@deepseek-ai/dsh-client-runtime",
|
|
39
|
+
"@deepseek-ai/dsh-api-remotes",
|
|
40
|
+
"@deepseek-ai/dsh-client-ui-sidebar",
|
|
41
|
+
"@deepseek-ai/dsh-client-ui-layout",
|
|
42
|
+
"@deepseek-ai/dsh-client-ui-settings-general",
|
|
43
|
+
"@deepseek-ai/dsh-client-ui-conversation",
|
|
44
|
+
"@deepseek-ai/dsh-client-ui-workspace",
|
|
45
|
+
"@deepseek-ai/dsh-client-locale"
|
|
46
|
+
]
|
|
47
|
+
}
|
|
48
|
+
},
|
|
49
|
+
"dependencies": {
|
|
50
|
+
"@deepseek-ai/dsh-storage-sqlite": ">=0.1.1-rc.2 <0.2.0",
|
|
51
|
+
"zod": "^4.4.3"
|
|
52
|
+
},
|
|
53
|
+
"devDependencies": {
|
|
54
|
+
"@testing-library/dom": "^10.4.1",
|
|
55
|
+
"@testing-library/react": "^16.3.2",
|
|
56
|
+
"@types/node": "^24.0.0",
|
|
57
|
+
"@types/react": "~18.3.31",
|
|
58
|
+
"@types/react-dom": "~18.3.7",
|
|
59
|
+
"jsdom": "^30.0.1",
|
|
60
|
+
"react": "^18.3.1",
|
|
61
|
+
"react-dom": "^18.3.1",
|
|
62
|
+
"typescript": "^5.8.3",
|
|
63
|
+
"use-sync-external-store": "1.2.0",
|
|
64
|
+
"vite": "^7.0.0",
|
|
65
|
+
"vite-tsconfig-paths": "^5.0.0",
|
|
66
|
+
"vitest": "^4.1.8"
|
|
67
|
+
},
|
|
68
|
+
"main": "packages/client-agent-team/lib/index.js",
|
|
69
|
+
"types": "packages/client-agent-team/lib/types/index.d.ts",
|
|
70
|
+
"exports": {
|
|
71
|
+
".": {
|
|
72
|
+
"types": "./packages/client-agent-team/lib/types/index.d.ts",
|
|
73
|
+
"default": "./packages/client-agent-team/lib/index.js"
|
|
74
|
+
},
|
|
75
|
+
"./host": {
|
|
76
|
+
"types": "./packages/agent-team/lib/types/index.d.ts",
|
|
77
|
+
"default": "./packages/agent-team/lib/index.js"
|
|
78
|
+
},
|
|
79
|
+
"./invariant": {
|
|
80
|
+
"types": "./packages/agent-team/lib/types/invariant.d.ts",
|
|
81
|
+
"default": "./packages/agent-team/lib/invariant.js"
|
|
82
|
+
},
|
|
83
|
+
"./types": {
|
|
84
|
+
"types": "./packages/agent-team/lib/types/types.d.ts",
|
|
85
|
+
"default": "./packages/agent-team/lib/types.js"
|
|
86
|
+
},
|
|
87
|
+
"./typert": {
|
|
88
|
+
"types": "./packages/agent-team/lib/typert.host.d.ts",
|
|
89
|
+
"default": "./packages/agent-team/lib/typert.host.js"
|
|
90
|
+
},
|
|
91
|
+
"./remote": {
|
|
92
|
+
"types": "./packages/agent-team/lib/typert.remote-client.d.ts",
|
|
93
|
+
"default": "./packages/agent-team/lib/typert.remote-client.js"
|
|
94
|
+
},
|
|
95
|
+
"./preset-roster": {
|
|
96
|
+
"types": "./packages/agent-team/lib/types/preset-roster.d.ts",
|
|
97
|
+
"default": "./packages/agent-team/lib/preset-roster.js"
|
|
98
|
+
},
|
|
99
|
+
"./member-context": {
|
|
100
|
+
"types": "./packages/agent-team/lib/types/member-context.d.ts",
|
|
101
|
+
"default": "./packages/agent-team/lib/member-context.js"
|
|
102
|
+
},
|
|
103
|
+
"./tools": {
|
|
104
|
+
"types": "./packages/tool-agent-team/lib/types/index.d.ts",
|
|
105
|
+
"default": "./packages/tool-agent-team/lib/index.js"
|
|
106
|
+
},
|
|
107
|
+
"./client": {
|
|
108
|
+
"types": "./packages/client-agent-team/lib/types/client/index.d.ts",
|
|
109
|
+
"default": "./packages/client-agent-team/lib/client.js"
|
|
110
|
+
},
|
|
111
|
+
"./package.json": "./package.json"
|
|
112
|
+
},
|
|
113
|
+
"peerDependencies": {
|
|
114
|
+
"@deepseek-ai/dsh-agent": ">=0.1.1-rc.2 <0.2.0",
|
|
115
|
+
"@deepseek-ai/dsh-agent-default-model": ">=0.1.1-rc.2 <0.2.0",
|
|
116
|
+
"@deepseek-ai/dsh-agent-tool-presentation": ">=0.1.1-rc.2 <0.2.0",
|
|
117
|
+
"@deepseek-ai/dsh-agent-presets": ">=0.1.1-rc.2 <0.2.0",
|
|
118
|
+
"@deepseek-ai/dsh-tool-bash": ">=0.1.1-rc.2 <0.2.0",
|
|
119
|
+
"@deepseek-ai/dsh-tool-pwsh": ">=0.1.1-rc.2 <0.2.0",
|
|
120
|
+
"@deepseek-ai/dsh-tool-fs": ">=0.1.1-rc.2 <0.2.0",
|
|
121
|
+
"@deepseek-ai/dsh-tool-fs-search": ">=0.1.1-rc.2 <0.2.0",
|
|
122
|
+
"@deepseek-ai/dsh-tool-jobs": ">=0.1.1-rc.2 <0.2.0",
|
|
123
|
+
"@deepseek-ai/dsh-skill-filesystem": ">=0.1.1-rc.2 <0.2.0",
|
|
124
|
+
"@deepseek-ai/dsh-tool-skill": ">=0.1.1-rc.2 <0.2.0",
|
|
125
|
+
"@deepseek-ai/dsh-tool-todo": ">=0.1.1-rc.2 <0.2.0",
|
|
126
|
+
"@deepseek-ai/dsh-tool-web": ">=0.1.1-rc.2 <0.2.0",
|
|
127
|
+
"@deepseek-ai/dsh-brand": ">=0.1.1-rc.2 <0.2.0",
|
|
128
|
+
"@deepseek-ai/dsh-home-paths": ">=0.1.1-rc.2 <0.2.0",
|
|
129
|
+
"@deepseek-ai/dsh-invariants": ">=0.1.1-rc.2 <0.2.0",
|
|
130
|
+
"@deepseek-ai/dsh-llm": ">=0.1.1-rc.2 <0.2.0",
|
|
131
|
+
"@deepseek-ai/dsh-sandbox-policy": ">=0.1.1-rc.2 <0.2.0",
|
|
132
|
+
"@deepseek-ai/dsh-scope": ">=0.1.1-rc.2 <0.2.0",
|
|
133
|
+
"@deepseek-ai/dsh-session": ">=0.1.1-rc.2 <0.2.0",
|
|
134
|
+
"@deepseek-ai/dsh-session-persistence": ">=0.1.1-rc.2 <0.2.0",
|
|
135
|
+
"@deepseek-ai/dsh-storage-domain": ">=0.1.1-rc.2 <0.2.0",
|
|
136
|
+
"@deepseek-ai/dsh-tools": ">=0.1.1-rc.2 <0.2.0",
|
|
137
|
+
"@deepseek-ai/dsh-typert-protocol": ">=0.1.1-rc.2 <0.2.0",
|
|
138
|
+
"@deepseek-ai/dsh-workspace": ">=0.1.1-rc.2 <0.2.0",
|
|
139
|
+
"@deepseek-ai/cordis": "^4.0.1",
|
|
140
|
+
"@deepseek-ai/dsh-api-remotes": ">=0.1.1-rc.2 <0.2.0",
|
|
141
|
+
"@deepseek-ai/dsh-client-locale": ">=0.1.1-rc.2 <0.2.0",
|
|
142
|
+
"@deepseek-ai/dsh-client-runtime": ">=0.1.1-rc.2 <0.2.0",
|
|
143
|
+
"@deepseek-ai/dsh-client-ui-conversation": ">=0.1.1-rc.2 <0.2.0",
|
|
144
|
+
"@deepseek-ai/dsh-client-ui-workspace": ">=0.1.1-rc.2 <0.2.0",
|
|
145
|
+
"@deepseek-ai/dsh-client-ui-layout": ">=0.1.1-rc.2 <0.2.0",
|
|
146
|
+
"@deepseek-ai/dsh-client-ui-primitives": ">=0.1.1-rc.2 <0.2.0",
|
|
147
|
+
"@deepseek-ai/dsh-client-ui-settings-general": ">=0.1.1-rc.2 <0.2.0",
|
|
148
|
+
"@deepseek-ai/dsh-client-ui-sidebar": ">=0.1.1-rc.2 <0.2.0",
|
|
149
|
+
"@deepseek-ai/dsh-client-ui-slots": ">=0.1.1-rc.2 <0.2.0",
|
|
150
|
+
"react": "^18.2.0"
|
|
151
|
+
}
|
|
152
|
+
}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
# @wowyuarm/dsh-agent-team
|
|
2
|
+
|
|
3
|
+
English | [中文](README.zh.md)
|
|
4
|
+
|
|
5
|
+
The Host capability for one Agent Team in a dshHome. `ctx.agentTeam` owns the append-only operation ledger, reconstructs the current collaboration projection, and is the lifecycle owner for member Agents managed by the same capability. Thread Attention and the Member Inbox are durable Host projections. When unread state changes, this package sends one bounded, coalesced context notification through the Agent's public safe-boundary API; it never interrupts an active request or acts as a Session delivery worker. The [Agent Team architecture note](../../../.agents/notes/proposed/architecture/2026-08-15-agent-team-operation-ledger.md) owns the persistence and package-topology decisions.
|
|
6
|
+
|
|
7
|
+
## Service contract
|
|
8
|
+
|
|
9
|
+
The Service consumes `ctx.storageDomain`, `ctx.workspaceRegistry`, `ctx.agents`, `ctx.agentDefaultModel`, `ctx.agentPresets`, `ctx.tools`, `ctx.sessions`, and `ctx.sessionPersistence`. It opens the versioned `agent_team` Domain before Cordis publishes `ctx.agentTeam`. The first boot appends one `team/initialized` operation for the stable Human Member; later boots replay the same operation and do not append another record.
|
|
10
|
+
|
|
11
|
+
`status()` returns the current durable sequence, operation count, channel count, Agent Member count, and Human Member ref. It performs no model request and no storage write. `validateLedger()` checks the package-owned projection against the durable operation table.
|
|
12
|
+
|
|
13
|
+
Every operation record carries a positive global sequence, unique operation and request ids, an actor snapshot, and the previous operation id. Replay rejects invalid record fields, table-key/id mismatches, sequence gaps, broken previous links, repeated ids, and invalid state transitions. An identical request-id retry returns the original receipt; a changed payload with the same request id rejects.
|
|
14
|
+
|
|
15
|
+
## Durability and lifecycle
|
|
16
|
+
|
|
17
|
+
`storage-domain` validates every record at the durable read boundary and rejects a backend unit stamped with another version. The Team updates its projection only after `KvTable.put()` resolves. Its Fiber owns the Domain handle; disposal rejects new Service calls through Cordis removal, drains accepted Domain writes, and closes the backend unit before the name can reopen.
|
|
18
|
+
|
|
19
|
+
Member creation commits one stable Member/session/Workspace/preset/private-memory identity before unpublished Agent setup. Setup mounts the selected preset and validates its marked `team_message` plus all five Team tools before publication. Failure leaves only that Member unavailable. Suspend waits for the owned `AgentHandle` to stop; resume and Host remount restore the exact persisted session.
|
|
20
|
+
|
|
21
|
+
Every team-managed session records `danger-full-access`. Project cwd remains the Workspace path, while private memory lives under `$DSH_HOME/agent-team/members/<memberId>/`. An untitled Member session is named with its handle through the session-title service, so the ordinary Session list shows the Member identity; an explicit rename or any earlier title always wins. The isolated `team-member` preset also provides coding tools including model-facing web search, Workspace instruction discovery, and Team protocol guidance. The host owns the shared Web service and provider; the preset mounts only the model-facing web tool. Its lowercase `memory.md` is a bounded 8 KiB reference index, injected only for that Member when its content changes; `notes/` stays on-demand through filesystem tools. Over-budget indexes receive a maintenance warning, not silent truncation. Ordinary sessions and forks receive no Team identity or private-memory context. At Host startup the Host prunes `member:`-shaped private-memory directories that the replayed ledger does not reference — leftovers from discarded ledgers, since a version-bumped medium rejects at open and starts empty. Prune failures fail startup; entries outside the `member:` shape are left untouched.
|
|
22
|
+
|
|
23
|
+
Adding a Member to a Channel grants future read/send/claim authority but injects no historical Messages into the member session. Thread Attention starts when a Task is created, a Claim is created, a member follows, a top-level Message mentions them, or a Human confirms an invitation. Ordinary unread is derived from Attention; structured mentions create durable direct markers, while terminal Task changes retain sparse Activity markers for affected followers after Attention ends. `team_inbox` and Thread reads are Host projections, not Session inbox contents. A direct mention context includes its Message body and source; Task/Claim changes include concise transition facts; ordinary unread includes only a body-free Task route. Pending hints are coalesced, ignored hints do not loop, and resume/error recovery derives a new hint from durable unread state.
|
|
24
|
+
|
|
25
|
+
Member replies require the exact current Thread revision and atomically update Message and Thread facts. Unread work must be read before a mutation; stale revisions are rejected after that unread gate. A closed Task rejects replies and new Attention; reopening restores the Task without restoring prior Attention. Top-level Messages may mention Agents directly: mentioned Members start following the new Thread. In an existing Thread, a Human reply mentioning an unfollowed Agent requires a process-local, one-use confirmation token before the operation commits, while such Member replies are rejected with member_not_following. Message facts carry their structured mention refs, and the Client renders mention chips only for those Members. Claim/done/release and Task changes are ordered host-authored Activities. Active Claims exclude only the same normalized Direction; different Directions can run concurrently. Task state is derived from Claims unless Human acceptance or closure overrides it. Close releases active Claims and clears Thread Attention atomically. Member removal marks the member inactive, releases owned active Claims, clears its Attention and direct markers, and archives the session after the durable commit. Message and Activity facts share one bounded sequence cursor.
|
|
26
|
+
|
|
27
|
+
`changes()` is the Client invalidation stream. Each request declares one optional `scope` — workspace, channel, or thread — plus an abortable transport signal; a committed operation wakes only waiters whose scope matches the scopes derived from that operation (member lifecycle and presence wake their Workspace; content operations wake their Channel and Thread). A Thread read commits durably but derives no scope, because it advances only the reader's private watermark. After each commit the Host notifies only the Members whose Inbox projection the operation can have changed — the operation's Attention/marker delta plus current followers of the touched Threads — never every live Agent.
|
|
28
|
+
|
|
29
|
+
M1 supports one Host writer. The ledger is permanent and has no snapshot or compaction path.
|
|
30
|
+
|
|
31
|
+
## Composition
|
|
32
|
+
|
|
33
|
+
The bundle consumes the Host's existing singleton providers; it does not mount replacements for `agents`, default model selection, `tools`, `fs`, `sandboxPolicy`, Session store/persistence, Workspace registry, or storage. Load those Host services once, then mount this Service and its invariant companion. The Team Web Client is the only Human control surface.
|
|
34
|
+
|
|
35
|
+
A team-enabled preset registers the five tools in its own agent scope and marks the `team_message` definition with `markAgentTeamPreset()`. Preset rows must resolve `ctx.agentTeam` when executing, not statically inject it: the Host mounts member presets while it restores Members during its own activation, so a row that declares `agentTeam` as a dependency cannot activate and fails every startup restore. Duplicate scoped tool names fail during unpublished setup and make only that Member unavailable. Duplicate Host service providers remain a composition error and should be removed rather than layered.
|
|
36
|
+
|
|
37
|
+
## Model Experience
|
|
38
|
+
|
|
39
|
+
### Host collaboration state
|
|
40
|
+
|
|
41
|
+
#### What the model sees
|
|
42
|
+
|
|
43
|
+
An enabled Member may receive one bounded, coalesced context notification after durable unread work appears. Structured direct mentions include their Message body and source; Task/Claim Activities include concise state transitions; ordinary unread includes only Task refs, counts, and revisions. The notification is queued at the Agent's safe step boundary, so active model requests and tools are not interrupted. It routes the common path directly to `team_thread.read`; the model uses `team_inbox` only when it needs to triage remaining Threads.
|
|
44
|
+
|
|
45
|
+
#### Token effect
|
|
46
|
+
|
|
47
|
+
The ledger, projection, and Human status reads add no model tokens.
|
|
48
|
+
|
|
49
|
+
#### KV Cache effect
|
|
50
|
+
|
|
51
|
+
The Host ledger and Human status reads do not alter model requests or cache reuse.
|
|
52
|
+
|
|
53
|
+
## Known Limitations and Deferred Work
|
|
54
|
+
|
|
55
|
+
- **Single Host writer** — concurrent processes over one dshHome are unsupported; operation serialization is process-local.
|
|
56
|
+
- **Permanent ledger** — M1 provides neither snapshots nor compaction, so storage grows with committed collaboration facts.
|
|
57
|
+
- **No remote provider seam** — the package combines the capability definition and its only implementation until a real remote Consumer requires another Provider.
|
|
58
|
+
- **Current DSH SQLite only** — SQLite Session persistence uses the current DSH schema. Delete old Session databases and create new Member sessions; this package provides no migration, compatibility read, or fallback.
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
# @wowyuarm/dsh-agent-team
|
|
2
|
+
|
|
3
|
+
[English](README.md) | 中文
|
|
4
|
+
|
|
5
|
+
一个 dshHome 内唯一 Agent Team 的 Host capability。`ctx.agentTeam` 拥有 append-only operation ledger、重建当前协作 projection,并作为同一 capability 内 Member Agent 的 lifecycle owner。Thread Attention 和 Member Inbox 是 Host 的持久 projection。未读状态变化时,本包通过 Agent 的公开安全边界 API 发送一次有界、合并的 context 通知;不会中断正在执行的请求,也不运行 Session delivery worker。[Agent Team 架构 Agent Note](../../../.agents/notes/proposed/architecture/2026-08-15-agent-team-operation-ledger.md)记录持久化和包拓扑决策。
|
|
6
|
+
|
|
7
|
+
## Service 约定
|
|
8
|
+
|
|
9
|
+
Service 使用 `ctx.storageDomain`、`ctx.workspaceRegistry`、`ctx.agents`、`ctx.agentDefaultModel`、`ctx.agentPresets`、`ctx.tools`、`ctx.sessions` 和 `ctx.sessionPersistence`,并在 Cordis 发布 `ctx.agentTeam` 前打开带版本的 `agent_team` Domain。首次启动为稳定 Human Member 追加一条 `team/initialized` operation;后续启动重放同一 operation,不追加新记录。
|
|
10
|
+
|
|
11
|
+
`status()` 返回当前持久 sequence、operation 数量、channel 数量、Agent Member 数量和 Human Member ref。它不发起模型请求,也不写 storage。`validateLedger()` 对照持久 operation table 检查包内 projection。
|
|
12
|
+
|
|
13
|
+
每条 operation record 包含正数全局 sequence、唯一 operation/request id、actor snapshot 和前一条 operation id。重放拒绝无效字段、table key/id 不一致、sequence 缺口、previous link 断裂、重复 id 和非法状态转换。相同 request id 和 payload 的重试返回原 receipt;同 request id 携带变化后的 payload 会被拒绝。
|
|
14
|
+
|
|
15
|
+
## 持久化与生命周期
|
|
16
|
+
|
|
17
|
+
`storage-domain` 在持久读取处校验每条 record,并拒绝被其他版本标记的 backend unit。Team 只在 `KvTable.put()` 完成后更新 projection。其 Fiber 持有 Domain handle;dispose 通过 Cordis 移除拒绝新的 Service 调用,排空已接受的 Domain write,并在名称可重新打开前关闭 backend unit。
|
|
18
|
+
|
|
19
|
+
创建 Member 时,先提交稳定的 Member/session/Workspace/preset/private-memory 身份,再执行 unpublished Agent setup。Setup 挂载指定 preset,并在发布前检查带 marker 的 `team_message` 和全部五个 Team tools。失败只把该 Member 标为 unavailable。Suspend 等待所属 `AgentHandle` 完全停止;resume 和 Host remount 恢复同一个持久 session。
|
|
20
|
+
|
|
21
|
+
每个 Team 管理的 session 都会持久写入 `danger-full-access`。项目 cwd 仍是 Workspace 路径,私有记忆位于 `$DSH_HOME/agent-team/members/<memberId>/`。没有标题的 Member session 会通过 session-title service 以 handle 命名,普通 Session 列表因此直接显示 Member 身份;显式重命名或任何既有标题始终优先。隔离的 `team-member` preset 还提供 coding 工具、面向模型的 Web 搜索、Workspace instruction discovery 和 Team protocol guidance。共享的 Web service 与 provider 仍由 Host 持有;preset 只挂载面向模型的 Web tool。小写 `memory.md` 是有界的 8 KiB 参考索引,只有该 Member 的内容变化时才注入;`notes/` 只通过 filesystem tools 按需读取。超预算索引只产生维护警告,不静默截断。普通 session 和 fork 不获得 Team 身份或私有记忆上下文。Host 启动时会清理重放 ledger 不再引用的 `member:` 形态私有记忆目录——这些是 ledger 被丢弃后的遗留(版本提升的 medium 在 open 时被拒绝并以空状态重启)。清理失败会使启动失败;非 `member:` 形态的条目保持原样。
|
|
22
|
+
|
|
23
|
+
把 Member 加入 Channel 只授予之后的 read/send/claim authority,不向 Member session 注入历史 Message。创建 Task、创建 Claim、显式 follow、顶层消息 mention 到、或 Human 确认邀请会开始 Thread Attention。普通未读从 Attention 派生,structured mention 形成持久 direct marker;终止 Task 的状态变化会为受影响关注者保留稀疏 Activity marker,即使 Attention 已结束仍可读取。`team_inbox` 和 Thread read 是 Host projection,不是 Session inbox 内容。Direct mention context 包含消息正文和来源,Task/Claim 变化包含简短状态事实,普通未读只包含无正文的 Task 路由;提示会合并,忽略提示不会形成循环,resume/runtime error recovery 会从持久未读状态重新判断是否提示。
|
|
24
|
+
|
|
25
|
+
Member reply 必须携带准确的当前 Thread revision,并在一个 operation 内更新 Message 和 Thread facts。未读工作必须先 read;revision 过期时拒绝写入。Closed Task 拒绝 reply 和新的 Attention;reopen 恢复 Task,但不恢复之前的 Attention。顶层消息可以直接 mention Agent:被 mention 的 Member 会开始关注新 Thread。在既有 Thread 中,Human 的 reply 提到 unfollowed Agent 时必须先取得 process-local one-use confirmation token 才提交 operation;Member 的此类 reply 会以 member_not_following 拒绝。Message fact 携带自身的 structured mention refs,Client 只为这些 Member 渲染 mention chip。claim/done/release 和 Task change 是有序的 host-authored Activity。Active Claim 只排斥相同的 normalized Direction;不同 Direction 可以并行。Task status 从 Claims 派生,Human accept/close 是覆盖事实。Close 原子释放 active Claims 并清除 Thread Attention。Member remove 原子标记 inactive、释放 owned active Claims、清除该成员的 Attention 和 direct markers,再归档 session。Message 与 Activity facts 共用一个有界 sequence cursor。
|
|
26
|
+
|
|
27
|
+
`changes()` 是 Client 失效通知流。每个请求声明一个可选 `scope`(workspace、channel 或 thread)和可取消的传输 signal;一次提交的 operation 只唤醒 scope 与该 operation 派生范围匹配的 waiter(成员生命周期与 presence 唤醒其 Workspace,内容操作唤醒其 Channel 与 Thread)。Thread read 会持久化提交但不派生任何 scope,因为它只推进读者自己的私有水位。每次提交后,Host 只通知 Inbox projection 可能被该 operation 改变的 Member——即 operation 的 Attention/marker delta 加上被触及 Thread 的当前关注者——而不是全部在线 Agent。
|
|
28
|
+
|
|
29
|
+
M1 支持单个 Host writer。Ledger 永久保留,不提供 snapshot 或 compaction。
|
|
30
|
+
|
|
31
|
+
## Composition
|
|
32
|
+
|
|
33
|
+
Bundle 使用 Host 已有的 singleton provider,不重复挂载 `agents`、默认模型选择、`tools`、`fs`、`sandboxPolicy`、Session store/persistence、Workspace registry 或 storage 的替代实现。Host services 只挂载一次,再挂载本 Service 及 invariant companion。`/team` 等 Human control 是独立 Consumer。
|
|
34
|
+
|
|
35
|
+
Team-enabled preset 在自身 Agent scope 注册五个工具,并用 `markAgentTeamPreset()` 标记 `team_message` definition。Preset row 应在执行时读取 `ctx.agentTeam`,不能声明静态 inject:Host 在自身激活期间恢复 Member 时就会挂载成员 preset,声明依赖 `agentTeam` 的 row 无法激活,会让每次启动恢复失败。Scoped tool 重名会在 unpublished setup 阶段失败,只使对应 Member unavailable。Host service provider 重复则仍是 composition error,应删除重复行,不做叠加。
|
|
36
|
+
|
|
37
|
+
## Model Experience
|
|
38
|
+
|
|
39
|
+
### Host collaboration state
|
|
40
|
+
|
|
41
|
+
#### What the model sees
|
|
42
|
+
|
|
43
|
+
启用的 Member 在持久未读工作出现后,可能收到一次有界、合并的 context 通知。Structured direct mention 包含消息正文和来源;Task/Claim Activity 包含简短状态变化;普通未读只包含 Task ref、数量和 revision。通知通过 Agent 的安全 step 边界排队,正在执行的模型请求和工具不会被中断。常见路径可以直接调用 `team_thread.read`;只有需要跨 Thread 分流时才调用 `team_inbox`。
|
|
44
|
+
|
|
45
|
+
#### Token effect
|
|
46
|
+
|
|
47
|
+
Ledger、projection 和 Human status read 不增加模型 token。
|
|
48
|
+
|
|
49
|
+
#### KV Cache effect
|
|
50
|
+
|
|
51
|
+
Host ledger 和 Human status read 不改变模型请求或 cache reuse。
|
|
52
|
+
|
|
53
|
+
## Known Limitations and Deferred Work
|
|
54
|
+
|
|
55
|
+
- **单 Host writer** — 不支持多个进程并发写同一 dshHome;operation serialization 只在进程内生效。
|
|
56
|
+
- **永久 ledger** — M1 不提供 snapshot 或 compaction,storage 会随已提交协作事实增长。
|
|
57
|
+
- **没有 remote provider seam** — 在真实 remote Consumer 需要另一 Provider 前,本包合并 capability definition 和唯一实现。
|