@wowyuarm/dsh-agent-team 0.1.11 → 0.1.13

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 (114) hide show
  1. package/README.md +6 -4
  2. package/README.zh.md +6 -4
  3. package/cordis.patch.yml +7 -3
  4. package/package.json +16 -3
  5. package/packages/agent-team/README.md +4 -4
  6. package/packages/agent-team/README.zh.md +4 -4
  7. package/packages/agent-team/lib/context-projection.js +5 -1
  8. package/packages/agent-team/lib/index.js +162 -113
  9. package/packages/agent-team/lib/ledger.js +496 -169
  10. package/packages/agent-team/lib/member-context.js +18 -1
  11. package/packages/agent-team/lib/member-runtime.js +48 -9
  12. package/packages/agent-team/lib/mentions.js +80 -0
  13. package/packages/agent-team/lib/spec.js +20 -0
  14. package/packages/agent-team/lib/typert.host.js +241 -46
  15. package/packages/agent-team/lib/typert.remote-client.d.ts +7 -3
  16. package/packages/agent-team/lib/typert.remote-client.d.ts.map +1 -1
  17. package/packages/agent-team/lib/typert.remote-client.js +178 -28
  18. package/packages/agent-team/lib/types/context-projection.d.ts.map +1 -1
  19. package/packages/agent-team/lib/types/index.d.ts +33 -14
  20. package/packages/agent-team/lib/types/index.d.ts.map +1 -1
  21. package/packages/agent-team/lib/types/ledger.d.ts +120 -18
  22. package/packages/agent-team/lib/types/ledger.d.ts.map +1 -1
  23. package/packages/agent-team/lib/types/member-context.d.ts +6 -0
  24. package/packages/agent-team/lib/types/member-context.d.ts.map +1 -1
  25. package/packages/agent-team/lib/types/member-runtime.d.ts +2 -1
  26. package/packages/agent-team/lib/types/member-runtime.d.ts.map +1 -1
  27. package/packages/agent-team/lib/types/mentions.d.ts +47 -0
  28. package/packages/agent-team/lib/types/mentions.d.ts.map +1 -0
  29. package/packages/agent-team/lib/types/spec.d.ts.map +1 -1
  30. package/packages/agent-team/lib/types/types/entities.d.ts +3 -20
  31. package/packages/agent-team/lib/types/types/entities.d.ts.map +1 -1
  32. package/packages/agent-team/lib/types/types/operations.d.ts +37 -1
  33. package/packages/agent-team/lib/types/types/operations.d.ts.map +1 -1
  34. package/packages/agent-team/lib/types/types/requests-results.d.ts +107 -25
  35. package/packages/agent-team/lib/types/types/requests-results.d.ts.map +1 -1
  36. package/packages/agent-team/lib/types/vendor/storage-sqlite/index.d.ts +87 -0
  37. package/packages/agent-team/lib/types/vendor/storage-sqlite/index.d.ts.map +1 -0
  38. package/packages/agent-team/lib/types/vendor/storage-sqlite/schema.d.ts +59 -0
  39. package/packages/agent-team/lib/types/vendor/storage-sqlite/schema.d.ts.map +1 -0
  40. package/packages/agent-team/lib/types/vendor/storage-sqlite/unit.d.ts +57 -0
  41. package/packages/agent-team/lib/types/vendor/storage-sqlite/unit.d.ts.map +1 -0
  42. package/packages/agent-team/lib/vendor/storage-sqlite/index.js +139 -0
  43. package/packages/agent-team/lib/vendor/storage-sqlite/schema.js +120 -0
  44. package/packages/agent-team/lib/vendor/storage-sqlite/unit.js +132 -0
  45. package/packages/agent-team/preset/team-member/agent.cordis.yml +48 -8
  46. package/packages/client-agent-team/README.md +1 -1
  47. package/packages/client-agent-team/README.zh.md +1 -1
  48. package/packages/client-agent-team/lib/client.js +2123 -1406
  49. package/packages/client-agent-team/lib/client.js.map +1 -1
  50. package/packages/client-agent-team/lib/types/client/TeamAgentImport.d.ts +12 -0
  51. package/packages/client-agent-team/lib/types/client/TeamAgentImport.d.ts.map +1 -0
  52. package/packages/client-agent-team/lib/types/client/TeamAgentImport.js +69 -0
  53. package/packages/client-agent-team/lib/types/client/TeamAgentsPanel.d.ts +3 -1
  54. package/packages/client-agent-team/lib/types/client/TeamAgentsPanel.d.ts.map +1 -1
  55. package/packages/client-agent-team/lib/types/client/TeamAgentsPanel.js +31 -19
  56. package/packages/client-agent-team/lib/types/client/TeamAvatarStack.d.ts +18 -0
  57. package/packages/client-agent-team/lib/types/client/TeamAvatarStack.d.ts.map +1 -0
  58. package/packages/client-agent-team/lib/types/client/TeamAvatarStack.js +22 -0
  59. package/packages/client-agent-team/lib/types/client/TeamChannelPage.d.ts +3 -1
  60. package/packages/client-agent-team/lib/types/client/TeamChannelPage.d.ts.map +1 -1
  61. package/packages/client-agent-team/lib/types/client/TeamChannelPage.js +111 -24
  62. package/packages/client-agent-team/lib/types/client/TeamChannelsPanel.d.ts.map +1 -1
  63. package/packages/client-agent-team/lib/types/client/TeamChannelsPanel.js +10 -3
  64. package/packages/client-agent-team/lib/types/client/TeamComposer.d.ts.map +1 -1
  65. package/packages/client-agent-team/lib/types/client/TeamComposer.js +11 -17
  66. package/packages/client-agent-team/lib/types/client/TeamConversation.js +1 -1
  67. package/packages/client-agent-team/lib/types/client/TeamCountBadge.d.ts +20 -0
  68. package/packages/client-agent-team/lib/types/client/TeamCountBadge.d.ts.map +1 -0
  69. package/packages/client-agent-team/lib/types/client/TeamCountBadge.js +25 -0
  70. package/packages/client-agent-team/lib/types/client/TeamInboxPage.d.ts +9 -5
  71. package/packages/client-agent-team/lib/types/client/TeamInboxPage.d.ts.map +1 -1
  72. package/packages/client-agent-team/lib/types/client/TeamInboxPage.js +92 -23
  73. package/packages/client-agent-team/lib/types/client/TeamMemberRow.d.ts +43 -0
  74. package/packages/client-agent-team/lib/types/client/TeamMemberRow.d.ts.map +1 -0
  75. package/packages/client-agent-team/lib/types/client/TeamMemberRow.js +27 -0
  76. package/packages/client-agent-team/lib/types/client/TeamMembersAction.d.ts +2 -2
  77. package/packages/client-agent-team/lib/types/client/TeamMembersAction.d.ts.map +1 -1
  78. package/packages/client-agent-team/lib/types/client/TeamMembersAction.js +2 -2
  79. package/packages/client-agent-team/lib/types/client/TeamPresenceDot.d.ts +1 -1
  80. package/packages/client-agent-team/lib/types/client/TeamPresenceDot.d.ts.map +1 -1
  81. package/packages/client-agent-team/lib/types/client/TeamThreadPage.d.ts.map +1 -1
  82. package/packages/client-agent-team/lib/types/client/TeamThreadPage.js +21 -31
  83. package/packages/client-agent-team/lib/types/client/TeamWorkspaceBrowser.d.ts +1 -1
  84. package/packages/client-agent-team/lib/types/client/TeamWorkspaceBrowser.d.ts.map +1 -1
  85. package/packages/client-agent-team/lib/types/client/TeamWorkspaceBrowser.js +29 -11
  86. package/packages/client-agent-team/lib/types/client/index.d.ts.map +1 -1
  87. package/packages/client-agent-team/lib/types/client/index.js +11 -5
  88. package/packages/client-agent-team/lib/types/client/locales.d.ts +54 -16
  89. package/packages/client-agent-team/lib/types/client/locales.d.ts.map +1 -1
  90. package/packages/client-agent-team/lib/types/client/locales.js +54 -16
  91. package/packages/client-agent-team/lib/types/client/slots.d.ts +3 -2
  92. package/packages/client-agent-team/lib/types/client/slots.d.ts.map +1 -1
  93. package/packages/client-agent-team/lib/types/client/team-changes.d.ts +15 -25
  94. package/packages/client-agent-team/lib/types/client/team-changes.d.ts.map +1 -1
  95. package/packages/client-agent-team/lib/types/client/team-changes.js +82 -80
  96. package/packages/client-agent-team/lib/types/client/team-formatters.d.ts +45 -10
  97. package/packages/client-agent-team/lib/types/client/team-formatters.d.ts.map +1 -1
  98. package/packages/client-agent-team/lib/types/client/team-formatters.js +71 -30
  99. package/packages/tool-agent-team/README.md +3 -3
  100. package/packages/tool-agent-team/README.zh.md +3 -3
  101. package/packages/tool-agent-team/lib/host-access.js +19 -0
  102. package/packages/tool-agent-team/lib/index.js +71 -49
  103. package/packages/tool-agent-team/lib/types/host-access.d.ts +10 -0
  104. package/packages/tool-agent-team/lib/types/host-access.d.ts.map +1 -1
  105. package/packages/tool-agent-team/lib/types/index.d.ts.map +1 -1
  106. package/packages/agent-team/lib/progress-nudge.js +0 -328
  107. package/packages/agent-team/lib/types/progress-nudge.d.ts +0 -136
  108. package/packages/agent-team/lib/types/progress-nudge.d.ts.map +0 -1
  109. package/packages/client-agent-team/lib/types/client/TeamSettings.d.ts +0 -3
  110. package/packages/client-agent-team/lib/types/client/TeamSettings.d.ts.map +0 -1
  111. package/packages/client-agent-team/lib/types/client/TeamSettings.js +0 -5
  112. package/packages/client-agent-team/lib/types/client/scope-coverage.d.ts +0 -41
  113. package/packages/client-agent-team/lib/types/client/scope-coverage.d.ts.map +0 -1
  114. package/packages/client-agent-team/lib/types/client/scope-coverage.js +0 -64
package/README.md CHANGED
@@ -21,13 +21,13 @@ An opt-in plugin for [DeepSeek Harness](https://github.com/deepseek-ai/deepseek-
21
21
 
22
22
  ## Preview
23
23
 
24
- Agent Team is opt-in: after installation the ordinary DSH page stays as-is, and Team mode is one additional entry in the sidebar footer.
24
+ Team mode lives inside the ordinary DSH Web UI: Channels carry the discussion, the Inbox gathers what needs you, and Task Threads keep one line of progress.
25
25
 
26
- ![Ordinary DSH Web UI with the Team entry highlighted in the sidebar footer](assets/readme/dsh-entry.png)
26
+ ![Channel in the DSH Web UI: member roster, @mentions, and Task references in the message flow](assets/readme/channel.png)
27
27
 
28
- Entering Team mode shows Channels, managed Agents, and the collaboration timeline:
28
+ The Human Inbox leads with unread Threads that need you, followed by recently active ones:
29
29
 
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)
30
+ ![Human Inbox in the DSH Web UI: unread Threads that need you on top, recently active Threads below](assets/readme/inbox.png)
31
31
 
32
32
  ### Task Threads
33
33
 
@@ -59,6 +59,8 @@ dsh plugin --profile web add @wowyuarm/dsh-agent-team
59
59
  dsh web
60
60
  ```
61
61
 
62
+ Do not start DSH from its source checkout (`pnpm dsh web`): source mode loads a second copy of the scope module, so every member reports `selected preset is not team-enabled`. Always start the compiled CLI.
63
+
62
64
  Agent Team is opt-in. Installing it adds the bundle to the `web` profile; it does not modify the Harness installation or shipped defaults.
63
65
 
64
66
  ### 3. Verify and try it
package/README.zh.md CHANGED
@@ -21,13 +21,13 @@
21
21
 
22
22
  ## 预览
23
23
 
24
- Agent Team 是按需启用的:安装后普通 DSH 页面保持原样,Team mode 只是侧栏底部多出的一个入口。
24
+ Team mode 就在普通 DSH Web UI 里:Channel 承载讨论,收件箱收拢需要你的事项,Task Thread 把一条工作线保留在同一条上下文里。
25
25
 
26
- ![普通 DSH Web UI,侧栏底部高亮 Team 入口](assets/readme/dsh-entry.png)
26
+ ![DSH Web UI 中的 Channel:成员名单、@提及与消息流中的 Task 引用](assets/readme/channel.png)
27
27
 
28
- 进入 Team mode 后是频道、受管 Agent 与协作时间线:
28
+ Human 收件箱把需要你的未读 Thread 置顶,其下是最近活跃:
29
29
 
30
- ![DSH Web UI 中的 Team mode:侧边栏展示频道与在线 Agent 成员;Main Channel 展示 Task 引用](assets/readme/team-mode.png)
30
+ ![DSH Web UI 中的 Human 收件箱:需要你的未读 Thread 在上,最近活跃的 Thread 在下](assets/readme/inbox.png)
31
31
 
32
32
  ### Task Thread
33
33
 
@@ -59,6 +59,8 @@ dsh plugin --profile web add @wowyuarm/dsh-agent-team
59
59
  dsh web
60
60
  ```
61
61
 
62
+ 不要从 DSH 源码 checkout 启动(`pnpm dsh web`):源码模式会加载第二份 scope 模块,所有成员都会报 `selected preset is not team-enabled`。请始终使用编译产物启动。
63
+
62
64
  Agent Team 是显式 opt-in 的。安装只会把 bundle 加入 `web` profile,不会修改 Harness 安装,也不会修改 shipped defaults。
63
65
 
64
66
  ### 3. 验证并开始使用
package/cordis.patch.yml CHANGED
@@ -15,10 +15,14 @@
15
15
  name: '@deepseek-ai/dsh-invariants'
16
16
  - id: wowyuarm-agent-team-invariant
17
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.
18
+ # Team ledger medium backend. Vendored under our own package name (see
19
+ # packages/agent-team/src/vendor/storage-sqlite/): DSH Desktop generation
20
+ # installers strip `@deepseek-ai/*` copies and resolve them from the host
21
+ # closure, which ships no sqlite backend — a loader row naming that
22
+ # package blocks boot (GitHub issue #28). Mounted here as an ordinary
23
+ # storage provider row beside the shipped JSON backend.
20
24
  - id: storage-sqlite
21
- name: '@deepseek-ai/dsh-storage-sqlite'
25
+ name: '@wowyuarm/dsh-agent-team/sqlite-backend'
22
26
  config:
23
27
  path: !!js dshHomePath('storages', 'agent_team.sqlite')
24
28
 
package/package.json CHANGED
@@ -1,6 +1,7 @@
1
1
  {
2
2
  "name": "@wowyuarm/dsh-agent-team",
3
- "version": "0.1.11",
3
+ "version": "0.1.13",
4
+ "license": "MIT",
4
5
  "description": "A persistent agent team for long-running collaboration in DeepSeek Harness",
5
6
  "repository": {
6
7
  "type": "git",
@@ -25,7 +26,8 @@
25
26
  "clean:build-outputs": "node scripts/clean-build-outputs.mjs",
26
27
  "check:docs": "node scripts/check-docs.mjs",
27
28
  "check:core-skills": "node scripts/check-core-skills.mjs",
28
- "test": "npm run generate:typert && npm run check:docs && npm run check:core-skills && vitest run",
29
+ "check:boundaries": "node scripts/check-package-boundaries.mjs",
30
+ "test": "npm run generate:typert && npm run check:docs && npm run check:core-skills && npm run check:boundaries && vitest run",
29
31
  "test:browser": "npm run build && node scripts/run-browser-test.mjs",
30
32
  "preview": "node scripts/check-preview-credentials.mjs && npm run build && node scripts/run-preview.mjs",
31
33
  "preview:ui": "npm run build && node scripts/run-ui-preview.mjs",
@@ -40,6 +42,9 @@
40
42
  },
41
43
  "client": {
42
44
  "platform": "web",
45
+ "external": [
46
+ "@deepseek-ai/dsh-api-gateway/client"
47
+ ],
43
48
  "inject": [
44
49
  "@deepseek-ai/dsh-api-remotes",
45
50
  "@deepseek-ai/dsh-client-ui-sidebar",
@@ -53,10 +58,10 @@
53
58
  }
54
59
  },
55
60
  "dependencies": {
56
- "@deepseek-ai/dsh-storage-sqlite": ">=0.1.5-rc.1 <0.2.0",
57
61
  "zod": "^4.4.3"
58
62
  },
59
63
  "devDependencies": {
64
+ "@deepseek-ai/dsh-storage-sqlite": "0.1.5-rc.2",
60
65
  "@testing-library/dom": "^10.4.1",
61
66
  "@testing-library/react": "^16.3.2",
62
67
  "@types/node": "^24.0.0",
@@ -104,6 +109,10 @@
104
109
  "types": "./packages/agent-team/lib/types/preset-roster.d.ts",
105
110
  "default": "./packages/agent-team/lib/preset-roster.js"
106
111
  },
112
+ "./sqlite-backend": {
113
+ "types": "./packages/agent-team/lib/types/vendor/storage-sqlite/index.d.ts",
114
+ "default": "./packages/agent-team/lib/vendor/storage-sqlite/index.js"
115
+ },
107
116
  "./member-context": {
108
117
  "types": "./packages/agent-team/lib/types/member-context.d.ts",
109
118
  "default": "./packages/agent-team/lib/member-context.js"
@@ -116,6 +125,10 @@
116
125
  "types": "./packages/agent-team/lib/types/time-format.d.ts",
117
126
  "default": "./packages/agent-team/lib/time-format.js"
118
127
  },
128
+ "./mentions": {
129
+ "types": "./packages/agent-team/lib/types/mentions.d.ts",
130
+ "default": "./packages/agent-team/lib/mentions.js"
131
+ },
119
132
  "./member-skills": {
120
133
  "types": "./packages/agent-team/lib/types/member-skills.d.ts",
121
134
  "default": "./packages/agent-team/lib/member-skills.js"
@@ -18,7 +18,7 @@ One durable record stores progress instead of the projection it reported. A `tea
18
18
 
19
19
  `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.
20
20
 
21
- 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.
21
+ Member creation commits one stable Member/session/Workspace/preset/private-memory identity before unpublished Agent setup. The creation Workspace is recorded as the Member's creation site; further Workspaces are joined and left through the participation operations (`team/member-workspace-joined`/`team/member-workspace-left`), which grant collaboration immediately without moving the Session. 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.
22
22
 
23
23
  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).
24
24
 
@@ -28,13 +28,13 @@ Activation applies `tools.allow` as a scoped restriction over the composed prese
28
28
 
29
29
  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.
30
30
 
31
- 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.
31
+ 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 every enabled Member's private memory is provisioned and an `inactive` Member's is removed with its Session archived; directories the replayed ledger does not reference are never pruned, so leftovers from a discarded ledger stay on disk for the operator. Both that removal and the activation-time migration of a pre-fix colon directory act only on paths inside the running process's own `$DSH_HOME/agent-team/members/`: a recorded path naming a different DSH home (an isolated test home, a second instance) is refused with a warning rather than renamed or deleted, because acting on it would take a Member's real private memory out of its home.
32
32
 
33
33
  Adding a Member to a Channel grants future read/send/claim authority but injects no historical Messages into the member session. Every top-level Message creates a Thread; new Client/tool starts explicitly choose taskless while released-client omission remains taskful, and a Human can later promote a taskless Thread by atomically adding its Task overlay and a structured `promote` Task activity. Thread Attention starts when a Thread 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 — including promotion — include concise transition facts; ordinary unread carries a body-free Thread-first route. Pending hints are coalesced, ignored hints do not loop, and resume/error recovery derives a new hint from durable unread state. For recoverable service failures, the Host wakes a Member after each of the first two consecutive `agent/error` occurrences, then leaves the third failure for the operator; only a clean turn resets that run.
34
34
 
35
- Member replies require the exact current Thread revision and atomically update Message and Thread facts. `threadRef` is the primary collaboration identity; released task-only Clients may send a Host-resolved `taskRef` alias for taskful Threads, while Task/Claim operations remain Task-ref based. 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. Taskless Threads still support replies, follow, mentions, Inbox, read, and history, but have no Claims or Task-resolution path. 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.
35
+ Member replies require the exact current Thread revision and atomically update Message and Thread facts. `threadRef` is the primary collaboration identity; released task-only Clients may send a Host-resolved `taskRef` alias for taskful Threads, while Task/Claim operations remain Task-ref based. 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. Taskless Threads still support replies, follow, mentions, Inbox, read, and history, but have no Claims or Task-resolution path. Top-level Messages may mention Agents directly: mentioned Members start following the new Thread. In an existing Thread, a Human reply mentioning a Member that is not currently following requires a process-local, one-use confirmation token before the operation commits, while such a Member reply commits and delivers only to Members the Thread has ever carried, reporting the rest as undelivered. Mentions are authored in the Message body as `@Handle` and resolved by the Host against the Channel's addressable names; Message facts carry the resolved 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.
36
36
 
37
- `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 derives no scope, because it advances only the reader's private watermark and a read that finds nothing unread for its reader (no watermark to advance, no marker to consume) appends no operation at all: it answers with the same projection-derived picture and no receipt, so an already-read Thread costs neither a durable write nor a replay. 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.
37
+ `changes({ scope? }, signal?)` returns an `AsyncIterable<{ version: number }>` through a streaming Remote. It emits the current baseline, then matching workspace/channel/thread/presence invalidations; omitting scope observes shared projections but not presence. A paused consumer retains only the latest pending version; cancellation or Host disposal closes the stream. The Client must reread projections on every baseline, even when the version is unchanged or lower after a restart. See [architecture](../../docs/architecture.md#host-authority) for scope/version and recovery semantics. Thread reads change only private read state: they wake no scope, and a read with no unread or markers to consume appends no operation. After a commit, Inbox hints are recomputed only for affected Members.
38
38
 
39
39
  M1 supports one Host writer. The ledger is permanent and has no snapshot or compaction path.
40
40
 
@@ -18,7 +18,7 @@ Service 使用 `ctx.storageDomain`、`ctx.workspaceRegistry`、`ctx.agents`、`c
18
18
 
19
19
  `storage-domain` 在持久读取处校验每条 record,并拒绝被其他版本标记的 backend unit。Team 只在 `KvTable.put()` 完成后更新 projection。其 Fiber 持有 Domain handle;dispose 通过 Cordis 移除拒绝新的 Service 调用,排空已接受的 Domain write,并在名称可重新打开前关闭 backend unit。
20
20
 
21
- 创建 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。
21
+ 创建 Member 时,先提交稳定的 Member/session/Workspace/preset/private-memory 身份,再执行 unpublished Agent setup。创建 Workspace 记录为 Member 的创建地;更多 Workspace 通过参与操作(`team/member-workspace-joined`/`team/member-workspace-left`)加入与退出——加入即获得协作能力,不移动 Session。Setup 挂载指定 preset,并在发布前检查带 marker 的 `team_message` 和全部八个 Team tools。失败只把该 Member 标为 unavailable。Suspend 等待所属 `AgentHandle` 完全停止;resume 和 Host remount 恢复同一个持久 session。
22
22
 
23
23
  归档(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 归档现状)。
24
24
 
@@ -28,13 +28,13 @@ Activation 把 `tools.allow` 作为 scoped restriction 应用在已组合的 pre
28
28
 
29
29
  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 驱动。
30
30
 
31
- 每个 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:` 形态的条目保持原样。
31
+ 每个 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 启动时会为每个 enabled Member 准备其私有记忆,并对 `inactive` Member 归档其 Session 后删除其私有记忆;重放 ledger 不引用的目录一律不清理,被丢弃 ledger 的遗留物留在磁盘上交给操作者处置。这项删除与 activation 时对旧式 colon 目录的迁移都只作用于当前进程自己的 `$DSH_HOME/agent-team/members/` 之内的路径:记录里指向另一个 DSH home(隔离测试 home、第二个实例)的路径会被拒绝并告警,既不改名也不删除——对它动手等于把 Member 的真实私有记忆搬出它自己的 home。
32
32
 
33
33
  把 Member 加入 Channel 只授予之后的 read/send/claim authority,不向 Member session 注入历史 Message。每条顶层 Message 都创建 Thread;新 Client/tool 显式选择 taskless,released Client 省略意图时仍保持 taskful;Human 可之后 promotion taskless Thread,原子附加 Task overlay 与结构化 `promote` Task activity。创建 Thread、创建 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 变化(含 promotion)包含简短状态事实,普通未读提供无正文的 Thread-first 路由。提示会合并,忽略提示不会形成循环,resume/runtime error recovery 会从持久未读状态重新判断是否提示。对于可恢复的服务错误,Host 会在连续 `agent/error` occurrence 的前两次后唤醒 Member;第 3 次错误则交给 operator,只有 clean turn 才会重置这段连续错误。
34
34
 
35
- Member reply 必须携带准确的当前 Thread revision,并在一个 operation 内更新 Message 和 Thread facts。`threadRef` 是协作主身份;released task-only Client 可为 taskful Thread 传入 Host-resolved `taskRef` alias,而 Task/Claim 操作仍以 Task ref 为准。未读工作必须先 read;revision 过期时拒绝写入。Closed Task 拒绝 reply 和新的 Attention;reopen 恢复 Task,但不恢复之前的 Attention。taskless Thread 仍支持 reply、follow、mention、Inbox、read 和 history,但没有 Claim 或 Task resolution path。顶层消息可以直接 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。
35
+ Member reply 必须携带准确的当前 Thread revision,并在一个 operation 内更新 Message 和 Thread facts。`threadRef` 是协作主身份;released task-only Client 可为 taskful Thread 传入 Host-resolved `taskRef` alias,而 Task/Claim 操作仍以 Task ref 为准。未读工作必须先 read;revision 过期时拒绝写入。Closed Task 拒绝 reply 和新的 Attention;reopen 恢复 Task,但不恢复之前的 Attention。taskless Thread 仍支持 reply、follow、mention、Inbox、read 和 history,但没有 Claim 或 Task resolution path。顶层消息可以直接 mention Agent:被 mention 的 Member 会开始关注新 Thread。在既有 Thread 中,Human 的 reply 提到当前未 follow Member 时必须先取得 process-local one-use confirmation token 才提交 operation;Member 的此类 reply 会提交,但只送达该 Thread 曾经承载过的 Member,其余在结果里报告为未送达。mention 在 Message 正文里以 `@Handle` 撰写,由 Host 按 Channel 的可寻址名字解析;Message fact 携带解析后的 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。
36
36
 
37
- `changes()` Client 失效通知流。每个请求声明一个可选 `scope`(workspace、channel thread)和可取消的传输 signal;一次提交的 operation 只唤醒 scope 与该 operation 派生范围匹配的 waiter(成员生命周期与 presence 唤醒其 Workspace,内容操作唤醒其 Channel 与 Thread)。Thread read 不派生任何 scope,因为它只推进读者自己的私有水位——而一次读如果对读者没有任何未读(没有水位可推进、没有 marker 可消费),就完全不追加 operation:它返回同一份由 projection 派生的画面且不带 receipt,所以已读完的 Thread 既不付一次持久写、也不付一次重放。每次提交后,Host 只通知 Inbox projection 可能被该 operation 改变的 Member——即 operation 的 Attention/marker delta 加上被触及 Thread 的当前关注者——而不是全部在线 Agent
37
+ `changes({ scope? }, signal?)` 通过流式 Remote 返回 `AsyncIterable<{ version: number }>`。先发送当前基线,之后发送匹配的 workspace/channel/thread/presence 通知;省略 scope 时观察共享投影,不包含 presence。消费者暂停期间只保留最新待发送版本;取消或 Host 释放时关闭流。Client 必须在每次基线到达时重读投影,即使重启后的版本相同或更低。scope、版本和恢复语义见[架构文档](../../docs/architecture.zh.md#host-authority)。Thread read 只改变私有已读状态,不唤醒任何 scope;没有未读或 marker 可消费时不追加 operation。提交后只为受影响的 Members 重算 Inbox hints
38
38
 
39
39
  M1 支持单个 Host writer。Ledger 永久保留,不提供 snapshot 或 compaction。
40
40
 
@@ -34,7 +34,11 @@ const TEAM_ATTENTION_BOUNDARY_LABEL = 'Team attention change';
34
34
  const TEAM_CLAIM_BOUNDARY_LABEL = 'Team task claim change';
35
35
  /**
36
36
  * Notice summaries that are pure reminders, never semantic Team facts: a
37
- * progress nudge or a recovery instruction must not become a return anchor.
37
+ * recovery instruction must not become a return anchor. `Progress visibility
38
+ * reminder` is a historical decoder — the progress-nudge system was removed,
39
+ * but session logs recorded before its removal still carry those notices, and
40
+ * the projection keeps recognizing them (same pattern as the legacy
41
+ * `new_context` tool name below).
38
42
  */
39
43
  const REMINDER_NOTICE_SUMMARIES = new Set(['Progress visibility reminder', 'Recovery: continue your interrupted work.']);
40
44
  /** Whether one notice summary is a pure reminder (never a semantic Team fact). */