@wowyuarm/dsh-agent-team 0.1.8 → 0.1.9

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 (66) hide show
  1. package/package.json +2 -1
  2. package/packages/agent-team/README.md +5 -3
  3. package/packages/agent-team/README.zh.md +5 -3
  4. package/packages/agent-team/lib/attachments.js +14 -4
  5. package/packages/agent-team/lib/context-management.js +379 -0
  6. package/packages/agent-team/lib/context-projection.js +574 -0
  7. package/packages/agent-team/lib/context-source.js +72 -0
  8. package/packages/agent-team/lib/index.js +1208 -62
  9. package/packages/agent-team/lib/ledger.js +222 -14
  10. package/packages/agent-team/lib/member-context.js +6 -2
  11. package/packages/agent-team/lib/member-runtime.js +159 -4
  12. package/packages/agent-team/lib/pressure-policy.js +200 -0
  13. package/packages/agent-team/lib/spec.js +18 -0
  14. package/packages/agent-team/lib/typert.host.js +122 -41
  15. package/packages/agent-team/lib/typert.remote-client.d.ts.map +1 -1
  16. package/packages/agent-team/lib/typert.remote-client.js +38 -25
  17. package/packages/agent-team/lib/types/attachments.d.ts +1 -1
  18. package/packages/agent-team/lib/types/attachments.d.ts.map +1 -1
  19. package/packages/agent-team/lib/types/context-management.d.ts +142 -0
  20. package/packages/agent-team/lib/types/context-management.d.ts.map +1 -0
  21. package/packages/agent-team/lib/types/context-projection.d.ts +219 -0
  22. package/packages/agent-team/lib/types/context-projection.d.ts.map +1 -0
  23. package/packages/agent-team/lib/types/context-source.d.ts +83 -0
  24. package/packages/agent-team/lib/types/context-source.d.ts.map +1 -0
  25. package/packages/agent-team/lib/types/index.d.ts +275 -2
  26. package/packages/agent-team/lib/types/index.d.ts.map +1 -1
  27. package/packages/agent-team/lib/types/ledger.d.ts +94 -6
  28. package/packages/agent-team/lib/types/ledger.d.ts.map +1 -1
  29. package/packages/agent-team/lib/types/member-context.d.ts.map +1 -1
  30. package/packages/agent-team/lib/types/member-runtime.d.ts +30 -2
  31. package/packages/agent-team/lib/types/member-runtime.d.ts.map +1 -1
  32. package/packages/agent-team/lib/types/pressure-policy.d.ts +106 -0
  33. package/packages/agent-team/lib/types/pressure-policy.d.ts.map +1 -0
  34. package/packages/agent-team/lib/types/spec.d.ts.map +1 -1
  35. package/packages/agent-team/lib/types/types/entities.d.ts +14 -1
  36. package/packages/agent-team/lib/types/types/entities.d.ts.map +1 -1
  37. package/packages/agent-team/lib/types/types/operations.d.ts +38 -3
  38. package/packages/agent-team/lib/types/types/operations.d.ts.map +1 -1
  39. package/packages/agent-team/lib/types/types/requests-results.d.ts +52 -1
  40. package/packages/agent-team/lib/types/types/requests-results.d.ts.map +1 -1
  41. package/packages/agent-team/preset/team-member/agent.cordis.yml +9 -1
  42. package/packages/client-agent-team/lib/client.js +314 -323
  43. package/packages/client-agent-team/lib/client.js.map +1 -1
  44. package/packages/client-agent-team/lib/types/client/TeamAgentsPanel.d.ts +1 -2
  45. package/packages/client-agent-team/lib/types/client/TeamAgentsPanel.d.ts.map +1 -1
  46. package/packages/client-agent-team/lib/types/client/TeamAgentsPanel.js +61 -41
  47. package/packages/client-agent-team/lib/types/client/TeamWorkspaceBrowser.d.ts +1 -1
  48. package/packages/client-agent-team/lib/types/client/TeamWorkspaceBrowser.d.ts.map +1 -1
  49. package/packages/client-agent-team/lib/types/client/TeamWorkspaceBrowser.js +2 -2
  50. package/packages/client-agent-team/lib/types/client/index.d.ts.map +1 -1
  51. package/packages/client-agent-team/lib/types/client/index.js +34 -11
  52. package/packages/client-agent-team/lib/types/client/locales.d.ts +0 -14
  53. package/packages/client-agent-team/lib/types/client/locales.d.ts.map +1 -1
  54. package/packages/client-agent-team/lib/types/client/locales.js +0 -14
  55. package/packages/client-agent-team/lib/types/client/slots.d.ts +5 -0
  56. package/packages/client-agent-team/lib/types/client/slots.d.ts.map +1 -1
  57. package/packages/tool-agent-team/README.md +8 -5
  58. package/packages/tool-agent-team/README.zh.md +8 -5
  59. package/packages/tool-agent-team/lib/context-tools.js +179 -0
  60. package/packages/tool-agent-team/lib/index.js +135 -16
  61. package/packages/tool-agent-team/lib/types/context-tools.d.ts +16 -0
  62. package/packages/tool-agent-team/lib/types/context-tools.d.ts.map +1 -0
  63. package/packages/tool-agent-team/lib/types/index.d.ts.map +1 -1
  64. package/packages/agent-team/lib/auto-compaction.js +0 -201
  65. package/packages/agent-team/lib/types/auto-compaction.d.ts +0 -47
  66. package/packages/agent-team/lib/types/auto-compaction.d.ts.map +0 -1
@@ -8,7 +8,6 @@ interface TeamAgentsPanelProps {
8
8
  readonly addMember: TeamSidebarProps['addMember'];
9
9
  readonly updateMember: TeamSidebarProps['updateMember'];
10
10
  readonly recoverMember: TeamSidebarProps['recoverMember'];
11
- readonly clearMemberContext: TeamSidebarProps['clearMemberContext'];
12
11
  readonly archiveMember: TeamSidebarProps['archiveMember'];
13
12
  readonly loadModels: TeamSidebarProps['loadModels'];
14
13
  /** The Member Session currently embedded in the conversation seat, if any. */
@@ -17,6 +16,6 @@ interface TeamAgentsPanelProps {
17
16
  readonly onCreatingChange: (request: AgentTeamAddMemberRequest, creating: boolean) => void;
18
17
  readonly t: TeamSidebarProps['t'];
19
18
  }
20
- export declare function TeamAgentsPanel({ workspaceId, loadMembers, subscribeChanges, addMember, updateMember, recoverMember, clearMemberContext, archiveMember, loadModels, memberSessionId, openMemberSession, onCreatingChange, t }: TeamAgentsPanelProps): import("react").JSX.Element;
19
+ export declare function TeamAgentsPanel({ workspaceId, loadMembers, subscribeChanges, addMember, updateMember, recoverMember, archiveMember, loadModels, memberSessionId, openMemberSession, onCreatingChange, t }: TeamAgentsPanelProps): import("react").JSX.Element;
21
20
  export {};
22
21
  //# sourceMappingURL=TeamAgentsPanel.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"TeamAgentsPanel.d.ts","sourceRoot":"","sources":["../../../src/client/TeamAgentsPanel.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,yBAAyB,EACzB,2BAA2B,EAE5B,MAAM,gCAAgC,CAAA;AACvC,OAAO,KA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AAgB,EAAE,SAAS,EAAE,YAAY,EAAE,aAAa,EAAE,aAAa,EAAE,UAAU,EAAE,eAAe,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,CAAC,EAAE,EAAE,oBAAoB,+BA2N/N"}
@@ -1,6 +1,6 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
2
  import { useCallback, useEffect, useMemo, useRef, useState } from 'react';
3
- import { Button, IconArchiveOutline20, IconEditOutline16, IconNewChatOutline16, IconPlayOutline16, IconPlusOutline16, IconRefreshOutline16, Input, Modal, Tooltip } from '@deepseek-ai/dsh-client-ui-primitives';
3
+ import { Button, IconArchiveOutline20, IconEditOutline16, IconPlayOutline16, IconPlusOutline16, IconRefreshOutline16, Input, Modal, Tooltip } from '@deepseek-ai/dsh-client-ui-primitives';
4
4
  import { TeamMemberAvatar } from "./TeamMemberAvatar.js";
5
5
  import { SortableRow, useSidebarRowDrag } from "./sidebar-drag.js";
6
6
  import { moveSidebarItem, useSidebarOrder } from "./sidebar-order.js";
@@ -11,7 +11,7 @@ import { TeamSidebarSection } from "./TeamSidebarSection.js";
11
11
  import { AgentEditorDialog, ModelPickerField, sameModel } from "./TeamMemberEditor.js";
12
12
  import createCss from './create.module.css';
13
13
  import css from './sidebar.module.css';
14
- export function TeamAgentsPanel({ workspaceId, loadMembers, subscribeChanges, addMember, updateMember, recoverMember, clearMemberContext, archiveMember, loadModels, memberSessionId, openMemberSession, onCreatingChange, t }) {
14
+ export function TeamAgentsPanel({ workspaceId, loadMembers, subscribeChanges, addMember, updateMember, recoverMember, archiveMember, loadModels, memberSessionId, openMemberSession, onCreatingChange, t }) {
15
15
  const [members, setMembers] = useState([]);
16
16
  const [loading, setLoading] = useState(true);
17
17
  const [error, setError] = useState();
@@ -35,20 +35,74 @@ export function TeamAgentsPanel({ workspaceId, loadMembers, subscribeChanges, ad
35
35
  };
36
36
  const drag = useSidebarRowDrag({ refs: orderedAgentRefs, onCommit: applyMove });
37
37
  const sectionOpen = useSidebarSectionOpen(workspaceId, 'agents');
38
+ // Observed old→new Session binding per Member while this panel is
39
+ // mounted. A model-initiated rollover moves the binding without any
40
+ // Client action; when the conversation seat is showing the Member's
41
+ // previous live Session, the panel follows to the new one exactly once —
42
+ // but only after the refreshed status is actually active, so the commit
43
+ // window (binding moved, new Session not yet live) never redirects to a
44
+ // Session that does not exist. The follow requires the seat to still show
45
+ // the previous Session at completion as well: a rollover observed while
46
+ // unavailable stays pending, and navigating away before it completes
47
+ // cancels the follow instead of pulling the pane back.
48
+ const observedSessionIds = useRef(new Map());
49
+ const pendingFollows = useRef(new Map());
50
+ // The seat's embedded Session id rides a ref: the change subscription may
51
+ // deliver an invalidation through a refresh closure captured before the
52
+ // seat rebinds, and the follow decision must always read the live value.
53
+ const seatSessionIdRef = useRef(memberSessionId);
54
+ seatSessionIdRef.current = memberSessionId;
55
+ const openMemberSessionRef = useRef(openMemberSession);
56
+ openMemberSessionRef.current = openMemberSession;
57
+ const followRollover = useCallback((statuses) => {
58
+ for (const status of statuses) {
59
+ const memberId = status.member.memberId;
60
+ const observed = observedSessionIds.current.get(memberId);
61
+ if (observed === undefined) {
62
+ observedSessionIds.current.set(memberId, status.member.sessionId);
63
+ continue;
64
+ }
65
+ if (observed !== status.member.sessionId) {
66
+ observedSessionIds.current.set(memberId, status.member.sessionId);
67
+ // Only the exact previous live page follows; browsing an older
68
+ // archive or another Member stays untouched. A binding change seen
69
+ // before any page is embedded is still recorded so the observation
70
+ // baseline stays current.
71
+ const seatSessionId = seatSessionIdRef.current;
72
+ if (seatSessionId !== undefined && observed === seatSessionId)
73
+ pendingFollows.current.set(memberId, { previousSessionId: observed, nextSessionId: status.member.sessionId });
74
+ else
75
+ pendingFollows.current.delete(memberId);
76
+ }
77
+ const pending = pendingFollows.current.get(memberId);
78
+ if (pending !== undefined && pending.nextSessionId === status.member.sessionId && status.availability === 'active') {
79
+ // The seat must still show the followed Member's previous Session at
80
+ // completion too: the commit window can outlive the user's patience,
81
+ // and navigating away (or onto another Member/archive view) cancels
82
+ // the follow instead of yanking the pane back onto the new Session.
83
+ const seatSessionId = seatSessionIdRef.current;
84
+ pendingFollows.current.delete(memberId);
85
+ if (seatSessionId !== undefined && seatSessionId === pending.previousSessionId)
86
+ openMemberSessionRef.current(pending.nextSessionId);
87
+ }
88
+ }
89
+ }, []);
38
90
  const refresh = useCallback(async () => {
39
91
  setLoading(true);
40
92
  const result = await loadMembers({ workspaceId });
41
93
  if (result.ok) {
42
94
  // Archived Members are hidden from every surface; the row disappears
43
95
  // the moment the workspace-scope wake delivers the archived state.
44
- setMembers(result.value.filter(status => status.member.state !== 'inactive' && status.member.state !== 'archived'));
96
+ const next = result.value.filter(status => status.member.state !== 'inactive' && status.member.state !== 'archived');
97
+ setMembers(next);
98
+ followRollover(next);
45
99
  setError(undefined);
46
100
  }
47
101
  else {
48
102
  setError(result.error.message);
49
103
  }
50
104
  setLoading(false);
51
- }, [loadMembers, workspaceId]);
105
+ }, [loadMembers, workspaceId, followRollover]);
52
106
  useEffect(() => { void refresh(); }, [refresh]);
53
107
  useEffect(() => subscribeChanges({ kind: 'workspace', workspaceId }, update => {
54
108
  if (update.type === 'failed') {
@@ -126,17 +180,16 @@ export function TeamAgentsPanel({ workspaceId, loadMembers, subscribeChanges, ad
126
180
  ...(model === undefined ? {} : { model }),
127
181
  });
128
182
  };
129
- return (_jsxs("div", { className: css.panel, children: [_jsx(Modal, { open: formOpen, onClose: closeForm, title: t('addAgent'), closeLabel: t('close'), contentClassName: createCss.dialogContent, footer: _jsxs(_Fragment, { children: [_jsx(Button, { variant: "outline", disabled: creating, onClick: closeForm, children: t('cancel') }), _jsx(Button, { type: "submit", form: "team-agent-create-form", variant: "primary", disabled: creating || handle.trim().length === 0, children: creating ? t('creatingAgent') : t('createAgent') })] }), children: _jsxs("form", { id: "team-agent-create-form", className: createCss.form, onSubmit: submit, children: [_jsxs("label", { className: createCss.field, children: [_jsx("span", { children: t('agentName') }), _jsx(Input, { className: createCss.input, value: handle, onChange: event => { setHandle(event.target.value); setRetryRequest(undefined); }, disabled: creating, autoFocus: true })] }), _jsxs("label", { className: createCss.field, children: [_jsxs("span", { children: [t('agentDescription'), t('optionalSuffix')] }), _jsx(Input, { className: createCss.input, value: description, placeholder: t('agentDescriptionPlaceholder'), onChange: event => { setDescription(event.target.value); setRetryRequest(undefined); }, disabled: creating })] }), _jsx(ModelPickerField, { model: model, onModelChange: choice => { setModel(choice); setRetryRequest(undefined); }, loadModels: loadModels, disabled: creating, t: t }), formOpen && error !== undefined && _jsx("p", { className: createCss.error, role: "alert", children: error })] }) }), _jsxs(TeamSidebarSection, { title: t('agents'), open: sectionOpen, onToggle: open => { setSidebarSectionOpen(workspaceId, 'agents', open); }, actions: (_jsx(Tooltip, { label: t('addAgent'), delayMs: 500, children: _jsx("button", { ref: triggerRef, type: "button", className: css.iconButton, "aria-label": t('addAgent'), onClick: () => { setError(undefined); setFormOpen(true); }, children: _jsx(IconPlusOutline16, { size: 14 }) }) })), children: [loading && members.length === 0 && _jsx("p", { className: css.emptyState, children: t('loadingAgents') }), !loading && members.length === 0 && _jsx("p", { className: css.emptyState, children: t('emptyAgents') }), _jsx("div", { className: css.agentList, children: orderedMembers.map(status => (_jsx(SortableRow, { drag: drag, orderKey: status.member.memberId, children: _jsx(AgentRow, { status: status, ...(memberSessionId === undefined ? {} : { current: status.member.sessionId === memberSessionId }), updateMember: updateMember, recoverMember: recoverMember, clearMemberContext: clearMemberContext, archiveMember: archiveMember, loadModels: loadModels, openMemberSession: openMemberSession, onUpdated: () => { void refresh(); }, t: t }) }, status.member.memberId))) })] }), !formOpen && error !== undefined && (_jsxs("div", { className: css.retryError, role: "alert", children: [_jsx("span", { children: error }), retryRequest !== undefined && _jsx("button", { type: "button", className: css.textButton, disabled: creating, onClick: () => { setFormOpen(true); }, children: t('retry') })] }))] }));
183
+ return (_jsxs("div", { className: css.panel, children: [_jsx(Modal, { open: formOpen, onClose: closeForm, title: t('addAgent'), closeLabel: t('close'), contentClassName: createCss.dialogContent, footer: _jsxs(_Fragment, { children: [_jsx(Button, { variant: "outline", disabled: creating, onClick: closeForm, children: t('cancel') }), _jsx(Button, { type: "submit", form: "team-agent-create-form", variant: "primary", disabled: creating || handle.trim().length === 0, children: creating ? t('creatingAgent') : t('createAgent') })] }), children: _jsxs("form", { id: "team-agent-create-form", className: createCss.form, onSubmit: submit, children: [_jsxs("label", { className: createCss.field, children: [_jsx("span", { children: t('agentName') }), _jsx(Input, { className: createCss.input, value: handle, onChange: event => { setHandle(event.target.value); setRetryRequest(undefined); }, disabled: creating, autoFocus: true })] }), _jsxs("label", { className: createCss.field, children: [_jsxs("span", { children: [t('agentDescription'), t('optionalSuffix')] }), _jsx(Input, { className: createCss.input, value: description, placeholder: t('agentDescriptionPlaceholder'), onChange: event => { setDescription(event.target.value); setRetryRequest(undefined); }, disabled: creating })] }), _jsx(ModelPickerField, { model: model, onModelChange: choice => { setModel(choice); setRetryRequest(undefined); }, loadModels: loadModels, disabled: creating, t: t }), formOpen && error !== undefined && _jsx("p", { className: createCss.error, role: "alert", children: error })] }) }), _jsxs(TeamSidebarSection, { title: t('agents'), open: sectionOpen, onToggle: open => { setSidebarSectionOpen(workspaceId, 'agents', open); }, actions: (_jsx(Tooltip, { label: t('addAgent'), delayMs: 500, children: _jsx("button", { ref: triggerRef, type: "button", className: css.iconButton, "aria-label": t('addAgent'), onClick: () => { setError(undefined); setFormOpen(true); }, children: _jsx(IconPlusOutline16, { size: 14 }) }) })), children: [loading && members.length === 0 && _jsx("p", { className: css.emptyState, children: t('loadingAgents') }), !loading && members.length === 0 && _jsx("p", { className: css.emptyState, children: t('emptyAgents') }), _jsx("div", { className: css.agentList, children: orderedMembers.map(status => (_jsx(SortableRow, { drag: drag, orderKey: status.member.memberId, children: _jsx(AgentRow, { status: status, ...(memberSessionId === undefined ? {} : { current: status.member.sessionId === memberSessionId }), updateMember: updateMember, recoverMember: recoverMember, archiveMember: archiveMember, loadModels: loadModels, openMemberSession: openMemberSession, onUpdated: () => { void refresh(); }, t: t }) }, status.member.memberId))) })] }), !formOpen && error !== undefined && (_jsxs("div", { className: css.retryError, role: "alert", children: [_jsx("span", { children: error }), retryRequest !== undefined && _jsx("button", { type: "button", className: css.textButton, disabled: creating, onClick: () => { setFormOpen(true); }, children: t('retry') })] }))] }));
130
184
  }
131
185
  /**
132
186
  * One sidebar Agent row: the select button opens the Member's own Session
133
187
  * conversation page, the avatar carries identity plus the presence badge, and
134
188
  * the row menu opens the editor.
135
189
  */
136
- function AgentRow({ status, current, updateMember, recoverMember, clearMemberContext, archiveMember, loadModels, openMemberSession, onUpdated, t }) {
190
+ function AgentRow({ status, current, updateMember, recoverMember, archiveMember, loadModels, openMemberSession, onUpdated, t }) {
137
191
  const [menuOpen, setMenuOpen] = useState(false);
138
192
  const [editing, setEditing] = useState(false);
139
- const [clearing, setClearing] = useState(false);
140
193
  const [archiving, setArchiving] = useState(false);
141
194
  const [rowAlert, setRowAlert] = useState();
142
195
  // Both row actions ride the same runtime remote: the Host steers a live
@@ -167,35 +220,6 @@ function AgentRow({ status, current, updateMember, recoverMember, clearMemberCon
167
220
  setRowAlert(t('restartFailed', { message: cause instanceof Error ? cause.message : String(cause) }));
168
221
  }
169
222
  };
170
- const clearContext = async () => {
171
- try {
172
- const result = await clearMemberContext({
173
- requestId: mintRequestId(),
174
- workspaceId: status.member.workspaceId,
175
- memberId: status.member.memberId,
176
- });
177
- await onUpdated();
178
- if (!result.ok) {
179
- setRowAlert(t('clearContextFailed', { message: result.error.message }));
180
- return;
181
- }
182
- setRowAlert(undefined);
183
- // The Host moved the Member onto a fresh Session id (the previous log
184
- // stays archived on disk). A new id has no resident client instance, so
185
- // re-entering the member view lazily instantiates it from host truth:
186
- // blank hero, live updates, and no disposed-generation gray-out.
187
- if (current === true)
188
- openMemberSession(result.value.status.member.sessionId);
189
- }
190
- catch (cause) {
191
- setRowAlert(t('clearContextFailed', { message: cause instanceof Error ? cause.message : String(cause) }));
192
- }
193
- };
194
- // Error Members keep a live idle handle, so starting from a new context
195
- // is available to them too — it doubles as a recovery path (the broken
196
- // handle's error markers are dropped with it). Only a running turn or a
197
- // missing handle gates the entry.
198
- const contextClearable = status.presence === 'available' || status.presence === 'error';
199
223
  const archive = async () => {
200
224
  try {
201
225
  const result = await archiveMember({
@@ -215,17 +239,13 @@ function AgentRow({ status, current, updateMember, recoverMember, clearMemberCon
215
239
  { id: 'edit', label: t('editAgent'), icon: _jsx(IconEditOutline16, {}) },
216
240
  ...(status.presence === 'error' ? [{ id: 'resume', label: t('resumeAgent'), icon: _jsx(IconPlayOutline16, {}) }] : []),
217
241
  ...(status.availability === 'unavailable' ? [{ id: 'restart', label: t('restartAgent'), icon: _jsx(IconRefreshOutline16, {}) }] : []),
218
- { id: 'clear-context', label: t('clearContextAgent'), icon: _jsx(IconNewChatOutline16, {}), danger: true, disabled: !contextClearable },
219
- ...(!contextClearable ? [{ type: 'label', id: 'clear-context-reason', text: status.presence === 'working' ? t('clearContextWorkingReason') : t('clearContextUnavailableReason') }] : []),
220
242
  { id: 'archive', label: t('archiveAgent'), icon: _jsx(IconArchiveOutline20, { size: 16 }), danger: true },
221
243
  ], onSelect: (id) => {
222
244
  if (id === 'edit')
223
245
  setEditing(true);
224
- else if (id === 'clear-context')
225
- setClearing(true);
226
246
  else if (id === 'archive')
227
247
  setArchiving(true);
228
248
  else
229
249
  void recover();
230
- }, onOpenChange: setMenuOpen }) })] }), rowAlert !== undefined && _jsx("div", { className: css.rowAlert, role: "alert", children: rowAlert }), clearing && (_jsx(Modal, { open: true, onClose: () => { setClearing(false); }, title: t('clearContextTitle', { name: status.member.handle }), closeLabel: t('close'), contentClassName: createCss.dialogContent, footer: _jsxs(_Fragment, { children: [_jsx(Button, { variant: "outline", onClick: () => { setClearing(false); }, children: t('cancel') }), _jsx(Button, { variant: "primary", onClick: () => { setClearing(false); void clearContext(); }, children: t('clearContextConfirm') })] }), children: _jsx("p", { className: createCss.error, children: t('clearContextNotice', { name: status.member.handle }) }) })), archiving && (_jsx(Modal, { open: true, onClose: () => { setArchiving(false); }, title: t('archiveAgentTitle', { name: status.member.handle }), closeLabel: t('close'), contentClassName: createCss.dialogContent, footer: _jsxs(_Fragment, { children: [_jsx(Button, { variant: "outline", onClick: () => { setArchiving(false); }, children: t('cancel') }), _jsx(Button, { variant: "primary", onClick: () => { setArchiving(false); void archive(); }, children: t('archiveAgentConfirm') })] }), children: _jsx("p", { className: createCss.error, children: t('archiveAgentNotice', { name: status.member.handle }) }) })), editing && (_jsx(AgentEditorDialog, { status: status, updateMember: updateMember, loadModels: loadModels, onCommitted: onUpdated, onClose: () => { setEditing(false); }, t: t }))] }));
250
+ }, onOpenChange: setMenuOpen }) })] }), rowAlert !== undefined && _jsx("div", { className: css.rowAlert, role: "alert", children: rowAlert }), archiving && (_jsx(Modal, { open: true, onClose: () => { setArchiving(false); }, title: t('archiveAgentTitle', { name: status.member.handle }), closeLabel: t('close'), contentClassName: createCss.dialogContent, footer: _jsxs(_Fragment, { children: [_jsx(Button, { variant: "outline", onClick: () => { setArchiving(false); }, children: t('cancel') }), _jsx(Button, { variant: "primary", onClick: () => { setArchiving(false); void archive(); }, children: t('archiveAgentConfirm') })] }), children: _jsx("p", { className: createCss.error, children: t('archiveAgentNotice', { name: status.member.handle }) }) })), editing && (_jsx(AgentEditorDialog, { status: status, updateMember: updateMember, loadModels: loadModels, onCommitted: onUpdated, onClose: () => { setEditing(false); }, t: t }))] }));
231
251
  }
@@ -1,3 +1,3 @@
1
1
  import type { TeamSidebarProps } from './slots.ts';
2
- export declare function TeamWorkspaceBrowser({ wide, expandSidebar, navigation, selectWorkspace, selectChannel, t, useWorkspaces, loadMembers, subscribeChanges, addMember, loadChannels, createChannel, updateChannel, archiveChannel, updateMember, recoverMember, clearMemberContext, archiveMember, joinChannel, removeChannelMember, loadModels, openMemberSession }: TeamSidebarProps): import("react").JSX.Element;
2
+ export declare function TeamWorkspaceBrowser({ wide, expandSidebar, navigation, selectWorkspace, selectChannel, t, useWorkspaces, loadMembers, subscribeChanges, addMember, loadChannels, createChannel, updateChannel, archiveChannel, updateMember, recoverMember, archiveMember, joinChannel, removeChannelMember, loadModels, openMemberSession }: TeamSidebarProps): import("react").JSX.Element;
3
3
  //# sourceMappingURL=TeamWorkspaceBrowser.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"TeamWorkspaceBrowser.d.ts","sourceRoot":"","sources":["../../../src/client/TeamWorkspaceBrowser.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAA;AAUlD,wBAAgB,oBAAoB,CAAC,EAAE,IAAI,EAAE,aAAa,EAAE,UAAU,EAAE,eAAe,EAAE,aAAa,EAAE,CAAC,EAAE,aAAa,EAAE,WAAW,EAAE,gBAAgB,EAAE,SAAS,EAAE,YAAY,EAAE,aAAa,EAAE,aAAa,EAAE,cAAc,EAAE,YAAY,EAAE,aAAa,EAAE,kBAAkB,EAAE,aAAa,EAAE,WAAW,EAAE,mBAAmB,EAAE,UAAU,EAAE,iBAAiB,EAAE,EAAE,gBAAgB,+BA8DlX"}
1
+ {"version":3,"file":"TeamWorkspaceBrowser.d.ts","sourceRoot":"","sources":["../../../src/client/TeamWorkspaceBrowser.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAA;AAUlD,wBAAgB,oBAAoB,CAAC,EAAE,IAAI,EAAE,aAAa,EAAE,UAAU,EAAE,eAAe,EAAE,aAAa,EAAE,CAAC,EAAE,aAAa,EAAE,WAAW,EAAE,gBAAgB,EAAE,SAAS,EAAE,YAAY,EAAE,aAAa,EAAE,aAAa,EAAE,cAAc,EAAE,YAAY,EAAE,aAAa,EAAE,aAAa,EAAE,WAAW,EAAE,mBAAmB,EAAE,UAAU,EAAE,iBAAiB,EAAE,EAAE,gBAAgB,+BA8D9V"}
@@ -7,7 +7,7 @@ import { useSidebarSectionOpen, setSidebarSectionOpen } from "./sidebar-sections
7
7
  import { TeamAgentsPanel } from "./TeamAgentsPanel.js";
8
8
  import { TeamChannelsPanel } from "./TeamChannelsPanel.js";
9
9
  import css from './sidebar.module.css';
10
- export function TeamWorkspaceBrowser({ wide, expandSidebar, navigation, selectWorkspace, selectChannel, t, useWorkspaces, loadMembers, subscribeChanges, addMember, loadChannels, createChannel, updateChannel, archiveChannel, updateMember, recoverMember, clearMemberContext, archiveMember, joinChannel, removeChannelMember, loadModels, openMemberSession }) {
10
+ export function TeamWorkspaceBrowser({ wide, expandSidebar, navigation, selectWorkspace, selectChannel, t, useWorkspaces, loadMembers, subscribeChanges, addMember, loadChannels, createChannel, updateChannel, archiveChannel, updateMember, recoverMember, archiveMember, joinChannel, removeChannelMember, loadModels, openMemberSession }) {
11
11
  const navigationState = useSyncExternalStore(navigation.subscribe, navigation.getSnapshot, navigation.getSnapshot);
12
12
  const workspaces = useWorkspaces(state => state.items);
13
13
  const selected = navigationState.workspaceId;
@@ -39,5 +39,5 @@ export function TeamWorkspaceBrowser({ wide, expandSidebar, navigation, selectWo
39
39
  if (!wide) {
40
40
  return _jsxs("nav", { className: css.railWorkspace, "aria-label": t('workspaceSections'), children: [_jsx(Tooltip, { label: t('channels'), side: "right", children: _jsx("button", { type: "button", className: css.railButton, "aria-label": t('channels'), onClick: () => { setPendingSection('channels'); expandSidebar(); }, children: _jsx(IconListPenOutline16, { size: 16 }) }) }), _jsx(Tooltip, { label: t('agents'), side: "right", children: _jsx("button", { type: "button", className: css.railButton, "aria-label": t('agents'), onClick: () => { setPendingSection('agents'); expandSidebar(); }, children: _jsx(IconAgentPresetOutline16, { size: 16 }) }) })] });
41
41
  }
42
- return _jsxs("section", { className: css.workspaceBrowser, "aria-label": t('workspaces'), children: [_jsx(TeamSidebarSection, { title: t('workspaces'), open: workspacesOpen, onToggle: open => { setSidebarSectionOpen(undefined, 'workspaces', open); }, children: _jsxs("div", { className: css.workspaceList, children: [workspaces.map(workspace => _jsx(TeamWorkspaceRow, { workspaceId: workspace.workspaceId, title: workspace.title, path: workspace.path, selected: workspace.workspaceId === selectedId, current: workspace.workspaceId === selectedId && overviewIsCurrent, onSelect: selectWorkspace }, workspace.workspaceId)), workspaces.length === 0 && _jsx("p", { className: css.emptyState, children: t('empty') })] }) }), selectedId !== undefined && _jsxs("div", { className: css.workspaceSection, children: [_jsx("div", { ref: channelsRef, children: _jsx(TeamChannelsPanel, { workspaceId: selectedId, loadMembers: loadMembers, loadChannels: loadChannels, subscribeChanges: subscribeChanges, createChannel: createChannel, updateChannel: updateChannel, archiveChannel: archiveChannel, joinChannel: joinChannel, removeChannelMember: removeChannelMember, creatingAgents: creatingAgents.filter(request => request.workspaceId === selectedId), ...(navigationState.memberSessionId !== undefined || navigationState.channelRef === undefined ? {} : { selectedChannelRef: navigationState.channelRef }), selectChannel: selectChannel, t: t }, selectedId) }), _jsx("div", { ref: agentsRef, children: _jsx(TeamAgentsPanel, { workspaceId: selectedId, loadMembers: loadMembers, subscribeChanges: subscribeChanges, addMember: addMember, updateMember: updateMember, recoverMember: recoverMember, clearMemberContext: clearMemberContext, archiveMember: archiveMember, loadModels: loadModels, ...(navigationState.memberSessionId === undefined ? {} : { memberSessionId: navigationState.memberSessionId }), openMemberSession: openMemberSession, onCreatingChange: (request, creating) => { setCreatingAgents(current => creating ? [...current.filter(item => item.requestId !== request.requestId), request] : current.filter(item => item.requestId !== request.requestId)); }, t: t }, selectedId) })] })] });
42
+ return _jsxs("section", { className: css.workspaceBrowser, "aria-label": t('workspaces'), children: [_jsx(TeamSidebarSection, { title: t('workspaces'), open: workspacesOpen, onToggle: open => { setSidebarSectionOpen(undefined, 'workspaces', open); }, children: _jsxs("div", { className: css.workspaceList, children: [workspaces.map(workspace => _jsx(TeamWorkspaceRow, { workspaceId: workspace.workspaceId, title: workspace.title, path: workspace.path, selected: workspace.workspaceId === selectedId, current: workspace.workspaceId === selectedId && overviewIsCurrent, onSelect: selectWorkspace }, workspace.workspaceId)), workspaces.length === 0 && _jsx("p", { className: css.emptyState, children: t('empty') })] }) }), selectedId !== undefined && _jsxs("div", { className: css.workspaceSection, children: [_jsx("div", { ref: channelsRef, children: _jsx(TeamChannelsPanel, { workspaceId: selectedId, loadMembers: loadMembers, loadChannels: loadChannels, subscribeChanges: subscribeChanges, createChannel: createChannel, updateChannel: updateChannel, archiveChannel: archiveChannel, joinChannel: joinChannel, removeChannelMember: removeChannelMember, creatingAgents: creatingAgents.filter(request => request.workspaceId === selectedId), ...(navigationState.memberSessionId !== undefined || navigationState.channelRef === undefined ? {} : { selectedChannelRef: navigationState.channelRef }), selectChannel: selectChannel, t: t }, selectedId) }), _jsx("div", { ref: agentsRef, children: _jsx(TeamAgentsPanel, { workspaceId: selectedId, loadMembers: loadMembers, subscribeChanges: subscribeChanges, addMember: addMember, updateMember: updateMember, recoverMember: recoverMember, archiveMember: archiveMember, loadModels: loadModels, ...(navigationState.memberSessionId === undefined ? {} : { memberSessionId: navigationState.memberSessionId }), openMemberSession: openMemberSession, onCreatingChange: (request, creating) => { setCreatingAgents(current => creating ? [...current.filter(item => item.requestId !== request.requestId), request] : current.filter(item => item.requestId !== request.requestId)); }, t: t }, selectedId) })] })] });
43
43
  }
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/client/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,IAAI,aAAa,EAAE,MAAM,qBAAqB,CAAA;AAoCnE,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAA;AAEhD,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAA;AAK5C,OAAO,EAAU,KAAK,OAAO,EAAE,MAAM,cAAc,CAAA;AAEnD,YAAY,EAAE,QAAQ,EAAE,qBAAqB,EAAE,sBAAsB,EAAE,MAAM,iBAAiB,CAAA;AAC9F,YAAY,EAAE,OAAO,EAAE,MAAM,cAAc,CAAA;AAC3C,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAA;AAIhD,eAAO,MAAM,MAAM,UAElB,CAAA;AAED,OAAO,QAAQ,kCAAkC,CAAC;IAChD,UAAU,kBAAkB;QAC1B,IAAI,EAAE,OAAO,CAAA;KACd;CACF;AAED,OAAO,QAAQ,qBAAqB,CAAC;IACnC,UAAU,OAAO;QACf,cAAc,EAAE,cAAc,CAAA;QAC9B,UAAU,EAAE,cAAc,CAAA;KAC3B;CACF;AAyJD,wBAAsB,KAAK,CAAC,GAAG,EAAE,aAAa,GAAG,OAAO,CAAC,IAAI,CAAC,CAI7D"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/client/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,IAAI,aAAa,EAAE,MAAM,qBAAqB,CAAA;AAoCnE,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAA;AAEhD,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAA;AAK5C,OAAO,EAAU,KAAK,OAAO,EAAE,MAAM,cAAc,CAAA;AAEnD,YAAY,EAAE,QAAQ,EAAE,qBAAqB,EAAE,sBAAsB,EAAE,MAAM,iBAAiB,CAAA;AAC9F,YAAY,EAAE,OAAO,EAAE,MAAM,cAAc,CAAA;AAC3C,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAA;AAIhD,eAAO,MAAM,MAAM,UAElB,CAAA;AAED,OAAO,QAAQ,kCAAkC,CAAC;IAChD,UAAU,kBAAkB;QAC1B,IAAI,EAAE,OAAO,CAAA;KACd;CACF;AAED,OAAO,QAAQ,qBAAqB,CAAC;IACnC,UAAU,OAAO;QACf,cAAc,EAAE,cAAc,CAAA;QAC9B,UAAU,EAAE,cAAc,CAAA;KAC3B;CACF;AA8KD,wBAAsB,KAAK,CAAC,GAAG,EAAE,aAAa,GAAG,OAAO,CAAC,IAAI,CAAC,CAI7D"}
@@ -107,6 +107,36 @@ function applyUi(ctx) {
107
107
  void disposeNavigation();
108
108
  void disposeDrafts();
109
109
  }, 'agent-team: navigation service');
110
+ // The one restore owner: leaving an embedded Member Session view must
111
+ // rebind the underlying current session, or the stale Member current later
112
+ // masks to undefined when the Host disposes that session (rollover) and
113
+ // the conversation seat remounts. Takeover is conditional — only when the
114
+ // current still IS the departed Member session — so a selection someone
115
+ // else made in the meantime survives. A dead return target clears instead
116
+ // of opening an unknown id.
117
+ ctx.effect(() => {
118
+ let previous = navigation.getSnapshot();
119
+ const restore = () => {
120
+ const snapshot = navigation.getSnapshot();
121
+ const departed = previous.memberSessionId;
122
+ const returnTo = previous.returnToSessionId;
123
+ previous = snapshot;
124
+ if (departed === undefined || snapshot.memberSessionId !== undefined)
125
+ return;
126
+ const sessions = ctx.sessions;
127
+ if (sessions.list.getSnapshot().current !== departed)
128
+ return;
129
+ if (returnTo !== undefined && sessions.list.getSnapshot().byId[returnTo] !== undefined)
130
+ sessions.open(returnTo);
131
+ else
132
+ sessions.clear();
133
+ };
134
+ const unsubscribe = navigation.subscribe(restore);
135
+ return () => {
136
+ unsubscribe();
137
+ restore();
138
+ };
139
+ }, 'agent-team: member session restore');
110
140
  const changes = new TeamChangeStream((request, signal) => ctx.remote.agentTeam.changes(request, signal));
111
141
  const loadMemberGroups = async () => {
112
142
  const workspaces = ctx.workspaces.list.getSnapshot().items;
@@ -129,19 +159,12 @@ function applyUi(ctx) {
129
159
  inject: () => ({
130
160
  navigation,
131
161
  ...navigation.actions(),
132
- // The footer is the only surface that leaves Team mode; it also closes
133
- // an embedded Member Session view, restoring the session the Human came
134
- // from so the ordinary shell never strands them inside a Member Session.
162
+ // The footer is the only surface that leaves Team mode; closing the
163
+ // embedded Member Session view rebinds the underlying current through
164
+ // the same root-scope restore owner, so there is exactly one restore
165
+ // path and no double open.
135
166
  leaveTeam: () => {
136
- const snapshot = navigation.getSnapshot();
137
- if (snapshot.memberSessionId === undefined) {
138
- navigation.actions().leaveTeam();
139
- return;
140
- }
141
- const returnTo = snapshot.returnToSessionId;
142
167
  navigation.actions().exitMemberSession();
143
- if (returnTo !== undefined)
144
- ctx.sessions.open(returnTo);
145
168
  navigation.actions().leaveTeam();
146
169
  },
147
170
  loadMemberGroups,
@@ -41,13 +41,6 @@ export declare const zh: {
41
41
  readonly restartAgent: "重启";
42
42
  readonly restartStillUnavailable: "重启已执行,成员仍不可用:{diagnostic}";
43
43
  readonly restartFailed: "重启执行失败:{message}";
44
- readonly clearContextAgent: "从全新上下文开始";
45
- readonly clearContextWorkingReason: "成员正在工作中,完成后才能清空上下文";
46
- readonly clearContextUnavailableReason: "成员当前不可用,恢复在线且空闲后才能清空上下文";
47
- readonly clearContextTitle: "从全新上下文开始:{name}";
48
- readonly clearContextNotice: "将结束 {name} 当前的会话上下文并从空白开始:旧对话会归档保留在会话记录中。{name} 的身份、私有记忆与 notes、频道和会话绑定都保持不变,后续协作从新上下文继续累积。";
49
- readonly clearContextConfirm: "开始全新上下文";
50
- readonly clearContextFailed: "清空上下文失败:{message}";
51
44
  readonly archiveAgent: "归档";
52
45
  readonly archiveAgentTitle: "归档 Agent:{name}";
53
46
  readonly archiveAgentNotice: "将把 {name} 从所有列表收起:会话与私有记忆保留在磁盘上、活跃 Claim 会释放,但暂无恢复入口。";
@@ -196,13 +189,6 @@ export declare const en: {
196
189
  readonly restartAgent: "Restart";
197
190
  readonly restartStillUnavailable: "Restart ran, but the Member is still unavailable: {diagnostic}";
198
191
  readonly restartFailed: "Restart failed: {message}";
199
- readonly clearContextAgent: "Start from new context";
200
- readonly clearContextWorkingReason: "The Member is working; clear once the current turn ends";
201
- readonly clearContextUnavailableReason: "The Member is unavailable; only an idle available Member can start from a new context";
202
- readonly clearContextTitle: "Start from new context: {name}";
203
- readonly clearContextNotice: "This ends {name}'s current session context and starts blank: the previous conversation is archived and stays in the session history. {name}'s identity, private memory and notes, channel and session bindings are untouched, and future collaboration accumulates from the new context.";
204
- readonly clearContextConfirm: "Start from new context";
205
- readonly clearContextFailed: "Failed to clear context: {message}";
206
192
  readonly archiveAgent: "Archive";
207
193
  readonly archiveAgentTitle: "Archive Agent: {name}";
208
194
  readonly archiveAgentNotice: "This hides {name} from every list: the session log and private memory stay on disk and active Claims release, but there is no restore entry point yet.";
@@ -1 +1 @@
1
- {"version":3,"file":"locales.d.ts","sourceRoot":"","sources":["../../../src/client/locales.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA0JL,CAAA;AAEV,eAAO,MAAM,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA0JL,CAAA;AAEV,MAAM,MAAM,OAAO,GAAG,MAAM,OAAO,EAAE,CAAA"}
1
+ {"version":3,"file":"locales.d.ts","sourceRoot":"","sources":["../../../src/client/locales.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAmJL,CAAA;AAEV,eAAO,MAAM,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAmJL,CAAA;AAEV,MAAM,MAAM,OAAO,GAAG,MAAM,OAAO,EAAE,CAAA"}
@@ -41,13 +41,6 @@ export const zh = {
41
41
  restartAgent: '重启',
42
42
  restartStillUnavailable: '重启已执行,成员仍不可用:{diagnostic}',
43
43
  restartFailed: '重启执行失败:{message}',
44
- clearContextAgent: '从全新上下文开始',
45
- clearContextWorkingReason: '成员正在工作中,完成后才能清空上下文',
46
- clearContextUnavailableReason: '成员当前不可用,恢复在线且空闲后才能清空上下文',
47
- clearContextTitle: '从全新上下文开始:{name}',
48
- clearContextNotice: '将结束 {name} 当前的会话上下文并从空白开始:旧对话会归档保留在会话记录中。{name} 的身份、私有记忆与 notes、频道和会话绑定都保持不变,后续协作从新上下文继续累积。',
49
- clearContextConfirm: '开始全新上下文',
50
- clearContextFailed: '清空上下文失败:{message}',
51
44
  archiveAgent: '归档',
52
45
  archiveAgentTitle: '归档 Agent:{name}',
53
46
  archiveAgentNotice: '将把 {name} 从所有列表收起:会话与私有记忆保留在磁盘上、活跃 Claim 会释放,但暂无恢复入口。',
@@ -196,13 +189,6 @@ export const en = {
196
189
  restartAgent: 'Restart',
197
190
  restartStillUnavailable: 'Restart ran, but the Member is still unavailable: {diagnostic}',
198
191
  restartFailed: 'Restart failed: {message}',
199
- clearContextAgent: 'Start from new context',
200
- clearContextWorkingReason: 'The Member is working; clear once the current turn ends',
201
- clearContextUnavailableReason: 'The Member is unavailable; only an idle available Member can start from a new context',
202
- clearContextTitle: 'Start from new context: {name}',
203
- clearContextNotice: 'This ends {name}\'s current session context and starts blank: the previous conversation is archived and stays in the session history. {name}\'s identity, private memory and notes, channel and session bindings are untouched, and future collaboration accumulates from the new context.',
204
- clearContextConfirm: 'Start from new context',
205
- clearContextFailed: 'Failed to clear context: {message}',
206
192
  archiveAgent: 'Archive',
207
193
  archiveAgentTitle: 'Archive Agent: {name}',
208
194
  archiveAgentNotice: 'This hides {name} from every list: the session log and private memory stay on disk and active Claims release, but there is no restore entry point yet.',
@@ -50,6 +50,11 @@ export type TeamSidebarProps = PropsRuntime<'sidebar.workspaces'> & PropsLocale<
50
50
  archiveChannel: (request: AgentTeamArchiveChannelRequest) => Promise<RemoteResult<AgentTeamArchiveChannelResult>>;
51
51
  updateMember: (request: AgentTeamUpdateMemberRequest) => Promise<RemoteResult<AgentTeamMemberResult>>;
52
52
  recoverMember: (request: AgentTeamRecoverMemberRequest) => Promise<RemoteResult<AgentTeamRecoverMemberResult>>;
53
+ /**
54
+ * Host clear-context remote kept as a hidden migration escape hatch.
55
+ * The visible row action is retired: Members manage their own context
56
+ * through the context_rollover tool (see docs/architecture.md).
57
+ */
53
58
  clearMemberContext: (request: AgentTeamClearMemberContextRequest) => Promise<RemoteResult<AgentTeamClearMemberContextResult>>;
54
59
  archiveMember: (request: AgentTeamArchiveMemberRequest) => Promise<RemoteResult<AgentTeamArchiveMemberResult>>;
55
60
  joinChannel: (request: AgentTeamJoinChannelRequest) => Promise<RemoteResult<AgentTeamJoinChannelResult>>;
@@ -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,2BAA2B,EAC3B,0BAA0B,EAC1B,6BAA6B,EAC7B,4BAA4B,EAC5B,6BAA6B,EAC7B,4BAA4B,EAC5B,qBAAqB,EACrB,6BAA6B,EAC7B,4BAA4B,EAC5B,uBAAuB,EACvB,mCAAmC,EACnC,kCAAkC,EAClC,qBAAqB,EACrB,+BAA+B,EAC/B,8BAA8B,EAC9B,oBAAoB,EACpB,6BAA6B,EAC7B,sBAAsB,EACtB,6BAA6B,EAC7B,2BAA2B,EAC3B,kCAAkC,EAClC,0BAA0B,EAC1B,yBAA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AE,kCAAkC,KAAK,OAAO,CAAC,YAAY,CAAC,2BAA2B,CAAC,CAAC,CAAA;CACxH,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;IAChC,gBAAgB,EAAE,MAAM,OAAO,CAAC,SAAS,eAAe,EAAE,CAAC,CAAA;CAC5D,CAAA"}
@@ -6,15 +6,18 @@ Model-facing tools for Agent Team Members. The package registers tools in the ca
6
6
 
7
7
  ## Tools
8
8
 
9
- - `team_inbox` lists bounded unread Thread summaries for the calling Member, ordered by direct work and then recency; Task status/number appear only where the Thread has a real Task overlay.
10
- - `team_thread` reads a Thread, pages history, follows, or unfollows. `threadRef` is primary; a `taskRef` is a Host alias only for released task-only Clients. `read` atomically returns the Thread anchor, optional current Task and Claim snapshot, bounded orientation facts, and one contiguous unread batch while advancing the durable watermark; `history` never changes read state.
11
- - `team_message` starts a top-level Thread or replies to an existing Thread. It defaults to a taskless Thread; pass `asTask: true` for atomic Task creation. Replies require the exact `baseRevision` and reject unread work before checking revision freshness.
9
+ - `team_inbox` lists bounded unread Thread summaries for the calling Member, ordered by direct work and then recency; Task status/number appear only where the Thread has a real Task overlay. The render states total unread/direct counts (including Threads beyond the bounded list) and each item's exact unread/direct counts, Channel ref, and Task status.
10
+ - `team_thread` reads a Thread, pages history, follows, or unfollows. `threadRef` is primary; a `taskRef` is a Host alias only for released task-only Clients. `read` atomically returns the Thread anchor, optional current Task and Claim snapshot, bounded orientation facts, and one contiguous unread batch while advancing the durable watermark; `history` never changes read state. Activity facts render structured — actor, Task ref, and the Claim refs each activity claimed, completed, accepted, or released — and the header states the Task's status/resolution on taskful Threads. The Claims snapshot renders one line per Claim, the anchor renders whenever it is not already among the facts, message facts carry unread/direct markers, a read footer states read-through sequence and remaining unread count, and a history footer states the cursor and hasMore for paging. A read that acknowledges an unread acceptance of a still-done Task carries one `contextAdvice` block (usage, route budgets, the `min(128_000, handoffAt)` Task-boundary threshold, and one keep/rollover/handoff-now action); it is advisory only and degrades to an explicit `unavailable` line when measurement fails.
11
+ - `team_message` starts a top-level Thread or replies to an existing Thread. It defaults to a taskless Thread; pass `asTask: true` for atomic Task creation. Replies require the exact `baseRevision` and reject unread work before checking revision freshness. A committed start renders the new Thread ref (and Task ref when taskful); typed rejections render the refs and counts needed to reread and retry.
12
12
  - `team_claim` lists or mutates the calling Member's Direction Claims through `list`, `claim`, `done`, and `release`; it applies only to real Tasks. Direction exclusion uses Unicode NFKC normalization, trim, whitespace compression, and deterministic case folding.
13
- - `team_view` discovers bounded, membership-authorized Channel, real Task, and Member summaries. It does not return Thread messages or activities.
13
+ - `team_view` discovers bounded, membership-authorized Channel, top-level Thread, Task, and Member summaries. Thread entries carry refs, revision, message count, and Task status where applicable; it does not return Thread messages or activities. The render ends with the shared cursor and a hasMore verdict; Task rows carry their Thread and Channel refs with the current revision.
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
+ - `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.
14
17
 
15
18
  An Agent cannot silently enroll an unfollowed Agent through a mention; the Host returns `member_not_following`. 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.
16
19
 
17
- Canonical results expose stable refs, optional Task status, Thread revision, Claim history, Attention, and unread facts. Typed `unread_required` and `stale_revision` results include the fields needed to reread and retry deliberately. Tool execution resolves the exact live `exec.agent`; arguments cannot select or impersonate the actor or Workspace. Write request identity derives from sessionId plus tool callId. Team tools return to the model loop and never conclude the turn.
20
+ Canonical results expose stable refs, optional Task status, Thread revision, Claim history, Attention, and unread facts. Typed `unread_required` and `stale_revision` results include the fields needed to reread and retry deliberately. Tool execution resolves the exact live `exec.agent`; arguments cannot select or impersonate the actor or Workspace. Write request identity derives from sessionId plus tool callId. `context_rollover` and `context_checkpoint` conclude the Agent turn (a rollover must not be followed by old-generation work, and a checkpoint resolves at its containing turn's end); every other Team tool returns to the model loop.
18
21
 
19
22
  The complete implemented protocol is documented in [`../../docs/team-collaboration.md`](../../docs/team-collaboration.md).
20
23
 
@@ -6,15 +6,18 @@
6
6
 
7
7
  ## 工具
8
8
 
9
- - `team_inbox` 列出调用方 Member 的有界未读 Thread 摘要,先按 direct work、再按最近活动排序;只有 Thread 存在真实 Task overlay 时才出现 Task status/number。
10
- - `team_thread` 读取 Thread、分页历史、follow 或 unfollow。`threadRef` 是主身份;`taskRef` 只对 released task-only Client 是 Host alias。`read` 原子返回 Thread anchor、可选的当前 Task 与 Claim 快照、有界背景和一批连续未读事实,并推进持久 watermark;`history` 不改变 read 状态。
11
- - `team_message` 创建顶层 Thread,或回复已有 Thread。它默认创建 taskless Thread;传入 `asTask: true` 才原子创建 Task。Reply 必须携带准确的 `baseRevision`,并在检查 revision 前先处理未读门禁。
9
+ - `team_inbox` 列出调用方 Member 的有界未读 Thread 摘要,先按 direct work、再按最近活动排序;只有 Thread 存在真实 Task overlay 时才出现 Task status/number。渲染给出 unread/direct 总数(含有界列表之外的 Threads),每个条目显示精确的 unread/direct 计数、Channel ref 与 Task status
10
+ - `team_thread` 读取 Thread、分页历史、follow 或 unfollow。`threadRef` 是主身份;`taskRef` 只对 released task-only Client 是 Host alias。`read` 原子返回 Thread anchor、可选的当前 Task 与 Claim 快照、有界背景和一批连续未读事实,并推进持久 watermark;`history` 不改变 read 状态。Activity facts 结构化渲染——actor、Task ref,以及每条 activity claim、完成、接受或 release 的 Claim refs——taskful Thread 的 header 呈现 Task status/resolution。Claims 快照逐条渲染,anchor 未出现在 facts 中时也会渲染,message facts 携带 unread/direct 标记,read 页脚给出 read-through sequence 与剩余 unread 计数,history 页脚给出 cursor 与 hasMore 供翻页。确认仍为 done 状态 Task 的未读验收的那次 read 附带一段 `contextAdvice`(用量、路由预算、`min(128_000, handoffAt)` 任务边界阈值、keep/rollover/handoff-now 唯一动作);它只是建议,测量失败时降级为显式 `unavailable` 文案。
11
+ - `team_message` 创建顶层 Thread,或回复已有 Thread。它默认创建 taskless Thread;传入 `asTask: true` 才原子创建 Task。Reply 必须携带准确的 `baseRevision`,并在检查 revision 前先处理未读门禁。commit 的 start 渲染新 Thread ref(taskful 时含 Task ref);类型化拒绝渲染重读与重试所需的 refs 与计数。
12
12
  - `team_claim` 通过 `list`、`claim`、`done`、`release` 读取或修改调用方 Member 的 Direction Claim;它只适用于真实 Task。Direction 互斥键执行 Unicode NFKC normalization、trim、空白压缩和确定性大小写折叠。
13
- - `team_view` 发现有界、按 membership 授权的 Channel、真实 Task 和 Member 摘要,不返回 Thread Message 或 Activity。
13
+ - `team_view` 发现有界、按 membership 授权的 Channel、顶层 Thread、Task 和 Member 摘要。Thread 条目携带 refs、revision、message 数及适用的 Task status;不返回 Thread Message 或 Activity。渲染以共享 cursor 与 hasMore 结论收尾;Task 行携带其 Thread、Channel ref 与当前 revision
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
+ - `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。
14
17
 
15
18
  Agent 不能通过 mention 静默把另一个 unfollowed Agent 加入 Thread;Host 返回 `member_not_following`。Human confirmation 属于单独的 Host/Client 流程。Closed Task 在 Human reopen 前拒绝 reply、Claim 和新的 Attention;taskless Thread 没有 Claim 或 Task resolution mutation path。
16
19
 
17
- Canonical result 包含稳定 refs、可选的 Task status、Thread revision、Claim history、Attention 和未读 facts。类型化的 `unread_required` 与 `stale_revision` 结果包含重新读取和审慎重试所需字段。工具执行通过准确的 live `exec.agent` 解析 actor;参数不能选择或冒充 actor 或 Workspace。写操作的 request identity 由 sessionId 与 tool callId 派生。Team tools 将结果返回模型循环,不主动结束 turn。
20
+ Canonical result 包含稳定 refs、可选的 Task status、Thread revision、Claim history、Attention 和未读 facts。类型化的 `unread_required` 与 `stale_revision` 结果包含重新读取和审慎重试所需字段。工具执行通过准确的 live `exec.agent` 解析 actor;参数不能选择或冒充 actor 或 Workspace。写操作的 request identity 由 sessionId 与 tool callId 派生。`context_rollover` 与 `context_checkpoint` 结束 Agent turn;其余 Team tools 将结果返回模型循环,不主动结束 turn。
18
21
 
19
22
  完整的已实现协议见 [`../../docs/team-collaboration.md`](../../docs/team-collaboration.md)。
20
23