@wowyuarm/dsh-agent-team 0.1.14-alpha.2 → 0.1.14

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 (127) hide show
  1. package/README.md +5 -3
  2. package/README.zh.md +5 -3
  3. package/cordis.patch.yml +2 -185
  4. package/package.json +52 -46
  5. package/packages/agent-team/README.md +1 -1
  6. package/packages/agent-team/README.zh.md +1 -1
  7. package/packages/agent-team/core-skills/member-memory-manager/SKILL.md +30 -0
  8. package/packages/agent-team/lib/context-continuity-host.js +91 -0
  9. package/packages/agent-team/lib/context-projection.js +266 -489
  10. package/packages/agent-team/lib/context-source.js +17 -106
  11. package/packages/agent-team/lib/human-avatar.js +61 -0
  12. package/packages/agent-team/lib/human-profile.js +46 -0
  13. package/packages/agent-team/lib/human-update-check.js +119 -0
  14. package/packages/agent-team/lib/index.js +408 -264
  15. package/packages/agent-team/lib/ledger.js +120 -15
  16. package/packages/agent-team/lib/member-context.js +9 -8
  17. package/packages/agent-team/lib/member-runtime.js +1 -1
  18. package/packages/agent-team/lib/member-time-context.js +2 -5
  19. package/packages/agent-team/lib/preset-roster.js +15 -0
  20. package/packages/agent-team/lib/pressure-policy.js +9 -6
  21. package/packages/agent-team/lib/session-remediation.js +493 -0
  22. package/packages/agent-team/lib/stored-session-reader.js +2 -1
  23. package/packages/agent-team/lib/typert.host.js +605 -291
  24. package/packages/agent-team/lib/typert.remote-client.d.ts +15 -6
  25. package/packages/agent-team/lib/typert.remote-client.d.ts.map +1 -1
  26. package/packages/agent-team/lib/typert.remote-client.js +367 -244
  27. package/packages/agent-team/lib/types/context-continuity-host.d.ts +84 -0
  28. package/packages/agent-team/lib/types/context-continuity-host.d.ts.map +1 -0
  29. package/packages/agent-team/lib/types/context-projection.d.ts +130 -185
  30. package/packages/agent-team/lib/types/context-projection.d.ts.map +1 -1
  31. package/packages/agent-team/lib/types/context-source.d.ts +17 -81
  32. package/packages/agent-team/lib/types/context-source.d.ts.map +1 -1
  33. package/packages/agent-team/lib/types/human-avatar.d.ts +29 -0
  34. package/packages/agent-team/lib/types/human-avatar.d.ts.map +1 -0
  35. package/packages/agent-team/lib/types/human-profile.d.ts +44 -0
  36. package/packages/agent-team/lib/types/human-profile.d.ts.map +1 -0
  37. package/packages/agent-team/lib/types/human-update-check.d.ts +73 -0
  38. package/packages/agent-team/lib/types/human-update-check.d.ts.map +1 -0
  39. package/packages/agent-team/lib/types/index.d.ts +112 -38
  40. package/packages/agent-team/lib/types/index.d.ts.map +1 -1
  41. package/packages/agent-team/lib/types/ledger.d.ts +31 -2
  42. package/packages/agent-team/lib/types/ledger.d.ts.map +1 -1
  43. package/packages/agent-team/lib/types/member-context.d.ts +0 -14
  44. package/packages/agent-team/lib/types/member-context.d.ts.map +1 -1
  45. package/packages/agent-team/lib/types/member-time-context.d.ts +0 -15
  46. package/packages/agent-team/lib/types/member-time-context.d.ts.map +1 -1
  47. package/packages/agent-team/lib/types/preset-roster.d.ts +5 -0
  48. package/packages/agent-team/lib/types/preset-roster.d.ts.map +1 -0
  49. package/packages/agent-team/lib/types/pressure-policy.d.ts +6 -0
  50. package/packages/agent-team/lib/types/pressure-policy.d.ts.map +1 -1
  51. package/packages/agent-team/lib/types/session-remediation.d.ts +172 -0
  52. package/packages/agent-team/lib/types/session-remediation.d.ts.map +1 -0
  53. package/packages/agent-team/lib/types/stored-session-reader.d.ts +2 -1
  54. package/packages/agent-team/lib/types/stored-session-reader.d.ts.map +1 -1
  55. package/packages/agent-team/lib/types/types/entities.d.ts +20 -3
  56. package/packages/agent-team/lib/types/types/entities.d.ts.map +1 -1
  57. package/packages/agent-team/lib/types/types/requests-results.d.ts +63 -0
  58. package/packages/agent-team/lib/types/types/requests-results.d.ts.map +1 -1
  59. package/packages/agent-team/preset/team-member/agent.cordis.yml +166 -0
  60. package/packages/client-agent-team/lib/client.js +1667 -516
  61. package/packages/client-agent-team/lib/client.js.map +1 -1
  62. package/packages/client-agent-team/lib/types/client/HumanSettingsSection.d.ts +15 -0
  63. package/packages/client-agent-team/lib/types/client/HumanSettingsSection.d.ts.map +1 -0
  64. package/packages/client-agent-team/lib/types/client/HumanSettingsSection.js +115 -0
  65. package/packages/client-agent-team/lib/types/client/TeamAgentsPanel.d.ts.map +1 -1
  66. package/packages/client-agent-team/lib/types/client/TeamAgentsPanel.js +12 -8
  67. package/packages/client-agent-team/lib/types/client/TeamAvatarStack.d.ts +22 -1
  68. package/packages/client-agent-team/lib/types/client/TeamAvatarStack.d.ts.map +1 -1
  69. package/packages/client-agent-team/lib/types/client/TeamAvatarStack.js +25 -2
  70. package/packages/client-agent-team/lib/types/client/TeamChannelPage.d.ts +6 -1
  71. package/packages/client-agent-team/lib/types/client/TeamChannelPage.d.ts.map +1 -1
  72. package/packages/client-agent-team/lib/types/client/TeamChannelPage.js +69 -31
  73. package/packages/client-agent-team/lib/types/client/TeamChannelsPanel.js +4 -4
  74. package/packages/client-agent-team/lib/types/client/TeamComposer.js +3 -3
  75. package/packages/client-agent-team/lib/types/client/TeamConversation.d.ts +1 -1
  76. package/packages/client-agent-team/lib/types/client/TeamConversation.d.ts.map +1 -1
  77. package/packages/client-agent-team/lib/types/client/TeamConversation.js +12 -5
  78. package/packages/client-agent-team/lib/types/client/TeamFooterAction.js +2 -2
  79. package/packages/client-agent-team/lib/types/client/TeamInboxPage.d.ts +4 -1
  80. package/packages/client-agent-team/lib/types/client/TeamInboxPage.d.ts.map +1 -1
  81. package/packages/client-agent-team/lib/types/client/TeamInboxPage.js +22 -7
  82. package/packages/client-agent-team/lib/types/client/TeamMemberEditor.d.ts +11 -1
  83. package/packages/client-agent-team/lib/types/client/TeamMemberEditor.d.ts.map +1 -1
  84. package/packages/client-agent-team/lib/types/client/TeamMemberEditor.js +69 -8
  85. package/packages/client-agent-team/lib/types/client/TeamMembersAction.js +2 -2
  86. package/packages/client-agent-team/lib/types/client/TeamMessage.d.ts +18 -3
  87. package/packages/client-agent-team/lib/types/client/TeamMessage.d.ts.map +1 -1
  88. package/packages/client-agent-team/lib/types/client/TeamMessage.js +213 -67
  89. package/packages/client-agent-team/lib/types/client/TeamRowMenu.d.ts.map +1 -1
  90. package/packages/client-agent-team/lib/types/client/TeamRowMenu.js +2 -2
  91. package/packages/client-agent-team/lib/types/client/TeamSidebarSection.js +2 -2
  92. package/packages/client-agent-team/lib/types/client/TeamThreadPage.d.ts +5 -0
  93. package/packages/client-agent-team/lib/types/client/TeamThreadPage.d.ts.map +1 -1
  94. package/packages/client-agent-team/lib/types/client/TeamThreadPage.js +55 -29
  95. package/packages/client-agent-team/lib/types/client/TeamWorkspaceBrowser.js +3 -3
  96. package/packages/client-agent-team/lib/types/client/TeamWorkspaceSelector.js +2 -2
  97. package/packages/client-agent-team/lib/types/client/avatar-image.d.ts +21 -0
  98. package/packages/client-agent-team/lib/types/client/avatar-image.d.ts.map +1 -0
  99. package/packages/client-agent-team/lib/types/client/avatar-image.js +9 -0
  100. package/packages/client-agent-team/lib/types/client/human-identity.d.ts +94 -0
  101. package/packages/client-agent-team/lib/types/client/human-identity.d.ts.map +1 -0
  102. package/packages/client-agent-team/lib/types/client/human-identity.js +117 -0
  103. package/packages/client-agent-team/lib/types/client/index.d.ts.map +1 -1
  104. package/packages/client-agent-team/lib/types/client/index.js +112 -41
  105. package/packages/client-agent-team/lib/types/client/locales.d.ts +72 -2
  106. package/packages/client-agent-team/lib/types/client/locales.d.ts.map +1 -1
  107. package/packages/client-agent-team/lib/types/client/locales.js +78 -2
  108. package/packages/client-agent-team/lib/types/client/multi-menu-field.js +2 -2
  109. package/packages/client-agent-team/lib/types/client/refs.d.ts +71 -0
  110. package/packages/client-agent-team/lib/types/client/refs.d.ts.map +1 -0
  111. package/packages/client-agent-team/lib/types/client/refs.js +181 -0
  112. package/packages/client-agent-team/lib/types/client/slots.d.ts +8 -2
  113. package/packages/client-agent-team/lib/types/client/slots.d.ts.map +1 -1
  114. package/packages/client-agent-team/lib/types/client/team-formatters.d.ts +57 -9
  115. package/packages/client-agent-team/lib/types/client/team-formatters.d.ts.map +1 -1
  116. package/packages/client-agent-team/lib/types/client/team-formatters.js +85 -17
  117. package/packages/tool-agent-team/README.md +1 -1
  118. package/packages/tool-agent-team/README.zh.md +1 -1
  119. package/packages/tool-agent-team/lib/context-tools.js +20 -6
  120. package/packages/tool-agent-team/lib/index.js +2 -2
  121. package/packages/tool-agent-team/lib/types/context-tools.d.ts.map +1 -1
  122. package/packages/agent-team/lib/context-management.js +0 -371
  123. package/packages/agent-team/lib/types/context-management.d.ts +0 -154
  124. package/packages/agent-team/lib/types/context-management.d.ts.map +0 -1
  125. package/packages/client-agent-team/lib/types/client/task-refs.d.ts +0 -31
  126. package/packages/client-agent-team/lib/types/client/task-refs.d.ts.map +0 -1
  127. package/packages/client-agent-team/lib/types/client/task-refs.js +0 -99
@@ -0,0 +1,181 @@
1
+ import { useSyncExternalStore } from 'react';
2
+ /** Compare refs by branded prefix plus hyphen-stripped UUID, so abbreviated spellings line up with their full form. */
3
+ export function refKeyOf(ref) {
4
+ return ref.toLowerCase().replaceAll('-', '');
5
+ }
6
+ /**
7
+ * One versioned resolution cache per Host-resolved ref kind. Concurrent
8
+ * callers deduplicate through the pending set; refs the Host does not know
9
+ * are parked for the session so renders never retry-loop; a landing
10
+ * resolution wakes every rendered link through the version token.
11
+ */
12
+ function createRefStore(refOf) {
13
+ const resolved = new Map();
14
+ const pending = new Set();
15
+ /** Refs the Host did not recognize; never re-queried (no retry loops). */
16
+ const unresolvable = new Set();
17
+ const listeners = new Set();
18
+ let version = 0;
19
+ const emit = () => {
20
+ version += 1;
21
+ for (const listener of listeners)
22
+ listener();
23
+ };
24
+ const subscribe = (listener) => {
25
+ listeners.add(listener);
26
+ return () => { listeners.delete(listener); };
27
+ };
28
+ /** Stable snapshot token; the map is read directly after this changes. */
29
+ const getSnapshot = () => version;
30
+ /** React binding: re-renders the caller when any ref resolution lands. */
31
+ const useVersion = () => useSyncExternalStore(subscribe, getSnapshot, getSnapshot);
32
+ const cached = (ref) => resolved.get(ref);
33
+ /** Store one resolution (click path) and wake every rendered link. */
34
+ const remember = (entry) => {
35
+ resolved.set(refOf(entry), entry);
36
+ pending.delete(refOf(entry));
37
+ emit();
38
+ };
39
+ /**
40
+ * Batch-resolve unknown refs through the Host lookup. Concurrent callers
41
+ * deduplicate through the pending set; failures just clear the pending mark
42
+ * so a later interaction can retry.
43
+ */
44
+ const resolveUnknown = async (refs, lookup) => {
45
+ const missing = refs.filter(ref => !resolved.has(ref) && !pending.has(ref) && !unresolvable.has(ref));
46
+ if (missing.length === 0)
47
+ return;
48
+ for (const ref of missing)
49
+ pending.add(ref);
50
+ try {
51
+ const entries = await lookup(missing);
52
+ for (const entry of entries) {
53
+ resolved.set(refOf(entry), entry);
54
+ pending.delete(refOf(entry));
55
+ }
56
+ // Refs the Host does not know are parked for the session: re-querying
57
+ // them on every render would loop and hammer the Host.
58
+ for (const ref of missing) {
59
+ if (!resolved.has(ref))
60
+ unresolvable.add(ref);
61
+ }
62
+ if (entries.length > 0)
63
+ emit();
64
+ }
65
+ finally {
66
+ for (const ref of missing)
67
+ pending.delete(ref);
68
+ }
69
+ };
70
+ return { useVersion, cached, remember, resolveUnknown };
71
+ }
72
+ const taskStore = createRefStore((entry) => entry.taskRef);
73
+ const threadStore = createRefStore((entry) => entry.threadRef);
74
+ /** React binding: re-renders the caller when any Task ref resolution lands. */
75
+ export const useResolvedTaskRefVersion = taskStore.useVersion;
76
+ export const cachedResolvedTaskRef = taskStore.cached;
77
+ /** Store one Task resolution (click path) and wake every rendered link. */
78
+ export const rememberResolvedTaskRef = taskStore.remember;
79
+ export const resolveUnknownTaskRefs = taskStore.resolveUnknown;
80
+ /** React binding: re-renders the caller when any Thread ref resolution lands. */
81
+ export const useResolvedThreadRefVersion = threadStore.useVersion;
82
+ export const cachedResolvedThreadRef = threadStore.cached;
83
+ /** Store one Thread resolution (click path) and wake every rendered link. */
84
+ export const rememberResolvedThreadRef = threadStore.remember;
85
+ export const resolveUnknownThreadRefs = threadStore.resolveUnknown;
86
+ /**
87
+ * Click-path Host lookup shared by both ref kinds: remember every resolved
88
+ * entry and hand them back for immediate navigation. The Host keeps
89
+ * `resolved` in the same order as the input refs (one entry per resolvable
90
+ * input, unknowns omitted); the pairing walk below relies on that contract,
91
+ * so it must be preserved together with this implementation. The Host
92
+ * answers with full refs even for abbreviated inputs; the returned entries
93
+ * keep the input order, so the walk remembers each authored spelling as an
94
+ * alias of its resolution.
95
+ */
96
+ async function hostRefLookup(remember, refOf, alias, request, refs) {
97
+ const result = await request(refs);
98
+ if (!result.ok)
99
+ return [];
100
+ const entries = result.value;
101
+ let entryIndex = 0;
102
+ for (const requested of refs) {
103
+ const entry = entries[entryIndex];
104
+ if (entry === undefined || !refKeyOf(refOf(entry)).startsWith(refKeyOf(requested)))
105
+ continue;
106
+ if (refOf(entry) !== requested)
107
+ remember(alias(entry, requested));
108
+ remember(entry);
109
+ entryIndex += 1;
110
+ }
111
+ return entries;
112
+ }
113
+ /**
114
+ * Click-path Task lookup: remember every resolved entry and hand them back
115
+ * for immediate navigation (see hostRefLookup for the ordering contract).
116
+ */
117
+ export const hostTaskRefLookup = (resolveTaskRefs, workspaceId) => async (taskRefs) => hostRefLookup(rememberResolvedTaskRef, entry => entry.taskRef, (entry, taskRef) => ({ ...entry, taskRef }), async (refs) => {
118
+ const result = await resolveTaskRefs({ workspaceId, taskRefs: refs });
119
+ return result.ok ? { ok: true, value: result.value.resolved } : result;
120
+ }, taskRefs);
121
+ /**
122
+ * Click-path Thread lookup: remember every resolved entry and hand them back
123
+ * for immediate navigation (see hostRefLookup for the ordering contract).
124
+ */
125
+ export const hostThreadRefLookup = (resolveThreadRefs, workspaceId) => async (threadRefs) => hostRefLookup(rememberResolvedThreadRef, entry => entry.threadRef, (entry, threadRef) => ({ ...entry, threadRef }), async (refs) => {
126
+ const result = await resolveThreadRefs({ workspaceId, threadRefs: refs });
127
+ return result.ok ? { ok: true, value: result.value.resolved } : result;
128
+ }, threadRefs);
129
+ /** Resolve one Task ref through the Host and jump to its home Channel Thread. */
130
+ export const jumpToTaskThread = (resolveTaskRefs, workspaceId, taskRef, selectThread) => {
131
+ void resolveTaskRefs({ workspaceId, taskRefs: [taskRef] }).then(result => {
132
+ if (!result.ok)
133
+ return;
134
+ const hit = result.value.resolved[0];
135
+ if (hit !== undefined)
136
+ selectThread(hit.threadRef, hit.channelRef, hit.taskRef, hit.taskNumber);
137
+ });
138
+ };
139
+ /** Resolve one Thread ref through the Host and jump to its home Channel Thread. */
140
+ export const jumpToThread = (resolveThreadRefs, workspaceId, threadRef, selectThread) => {
141
+ void resolveThreadRefs({ workspaceId, threadRefs: [threadRef] }).then(result => {
142
+ if (!result.ok)
143
+ return;
144
+ const hit = result.value.resolved[0];
145
+ if (hit !== undefined)
146
+ selectThread(hit.threadRef, hit.channelRef, hit.taskRef, hit.taskNumber);
147
+ });
148
+ };
149
+ /** Exactly one roster entry whose full key extends the authored spelling; ambiguity resolves to nothing. */
150
+ function uniqueByPrefix(entries, keyOf, authored) {
151
+ const key = refKeyOf(authored);
152
+ const hits = entries.filter(entry => refKeyOf(keyOf(entry)).startsWith(key));
153
+ return hits.length === 1 ? hits[0] : undefined;
154
+ }
155
+ /**
156
+ * Display name for one authored channel ref, or undefined when the loaded
157
+ * roster does not know it — the caller keeps plain text. Archived Channels
158
+ * never resolve: they are gone from every Team surface, so their refs are
159
+ * not links either.
160
+ */
161
+ export const rosterChannelName = (channels, channelRef) => uniqueByPrefix(channels.filter(channel => channel.state === 'active'), channel => channel.channelRef, channelRef)?.name;
162
+ /**
163
+ * Roster facts for one authored member ref, or undefined when nobody on the
164
+ * roster answers to it — the caller keeps plain text. The Human resolves to
165
+ * a handle with no session: informative, never a link.
166
+ */
167
+ export const rosterMember = (members, humanMemberId, humanHandle, memberRef) => {
168
+ if (humanMemberId !== undefined && refKeyOf(memberRef) === refKeyOf(humanMemberId)) {
169
+ return { memberId: humanMemberId, handle: humanHandle, openable: false };
170
+ }
171
+ const hit = uniqueByPrefix(members, status => status.member.memberId, memberRef);
172
+ if (hit === undefined)
173
+ return undefined;
174
+ const openable = hit.availability === 'active';
175
+ return {
176
+ memberId: hit.member.memberId,
177
+ handle: hit.member.handle.replace(/^@/, ''),
178
+ ...(openable ? { sessionId: hit.member.sessionId } : {}),
179
+ openable,
180
+ };
181
+ };
@@ -1,9 +1,10 @@
1
1
  import type { PropsLocale, PropsRuntime } from '@deepseek-ai/dsh-client-ui-slots';
2
- import type { AgentTeamAddMemberRequest, AgentTeamArchiveChannelRequest, AgentTeamArchiveChannelResult, AgentTeamArchiveMemberRequest, AgentTeamArchiveMemberResult, AgentTeamChannelRef, AgentTeamClientMemberStatus, AgentTeamClearMemberContextRequest, AgentTeamClearMemberContextResult, AgentTeamCreateChannelRequest, AgentTeamCreateChannelResult, AgentTeamInbox, AgentTeamInboxRequest, AgentTeamJoinWorkspaceRequest, AgentTeamJoinWorkspaceResult, AgentTeamLeaveWorkspaceRequest, AgentTeamLeaveWorkspaceResult, AgentTeamJoinChannelRequest, AgentTeamJoinChannelResult, AgentTeamGetAttachmentRequest, AgentTeamGetAttachmentResult, AgentTeamPutAttachmentRequest, AgentTeamPutAttachmentResult, AgentTeamMemberResult, AgentTeamRecoverMemberRequest, AgentTeamRecoverMemberResult, AgentTeamMembersRequest, AgentTeamRemoveChannelMemberRequest, AgentTeamRemoveChannelMemberResult, AgentTeamReplyRequest, AgentTeamResolveTaskRefsRequest, AgentTeamResolveTaskRefsResult, AgentTeamReplyResult, AgentTeamConfirmationRequired, AgentTeamThreadHistory, AgentTeamThreadHistoryRequest, AgentTeamThreadObservations, AgentTeamThreadObservationsRequest, AgentTeamThreadReadRequest, AgentTeamThreadReadResult, AgentTeamPromoteThreadRequest, AgentTeamPromoteThreadResult, AgentTeamTaskRequest, AgentTeamTaskResult, AgentTeamSendMessageRequest, AgentTeamSendMessageResult, AgentTeamUpdateChannelRequest, AgentTeamUpdateChannelResult, AgentTeamUpdateMemberRequest, AgentTeamView, AgentTeamViewRequest } from '@wowyuarm/dsh-agent-team/types';
2
+ import type { AgentTeamAddMemberRequest, AgentTeamArchiveChannelRequest, AgentTeamArchiveChannelResult, AgentTeamArchiveMemberRequest, AgentTeamArchiveMemberResult, AgentTeamChannelRef, AgentTeamClientMemberStatus, AgentTeamClearMemberContextRequest, AgentTeamClearMemberContextResult, AgentTeamCreateChannelRequest, AgentTeamCreateChannelResult, AgentTeamInbox, AgentTeamInboxRequest, AgentTeamJoinWorkspaceRequest, AgentTeamJoinWorkspaceResult, AgentTeamLeaveWorkspaceRequest, AgentTeamLeaveWorkspaceResult, AgentTeamJoinChannelRequest, AgentTeamJoinChannelResult, AgentTeamGetAttachmentRequest, AgentTeamGetAttachmentResult, AgentTeamPutAttachmentRequest, AgentTeamPutAttachmentResult, AgentTeamMemberResult, AgentTeamAddMemberResult, AgentTeamRecoverMemberRequest, AgentTeamRecoverMemberResult, AgentTeamMembersRequest, AgentTeamRemoveChannelMemberRequest, AgentTeamRemoveChannelMemberResult, AgentTeamReplyRequest, AgentTeamResolveTaskRefsRequest, AgentTeamResolveTaskRefsResult, AgentTeamResolveThreadRefsRequest, AgentTeamResolveThreadRefsResult, AgentTeamReplyResult, AgentTeamConfirmationRequired, AgentTeamThreadHistory, AgentTeamThreadHistoryRequest, AgentTeamThreadObservations, AgentTeamThreadObservationsRequest, AgentTeamThreadReadRequest, AgentTeamThreadReadResult, AgentTeamPromoteThreadRequest, AgentTeamPromoteThreadResult, AgentTeamTaskRequest, AgentTeamTaskResult, AgentTeamSendMessageRequest, AgentTeamSendMessageResult, AgentTeamUpdateChannelRequest, AgentTeamUpdateChannelResult, AgentTeamUpdateMemberRequest, AgentTeamView, AgentTeamViewRequest } from '@wowyuarm/dsh-agent-team/types';
3
3
  import type { RemoteResult } from '@deepseek-ai/dsh-typert-protocol';
4
4
  import type { TeamNavigationActions, TeamNavigationSnapshot } from './navigation.ts';
5
5
  import type { TeamChangeListener, TeamChangeScope } from './team-changes.ts';
6
6
  import type { TeamDraftStore } from './drafts.ts';
7
+ import type { TeamHumanIdentitySource } from './human-identity.ts';
7
8
  export interface TeamNavigationSource {
8
9
  getSnapshot: () => TeamNavigationSnapshot;
9
10
  subscribe: (listener: () => void) => () => void;
@@ -47,7 +48,7 @@ export type TeamSidebarProps = PropsRuntime<'sidebar.workspaces'> & PropsLocale<
47
48
  /** Fired after every committed durable Thread read; the badge refreshes without waiting for a changes wake. */
48
49
  subscribeReads: (listener: () => void) => () => void;
49
50
  subscribeChanges: SubscribeTeamChanges;
50
- addMember: (request: AgentTeamAddMemberRequest) => Promise<RemoteResult<AgentTeamMemberResult>>;
51
+ addMember: (request: AgentTeamAddMemberRequest) => Promise<RemoteResult<AgentTeamAddMemberResult>>;
51
52
  loadChannels: (request: AgentTeamViewRequest) => Promise<RemoteResult<AgentTeamView>>;
52
53
  createChannel: (request: AgentTeamCreateChannelRequest) => Promise<RemoteResult<AgentTeamCreateChannelResult>>;
53
54
  updateChannel: (request: AgentTeamUpdateChannelRequest) => Promise<RemoteResult<AgentTeamUpdateChannelResult>>;
@@ -75,6 +76,8 @@ export type TeamConversationProps = PropsRuntime<'main'> & PropsLocale<'team'> &
75
76
  navigation: TeamNavigationSource;
76
77
  /** Keyed composer draft cache; one store per Client context. */
77
78
  drafts: TeamDraftStore;
79
+ /** The Human's own identity: the display name and avatar every seat that names or draws them reads. */
80
+ humanIdentity: TeamHumanIdentitySource;
78
81
  loadChannels: (request: AgentTeamViewRequest) => Promise<RemoteResult<AgentTeamView>>;
79
82
  readThread: (request: AgentTeamThreadReadRequest) => Promise<RemoteResult<AgentTeamThreadReadResult>>;
80
83
  loadThreadHistory: (request: AgentTeamThreadHistoryRequest) => Promise<RemoteResult<AgentTeamThreadHistory>>;
@@ -88,11 +91,14 @@ export type TeamConversationProps = PropsRuntime<'main'> & PropsLocale<'team'> &
88
91
  changeTask: (request: AgentTeamTaskRequest) => Promise<RemoteResult<AgentTeamTaskResult>>;
89
92
  promoteThread: (request: AgentTeamPromoteThreadRequest) => Promise<RemoteResult<AgentTeamPromoteThreadResult>>;
90
93
  resolveTaskRefs: (request: AgentTeamResolveTaskRefsRequest) => Promise<RemoteResult<AgentTeamResolveTaskRefsResult>>;
94
+ resolveThreadRefs: (request: AgentTeamResolveThreadRefsRequest) => Promise<RemoteResult<AgentTeamResolveThreadRefsResult>>;
91
95
  loadMembers: (request: AgentTeamMembersRequest) => Promise<RemoteResult<readonly AgentTeamClientMemberStatus[]>>;
92
96
  /** Human direct-only Inbox slice; the Inbox page merges one call per visible Workspace. */
93
97
  loadInbox: (request: AgentTeamInboxRequest) => Promise<RemoteResult<AgentTeamInbox>>;
94
98
  /** Human-only Thread Attention observations; the Thread composer ranks the returned followers first. */
95
99
  threadObservations: (request: AgentTeamThreadObservationsRequest) => Promise<RemoteResult<AgentTeamThreadObservations>>;
100
+ /** Agent-card session jump, shared by every slot; message member chips reuse it. */
101
+ openMemberSession: (sessionId: AgentTeamClientMemberStatus['member']['sessionId']) => void;
96
102
  };
97
103
  export type TeamSettingsProps = PropsRuntime<'sidebar.settings'> & PropsLocale<'team'> & {
98
104
  loadMemberGroups: () => Promise<readonly TeamMemberGroup[]>;
@@ -1 +1 @@
1
- {"version":3,"file":"slots.d.ts","sourceRoot":"","sources":["../../../src/client/slots.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,kCAAkC,CAAA;AACjF,OAAO,KAAK,EACV,yBAAyB,EACzB,8BAA8B,EAC9B,6BAA6B,EAC7B,6BAA6B,EAC7B,4BAA4B,EAC5B,mBAAmB,EACnB,2BAA2B,EAC3B,kCAAkC,EAClC,iCAAiC,EACjC,6BAA6B,EAC7B,4BAA4B,EAC5B,cAAc,EACd,qBAAqB,EACrB,6BAA6B,EAC7B,4BAA4B,EAC5B,8BAA8B,EAC9B,6BAA6B,EAC7B,2BAA2B,EAC3B,0BAA0B,EAC1B,6BAA6B,EAC7B,4BAA4B,EAC5B,6BAA6B,EAC7B,4BAA4B,EAC5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C,KAAK,OAAO,CAAC,YAAY,CAAC,gCAAgC,CAAC,CAAC,CAAA;IAC1H,WAAW,EAAE,CAAC,OAAO,EAAE,uBAAuB,KAAK,OAAO,CAAC,YAAY,CAAC,SAAS,2BAA2B,EAAE,CAAC,CAAC,CAAA;IAChH,2FAA2F;IAC3F,SAAS,EAAE,CAAC,OAAO,EAAE,qBAAqB,KAAK,OAAO,CAAC,YAAY,CAAC,cAAc,CAAC,CAAC,CAAA;IACpF,wGAAwG;IACxG,kBAAkB,EAAE,CAAC,OAAO,EAAE,kCAAkC,KAAK,OAAO,CAAC,YAAY,CAAC,2BAA2B,CAAC,CAAC,CAAA;IACvH,oFAAoF;IACpF,iBAAiB,EAAE,CAAC,SAAS,EAAE,2BAA2B,CAAC,QAAQ,CAAC,CAAC,WAAW,CAAC,KAAK,IAAI,CAAA;CAC3F,CAAA;AAED,MAAM,MAAM,iBAAiB,GAAG,YAAY,CAAC,kBAAkB,CAAC,GAAG,WAAW,CAAC,MAAM,CAAC,GAAG;IACvF,gBAAgB,EAAE,MAAM,OAAO,CAAC,SAAS,eAAe,EAAE,CAAC,CAAA;CAC5D,CAAA;AAED,MAAM,WAAW,eAAe;IAC9B,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAA;IAC5B,QAAQ,CAAC,cAAc,EAAE,MAAM,CAAA;IAC/B,QAAQ,CAAC,OAAO,EAAE,SAAS,2BAA2B,EAAE,CAAA;CACzD;AAED,MAAM,MAAM,eAAe,GAAG,YAAY,CAAC,uBAAuB,CAAC,GAAG,WAAW,CAAC,MAAM,CAAC,GAAG,qBAAqB,GAAG;IAClH,UAAU,EAAE,oBAAoB,CAAA;CACjC,CAAA"}
@@ -1,8 +1,27 @@
1
- import type { AgentTeamActivity, AgentTeamClaim, AgentTeamClientMemberStatus, AgentTeamMemberId, AgentTeamTask, AgentTeamTaskRef } from '@wowyuarm/dsh-agent-team/types';
1
+ import type { AgentTeamActivity, AgentTeamClaim, AgentTeamClientMemberStatus, AgentTeamMemberId, AgentTeamTask, AgentTeamTaskRef, AgentTeamThreadRef } from '@wowyuarm/dsh-agent-team/types';
2
+ import type { TeamKey } from './locales.ts';
2
3
  import type { TeamConversationProps } from './slots.ts';
3
4
  import type { TeamStateDotState } from './TeamStateDot.tsx';
4
5
  export declare function formatTaskStatus(status: AgentTeamTask['status'], t: TeamConversationProps['t']): string;
5
6
  export declare function formatClaimState(state: AgentTeamClaim['state'], t: TeamConversationProps['t']): string;
7
+ /**
8
+ * The two localized halves of one runtime-risk statement: the class label names
9
+ * what kind of problem this is, and the sentence key states it of the Member
10
+ * (it keeps its `{member}` placeholder so the caller supplies the handle). The
11
+ * Host's own diagnostic stays English and belongs in the row's title, so the
12
+ * visible line reads in the interface language.
13
+ */
14
+ export declare function formatRiskClass(status: Pick<AgentTeamClientMemberStatus, 'diagnostic'>, t: TeamConversationProps['t']): {
15
+ readonly label: string;
16
+ readonly sentenceKey: TeamKey;
17
+ };
18
+ /**
19
+ * The first sentence of a Host diagnostic: risk rows read one line, and the
20
+ * Host writes the reason as its first sentence with recovery context after it.
21
+ * A terminator the Host used mid-sentence becomes a full stop so the clamped
22
+ * line reads as a sentence; the untouched text stays in the row's title.
23
+ */
24
+ export declare function firstSentence(detail: string): string;
6
25
  /**
7
26
  * Status indicator for a Task status, the dot every Task surface renders.
8
27
  * Active states map to StateDot variants; every status renders a dot so they
@@ -17,7 +36,7 @@ export declare function memberHue(memberId: string): number;
17
36
  /** One branded-ref occurrence inside a literal body segment. */
18
37
  export interface RefSegment {
19
38
  readonly text: string;
20
- /** The full `task:`/`channel:`/`thread:` ref when this segment is a link. */
39
+ /** The full `task:`/`channel:`/`thread:`/`member:` ref when this segment is a link. */
21
40
  readonly ref?: string;
22
41
  }
23
42
  /**
@@ -41,15 +60,32 @@ export interface MentionSegment {
41
60
  /** Canonical handle of the mentioned Member; present only on mention segments. */
42
61
  readonly name?: string;
43
62
  }
63
+ /** The Human's handle before they could rename themselves; the Host keeps it as an alias. */
64
+ export declare const HUMAN_HISTORIC_HANDLE = "human";
65
+ /**
66
+ * One mentioned Member as a Message renders them: the display name the seat
67
+ * prints, plus every older handle that still addresses the same person. A
68
+ * rename must not orphan the mentions written before it — the bodies say
69
+ * `@human`, the roster says the new name, and both are the Human.
70
+ */
71
+ export type MentionHandle = string | {
72
+ readonly name: string;
73
+ readonly also: readonly string[];
74
+ };
75
+ /** The printed name of one mention entry; its aliases follow that name, never the body. */
76
+ export declare function mentionNameOf(mention: MentionHandle): string;
44
77
  /**
45
78
  * Locate one Message's delivered mention names inside its literal body. Matching
46
79
  * is the shared Host delivery scan — an authored `@`, case-insensitive on Unicode
47
80
  * word boundaries, longest handle first, code quoted rather than called — so a chip
48
- * never lands where delivery would not reach. Mention segments render the canonical
49
- * `@Handle`; names absent from the body come back unmatched so the consumer can
50
- * append them as a fallback chip row.
81
+ * never lands where delivery would not reach. A chip names the person by their
82
+ * current name, the way member refs do: a body that wrote an older handle of a
83
+ * renamed Human chips as the name they answer to today. A person whose entry
84
+ * matched through any of their handles counts as matched, so the fallback row
85
+ * never repeats someone already chipped inline; names absent from the body come
86
+ * back unmatched so the consumer can append them as a fallback chip row.
51
87
  */
52
- export declare function splitMentionNames(text: string, names: readonly string[]): {
88
+ export declare function splitMentionNames(text: string, mentions: readonly MentionHandle[]): {
53
89
  segments: MentionSegment[];
54
90
  unmatched: readonly string[];
55
91
  };
@@ -80,8 +116,18 @@ export declare function allMentionMembers(members: readonly AgentTeamClientMembe
80
116
  * rather than the prose the Host reads.
81
117
  */
82
118
  export declare function mentionedMemberIds(body: string, members: readonly AgentTeamClientMemberStatus[]): readonly AgentTeamMemberId[];
83
- /** Canonical chip handles for one Message's structured mention refs. */
84
- export declare function mentionNamesOf(mentions: readonly AgentTeamMemberId[], handles: ReadonlyMap<AgentTeamMemberId, string>): string[];
119
+ /**
120
+ * Canonical chip handles for one Message's structured mention refs. The Human
121
+ * is Team authority, not an Agent projection, so `members()` does not include
122
+ * it: the caller hands over the profile name every seat names them by, so a
123
+ * rename reaches old mention chips the same way it reaches the roster.
124
+ *
125
+ * A renamed Human also keeps the historic `human` handle, because the Host
126
+ * accepts it as an alias and Message bodies written before the rename say
127
+ * exactly that: without the alias those mentions would stop chipping inline and
128
+ * reappear as a trailing chip under a name the body never used.
129
+ */
130
+ export declare function mentionNamesOf(mentions: readonly AgentTeamMemberId[], handles: ReadonlyMap<AgentTeamMemberId, string>, humanName: string): MentionHandle[];
85
131
  /** Accessible label for one "who is on this work" stack: its owners' handles, comma-separated. */
86
132
  export declare function claimersLabel(owners: ReadonlyArray<{
87
133
  readonly name: string;
@@ -145,6 +191,8 @@ export interface PlannedMessageBody {
145
191
  readonly fallbackRefs: readonly string[];
146
192
  /** Task refs authored in a literal body; resolved labels replace them in place. */
147
193
  readonly taskRefs: readonly AgentTeamTaskRef[];
194
+ /** Thread refs authored in a literal body; resolved titles replace them in place. */
195
+ readonly threadRefs: readonly AgentTeamThreadRef[];
148
196
  }
149
197
  /**
150
198
  * Decide how one Message body renders. Human input and plain-prose Agent
@@ -156,7 +204,7 @@ export interface PlannedMessageBody {
156
204
  */
157
205
  export declare function planMessageBody(body: string, options: {
158
206
  readonly human: boolean;
159
- readonly mentionNames?: readonly string[];
207
+ readonly mentionNames?: readonly MentionHandle[];
160
208
  readonly canOpenRefs: boolean;
161
209
  }): PlannedMessageBody;
162
210
  //# sourceMappingURL=team-formatters.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"team-formatters.d.ts","sourceRoot":"","sources":["../../../src/client/team-formatters.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,cAAc,EAAE,2BAA2B,EAAE,iBAAiB,EAAE,aAAa,EAAE,gBAAgB,EAAE,MAAM,gCAAgC,CAAA;AAExK,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,YAAY,CAAA;AACvD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAA;AAE3D,wBAAgB,gBAAgB,CAAC,MAA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,kBAAkB,CAgCrB"}
@@ -15,6 +15,40 @@ export function formatClaimState(state, t) {
15
15
  released: 'claimStateReleased',
16
16
  }[state]);
17
17
  }
18
+ const RISK_CLASS_KEYS = {
19
+ 'session-refused': ['riskClassSessionRefused', 'riskSessionRefused'],
20
+ 'session-unreadable': ['riskClassSessionUnreadable', 'riskSessionUnreadable'],
21
+ 'preset-composition': ['riskClassPresetComposition', 'riskPresetComposition'],
22
+ 'rollover': ['riskClassRollover', 'riskRollover'],
23
+ 'runtime': ['riskClassRuntime', 'riskRuntime'],
24
+ 'activation': ['riskClassActivation', 'riskActivation'],
25
+ };
26
+ /**
27
+ * The two localized halves of one runtime-risk statement: the class label names
28
+ * what kind of problem this is, and the sentence key states it of the Member
29
+ * (it keeps its `{member}` placeholder so the caller supplies the handle). The
30
+ * Host's own diagnostic stays English and belongs in the row's title, so the
31
+ * visible line reads in the interface language.
32
+ */
33
+ export function formatRiskClass(status, t) {
34
+ const [labelKey, sentenceKey] = RISK_CLASS_KEYS[status.diagnostic?.class ?? 'runtime'];
35
+ return { label: t(labelKey), sentenceKey };
36
+ }
37
+ /**
38
+ * The first sentence of a Host diagnostic: risk rows read one line, and the
39
+ * Host writes the reason as its first sentence with recovery context after it.
40
+ * A terminator the Host used mid-sentence becomes a full stop so the clamped
41
+ * line reads as a sentence; the untouched text stays in the row's title.
42
+ */
43
+ export function firstSentence(detail) {
44
+ const trimmed = detail.trim();
45
+ const end = trimmed.search(/[.。;;]/);
46
+ if (end === -1)
47
+ return trimmed;
48
+ // A terminator that already ends a sentence stays; a separator the Host used
49
+ // mid-sentence becomes a full stop.
50
+ return trimmed[end] === '.' || trimmed[end] === '。' ? trimmed.slice(0, end + 1) : `${trimmed.slice(0, end)}.`;
51
+ }
18
52
  /**
19
53
  * Status indicator for a Task status, the dot every Task surface renders.
20
54
  * Active states map to StateDot variants; every status renders a dot so they
@@ -38,8 +72,9 @@ export function memberHue(memberId) {
38
72
  }
39
73
  // Full UUIDs and abbreviated forms (prefix plus the first 6+ hex chars, with
40
74
  // or without the original hyphens) both match; resolution decides whether an
41
- // abbreviation is real, so unresolvable matches stay plain text.
42
- const BRANDED_REF_PATTERN = /\b(task|channel|thread):{1,2}[0-9a-f]{6,}(?:-[0-9a-f]{1,})*\b/gi;
75
+ // abbreviation is real, so unresolvable matches stay plain text. Member refs
76
+ // match the same shape; the roster map decides whether one names a member.
77
+ const BRANDED_REF_PATTERN = /\b(task|channel|thread|member):{1,2}[0-9a-f]{6,}(?:-[0-9a-f]{1,})*\b/gi;
43
78
  /**
44
79
  * Canonical form of one matched ref: models occasionally double the colon or
45
80
  * uppercase the UUID when citing a ref in prose, while Host lookups and
@@ -82,30 +117,50 @@ export function isSingleBrandedRef(text) {
82
117
  const matches = [...trimmed.matchAll(BRANDED_REF_PATTERN)];
83
118
  return matches.length === 1 && matches[0][0] === trimmed;
84
119
  }
120
+ /** The Human's handle before they could rename themselves; the Host keeps it as an alias. */
121
+ export const HUMAN_HISTORIC_HANDLE = 'human';
122
+ /** Normalize one mention entry into its printed name and every handle that matches it. */
123
+ function mentionHandlesOf(mention) {
124
+ return typeof mention === 'string' ? { name: mention, handles: [mention] } : { name: mention.name, handles: [mention.name, ...mention.also] };
125
+ }
126
+ /** The printed name of one mention entry; its aliases follow that name, never the body. */
127
+ export function mentionNameOf(mention) {
128
+ return typeof mention === 'string' ? mention : mention.name;
129
+ }
85
130
  /**
86
131
  * Locate one Message's delivered mention names inside its literal body. Matching
87
132
  * is the shared Host delivery scan — an authored `@`, case-insensitive on Unicode
88
133
  * word boundaries, longest handle first, code quoted rather than called — so a chip
89
- * never lands where delivery would not reach. Mention segments render the canonical
90
- * `@Handle`; names absent from the body come back unmatched so the consumer can
91
- * append them as a fallback chip row.
134
+ * never lands where delivery would not reach. A chip names the person by their
135
+ * current name, the way member refs do: a body that wrote an older handle of a
136
+ * renamed Human chips as the name they answer to today. A person whose entry
137
+ * matched through any of their handles counts as matched, so the fallback row
138
+ * never repeats someone already chipped inline; names absent from the body come
139
+ * back unmatched so the consumer can append them as a fallback chip row.
92
140
  */
93
- export function splitMentionNames(text, names) {
94
- if (names.length === 0)
141
+ export function splitMentionNames(text, mentions) {
142
+ if (mentions.length === 0)
95
143
  return { segments: [{ text, mention: false }], unmatched: [] };
144
+ const entries = mentions.map(mentionHandlesOf);
96
145
  const segments = [];
97
146
  const matched = new Set();
98
147
  let cursor = 0;
99
- for (const match of scanBodyHandles(text, names)) {
148
+ for (const match of scanBodyHandles(text, entries.flatMap(entry => entry.handles))) {
100
149
  if (match.start > cursor)
101
150
  segments.push({ text: text.slice(cursor, match.start), mention: false });
102
- segments.push({ text: `@${match.handle}`, mention: true, name: match.handle });
103
- matched.add(match.handle.toLowerCase());
151
+ const handle = match.handle.toLowerCase();
152
+ const owner = entries.find(entry => entry.handles.some(candidate => candidate.toLowerCase() === handle));
153
+ // The scan hands back the entry's own spelling; only an entry matched
154
+ // through another handle prints the name it answers to today.
155
+ const printed = owner === undefined || owner.name.toLowerCase() === handle ? match.handle : owner.name;
156
+ segments.push({ text: `@${printed}`, mention: true, name: printed });
157
+ if (owner !== undefined)
158
+ matched.add(owner.name.toLowerCase());
104
159
  cursor = match.end;
105
160
  }
106
161
  if (cursor < text.length)
107
162
  segments.push({ text: text.slice(cursor), mention: false });
108
- return { segments, unmatched: names.filter(name => !matched.has(name.toLowerCase())) };
163
+ return { segments, unmatched: entries.map(entry => entry.name).filter(name => !matched.has(name.toLowerCase())) };
109
164
  }
110
165
  /**
111
166
  * Whether one draft spells a handle as an authored `@mention`: the shared
@@ -150,12 +205,22 @@ export function mentionedMemberIds(body, members) {
150
205
  // delivery would.
151
206
  return resolveBodyMentions(body, candidates, 'member:human').memberIds;
152
207
  }
153
- /** Canonical chip handles for one Message's structured mention refs. */
154
- export function mentionNamesOf(mentions, handles) {
208
+ /**
209
+ * Canonical chip handles for one Message's structured mention refs. The Human
210
+ * is Team authority, not an Agent projection, so `members()` does not include
211
+ * it: the caller hands over the profile name every seat names them by, so a
212
+ * rename reaches old mention chips the same way it reaches the roster.
213
+ *
214
+ * A renamed Human also keeps the historic `human` handle, because the Host
215
+ * accepts it as an alias and Message bodies written before the rename say
216
+ * exactly that: without the alias those mentions would stop chipping inline and
217
+ * reappear as a trailing chip under a name the body never used.
218
+ */
219
+ export function mentionNamesOf(mentions, handles, humanName) {
155
220
  return mentions
156
- // The Human is Team authority, not an Agent projection, so `members()` does
157
- // not include it. Keep its stable public handle available for rendering.
158
- .map(memberId => memberId === 'member:human' ? 'human' : handles.get(memberId))
221
+ .map((memberId) => memberId === 'member:human'
222
+ ? (humanName.toLowerCase() === HUMAN_HISTORIC_HANDLE ? humanName : { name: humanName, also: [HUMAN_HISTORIC_HANDLE] })
223
+ : handles.get(memberId))
159
224
  .filter((name) => name !== undefined);
160
225
  }
161
226
  /** Accessible label for one "who is on this work" stack: its owners' handles, comma-separated. */
@@ -283,7 +348,7 @@ export function planMessageBody(body, options) {
283
348
  const fallbackNames = inline !== undefined ? inline.unmatched
284
349
  : richAgentBody && options.canOpenRefs && options.mentionNames !== undefined
285
350
  ? splitMentionNames(displayBody, options.mentionNames).unmatched
286
- : options.mentionNames ?? [];
351
+ : (options.mentionNames ?? []).map(mentionNameOf);
287
352
  const refs = splitBrandedRefs(displayBody).flatMap(segment => segment.ref === undefined ? [] : [segment.ref]);
288
353
  const render = inline !== undefined ? 'inline'
289
354
  : options.human || (options.canOpenRefs && !richAgentBody && refs.length > 0) ? 'literal'
@@ -301,5 +366,8 @@ export function planMessageBody(body, options) {
301
366
  taskRefs: options.canOpenRefs && !richAgentBody
302
367
  ? refs.filter(ref => ref.startsWith('task:')).map(ref => ref)
303
368
  : [],
369
+ threadRefs: options.canOpenRefs && !richAgentBody
370
+ ? refs.filter(ref => ref.startsWith('thread:')).map(ref => ref)
371
+ : [],
304
372
  };
305
373
  }
@@ -13,7 +13,7 @@ Model-facing tools for Agent Team Members. The package registers tools in the ca
13
13
  - `team_view` is the address book: bounded, membership-authorized Channel, top-level Thread, and Member summaries — current addresses, not a work queue. Threads are the sole paginated catalog: newest-first rows carrying threadRef, Channel ref, a bounded anchor subject, and Task standing inline (never a second Task index, never revision or message count). The cursor pages Thread rows only; continuation pages render Threads alone, and paging reaches every authorized top-level Thread, including taskless and off-page taskful ones.
14
14
  - `context_rollover` schedules one rollover of the calling Member into a fresh context. The tool validates the bounded private `handoff` (plus optional `relatedFiles`, or a `checkpointRef` to return to a recorded checkpoint instead) against the Host, concludes the turn, and returns `status: 'scheduled'`; the Host performs the actual swap only after the successful tool result is durably appended. The `checkpointRef` copy is hardened on both the tool and parameter descriptions: omit it for ordinary generation changes and pressure-driven handoffs, and supply it only when citing the exact ref a `context_timeline` result listed as restorable — never a synthesized or guessed one. A `checkpointRef` that cannot succeed now — fabricated, unresolved, unattributable, nonshrinking, unmeasurable, over-budget, or blocked by multiple active Claims — rejects as a model-visible error result instead of a fake `scheduled`; the mutable guards (jobs, route limits) are revalidated at the swap seam, and a seam failure leaves the Member recoverable through a later-turn fresh rollover. `context_rollover` and `context_checkpoint` both conclude the Agent turn.
15
15
  - `context_checkpoint` records one named checkpoint of the calling Member's current context. The durable checkpoint is the successful `tool/call`+`tool/result` pair the Session projection folds; the returned ref is deterministic from the Member Session identity plus the tool call id. It performs no lifecycle side effect in the tool body and concludes the turn: a checkpoint resolves at its containing turn's end, so the model records it as its final action of a completed unit of work.
16
- - `context_timeline` returns one bounded structural view of the Member's context generations across the current Session and its archived ancestor lineage: recorded checkpoints and handoff/Team/compaction boundaries, with restorability reasons where a return cannot be proven safe. Structural only — no transcript content. A fresh `context_rollover` never requires consulting the timeline first.
16
+ - `context_timeline` returns one bounded structural view of the Member's context generations across the current Session and its archived ancestor lineage: recorded checkpoints and handoff/Team/compaction boundaries, with restorability reasons where a return cannot be proven safe. A Team boundary is offered exactly when the retained prefix through it stays inside one Thread and the return would shrink the working set below the handoff budget. Each row carries a short stable `anchor` id, a digest of that row's own ref, so rows that share a name and a price stay distinguishable — it is not a ref, and only the `checkpointRef` printed on a restorable row is citable. Structural only — no transcript content. A fresh `context_rollover` never requires consulting the timeline first.
17
17
 
18
18
  Mentions are authored in the Message body, as `@Handle` (the `@` is required, matching ignores case, and `@all` reaches the Channel); there is no recipient parameter. An Agent cannot silently enroll an uninvited Member: naming one this Thread has never carried commits the Message, delivers nothing to that Member, and reports them as undelivered. Human confirmation is a separate Host/Client flow. Closed Tasks reject replies, Claims, and new Attention until a Human reopens them; taskless Threads have no Claim or Task-resolution mutation path.
19
19
 
@@ -13,7 +13,7 @@
13
13
  - `team_view` 是 address book:有界、按 membership 授权的 Channel、顶层 Thread 与 Member 摘要——是当前的地址簿,不是工作队列。Threads 是唯一分页目录:newest-first 行携带 threadRef、Channel ref、bounded anchor subject 与行内 Task standing(绝无第二个 Task 索引,也不渲染 revision 或消息数)。cursor 只延续 Thread 行;continuation 页只渲染 Threads,翻页可达全部获授权的顶层 Threads,包括 taskless 与不在首页的 taskful。
14
14
  - `context_rollover` 为调用方 Member 安排一次进入全新上下文的 rollover。工具向 Host 校验有界的私有 `handoff`(及可选 `relatedFiles`;传入 `checkpointRef` 则改为回返到已记录的 checkpoint),结束当前 turn 并返回 `status: 'scheduled'`;Host 只在成功的 tool result 持久落盘后才执行真正的换窗。`checkpointRef` 在工具与参数两级 description 上做了 copy hardening:普通续代与压力换窗必须省略,只有引用 `context_timeline` 结果中列为 restorable 的精确 ref 时才提供——绝不合成或猜测。当下不可能成功的 `checkpointRef`——伪造、未 resolve、无法归属、不缩减、不可测量、超预算或被多个 active Claim 阻塞——以 model-visible 的 error result 拒绝,而不是返回假 `scheduled`;可变 guards(jobs、route limits)在换窗 seam 复查,seam 失败后 Member 仍可通过后续 turn 的显式 fresh rollover 恢复。`context_rollover` 与 `context_checkpoint` 都会结束 Agent turn(换窗后不得再接旧代工作;checkpoint 在其所属 turn 结束时 resolve)。
15
15
  - `context_checkpoint` 为调用的 Member 记录一个命名的当前上下文 checkpoint。durable checkpoint 就是 Session projection 折叠的成功 `tool/call`+`tool/result` 对;返回的 ref 由 Member Session 身份加 tool call id 确定性派生。工具体不做 lifecycle 副作用,但会结束 turn:checkpoint 在其所属 turn 结束时 resolve,因此模型把它作为一个完整工作单元的最后动作来记录。
16
- - `context_timeline` 返回该 Member 跨当前 Session 与已归档祖先 lineage 的上下文代际有界结构视图:已记录的 checkpoints 与 handoff/Team/compaction 边界,无法证明可安全回返的条目携带拒绝原因。仅结构信息——不含任何 transcript 正文。fresh 的 `context_rollover` 从不需要先查 timeline。
16
+ - `context_timeline` 返回该 Member 跨当前 Session 与已归档祖先 lineage 的上下文代际有界结构视图:已记录的 checkpoints 与 handoff/Team/compaction 边界,无法证明可安全回返的条目携带拒绝原因。Team 边界只有在「经它保留的前缀仍停留在单一 Thread 内」且回返能把工作集缩到 handoff 预算之下时才会被提供。每一行附一个短的稳定 `anchor` id(该行自身 ref 的摘要),使名称与价格相同的行仍可区分——它不是 ref,只有 restorable 行上打印的 `checkpointRef` 可被引用。仅结构信息——不含任何 transcript 正文。fresh 的 `context_rollover` 从不需要先查 timeline。
17
17
 
18
18
  mention 在 Message 正文里撰写,形如 `@Handle`(`@` 必需、大小写不敏感,`@all` 触达整个 Channel);不存在收件人参数。Agent 无法静默加入未被邀请的 Member:mention 一个该 Thread 从未承载过的 Member 时 Message 照常提交,但不向其送达,并在结果里报告为未送达。Human confirmation 属于单独的 Host/Client 流程。Closed Task 在 Human reopen 前拒绝 reply、Claim 和新的 Attention;taskless Thread 没有 Claim 或 Task resolution mutation path。
19
19