@deepseek-harness-tui/dsh-tui 0.19.0 → 0.20.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (166) hide show
  1. package/README.md +63 -57
  2. package/cordis.patch.yml +5 -3
  3. package/cordis.yml +3 -2
  4. package/guide/dsh-tui-guide/configuration.en.md +1 -1
  5. package/guide/dsh-tui-guide/configuration.md +1 -1
  6. package/guide/dsh-tui-guide/getting-started.en.md +2 -2
  7. package/guide/dsh-tui-guide/getting-started.md +2 -2
  8. package/guide/dsh-tui-guide/user-guide.en.md +7 -2
  9. package/guide/dsh-tui-guide/user-guide.md +7 -2
  10. package/lib/settings.json +24 -8
  11. package/lib/types/adapter/ports/channel-view.d.ts +39 -3
  12. package/lib/types/adapter/ports/channel-view.d.ts.map +1 -1
  13. package/lib/types/agent/events.d.ts +3 -1
  14. package/lib/types/agent/events.d.ts.map +1 -1
  15. package/lib/types/backends/claude/tools.d.ts.map +1 -1
  16. package/lib/types/backends/claude/tools.js +8 -3
  17. package/lib/types/backends/codex/translate/presentation.d.ts.map +1 -1
  18. package/lib/types/backends/codex/translate/presentation.js +5 -2
  19. package/lib/types/channel/interaction.d.ts.map +1 -1
  20. package/lib/types/channel/interaction.js +1 -0
  21. package/lib/types/channel/permissions.d.ts +15 -0
  22. package/lib/types/channel/permissions.d.ts.map +1 -1
  23. package/lib/types/channel/permissions.js +28 -0
  24. package/lib/types/channel/projection.d.ts.map +1 -1
  25. package/lib/types/channel/projection.js +11 -1
  26. package/lib/types/channel/questions.d.ts +26 -0
  27. package/lib/types/channel/questions.d.ts.map +1 -1
  28. package/lib/types/channel/questions.js +43 -0
  29. package/lib/types/commands.js +1 -1
  30. package/lib/types/components/MessageList.d.ts.map +1 -1
  31. package/lib/types/components/MessageList.js +3 -3
  32. package/lib/types/components/SplitDiffView.d.ts.map +1 -1
  33. package/lib/types/components/SplitDiffView.js +3 -2
  34. package/lib/types/components/StarPrompt.d.ts +5 -3
  35. package/lib/types/components/StarPrompt.d.ts.map +1 -1
  36. package/lib/types/components/StarPrompt.js +56 -6
  37. package/lib/types/components/SubagentCard.d.ts.map +1 -1
  38. package/lib/types/components/SubagentCard.js +1 -1
  39. package/lib/types/components/SubagentDashboard.d.ts.map +1 -1
  40. package/lib/types/components/SubagentDashboard.js +3 -2
  41. package/lib/types/components/SubagentDetailScene.d.ts.map +1 -1
  42. package/lib/types/components/SubagentDetailScene.js +1 -1
  43. package/lib/types/components/messages/AssistantToolUseMessage.d.ts.map +1 -1
  44. package/lib/types/components/messages/AssistantToolUseMessage.js +121 -23
  45. package/lib/types/components/teamRoster.d.ts +6 -3
  46. package/lib/types/components/teamRoster.d.ts.map +1 -1
  47. package/lib/types/dsh-adapter/approvals.d.ts +19 -0
  48. package/lib/types/dsh-adapter/approvals.d.ts.map +1 -1
  49. package/lib/types/dsh-adapter/approvals.js +17 -1
  50. package/lib/types/dsh-adapter/backend/translate.d.ts.map +1 -1
  51. package/lib/types/dsh-adapter/backend/translate.js +15 -3
  52. package/lib/types/dsh-adapter/channel/extensions.d.ts.map +1 -1
  53. package/lib/types/dsh-adapter/channel/extensions.js +7 -4
  54. package/lib/types/dsh-adapter/channel/local-actions.d.ts.map +1 -1
  55. package/lib/types/dsh-adapter/channel/local-actions.js +7 -3
  56. package/lib/types/dsh-adapter/channel/projection-helpers.d.ts.map +1 -1
  57. package/lib/types/dsh-adapter/channel/projection-helpers.js +4 -2
  58. package/lib/types/dsh-adapter/channel/settings-host.d.ts.map +1 -1
  59. package/lib/types/dsh-adapter/channel/settings-host.js +179 -33
  60. package/lib/types/dsh-adapter/channel/subagent-projection.d.ts +55 -4
  61. package/lib/types/dsh-adapter/channel/subagent-projection.d.ts.map +1 -1
  62. package/lib/types/dsh-adapter/channel/subagent-projection.js +80 -16
  63. package/lib/types/dsh-adapter/channel/subagent-transcript.d.ts +1 -1
  64. package/lib/types/dsh-adapter/channel/subagent-transcript.d.ts.map +1 -1
  65. package/lib/types/dsh-adapter/channel/subagent-transcript.js +6 -5
  66. package/lib/types/dsh-adapter/channel/task-completion.js +2 -10
  67. package/lib/types/dsh-adapter/compat/compaction-previews.d.ts +11 -0
  68. package/lib/types/dsh-adapter/compat/compaction-previews.d.ts.map +1 -0
  69. package/lib/types/dsh-adapter/compat/compaction-previews.js +38 -0
  70. package/lib/types/dsh-adapter/compat/messages.d.ts +1 -1
  71. package/lib/types/dsh-adapter/compat/messages.d.ts.map +1 -1
  72. package/lib/types/dsh-adapter/compat/messages.js +2 -2
  73. package/lib/types/dsh-adapter/contract.d.ts +7 -4
  74. package/lib/types/dsh-adapter/contract.d.ts.map +1 -1
  75. package/lib/types/dsh-adapter/contract.js +8 -4
  76. package/lib/types/dsh-adapter/experimental-bundles.d.ts +5 -0
  77. package/lib/types/dsh-adapter/experimental-bundles.d.ts.map +1 -1
  78. package/lib/types/dsh-adapter/experimental-bundles.js +0 -2
  79. package/lib/types/dsh-adapter/host-contract.d.ts +1 -1
  80. package/lib/types/dsh-adapter/host-contract.js +2 -2
  81. package/lib/types/dsh-adapter/host-dsh.d.ts +2 -0
  82. package/lib/types/dsh-adapter/host-dsh.d.ts.map +1 -1
  83. package/lib/types/dsh-adapter/host-dsh.js +3 -0
  84. package/lib/types/dsh-adapter/index.d.ts +9 -1
  85. package/lib/types/dsh-adapter/index.d.ts.map +1 -1
  86. package/lib/types/dsh-adapter/index.js +5 -0
  87. package/lib/types/dsh-adapter/oauth/account-notifications.d.ts +73 -0
  88. package/lib/types/dsh-adapter/oauth/account-notifications.d.ts.map +1 -0
  89. package/lib/types/dsh-adapter/oauth/account-notifications.js +250 -0
  90. package/lib/types/dsh-adapter/oauth/bonus.d.ts +34 -9
  91. package/lib/types/dsh-adapter/oauth/bonus.d.ts.map +1 -1
  92. package/lib/types/dsh-adapter/oauth/bonus.js +47 -5
  93. package/lib/types/dsh-adapter/oauth/deepseek.d.ts +7 -2
  94. package/lib/types/dsh-adapter/oauth/deepseek.d.ts.map +1 -1
  95. package/lib/types/dsh-adapter/oauth/deepseek.js +6 -1
  96. package/lib/types/dsh-adapter/oauth/index.d.ts.map +1 -1
  97. package/lib/types/dsh-adapter/oauth/index.js +44 -0
  98. package/lib/types/dsh-adapter/oauth/service.d.ts.map +1 -1
  99. package/lib/types/dsh-adapter/oauth/service.js +5 -6
  100. package/lib/types/dsh-adapter/plugin-manage.d.ts +6 -4
  101. package/lib/types/dsh-adapter/plugin-manage.d.ts.map +1 -1
  102. package/lib/types/dsh-adapter/plugin-manage.js +3 -2
  103. package/lib/types/dsh-adapter/plugin.d.ts +237 -6
  104. package/lib/types/dsh-adapter/plugin.d.ts.map +1 -1
  105. package/lib/types/dsh-adapter/plugin.js +608 -23
  106. package/lib/types/dsh-adapter/session-projection-store.d.ts +1 -1
  107. package/lib/types/dsh-adapter/session-projection-store.d.ts.map +1 -1
  108. package/lib/types/dsh-adapter/session-projection-store.js +30 -23
  109. package/lib/types/dsh-adapter/sessionTree.d.ts.map +1 -1
  110. package/lib/types/dsh-adapter/sessionTree.js +4 -1
  111. package/lib/types/dsh-adapter/subagents.d.ts +1 -0
  112. package/lib/types/dsh-adapter/subagents.d.ts.map +1 -1
  113. package/lib/types/dsh-adapter/subagents.js +10 -2
  114. package/lib/types/dsh-adapter/team-mode.d.ts +29 -17
  115. package/lib/types/dsh-adapter/team-mode.d.ts.map +1 -1
  116. package/lib/types/dsh-adapter/team-mode.js +138 -17
  117. package/lib/types/dsh-adapter/team-roster.d.ts +53 -18
  118. package/lib/types/dsh-adapter/team-roster.d.ts.map +1 -1
  119. package/lib/types/dsh-adapter/team-roster.js +206 -39
  120. package/lib/types/dsh-adapter/team-tools.d.ts +25 -12
  121. package/lib/types/dsh-adapter/team-tools.d.ts.map +1 -1
  122. package/lib/types/dsh-adapter/team-tools.js +81 -26
  123. package/lib/types/i18n.d.ts +65 -9
  124. package/lib/types/i18n.d.ts.map +1 -1
  125. package/lib/types/i18n.js +29 -8
  126. package/lib/types/ink/dom.d.ts.map +1 -1
  127. package/lib/types/ink/dom.js +13 -3
  128. package/lib/types/ink/flush-tick.d.ts +6 -0
  129. package/lib/types/ink/flush-tick.d.ts.map +1 -1
  130. package/lib/types/ink/flush-tick.js +31 -0
  131. package/lib/types/ink/hooks/use-terminal-title.d.ts +15 -0
  132. package/lib/types/ink/hooks/use-terminal-title.d.ts.map +1 -1
  133. package/lib/types/ink/hooks/use-terminal-title.js +23 -3
  134. package/lib/types/ink/ink.js +2 -2
  135. package/lib/types/ink/jumpback-state.d.ts +33 -0
  136. package/lib/types/ink/jumpback-state.d.ts.map +1 -0
  137. package/lib/types/ink/jumpback-state.js +51 -0
  138. package/lib/types/ink/jumpback.d.ts +78 -0
  139. package/lib/types/ink/jumpback.d.ts.map +1 -0
  140. package/lib/types/ink/jumpback.js +515 -0
  141. package/lib/types/ink/log-update.js +37 -14
  142. package/lib/types/ink/notify-helper/activate.cs +836 -0
  143. package/lib/types/ink/notify-helper/compile.d.ts +30 -0
  144. package/lib/types/ink/notify-helper/compile.d.ts.map +1 -0
  145. package/lib/types/ink/notify-helper/compile.js +235 -0
  146. package/lib/types/ink/terminal-notification-windows.d.ts +8 -4
  147. package/lib/types/ink/terminal-notification-windows.d.ts.map +1 -1
  148. package/lib/types/ink/terminal-notification-windows.js +14 -21
  149. package/lib/types/ink/terminal-notification.d.ts +31 -2
  150. package/lib/types/ink/terminal-notification.d.ts.map +1 -1
  151. package/lib/types/ink/terminal-notification.js +51 -0
  152. package/lib/types/ink/terminal.d.ts +2 -1
  153. package/lib/types/ink/terminal.d.ts.map +1 -1
  154. package/lib/types/ink/terminal.js +9 -4
  155. package/lib/types/screens/AgentTranscriptScene.d.ts.map +1 -1
  156. package/lib/types/screens/AgentTranscriptScene.js +1 -1
  157. package/lib/types/screens/Chat.d.ts +4 -3
  158. package/lib/types/screens/Chat.d.ts.map +1 -1
  159. package/lib/types/screens/Chat.js +38 -9
  160. package/lib/types/settings/definitions.d.ts +12 -0
  161. package/lib/types/settings/definitions.d.ts.map +1 -1
  162. package/lib/types/settings/definitions.js +15 -7
  163. package/package.json +112 -112
  164. package/presets/liangshen/agent.cordis.yml +4 -0
  165. package/tui-profile/feed/README.md +1 -1
  166. package/tui-profile/feed/first-party.json +1 -1
@@ -25,7 +25,7 @@ export interface SessionProjectionStoreOptions<T> {
25
25
  /** Narrow one wire value of a session; anything else is dropped, never half-rendered. */
26
26
  narrow(value: unknown, sessionId: string): T | undefined;
27
27
  /** Map the bound session to the session it reads (default: itself). */
28
- watch?(session: unknown): WatchedSession;
28
+ watch?(session: unknown): WatchedSession | undefined;
29
29
  /** Read-failure sink, reported once per attached registry (the composition root's logger). */
30
30
  warn?(message: string): void;
31
31
  }
@@ -1 +1 @@
1
- {"version":3,"file":"session-projection-store.d.ts","sourceRoot":"","sources":["../../../src/dsh-adapter/session-projection-store.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAA;AAClD,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,qBAAqB,CAAA;AAEjE,sEAAsE;AACtE,MAAM,WAAW,cAAc;IAC7B,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAA;IACnB,0EAA0E;IAC1E,QAAQ,CAAC,OAAO,CAAC,EAAE,OAAO,CAAA;CAC3B;AAED,MAAM,WAAW,6BAA6B,CAAC,CAAC;IAC9C,mDAAmD;IACnD,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAA;IACpB,yFAAyF;IACzF,MAAM,CAAC,KAAK,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,GAAG,CAAC,GAAG,SAAS,CAAA;IACxD,uEAAuE;IACvE,KAAK,CAAC,CAAC,OAAO,EAAE,OAAO,GAAG,cAAc,CAAA;IACxC,8FAA8F;IAC9F,IAAI,CAAC,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI,CAAA;CAC7B;AAED,MAAM,WAAW,sBAAsB,CAAC,CAAC;IACvC,2EAA2E;IA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A6B,CAAC,CAAC,CAAC,GAAG,sBAAsB,CAAC,CAAC,CAAC,CA6FpH;AAED;;;;;;;GAOG;AACH,wBAAgB,uBAAuB,CAAC,GAAG,EAAE,OAAO,EAAE,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,sBAAsB,CAAC,OAAO,CAAC,GAAG,IAAI,CAmB/G"}
@@ -45,28 +45,7 @@ export function createSessionProjectionStore(options) {
45
45
  value = undefined;
46
46
  emit();
47
47
  },
48
- seed(session) {
49
- if (session === null || session === undefined)
50
- return;
51
- bound = session;
52
- const next = options.watch?.(session) ?? { id: sessionIdOf(session), session };
53
- if (next.id !== watched?.id) {
54
- raw = undefined;
55
- if (value !== undefined) {
56
- value = undefined;
57
- emit();
58
- }
59
- }
60
- watched = next;
61
- if (registry === undefined || next.session === undefined)
62
- return;
63
- try {
64
- store.update(next.id, registry.snapshot(next.session, [options.key]).values[options.key]);
65
- }
66
- catch (error) {
67
- store.noteReadFailure(error);
68
- }
69
- },
48
+ seed: session => { seedValue(session); },
70
49
  update(sessionId, next) {
71
50
  if (sessionId !== watched?.id)
72
51
  return;
@@ -89,7 +68,7 @@ export function createSessionProjectionStore(options) {
89
68
  // included, is re-narrowed.
90
69
  const held = raw;
91
70
  raw = UNREAD;
92
- store.seed(bound);
71
+ seedValue(bound);
93
72
  // No snapshot was read (no registry, the watched session not live, or a
94
73
  // failed read): narrow the value already held instead.
95
74
  if (raw === UNREAD && held !== UNREAD && watched !== undefined)
@@ -114,6 +93,34 @@ export function createSessionProjectionStore(options) {
114
93
  options.warn?.(`dsh-tui: ${options.key} projection read failed: ${detail}`);
115
94
  },
116
95
  };
96
+ /**
97
+ * Bind/read one session. Kept private so `reseed` never re-enters an
98
+ * overridden `seed` (a composite store would otherwise rebind its companion
99
+ * projection and narrow the old session's value against the new one).
100
+ * @param session - the session to bind and read a baseline for.
101
+ */
102
+ function seedValue(session) {
103
+ if (session === null || session === undefined)
104
+ return;
105
+ bound = session;
106
+ const next = options.watch === undefined ? { id: sessionIdOf(session), session } : options.watch(session);
107
+ if (next?.id !== watched?.id) {
108
+ raw = undefined;
109
+ if (value !== undefined) {
110
+ value = undefined;
111
+ emit();
112
+ }
113
+ }
114
+ watched = next;
115
+ if (registry === undefined || next?.session === undefined)
116
+ return;
117
+ try {
118
+ store.update(next.id, registry.snapshot(next.session, [options.key]).values[options.key]);
119
+ }
120
+ catch (error) {
121
+ store.noteReadFailure(error);
122
+ }
123
+ }
117
124
  return store;
118
125
  }
119
126
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"sessionTree.d.ts","sourceRoot":"","sources":["../../../src/dsh-adapter/sessionTree.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,QAAQ,EAAE,SAAS,EAAiE,MAAM,qCAAqC,CAAA;AAC9J,YAAY,EAAE,eAAe,EAAE,QAAQ,EAAE,SAAS,EAAE,aAAa,EAAE,eAAe,EAAE,kBAAkB,EAAE,SAAS,EAAE,MAAM,qCAAqC,CAAA;AAC9J;;;;;;;;;;;;;;;GAeG;AACH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAA;AAG5D,wEAAwE;AACxE,MAAM,MAAM,UAAU,GAAG,SAAS,GAAG,UAAU,GAAG,WAAW,GAAG,KAAK,CAAA;AACrE,eAAO,MAAM,YAAY,EAAE,SAAS,UAAU,EAAgD,CAAA;AAE9F,wEAAwE;AACxE,MAAM,WAAW,aAAa;IAC5B,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAA;IACnB,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAA;IAC1B,QAAQ,CAAC,aAAa,CAAC,EAAE,MAAM,CAAA;IAC/B,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,CAAA;IAC5B;;;mDAG+C;IAC/C,QAAQ,CAAC,MAAM,EAAE,SAAS,YAAY,EAAE,CAAA;IACxC,uEAAuE;IACvE,QAAQ,CAAC,IAAI,EAAE,OAAO,CAAA;IACtB,6EAA6E;I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AAgB,mBAAmB,CACjC,OAAO,EAAE,SAAS,QAAQ,EAAE,EAC5B,IAAI,EAAE,SAAS,QAAQ,EAAE,EACzB,QAAQ,EAAE,MAAM,GAAG,IAAI,GACtB,MAAM,CAaR"}
@@ -1,3 +1,4 @@
1
+ import { CompactionPreviews } from './compat/compaction-previews.js';
1
2
  import { isCompactionCheckpointSource, toolResultPayload } from './compat/messages.js';
2
3
  export const TREE_FILTERS = ['default', 'no-tools', 'user-only', 'all'];
3
4
  /**
@@ -312,7 +313,9 @@ export function extractEntries(sessionId, events) {
312
313
  const openTools = new Map();
313
314
  /** Turns whose turn/end said aborted/interrupted. */
314
315
  const abortedTurns = new Set();
316
+ const compactionPreviews = new CompactionPreviews();
315
317
  for (const event of coalesceReplayEvents(events)) {
318
+ compactionPreviews.observe(event);
316
319
  if (event.type === 'turn/start') {
317
320
  turnsSeen += 1;
318
321
  inFirstTurn = markFirstTurn && turnsSeen === 1;
@@ -351,7 +354,7 @@ export function extractEntries(sessionId, events) {
351
354
  push({
352
355
  seq: event.seq,
353
356
  kind: 'compact',
354
- text: preview(summary || '(compaction)'),
357
+ text: preview(compactionPreviews.take(source) ?? (summary || '(compaction)')),
355
358
  searchText: `compact ${summary}`,
356
359
  time: event.time,
357
360
  });
@@ -55,6 +55,7 @@ export declare class SubagentActivityStore {
55
55
  * alone cannot prove how its last epoch ended). */
56
56
  onDiscovered(agentId: string, info?: {
57
57
  label?: string;
58
+ name?: string;
58
59
  childCreatedAt?: number;
59
60
  live?: boolean;
60
61
  provider?: string;
@@ -1 +1 @@
1
- {"version":3,"file":"subagents.d.ts","sourceRoot":"","sources":["../../../src/dsh-adapter/subagents.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAA;AAIlE,OAAO,KAAK,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,aAAa,EAAsC,kBAAkB,EAAE,gBAAgB,EAAsB,MAAM,kCAAkC,CAAA;AACxM,Y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AAC,KAAK,CAAC,EAAE,MAAM,CAAC;QAAC,OAAO,CAAC,EAAE,MAAM,CAAA;KAAE,GAAG,IAAI;IAU3J,mDAAmD;IACnD,OAAO,CAAC,WAAW;IAqBnB;;;;;;sCAMkC;IAClC,OAAO,CAAC,cAAc;IAyBtB,qDAAqD;IACrD,YAAY,IAAI,oBAAoB;IAWpC,WAAW,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,EAAE,UAAU,SAAc,EAAE,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI;IAChG,QAAQ,CAAC,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI;IAChE,WAAW,CAAC,OAAO,EAAE,MAAM,EAAE,MAAM,SAAc,EAAE,OAAO,CAAC,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI;IAE5F,OAAO,CAAC,MAAM;IAwBd;;;kCAG8B;IAC9B,OAAO,CAAC,gBAAgB;IAUxB;;;sDAGkD;IAClD,KAAK,IAAI,IAAI;IAYb,QAAQ,IAAI,aAAa,EAAE;IAC3B,GAAG,CAAC,OAAO,EAAE,MAAM,GAAG,aAAa,GAAG,SAAS;IAC/C,SAAS,CAAC,QAAQ,EAAE,MAAM,IAAI,GAAG,MAAM,IAAI;IAC3C,OAAO,CAAC,MAAM;CACf"}
@@ -179,13 +179,19 @@ export class SubagentActivityStore {
179
179
  const existing = this.states.get(agentId);
180
180
  if (existing !== undefined) {
181
181
  // A bus edge usually created the row first; the durable catalog fact
182
- // still carries the two things the edge never knows — the mode, and the
183
- // childId-keyed label that a queue-derived description only guessed at.
182
+ // still carries the things the edge never knows — the mode, the
183
+ // childId-keyed label that a queue-derived description only guessed at,
184
+ // and (catalog v3) the sibling-unique name.
184
185
  let changed = false;
185
186
  if (info.mode !== undefined && existing.mode === undefined) {
186
187
  existing.mode = info.mode;
187
188
  changed = true;
188
189
  }
190
+ // A name is immutable and sibling-unique, so the first fact is final.
191
+ if (info.name !== undefined && existing.name === undefined) {
192
+ existing.name = info.name;
193
+ changed = true;
194
+ }
189
195
  if (this.describeFromLabel(agentId, info.label))
190
196
  changed = true;
191
197
  if (changed)
@@ -195,9 +201,11 @@ export class SubagentActivityStore {
195
201
  // An empty label is not a fact: the row keeps a visible placeholder that a
196
202
  // later real label can still replace.
197
203
  const label = typeof info.label === 'string' && info.label !== '' ? info.label : undefined;
204
+ const name = typeof info.name === 'string' && info.name !== '' ? info.name : undefined;
198
205
  this.states.set(agentId, {
199
206
  agentId,
200
207
  description: label ?? `${info.provider ?? 'subagent'} task`,
208
+ ...(name === undefined ? {} : { name }),
201
209
  provider: info.provider ?? 'subagent',
202
210
  model: info.model ?? info.provider,
203
211
  status: info.live ? 'running' : 'unknown',
@@ -1,18 +1,22 @@
1
1
  /**
2
- * Agent Teams status at run time (issue #1241, see
3
- * docs/agent-teams-design.md「开关机制」).
2
+ * Agent Teams status and switch at run time (issue #1241; `0.2.2-rc.2`
3
+ * moved the team from an experimental bundle to a per-session selection).
4
4
  *
5
- * Switching is the upstream team bundle itself: `/plugin enable|disable`
6
- * selects or drops its layer through the host plugin manager, which persists
7
- * to the profile and, with `hmr` mounted, applies at once. `/team` is the
8
- * read-only side: it reports the bundle, the service and this session's
9
- * teammates, and is exposed only while the `agentTeams` service is mounted —
10
- * the same availability the desktop UI gives the feature. A typed `/team`
11
- * before that still answers with the enable route instead of reaching the
12
- * model.
5
+ * Two upstream mechanisms are told apart by shape, never by version:
6
+ *
7
+ * - **Selection hosts** (`0.2.2-rc.2` and later): the service ships in
8
+ * `dsh-base` and exposes `setEnabled(rootAgent, enabled)` / `isEnabled`.
9
+ * `/team on|off` writes that saved per-root selection; `/team` reports it.
10
+ * The task tools and Team guidance follow the root's selection throughout
11
+ * its subagent tree, and switching off keeps subagents and tasks.
12
+ * - **Bundle hosts** (`0.2.2-rc.1` and earlier): the service is mounted by the
13
+ * retired `dsh-experimental-agent-team-profile` bundle, so the switch stays
14
+ * `/plugin enable|disable`, and `/team` only reports plus points at it.
13
15
  *
14
16
  * What stays here besides the command is the one decision that cannot live in
15
- * a preset — which legacy delegation tools a request carries.
17
+ * a preset — which legacy delegation tools a request carries. It is a
18
+ * bundle-host seam: a selection host has no `spawn_teammate` tool, so the
19
+ * predicate is inert there.
16
20
  *
17
21
  * @module
18
22
  */
@@ -21,7 +25,8 @@ import type { LocalCommand } from '../commands.js';
21
25
  import type { TeamActiveMembers } from './plugin-manage.js';
22
26
  /**
23
27
  * Whether the team service is mounted. This is the one signal `/team` appears
24
- * on: the desktop UI shows the same feature only while its service is there.
28
+ * on: a bundle host mounts it only while the feature is on, while a selection
29
+ * host always mounts it (the saved mode decides whether the tools are there).
25
30
  * @param ctx - Host context of the composition root.
26
31
  */
27
32
  export declare function teamServiceActive(ctx: Context): boolean;
@@ -44,6 +49,11 @@ export declare function withTeamCommandVisibility(commands: readonly LocalComman
44
49
  * joined (a preset revision cannot), and a team service that never activated
45
50
  * leaves the legacy tools in place.
46
51
  *
52
+ * Bundle hosts only: a selection host (`0.2.2-rc.2` and later) has no
53
+ * `spawn_teammate`, and the standard `subagent` / `subagent_fork` tools are
54
+ * its own delegation surface, so the predicate is inert there. Kept for the
55
+ * old hosts this application still supports.
56
+ *
47
57
  * @param registered - Effective agent tool names, including inherited preset tools.
48
58
  * @returns The replaced tool names to deny, empty when the team is inactive.
49
59
  */
@@ -59,7 +69,7 @@ export declare function filterTeamReplacedTools<T extends {
59
69
  export type TeamCommand = {
60
70
  readonly kind: 'status';
61
71
  }
62
- /** `on` / `off`: the switch moved to `/plugin enable|disable`. */
72
+ /** `on` / `off`: the per-session switch on a selection host, the bundle route on a bundle host. */
63
73
  | {
64
74
  readonly kind: 'switch';
65
75
  } | {
@@ -77,14 +87,16 @@ export interface TeamCommandSink {
77
87
  /** The entry the screen calls: argument text in, report lines out. */
78
88
  export type TeamCommandEntry = (args: string, sink: TeamCommandSink) => Promise<readonly string[]>;
79
89
  /**
80
- * Wire `/team` to the running composition. The command only reports; the
81
- * bundle switch is `/plugin enable|disable`, which shares the lifecycle flow
82
- * and its confirmations.
90
+ * Wire `/team` to the running composition. On a selection host it also moves
91
+ * the switch; on a bundle host it only reports and points at
92
+ * `/plugin enable|disable` (the lifecycle flow and its confirmations).
83
93
  * @param ctx - Host context of the composition root.
84
- * @param options - The profile a CLI route names.
94
+ * @param options - The profile a CLI route names, and how to reach the bound session's live Agent.
85
95
  * @returns the command entry the screen calls.
86
96
  */
87
97
  export declare function createTeamCommandEntry(ctx: Context, options?: {
88
98
  readonly profileName?: string | undefined;
99
+ /** The bound session's live Agent, when this launch has one (DSH kernels). */
100
+ readonly rootAgent?: (() => unknown) | undefined;
89
101
  }): TeamCommandEntry;
90
102
  //# sourceMappingURL=team-mode.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"team-mode.d.ts","sourceRoot":"","sources":["../../../src/dsh-adapter/team-mode.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AACH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAA;AAClD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAA;AAElD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAA;AAS3D;;;;GAIG;AACH,wBAAgB,iBAAiB,CAAC,GAAG,EAAE,OAAO,GAAG,OAAO,CAEvD;AAED;;;;;;;;GAQG;AACH,wBAAgB,yBAAyB,CAAC,QAAQ,EAAE,SAAS,YAAY,EAAE,EAAE,OAAO,EAAE,OAAO,GAAG,SAAS,YAAY,EAAE,CAEtH;AAUD;;;;;;;;;;;GAWG;AACH,wBAAgB,oBAAoB,CAAC,UAAU,EAAE,WAAW,CAAC,MAAM,CAAC,GAAG,SAAS,MAAM,EAAE,CAGvF;AAED,6EAA6E;AAC7E,wBAAgB,uBAAuB,CAAC,CAAC,SAAS;IAChD,QAAQ,CAAC,QAAQ,EAA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AAI,EAAE,MAAM,EAAE,IAAI,EAAE,eAAe,KAAK,OAAO,CAAC,SAAS,MAAM,EAAE,CAAC,CAAA;AA6ClG;;;;;;;GAOG;AACH,wBAAgB,sBAAsB,CACpC,GAAG,EAAE,OAAO,EACZ,OAAO,GAAE;IACP,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;IACzC,8EAA8E;IAC9E,QAAQ,CAAC,SAAS,CAAC,EAAE,CAAC,MAAM,OAAO,CAAC,GAAG,SAAS,CAAA;CAC5C,GACL,gBAAgB,CAuBlB"}
@@ -7,7 +7,8 @@ import { TEAM_SPAWN_TOOL } from './team-tools.js';
7
7
  const TEAM_COMMAND_NAME = 'team';
8
8
  /**
9
9
  * Whether the team service is mounted. This is the one signal `/team` appears
10
- * on: the desktop UI shows the same feature only while its service is there.
10
+ * on: a bundle host mounts it only while the feature is on, while a selection
11
+ * host always mounts it (the saved mode decides whether the tools are there).
11
12
  * @param ctx - Host context of the composition root.
12
13
  */
13
14
  export function teamServiceActive(ctx) {
@@ -41,6 +42,11 @@ const TEAM_REPLACED_TOOLS = new Set(['subagent', 'subagent_fork']);
41
42
  * joined (a preset revision cannot), and a team service that never activated
42
43
  * leaves the legacy tools in place.
43
44
  *
45
+ * Bundle hosts only: a selection host (`0.2.2-rc.2` and later) has no
46
+ * `spawn_teammate`, and the standard `subagent` / `subagent_fork` tools are
47
+ * its own delegation surface, so the predicate is inert there. Kept for the
48
+ * old hosts this application still supports.
49
+ *
44
50
  * @param registered - Effective agent tool names, including inherited preset tools.
45
51
  * @returns The replaced tool names to deny, empty when the team is inactive.
46
52
  */
@@ -66,11 +72,42 @@ export function parseTeamArgs(args) {
66
72
  return { kind: 'unknown', sub };
67
73
  }
68
74
  /**
69
- * Wire `/team` to the running composition. The command only reports; the
70
- * bundle switch is `/plugin enable|disable`, which shares the lifecycle flow
71
- * and its confirmations.
75
+ * The per-session switch, when this service has one. Bundle hosts expose task
76
+ * methods only; their switch stays the bundle lifecycle.
77
+ * @param ctx - Host context of the composition root.
78
+ */
79
+ function teamSwitchOf(ctx) {
80
+ const service = ctx.get('agentTeams', false);
81
+ if (service === undefined || typeof service.setEnabled !== 'function' || typeof service.isEnabled !== 'function')
82
+ return undefined;
83
+ return service;
84
+ }
85
+ /**
86
+ * Resolve the root Agent that owns the saved selection. The service rejects
87
+ * descendants, so the walk is not merely a convenience.
88
+ * @param ctx - Host context of the composition root.
89
+ * @param agent - The bound session's live Agent.
90
+ * @returns the root Agent, or `undefined` when the tree cannot be resolved.
91
+ */
92
+ function rootAgentOf(ctx, agent) {
93
+ const subagents = ctx.get('subagents', false);
94
+ try {
95
+ return subagents?.rootOf?.(agent) ?? agent;
96
+ }
97
+ catch {
98
+ return undefined;
99
+ }
100
+ }
101
+ /** `/team off force`: confirms switching off while subagents are still running. */
102
+ function switchForceRequested(args) {
103
+ return /(?:^|\s)(?:force|--force|-f)(?:\s|$)/i.test(args);
104
+ }
105
+ /**
106
+ * Wire `/team` to the running composition. On a selection host it also moves
107
+ * the switch; on a bundle host it only reports and points at
108
+ * `/plugin enable|disable` (the lifecycle flow and its confirmations).
72
109
  * @param ctx - Host context of the composition root.
73
- * @param options - The profile a CLI route names.
110
+ * @param options - The profile a CLI route names, and how to reach the bound session's live Agent.
74
111
  * @returns the command entry the screen calls.
75
112
  */
76
113
  export function createTeamCommandEntry(ctx, options = {}) {
@@ -80,6 +117,13 @@ export function createTeamCommandEntry(ctx, options = {}) {
80
117
  if (parsed.kind === 'unknown') {
81
118
  return [t('team-cmd-usage', { sub: cell(parsed.sub) })];
82
119
  }
120
+ const service = teamSwitchOf(ctx);
121
+ if (service !== undefined) {
122
+ const bound = resolveBoundRoot(ctx, options.rootAgent);
123
+ if (parsed.kind === 'status')
124
+ return teamSwitchStatusLines(service, bound, sink);
125
+ return teamSwitchActionLines(service, bound, sink, args);
126
+ }
83
127
  // The mounted service is the only state `/team` reports on.
84
128
  if (parsed.kind === 'status' && teamServiceActive(ctx)) {
85
129
  return teamStatusLines(ctx, sink);
@@ -91,12 +135,91 @@ export function createTeamCommandEntry(ctx, options = {}) {
91
135
  return teamSwitchRouteLines(ctx, profile, parsed.kind === 'switch' ? 'switch' : 'not-enabled');
92
136
  };
93
137
  }
138
+ /** The bound session's root Agent, when a live DSH Agent can be reached. */
139
+ function resolveBoundRoot(ctx, rootAgent) {
140
+ if (rootAgent === undefined)
141
+ return undefined;
142
+ let agent;
143
+ try {
144
+ agent = rootAgent();
145
+ }
146
+ catch {
147
+ return undefined;
148
+ }
149
+ if (agent === undefined)
150
+ return undefined;
151
+ return rootAgentOf(ctx, agent);
152
+ }
94
153
  /**
95
- * Where the switch went, checked against this launch: the in-session lifecycle
96
- * command only when the plugin service can run it and the installation lists
97
- * the bundle; the CLI route or the DSH-line reason otherwise. A bundle the
98
- * profile already selects is not told to enable itself: with no service running
99
- * the answer is the restart or the failed activation.
154
+ * `/team` and `/team status` on a selection host: the saved mode, the service
155
+ * and the bound session's subagents.
156
+ */
157
+ function teamSwitchStatusLines(service, rootAgent, sink) {
158
+ const lines = [];
159
+ const enabled = readTeamMode(service, rootAgent);
160
+ lines.push(enabled === undefined
161
+ ? t('team-cmd-mode-unavailable')
162
+ : t('team-cmd-mode', { state: t(enabled ? 'team-cmd-on' : 'team-cmd-off') }));
163
+ lines.push(t('team-cmd-service', { state: t('team-cmd-running') }));
164
+ lines.push(...memberCountLines(sink));
165
+ if (enabled === false)
166
+ lines.push(t('team-cmd-use-switch'));
167
+ return lines;
168
+ }
169
+ /** `/team on|off` on a selection host: write the saved selection and report it. */
170
+ async function teamSwitchActionLines(service, rootAgent, sink, args) {
171
+ if (rootAgent === undefined)
172
+ return [t('team-cmd-switch-unavailable')];
173
+ // The subcommand token decides the direction. Scanning the whole argument
174
+ // string would let a stray later token flip it (`/team off on` must stay off).
175
+ const action = args.trim().split(/\s+/)[0]?.toLowerCase();
176
+ const enable = action === 'on';
177
+ const members = sink.members();
178
+ // Switching off keeps subagents and tasks on a selection host; the confirm
179
+ // only exists because running work keeps going without Team guidance. It
180
+ // counts subagents, which no longer appear in the team wire.
181
+ if (!enable && !switchForceRequested(args) && members.active + members.unseen > 0) {
182
+ return [t('team-cmd-switch-confirm', { members: String(members.active + members.unseen) })];
183
+ }
184
+ try {
185
+ await service.setEnabled(rootAgent, enable);
186
+ }
187
+ catch (error) {
188
+ return [t('team-cmd-switch-failed', { reason: cell(error instanceof Error ? error.message : String(error)) })];
189
+ }
190
+ const lines = [
191
+ t('team-cmd-mode', { state: t(enable ? 'team-cmd-on' : 'team-cmd-off') }),
192
+ ...memberCountLines(sink),
193
+ ];
194
+ if (!enable)
195
+ lines.push(t('team-cmd-use-switch'));
196
+ return lines;
197
+ }
198
+ /** The saved selection, or `undefined` when the live Agent cannot be read. */
199
+ function readTeamMode(service, rootAgent) {
200
+ if (rootAgent === undefined)
201
+ return undefined;
202
+ try {
203
+ return service.isEnabled(rootAgent);
204
+ }
205
+ catch {
206
+ return undefined;
207
+ }
208
+ }
209
+ /** The member-count tail both mechanisms share. */
210
+ function memberCountLines(sink) {
211
+ const { total, active, unseen } = sink.members();
212
+ return [total === 0
213
+ ? t('team-cmd-no-members')
214
+ : t(unseen === 0 ? 'team-cmd-members' : 'team-cmd-members-unseen', { total: String(total), active: String(active), unseen: String(unseen) })];
215
+ }
216
+ /**
217
+ * Where the switch went on a bundle host, checked against this launch: the
218
+ * in-session lifecycle command only when the plugin service can run it and the
219
+ * installation lists the bundle; the CLI route or the DSH-line reason
220
+ * otherwise. A bundle the profile already selects is not told to enable
221
+ * itself: with no service running the answer is the restart or the failed
222
+ * activation.
100
223
  */
101
224
  async function teamSwitchRouteLines(ctx, profile, kind) {
102
225
  const manager = pluginManagerOf(ctx);
@@ -122,9 +245,10 @@ async function teamSwitchRouteLines(ctx, profile, kind) {
122
245
  return [t(kind === 'switch' ? 'team-cmd-switch-moved' : 'team-cmd-not-enabled', { bundle: TEAM_BUNDLE })];
123
246
  }
124
247
  /**
125
- * `/team` and `/team status`: whether the profile selects the bundle and the
126
- * bound session's team. The caller only runs this while the service is mounted,
127
- * so the service line states that state instead of re-reading it.
248
+ * `/team` and `/team status` on a bundle host: whether the profile selects the
249
+ * bundle and the bound session's team. The caller only runs this while the
250
+ * service is mounted, so the service line states that state instead of
251
+ * re-reading it.
128
252
  */
129
253
  async function teamStatusLines(ctx, sink) {
130
254
  const manager = pluginManagerOf(ctx);
@@ -151,9 +275,6 @@ async function teamStatusLines(ctx, sink) {
151
275
  if (selected === false)
152
276
  lines.push(t('team-cmd-pending-off'));
153
277
  }
154
- const { total, active, unseen } = sink.members();
155
- lines.push(total === 0
156
- ? t('team-cmd-no-members')
157
- : t(unseen === 0 ? 'team-cmd-members' : 'team-cmd-members-unseen', { total: String(total), active: String(active), unseen: String(unseen) }));
278
+ lines.push(...memberCountLines(sink));
158
279
  return lines;
159
280
  }
@@ -1,12 +1,22 @@
1
1
  /**
2
- * Read side of DSH's experimental Agent Teams: the Lead session's `agentTeam`
3
- * projection (roster + non-deleted task board), folded for the session on
4
- * screen. Inside a teammate it reads the Lead's value, found through the
5
- * teammate header's `parentSession` (another child of the Lead reads none).
2
+ * Read side of DSH Agent Teams: the Lead session's `agentTeam` projection
3
+ * (saved selection + non-deleted task board, and — on older hosts — the
4
+ * durable member roster), folded for the session on screen. Inside a
5
+ * teammate it reads the Lead's value, found through the teammate header's
6
+ * `parentSession` (another child of the Lead reads none on a roster host).
6
7
  *
7
- * The wire value is narrowed locally (`@deepseek-ai/dsh-experimental-agent-team`
8
- * is never imported); a composition without the team service never publishes
9
- * the key and the store stays empty.
8
+ * Two upstream wire shapes are told apart by shape, never by version:
9
+ *
10
+ * - `roster` — DSH `0.2.2-rc.1` and earlier: `agentTeam` carries
11
+ * `{members, tasks, failure?}`. The team exists only while the bundle that
12
+ * mounts the service is on, so an implicit one-member team is no team.
13
+ * - `switch` — DSH `0.2.2-rc.2` and later: `agentTeam` carries
14
+ * `{enabled, tasks, failure?}` and no members; the service ships in
15
+ * `dsh-base` and each root session saves its own selection. Members are the
16
+ * Lead's current subagents, supplied by the parent `subagentCatalog`
17
+ * projection and joined here.
18
+ *
19
+ * Neither package is imported: both wire values are narrowed locally.
10
20
  *
11
21
  * @module
12
22
  */
@@ -14,7 +24,17 @@ import type { Context } from '@deepseek-ai/cordis';
14
24
  import type { TeamView } from '../adapter/ports/channel-view.js';
15
25
  import { type SessionProjectionStore, type WatchedSession } from './session-projection-store.js';
16
26
  export declare const TEAM_PROJECTION_KEY = "agentTeam";
17
- /** The upstream bundle that mounts the team service and tools: the team-mode switch. */
27
+ /**
28
+ * The parent Session's direct-child catalog, and on `switch` hosts the only
29
+ * member source. Payload version 3 rows carry the child's model-facing `name`.
30
+ */
31
+ export declare const SUBAGENT_CATALOG_KEY = "subagentCatalog";
32
+ /**
33
+ * The upstream bundle that mounts the team service on `0.2.2-rc.1` and
34
+ * earlier hosts: the legacy switch. `0.2.2-rc.2` retires it (the service and
35
+ * task tools ship in `dsh-base`, switched per root session), so the name only
36
+ * serves the old-host flows and their migration hints.
37
+ */
18
38
  export declare const TEAM_BUNDLE = "@deepseek-ai/dsh-experimental-agent-team-profile";
19
39
  /** What the channel reads: the team of one session, if any. */
20
40
  export interface TeamSource {
@@ -24,15 +44,25 @@ export interface TeamSource {
24
44
  subscribe(listener: () => void): () => void;
25
45
  }
26
46
  export type TeamRosterStore = SessionProjectionStore<TeamView> & TeamSource;
47
+ /** One direct child as the parent `subagentCatalog` projection publishes it. */
48
+ export interface CatalogChild {
49
+ readonly id: string;
50
+ /** Model-facing name (payload v3): unique among the parent's children. */
51
+ readonly name?: string;
52
+ /** Durable creation label: what the delegation asked the child to do. */
53
+ readonly label?: string;
54
+ }
27
55
  /**
28
- * Narrow one `agentTeam` value into the view the UI renders. A session's
29
- * implicit team (the Lead alone, no task, no failure) is no team: every root
30
- * session publishes that baseline once the service is mounted.
56
+ * Narrow one `agentTeam` value into the view the UI renders. Both upstream
57
+ * shapes are told apart by the value itself; a session's implicit team (the
58
+ * Lead alone, no task, no failure) is no team on a roster host, while a
59
+ * `switch` host publishes the saved selection.
31
60
  * @param value - Raw projection value.
32
61
  * @param leadSessionId - The session the value was published for.
62
+ * @param catalog - The Lead's direct-child catalog (a `switch` host's member source).
33
63
  * @returns the team view, or `undefined` when there is nothing to show.
34
64
  */
35
- export declare function asTeamView(value: unknown, leadSessionId: string): TeamView | undefined;
65
+ export declare function asTeamView(value: unknown, leadSessionId: string, catalog?: readonly CatalogChild[]): TeamView | undefined;
36
66
  interface AgentsLike {
37
67
  list(): Iterable<{
38
68
  readonly session: {
@@ -41,17 +71,22 @@ interface AgentsLike {
41
71
  }>;
42
72
  }
43
73
  /**
44
- * The team a bound session belongs to is rooted at itself, or — for a
45
- * delegated child — at its parent: teammates are direct children of the Lead.
74
+ * The team a bound session belongs to is rooted at its top-level ancestor:
75
+ * the Lead itself, or — for a delegated child — the root its creator chain
76
+ * reaches. On a roster host teammates are direct children of the Lead; a
77
+ * `switch` host can nest deeper. Loaded ancestors are followed by identity;
78
+ * one that is gone stops the walk at its recorded parent id (the value there
79
+ * is likely absent, which reads as no team rather than a stale one).
46
80
  * @param session - The bound session.
47
- * @param agents - Live agents, to find the Lead's session object for a baseline.
81
+ * @param agents - Live agents, used to find loaded ancestors for traversal and baseline snapshots.
48
82
  * @returns the session whose `agentTeam` value to read.
49
83
  */
50
84
  export declare function teamRootOf(session: unknown, agents: AgentsLike | undefined): WatchedSession;
51
85
  /**
52
- * The watched team as seen from `sessionId`: the Lead's own, or a listed
53
- * teammate's. Any other child of the Lead (a plain subagent, a workflow
54
- * spawn) is watched at the same parent but belongs to no team.
86
+ * The watched team as seen from `sessionId`: the Lead's own, or — on a
87
+ * roster host — a listed teammate's. A `switch` host's tree is the team, so
88
+ * any session watched at that Lead reads it. Any other child of a roster
89
+ * host's Lead (a plain subagent, a workflow spawn) belongs to no team.
55
90
  * @param team - The watched session's team.
56
91
  * @param sessionId - The bound session.
57
92
  * @returns the team, or `undefined` when the session is not on it.
@@ -1 +1 @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