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

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 (224) hide show
  1. package/README.md +67 -57
  2. package/bin/dsh-tui.js +26 -8
  3. package/cordis.patch.yml +5 -3
  4. package/cordis.yml +3 -2
  5. package/guide/dsh-tui-guide/claude-backend.en.md +6 -5
  6. package/guide/dsh-tui-guide/claude-backend.md +5 -5
  7. package/guide/dsh-tui-guide/configuration.en.md +1 -1
  8. package/guide/dsh-tui-guide/configuration.md +1 -1
  9. package/guide/dsh-tui-guide/getting-started.en.md +2 -2
  10. package/guide/dsh-tui-guide/getting-started.md +2 -2
  11. package/guide/dsh-tui-guide/migrate.en.md +5 -0
  12. package/guide/dsh-tui-guide/migrate.md +4 -0
  13. package/guide/dsh-tui-guide/plugins.en.md +17 -1
  14. package/guide/dsh-tui-guide/plugins.md +12 -1
  15. package/guide/dsh-tui-guide/user-guide.en.md +7 -2
  16. package/guide/dsh-tui-guide/user-guide.md +7 -2
  17. package/lib/settings.json +24 -8
  18. package/lib/types/adapter/kernel/host-facade.d.ts +3 -1
  19. package/lib/types/adapter/kernel/host-facade.d.ts.map +1 -1
  20. package/lib/types/adapter/kernel/host-facade.js +6 -0
  21. package/lib/types/adapter/kernel/runtime.d.ts.map +1 -1
  22. package/lib/types/adapter/kernel/runtime.js +5 -0
  23. package/lib/types/adapter/kernel/slices/extensions.d.ts +1 -0
  24. package/lib/types/adapter/kernel/slices/extensions.d.ts.map +1 -1
  25. package/lib/types/adapter/kernel/slices/extensions.js +6 -1
  26. package/lib/types/adapter/kernel/slices/index.d.ts +1 -1
  27. package/lib/types/adapter/kernel/slices/index.d.ts.map +1 -1
  28. package/lib/types/adapter/kernel/slices/index.js +3 -2
  29. package/lib/types/adapter/ports/channel-catalog.d.ts +19 -0
  30. package/lib/types/adapter/ports/channel-catalog.d.ts.map +1 -1
  31. package/lib/types/adapter/ports/channel-view.d.ts +39 -3
  32. package/lib/types/adapter/ports/channel-view.d.ts.map +1 -1
  33. package/lib/types/adapter/ports/extensions.d.ts +9 -0
  34. package/lib/types/adapter/ports/extensions.d.ts.map +1 -1
  35. package/lib/types/adapter/ports/index.d.ts +1 -1
  36. package/lib/types/adapter/ports/index.d.ts.map +1 -1
  37. package/lib/types/adapter/upstream/extensions-driver.d.ts +4 -1
  38. package/lib/types/adapter/upstream/extensions-driver.d.ts.map +1 -1
  39. package/lib/types/adapter/upstream/extensions-driver.js +111 -1
  40. package/lib/types/adapter/upstream/index.d.ts +1 -1
  41. package/lib/types/adapter/upstream/index.d.ts.map +1 -1
  42. package/lib/types/adapter/upstream/index.js +1 -1
  43. package/lib/types/agent/events.d.ts +3 -1
  44. package/lib/types/agent/events.d.ts.map +1 -1
  45. package/lib/types/api.d.ts +1 -1
  46. package/lib/types/api.d.ts.map +1 -1
  47. package/lib/types/backends/claude/backend.d.ts.map +1 -1
  48. package/lib/types/backends/claude/backend.js +7 -2
  49. package/lib/types/backends/claude/tools.d.ts.map +1 -1
  50. package/lib/types/backends/claude/tools.js +8 -3
  51. package/lib/types/backends/codex/translate/presentation.d.ts.map +1 -1
  52. package/lib/types/backends/codex/translate/presentation.js +5 -2
  53. package/lib/types/channel/interaction.d.ts.map +1 -1
  54. package/lib/types/channel/interaction.js +1 -0
  55. package/lib/types/channel/permissions.d.ts +15 -0
  56. package/lib/types/channel/permissions.d.ts.map +1 -1
  57. package/lib/types/channel/permissions.js +28 -0
  58. package/lib/types/channel/projection.d.ts.map +1 -1
  59. package/lib/types/channel/projection.js +11 -1
  60. package/lib/types/channel/questions.d.ts +26 -0
  61. package/lib/types/channel/questions.d.ts.map +1 -1
  62. package/lib/types/channel/questions.js +43 -0
  63. package/lib/types/commands.js +1 -1
  64. package/lib/types/components/FileSuggestions.d.ts +2 -2
  65. package/lib/types/components/FileSuggestions.d.ts.map +1 -1
  66. package/lib/types/components/FileSuggestions.js +25 -5
  67. package/lib/types/components/MessageList.d.ts.map +1 -1
  68. package/lib/types/components/MessageList.js +3 -3
  69. package/lib/types/components/PromptInput.d.ts +7 -1
  70. package/lib/types/components/PromptInput.d.ts.map +1 -1
  71. package/lib/types/components/PromptInput.js +81 -23
  72. package/lib/types/components/SplitDiffView.d.ts.map +1 -1
  73. package/lib/types/components/SplitDiffView.js +3 -2
  74. package/lib/types/components/StarPrompt.d.ts +5 -3
  75. package/lib/types/components/StarPrompt.d.ts.map +1 -1
  76. package/lib/types/components/StarPrompt.js +56 -6
  77. package/lib/types/components/SubagentCard.d.ts.map +1 -1
  78. package/lib/types/components/SubagentCard.js +1 -1
  79. package/lib/types/components/SubagentDashboard.d.ts.map +1 -1
  80. package/lib/types/components/SubagentDashboard.js +3 -2
  81. package/lib/types/components/SubagentDetailScene.d.ts.map +1 -1
  82. package/lib/types/components/SubagentDetailScene.js +1 -1
  83. package/lib/types/components/messages/AssistantToolUseMessage.d.ts.map +1 -1
  84. package/lib/types/components/messages/AssistantToolUseMessage.js +121 -23
  85. package/lib/types/components/teamRoster.d.ts +6 -3
  86. package/lib/types/components/teamRoster.d.ts.map +1 -1
  87. package/lib/types/dsh-adapter/approvals.d.ts +19 -0
  88. package/lib/types/dsh-adapter/approvals.d.ts.map +1 -1
  89. package/lib/types/dsh-adapter/approvals.js +17 -1
  90. package/lib/types/dsh-adapter/backend/translate.d.ts.map +1 -1
  91. package/lib/types/dsh-adapter/backend/translate.js +15 -3
  92. package/lib/types/dsh-adapter/channel/extensions.d.ts.map +1 -1
  93. package/lib/types/dsh-adapter/channel/extensions.js +7 -4
  94. package/lib/types/dsh-adapter/channel/local-actions.d.ts.map +1 -1
  95. package/lib/types/dsh-adapter/channel/local-actions.js +7 -3
  96. package/lib/types/dsh-adapter/channel/projection-helpers.d.ts.map +1 -1
  97. package/lib/types/dsh-adapter/channel/projection-helpers.js +4 -2
  98. package/lib/types/dsh-adapter/channel/settings-host.d.ts.map +1 -1
  99. package/lib/types/dsh-adapter/channel/settings-host.js +179 -33
  100. package/lib/types/dsh-adapter/channel/subagent-projection.d.ts +55 -4
  101. package/lib/types/dsh-adapter/channel/subagent-projection.d.ts.map +1 -1
  102. package/lib/types/dsh-adapter/channel/subagent-projection.js +80 -16
  103. package/lib/types/dsh-adapter/channel/subagent-transcript.d.ts +1 -1
  104. package/lib/types/dsh-adapter/channel/subagent-transcript.d.ts.map +1 -1
  105. package/lib/types/dsh-adapter/channel/subagent-transcript.js +6 -5
  106. package/lib/types/dsh-adapter/channel/task-completion.js +2 -10
  107. package/lib/types/dsh-adapter/childStderr.d.ts +1 -1
  108. package/lib/types/dsh-adapter/childStderr.d.ts.map +1 -1
  109. package/lib/types/dsh-adapter/childStderr.js +5 -0
  110. package/lib/types/dsh-adapter/compat/compaction-previews.d.ts +11 -0
  111. package/lib/types/dsh-adapter/compat/compaction-previews.d.ts.map +1 -0
  112. package/lib/types/dsh-adapter/compat/compaction-previews.js +38 -0
  113. package/lib/types/dsh-adapter/compat/messages.d.ts +1 -1
  114. package/lib/types/dsh-adapter/compat/messages.d.ts.map +1 -1
  115. package/lib/types/dsh-adapter/compat/messages.js +2 -2
  116. package/lib/types/dsh-adapter/contract.d.ts +12 -5
  117. package/lib/types/dsh-adapter/contract.d.ts.map +1 -1
  118. package/lib/types/dsh-adapter/contract.js +15 -4
  119. package/lib/types/dsh-adapter/experimental-bundles.d.ts +5 -0
  120. package/lib/types/dsh-adapter/experimental-bundles.d.ts.map +1 -1
  121. package/lib/types/dsh-adapter/experimental-bundles.js +0 -2
  122. package/lib/types/dsh-adapter/extensions.d.ts +3 -2
  123. package/lib/types/dsh-adapter/extensions.d.ts.map +1 -1
  124. package/lib/types/dsh-adapter/extensions.js +5 -2
  125. package/lib/types/dsh-adapter/host-contract.d.ts +1 -1
  126. package/lib/types/dsh-adapter/host-contract.js +2 -2
  127. package/lib/types/dsh-adapter/host-dsh.d.ts +6 -0
  128. package/lib/types/dsh-adapter/host-dsh.d.ts.map +1 -1
  129. package/lib/types/dsh-adapter/host-dsh.js +29 -0
  130. package/lib/types/dsh-adapter/index.d.ts +9 -1
  131. package/lib/types/dsh-adapter/index.d.ts.map +1 -1
  132. package/lib/types/dsh-adapter/index.js +5 -0
  133. package/lib/types/dsh-adapter/mention-providers.d.ts +91 -0
  134. package/lib/types/dsh-adapter/mention-providers.d.ts.map +1 -0
  135. package/lib/types/dsh-adapter/mention-providers.js +214 -0
  136. package/lib/types/dsh-adapter/migrate/entry.d.ts +2 -0
  137. package/lib/types/dsh-adapter/migrate/entry.d.ts.map +1 -0
  138. package/lib/types/dsh-adapter/migrate/entry.js +46 -0
  139. package/lib/types/dsh-adapter/oauth/account-notifications.d.ts +73 -0
  140. package/lib/types/dsh-adapter/oauth/account-notifications.d.ts.map +1 -0
  141. package/lib/types/dsh-adapter/oauth/account-notifications.js +250 -0
  142. package/lib/types/dsh-adapter/oauth/bonus.d.ts +34 -9
  143. package/lib/types/dsh-adapter/oauth/bonus.d.ts.map +1 -1
  144. package/lib/types/dsh-adapter/oauth/bonus.js +47 -5
  145. package/lib/types/dsh-adapter/oauth/deepseek.d.ts +7 -2
  146. package/lib/types/dsh-adapter/oauth/deepseek.d.ts.map +1 -1
  147. package/lib/types/dsh-adapter/oauth/deepseek.js +6 -1
  148. package/lib/types/dsh-adapter/oauth/index.d.ts.map +1 -1
  149. package/lib/types/dsh-adapter/oauth/index.js +44 -0
  150. package/lib/types/dsh-adapter/oauth/service.d.ts.map +1 -1
  151. package/lib/types/dsh-adapter/oauth/service.js +5 -6
  152. package/lib/types/dsh-adapter/plugin-manage.d.ts +6 -4
  153. package/lib/types/dsh-adapter/plugin-manage.d.ts.map +1 -1
  154. package/lib/types/dsh-adapter/plugin-manage.js +3 -2
  155. package/lib/types/dsh-adapter/plugin.d.ts +237 -6
  156. package/lib/types/dsh-adapter/plugin.d.ts.map +1 -1
  157. package/lib/types/dsh-adapter/plugin.js +611 -23
  158. package/lib/types/dsh-adapter/session-projection-store.d.ts +1 -1
  159. package/lib/types/dsh-adapter/session-projection-store.d.ts.map +1 -1
  160. package/lib/types/dsh-adapter/session-projection-store.js +30 -23
  161. package/lib/types/dsh-adapter/sessionTree.d.ts.map +1 -1
  162. package/lib/types/dsh-adapter/sessionTree.js +4 -1
  163. package/lib/types/dsh-adapter/subagents.d.ts +1 -0
  164. package/lib/types/dsh-adapter/subagents.d.ts.map +1 -1
  165. package/lib/types/dsh-adapter/subagents.js +10 -2
  166. package/lib/types/dsh-adapter/team-mode.d.ts +29 -17
  167. package/lib/types/dsh-adapter/team-mode.d.ts.map +1 -1
  168. package/lib/types/dsh-adapter/team-mode.js +138 -17
  169. package/lib/types/dsh-adapter/team-roster.d.ts +53 -18
  170. package/lib/types/dsh-adapter/team-roster.d.ts.map +1 -1
  171. package/lib/types/dsh-adapter/team-roster.js +206 -39
  172. package/lib/types/dsh-adapter/team-tools.d.ts +25 -12
  173. package/lib/types/dsh-adapter/team-tools.d.ts.map +1 -1
  174. package/lib/types/dsh-adapter/team-tools.js +81 -26
  175. package/lib/types/extensions.d.ts +2 -0
  176. package/lib/types/extensions.d.ts.map +1 -1
  177. package/lib/types/extensions.js +4 -1
  178. package/lib/types/i18n.d.ts +71 -11
  179. package/lib/types/i18n.d.ts.map +1 -1
  180. package/lib/types/i18n.js +32 -9
  181. package/lib/types/ink/dom.d.ts.map +1 -1
  182. package/lib/types/ink/dom.js +13 -3
  183. package/lib/types/ink/flush-tick.d.ts +6 -0
  184. package/lib/types/ink/flush-tick.d.ts.map +1 -1
  185. package/lib/types/ink/flush-tick.js +31 -0
  186. package/lib/types/ink/hooks/use-terminal-title.d.ts +15 -0
  187. package/lib/types/ink/hooks/use-terminal-title.d.ts.map +1 -1
  188. package/lib/types/ink/hooks/use-terminal-title.js +23 -3
  189. package/lib/types/ink/ink.js +2 -2
  190. package/lib/types/ink/jumpback-state.d.ts +33 -0
  191. package/lib/types/ink/jumpback-state.d.ts.map +1 -0
  192. package/lib/types/ink/jumpback-state.js +51 -0
  193. package/lib/types/ink/jumpback.d.ts +78 -0
  194. package/lib/types/ink/jumpback.d.ts.map +1 -0
  195. package/lib/types/ink/jumpback.js +515 -0
  196. package/lib/types/ink/log-update.js +37 -14
  197. package/lib/types/ink/notify-helper/activate.cs +836 -0
  198. package/lib/types/ink/notify-helper/compile.d.ts +30 -0
  199. package/lib/types/ink/notify-helper/compile.d.ts.map +1 -0
  200. package/lib/types/ink/notify-helper/compile.js +235 -0
  201. package/lib/types/ink/terminal-notification-windows.d.ts +8 -4
  202. package/lib/types/ink/terminal-notification-windows.d.ts.map +1 -1
  203. package/lib/types/ink/terminal-notification-windows.js +14 -21
  204. package/lib/types/ink/terminal-notification.d.ts +31 -2
  205. package/lib/types/ink/terminal-notification.d.ts.map +1 -1
  206. package/lib/types/ink/terminal-notification.js +51 -0
  207. package/lib/types/ink/terminal.d.ts +2 -1
  208. package/lib/types/ink/terminal.d.ts.map +1 -1
  209. package/lib/types/ink/terminal.js +9 -4
  210. package/lib/types/screens/AgentTranscriptScene.d.ts.map +1 -1
  211. package/lib/types/screens/AgentTranscriptScene.js +1 -1
  212. package/lib/types/screens/Chat.d.ts +8 -4
  213. package/lib/types/screens/Chat.d.ts.map +1 -1
  214. package/lib/types/screens/Chat.js +40 -11
  215. package/lib/types/settings/definitions.d.ts +12 -0
  216. package/lib/types/settings/definitions.d.ts.map +1 -1
  217. package/lib/types/settings/definitions.js +15 -7
  218. package/lib/types/utils/fileSuggestions.d.ts +14 -3
  219. package/lib/types/utils/fileSuggestions.d.ts.map +1 -1
  220. package/lib/types/utils/fileSuggestions.js +33 -0
  221. package/package.json +117 -112
  222. package/presets/liangshen/agent.cordis.yml +4 -0
  223. package/tui-profile/feed/README.md +1 -1
  224. package/tui-profile/feed/first-party.json +1 -1
@@ -1,6 +1,8 @@
1
1
  import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { sanitizeEditableText } from '../utils/inputPaste.js';
2
3
  import React from 'react';
3
- import { Box, Text, useInput, useTerminalImages, useTerminalSize } from '../ui.js';
4
+ import { afterNextTerminalFlush } from '../ink/flush-tick.js';
5
+ import { Box, Text, ScrollBox, useApp, useInput, useTerminalImages, useTerminalSize } from '../ui.js';
4
6
  import { getLang, subscribeLang, t } from '../i18n.js';
5
7
  import { Divider } from './design-system/Divider.js';
6
8
  import { HintLine } from './design-system/HintLine.js';
@@ -171,7 +173,19 @@ function couponExpiry(expiresAt) {
171
173
  return month === undefined || day === undefined || hour === undefined || minute === undefined
172
174
  ? null : { month, day, time: `${hour}:${minute}` };
173
175
  }
174
- export function WhaleCouponPrompt({ notice, onShown, onClose, }) {
176
+ /** One existing account-notice lane, with server copy when no coupon data exists. */
177
+ export function WhaleCouponPrompt(props) {
178
+ const notice = props.notice;
179
+ if (notice.kind !== 'account-notification')
180
+ return _jsx(LegacyWhaleCouponPrompt, { ...props, notice: notice });
181
+ if (notice.amount !== undefined && notice.currency !== undefined && notice.expiresAt !== undefined) {
182
+ // Keep the store's snapshot identity: allocating a presentation object here
183
+ // would re-arm the write receipt on every unrelated Chat commit.
184
+ return _jsx(LegacyWhaleCouponPrompt, { ...props, notice: notice });
185
+ }
186
+ return _jsx(ServerAccountNotice, { ...props, notice: notice });
187
+ }
188
+ function LegacyWhaleCouponPrompt({ notice, onShown, onClose, }) {
175
189
  const lang = React.useSyncExternalStore(subscribeLang, getLang);
176
190
  const { columns, rows } = useTerminalSize();
177
191
  const imagesAvailable = useTerminalImages();
@@ -186,10 +200,17 @@ export function WhaleCouponPrompt({ notice, onShown, onClose, }) {
186
200
  const amount = notice.amount.replace(/(\.\d*?)0+$/u, '$1').replace(/\.$/u, '');
187
201
  const unit = lang === 'zh' ? notice.currency === 'CNY' ? '元' : '美元' : notice.currency;
188
202
  const expiry = couponExpiry(notice.expiresAt);
189
- React.useEffect(() => {
190
- const timer = setTimeout(() => onShown(notice.orderId), 0);
191
- return () => { clearTimeout(timer); };
192
- }, [notice.orderId, onShown]);
203
+ const { stdout } = useApp();
204
+ // Register during mutation so even synchronous commits capture this card.
205
+ // A queued write is not presentation: wait for its successful completion.
206
+ // Register once per snapshot identity: an unrelated commit with a fresh
207
+ // parent callback must not re-arm the receipt, but a refreshed same-id
208
+ // snapshot must (the store rejects an ack carrying the previous snapshot).
209
+ // The callback reads the latest pair so the newest card acknowledges itself.
210
+ const receipt = React.useRef({ onShown, orderId: notice.orderId });
211
+ receipt.current.onShown = onShown;
212
+ receipt.current.orderId = notice.orderId;
213
+ React.useInsertionEffect(() => afterNextTerminalFlush(stdout, () => receipt.current.onShown(receipt.current.orderId)), [stdout, notice]);
193
214
  useInput((_input, key) => {
194
215
  if (key.return || key.escape)
195
216
  onClose();
@@ -326,3 +347,32 @@ function useConfettiFrame() {
326
347
  }, []);
327
348
  return frame;
328
349
  }
350
+ /** Server-authored account text uses the existing account-notice modal lane. */
351
+ function ServerAccountNotice({ notice, onShown, onClose }) {
352
+ const { columns, rows } = useTerminalSize();
353
+ const { stdout } = useApp();
354
+ const background = useTerminalBackground();
355
+ const scroll = React.useRef(null);
356
+ const width = Math.max(1, Math.min(columns, 72));
357
+ const height = Math.max(1, Math.min(rows, 20));
358
+ // Mutation-phase registration precedes even the synchronous test renderer's
359
+ // resetAfterCommit. The callback requires a real write, never a timer guess;
360
+ // it re-arms only when this snapshot changes (a language refresh keeps the
361
+ // same id) and reads the latest callback through the ref.
362
+ const receipt = React.useRef({ onShown, orderId: notice.orderId });
363
+ receipt.current.onShown = onShown;
364
+ receipt.current.orderId = notice.orderId;
365
+ React.useInsertionEffect(() => afterNextTerminalFlush(stdout, () => receipt.current.onShown(receipt.current.orderId)), [stdout, notice]);
366
+ useInput((_input, key, event) => {
367
+ event.stopImmediatePropagation();
368
+ if (key.return || key.escape)
369
+ onClose();
370
+ else if (key.upArrow || key.wheelUp || key.pageUp)
371
+ scroll.current?.scrollBy(key.pageUp ? -Math.max(1, height - 5) : -3);
372
+ else if (key.downArrow || key.wheelDown || key.pageDown)
373
+ scroll.current?.scrollBy(key.pageDown ? Math.max(1, height - 5) : 3);
374
+ });
375
+ const accountAction = notice.actions.find(action => action.target.type === 'app_route');
376
+ const dismiss = notice.actions.find(action => action.target.type === 'dismiss');
377
+ return _jsxs(_Fragment, { children: [_jsx(Box, { position: "absolute", bottom: 0, left: 0, width: "100%", height: rows, backdrop: "dim", onClick: onClose }), _jsxs(Box, { position: "absolute", left: Math.max(0, Math.floor((columns - width) / 2)), bottom: Math.max(0, Math.floor((rows - height) / 2)), width: width, height: height, flexDirection: "column", borderStyle: "round", borderColor: "inactive", paddingX: 1, backgroundColor: background, opaque: true, overflow: "hidden", onClick: event => event.stopImmediatePropagation(), children: [_jsx(Box, { flexShrink: 0, children: _jsx(Text, { bold: true, color: "accent", wrap: "truncate-end", children: sanitizeEditableText(notice.title) }) }), _jsxs(ScrollBox, { ref: scroll, flexDirection: "column", flexGrow: 1, height: Math.max(1, height - 5), children: [_jsx(Text, { wrap: "wrap", children: sanitizeEditableText(notice.body) }), accountAction !== undefined && _jsx(Text, { dimColor: true, wrap: "wrap", children: t('account-notice-account-route', { label: sanitizeEditableText(accountAction.label) }) })] }), _jsx(Box, { flexShrink: 0, children: _jsx(Text, { dimColor: true, wrap: "wrap", children: t('account-notice-hint', { label: dismiss === undefined ? t('account-notice-close') : sanitizeEditableText(dismiss.label) }) }) })] })] });
378
+ }
@@ -1 +1 @@
1
- {"version":3,"file":"SubagentCard.d.ts","sourceRoot":"","sources":["../../../src/components/SubagentCard.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAmB,MAAM,OAAO,CAAA;AAEvC,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAA;AAIhE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,8BAA8B,CAAA;AAC9D,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAA;AAOvD,MAAM,WAAW,iBAAiB;IAChC,QAAQ,EAAE,aAAa,CAAA;IACvB,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,OAAO,CAAC,CAAC,KA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;KAAE,CAAA;CAC1E;AAED,yEAAyE;AACzE,wBAAgB,eAAe,CAAC,MAAM,EAAE,gBAAgB,EAAE,SAAS,EAAE,OAAO,GAAG;IAAE,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,KAAK,CAAC,EAAE,SAAS,GAAG,QAAQ,GAAG,OAAO,GAAG,QAAQ,CAAA;CAAE,CAQpK;AAED,wBAAgB,YAAY,CAAC,EAAE,QAAQ,EAAE,OAAO,EAAE,OAAO,EAAE,OAAmB,EAAE,UAAU,EAAE,EAAE,iBAAiB,GAAG,KAAK,CAAC,SAAS,CAgGhI"}
@@ -70,7 +70,7 @@ export function SubagentCard({ subagent, focused, onClick, variant = 'default',
70
70
  subagent.effort,
71
71
  shownDuration === undefined ? undefined : formatDuration(shownDuration),
72
72
  ].filter(part => part !== undefined && part !== '').join(' · ');
73
- return _jsxs(Box, { ref: clockRef, flexDirection: "column", paddingLeft: 1, marginBottom: panelMode ? 0 : 1, onClick: onClick, onMouseEnter: onClick !== undefined ? () => setHovered(true) : undefined, onMouseLeave: onClick !== undefined ? () => setHovered(false) : undefined, backgroundColor: hoverTint ? 'userMessageBackgroundHover' : undefined, children: [_jsxs(Box, { flexDirection: "row", children: [_jsx(Box, { flexShrink: 0, marginRight: 1, children: _jsx(Text, { color: glyphColor, children: glyph }) }), _jsx(Box, { flexGrow: 1, flexShrink: 1, overflow: "hidden", children: _jsx(Text, { bold: true, color: focused ? 'accent' : undefined, wrap: "truncate-end", children: teamMember !== undefined ? teamMember.name : panelMode ? subagent.description : `${t('subagent-card-prefix')}${subagent.description}` }) }), teamMember !== undefined && (_jsx(Box, { flexShrink: 0, marginLeft: 1, children: _jsx(Text, { color: focused ? 'accent' : teamGlyph?.color, dimColor: teamMember.status === 'provisioning', children: t(`team-status-${teamMember.status}`) }) })), teamMember === undefined && subagent.mode === 'continuable' && (_jsx(Box, { flexShrink: 0, marginLeft: 1, children: _jsx(Text, { color: focused ? 'accent' : 'warning', children: t('subagent-mode-continuable') }) })), teamMember === undefined && subagent.mode === 'one-shot' && (_jsx(Box, { flexShrink: 0, marginLeft: 1, children: _jsx(Text, { dimColor: true, children: t('subagent-mode-one-shot') }) })), !panelMode && meta !== '' && (_jsx(Box, { flexShrink: 0, marginLeft: 1, children: _jsx(Text, { dimColor: true, wrap: "truncate-end", children: meta }) }))] }), panelMode && panelMeta !== '' && _jsx(Box, { paddingLeft: 3, children: _jsx(Text, { dimColor: true, wrap: "wrap", children: panelMeta }) }), panelMode
73
+ return _jsxs(Box, { ref: clockRef, flexDirection: "column", paddingLeft: 1, marginBottom: panelMode ? 0 : 1, onClick: onClick, onMouseEnter: onClick !== undefined ? () => setHovered(true) : undefined, onMouseLeave: onClick !== undefined ? () => setHovered(false) : undefined, backgroundColor: hoverTint ? 'userMessageBackgroundHover' : undefined, children: [_jsxs(Box, { flexDirection: "row", children: [_jsx(Box, { flexShrink: 0, marginRight: 1, children: _jsx(Text, { color: glyphColor, children: glyph }) }), _jsx(Box, { flexGrow: 1, flexShrink: 1, overflow: "hidden", children: _jsx(Text, { bold: true, color: focused ? 'accent' : undefined, wrap: "truncate-end", children: teamMember !== undefined ? teamMember.name : panelMode ? subagent.description : `${t('subagent-card-prefix')}${subagent.description}` }) }), teamMember === undefined && subagent.name !== undefined && subagent.name !== '' && (_jsx(Box, { flexShrink: 1, overflow: "hidden", marginLeft: 1, children: _jsx(Text, { dimColor: true, wrap: "truncate-end", children: subagent.name }) })), teamMember !== undefined && (_jsx(Box, { flexShrink: 0, marginLeft: 1, children: _jsx(Text, { color: focused ? 'accent' : teamGlyph?.color, dimColor: teamMember.status === 'provisioning', children: t(`team-status-${teamMember.status}`) }) })), teamMember === undefined && subagent.mode === 'continuable' && (_jsx(Box, { flexShrink: 0, marginLeft: 1, children: _jsx(Text, { color: focused ? 'accent' : 'warning', children: t('subagent-mode-continuable') }) })), teamMember === undefined && subagent.mode === 'one-shot' && (_jsx(Box, { flexShrink: 0, marginLeft: 1, children: _jsx(Text, { dimColor: true, children: t('subagent-mode-one-shot') }) })), !panelMode && meta !== '' && (_jsx(Box, { flexShrink: 0, marginLeft: 1, children: _jsx(Text, { dimColor: true, wrap: "truncate-end", children: meta }) }))] }), panelMode && panelMeta !== '' && _jsx(Box, { paddingLeft: 3, children: _jsx(Text, { dimColor: true, wrap: "wrap", children: panelMeta }) }), panelMode
74
74
  ? previewRows.map(row => _jsx(Text, { dimColor: true, wrap: "truncate", children: ` ${row.text}` }, row.key))
75
75
  : liveLine !== undefined && _jsx(Text, { dimColor: true, wrap: "truncate", children: ` │ ${liveLine}` })] });
76
76
  }
@@ -1 +1 @@
1
- {"version":3,"file":"SubagentDashboard.d.ts","sourceRoot":"","sources":["../../../src/components/SubagentDashboard.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAGzB,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAA;AAOhE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAA;AAE7D,OAAO,KAAK,EAAE,gBAAgB,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAA;AAC9E,OAAO,KAAK,EAAY,QAAQ,EAAE,MAAM,kCAAkC,CAAA;AAK1E,MAAM,WAAW,sBAAsB;IACrC,SAAS,EAAE,SAAS,aAAa,EAAE,CAAA;IACnC,+EAA+E;IAC/E,QAAQ,CAAC,KAAK,CAAC,EAAE,SAAS,aAAa,EAAE,CAAA;IACzC;mDAC+C;IAC/C,OAAO,CAAC,EAAE,MAAM,IAAI,CAAA;IACpB,QAAQ,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAA;IACpC;0BACsB;IACtB,UAAU,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAA;IACtC,wCAAwC;IACxC,QAAQ,CAAC,EAAE,SAAS,gBAAgB,EAAE,CAAA;IACtC;6DACyD;IACzD,IAAI,CAAC,EAAE,QAAQ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C,EAAE,MAAM,IAAI,CAAA;IACpB,QAAQ,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAA;IACpC;0BACsB;IACtB,UAAU,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAA;IACtC,wCAAwC;IACxC,QAAQ,CAAC,EAAE,SAAS,gBAAgB,EAAE,CAAA;IACtC;6DACyD;IACzD,IAAI,CAAC,EAAE,QAAQ,CAAA;IACf;2DACuD;IACvD,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB;iCAC6B;IAC7B,OAAO,CAAC,EAAE,SAAS,GAAG,OAAO,CAAA;IAC7B,+CAA+C;IAC/C,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,OAAO,CAAC,EAAE,OAAO,CAAA;CAClB;AAED,2EAA2E;AAC3E,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,EAAE,iBAAiB,GAAG,OAAO,CAOjF;AAED,yCAAyC;AACzC,wBAAgB,UAAU,CAAC,EAAE,OAAO,EAAE,EAAE;IAAE,OAAO,EAAE,MAAM,IAAI,CAAA;CAAE,GAAG,KAAK,CAAC,SAAS,CAWhF;AAiED;;;GAGG;AACH,wBAAgB,iBAAiB,CAAC,EAChC,SAAS,EACT,IAAI,EACJ,SAAS,EACT,KAAK,EACL,OAAO,EACP,QAAQ,EACR,UAAU,EACV,QAAQ,EACR,OAAmB,EACnB,OAAc,EACd,OAAc,GACf,EAAE,sBAAsB,GAAG,KAAK,CAAC,SAAS,CA6T1C"}
@@ -28,7 +28,7 @@ export function ExitButton({ onClick }) {
28
28
  /** A teammate the host has not announced as a subagent yet. */
29
29
  function TeamRosterOnlyRow({ row, focused, panelMode, self }) {
30
30
  const { glyph, color } = teamStatusGlyph(row.status, isMinimalUiMode());
31
- return (_jsxs(Box, { flexDirection: "row", paddingLeft: 1, marginBottom: panelMode ? 0 : 1, children: [_jsx(Box, { flexShrink: 0, marginRight: 1, children: _jsx(Text, { color: color, children: glyph }) }), _jsx(Box, { flexGrow: 1, flexShrink: 1, overflow: "hidden", children: _jsxs(Text, { wrap: "truncate-end", children: [_jsx(Text, { bold: true, color: focused ? 'accent' : undefined, children: row.member.name }), self && _jsx(Text, { dimColor: true, children: ' · ' + t('team-self-mark') })] }) }), _jsx(Box, { flexShrink: 0, marginLeft: 1, children: _jsx(Text, { color: focused ? 'accent' : color, dimColor: row.status === 'provisioning', children: t(`team-status-${row.status}`) }) })] }));
31
+ return (_jsxs(Box, { flexDirection: "row", paddingLeft: 1, marginBottom: panelMode ? 0 : 1, children: [_jsx(Box, { flexShrink: 0, marginRight: 1, children: _jsx(Text, { color: color, children: glyph }) }), _jsx(Box, { flexGrow: 1, flexShrink: 1, overflow: "hidden", children: _jsxs(Text, { wrap: "truncate-end", children: [_jsx(Text, { bold: true, color: focused ? 'accent' : undefined, children: row.member.name }), row.member.description !== undefined && _jsx(Text, { dimColor: true, children: ' · ' + row.member.description }), self && _jsx(Text, { dimColor: true, children: ' · ' + t('team-self-mark') })] }) }), _jsx(Box, { flexShrink: 0, marginLeft: 1, children: _jsx(Text, { color: focused ? 'accent' : color, dimColor: row.status === 'provisioning', children: t(`team-status-${row.status}`) }) })] }));
32
32
  }
33
33
  const TASK_GLYPH = {
34
34
  pending: { glyph: '○', color: 'subtle' },
@@ -164,7 +164,8 @@ export function SubagentDashboard({ subagents, team, sessionId, peers, onClose,
164
164
  const outer = panelMode
165
165
  ? { paddingLeft: 1, paddingRight: 1, paddingTop: 0 }
166
166
  : { paddingX: 2, paddingY: 1 };
167
- return (_jsxs(Box, { flexDirection: "column", ...outer, children: [!panelMode && _jsx(Divider, { color: "accent", title: t(team === undefined ? 'subagent-dashboard-title' : 'team-dashboard-title') }), _jsxs(Box, { flexDirection: "row", gap: 3, marginTop: panelMode ? 0 : 1, marginBottom: panelMode ? 0 : 1, children: [team !== undefined ? (_jsx(Box, { flexShrink: 1, overflow: "hidden", children: _jsxs(Text, { wrap: "truncate-end", children: [_jsx(Text, { color: "accent", children: memberCount('running') }), _jsx(Text, { dimColor: true, children: ' ' + t('team-status-running') + teamSep }), _jsx(Text, { color: "accent", children: memberCount('idle') }), _jsx(Text, { dimColor: true, children: ' ' + t('team-status-idle') + teamSep }), memberCount('provisioning') > 0 && (_jsxs(_Fragment, { children: [_jsx(Text, { dimColor: true, children: memberCount('provisioning') }), _jsx(Text, { dimColor: true, children: ' ' + t('team-status-provisioning') + teamSep })] })), memberCount('active') > 0 && (_jsxs(_Fragment, { children: [_jsx(Text, { color: "accent", children: memberCount('active') }), _jsx(Text, { dimColor: true, children: ' ' + t('team-status-active') + teamSep })] })), memberCount('failed') > 0 && (_jsxs(_Fragment, { children: [_jsx(Text, { color: "error", children: memberCount('failed') }), _jsx(Text, { dimColor: true, children: ' ' + t('team-status-failed') + teamSep })] })), _jsx(Text, { dimColor: true, children: t('team-tasks-count', teamTaskProgress(team.tasks)) })] }) })) : (_jsxs(_Fragment, { children: [_jsxs(Text, { children: [_jsx(Text, { color: "accent", children: running }), _jsxs(Text, { dimColor: true, children: [" ", t('subagent-count-running')] })] }), _jsxs(Text, { children: [_jsx(Text, { color: "success", children: completed }), _jsxs(Text, { dimColor: true, children: [" ", t('subagent-count-completed')] })] }), failed > 0 && (_jsxs(Text, { children: [_jsx(Text, { color: "error", children: failed }), _jsxs(Text, { dimColor: true, children: [" ", t('subagent-count-failed')] })] })), nested > 0 && (_jsxs(Text, { children: [_jsx(Text, { color: "accent", children: nested }), _jsxs(Text, { dimColor: true, children: [" ", t('subagent-count-nested')] })] }))] })), _jsx(Box, { flexGrow: 1 }), !panelMode && onClose !== undefined && _jsx(ExitButton, { onClick: onClose })] }), team?.failure !== undefined && (_jsx(Text, { color: "error", wrap: "wrap", children: '⚠ ' + t('team-failure', { failure: team.failure }) })), channelFailures.map(summary => (_jsx(Text, { color: "error", wrap: "wrap", children: '⚠ ' + t('subagent-channel-degraded', {
167
+ const teamOff = team !== undefined && team.mode === 'switch' && !team.enabled;
168
+ return (_jsxs(Box, { flexDirection: "column", ...outer, children: [!panelMode && (_jsx(Divider, { color: "accent", title: t(team === undefined ? 'subagent-dashboard-title' : teamOff ? 'team-dashboard-title-off' : 'team-dashboard-title') })), _jsxs(Box, { flexDirection: "row", gap: 3, marginTop: panelMode ? 0 : 1, marginBottom: panelMode ? 0 : 1, children: [team !== undefined ? (_jsx(Box, { flexShrink: 1, overflow: "hidden", children: _jsxs(Text, { wrap: "truncate-end", children: [_jsx(Text, { color: "accent", children: memberCount('running') }), _jsx(Text, { dimColor: true, children: ' ' + t('team-status-running') + teamSep }), _jsx(Text, { color: "accent", children: memberCount('idle') }), _jsx(Text, { dimColor: true, children: ' ' + t('team-status-idle') + teamSep }), memberCount('provisioning') > 0 && (_jsxs(_Fragment, { children: [_jsx(Text, { dimColor: true, children: memberCount('provisioning') }), _jsx(Text, { dimColor: true, children: ' ' + t('team-status-provisioning') + teamSep })] })), memberCount('active') > 0 && (_jsxs(_Fragment, { children: [_jsx(Text, { color: "accent", children: memberCount('active') }), _jsx(Text, { dimColor: true, children: ' ' + t('team-status-active') + teamSep })] })), memberCount('failed') > 0 && (_jsxs(_Fragment, { children: [_jsx(Text, { color: "error", children: memberCount('failed') }), _jsx(Text, { dimColor: true, children: ' ' + t('team-status-failed') + teamSep })] })), _jsx(Text, { dimColor: true, children: t('team-tasks-count', teamTaskProgress(team.tasks)) })] }) })) : (_jsxs(_Fragment, { children: [_jsxs(Text, { children: [_jsx(Text, { color: "accent", children: running }), _jsxs(Text, { dimColor: true, children: [" ", t('subagent-count-running')] })] }), _jsxs(Text, { children: [_jsx(Text, { color: "success", children: completed }), _jsxs(Text, { dimColor: true, children: [" ", t('subagent-count-completed')] })] }), failed > 0 && (_jsxs(Text, { children: [_jsx(Text, { color: "error", children: failed }), _jsxs(Text, { dimColor: true, children: [" ", t('subagent-count-failed')] })] })), nested > 0 && (_jsxs(Text, { children: [_jsx(Text, { color: "accent", children: nested }), _jsxs(Text, { dimColor: true, children: [" ", t('subagent-count-nested')] })] }))] })), _jsx(Box, { flexGrow: 1 }), !panelMode && onClose !== undefined && _jsx(ExitButton, { onClick: onClose })] }), team?.failure !== undefined && (_jsx(Text, { color: "error", wrap: "wrap", children: '⚠ ' + t('team-failure', { failure: team.failure }) })), teamOff && _jsx(Text, { dimColor: true, wrap: "wrap", children: t('team-mode-off-note') }), channelFailures.map(summary => (_jsx(Text, { color: "error", wrap: "wrap", children: '⚠ ' + t('subagent-channel-degraded', {
168
169
  provider: summary.provider,
169
170
  failed: summary.failed,
170
171
  settled: summary.settled,
@@ -1 +1 @@
1
- {"version":3,"file":"SubagentDetailScene.d.ts","sourceRoot":"","sources":["../../../src/components/SubagentDetailScene.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAEzB,OAAO,KAAK,EAAsB,aAAa,EAAE,MAAM,6BAA6B,CAAA;AAIpF,OAAO,KAAK,EAAE,kBAAkB,EAAE,mBAAmB,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAA;AAExG,OAAO,EAKL,KAAK,gBAAgB,EACtB,MAAM,kCAAkC,CAAA;AA+JzC,MAAM,WAAW,wBAAwB;IACvC,QAAQ,EAAE,aAAa,CAAA;IACvB,+DAA+D;IAC/D,aAAa,CAAC,EAAE,CAAC,QAAQ,EAAE,aAAa,KAAK,IAAI,CAAA;IACjD,MAAM,EAAE,MAAM,IAAI,CAAA;IAClB,WAAW,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAA;IACvC;;qDAEiD;IACjD,cAAc,CAAC,EAAE,gBAAgB,CAAA;IACjC,yBAAyB;IACzB,UAAU,CAAC,EAAE,MAAM,IAAI,CAAA;IACvB,iCAAiC;IACjC,QAAQ,CAAC,EAAE,SAAS,gBAAgB,EAAE,CAAA;IACtC,gDAAgD;IAChD,OAAO,CAAC,EAAE;QAAE,QAAQ,CAAC,OAAO,EAAE,mBAAmB,CAAC;QAAC,QAAQ,CAAC,MAAM,EAAE,kBAAkB,CAAA;KAAE,CAAA;IACxF;iCAC6B;IAC7B,OAAO,CAAC,EAAE,SAAS,GAAG,OAAO,CAAA;IAC7B,+CAA+C;IAC/C,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,OAAO,CAAC,EAAE,OAAO,CAAA;CAClB;AAED;;;;;;GAMG;AACH,wBAAgB,mBAAmB,CAAC,EAClC,QAAQ,EACR,aAAa,EACb,MAAM,EACN,WAAW,EACX,cAAc,EACd,UAAU,EACV,QAAa,EACb,OAAO,EACP,OAAmB,EACnB,OAAc,EACd,OAAc,GACf,EAAE,wBAAwB,GAAG,KAAK,CAAC,SAAS,CAomB5C"}
1
+ {"version":3,"file":"SubagentDetailScene.d.ts","sourceRoot":"","sources":["../../../src/components/SubagentDetailScene.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAEzB,OAAO,KAAK,EAAsB,aAAa,EAAE,MAAM,6BAA6B,CAAA;AAIpF,OAAO,KAAK,EAAE,kBAAkB,EAAE,mBAAmB,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAA;AAExG,OAAO,EAKL,KAAK,gBAAgB,EACtB,MAAM,kCAAkC,CAAA;AA+JzC,MAAM,WAAW,wBAAwB;IACvC,QAAQ,EAAE,aAAa,CAAA;IACvB,+DAA+D;IAC/D,aAAa,CAAC,EAAE,CAAC,QAAQ,EAAE,aAAa,KAAK,IAAI,CAAA;IACjD,MAAM,EAAE,MAAM,IAAI,CAAA;IAClB,WAAW,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAA;IACvC;;qDAEiD;IACjD,cAAc,CAAC,EAAE,gBAAgB,CAAA;IACjC,yBAAyB;IACzB,UAAU,CAAC,EAAE,MAAM,IAAI,CAAA;IACvB,iCAAiC;IACjC,QAAQ,CAAC,EAAE,SAAS,gBAAgB,EAAE,CAAA;IACtC,gDAAgD;IAChD,OAAO,CAAC,EAAE;QAAE,QAAQ,CAAC,OAAO,EAAE,mBAAmB,CAAC;QAAC,QAAQ,CAAC,MAAM,EAAE,kBAAkB,CAAA;KAAE,CAAA;IACxF;iCAC6B;IAC7B,OAAO,CAAC,EAAE,SAAS,GAAG,OAAO,CAAA;IAC7B,+CAA+C;IAC/C,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,OAAO,CAAC,EAAE,OAAO,CAAA;CAClB;AAED;;;;;;GAMG;AACH,wBAAgB,mBAAmB,CAAC,EAClC,QAAQ,EACR,aAAa,EACb,MAAM,EACN,WAAW,EACX,cAAc,EACd,UAAU,EACV,QAAa,EACb,OAAO,EACP,OAAmB,EACnB,OAAc,EACd,OAAc,GACf,EAAE,wBAAwB,GAAG,KAAK,CAAC,SAAS,CA2mB5C"}
@@ -398,7 +398,7 @@ export function SubagentDetailScene({ subagent, onFailureRead, onBack, onInterru
398
398
  const outer = panelMode
399
399
  ? { paddingLeft: 1, paddingRight: 1, paddingTop: 0 }
400
400
  : { paddingX: 2, paddingY: 1 };
401
- return (_jsxs(Box, { flexDirection: "column", ...outer, children: [_jsxs(Box, { flexDirection: "row", gap: 1, children: [_jsx(Text, { color: info.color, bold: true, children: info.glyph }), _jsx(Text, { bold: true, children: `${t('subagent-card-prefix')}${subagent.description}` }), _jsx(Text, { dimColor: true, children: "\u00B7" }), _jsx(Text, { color: info.color, children: info.label }), subagent.mode === 'continuable' && _jsx(Text, { color: "warning", children: t('subagent-mode-continuable') }), subagent.mode === 'one-shot' && _jsx(Text, { dimColor: true, children: t('subagent-mode-one-shot') }), _jsx(Box, { flexGrow: 1 }), onOpenView !== undefined && (_jsx(Box, { onClick: openMainView, children: _jsx(Text, { color: "subtle", children: "\u2922" }) })), _jsx(ExitButton, { onClick: onBack })] }), _jsxs(Text, { children: [_jsx(Text, { children: subagent.model ?? subagent.provider ?? 'default' }), _jsxs(Text, { dimColor: true, children: [shownDuration !== undefined ? ` · ${formatDuration(shownDuration)} · ` : ' · ', totalTokens || '—', " tok \u00B7 ", toolsCount, " tools"] })] }), _jsxs(Text, { dimColor: true, children: [`${t('subagent-started')} ${formatTimestamp(subagent.startedAt)}`
401
+ return (_jsxs(Box, { flexDirection: "column", ...outer, children: [_jsxs(Box, { flexDirection: "row", gap: 1, children: [_jsx(Text, { color: info.color, bold: true, children: info.glyph }), _jsx(Text, { bold: true, children: `${t('subagent-card-prefix')}${subagent.description}` }), subagent.name !== undefined && subagent.name !== '' && (_jsx(Box, { flexShrink: 1, overflow: "hidden", children: _jsx(Text, { color: "accent", wrap: "truncate-end", children: subagent.name }) })), _jsx(Text, { dimColor: true, children: "\u00B7" }), _jsx(Text, { color: info.color, children: info.label }), subagent.mode === 'continuable' && _jsx(Text, { color: "warning", children: t('subagent-mode-continuable') }), subagent.mode === 'one-shot' && _jsx(Text, { dimColor: true, children: t('subagent-mode-one-shot') }), _jsx(Box, { flexGrow: 1 }), onOpenView !== undefined && (_jsx(Box, { onClick: openMainView, children: _jsx(Text, { color: "subtle", children: "\u2922" }) })), _jsx(ExitButton, { onClick: onBack })] }), _jsxs(Text, { children: [_jsx(Text, { children: subagent.model ?? subagent.provider ?? 'default' }), _jsxs(Text, { dimColor: true, children: [shownDuration !== undefined ? ` · ${formatDuration(shownDuration)} · ` : ' · ', totalTokens || '—', " tok \u00B7 ", toolsCount, " tools"] })] }), _jsxs(Text, { dimColor: true, children: [`${t('subagent-started')} ${formatTimestamp(subagent.startedAt)}`
402
402
  + (subagent.completedAt ? ` · ${t('subagent-completed')} ${formatTimestamp(subagent.completedAt)}` : ''), ` · id ${subagent.agentId.slice(0, 8)}`] }), subagent.error && (_jsx(Box, { marginTop: 0, children: _jsx(Text, { color: "error", wrap: "wrap", children: `${t('subagent-error-label')}: ${subagent.error}` }) })), _jsxs(Box, { flexDirection: "row", gap: 0, marginTop: 1, children: [tab('summary', t('subagent-tab-summary')), tab('output', subagent.outputEvents.length > 0 ? `${t('subagent-output-label')} ${subagent.outputEvents.length}` : t('subagent-output-label')), loadTranscript !== undefined && tab('transcript', t('subagent-tab-transcript')), tab('tools', toolsCount > 0 ? `${t('subagent-tools')} ${toolsCount}` : t('subagent-tools')), messages.length > 0 && tab('messages', `${t('agent-messages-tab')} ${messages.length}`), _jsx(Text, { dimColor: true, children: ` ${pageIndex + 1}/${pages.length}` })] }), _jsx(Text, { dimColor: true, children: '─'.repeat(Math.max(20, Math.min(72, columns - 6))) }), activePage === 'output' && loadTranscript === undefined && subagent.outputEvents.length >= OUTPUT_WINDOW_CAP && (_jsx(Text, { dimColor: true, children: t('subagent-transcript-retained', { count: subagent.outputEvents.length }) })), _jsx(Box, { flexDirection: "column", paddingX: 1, maxHeight: panelMode ? Math.max(6, rows - 10) : Math.max(10, rows - 14), children: _jsxs(ScrollBox, { ref: scrollRef, flexDirection: "column", flexGrow: 1, children: [activePage === 'summary' && (_jsxs(Box, { flexDirection: "column", children: [_jsx(StatGrid, { subagent: subagent, totalTokens: totalTokens, elapsed: elapsed, statusLabel: info.label, statusColor: info.color }), subagent.summary && (_jsxs(Box, { flexDirection: "column", marginTop: 1, children: [_jsx(Text, { dimColor: true, bold: true, children: '─ summary ' }), _jsx(Text, { wrap: "wrap", children: subagent.summary })] })), !subagent.summary && (_jsx(Text, { dimColor: true, children: isRunning ? t('subagent-no-output') : t('subagent-no-summary') }))] })), activePage === 'output' && (subagent.outputEvents.length === 0 && subagent.output.length === 0 ? (_jsx(Text, { dimColor: true, children: t('subagent-no-output') })) : (_jsx(_Fragment, { children: blocks.map((block, index) => {
403
403
  if (block.kind === 'thinking') {
404
404
  const text = block.lines.map(line => line.text).join('\n');
@@ -1 +1 @@
1
- {"version":3,"file":"AssistantToolUseMessage.d.ts","sourceRoot":"","sources":["../../../../src/components/messages/AssistantToolUseMessage.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAKzB,OAAO,KAAK,EAA8C,OAAO,EAAE,MAAM,8BAA8B,CAAA;AASvG,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAA;AAC9D,OAAO,KAA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,UAAkB,EAClB,OAAO,EACP,QAAQ,EACR,UAAmB,EACnB,cAAuB,EACvB,UAAU,EACV,mBAA2B,EAC3B,YAAoB,EACpB,KAAa,EACb,aAAa,EACb,YAAoB,EACpB,UAAkB,GACnB,EAAE,KAAK,GAAG,KAAK,CAAC,SAAS,CAmYzB"}
1
+ {"version":3,"file":"AssistantToolUseMessage.d.ts","sourceRoot":"","sources":["../../../../src/components/messages/AssistantToolUseMessage.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAMzB,OAAO,KAAK,EAA8C,OAAO,EAAE,MAAM,8BAA8B,CAAA;AASvG,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAA;AAC9D,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAA;AAC3C,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iCAAiC,CAAA;AAUjE,KAAK,KAAK,GAAG;IACX,IAAI,EAAE,OAAO,CAAA;IACb,4CAA4C;IAC5C,eAAe,EAAE,OAAO,CAAA;IACxB,iEAAiE;IACjE,OAAO,EAAE,OAAO,CAAA;IAChB,wCAAwC;IACxC,UAAU,CAAC,EAAE,OAAO,CAAA;IACpB;qCACiC;IACjC,UAAU,CAAC,EAAE,OAAO,CAAA;IACpB;;;;OAIG;IACH,OAAO,CAAC,CAAC,KAAK,EAAE,UAAU,GAAG,IAAI,CAAA;IACjC;;;;;;;OAOG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,oEAAoE;IACpE,UAAU,CAAC,EAAE,MAAM,GAAG,OAAO,GAAG,SAAS,CAAA;IACzC,2EAA2E;IAC3E,cAAc,CAAC,EAAE,cAAc,CAAA;IAC/B;;;;;OAKG;IACH,UAAU,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAA;IACnC;;;;OAIG;IACH,mBAAmB,CAAC,EAAE,OAAO,CAAA;IAC7B;;;;;;;OAOG;IACH,YAAY,CAAC,EAAE,OAAO,CAAA;IACtB;8CAC0C;IAC1C,KAAK,CAAC,EAAE,OAAO,CAAA;IACf,qFAAqF;IACrF,aAAa,CAAC,EAAE,MAAM,CAAA;IACtB;;;4BAGwB;IACxB,YAAY,CAAC,EAAE,OAAO,CAAA;IACtB;;6BAEyB;IACzB,UAAU,CAAC,EAAE,OAAO,CAAA;CACrB,CAAA;AA2LD,wBAAgB,aAAa,CAAC,GAAG,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,QAAQ,GAAG,MAAM,GAAG,OAAO,GAAG,MAAM,KAAK,CAS9F;AAmfD;;;;;GAKG;AACH,wBAAgB,uBAAuB,CAAC,EACtC,IAAI,EACJ,eAAe,EACf,OAAO,EACP,UAAkB,EAClB,UAAkB,EAClB,OAAO,EACP,QAAQ,EACR,UAAmB,EACnB,cAAuB,EACvB,UAAU,EACV,mBAA2B,EAC3B,YAAoB,EACpB,KAAa,EACb,aAAa,EACb,YAAoB,EACpB,UAAkB,GACnB,EAAE,KAAK,GAAG,KAAK,CAAC,SAAS,CA4YzB"}
@@ -1,6 +1,7 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
2
  import React from 'react';
3
3
  import { extname } from 'node:path';
4
+ import * as JsDiff from 'diff';
4
5
  import { Box, Text, useTerminalSize } from '../../ui.js';
5
6
  import { stringWidth } from '../../ink/stringWidth.js';
6
7
  import { useAnimationFrame } from '../../ink/hooks/use-animation-frame.js';
@@ -187,16 +188,57 @@ export function toolNameColor(raw, category) {
187
188
  return 'toolNameExec';
188
189
  return 'accent';
189
190
  }
190
- /** One side's text → display lines (upstream contentLines rule: empty text
191
- * is zero lines; a single trailing newline is a terminator, not a line;
192
- * interior blanks survive). */
193
- function sideLines(text) {
194
- if (text === '')
195
- return [];
196
- const lines = text.split('\n');
197
- if (lines[lines.length - 1] === '')
198
- lines.pop();
199
- return lines;
191
+ /** Context lines a unified diff keeps around each change block (git's
192
+ * default). The card locates a change instead of replaying the whole file
193
+ * (issue #1777). */
194
+ const DIFF_CONTEXT_LINES = 3;
195
+ /** Budget for the structured re-diff. A whole-file before/after image (the
196
+ * Claude backend) can be arbitrarily large, and jsdiff's Myers pass runs
197
+ * synchronously during render — a full rewrite of a big file took seconds.
198
+ * Past this budget jsdiff aborts (returns undefined) and the card falls back
199
+ * to the bounded whole-text listing; the ordinary line caps bound the rows
200
+ * either way. */
201
+ const DIFF_MAX_EDIT_LENGTH = 4000;
202
+ const DIFF_TIMEOUT_MS = 100;
203
+ /** `start,count` as a unified-diff range: git drops `,1` for a one-line
204
+ * range. */
205
+ function diffRange(start, count) {
206
+ return count === 1 ? String(start) : `${start},${count}`;
207
+ }
208
+ /** One side's range in a unified hunk header: `start,count` in file lines, or
209
+ * undefined when the side's file position is unknown. A zero-line side names
210
+ * the line BEFORE the range (git's convention), so a known start S maps to
211
+ * `S + hunkStart - 2` — a whole-file image at 1 keeps the `0,0` spelling.
212
+ * Without a start the side is a whole empty image (a new file's before-image
213
+ * or a deleted file's after-image), which is also `0,0`. */
214
+ function hunkRange(start, hunkStart, lines) {
215
+ if (lines === 0)
216
+ return start === undefined ? '0,0' : diffRange(Math.max(0, start + hunkStart - 2), 0);
217
+ return start === undefined ? undefined : diffRange(start + hunkStart - 1, lines);
218
+ }
219
+ /** One hunk's `@@ -a,b +c,d @@` header, or undefined when the texts' file
220
+ * positions are unknown. `oldStart`/`newStart` are the 1-based file lines of
221
+ * the diff's first text lines; only a producer that knows the texts are a
222
+ * whole-file image (or a known slice) may set them, so a missing offset stays
223
+ * unnumbered instead of guessed (#250 P2-3). */
224
+ function hunkHeader(hunk, oldStart, newStart) {
225
+ const oldRange = hunkRange(oldStart, hunk.oldStart, hunk.oldLines);
226
+ const newRange = hunkRange(newStart, hunk.newStart, hunk.newLines);
227
+ return oldRange === undefined || newRange === undefined ? undefined : `@@ -${oldRange} +${newRange} @@`;
228
+ }
229
+ /** One hunk body in git's unified layout: context lines keep their leading
230
+ * space, removals get `-`, additions `+`. A `\ No newline` marker carries no
231
+ * readable content and is dropped (the patch parser does the same). */
232
+ function hunkBodyLines(hunk) {
233
+ const out = [];
234
+ for (const raw of hunk.lines) {
235
+ if (raw.startsWith('\\'))
236
+ continue;
237
+ const marker = raw[0] ?? ' ';
238
+ const text = raw.slice(1);
239
+ out.push(marker === '-' ? del(`-${text}`) : marker === '+' ? add(`+${text}`) : plain(` ${text}`));
240
+ }
241
+ return out;
200
242
  }
201
243
  /** A patch file → its header and numbered hunk rows: each line carries
202
244
  * its real line number (old for a removed line, new otherwise) in a gutter
@@ -229,10 +271,63 @@ function patchLines(diff, multiFile) {
229
271
  });
230
272
  return out;
231
273
  }
232
- /** Diff hunks → add/del rows. The header already carries the path for the
233
- * common single-hunk case; with several hunks a path row separates files
234
- * and `⋯` separates scattered hunks of one file (upstream DiffBlock). A
235
- * patch file (`ToolFileDiff.patch`) renders through {@link patchLines}. */
274
+ /** One side's text → display lines (upstream contentLines rule: empty text
275
+ * is zero lines; a single trailing newline is a terminator, not a line;
276
+ * interior blanks survive). The hunk path gets the same rule from jsdiff;
277
+ * this listing is only the over-budget fallback. */
278
+ function sideLines(text) {
279
+ if (text === '')
280
+ return [];
281
+ const lines = text.split('\n');
282
+ if (lines[lines.length - 1] === '')
283
+ lines.pop();
284
+ return lines;
285
+ }
286
+ /** Whole-text fallback for a diff too large to hunk within the render budget:
287
+ * removed lines then added lines, with no hunk header (the position is not
288
+ * known here). The ordinary line caps bound the rows like any other body. */
289
+ function wholeTextDiffLines(diff) {
290
+ const out = [];
291
+ if (diff.oldText !== null)
292
+ for (const line of sideLines(diff.oldText))
293
+ out.push(del(`-${line}`));
294
+ for (const line of sideLines(diff.newText))
295
+ out.push(add(`+${line}`));
296
+ return out;
297
+ }
298
+ /** One old/new file diff → git-style hunks: each hunk shows its change plus
299
+ * {@link DIFF_CONTEXT_LINES} context lines, removed and added lines adjacent,
300
+ * and — when the backend told us where the texts start — the hunk header
301
+ * with real file line numbers. Without offsets a hunk prints no numbers and
302
+ * `⋯` separates the hunks instead (#250 P2-3, #1777). */
303
+ function oldNewDiffLines(diff) {
304
+ const patch = JsDiff.structuredPatch('', '', diff.oldText ?? '', diff.newText, undefined, undefined, {
305
+ context: DIFF_CONTEXT_LINES,
306
+ maxEditLength: DIFF_MAX_EDIT_LENGTH,
307
+ timeout: DIFF_TIMEOUT_MS,
308
+ });
309
+ // Over budget: keep the frame responsive with the bounded listing instead.
310
+ if (patch === undefined)
311
+ return wholeTextDiffLines(diff);
312
+ const out = [];
313
+ patch.hunks.forEach((hunk, index) => {
314
+ const header = hunkHeader(hunk, diff.oldStart, diff.newStart);
315
+ if (header !== undefined)
316
+ out.push(dim(header));
317
+ else if (index > 0)
318
+ out.push(dim('⋯'));
319
+ // Append row by row: a hunk can carry one row per file line, and spreading
320
+ // a large array into one `push` call hits the engine's argument limit.
321
+ for (const line of hunkBodyLines(hunk))
322
+ out.push(line);
323
+ });
324
+ return out;
325
+ }
326
+ /** Diff hunks → unified card rows. The header already carries the path for
327
+ * the common single-hunk case; with several hunks a path row separates files
328
+ * and `⋯` separates scattered hunks of one file (upstream DiffBlock). An
329
+ * old/new file diff is re-diffed into git-style hunks (#1777); a patch file
330
+ * (`ToolFileDiff.patch`) renders through {@link patchLines}. */
236
331
  function diffLines(diffs) {
237
332
  const out = [];
238
333
  let prevPath;
@@ -249,12 +344,9 @@ function diffLines(diffs) {
249
344
  out.push(dim('⋯'));
250
345
  }
251
346
  prevPath = diff.path;
252
- if (diff.oldText !== null) {
253
- for (const line of sideLines(diff.oldText))
254
- out.push(del(`- ${line}`));
255
- }
256
- for (const line of sideLines(diff.newText))
257
- out.push(add(`+ ${line}`));
347
+ // Same append-by-row rule: the over-budget fallback lists every source line.
348
+ for (const line of oldNewDiffLines(diff))
349
+ out.push(line);
258
350
  }
259
351
  return out;
260
352
  }
@@ -413,7 +505,7 @@ function foldTerminalTitle(title, foldLines) {
413
505
  let separators = 1;
414
506
  for (let at = title.indexOf('\n', firstEnd + 1); at !== -1; at = title.indexOf('\n', at + 1))
415
507
  separators++;
416
- // Same trailing-newline rule as sideLines: a terminator is not a line.
508
+ // A trailing newline is a terminator, not a line.
417
509
  hiddenLines = separators - (title.endsWith('\n') ? 1 : 0);
418
510
  body = title.slice(0, title.charCodeAt(firstEnd - 1) === 13 ? firstEnd - 1 : firstEnd);
419
511
  }
@@ -611,6 +703,12 @@ export function AssistantToolUseMessage({ tool, marginTopOnTurn, verbose, isSele
611
703
  const liveMaxLines = liveOutputMaxLines(verbose, fullscreen);
612
704
  const liveWidth = Math.max(1, columns - 4);
613
705
  const liveView = React.useMemo(() => liveText === '' ? undefined : liveOutputView(liveText, liveDropped, liveMaxLines, liveWidth), [liveText, liveDropped, liveMaxLines, liveWidth]);
706
+ // Structured body (diff hunks / tool output / read content) memoized on the
707
+ // view identity: a running card re-renders on the 1 s elapsed tick and on
708
+ // every reveal step, and the unified diff layout re-diffs its old/new texts
709
+ // into git hunks — a Claude card carries the whole file. `lang` joins the
710
+ // deps for the localized rows (patch stats, search totals).
711
+ const viewBody = React.useMemo(() => (useSplitDiff || view === undefined ? undefined : viewLines(view)), [useSplitDiff, view, lang]);
614
712
  let body = [];
615
713
  if (sendMessage !== undefined) {
616
714
  // 正文 = message 文本预览(长文走既有的三行折叠),summary 作副行;
@@ -643,8 +741,8 @@ export function AssistantToolUseMessage({ tool, marginTopOnTurn, verbose, isSele
643
741
  body = tool.errorText.split('\n').map((text) => ({ text, tone: 'error' }));
644
742
  }
645
743
  else if (!useSplitDiff) {
646
- if (view !== undefined)
647
- body = viewLines(view);
744
+ if (viewBody !== undefined)
745
+ body = viewBody;
648
746
  if (body.length === 0 && result) {
649
747
  body = result.trimEnd().split('\n').map(plain);
650
748
  }
@@ -1,9 +1,12 @@
1
1
  /**
2
2
  * Agent Teams in the agents surfaces (issue #1241, phase 2): fold the
3
3
  * session's `TeamView` and its subagent rows into what the dashboard
4
- * renders. A teammate is a continuable subagent of the Lead whose row id is
5
- * the member id, so the two join by id; neither side overwrites the other's
6
- * state (see `teamMemberStatus`). Pure: no I/O, no backend import.
4
+ * renders. Both upstream shapes arrive as the same `TeamView`: a legacy
5
+ * roster wire's durable members, or the `0.2.2-rc.2` selection wire's Lead
6
+ * plus named subagents composed in `team-roster.ts`. A teammate is a
7
+ * continuable subagent of the Lead whose row id is the member id, so the two
8
+ * join by id; neither side overwrites the other's state (see
9
+ * `teamMemberStatus`). Pure: no I/O, no backend import.
7
10
  */
8
11
  import type { TeamMember, TeamTask, TeamView } from '../adapter/ports/channel-view.js';
9
12
  import type { SubagentState } from '../dsh-adapter/subagents.js';
@@ -1 +1 @@
1
- {"version":3,"file":"teamRoster.d.ts","sourceRoot":"","sources":["../../../src/components/teamRoster.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,KAAK,EAAE,UAAU,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,kCAAkC,CAAA;AACtF,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAA;AAEhE;;8CAE8C;AAC9C,MAAM,MAAM,gBAAgB,GAAG,cAAc,GAAG,SAAS,GAAG,MAAM,GAAG,QAAQ,GAAG,QAAQ,CAAA;AAExF,0EAA0E;AAC1E,MAAM,WAAW,aAAa;IAC5B,QAAQ,CAAC,MAAM,EAAE,UAAU,CAAA;IAC3B,QAAQ,CAAC,QAAQ,CAAC,EAAE,aAAa,CAAA;IACjC,QAAQ,CAAC,MAAM,EAAE,gBAAgB,CAAA;CAClC;AAED,MAAM,WAAW,kBAAkB;IACjC,QAAQ,CAAC,IAAI,CAAC,EAAE,UAAU,CAAA;IAC1B,uFAAuF;IACvF,QAAQ,CAAC,cAAc,EAAE,OAAO,CAAA;IAChC,QAAQ,CAAC,SAAS,EAAE,SAAS,aAAa,EAAE,CAAA;IAC5C,yEAAyE;IACzE,QAAQ,CAAC,MAAM,EAAE,SAAS,aAAa,EAAE,CAAA;CAC1C;AAED;;;;;;;;;GASG;AACH,wBAAgB,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,6 +64,15 @@ export interface ApprovalSnapshot extends PermissionPanelSnapshot {
64
64
  export declare function bindApprovalStore(ctx: Parameters<typeof compositionRoot>[0], store: ApprovalStore): void;
65
65
  /** Host-only lookup used by the presentation Port bridge. */
66
66
  export declare function getApprovalStore(ctx: Parameters<typeof compositionRoot>[0]): ApprovalStore | undefined;
67
+ /**
68
+ * The ask's reason in the UI language. Requests may carry a localized
69
+ * `displayReason: { en, zh }` next to the English audit `reason` (DSH's
70
+ * auto-review asks do); older request types lack the field, so it is read
71
+ * structurally.
72
+ * @param req - The pending approval request.
73
+ * @returns The localized reason, else `req.reason`.
74
+ */
75
+ export declare function reasonOf(req: ApprovalRequest): string | undefined;
67
76
  /**
68
77
  * Approval store: parks asks from the harness's approval seam, surfaces
69
78
  * one at a time to the TUI, and settles each ask when the user decides or
@@ -129,6 +138,16 @@ export declare class ApprovalStore implements PermissionPanelSource {
129
138
  * @returns One id per asking agent, or an empty array when none waits.
130
139
  */
131
140
  pendingAgentIds(): readonly string[];
141
+ /**
142
+ * Whether this exact request object is still parked (active or queued). A
143
+ * notification queued before the native transport dispatches uses it to drop
144
+ * a toast whose approval was answered in the meantime; object identity is the
145
+ * only per-ask identity the protocol carries (the request has no id of its
146
+ * own and a null callId is legal).
147
+ * @param request - The request object handed to {@link park}.
148
+ * @returns True while that ask is still waiting for a decision.
149
+ */
150
+ hasParkedRequest(request: ApprovalRequest): boolean;
132
151
  /**
133
152
  * The first parked ask's detail for one agent — the agent view's row
134
153
  * summary while it needs input (the question it is blocked on).
@@ -1 +1 @@
1
- {"version":3,"file":"approvals.d.ts","sourceRoot":"","sources":["../../../src/dsh-adapter/approvals.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH,OAAO,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAA;AAClD,OAAO,EAGL,KAAK,qBAAqB,EAC3B,MAAM,8BAA8B,CAAA;AACrC,OAAO,KAAK,EAAE,eAAe,EAAE,eAAe,E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AQ,GAAG,SAAS,CAAC,CAAC,GAAG,SAAS;IAUzG,OAAO,CAAC,IAAI;IAIZ;iFAC6E;IAC7E,OAAO,CAAC,cAAc;IAStB;;iDAE6C;IAC7C,OAAO,CAAC,iBAAiB;IAYzB,gEAAgE;IAChE,OAAO,CAAC,eAAe;IAOvB;;;;;;;;;;;;;;OAcG;IACH,OAAO,CAAC,qBAAqB;IAY7B;;;;;;;;;;;;;;OAcG;IACH,gBAAgB,CAAC,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,YAAY,GAAG,IAAI;IAc5D;;;;;;;;;;;OAWG;IACH,OAAO,CAAC,gBAAgB;IAUxB;;;;;;;;OAQG;IACH,IAAI,CAAC,GAAG,EAAE,eAAe,GAAG,OAAO,CAAC,eAAe,CAAC;IA4DpD;;;kCAG8B;IAC9B,OAAO,CAAC,SAAS;IAUjB;;;;;;;OAOG;IACH,MAAM,CAAC,OAAO,EAAE,sBAAsB,EAAE,QAAQ,CAAC,EAAE,uBAAuB,GAAG,IAAI;IAajF;;;;OAIG;IACH,SAAS,CAAC,OAAO,EAAE,eAAe,GAAG,IAAI;IAazC;;;OAGG;IACH,OAAO,CAAC,YAAY;IAKpB;;;;;;;;;;;;OAYG;IACH,OAAO,CAAC,mBAAmB;CAsB5B"}
@@ -44,7 +44,7 @@ const COMMAND_CLIP = 500;
44
44
  * @param req - The pending approval request.
45
45
  * @returns The localized reason, else `req.reason`.
46
46
  */
47
- function reasonOf(req) {
47
+ export function reasonOf(req) {
48
48
  const display = req.displayReason;
49
49
  if (display !== null && typeof display === 'object') {
50
50
  const byLang = display;
@@ -217,6 +217,22 @@ export class ApprovalStore {
217
217
  }
218
218
  return ids;
219
219
  }
220
+ /**
221
+ * Whether this exact request object is still parked (active or queued). A
222
+ * notification queued before the native transport dispatches uses it to drop
223
+ * a toast whose approval was answered in the meantime; object identity is the
224
+ * only per-ask identity the protocol carries (the request has no id of its
225
+ * own and a null callId is legal).
226
+ * @param request - The request object handed to {@link park}.
227
+ * @returns True while that ask is still waiting for a decision.
228
+ */
229
+ hasParkedRequest(request) {
230
+ for (const ask of this.active === undefined ? this.queue : [this.active, ...this.queue]) {
231
+ if (ask.request === request)
232
+ return true;
233
+ }
234
+ return false;
235
+ }
220
236
  /**
221
237
  * The first parked ask's detail for one agent — the agent view's row
222
238
  * summary while it needs input (the question it is blocked on).
@@ -1 +1 @@
1
- {"version":3,"file":"translate.d.ts","sourceRoot":"","sources":["../../../../src/dsh-adapter/backend/translate.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AACH,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAA;AAElE,OAAO,KAAK,EAAE,YAAY,EAAqC,MAAM,0BAA0B,CAAA;AAC/F,OAAO,EAAa,KAAK,UAAU,EAAqB,KAAK,cAAc,EAA0D,MAAM,uBAAuB,CAAA;AAElK,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAA;AAI3D,OAAO,KAAK,EAAE,YAAY,EAAE,cAAc,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAA;AAQ1F,MAAM,WAAW,iBAAiB;IAChC;;0DAEsD;IACtD,KAAK,IAAI,iBAAiB,GAAG,SAAS,CAAA;IACtC;4EACwE;IACxE,KAAK,IAAI,OAAO,CAAA;IAChB;+DAC2D;IAC3D,WAAW,IAAI,OAAO,CAAA;CACvB;AAED;;;GAGG;AACH,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,MAAM,GAAG,aAAa,CAE5D;AAED;;;;;;;GAOG;AACH,wBAAgB,QAAQ,CAAC,IAAI,EAAE,cAAc,GAAG,OAAO,CAmEtD;AAkGD,2EAA2E;AAC3E,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,iBAAiB;4BAoL1B,YAAY,KAAG,SAAS,UAAU,EAAE;4BAgKpC,oBAAoB,KAAG,SAAS,UAAU,EAAE;8BAmB1C,SAAS,YAAY,EAAE,KAAG,SAAS,UAAU,EAAE;iB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;iBAY9D,IAAI;4BAjVS,MAAM,WAAW,MAAM,KAAG,YAAY,GAAG,SAAS;8BAgBhD,MAAM,WAAW,MAAM,QAAQ,YAAY,CAAC,aAAa,CAAC,CAAC,MAAM,CAAC,KAAG,cAAc,GAAG,SAAS;EA0UjI;AAED,MAAM,MAAM,aAAa,GAAG,UAAU,CAAC,OAAO,mBAAmB,CAAC,CAAA"}
@@ -2,6 +2,7 @@ import { NO_EVENTS } from '../../agent/events.js';
2
2
  import { isPeakHour } from '../../deepseekPricing.js';
3
3
  import { BACKGROUND_START_ACK, isSubagentToolName, parseJobOutputId, todoPanelItems, toolCommandOf } from '../channel/projection-helpers.js';
4
4
  import { harnessToolResultView, prepareReplayEvents, toolErrorText } from '../channel/transcript.js';
5
+ import { CompactionPreviews } from '../compat/compaction-previews.js';
5
6
  import { isCompactionCheckpointSource, toolResultPayload } from '../compat/messages.js';
6
7
  import { transcriptImagesOf } from '../transcript-images.js';
7
8
  import { isTeamToolName, TEAM_SPAWN_TOOL, teamMessageOf, teamToolCallView, teamToolResultView } from '../team-tools.js';
@@ -160,6 +161,7 @@ export function createDshTranslator(deps) {
160
161
  let lastStreamRevision = -1;
161
162
  /** Whether this session's first human prompt has been translated. */
162
163
  let promptSeen = false;
164
+ const compactionPreviews = new CompactionPreviews();
163
165
  /**
164
166
  * Open calls by callId until their result: what the result's presenter,
165
167
  * images and task feeds need. `card: false` = question-presented (the
@@ -248,10 +250,15 @@ export function createDshTranslator(deps) {
248
250
  // compat(dsh 0.2.0, log): a 0.2.0 mailbox delivery reads as the relay it became.
249
251
  const data = teamMailboxAsRelay(event.data);
250
252
  const base = { id: data.id, anchor: String(event.seq), seq: event.seq, time: event.time, blocks: data.content };
251
- // Both legacy and V4 checkpoints render as a folded summary rather than
253
+ // Full and partial checkpoints render as folded summaries rather than
252
254
  // disappearing with the other injected context.
253
255
  if (isCompactionCheckpointSource(data.source)) {
254
- return [{ type: 'user.message', ...base, source: 'compaction', text: textOf(data.content) }];
256
+ const compactPreview = compactionPreviews.take(data.source);
257
+ return [{
258
+ type: 'user.message', ...base, source: 'compaction', text: textOf(data.content),
259
+ ...(compactPreview === undefined ? {} : { compactPreview }),
260
+ ...(data.source.kind === 'spine-checkpoint' ? { compactionScope: 'partial' } : {}),
261
+ }];
255
262
  }
256
263
  // Same-session goal domain: goal-sourced messages are the round driver's
257
264
  // continuation prompts (positive rounds advance the counter); some hosts
@@ -347,6 +354,7 @@ export function createDshTranslator(deps) {
347
354
  };
348
355
  /** Translate one durable session event (live or as part of a replay). */
349
356
  const translateEvent = (event) => {
357
+ compactionPreviews.observe(event);
350
358
  const type = event.type;
351
359
  // Top-level `goal/change` events are how the goal service records durable
352
360
  // goal mutations (create/edit/pause/resume/complete/block/clear) —
@@ -392,7 +400,9 @@ export function createDshTranslator(deps) {
392
400
  openCalls.set(callId, { name: data.name, args: data.arguments, card: false });
393
401
  return [{ ...base, presentation: QUESTION }];
394
402
  }
395
- // The delegation tools render as the live subagent card.
403
+ // The delegation tools render as the live subagent card (a
404
+ // historical `spawn_teammate` call included: rc.2 removed the tool,
405
+ // but older logs still hold it and its result is not a card).
396
406
  if (isSubagentToolName(data.name)) {
397
407
  if (data.name === TEAM_SPAWN_TOOL)
398
408
  unwrittenSpawns.set(callId, base);
@@ -531,6 +541,7 @@ export function createDshTranslator(deps) {
531
541
  const translateReplay = (events) => {
532
542
  lastStreamRevision = -1;
533
543
  promptSeen = false;
544
+ compactionPreviews.clear();
534
545
  const out = [];
535
546
  for (const event of prepareReplayEvents(events)) {
536
547
  for (const translated of translateEvent(event))
@@ -542,6 +553,7 @@ export function createDshTranslator(deps) {
542
553
  const reset = () => {
543
554
  lastStreamRevision = -1;
544
555
  promptSeen = false;
556
+ compactionPreviews.clear();
545
557
  openCalls.clear();
546
558
  unwrittenSpawns.clear();
547
559
  };
@@ -1 +1 @@
1
- {"version":3,"file":"extensions.d.ts","sourceRoot":"","sources":["../../../../src/dsh-adapter/channel/extensions.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAA;AAKlD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,6BAA6B,CAAA;AAyB5D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAA;AA6BpD,OAAO,EAAqB,KAAK,oBAAoB,EAAE,MAAM,YAAY,CAAA;AAsBzE;;;;;GAKG;AACH,wBAAgB,mBAAmB,CACjC,IAAI,EAAE,WAAW,EACjB,GAAG,EAAE,OAAO,EACZ,aAAa,EAAE,SAAS,EACxB,OAAO,EAAE,oBAAoB,GAC5B,IAAI,CA2xBN"}
1
+ {"version":3,"file":"extensions.d.ts","sourceRoot":"","sources":["../../../../src/dsh-adapter/channel/extensions.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAA;AAKlD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,6BAA6B,CAAA;AAyB5D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAA;AA6BpD,OAAO,EAAqB,KAAK,oBAAoB,EAAE,MAAM,YAAY,CAAA;AAsBzE;;;;;GAKG;AACH,wBAAgB,mBAAmB,CACjC,IAAI,EAAE,WAAW,EACjB,GAAG,EAAE,OAAO,EACZ,aAAa,EAAE,SAAS,EACxB,OAAO,EAAE,oBAAoB,GAC5B,IAAI,CA8xBN"}
@@ -212,7 +212,9 @@ export function attachDshExtensions(core, ctx, initialNative, options) {
212
212
  // `/team` is gated on its service, not on a backend capability: Help and `/`
213
213
  // completion read `commandList`, so this is the one catalog that can hide it
214
214
  // while `agentTeams` is absent. Keep the unfiltered list so a later service
215
- // mount restores the row without waiting for a skill-catalog refresh.
215
+ // mount restores the row without waiting for a skill-catalog refresh. On a
216
+ // selection host (0.2.2-rc.2+) `dsh-base` mounts the service unconditionally,
217
+ // so the row is always there — it carries the `/team on|off` switch.
216
218
  let commandBase = LOCAL_COMMANDS;
217
219
  const publishCommandList = (commands, emit = true) => {
218
220
  state.commandList = annotateCommandCapabilities(withTeamCommandVisibility(commands, teamServiceActive(ctx)), capabilitiesOf());
@@ -223,9 +225,10 @@ export function attachDshExtensions(core, ctx, initialNative, options) {
223
225
  // before the first skill-catalog refresh publishes a new one, and a command
224
226
  // whose capability is missing must never look usable in that window.
225
227
  publishCommandList(LOCAL_COMMANDS, false);
226
- // The team service appears and disappears with its bundle (HMR, a CLI or
227
- // Web write). Follow the same `internal/service` signal the team store reads,
228
- // so the command catalog and the Help/`/` popup change with it.
228
+ // The team service appears and disappears with its bundle on a bundle host
229
+ // (HMR, a CLI or Web write); a selection host mounts it with `dsh-base` for
230
+ // the whole process. Follow the same `internal/service` signal the team
231
+ // store reads, so the command catalog and the Help/`/` popup follow it.
229
232
  owner.own(ctx.on('internal/service', ((name) => {
230
233
  if (name === 'agentTeams')
231
234
  publishCommandList(commandBase);