@wowyuarm/dsh-agent-team 0.1.8 → 0.1.10

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.
Files changed (81) hide show
  1. package/README.md +4 -11
  2. package/README.zh.md +4 -11
  3. package/package.json +54 -44
  4. package/packages/agent-team/README.md +7 -5
  5. package/packages/agent-team/README.zh.md +7 -4
  6. package/packages/agent-team/lib/attachments.js +14 -4
  7. package/packages/agent-team/lib/context-management.js +382 -0
  8. package/packages/agent-team/lib/context-projection.js +578 -0
  9. package/packages/agent-team/lib/context-source.js +212 -0
  10. package/packages/agent-team/lib/index.js +1272 -76
  11. package/packages/agent-team/lib/ledger.js +333 -44
  12. package/packages/agent-team/lib/member-context.js +6 -2
  13. package/packages/agent-team/lib/member-runtime.js +159 -4
  14. package/packages/agent-team/lib/member-time-context.js +126 -0
  15. package/packages/agent-team/lib/pressure-policy.js +199 -0
  16. package/packages/agent-team/lib/progress-nudge.js +12 -4
  17. package/packages/agent-team/lib/session-remediation.js +481 -0
  18. package/packages/agent-team/lib/spec.js +21 -2
  19. package/packages/agent-team/lib/time-format.js +56 -0
  20. package/packages/agent-team/lib/typert.host.js +168 -54
  21. package/packages/agent-team/lib/typert.remote-client.d.ts.map +1 -1
  22. package/packages/agent-team/lib/typert.remote-client.js +59 -25
  23. package/packages/agent-team/lib/types/attachments.d.ts +1 -1
  24. package/packages/agent-team/lib/types/attachments.d.ts.map +1 -1
  25. package/packages/agent-team/lib/types/context-management.d.ts +147 -0
  26. package/packages/agent-team/lib/types/context-management.d.ts.map +1 -0
  27. package/packages/agent-team/lib/types/context-projection.d.ts +219 -0
  28. package/packages/agent-team/lib/types/context-projection.d.ts.map +1 -0
  29. package/packages/agent-team/lib/types/context-source.d.ts +117 -0
  30. package/packages/agent-team/lib/types/context-source.d.ts.map +1 -0
  31. package/packages/agent-team/lib/types/index.d.ts +300 -2
  32. package/packages/agent-team/lib/types/index.d.ts.map +1 -1
  33. package/packages/agent-team/lib/types/ledger.d.ts +119 -6
  34. package/packages/agent-team/lib/types/ledger.d.ts.map +1 -1
  35. package/packages/agent-team/lib/types/member-context.d.ts.map +1 -1
  36. package/packages/agent-team/lib/types/member-runtime.d.ts +30 -2
  37. package/packages/agent-team/lib/types/member-runtime.d.ts.map +1 -1
  38. package/packages/agent-team/lib/types/member-time-context.d.ts +83 -0
  39. package/packages/agent-team/lib/types/member-time-context.d.ts.map +1 -0
  40. package/packages/agent-team/lib/types/pressure-policy.d.ts +106 -0
  41. package/packages/agent-team/lib/types/pressure-policy.d.ts.map +1 -0
  42. package/packages/agent-team/lib/types/progress-nudge.d.ts.map +1 -1
  43. package/packages/agent-team/lib/types/session-remediation.d.ts +149 -0
  44. package/packages/agent-team/lib/types/session-remediation.d.ts.map +1 -0
  45. package/packages/agent-team/lib/types/spec.d.ts.map +1 -1
  46. package/packages/agent-team/lib/types/time-format.d.ts +28 -0
  47. package/packages/agent-team/lib/types/time-format.d.ts.map +1 -0
  48. package/packages/agent-team/lib/types/types/entities.d.ts +22 -1
  49. package/packages/agent-team/lib/types/types/entities.d.ts.map +1 -1
  50. package/packages/agent-team/lib/types/types/operations.d.ts +38 -3
  51. package/packages/agent-team/lib/types/types/operations.d.ts.map +1 -1
  52. package/packages/agent-team/lib/types/types/requests-results.d.ts +58 -1
  53. package/packages/agent-team/lib/types/types/requests-results.d.ts.map +1 -1
  54. package/packages/agent-team/preset/team-member/agent.cordis.yml +27 -4
  55. package/packages/client-agent-team/lib/client.js +369 -352
  56. package/packages/client-agent-team/lib/client.js.map +1 -1
  57. package/packages/client-agent-team/lib/types/client/TeamAgentsPanel.d.ts +1 -2
  58. package/packages/client-agent-team/lib/types/client/TeamAgentsPanel.d.ts.map +1 -1
  59. package/packages/client-agent-team/lib/types/client/TeamAgentsPanel.js +61 -41
  60. package/packages/client-agent-team/lib/types/client/TeamMessage.js +2 -2
  61. package/packages/client-agent-team/lib/types/client/TeamThreadPage.js +4 -4
  62. package/packages/client-agent-team/lib/types/client/TeamWorkspaceBrowser.d.ts +1 -1
  63. package/packages/client-agent-team/lib/types/client/TeamWorkspaceBrowser.d.ts.map +1 -1
  64. package/packages/client-agent-team/lib/types/client/TeamWorkspaceBrowser.js +2 -2
  65. package/packages/client-agent-team/lib/types/client/index.d.ts.map +1 -1
  66. package/packages/client-agent-team/lib/types/client/index.js +44 -16
  67. package/packages/client-agent-team/lib/types/client/locales.d.ts +0 -14
  68. package/packages/client-agent-team/lib/types/client/locales.d.ts.map +1 -1
  69. package/packages/client-agent-team/lib/types/client/locales.js +0 -14
  70. package/packages/client-agent-team/lib/types/client/slots.d.ts +6 -1
  71. package/packages/client-agent-team/lib/types/client/slots.d.ts.map +1 -1
  72. package/packages/tool-agent-team/README.md +11 -6
  73. package/packages/tool-agent-team/README.zh.md +11 -6
  74. package/packages/tool-agent-team/lib/context-tools.js +179 -0
  75. package/packages/tool-agent-team/lib/index.js +369 -58
  76. package/packages/tool-agent-team/lib/types/context-tools.d.ts +16 -0
  77. package/packages/tool-agent-team/lib/types/context-tools.d.ts.map +1 -0
  78. package/packages/tool-agent-team/lib/types/index.d.ts.map +1 -1
  79. package/packages/agent-team/lib/auto-compaction.js +0 -201
  80. package/packages/agent-team/lib/types/auto-compaction.d.ts +0 -47
  81. package/packages/agent-team/lib/types/auto-compaction.d.ts.map +0 -1
package/README.md CHANGED
@@ -17,7 +17,7 @@ An opt-in plugin for [DeepSeek Harness](https://github.com/deepseek-ai/deepseek-
17
17
  - **Workspaces organize everything.** Different projects live in different Workspaces, each managing its own Agents and Channels.
18
18
  - **The Human routes Channels and responsibilities.** You decide who is in which channel and what they own; mentions route work to the right agent.
19
19
  - **Task Threads carry one line of progress.** Claims set the direction, Threads hold the context, and multiple session agents advance the same line of work without talking past each other — the facts of the work live in one Thread.
20
- - **No context babysitting.** Member sessions compact automatically past the threshold, with a pre-compaction hint to persist key conclusions first. Every member keeps its own memory and notes across sessions, so identity and knowledge survive session renewal.
20
+ - **No context babysitting.** Members manage their own context: roll over to a fresh one and stay on duty (`context_rollover`), or return to a past anchor (`context_timeline` / `context_checkpoint`); pending work survives switches and restarts, and memory and notes keep accumulating a member carries its full memory into every new context.
21
21
 
22
22
  ## Preview
23
23
 
@@ -27,13 +27,13 @@ Agent Team is opt-in: after installation the ordinary DSH page stays as-is, and
27
27
 
28
28
  Entering Team mode shows Channels, managed Agents, and the collaboration timeline:
29
29
 
30
- ![Team mode in the DSH Web UI: Channels and seven online Agents in the sidebar; the Main Channel shows Task references and the composer’s task switch](assets/readme/team-mode.png)
30
+ ![Team mode in the DSH Web UI: Channels and online Agent members in the sidebar, with the Main Channel showing Task references](assets/readme/team-mode.png)
31
31
 
32
32
  ### Task Threads
33
33
 
34
34
  A Task Thread keeps Claims, Agent handoffs, Human acceptance, and follow-up replies in one durable context.
35
35
 
36
- ![Completed Task Thread in the DSH Web UI: a Claim, Agent handoffs, Human acceptance activity, and the reply composer](assets/readme/task-thread.png)
36
+ ![Task Thread in the DSH Web UI: Claims, Agent handoffs, Human acceptance activity, and the reply composer](assets/readme/task-thread.png)
37
37
 
38
38
  If this looks useful, a star on [GitHub](https://github.com/wowyuarm/dsh-agent-team) helps other DSH users find it.
39
39
 
@@ -41,7 +41,7 @@ If this looks useful, a star on [GitHub](https://github.com/wowyuarm/dsh-agent-t
41
41
 
42
42
  ### 1. Check DSH
43
43
 
44
- This release is certified against DSH `0.1.2-rc.1`. If `dsh` is not installed yet, start DSH with the official package:
44
+ This release is certified against DSH `0.1.5-rc.1`. If `dsh` is not installed yet, start DSH with the official package:
45
45
 
46
46
  ```sh
47
47
  npx @deepseek-ai/dsh web
@@ -108,13 +108,6 @@ dsh web
108
108
 
109
109
  Published packages include built artifacts. A local checkout needs the adjacent Harness repository only for development checks, not for end-user installation.
110
110
 
111
- ## Compatibility and limits
112
-
113
- - This release is certified against DSH `0.1.2-rc.1`, and requires it: earlier DSH versions are not supported.
114
- - The bundle is single-host. It does not provide distributed consensus, Team direct messages, nested Threads, or semantic Direction deduplication.
115
- - 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.
116
- - Team-managed Agent Sessions use `danger-full-access`. Use them only in trusted Workspaces.
117
-
118
111
  ## Development
119
112
 
120
113
  Read [`docs/README.md`](docs/README.md) for the maintained documentation index. The usual checks are:
package/README.zh.md CHANGED
@@ -17,7 +17,7 @@
17
17
  - **Workspace 组织一切。** 不同项目放在不同 Workspace,各自管理自己的 Agents 与 Channels。
18
18
  - **Human 管 Channel 与职责。** 你决定谁在哪个频道、负责什么;@提及把工作路由到对的 Agent。
19
19
  - **Task Thread 串联推进。** 用 Task 认领方向、Thread 保持上下文,多个 Session Agent 围绕同一条工作线推进而不散乱。工作事实落在同一条 Thread 里,成员之间不会各说各的。
20
- - **无需操心上下文。** 成员会话超阈值自动压缩,压缩前提示成员先沉淀关键结论。每个成员的 memory 与 notes 跨会话保留,身份与知识不随会话续期丢失。
20
+ - **无需操心上下文。** 上下文由成员自己管理:刷新到新上下文继续待命(`context_rollover`),或回到过去的锚点继续(`context_timeline` / `context_checkpoint`),切换与重启都不丢待决事项;memory 与 notes 持续沉淀,成员带着完整记忆进入新上下文。
21
21
 
22
22
  ## 预览
23
23
 
@@ -27,13 +27,13 @@ Agent Team 是按需启用的:安装后普通 DSH 页面保持原样,Team mo
27
27
 
28
28
  进入 Team mode 后是频道、受管 Agent 与协作时间线:
29
29
 
30
- ![DSH Web UI 中的 Team mode:侧边栏展示频道与 7 位在线 Agent;Main 频道含 Task 引用和 composer 的作为任务开关](assets/readme/team-mode.png)
30
+ ![DSH Web UI 中的 Team mode:侧边栏展示频道与在线 Agent 成员;Main Channel 展示 Task 引用](assets/readme/team-mode.png)
31
31
 
32
32
  ### Task Thread
33
33
 
34
34
  Task Thread 把 Claim、Agent 交接、Human 验收和后续回复保留在同一条可持续阅读的上下文中。
35
35
 
36
- ![DSH Web UI 中已完成的 Task Thread:含 Claim、Agent 交接、Human 验收活动和回复 composer](assets/readme/task-thread.png)
36
+ ![DSH Web UI 中的 Task Thread:含 Claim、Agent 交接、Human 验收活动和回复 composer](assets/readme/task-thread.png)
37
37
 
38
38
  如果觉得有用,欢迎在 [GitHub](https://github.com/wowyuarm/dsh-agent-team) 点个 star,帮更多 DSH 用户发现它。
39
39
 
@@ -41,7 +41,7 @@ Task Thread 把 Claim、Agent 交接、Human 验收和后续回复保留在同
41
41
 
42
42
  ### 1. 检查 DSH
43
43
 
44
- 当前版本已针对 DSH `0.1.2-rc.1` 完成认证。如果还没有安装 `dsh`,先使用官方 package 启动 DSH:
44
+ 当前版本已针对 DSH `0.1.5-rc.1` 完成认证。如果还没有安装 `dsh`,先使用官方 package 启动 DSH:
45
45
 
46
46
  ```sh
47
47
  npx @deepseek-ai/dsh web
@@ -108,13 +108,6 @@ dsh web
108
108
 
109
109
  发布包已经包含构建产物。只有开发检查需要相邻的 Harness repository,终端用户安装不需要它。
110
110
 
111
- ## 兼容性与限制
112
-
113
- - 当前版本已针对 DSH `0.1.2-rc.1` 完成认证,并且要求该版本:更早的 DSH 版本不受支持。
114
- - Bundle 是单 Host,不提供分布式共识、Team direct message、嵌套 Thread 或 Direction 语义去重。
115
- - 当前 DSH SQLite Session schema 不接受旧版 DSH 的数据库。跨越该边界升级时,删除旧 Session 数据库并重新开始;本 bundle 不负责迁移。
116
- - Team 管理的 Agent Session 使用 `danger-full-access`。只在可信 Workspace 中使用。
117
-
118
111
  ## 开发
119
112
 
120
113
  维护中的文档入口是 [`docs/README.zh.md`](docs/README.zh.md)。常用检查命令:
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wowyuarm/dsh-agent-team",
3
- "version": "0.1.8",
3
+ "version": "0.1.10",
4
4
  "description": "A persistent agent team for long-running collaboration in DeepSeek Harness",
5
5
  "repository": {
6
6
  "type": "git",
@@ -8,6 +8,7 @@
8
8
  },
9
9
  "private": false,
10
10
  "type": "module",
11
+ "packageManager": "pnpm@11.7.0",
11
12
  "files": [
12
13
  "cordis.patch.yml",
13
14
  "packages/agent-team/lib/**/*",
@@ -50,7 +51,7 @@
50
51
  }
51
52
  },
52
53
  "dependencies": {
53
- "@deepseek-ai/dsh-storage-sqlite": ">=0.1.2-rc.1 <0.2.0",
54
+ "@deepseek-ai/dsh-storage-sqlite": ">=0.1.5-rc.1 <0.2.0",
54
55
  "zod": "^4.4.3"
55
56
  },
56
57
  "devDependencies": {
@@ -105,6 +106,14 @@
105
106
  "types": "./packages/agent-team/lib/types/member-context.d.ts",
106
107
  "default": "./packages/agent-team/lib/member-context.js"
107
108
  },
109
+ "./member-time-context": {
110
+ "types": "./packages/agent-team/lib/types/member-time-context.d.ts",
111
+ "default": "./packages/agent-team/lib/member-time-context.js"
112
+ },
113
+ "./time-format": {
114
+ "types": "./packages/agent-team/lib/types/time-format.d.ts",
115
+ "default": "./packages/agent-team/lib/time-format.js"
116
+ },
108
117
  "./member-skills": {
109
118
  "types": "./packages/agent-team/lib/types/member-skills.d.ts",
110
119
  "default": "./packages/agent-team/lib/member-skills.js"
@@ -121,48 +130,49 @@
121
130
  },
122
131
  "peerDependencies": {
123
132
  "@deepseek-ai/cordis": "^4.0.1",
124
- "@deepseek-ai/dsh-agent": ">=0.1.2-rc.1 <0.2.0",
125
- "@deepseek-ai/dsh-agent-default-model": ">=0.1.2-rc.1 <0.2.0",
126
- "@deepseek-ai/dsh-agent-presets": ">=0.1.2-rc.1 <0.2.0",
127
- "@deepseek-ai/dsh-agent-tool-presentation": ">=0.1.2-rc.1 <0.2.0",
128
- "@deepseek-ai/dsh-api-remotes": ">=0.1.2-rc.1 <0.2.0",
129
- "@deepseek-ai/dsh-api-session-controller": ">=0.1.2-rc.1 <0.2.0",
130
- "@deepseek-ai/dsh-api-workspace-controller": ">=0.1.2-rc.1 <0.2.0",
131
- "@deepseek-ai/dsh-brand": ">=0.1.2-rc.1 <0.2.0",
132
- "@deepseek-ai/dsh-client-locale": ">=0.1.2-rc.1 <0.2.0",
133
- "@deepseek-ai/dsh-client-ui-conversation": ">=0.1.2-rc.1 <0.2.0",
134
- "@deepseek-ai/dsh-client-ui-input-trigger": ">=0.1.2-rc.1 <0.2.0",
135
- "@deepseek-ai/dsh-client-ui-layout": ">=0.1.2-rc.1 <0.2.0",
136
- "@deepseek-ai/dsh-client-ui-primitives": ">=0.1.2-rc.1 <0.2.0",
137
- "@deepseek-ai/dsh-client-ui-renderer": ">=0.1.2-rc.1 <0.2.0",
138
- "@deepseek-ai/dsh-client-ui-settings-general": ">=0.1.2-rc.1 <0.2.0",
139
- "@deepseek-ai/dsh-client-ui-sidebar": ">=0.1.2-rc.1 <0.2.0",
140
- "@deepseek-ai/dsh-client-ui-slots": ">=0.1.2-rc.1 <0.2.0",
141
- "@deepseek-ai/dsh-client-ui-workspace": ">=0.1.2-rc.1 <0.2.0",
142
- "@deepseek-ai/dsh-command-compact": ">=0.1.2-rc.1 <0.2.0",
143
- "@deepseek-ai/dsh-compaction": ">=0.1.2-rc.1 <0.2.0",
144
- "@deepseek-ai/dsh-home-paths": ">=0.1.2-rc.1 <0.2.0",
145
- "@deepseek-ai/dsh-invariants": ">=0.1.2-rc.1 <0.2.0",
146
- "@deepseek-ai/dsh-llm": ">=0.1.2-rc.1 <0.2.0",
147
- "@deepseek-ai/dsh-sandbox-policy": ">=0.1.2-rc.1 <0.2.0",
148
- "@deepseek-ai/dsh-scope": ">=0.1.2-rc.1 <0.2.0",
149
- "@deepseek-ai/dsh-session": ">=0.1.2-rc.1 <0.2.0",
150
- "@deepseek-ai/dsh-session-persistence": ">=0.1.2-rc.1 <0.2.0",
151
- "@deepseek-ai/dsh-skill": ">=0.1.2-rc.1 <0.2.0",
152
- "@deepseek-ai/dsh-skill-filesystem": ">=0.1.2-rc.1 <0.2.0",
153
- "@deepseek-ai/dsh-storage-domain": ">=0.1.2-rc.1 <0.2.0",
154
- "@deepseek-ai/dsh-token-meter": ">=0.1.2-rc.1 <0.2.0",
155
- "@deepseek-ai/dsh-tool-bash": ">=0.1.2-rc.1 <0.2.0",
156
- "@deepseek-ai/dsh-tool-fs": ">=0.1.2-rc.1 <0.2.0",
157
- "@deepseek-ai/dsh-tool-fs-search": ">=0.1.2-rc.1 <0.2.0",
158
- "@deepseek-ai/dsh-tool-jobs": ">=0.1.2-rc.1 <0.2.0",
159
- "@deepseek-ai/dsh-tool-pwsh": ">=0.1.2-rc.1 <0.2.0",
160
- "@deepseek-ai/dsh-tool-skill": ">=0.1.2-rc.1 <0.2.0",
161
- "@deepseek-ai/dsh-tool-todo": ">=0.1.2-rc.1 <0.2.0",
162
- "@deepseek-ai/dsh-tool-web": ">=0.1.2-rc.1 <0.2.0",
163
- "@deepseek-ai/dsh-tools": ">=0.1.2-rc.1 <0.2.0",
164
- "@deepseek-ai/dsh-typert-protocol": ">=0.1.2-rc.1 <0.2.0",
165
- "@deepseek-ai/dsh-workspace": ">=0.1.2-rc.1 <0.2.0",
133
+ "@deepseek-ai/dsh-agent": ">=0.1.5-rc.1 <0.2.0",
134
+ "@deepseek-ai/dsh-agent-default-model": ">=0.1.5-rc.1 <0.2.0",
135
+ "@deepseek-ai/dsh-agent-presets": ">=0.1.5-rc.1 <0.2.0",
136
+ "@deepseek-ai/dsh-agent-tool-presentation": ">=0.1.5-rc.1 <0.2.0",
137
+ "@deepseek-ai/dsh-api-remotes": ">=0.1.5-rc.1 <0.2.0",
138
+ "@deepseek-ai/dsh-api-session-controller": ">=0.1.5-rc.1 <0.2.0",
139
+ "@deepseek-ai/dsh-api-workspace-controller": ">=0.1.5-rc.1 <0.2.0",
140
+ "@deepseek-ai/dsh-brand": ">=0.1.5-rc.1 <0.2.0",
141
+ "@deepseek-ai/dsh-client-locale": ">=0.1.5-rc.1 <0.2.0",
142
+ "@deepseek-ai/dsh-client-ui-conversation": ">=0.1.5-rc.1 <0.2.0",
143
+ "@deepseek-ai/dsh-client-ui-input-trigger": ">=0.1.5-rc.1 <0.2.0",
144
+ "@deepseek-ai/dsh-client-ui-layout": ">=0.1.5-rc.1 <0.2.0",
145
+ "@deepseek-ai/dsh-client-ui-primitives": ">=0.1.5-rc.1 <0.2.0",
146
+ "@deepseek-ai/dsh-client-ui-renderer": ">=0.1.5-rc.1 <0.2.0",
147
+ "@deepseek-ai/dsh-client-ui-settings-general": ">=0.1.5-rc.1 <0.2.0",
148
+ "@deepseek-ai/dsh-client-ui-sidebar": ">=0.1.5-rc.1 <0.2.0",
149
+ "@deepseek-ai/dsh-client-ui-slots": ">=0.1.5-rc.1 <0.2.0",
150
+ "@deepseek-ai/dsh-client-ui-workspace": ">=0.1.5-rc.1 <0.2.0",
151
+ "@deepseek-ai/dsh-command-compact": ">=0.1.5-rc.1 <0.2.0",
152
+ "@deepseek-ai/dsh-compaction": ">=0.1.5-rc.1 <0.2.0",
153
+ "@deepseek-ai/dsh-home-paths": ">=0.1.5-rc.1 <0.2.0",
154
+ "@deepseek-ai/dsh-invariants": ">=0.1.5-rc.1 <0.2.0",
155
+ "@deepseek-ai/dsh-llm": ">=0.1.5-rc.1 <0.2.0",
156
+ "@deepseek-ai/dsh-sandbox-policy": ">=0.1.5-rc.1 <0.2.0",
157
+ "@deepseek-ai/dsh-scope": ">=0.1.5-rc.1 <0.2.0",
158
+ "@deepseek-ai/dsh-session": ">=0.1.5-rc.1 <0.2.0",
159
+ "@deepseek-ai/dsh-session-format-catalog": ">=0.1.5-rc.1 <0.2.0",
160
+ "@deepseek-ai/dsh-session-persistence": ">=0.1.5-rc.1 <0.2.0",
161
+ "@deepseek-ai/dsh-skill": ">=0.1.5-rc.1 <0.2.0",
162
+ "@deepseek-ai/dsh-skill-filesystem": ">=0.1.5-rc.1 <0.2.0",
163
+ "@deepseek-ai/dsh-storage-domain": ">=0.1.5-rc.1 <0.2.0",
164
+ "@deepseek-ai/dsh-token-meter": ">=0.1.5-rc.1 <0.2.0",
165
+ "@deepseek-ai/dsh-tool-bash": ">=0.1.5-rc.1 <0.2.0",
166
+ "@deepseek-ai/dsh-tool-fs": ">=0.1.5-rc.1 <0.2.0",
167
+ "@deepseek-ai/dsh-tool-fs-search": ">=0.1.5-rc.1 <0.2.0",
168
+ "@deepseek-ai/dsh-tool-jobs": ">=0.1.5-rc.1 <0.2.0",
169
+ "@deepseek-ai/dsh-tool-pwsh": ">=0.1.5-rc.1 <0.2.0",
170
+ "@deepseek-ai/dsh-tool-skill": ">=0.1.5-rc.1 <0.2.0",
171
+ "@deepseek-ai/dsh-tool-todo": ">=0.1.5-rc.1 <0.2.0",
172
+ "@deepseek-ai/dsh-tool-web": ">=0.1.5-rc.1 <0.2.0",
173
+ "@deepseek-ai/dsh-tools": ">=0.1.5-rc.1 <0.2.0",
174
+ "@deepseek-ai/dsh-typert-protocol": ">=0.1.5-rc.1 <0.2.0",
175
+ "@deepseek-ai/dsh-workspace": ">=0.1.5-rc.1 <0.2.0",
166
176
  "react": "^18.2.0"
167
177
  },
168
178
  "keywords": [
@@ -2,7 +2,7 @@
2
2
 
3
3
  English | [中文](README.zh.md)
4
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.
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](../../.scratch/archive/2026-08/m1/design/agent-notes/2026-08-15-agent-team-operation-ledger.md) owns the persistence and package-topology decisions.
6
6
 
7
7
  ## Service contract
8
8
 
@@ -16,13 +16,13 @@ Every operation record carries a positive global sequence, unique operation and
16
16
 
17
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
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.
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 eight 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
20
 
21
21
  Archival is the reversible third state between suspend and remove, for Members and Channels alike. `archiveMember` commits `team/member-archived`, disposes the live session while keeping private memory and the Session log on disk, archives the Session from grouping surfaces, and releases the Member's active Claims with public `claims_released` Activities plus Attention/marker cleanup. `archiveChannel` commits `team/channel-archived` with the same release shape across every owner on the Channel's Threads. Memberships survive both forms — hidden state, not departure. Archived entities are gone from every Team API surface: projections, ref resolution (their Task refs stop resolving, so message bodies render plain text), and ref-addressed reads (`readThread`/`threadHistory`/`threadObservations`/`listClaims` reject with an explicit archived error) — while the facts stay complete in the ledger for replay and a future restore; that boundary is the archival-vs-remove divide. Removal from archived stays available as the data hygiene path; there is no restore entry point yet (mirroring archived dsh sessions).
22
22
 
23
23
  Members optionally carry durable capability intent (`capabilities.tools.allow`, `capabilities.skills.allow`). It flows verbatim through every lifecycle operation, replays unchanged after Host restart, and commits without known-name validation so Harness upgrades can never break old ledgers; divergence from known names surfaces at activation as derived, non-persisted `capabilityWarnings`. `tools.allow` is a deliberate interface reservation (no UI write path today) that future Runtime Revision manifest orchestration depends on. Edits follow absent-clears semantics like `model`: a caller that does not manage capabilities must echo the stored value back or its edit clears the override.
24
24
 
25
- Activation applies `tools.allow` as a scoped restriction over the composed preset surface (mount → restrict → validate) with the five Team tools force-unioned over the configured list; unknown names drop with a warning rather than failing the Member. A live allow-list edit swaps the restriction at a turn boundary in the same Session — idle Members apply immediately, and an edit racing a running turn waits for it while later lifecycle operations queue behind the wait. Restriction failures isolate to that Member's activation diagnostic.
25
+ Activation applies `tools.allow` as a scoped restriction over the composed preset surface (mount → restrict → validate) with the eight Team tools force-unioned over the configured list; unknown names drop with a warning rather than failing the Member. A live allow-list edit swaps the restriction at a turn boundary in the same Session — idle Members apply immediately, and an edit racing a running turn waits for it while later lifecycle operations queue behind the wait. Restriction failures isolate to that Member's activation diagnostic.
26
26
 
27
27
  Skills are Member-private: the preset has no shared skill-filesystem row, and the Host registers one provider per Member that scans exactly the plugin's bundled read-only core skills (`packages/agent-team/core-skills/` — the `member-skill-manager` meta skill that owns all skill craft guidance) plus that Member's writable `skills/` directory under its private memory path (default roots excluded). Installing is writing into the Member's own directory — directory form `skills/<name>/SKILL.md` with optional references and scripts, or a flat `.md` — and there is deliberately no upload Remote. The persona itself only states the private-space physical facts; the meta skill's description routes skill-management work to it. `skills.allow` filters the catalog through a live selection ref swapped at the same turn boundary; the filesystem watcher feeds discovery after a self-install.
28
28
 
@@ -40,7 +40,9 @@ M1 supports one Host writer. The ledger is permanent and has no snapshot or comp
40
40
 
41
41
  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.
42
42
 
43
- 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.
43
+ A team-enabled preset registers the eight 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.
44
+
45
+ Member context self-management rides the same lifecycle owner. The `context_rollover` and `context_checkpoint` tools only validate and conclude/anchor the turn; one `ContextManagementCoordinator` watches Member Session events, derives rollover and checkpoint intent from the durable successful `tool/call`+`tool/result` pairs, and executes the swap through the serialized lifecycle queue: wait for true idle, recheck the owned-jobs guard, dispose and archive the old Session (never delete), commit the idempotent `team/member-session-rolled-over` operation (Member actor, self-scoped, no handoff prose), activate a genuinely fresh Session — or a seeded Session for a checkpoint return, with the exact completed-turn prefix — then deliver the handoff and any carried non-Team input. Identity, model, private memory, skills, Claims, and Attention survive; process state is reconstructible from the durable log after a crash, including a handoff reconstructed from the ledger-recorded previous Session when a restart lands between the rollover commit and the new Session's activation. A second Host-owned coordinator (`pressure-policy.ts`) owns context pressure: budget thresholds from the live route's context window, one handoff-budget notice per generation, forced in-place compaction with fail-closed verification at the hard limit, and one bounded compact-and-retry for provider context-overflow; accepted-Task auto compaction is retired. The Human-side clear-context Remote remains a hidden migration escape hatch with no visible Client entry point.
44
46
 
45
47
  ## Model Experience
46
48
 
@@ -63,4 +65,4 @@ The Host ledger and Human status reads do not alter model requests or cache reus
63
65
  - **Single Host writer** — concurrent processes over one dshHome are unsupported; operation serialization is process-local.
64
66
  - **Permanent ledger** — M1 provides neither snapshots nor compaction, so storage grows with committed collaboration facts.
65
67
  - **No remote provider seam** — the package combines the capability definition and its only implementation until a real remote Consumer requires another Provider.
66
- - **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.
68
+ - **No Session migration of its own** — Member Sessions ride the Host's Session persistence and its released-format migration chain; this package provides no Team ledger or Member Session migration, compatibility read, or fallback.
@@ -2,7 +2,7 @@
2
2
 
3
3
  [English](README.md) | 中文
4
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)记录持久化和包拓扑决策。
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](../../.scratch/archive/2026-08/m1/design/agent-notes/2026-08-15-agent-team-operation-ledger.md)记录持久化和包拓扑决策。
6
6
 
7
7
  ## Service 约定
8
8
 
@@ -16,13 +16,13 @@ Service 使用 `ctx.storageDomain`、`ctx.workspaceRegistry`、`ctx.agents`、`c
16
16
 
17
17
  `storage-domain` 在持久读取处校验每条 record,并拒绝被其他版本标记的 backend unit。Team 只在 `KvTable.put()` 完成后更新 projection。其 Fiber 持有 Domain handle;dispose 通过 Cordis 移除拒绝新的 Service 调用,排空已接受的 Domain write,并在名称可重新打开前关闭 backend unit。
18
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。
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
20
 
21
21
  归档(archival)是介于 suspend 与 remove 之间的可逆第三态,Member 与 Channel 通用。`archiveMember` 提交 `team/member-archived`,dispose 活跃 session(私有记忆与 Session log 留在磁盘),把 Session 从分组面归档,并释放该 Member 的活跃 Claim(公开 `claims_released` Activity + Attention/marker 清理)。`archiveChannel` 提交 `team/channel-archived`,对该频道全部 Threads 上所有 owner 做同样的释放。两种归档都保留 Memberships——是隐藏而非离开。归档实体在所有 Team API 面上"默认不存在":投影、ref 解析(其 Task ref 不再解析,消息正文渲染为纯文本)、按 ref 的读取(`readThread`/`threadHistory`/`threadObservations`/`listClaims` 以明确的 archived 错误拒绝)——而事实在 ledger 中完整保留,供重放与未来恢复;这条边界正是归档与 remove 的分界。从归档态 remove 仍可用(数据卫生路径);本轮有意不提供恢复入口(对齐 dsh session 归档现状)。
22
22
 
23
23
  Member 可携带持久能力意图(`capabilities.tools.allow`、`capabilities.skills.allow`)。它随全部 lifecycle operation 原样流转,Host restart 后原样重放,commit 时不做已知名校验(Harness 升级不会破坏旧 ledger);与已知名的偏差在 activation 时派生为不持久化的 `capabilityWarnings`。`tools.allow` 是有意的接口预留(当前无 UI 写入路径),供后续 Runtime Revision manifest 编排依赖。编辑语义与 `model` 一致(absent 即清除):不管理 capabilities 的调用方必须回传已存储的值,否则其编辑会清掉该覆盖。
24
24
 
25
- Activation 把 `tools.allow` 作为 scoped restriction 应用在已组合的 preset 面上(mount → restrict → validate),五个 Team tools 在配置之上强制并集;未知名 drop + warning,不使 Member 失败。对 live Member 的 allow-list 编辑在 turn 边界同 Session 换装 restriction——idle 立即生效,与 running turn 竞争的编辑等待其结束,后续 lifecycle 操作在该等待之后排队。restriction 失败只隔离为该 Member 的 activation diagnostic。
25
+ Activation 把 `tools.allow` 作为 scoped restriction 应用在已组合的 preset 面上(mount → restrict → validate),八个 Team tools 在配置之上强制并集;未知名 drop + warning,不使 Member 失败。对 live Member 的 allow-list 编辑在 turn 边界同 Session 换装 restriction——idle 立即生效,与 running turn 竞争的编辑等待其结束,后续 lifecycle 操作在该等待之后排队。restriction 失败只隔离为该 Member 的 activation diagnostic。
26
26
 
27
27
  Skills 是 Member 私有的:preset 不带共享 skill-filesystem row,Host 为每个 Member 注册一个 provider,只扫插件内置的只读 core skills(`packages/agent-team/core-skills/`——`member-skill-manager` meta skill,全部 skill 写作/安装/credentials 引导都在它里面)加该 Member 可写的私有 `skills/` 目录(排除默认 roots)。安装就是往自己目录写——目录形态 `skills/<name>/SKILL.md` + 可选 references/scripts,或平铺 `.md`——有意不提供上传 Remote。persona 只陈述私有空间物理事实,meta skill 的 description 负责"涉及 skill 管理工作时先读我"。`skills.allow` 通过同一 turn 边界换装的 live selection ref 过滤 catalog;自装后的发现由 filesystem watcher 驱动。
28
28
 
@@ -40,7 +40,9 @@ M1 支持单个 Host writer。Ledger 永久保留,不提供 snapshot 或 compa
40
40
 
41
41
  Bundle 使用 Host 已有的 singleton provider,不重复挂载 `agents`、默认模型选择、`tools`、`fs`、`sandboxPolicy`、Session store/persistence、Workspace registry 或 storage 的替代实现。Host services 只挂载一次,再挂载本 Service 及 invariant companion。`/team` 等 Human control 是独立 Consumer。
42
42
 
43
- 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,应删除重复行,不做叠加。
43
+ 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,应删除重复行,不做叠加。
44
+
45
+ Member 上下文自主管理复用同一 lifecycle owner。`context_rollover` 与 `context_checkpoint` 工具只做校验并结束/锚定 turn;单一 `ContextManagementCoordinator` 监听 Member Session 事件,从 durable 的成功 `tool/call`+`tool/result` 对派生 rollover 与 checkpoint 意图,并经串行 lifecycle queue 执行换窗:等真正 idle、复查 owned-jobs guard、dispose 并归档旧 Session(绝不删除)、提交幂等的 `team/member-session-rolled-over` operation(Member actor、仅限自身、不写 handoff 正文)、激活全新 Session——checkpoint 回返则以精确 completed-turn 前缀作 seed——再送达 handoff 与携带的非 Team 输入。身份、模型、私有记忆、skills、Claims 和 Attention 全部保留;进程内状态在崩溃后可从 durable log 重建,包括重启落在 rollover commit 与新 Session 激活之间时,从 ledger 记录的上一 Session 重建 handoff。第二个 Host 持有的 coordinator(`pressure-policy.ts`)拥有上下文压力:预算阈值从当前 route 的 context window 派生,handoff 预算每 generation 一条通知,硬上限强制原地 compaction 并 fail-closed 验证,provider context-overflow 获得一条有界 compact-and-retry;已接受 Task 的自动 compaction 已退役。Host 侧 clear-context Remote 保留为无可见 Client 入口的迁移逃生门。
44
46
 
45
47
  ## Model Experience
46
48
 
@@ -63,3 +65,4 @@ Host ledger 和 Human status read 不改变模型请求或 cache reuse。
63
65
  - **单 Host writer** — 不支持多个进程并发写同一 dshHome;operation serialization 只在进程内生效。
64
66
  - **永久 ledger** — M1 不提供 snapshot 或 compaction,storage 会随已提交协作事实增长。
65
67
  - **没有 remote provider seam** — 在真实 remote Consumer 需要另一 Provider 前,本包合并 capability definition 和唯一实现。
68
+ - **自身不提供 Session 迁移** — Member Sessions 依赖 Host 的 Session persistence 与其已发布格式迁移链;本包不提供 Team ledger 或 Member Session 迁移、兼容读取或回退。
@@ -24,15 +24,25 @@ export function attachmentPayloadPath(attachmentId, name) {
24
24
  export function newAttachmentId() {
25
25
  return randomUUID();
26
26
  }
27
- /** Strip path separators, control characters, and leading dots from one client-supplied name. */
27
+ /** Strip path separators, control characters, Windows-illegal characters, reserved device names, and leading dots from one client-supplied name. */
28
28
  export function sanitizeFileName(raw) {
29
- // oxlint-disable-next-line no-control-regex -- strip ASCII control characters from client filenames.
30
- const cleaned = raw.replaceAll(/[\\/\u0000-\u001f\u007f]/g, '').replaceAll(/^\.+/g, '').trim().slice(0, 180);
29
+ // oxlint-disable no-control-regex -- strip ASCII control characters, separators, and Windows-reserved characters from client filenames.
30
+ const cleaned = raw
31
+ .replaceAll(/[\\/:*?"<>|\u0000-\u001f\u007f]/g, '')
32
+ .replaceAll(/^\.+/g, '')
33
+ .trim()
34
+ .slice(0, 180)
35
+ .replace(/[\s.]+$/g, '');
36
+ // oxlint-enable no-control-regex
31
37
  if (cleaned === '')
32
38
  return 'attachment';
33
39
  // The metadata sidecar owns 'meta.json' inside every entry directory; a
34
40
  // payload with that name would be clobbered by the sidecar and unreadable.
35
- return /^meta\.json$/i.test(cleaned) ? `_${cleaned}` : cleaned;
41
+ if (/^meta\.json$/i.test(cleaned))
42
+ return `_${cleaned}`;
43
+ // Win32 CreateFile resolves these device names (with or without an
44
+ // extension) as hardware, so the payload write would fail or alias a device.
45
+ return /^(?:CON|PRN|AUX|NUL|COM[1-9]|LPT[1-9])(?:\.|$)/i.test(cleaned) ? `_${cleaned}` : cleaned;
36
46
  }
37
47
  /** Extension-derived media types for agent-supplied files; unknown types stay generic. */
38
48
  const PATH_MEDIA_TYPES = {