@athenaintel/react 0.43.0 → 0.48.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 (661) hide show
  1. package/README.md +215 -3
  2. package/dist/agent-runtime/src/answer-label.cjs +137 -0
  3. package/dist/agent-runtime/src/answer-label.cjs.map +1 -0
  4. package/dist/agent-runtime/src/answer-label.d.ts +104 -0
  5. package/dist/agent-runtime/src/answer-label.js +137 -0
  6. package/dist/agent-runtime/src/answer-label.js.map +1 -0
  7. package/dist/agent-runtime/src/answer-rows.cjs +180 -0
  8. package/dist/agent-runtime/src/answer-rows.cjs.map +1 -0
  9. package/dist/agent-runtime/src/answer-rows.d.ts +86 -0
  10. package/dist/agent-runtime/src/answer-rows.js +180 -0
  11. package/dist/agent-runtime/src/answer-rows.js.map +1 -0
  12. package/dist/agent-runtime/src/client-tool-bridge.cjs +15 -15
  13. package/dist/agent-runtime/src/client-tool-bridge.cjs.map +1 -1
  14. package/dist/agent-runtime/src/conversation-index.cjs +8 -8
  15. package/dist/agent-runtime/src/conversation-index.cjs.map +1 -1
  16. package/dist/agent-runtime/src/decision-checks.cjs +207 -0
  17. package/dist/agent-runtime/src/decision-checks.cjs.map +1 -0
  18. package/dist/agent-runtime/src/decision-checks.d.ts +142 -0
  19. package/dist/agent-runtime/src/decision-checks.js +207 -0
  20. package/dist/agent-runtime/src/decision-checks.js.map +1 -0
  21. package/dist/agent-runtime/src/desktop-handoff.d.ts +12 -0
  22. package/dist/agent-runtime/src/errors.cjs +18 -0
  23. package/dist/agent-runtime/src/errors.cjs.map +1 -1
  24. package/dist/agent-runtime/src/errors.d.ts +7 -0
  25. package/dist/agent-runtime/src/errors.js +18 -0
  26. package/dist/agent-runtime/src/errors.js.map +1 -1
  27. package/dist/agent-runtime/src/generated/runconfig-contract.cjs +12 -0
  28. package/dist/agent-runtime/src/generated/runconfig-contract.cjs.map +1 -1
  29. package/dist/agent-runtime/src/generated/runconfig-contract.d.ts +6 -6
  30. package/dist/agent-runtime/src/generated/runconfig-contract.js +12 -0
  31. package/dist/agent-runtime/src/generated/runconfig-contract.js.map +1 -1
  32. package/dist/agent-runtime/src/handoff-arrival.cjs +60 -0
  33. package/dist/agent-runtime/src/handoff-arrival.cjs.map +1 -0
  34. package/dist/agent-runtime/src/handoff-arrival.d.ts +46 -0
  35. package/dist/agent-runtime/src/handoff-arrival.js +60 -0
  36. package/dist/agent-runtime/src/handoff-arrival.js.map +1 -0
  37. package/dist/agent-runtime/src/index.d.ts +14 -8
  38. package/dist/agent-runtime/src/interrupts.cjs +43 -18
  39. package/dist/agent-runtime/src/interrupts.cjs.map +1 -1
  40. package/dist/agent-runtime/src/interrupts.d.ts +19 -2
  41. package/dist/agent-runtime/src/interrupts.js +28 -3
  42. package/dist/agent-runtime/src/interrupts.js.map +1 -1
  43. package/dist/agent-runtime/src/lane-history.cjs +8 -8
  44. package/dist/agent-runtime/src/lane-history.cjs.map +1 -1
  45. package/dist/agent-runtime/src/messages.cjs +43 -8
  46. package/dist/agent-runtime/src/messages.cjs.map +1 -1
  47. package/dist/agent-runtime/src/messages.d.ts +25 -3
  48. package/dist/agent-runtime/src/messages.js +43 -8
  49. package/dist/agent-runtime/src/messages.js.map +1 -1
  50. package/dist/agent-runtime/src/offline-status.cjs +36 -0
  51. package/dist/agent-runtime/src/offline-status.cjs.map +1 -0
  52. package/dist/agent-runtime/src/offline-status.d.ts +118 -3
  53. package/dist/agent-runtime/src/offline-status.js +36 -0
  54. package/dist/agent-runtime/src/offline-status.js.map +1 -0
  55. package/dist/agent-runtime/src/queue.cjs +0 -9
  56. package/dist/agent-runtime/src/queue.cjs.map +1 -1
  57. package/dist/agent-runtime/src/queue.js +0 -9
  58. package/dist/agent-runtime/src/queue.js.map +1 -1
  59. package/dist/agent-runtime/src/quota-safe-local-storage-session.cjs +9 -9
  60. package/dist/agent-runtime/src/quota-safe-local-storage-session.cjs.map +1 -1
  61. package/dist/agent-runtime/src/runtime-catalog.cjs +42 -0
  62. package/dist/agent-runtime/src/runtime-catalog.cjs.map +1 -0
  63. package/dist/agent-runtime/src/runtime-catalog.d.ts +35 -0
  64. package/dist/agent-runtime/src/runtime-catalog.js +42 -0
  65. package/dist/agent-runtime/src/runtime-catalog.js.map +1 -0
  66. package/dist/agent-runtime/src/runtime-messages.cjs.map +1 -1
  67. package/dist/agent-runtime/src/runtime-messages.d.ts +1 -1
  68. package/dist/agent-runtime/src/runtime-messages.js.map +1 -1
  69. package/dist/agent-runtime/src/runtime.d.ts +40 -0
  70. package/dist/agent-runtime/src/statewire-suspended.cjs +3 -3
  71. package/dist/agent-runtime/src/statewire-suspended.cjs.map +1 -1
  72. package/dist/agent-runtime/src/subagents.cjs +32 -2
  73. package/dist/agent-runtime/src/subagents.cjs.map +1 -1
  74. package/dist/agent-runtime/src/subagents.d.ts +9 -0
  75. package/dist/agent-runtime/src/subagents.js +30 -0
  76. package/dist/agent-runtime/src/subagents.js.map +1 -1
  77. package/dist/agent-runtime/src/thread-driver.cjs +67 -0
  78. package/dist/agent-runtime/src/thread-driver.cjs.map +1 -0
  79. package/dist/agent-runtime/src/thread-driver.d.ts +49 -0
  80. package/dist/agent-runtime/src/thread-driver.js +67 -0
  81. package/dist/agent-runtime/src/thread-driver.js.map +1 -0
  82. package/dist/agent-runtime/src/thread-handoff-flow-machine.d.ts +172 -0
  83. package/dist/agent-runtime/src/thread-handoff-protocol.d.ts +756 -0
  84. package/dist/agent-runtime/src/thread-handoff-qr.d.ts +11 -0
  85. package/dist/agent-runtime/src/thread-handoff.d.ts +3 -364
  86. package/dist/agent-runtime/src/thread-status.cjs +3 -3
  87. package/dist/agent-runtime/src/thread-status.cjs.map +1 -1
  88. package/dist/agent-runtime/src/tool-metadata.cjs +210 -25
  89. package/dist/agent-runtime/src/tool-metadata.cjs.map +1 -1
  90. package/dist/agent-runtime/src/tool-metadata.d.ts +12 -0
  91. package/dist/agent-runtime/src/tool-metadata.js +210 -25
  92. package/dist/agent-runtime/src/tool-metadata.js.map +1 -1
  93. package/dist/agent-runtime/src/tool-names.cjs +2 -0
  94. package/dist/agent-runtime/src/tool-names.cjs.map +1 -1
  95. package/dist/agent-runtime/src/tool-names.d.ts +2 -0
  96. package/dist/agent-runtime/src/tool-names.js +2 -0
  97. package/dist/agent-runtime/src/tool-names.js.map +1 -1
  98. package/dist/agent-runtime/src/types.d.ts +10 -2
  99. package/dist/agent-runtime/src/use-conversation-list.cjs +11 -11
  100. package/dist/agent-runtime/src/use-conversation-list.cjs.map +1 -1
  101. package/dist/agent-runtime/src/use-deep-agent-chat-outbox.cjs +24 -19
  102. package/dist/agent-runtime/src/use-deep-agent-chat-outbox.cjs.map +1 -1
  103. package/dist/agent-runtime/src/use-deep-agent-chat-outbox.d.ts +2 -1
  104. package/dist/agent-runtime/src/use-deep-agent-chat-outbox.js +6 -1
  105. package/dist/agent-runtime/src/use-deep-agent-chat-outbox.js.map +1 -1
  106. package/dist/agent-runtime/src/use-deep-agent-config.cjs +14 -14
  107. package/dist/agent-runtime/src/use-deep-agent-config.cjs.map +1 -1
  108. package/dist/agent-runtime/src/use-deep-agent-edit-submit.cjs +6 -6
  109. package/dist/agent-runtime/src/use-deep-agent-edit-submit.cjs.map +1 -1
  110. package/dist/agent-runtime/src/use-deep-agent-runtime.cjs +16 -16
  111. package/dist/agent-runtime/src/use-deep-agent-runtime.cjs.map +1 -1
  112. package/dist/agent-runtime/src/use-deep-agent-thread.cjs +45 -45
  113. package/dist/agent-runtime/src/use-deep-agent-thread.cjs.map +1 -1
  114. package/dist/agent-runtime/src/use-deep-agent-voice.cjs +547 -124
  115. package/dist/agent-runtime/src/use-deep-agent-voice.cjs.map +1 -1
  116. package/dist/agent-runtime/src/use-deep-agent-voice.d.ts +129 -10
  117. package/dist/agent-runtime/src/use-deep-agent-voice.js +487 -64
  118. package/dist/agent-runtime/src/use-deep-agent-voice.js.map +1 -1
  119. package/dist/agent-runtime/src/use-deep-agent-window-sync.cjs +26 -26
  120. package/dist/agent-runtime/src/use-deep-agent-window-sync.cjs.map +1 -1
  121. package/dist/agent-runtime/src/use-historical-edit-attachments.cjs +4 -4
  122. package/dist/agent-runtime/src/use-historical-edit-attachments.cjs.map +1 -1
  123. package/dist/agent-runtime/src/use-thread-handoff-flow.d.ts +28 -26
  124. package/dist/agent-runtime/src/voice-media.cjs +117 -0
  125. package/dist/agent-runtime/src/voice-media.cjs.map +1 -0
  126. package/dist/agent-runtime/src/voice-media.d.ts +49 -0
  127. package/dist/agent-runtime/src/voice-media.js +117 -0
  128. package/dist/agent-runtime/src/voice-media.js.map +1 -0
  129. package/dist/agent-runtime/src/voice-wire-types.d.ts +32 -0
  130. package/dist/assets/AssetPanel.cjs +11 -11
  131. package/dist/assets/AssetPanel.cjs.map +1 -1
  132. package/dist/assets/AthenaAssetEmbed.cjs +11 -9
  133. package/dist/assets/AthenaAssetEmbed.cjs.map +1 -1
  134. package/dist/assets/AthenaAssetEmbed.d.ts +7 -0
  135. package/dist/assets/AthenaAssetEmbed.js +4 -2
  136. package/dist/assets/AthenaAssetEmbed.js.map +1 -1
  137. package/dist/assets/AthenaLayout.cjs +16 -16
  138. package/dist/assets/AthenaLayout.cjs.map +1 -1
  139. package/dist/assets/use-asset-content.cjs +4 -4
  140. package/dist/assets/use-asset-content.cjs.map +1 -1
  141. package/dist/assets/use-asset-embed.cjs +14 -7
  142. package/dist/assets/use-asset-embed.cjs.map +1 -1
  143. package/dist/assets/use-asset-embed.d.ts +11 -1
  144. package/dist/assets/use-asset-embed.js +10 -3
  145. package/dist/assets/use-asset-embed.js.map +1 -1
  146. package/dist/auth/AthenaAuthContext.cjs +3 -3
  147. package/dist/auth/AthenaAuthContext.cjs.map +1 -1
  148. package/dist/auth/AthenaAuthProvider.cjs +8 -8
  149. package/dist/auth/AthenaAuthProvider.cjs.map +1 -1
  150. package/dist/auth/AthenaCredentialSourceContext.cjs +5 -5
  151. package/dist/auth/AthenaCredentialSourceContext.cjs.map +1 -1
  152. package/dist/auth/AthenaSSOProvider.cjs +14 -14
  153. package/dist/auth/AthenaSSOProvider.cjs.map +1 -1
  154. package/dist/auth/credential-source.cjs +26 -13
  155. package/dist/auth/credential-source.cjs.map +1 -1
  156. package/dist/auth/credential-source.d.ts +8 -0
  157. package/dist/auth/credential-source.js +26 -13
  158. package/dist/auth/credential-source.js.map +1 -1
  159. package/dist/catalog/agent-model-options.cjs +25 -17
  160. package/dist/catalog/agent-model-options.cjs.map +1 -1
  161. package/dist/catalog/agent-model-options.d.ts +38 -5
  162. package/dist/catalog/agent-model-options.js +25 -17
  163. package/dist/catalog/agent-model-options.js.map +1 -1
  164. package/dist/catalog/channel-refusal.cjs +36 -0
  165. package/dist/catalog/channel-refusal.cjs.map +1 -0
  166. package/dist/catalog/channel-refusal.d.ts +29 -0
  167. package/dist/catalog/channel-refusal.js +36 -0
  168. package/dist/catalog/channel-refusal.js.map +1 -0
  169. package/dist/catalog/chat-pickers.cjs +60 -24
  170. package/dist/catalog/chat-pickers.cjs.map +1 -1
  171. package/dist/catalog/chat-pickers.d.ts +12 -2
  172. package/dist/catalog/chat-pickers.js +56 -20
  173. package/dist/catalog/chat-pickers.js.map +1 -1
  174. package/dist/catalog/runtime-catalog.cjs +89 -23
  175. package/dist/catalog/runtime-catalog.cjs.map +1 -1
  176. package/dist/catalog/runtime-catalog.d.ts +8 -2
  177. package/dist/catalog/runtime-catalog.js +83 -17
  178. package/dist/catalog/runtime-catalog.js.map +1 -1
  179. package/dist/catalog/use-athena-chat-mode.cjs +12 -12
  180. package/dist/catalog/use-athena-chat-mode.cjs.map +1 -1
  181. package/dist/chat/AthenaChat.cjs +155 -67
  182. package/dist/chat/AthenaChat.cjs.map +1 -1
  183. package/dist/chat/AthenaChat.d.ts +42 -2
  184. package/dist/chat/AthenaChat.js +106 -18
  185. package/dist/chat/AthenaChat.js.map +1 -1
  186. package/dist/chat/AthenaChatErrorBoundary.cjs +3 -3
  187. package/dist/chat/AthenaChatErrorBoundary.cjs.map +1 -1
  188. package/dist/chat/DrivingOnChip.cjs +23 -0
  189. package/dist/chat/DrivingOnChip.cjs.map +1 -0
  190. package/dist/chat/DrivingOnChip.d.ts +17 -0
  191. package/dist/chat/DrivingOnChip.js +23 -0
  192. package/dist/chat/DrivingOnChip.js.map +1 -0
  193. package/dist/chat/StatewireApprovalCard.cjs +125 -31
  194. package/dist/chat/StatewireApprovalCard.cjs.map +1 -1
  195. package/dist/chat/StatewireApprovalCard.d.ts +73 -1
  196. package/dist/chat/StatewireApprovalCard.js +115 -21
  197. package/dist/chat/StatewireApprovalCard.js.map +1 -1
  198. package/dist/chat/StatewireClientToolBridge.cjs +2 -2
  199. package/dist/chat/StatewireClientToolBridge.cjs.map +1 -1
  200. package/dist/chat/StatewireQueuedMessages.cjs +25 -63
  201. package/dist/chat/StatewireQueuedMessages.cjs.map +1 -1
  202. package/dist/chat/StatewireQueuedMessages.d.ts +11 -13
  203. package/dist/chat/StatewireQueuedMessages.js +16 -54
  204. package/dist/chat/StatewireQueuedMessages.js.map +1 -1
  205. package/dist/chat/WaitingOnYouBanner.cjs +3 -3
  206. package/dist/chat/WaitingOnYouBanner.cjs.map +1 -1
  207. package/dist/chat/athena-chat-welcome.cjs +2 -2
  208. package/dist/chat/athena-chat-welcome.cjs.map +1 -1
  209. package/dist/chat/athena-citation-links.cjs +5 -5
  210. package/dist/chat/athena-citation-links.cjs.map +1 -1
  211. package/dist/chat/athena-composer-controls.cjs +26 -16
  212. package/dist/chat/athena-composer-controls.cjs.map +1 -1
  213. package/dist/chat/athena-composer-controls.d.ts +6 -0
  214. package/dist/chat/athena-composer-controls.js +26 -16
  215. package/dist/chat/athena-composer-controls.js.map +1 -1
  216. package/dist/chat/athena-turn-end-status.cjs +42 -0
  217. package/dist/chat/athena-turn-end-status.cjs.map +1 -0
  218. package/dist/chat/athena-turn-end-status.d.ts +24 -0
  219. package/dist/chat/athena-turn-end-status.js +42 -0
  220. package/dist/chat/athena-turn-end-status.js.map +1 -0
  221. package/dist/chat/browser-decision-check.cjs +131 -0
  222. package/dist/chat/browser-decision-check.cjs.map +1 -0
  223. package/dist/chat/browser-decision-check.d.ts +61 -0
  224. package/dist/chat/browser-decision-check.js +131 -0
  225. package/dist/chat/browser-decision-check.js.map +1 -0
  226. package/dist/chat/chat-outbox-rows.cjs +3 -3
  227. package/dist/chat/chat-outbox-rows.cjs.map +1 -1
  228. package/dist/chat/chat-voice-controls.cjs +93 -28
  229. package/dist/chat/chat-voice-controls.cjs.map +1 -1
  230. package/dist/chat/chat-voice-controls.d.ts +36 -2
  231. package/dist/chat/chat-voice-controls.js +89 -24
  232. package/dist/chat/chat-voice-controls.js.map +1 -1
  233. package/dist/chat/composer-keyboard-hint.cjs +5 -5
  234. package/dist/chat/composer-keyboard-hint.cjs.map +1 -1
  235. package/dist/chat/device-operation.cjs +29 -0
  236. package/dist/chat/device-operation.cjs.map +1 -0
  237. package/dist/chat/device-operation.d.ts +34 -0
  238. package/dist/chat/device-operation.js +29 -0
  239. package/dist/chat/device-operation.js.map +1 -0
  240. package/dist/chat/super-grouping/CollapsibleGroup.cjs +14 -14
  241. package/dist/chat/super-grouping/CollapsibleGroup.cjs.map +1 -1
  242. package/dist/chat/super-grouping/GroupedMessageParts.cjs +4 -4
  243. package/dist/chat/super-grouping/GroupedMessageParts.cjs.map +1 -1
  244. package/dist/chat/super-grouping/SuperGroupingCard.cjs +52 -36
  245. package/dist/chat/super-grouping/SuperGroupingCard.cjs.map +1 -1
  246. package/dist/chat/super-grouping/SuperGroupingCard.d.ts +19 -4
  247. package/dist/chat/super-grouping/SuperGroupingCard.js +29 -13
  248. package/dist/chat/super-grouping/SuperGroupingCard.js.map +1 -1
  249. package/dist/chat/super-grouping/SuperGroupingTranscript.cjs +32 -32
  250. package/dist/chat/super-grouping/SuperGroupingTranscript.cjs.map +1 -1
  251. package/dist/chat/super-grouping/SuperGroupingTranscript.js +3 -3
  252. package/dist/chat/super-grouping/SuperGroupingTranscript.js.map +1 -1
  253. package/dist/chat/super-grouping/ToolTimeline.cjs +73 -40
  254. package/dist/chat/super-grouping/ToolTimeline.cjs.map +1 -1
  255. package/dist/chat/super-grouping/ToolTimeline.d.ts +10 -2
  256. package/dist/chat/super-grouping/ToolTimeline.js +69 -36
  257. package/dist/chat/super-grouping/ToolTimeline.js.map +1 -1
  258. package/dist/chat/super-grouping/activity-timeline.cjs +47 -12
  259. package/dist/chat/super-grouping/activity-timeline.cjs.map +1 -1
  260. package/dist/chat/super-grouping/activity-timeline.d.ts +21 -0
  261. package/dist/chat/super-grouping/activity-timeline.js +47 -12
  262. package/dist/chat/super-grouping/activity-timeline.js.map +1 -1
  263. package/dist/chat/super-grouping/grouping-function.cjs +4 -0
  264. package/dist/chat/super-grouping/grouping-function.cjs.map +1 -1
  265. package/dist/chat/super-grouping/grouping-function.d.ts +7 -0
  266. package/dist/chat/super-grouping/grouping-function.js +5 -1
  267. package/dist/chat/super-grouping/grouping-function.js.map +1 -1
  268. package/dist/chat/super-grouping/index.cjs +6 -0
  269. package/dist/chat/super-grouping/index.cjs.map +1 -1
  270. package/dist/chat/super-grouping/index.d.ts +5 -2
  271. package/dist/chat/super-grouping/index.js +7 -1
  272. package/dist/chat/super-grouping/index.js.map +1 -1
  273. package/dist/chat/super-grouping/tool-part-placement.cjs +17 -0
  274. package/dist/chat/super-grouping/tool-part-placement.cjs.map +1 -0
  275. package/dist/chat/super-grouping/tool-part-placement.d.ts +22 -0
  276. package/dist/chat/super-grouping/tool-part-placement.js +17 -0
  277. package/dist/chat/super-grouping/tool-part-placement.js.map +1 -0
  278. package/dist/chat/thread-scroll-to-bottom.cjs +2 -2
  279. package/dist/chat/thread-scroll-to-bottom.cjs.map +1 -1
  280. package/dist/chat/thread-scroll-to-bottom.d.ts +10 -7
  281. package/dist/chat/thread-scroll-to-bottom.js +2 -2
  282. package/dist/chat/thread-scroll-to-bottom.js.map +1 -1
  283. package/dist/chat/tooltip-icon-button.cjs +2 -2
  284. package/dist/chat/tooltip-icon-button.cjs.map +1 -1
  285. package/dist/chat/use-athena-voice-live.cjs +11 -0
  286. package/dist/chat/use-athena-voice-live.cjs.map +1 -0
  287. package/dist/chat/use-athena-voice-live.d.ts +11 -0
  288. package/dist/chat/use-athena-voice-live.js +11 -0
  289. package/dist/chat/use-athena-voice-live.js.map +1 -0
  290. package/dist/chat/use-statewire-approval-request.cjs +56 -24
  291. package/dist/chat/use-statewire-approval-request.cjs.map +1 -1
  292. package/dist/chat/use-statewire-approval-request.d.ts +33 -4
  293. package/dist/chat/use-statewire-approval-request.js +41 -9
  294. package/dist/chat/use-statewire-approval-request.js.map +1 -1
  295. package/dist/chat-ui/auth/sign-in-card.cjs +2 -2
  296. package/dist/chat-ui/auth/sign-in-card.cjs.map +1 -1
  297. package/dist/chat-ui/composer/tiptap-composer.cjs +138 -107
  298. package/dist/chat-ui/composer/tiptap-composer.cjs.map +1 -1
  299. package/dist/chat-ui/composer/tiptap-composer.d.ts +20 -4
  300. package/dist/chat-ui/composer/tiptap-composer.js +85 -54
  301. package/dist/chat-ui/composer/tiptap-composer.js.map +1 -1
  302. package/dist/chat-ui/header/conversation-history-panel.cjs +49 -23
  303. package/dist/chat-ui/header/conversation-history-panel.cjs.map +1 -1
  304. package/dist/chat-ui/header/conversation-history-panel.d.ts +12 -1
  305. package/dist/chat-ui/header/conversation-history-panel.js +38 -12
  306. package/dist/chat-ui/header/conversation-history-panel.js.map +1 -1
  307. package/dist/chat-ui/index.cjs +18 -0
  308. package/dist/chat-ui/index.cjs.map +1 -1
  309. package/dist/chat-ui/index.d.ts +7 -1
  310. package/dist/chat-ui/index.js +18 -0
  311. package/dist/chat-ui/index.js.map +1 -1
  312. package/dist/chat-ui/mentions/mention-chip.cjs +4 -4
  313. package/dist/chat-ui/mentions/mention-chip.cjs.map +1 -1
  314. package/dist/chat-ui/mentions/suggestions/components/mention-suggestion-list.cjs +10 -9
  315. package/dist/chat-ui/mentions/suggestions/components/mention-suggestion-list.cjs.map +1 -1
  316. package/dist/chat-ui/mentions/suggestions/components/mention-suggestion-list.js +3 -2
  317. package/dist/chat-ui/mentions/suggestions/components/mention-suggestion-list.js.map +1 -1
  318. package/dist/chat-ui/mentions/suggestions/components/mention-suggestion-popup.cjs +2 -2
  319. package/dist/chat-ui/mentions/suggestions/components/mention-suggestion-popup.cjs.map +1 -1
  320. package/dist/chat-ui/mentions/suggestions/components/menu-list.cjs +29 -6
  321. package/dist/chat-ui/mentions/suggestions/components/menu-list.cjs.map +1 -1
  322. package/dist/chat-ui/mentions/suggestions/components/menu-list.d.ts +7 -1
  323. package/dist/chat-ui/mentions/suggestions/components/menu-list.js +25 -2
  324. package/dist/chat-ui/mentions/suggestions/components/menu-list.js.map +1 -1
  325. package/dist/chat-ui/mentions/suggestions/components/use-keyboard-navigation.cjs +2 -2
  326. package/dist/chat-ui/mentions/suggestions/components/use-keyboard-navigation.cjs.map +1 -1
  327. package/dist/chat-ui/mentions/suggestions/components/use-menu-navigation.cjs +2 -2
  328. package/dist/chat-ui/mentions/suggestions/components/use-menu-navigation.cjs.map +1 -1
  329. package/dist/chat-ui/mentions/suggestions/data/api-client.cjs +3 -3
  330. package/dist/chat-ui/mentions/suggestions/data/api-client.cjs.map +1 -1
  331. package/dist/chat-ui/mentions/suggestions/data/orchestrator.cjs +56 -2
  332. package/dist/chat-ui/mentions/suggestions/data/orchestrator.cjs.map +1 -1
  333. package/dist/chat-ui/mentions/suggestions/data/orchestrator.d.ts +12 -0
  334. package/dist/chat-ui/mentions/suggestions/data/orchestrator.js +56 -2
  335. package/dist/chat-ui/mentions/suggestions/data/orchestrator.js.map +1 -1
  336. package/dist/chat-ui/mentions/suggestions/data/sources/index.cjs +24 -3
  337. package/dist/chat-ui/mentions/suggestions/data/sources/index.cjs.map +1 -1
  338. package/dist/chat-ui/mentions/suggestions/data/sources/index.d.ts +7 -0
  339. package/dist/chat-ui/mentions/suggestions/data/sources/index.js +24 -3
  340. package/dist/chat-ui/mentions/suggestions/data/sources/index.js.map +1 -1
  341. package/dist/chat-ui/mentions/suggestions/data/use-mention-suggestions.cjs +35 -13
  342. package/dist/chat-ui/mentions/suggestions/data/use-mention-suggestions.cjs.map +1 -1
  343. package/dist/chat-ui/mentions/suggestions/data/use-mention-suggestions.d.ts +15 -1
  344. package/dist/chat-ui/mentions/suggestions/data/use-mention-suggestions.js +28 -6
  345. package/dist/chat-ui/mentions/suggestions/data/use-mention-suggestions.js.map +1 -1
  346. package/dist/chat-ui/mentions/suggestions/data/use-menu-items.cjs +9 -6
  347. package/dist/chat-ui/mentions/suggestions/data/use-menu-items.cjs.map +1 -1
  348. package/dist/chat-ui/mentions/suggestions/data/use-menu-items.d.ts +3 -0
  349. package/dist/chat-ui/mentions/suggestions/data/use-menu-items.js +5 -2
  350. package/dist/chat-ui/mentions/suggestions/data/use-menu-items.js.map +1 -1
  351. package/dist/chat-ui/mentions/use-account-workspace-id.cjs +45 -10
  352. package/dist/chat-ui/mentions/use-account-workspace-id.cjs.map +1 -1
  353. package/dist/chat-ui/mentions/use-account-workspace-id.d.ts +24 -1
  354. package/dist/chat-ui/mentions/use-account-workspace-id.js +46 -11
  355. package/dist/chat-ui/mentions/use-account-workspace-id.js.map +1 -1
  356. package/dist/chat-ui/mentions/use-member-avatar.cjs +4 -4
  357. package/dist/chat-ui/mentions/use-member-avatar.cjs.map +1 -1
  358. package/dist/chat-ui/mentions/use-mention-asset.cjs +3 -3
  359. package/dist/chat-ui/mentions/use-mention-asset.cjs.map +1 -1
  360. package/dist/chat-ui/messages/answer-label.cjs +42 -0
  361. package/dist/chat-ui/messages/answer-label.cjs.map +1 -0
  362. package/dist/chat-ui/messages/answer-label.d.ts +33 -0
  363. package/dist/chat-ui/messages/answer-label.js +42 -0
  364. package/dist/chat-ui/messages/answer-label.js.map +1 -0
  365. package/dist/chat-ui/messages/arrival-animation.cjs +13 -0
  366. package/dist/chat-ui/messages/arrival-animation.cjs.map +1 -0
  367. package/dist/chat-ui/messages/arrival-animation.d.ts +14 -0
  368. package/dist/chat-ui/messages/arrival-animation.js +13 -0
  369. package/dist/chat-ui/messages/arrival-animation.js.map +1 -0
  370. package/dist/chat-ui/messages/continue-pill.cjs +5 -5
  371. package/dist/chat-ui/messages/continue-pill.cjs.map +1 -1
  372. package/dist/chat-ui/messages/handoff-arrival-divider.cjs +44 -0
  373. package/dist/chat-ui/messages/handoff-arrival-divider.cjs.map +1 -0
  374. package/dist/chat-ui/messages/handoff-arrival-divider.d.ts +17 -0
  375. package/dist/chat-ui/messages/handoff-arrival-divider.js +44 -0
  376. package/dist/chat-ui/messages/handoff-arrival-divider.js.map +1 -0
  377. package/dist/chat-ui/messages/message-actions-config.cjs +3 -3
  378. package/dist/chat-ui/messages/message-actions-config.cjs.map +1 -1
  379. package/dist/chat-ui/messages/message-components.cjs +8 -4
  380. package/dist/chat-ui/messages/message-components.cjs.map +1 -1
  381. package/dist/chat-ui/messages/message-components.js +5 -1
  382. package/dist/chat-ui/messages/message-components.js.map +1 -1
  383. package/dist/chat-ui/messages/message-images.cjs +66 -0
  384. package/dist/chat-ui/messages/message-images.cjs.map +1 -0
  385. package/dist/chat-ui/messages/message-images.d.ts +16 -0
  386. package/dist/chat-ui/messages/message-images.js +66 -0
  387. package/dist/chat-ui/messages/message-images.js.map +1 -0
  388. package/dist/chat-ui/messages/user-edit-composer.cjs +2 -2
  389. package/dist/chat-ui/messages/user-edit-composer.cjs.map +1 -1
  390. package/dist/chat-ui/messages/wake-marker.cjs +3 -3
  391. package/dist/chat-ui/messages/wake-marker.cjs.map +1 -1
  392. package/dist/chat-ui/rich-text/chat-link.cjs +2 -2
  393. package/dist/chat-ui/rich-text/chat-link.cjs.map +1 -1
  394. package/dist/chat-ui/rich-text/chat-message-body.cjs +8 -8
  395. package/dist/chat-ui/rich-text/chat-message-body.cjs.map +1 -1
  396. package/dist/chat-ui/rich-text/chat-node-views.cjs +6 -6
  397. package/dist/chat-ui/rich-text/chat-node-views.cjs.map +1 -1
  398. package/dist/chat-ui/rich-text/dom-output-spec.cjs +2 -2
  399. package/dist/chat-ui/rich-text/dom-output-spec.cjs.map +1 -1
  400. package/dist/chat-ui/statewire.cjs +3 -0
  401. package/dist/chat-ui/statewire.cjs.map +1 -1
  402. package/dist/chat-ui/statewire.d.ts +2 -1
  403. package/dist/chat-ui/statewire.js +3 -0
  404. package/dist/chat-ui/statewire.js.map +1 -1
  405. package/dist/chat-ui/thread/chat-thread-shell.cjs +43 -14
  406. package/dist/chat-ui/thread/chat-thread-shell.cjs.map +1 -1
  407. package/dist/chat-ui/thread/chat-thread-shell.d.ts +16 -2
  408. package/dist/chat-ui/thread/chat-thread-shell.js +35 -6
  409. package/dist/chat-ui/thread/chat-thread-shell.js.map +1 -1
  410. package/dist/chat-ui/thread/composer-send-or-stop.cjs +30 -20
  411. package/dist/chat-ui/thread/composer-send-or-stop.cjs.map +1 -1
  412. package/dist/chat-ui/thread/composer-send-or-stop.d.ts +8 -0
  413. package/dist/chat-ui/thread/composer-send-or-stop.js +29 -19
  414. package/dist/chat-ui/thread/composer-send-or-stop.js.map +1 -1
  415. package/dist/chat-ui/thread/statewire-history-edge.cjs +20 -21
  416. package/dist/chat-ui/thread/statewire-history-edge.cjs.map +1 -1
  417. package/dist/chat-ui/thread/statewire-history-edge.js +3 -4
  418. package/dist/chat-ui/thread/statewire-history-edge.js.map +1 -1
  419. package/dist/chat-ui/thread/thread-loading-overlay.cjs +5 -5
  420. package/dist/chat-ui/thread/thread-loading-overlay.cjs.map +1 -1
  421. package/dist/collab/client.cjs +40 -3
  422. package/dist/collab/client.cjs.map +1 -1
  423. package/dist/collab/client.d.ts +25 -0
  424. package/dist/collab/client.js +40 -3
  425. package/dist/collab/client.js.map +1 -1
  426. package/dist/collab/document-status.cjs +150 -0
  427. package/dist/collab/document-status.cjs.map +1 -0
  428. package/dist/collab/document-status.d.ts +68 -0
  429. package/dist/collab/document-status.js +150 -0
  430. package/dist/collab/document-status.js.map +1 -0
  431. package/dist/collab/index.cjs +7 -0
  432. package/dist/collab/index.cjs.map +1 -1
  433. package/dist/collab/index.d.ts +6 -1
  434. package/dist/collab/index.js +7 -0
  435. package/dist/collab/index.js.map +1 -1
  436. package/dist/collab/presence-react.cjs +11 -11
  437. package/dist/collab/presence-react.cjs.map +1 -1
  438. package/dist/collab/react.cjs +6 -6
  439. package/dist/collab/react.cjs.map +1 -1
  440. package/dist/composer/AttachmentContext.cjs +24 -11
  441. package/dist/composer/AttachmentContext.cjs.map +1 -1
  442. package/dist/composer/AttachmentContext.js +18 -5
  443. package/dist/composer/AttachmentContext.js.map +1 -1
  444. package/dist/composer/ComposerAttachmentPreview.cjs +78 -23
  445. package/dist/composer/ComposerAttachmentPreview.cjs.map +1 -1
  446. package/dist/composer/ComposerAttachmentPreview.d.ts +5 -3
  447. package/dist/composer/ComposerAttachmentPreview.js +79 -24
  448. package/dist/composer/ComposerAttachmentPreview.js.map +1 -1
  449. package/dist/composer/ComposerDropZone.cjs +7 -7
  450. package/dist/composer/ComposerDropZone.cjs.map +1 -1
  451. package/dist/composer/FileUploadButton.cjs +37 -22
  452. package/dist/composer/FileUploadButton.cjs.map +1 -1
  453. package/dist/composer/FileUploadButton.d.ts +6 -0
  454. package/dist/composer/FileUploadButton.js +34 -19
  455. package/dist/composer/FileUploadButton.js.map +1 -1
  456. package/dist/composer/QuoteContext.cjs +8 -8
  457. package/dist/composer/QuoteContext.cjs.map +1 -1
  458. package/dist/composer/composer-handoff.cjs +4 -4
  459. package/dist/composer/composer-handoff.cjs.map +1 -1
  460. package/dist/composer/useAppendToComposer.cjs +4 -4
  461. package/dist/composer/useAppendToComposer.cjs.map +1 -1
  462. package/dist/composer/useAttachFiles.cjs +23 -6
  463. package/dist/composer/useAttachFiles.cjs.map +1 -1
  464. package/dist/composer/useAttachFiles.d.ts +15 -7
  465. package/dist/composer/useAttachFiles.js +22 -5
  466. package/dist/composer/useAttachFiles.js.map +1 -1
  467. package/dist/composer/useComposerAttachment.cjs +4 -4
  468. package/dist/composer/useComposerAttachment.cjs.map +1 -1
  469. package/dist/composer/useFileUpload.cjs +21 -16
  470. package/dist/composer/useFileUpload.cjs.map +1 -1
  471. package/dist/composer/useFileUpload.d.ts +12 -0
  472. package/dist/composer/useFileUpload.js +12 -7
  473. package/dist/composer/useFileUpload.js.map +1 -1
  474. package/dist/composer/useReadComposerDraft.cjs +2 -2
  475. package/dist/composer/useReadComposerDraft.cjs.map +1 -1
  476. package/dist/composer/useSendMessage.cjs +4 -4
  477. package/dist/composer/useSendMessage.cjs.map +1 -1
  478. package/dist/diagnostics/useAthenaDiagnostics.cjs +4 -4
  479. package/dist/diagnostics/useAthenaDiagnostics.cjs.map +1 -1
  480. package/dist/dictation/audio-level-history.cjs +3 -3
  481. package/dist/dictation/audio-level-history.cjs.map +1 -1
  482. package/dist/dictation/dictation-controls.cjs +24 -20
  483. package/dist/dictation/dictation-controls.cjs.map +1 -1
  484. package/dist/dictation/dictation-controls.d.ts +6 -1
  485. package/dist/dictation/dictation-controls.js +24 -20
  486. package/dist/dictation/dictation-controls.js.map +1 -1
  487. package/dist/dictation/use-athena-dictation-engine.cjs +3 -3
  488. package/dist/dictation/use-athena-dictation-engine.cjs.map +1 -1
  489. package/dist/dictation/use-dictation.cjs +22 -22
  490. package/dist/dictation/use-dictation.cjs.map +1 -1
  491. package/dist/index.cjs +26 -2
  492. package/dist/index.cjs.map +1 -1
  493. package/dist/index.d.ts +15 -3
  494. package/dist/index.js +26 -2
  495. package/dist/index.js.map +1 -1
  496. package/dist/keryx-http/src/receive-only-socket.cjs +40 -0
  497. package/dist/keryx-http/src/receive-only-socket.cjs.map +1 -0
  498. package/dist/keryx-http/src/receive-only-socket.d.ts +27 -0
  499. package/dist/keryx-http/src/receive-only-socket.js +40 -0
  500. package/dist/keryx-http/src/receive-only-socket.js.map +1 -0
  501. package/dist/keryx-http/src/update-attributions.cjs +111 -0
  502. package/dist/keryx-http/src/update-attributions.cjs.map +1 -0
  503. package/dist/keryx-http/src/update-attributions.d.ts +75 -0
  504. package/dist/keryx-http/src/update-attributions.js +111 -0
  505. package/dist/keryx-http/src/update-attributions.js.map +1 -0
  506. package/dist/lib/owner-document.cjs +6 -6
  507. package/dist/lib/owner-document.cjs.map +1 -1
  508. package/dist/lib/use-athena-rest-query.cjs +4 -4
  509. package/dist/lib/use-athena-rest-query.cjs.map +1 -1
  510. package/dist/lib/use-document-active.cjs +4 -4
  511. package/dist/lib/use-document-active.cjs.map +1 -1
  512. package/dist/lib/use-prefers-reduced-motion.cjs +2 -2
  513. package/dist/lib/use-prefers-reduced-motion.cjs.map +1 -1
  514. package/dist/offline/offline-history.cjs +7 -7
  515. package/dist/offline/offline-history.cjs.map +1 -1
  516. package/dist/provider/AthenaContext.cjs +3 -3
  517. package/dist/provider/AthenaContext.cjs.map +1 -1
  518. package/dist/provider/AthenaProvider.cjs +116 -79
  519. package/dist/provider/AthenaProvider.cjs.map +1 -1
  520. package/dist/provider/AthenaProvider.js +40 -3
  521. package/dist/provider/AthenaProvider.js.map +1 -1
  522. package/dist/provider/PostHogProvider.cjs +2 -2
  523. package/dist/provider/PostHogProvider.cjs.map +1 -1
  524. package/dist/provider/agent-selection-context.cjs +2 -2
  525. package/dist/provider/agent-selection-context.cjs.map +1 -1
  526. package/dist/provider/chat-mode-context.cjs +2 -2
  527. package/dist/provider/chat-mode-context.cjs.map +1 -1
  528. package/dist/provider/session-persistence-context.cjs +10 -0
  529. package/dist/provider/session-persistence-context.cjs.map +1 -0
  530. package/dist/provider/session-persistence-context.d.ts +15 -0
  531. package/dist/provider/session-persistence-context.js +10 -0
  532. package/dist/provider/session-persistence-context.js.map +1 -0
  533. package/dist/provider/statewire-history-context.cjs +4 -4
  534. package/dist/provider/statewire-history-context.cjs.map +1 -1
  535. package/dist/provider/statewire-lifecycle-context.cjs +3 -3
  536. package/dist/provider/statewire-lifecycle-context.cjs.map +1 -1
  537. package/dist/provider/statewire-window-context.cjs +3 -3
  538. package/dist/provider/statewire-window-context.cjs.map +1 -1
  539. package/dist/provider/theme-style-context.cjs +3 -3
  540. package/dist/provider/theme-style-context.cjs.map +1 -1
  541. package/dist/react/package.json.cjs +1 -1
  542. package/dist/react/package.json.js +1 -1
  543. package/dist/runtime/StatewireThreadConfigLaneSync.cjs +10 -10
  544. package/dist/runtime/StatewireThreadConfigLaneSync.cjs.map +1 -1
  545. package/dist/runtime/auth-refusal-restart.cjs +7 -7
  546. package/dist/runtime/auth-refusal-restart.cjs.map +1 -1
  547. package/dist/runtime/auth.cjs +13 -13
  548. package/dist/runtime/auth.cjs.map +1 -1
  549. package/dist/runtime/statewire-lifecycle.cjs +1 -0
  550. package/dist/runtime/statewire-lifecycle.cjs.map +1 -1
  551. package/dist/runtime/statewire-lifecycle.d.ts +3 -1
  552. package/dist/runtime/statewire-lifecycle.js +2 -1
  553. package/dist/runtime/statewire-lifecycle.js.map +1 -1
  554. package/dist/runtime/statewire-server-lane-context.cjs +2 -2
  555. package/dist/runtime/statewire-server-lane-context.cjs.map +1 -1
  556. package/dist/runtime/statewire-session-lane.cjs +4 -4
  557. package/dist/runtime/statewire-session-lane.cjs.map +1 -1
  558. package/dist/runtime/useAthenaStatewireRuntime.cjs +10 -8
  559. package/dist/runtime/useAthenaStatewireRuntime.cjs.map +1 -1
  560. package/dist/runtime/useAthenaStatewireRuntime.d.ts +2 -0
  561. package/dist/runtime/useAthenaStatewireRuntime.js +2 -0
  562. package/dist/runtime/useAthenaStatewireRuntime.js.map +1 -1
  563. package/dist/styles.css +1 -1
  564. package/dist/threads/Inbox.cjs +8 -8
  565. package/dist/threads/Inbox.cjs.map +1 -1
  566. package/dist/threads/SessionList.cjs +9 -9
  567. package/dist/threads/SessionList.cjs.map +1 -1
  568. package/dist/threads/SessionsPage.cjs +11 -11
  569. package/dist/threads/SessionsPage.cjs.map +1 -1
  570. package/dist/threads/index-triggered-refresh.cjs +10 -10
  571. package/dist/threads/index-triggered-refresh.cjs.map +1 -1
  572. package/dist/threads/mark-viewed-thread-read.cjs +12 -12
  573. package/dist/threads/mark-viewed-thread-read.cjs.map +1 -1
  574. package/dist/threads/offline-session-list.cjs +3 -3
  575. package/dist/threads/offline-session-list.cjs.map +1 -1
  576. package/dist/threads/session-list-tab-share.cjs +5 -5
  577. package/dist/threads/session-list-tab-share.cjs.map +1 -1
  578. package/dist/threads/statewire-thread-list.cjs +51 -51
  579. package/dist/threads/statewire-thread-list.cjs.map +1 -1
  580. package/dist/threads/thread-id-context.cjs +5 -5
  581. package/dist/threads/thread-id-context.cjs.map +1 -1
  582. package/dist/threads/use-athena-session-attention.cjs +2 -2
  583. package/dist/threads/use-athena-session-attention.cjs.map +1 -1
  584. package/dist/threads/use-athena-sessions.cjs +10 -10
  585. package/dist/threads/use-athena-sessions.cjs.map +1 -1
  586. package/dist/threads/use-athena-thread-model.cjs +3 -3
  587. package/dist/threads/use-athena-thread-model.cjs.map +1 -1
  588. package/dist/threads/use-rest-conversation-history.cjs +3 -3
  589. package/dist/threads/use-rest-conversation-history.cjs.map +1 -1
  590. package/dist/threads/use-statewire-conversation-history.cjs +8 -8
  591. package/dist/threads/use-statewire-conversation-history.cjs.map +1 -1
  592. package/dist/threads/use-thread-archive.cjs +9 -9
  593. package/dist/threads/use-thread-archive.cjs.map +1 -1
  594. package/dist/threads/use-thread-favorite.cjs +2 -2
  595. package/dist/threads/use-thread-favorite.cjs.map +1 -1
  596. package/dist/threads/use-thread-field-override.cjs +20 -20
  597. package/dist/threads/use-thread-field-override.cjs.map +1 -1
  598. package/dist/threads/use-thread-read-state.cjs +4 -4
  599. package/dist/threads/use-thread-read-state.cjs.map +1 -1
  600. package/dist/threads/use-thread-rename.cjs +2 -2
  601. package/dist/threads/use-thread-rename.cjs.map +1 -1
  602. package/dist/threads/useAthenaThreadManager.cjs +2 -2
  603. package/dist/threads/useAthenaThreadManager.cjs.map +1 -1
  604. package/dist/tools/NestedPtcMessages.cjs +6 -6
  605. package/dist/tools/NestedPtcMessages.cjs.map +1 -1
  606. package/dist/tools/append-document-tool-ui.cjs +7 -7
  607. package/dist/tools/append-document-tool-ui.cjs.map +1 -1
  608. package/dist/tools/file-tool-uis.cjs +2 -2
  609. package/dist/tools/file-tool-uis.cjs.map +1 -1
  610. package/dist/tools/misc-tool-uis.cjs +2 -2
  611. package/dist/tools/misc-tool-uis.cjs.map +1 -1
  612. package/dist/tools/primitives.cjs +6 -6
  613. package/dist/tools/primitives.cjs.map +1 -1
  614. package/dist/tools/read-asset-tool-ui.cjs +6 -6
  615. package/dist/tools/read-asset-tool-ui.cjs.map +1 -1
  616. package/dist/tools/subagent-task-tool-ui.cjs +21 -21
  617. package/dist/tools/subagent-task-tool-ui.cjs.map +1 -1
  618. package/dist/tools/test-recording-tool-uis.cjs +16 -16
  619. package/dist/tools/test-recording-tool-uis.cjs.map +1 -1
  620. package/dist/tools/todo-plan-store.cjs +4 -4
  621. package/dist/tools/todo-plan-store.cjs.map +1 -1
  622. package/dist/tools/tool-appearance.cjs +3 -3
  623. package/dist/tools/tool-appearance.cjs.map +1 -1
  624. package/dist/tools/tool-fallback.cjs +14 -14
  625. package/dist/tools/tool-fallback.cjs.map +1 -1
  626. package/dist/tools/tool-uis.cjs +74 -74
  627. package/dist/tools/tool-uis.cjs.map +1 -1
  628. package/dist/tools/use-elapsed-seconds.cjs +3 -3
  629. package/dist/tools/use-elapsed-seconds.cjs.map +1 -1
  630. package/dist/tools/write-todos-tool-ui.cjs +9 -9
  631. package/dist/tools/write-todos-tool-ui.cjs.map +1 -1
  632. package/dist/ui/image-viewer.cjs +382 -0
  633. package/dist/ui/image-viewer.cjs.map +1 -0
  634. package/dist/ui/image-viewer.d.ts +50 -0
  635. package/dist/ui/image-viewer.js +382 -0
  636. package/dist/ui/image-viewer.js.map +1 -0
  637. package/dist/voice/chat.cjs +6 -0
  638. package/dist/voice/chat.cjs.map +1 -1
  639. package/dist/voice/chat.d.ts +1 -1
  640. package/dist/voice/chat.js +8 -2
  641. package/dist/voice/livekit-join.cjs +52 -101
  642. package/dist/voice/livekit-join.cjs.map +1 -1
  643. package/dist/voice/livekit-join.d.ts +1 -6
  644. package/dist/voice/livekit-join.js +52 -101
  645. package/dist/voice/livekit-join.js.map +1 -1
  646. package/dist/voice/livekit.cjs.map +1 -1
  647. package/dist/voice/livekit.d.ts +11 -1
  648. package/dist/voice/livekit.js.map +1 -1
  649. package/dist/voice/use-athena-voice-session.cjs +34 -34
  650. package/dist/voice/use-athena-voice-session.cjs.map +1 -1
  651. package/dist/workbench/ComputerLiveDesktop.cjs +13 -13
  652. package/dist/workbench/ComputerLiveDesktop.cjs.map +1 -1
  653. package/dist/workbench/SessionWorkbench.cjs +22 -22
  654. package/dist/workbench/SessionWorkbench.cjs.map +1 -1
  655. package/dist/workbench/session-workbench-context.cjs +3 -3
  656. package/dist/workbench/session-workbench-context.cjs.map +1 -1
  657. package/dist/workbench/session-workbench-panes.cjs +8 -8
  658. package/dist/workbench/session-workbench-panes.cjs.map +1 -1
  659. package/dist/workbench/workbench-layout-context.cjs +3 -3
  660. package/dist/workbench/workbench-layout-context.cjs.map +1 -1
  661. package/package.json +2 -1
@@ -1 +1 @@
1
- {"version":3,"file":"read-asset-tool-ui.cjs","sources":["../../src/tools/read-asset-tool-ui.tsx"],"sourcesContent":["import { memo, useMemo, useState } from \"react\";\nimport type { ToolCallMessagePartComponent } from \"@assistant-ui/react\";\nimport {\n CheckCircle2Icon,\n ChevronDownIcon,\n FileTextIcon,\n LoaderIcon,\n AlertCircleIcon,\n BookOpenIcon,\n} from \"lucide-react\";\nimport { cn } from \"../lib/utils\";\nimport { rangePreviewFromCellMap } from \"../sheet-range/range-preview\";\nimport { RangePreviewTable } from \"../sheet-range/range-preview-table\";\nimport { getAssetInfo, tryParseJson } from \"./asset-utils\";\n\nfunction normalizeResult(result: unknown): unknown {\n if (typeof result === \"string\") return tryParseJson(result) ?? result;\n if (typeof result === \"object\" && result !== null) {\n const obj = result as Record<string, unknown>;\n if (typeof obj.result === \"string\")\n return tryParseJson(obj.result) ?? obj.result;\n return obj;\n }\n return result;\n}\n\nfunction isErrorResult(resultText: string): boolean {\n return (\n resultText.startsWith(\"Error reading asset\") ||\n resultText.startsWith(\"Error:\")\n );\n}\n\ninterface ReadAssetResultItem {\n asset_id?: string;\n format?: string;\n content?: string;\n success?: boolean;\n error?: string;\n title?: string;\n}\n\nfunction isReadAssetResultItem(value: unknown): value is ReadAssetResultItem {\n if (!value || typeof value !== \"object\") return false;\n const item = value as Record<string, unknown>;\n return (\n typeof item.asset_id === \"string\" ||\n typeof item.format === \"string\" ||\n typeof item.content === \"string\" ||\n typeof item.success === \"boolean\" ||\n typeof item.error === \"string\"\n );\n}\n\nfunction getResultItems(value: unknown): ReadAssetResultItem[] {\n if (Array.isArray(value)) return value.filter(isReadAssetResultItem);\n if (isReadAssetResultItem(value)) return [value];\n return [];\n}\n\nfunction getResultAssetIds(items: ReadAssetResultItem[]): string[] {\n return items\n .map((item) => item.asset_id?.split(\"?\")[0])\n .filter((assetId): assetId is string => !!assetId);\n}\n\nfunction getReviewedText(items: ReadAssetResultItem[]): string | null {\n const textParts = items\n .filter(\n (item) =>\n item.success !== false &&\n typeof item.content === \"string\" &&\n item.content,\n )\n .map((item) => item.content as string);\n return textParts.length > 0 ? textParts.join(\"\\n\\n---\\n\\n\") : null;\n}\n\nfunction getErrorText(items: ReadAssetResultItem[]): string | null {\n const firstError = items.find((item) => item.success === false && item.error);\n return firstError?.error ?? null;\n}\n\n// --- Workbook preview ---\n\ntype WorkbookCellValue =\n | string\n | number\n | boolean\n | null\n | [string, unknown]\n | [string, unknown, string];\n\ninterface WorkbookSheet {\n sheetName: string;\n dimension: string;\n cells: Record<string, WorkbookCellValue>;\n}\n\ninterface WorkbookFormat {\n workbook: {\n sheets: WorkbookSheet[];\n };\n}\n\nfunction isWorkbookFormat(value: unknown): value is WorkbookFormat {\n if (!value || typeof value !== \"object\") return false;\n const obj = value as Record<string, unknown>;\n if (!obj.workbook || typeof obj.workbook !== \"object\") return false;\n const workbook = obj.workbook as Record<string, unknown>;\n return Array.isArray(workbook.sheets);\n}\n\nfunction formatCellValue(value: WorkbookCellValue | undefined): string {\n if (value === null || value === undefined) return \"\";\n if (Array.isArray(value)) return String(value[0] ?? \"\");\n return String(value);\n}\n\n// A glance at each sheet, not the whole of it: the card's body is short.\nconst WORKBOOK_PREVIEW_MAX_ROWS = 12;\nconst WORKBOOK_PREVIEW_MAX_COLUMNS = 8;\n\nfunction WorkbookPreview({ workbook }: { workbook: WorkbookFormat }) {\n return (\n <div className=\"space-y-3\">\n {workbook.workbook.sheets.map((sheet) => {\n const preview = rangePreviewFromCellMap({\n range: sheet.dimension,\n cells: sheet.cells ?? {},\n formatCell: formatCellValue,\n maxRows: WORKBOOK_PREVIEW_MAX_ROWS,\n maxColumns: WORKBOOK_PREVIEW_MAX_COLUMNS,\n });\n if (!preview) return null;\n\n return (\n <div key={sheet.sheetName}>\n <p className=\"mb-1 text-xs font-semibold text-muted-foreground\">\n {sheet.sheetName}\n </p>\n <RangePreviewTable\n preview={preview}\n maxRows={WORKBOOK_PREVIEW_MAX_ROWS}\n maxColumns={WORKBOOK_PREVIEW_MAX_COLUMNS}\n caption={`${sheet.sheetName} ${sheet.dimension}`}\n />\n <p className=\"mt-1 text-[10px] text-muted-foreground\">\n Showing preview from {sheet.dimension}\n </p>\n </div>\n );\n })}\n </div>\n );\n}\n\nfunction TextContentPreview({ text }: { text: string }) {\n const lines = text.split(\"\\n\");\n const previewLines = lines.slice(0, 20);\n const hasMore = lines.length > 20;\n\n return (\n <pre className=\"whitespace-pre-wrap break-words text-[12px] leading-[1.6] text-muted-foreground\">\n {previewLines.join(\"\\n\")}\n {hasMore && (\n <span className=\"text-muted-foreground/70\">{`\\n... ${lines.length - 20} more lines`}</span>\n )}\n </pre>\n );\n}\n\n// --- Main component ---\n\nconst ReadAssetToolUIImpl: ToolCallMessagePartComponent = ({\n args,\n result,\n status,\n isError: isToolError,\n}) => {\n const [expanded, setExpanded] = useState(false);\n\n const typedArgs = args as Record<string, unknown> | undefined;\n const assetIds = (typedArgs?.asset_ids as string[]) ?? [];\n const firstAssetId = assetIds[0] ?? \"\";\n const assetCount = assetIds.length;\n\n const normalizedResult = useMemo(() => normalizeResult(result), [result]);\n const resultItems = useMemo(\n () => getResultItems(normalizedResult),\n [normalizedResult],\n );\n\n const isRunning = status?.type === \"running\";\n const isComplete = status?.type === \"complete\";\n const isIncomplete = status?.type === \"incomplete\";\n\n const reviewedText = useMemo(\n () => getReviewedText(resultItems),\n [resultItems],\n );\n const resultText =\n typeof normalizedResult === \"string\" ? normalizedResult : reviewedText;\n const workbookData = isWorkbookFormat(normalizedResult)\n ? normalizedResult\n : null;\n const failedItems = resultItems.filter((item) => item.success === false);\n const allFailed =\n resultItems.length > 0 && failedItems.length === resultItems.length;\n const hasPartialIssues = failedItems.length > 0 && !allFailed;\n const resultError = getErrorText(resultItems);\n const hasError =\n isToolError ||\n isIncomplete ||\n allFailed ||\n (resultText != null && isErrorResult(resultText));\n\n const resultAssetIds = getResultAssetIds(resultItems);\n const resolvedAssetCount = Math.max(assetCount, new Set(resultAssetIds).size);\n const primaryAsset = getAssetInfo(firstAssetId || resultAssetIds[0] || \"\");\n // Prefer human titles over raw asset ids — an `asset_<uuid>` label reads as\n // garble to non-technical users. Multi-reads get a per-source checklist of\n // titles below the header; when the runtime offloaded the result (no titles\n // survive, only ids), fall back to a plain count rather than a uuid.\n const resultTitle = resultItems.find((item) => item.title)?.title;\n const isOpaqueId = (label: string) => /^asset_[0-9a-f-]{8,}/i.test(label);\n const primaryLabel =\n resultTitle ??\n (isOpaqueId(primaryAsset.name) ? \"1 document\" : primaryAsset.name);\n const sourceList =\n resolvedAssetCount > 1\n ? resultItems\n .filter((item) => typeof item.title === \"string\" && item.title !== \"\")\n .map((item, index) => ({\n key: item.asset_id ?? `${index}-${item.title}`,\n label: item.title as string,\n failed: item.success === false,\n }))\n : [];\n const assetLabel =\n resolvedAssetCount > 1\n ? `${resolvedAssetCount} documents`\n : primaryLabel;\n const statusTitle = isRunning\n ? \"Reviewing asset content\"\n : hasError\n ? \"Asset content review failed\"\n : hasPartialIssues\n ? \"Asset content reviewed with issues\"\n : \"Asset content review complete\";\n const badge = hasPartialIssues\n ? `${failedItems.length} ${failedItems.length === 1 ? \"issue\" : \"issues\"}`\n : resolvedAssetCount > 1\n ? `${resolvedAssetCount} sources`\n : workbookData\n ? \"Workbook review\"\n : \"Content review\";\n\n const hasContent =\n (isComplete || isIncomplete) && (resultText || workbookData);\n const errorMessage =\n status?.type === \"incomplete\"\n ? String(status.error ?? \"Content review failed\")\n : (resultError ?? (hasError && resultText ? resultText : null));\n\n return (\n <div className=\"my-1.5 w-full overflow-hidden rounded-xl border bg-background shadow-sm\">\n {/* Header */}\n <div className=\"flex items-center gap-3 px-4 py-3\">\n <div\n className={cn(\n \"flex size-9 shrink-0 items-center justify-center rounded-lg\",\n isRunning && \"bg-blue-50 text-blue-600\",\n isComplete && !hasError && \"bg-emerald-50 text-emerald-600\",\n isComplete && hasError && \"bg-red-50 text-red-500\",\n isIncomplete && \"bg-red-50 text-red-500\",\n !isRunning &&\n !isComplete &&\n !isIncomplete &&\n \"bg-muted text-muted-foreground\",\n )}\n >\n {isRunning ? (\n <LoaderIcon className=\"size-4 animate-spin\" />\n ) : hasError || isIncomplete ? (\n <AlertCircleIcon className=\"size-4\" />\n ) : (\n <BookOpenIcon className=\"size-4\" />\n )}\n </div>\n <div className=\"min-w-0 flex-1\">\n <div className=\"flex items-center gap-2\">\n <span className=\"text-[13px] font-semibold\">{statusTitle}</span>\n {isComplete && !hasError && (\n <CheckCircle2Icon className=\"size-3.5 text-emerald-500\" />\n )}\n <span className=\"rounded-full border border-border/60 bg-muted/50 px-2 py-0.5 text-[10px] font-medium uppercase tracking-wide text-muted-foreground\">\n {badge}\n </span>\n </div>\n <div className=\"flex items-center gap-1.5\">\n <FileTextIcon className=\"size-4\" />\n <span className=\"truncate text-[12px] text-muted-foreground\">\n Source: {assetLabel}\n </span>\n </div>\n </div>\n\n {/* Loading shimmer for streaming */}\n {isRunning && (\n <div className=\"flex items-center gap-1.5\">\n <div className=\"h-1.5 w-12 animate-pulse rounded-full bg-blue-100\" />\n <div className=\"h-1.5 w-8 animate-pulse rounded-full bg-blue-100\" />\n </div>\n )}\n </div>\n\n {/* Per-source checklist — actual titles with checkmarks (multi-read only;\n offloaded results carry no titles, so the header count stands alone) */}\n {sourceList.length > 1 && (\n <ul className=\"border-t px-4 py-2\">\n {sourceList.slice(0, 8).map((source) => (\n <li\n key={source.key}\n className=\"flex items-center gap-2 py-0.5 text-[12px] text-muted-foreground\"\n >\n {source.failed ? (\n <AlertCircleIcon className=\"size-3.5 shrink-0 text-red-400\" />\n ) : (\n <CheckCircle2Icon className=\"size-3.5 shrink-0 text-emerald-500\" />\n )}\n <span className=\"min-w-0 truncate\">{source.label}</span>\n </li>\n ))}\n {sourceList.length > 8 && (\n <li className=\"py-0.5 text-[11px] text-muted-foreground/70\">\n and {sourceList.length - 8} more\n </li>\n )}\n </ul>\n )}\n\n {/* Error message */}\n {hasError && errorMessage && (\n <div className=\"border-t bg-red-50/50 px-4 py-2.5\">\n <p className=\"text-[12px] leading-relaxed text-red-600\">\n {errorMessage}\n </p>\n </div>\n )}\n\n {/* Content preview (non-error) */}\n {hasContent && !hasError && (\n <div className=\"border-t\">\n <button\n type=\"button\"\n onClick={() => setExpanded(!expanded)}\n className=\"flex w-full items-center gap-2 px-4 py-2 text-left text-[11px] font-medium text-muted-foreground transition-colors hover:bg-muted/50\"\n >\n <ChevronDownIcon\n className={cn(\n \"size-3.5 shrink-0 transition-transform duration-200\",\n !expanded && \"-rotate-90\",\n )}\n />\n <span>\n {expanded ? \"Hide reviewed content\" : \"Show reviewed content\"}\n </span>\n </button>\n\n {expanded && (\n <div className=\"max-h-80 overflow-y-auto border-t bg-muted/30 px-4 py-3\">\n <div className=\"mb-2 text-[10px] font-semibold uppercase tracking-wide text-muted-foreground\">\n Reviewed content\n </div>\n {workbookData ? (\n <WorkbookPreview workbook={workbookData} />\n ) : resultText ? (\n <TextContentPreview text={resultText} />\n ) : null}\n </div>\n )}\n </div>\n )}\n </div>\n );\n};\n\nexport const ReadAssetToolUI = memo(\n ReadAssetToolUIImpl,\n) as unknown as ToolCallMessagePartComponent;\n\nReadAssetToolUI.displayName = \"ReadAssetToolUI\";\n"],"names":["tryParseJson","jsx","rangePreviewFromCellMap","RangePreviewTable","jsxs","useState","useMemo","getAssetInfo","cn","LoaderIcon","AlertCircleIcon","BookOpenIcon","CheckCircle2Icon","FileTextIcon","ChevronDownIcon","memo"],"mappings":";;;;;;;;;AAeA,SAAS,gBAAgB,QAA0B;AACjD,MAAI,OAAO,WAAW,SAAU,QAAOA,WAAAA,aAAa,MAAM,KAAK;AAC/D,MAAI,OAAO,WAAW,YAAY,WAAW,MAAM;AACjD,UAAM,MAAM;AACZ,QAAI,OAAO,IAAI,WAAW;AACxB,aAAOA,WAAAA,aAAa,IAAI,MAAM,KAAK,IAAI;AACzC,WAAO;AAAA,EACT;AACA,SAAO;AACT;AAEA,SAAS,cAAc,YAA6B;AAClD,SACE,WAAW,WAAW,qBAAqB,KAC3C,WAAW,WAAW,QAAQ;AAElC;AAWA,SAAS,sBAAsB,OAA8C;AAC3E,MAAI,CAAC,SAAS,OAAO,UAAU,SAAU,QAAO;AAChD,QAAM,OAAO;AACb,SACE,OAAO,KAAK,aAAa,YACzB,OAAO,KAAK,WAAW,YACvB,OAAO,KAAK,YAAY,YACxB,OAAO,KAAK,YAAY,aACxB,OAAO,KAAK,UAAU;AAE1B;AAEA,SAAS,eAAe,OAAuC;AAC7D,MAAI,MAAM,QAAQ,KAAK,EAAG,QAAO,MAAM,OAAO,qBAAqB;AACnE,MAAI,sBAAsB,KAAK,EAAG,QAAO,CAAC,KAAK;AAC/C,SAAO,CAAA;AACT;AAEA,SAAS,kBAAkB,OAAwC;AACjE,SAAO,MACJ,IAAI,CAAC,SAAA;;AAAS,sBAAK,aAAL,mBAAe,MAAM,KAAK;AAAA,GAAE,EAC1C,OAAO,CAAC,YAA+B,CAAC,CAAC,OAAO;AACrD;AAEA,SAAS,gBAAgB,OAA6C;AACpE,QAAM,YAAY,MACf;AAAA,I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AA;AAAA,UACC,MAAK;AAAA,UACL,SAAS,MAAM,YAAY,CAAC,QAAQ;AAAA,UACpC,WAAU;AAAA,UAEV,UAAA;AAAA,YAAAH,2BAAAA;AAAAA,cAACa,YAAAA;AAAAA,cAAA;AAAA,gBACC,WAAWN,OAAAA;AAAAA,kBACT;AAAA,kBACA,CAAC,YAAY;AAAA,gBAAA;AAAA,cACf;AAAA,YAAA;AAAA,YAEFP,2BAAAA,IAAC,QAAA,EACE,UAAA,WAAW,0BAA0B,wBAAA,CACxC;AAAA,UAAA;AAAA,QAAA;AAAA,MAAA;AAAA,MAGD,YACCG,2BAAAA,KAAC,OAAA,EAAI,WAAU,2DACb,UAAA;AAAA,QAAAH,2BAAAA,IAAC,OAAA,EAAI,WAAU,gFAA+E,UAAA,oBAE9F;AAAA,QACC,eACCA,2BAAAA,IAAC,iBAAA,EAAgB,UAAU,aAAA,CAAc,IACvC,aACFA,2BAAAA,IAAC,oBAAA,EAAmB,MAAM,WAAA,CAAY,IACpC;AAAA,MAAA,EAAA,CACN;AAAA,IAAA,EAAA,CAEJ;AAAA,EAAA,GAEJ;AAEJ;AAEO,MAAM,kBAAkBc,MAAAA;AAAAA,EAC7B;AACF;AAEA,gBAAgB,cAAc;;"}
1
+ {"version":3,"file":"read-asset-tool-ui.cjs","sources":["../../src/tools/read-asset-tool-ui.tsx"],"sourcesContent":["import { memo, useMemo, useState } from \"react\";\nimport type { ToolCallMessagePartComponent } from \"@assistant-ui/react\";\nimport {\n CheckCircle2Icon,\n ChevronDownIcon,\n FileTextIcon,\n LoaderIcon,\n AlertCircleIcon,\n BookOpenIcon,\n} from \"lucide-react\";\nimport { cn } from \"../lib/utils\";\nimport { rangePreviewFromCellMap } from \"../sheet-range/range-preview\";\nimport { RangePreviewTable } from \"../sheet-range/range-preview-table\";\nimport { getAssetInfo, tryParseJson } from \"./asset-utils\";\n\nfunction normalizeResult(result: unknown): unknown {\n if (typeof result === \"string\") return tryParseJson(result) ?? result;\n if (typeof result === \"object\" && result !== null) {\n const obj = result as Record<string, unknown>;\n if (typeof obj.result === \"string\")\n return tryParseJson(obj.result) ?? obj.result;\n return obj;\n }\n return result;\n}\n\nfunction isErrorResult(resultText: string): boolean {\n return (\n resultText.startsWith(\"Error reading asset\") ||\n resultText.startsWith(\"Error:\")\n );\n}\n\ninterface ReadAssetResultItem {\n asset_id?: string;\n format?: string;\n content?: string;\n success?: boolean;\n error?: string;\n title?: string;\n}\n\nfunction isReadAssetResultItem(value: unknown): value is ReadAssetResultItem {\n if (!value || typeof value !== \"object\") return false;\n const item = value as Record<string, unknown>;\n return (\n typeof item.asset_id === \"string\" ||\n typeof item.format === \"string\" ||\n typeof item.content === \"string\" ||\n typeof item.success === \"boolean\" ||\n typeof item.error === \"string\"\n );\n}\n\nfunction getResultItems(value: unknown): ReadAssetResultItem[] {\n if (Array.isArray(value)) return value.filter(isReadAssetResultItem);\n if (isReadAssetResultItem(value)) return [value];\n return [];\n}\n\nfunction getResultAssetIds(items: ReadAssetResultItem[]): string[] {\n return items\n .map((item) => item.asset_id?.split(\"?\")[0])\n .filter((assetId): assetId is string => !!assetId);\n}\n\nfunction getReviewedText(items: ReadAssetResultItem[]): string | null {\n const textParts = items\n .filter(\n (item) =>\n item.success !== false &&\n typeof item.content === \"string\" &&\n item.content,\n )\n .map((item) => item.content as string);\n return textParts.length > 0 ? textParts.join(\"\\n\\n---\\n\\n\") : null;\n}\n\nfunction getErrorText(items: ReadAssetResultItem[]): string | null {\n const firstError = items.find((item) => item.success === false && item.error);\n return firstError?.error ?? null;\n}\n\n// --- Workbook preview ---\n\ntype WorkbookCellValue =\n | string\n | number\n | boolean\n | null\n | [string, unknown]\n | [string, unknown, string];\n\ninterface WorkbookSheet {\n sheetName: string;\n dimension: string;\n cells: Record<string, WorkbookCellValue>;\n}\n\ninterface WorkbookFormat {\n workbook: {\n sheets: WorkbookSheet[];\n };\n}\n\nfunction isWorkbookFormat(value: unknown): value is WorkbookFormat {\n if (!value || typeof value !== \"object\") return false;\n const obj = value as Record<string, unknown>;\n if (!obj.workbook || typeof obj.workbook !== \"object\") return false;\n const workbook = obj.workbook as Record<string, unknown>;\n return Array.isArray(workbook.sheets);\n}\n\nfunction formatCellValue(value: WorkbookCellValue | undefined): string {\n if (value === null || value === undefined) return \"\";\n if (Array.isArray(value)) return String(value[0] ?? \"\");\n return String(value);\n}\n\n// A glance at each sheet, not the whole of it: the card's body is short.\nconst WORKBOOK_PREVIEW_MAX_ROWS = 12;\nconst WORKBOOK_PREVIEW_MAX_COLUMNS = 8;\n\nfunction WorkbookPreview({ workbook }: { workbook: WorkbookFormat }) {\n return (\n <div className=\"space-y-3\">\n {workbook.workbook.sheets.map((sheet) => {\n const preview = rangePreviewFromCellMap({\n range: sheet.dimension,\n cells: sheet.cells ?? {},\n formatCell: formatCellValue,\n maxRows: WORKBOOK_PREVIEW_MAX_ROWS,\n maxColumns: WORKBOOK_PREVIEW_MAX_COLUMNS,\n });\n if (!preview) return null;\n\n return (\n <div key={sheet.sheetName}>\n <p className=\"mb-1 text-xs font-semibold text-muted-foreground\">\n {sheet.sheetName}\n </p>\n <RangePreviewTable\n preview={preview}\n maxRows={WORKBOOK_PREVIEW_MAX_ROWS}\n maxColumns={WORKBOOK_PREVIEW_MAX_COLUMNS}\n caption={`${sheet.sheetName} ${sheet.dimension}`}\n />\n <p className=\"mt-1 text-[10px] text-muted-foreground\">\n Showing preview from {sheet.dimension}\n </p>\n </div>\n );\n })}\n </div>\n );\n}\n\nfunction TextContentPreview({ text }: { text: string }) {\n const lines = text.split(\"\\n\");\n const previewLines = lines.slice(0, 20);\n const hasMore = lines.length > 20;\n\n return (\n <pre className=\"whitespace-pre-wrap break-words text-[12px] leading-[1.6] text-muted-foreground\">\n {previewLines.join(\"\\n\")}\n {hasMore && (\n <span className=\"text-muted-foreground/70\">{`\\n... ${lines.length - 20} more lines`}</span>\n )}\n </pre>\n );\n}\n\n// --- Main component ---\n\nconst ReadAssetToolUIImpl: ToolCallMessagePartComponent = ({\n args,\n result,\n status,\n isError: isToolError,\n}) => {\n const [expanded, setExpanded] = useState(false);\n\n const typedArgs = args as Record<string, unknown> | undefined;\n const assetIds = (typedArgs?.asset_ids as string[]) ?? [];\n const firstAssetId = assetIds[0] ?? \"\";\n const assetCount = assetIds.length;\n\n const normalizedResult = useMemo(() => normalizeResult(result), [result]);\n const resultItems = useMemo(\n () => getResultItems(normalizedResult),\n [normalizedResult],\n );\n\n const isRunning = status?.type === \"running\";\n const isComplete = status?.type === \"complete\";\n const isIncomplete = status?.type === \"incomplete\";\n\n const reviewedText = useMemo(\n () => getReviewedText(resultItems),\n [resultItems],\n );\n const resultText =\n typeof normalizedResult === \"string\" ? normalizedResult : reviewedText;\n const workbookData = isWorkbookFormat(normalizedResult)\n ? normalizedResult\n : null;\n const failedItems = resultItems.filter((item) => item.success === false);\n const allFailed =\n resultItems.length > 0 && failedItems.length === resultItems.length;\n const hasPartialIssues = failedItems.length > 0 && !allFailed;\n const resultError = getErrorText(resultItems);\n const hasError =\n isToolError ||\n isIncomplete ||\n allFailed ||\n (resultText != null && isErrorResult(resultText));\n\n const resultAssetIds = getResultAssetIds(resultItems);\n const resolvedAssetCount = Math.max(assetCount, new Set(resultAssetIds).size);\n const primaryAsset = getAssetInfo(firstAssetId || resultAssetIds[0] || \"\");\n // Prefer human titles over raw asset ids — an `asset_<uuid>` label reads as\n // garble to non-technical users. Multi-reads get a per-source checklist of\n // titles below the header; when the runtime offloaded the result (no titles\n // survive, only ids), fall back to a plain count rather than a uuid.\n const resultTitle = resultItems.find((item) => item.title)?.title;\n const isOpaqueId = (label: string) => /^asset_[0-9a-f-]{8,}/i.test(label);\n const primaryLabel =\n resultTitle ??\n (isOpaqueId(primaryAsset.name) ? \"1 document\" : primaryAsset.name);\n const sourceList =\n resolvedAssetCount > 1\n ? resultItems\n .filter((item) => typeof item.title === \"string\" && item.title !== \"\")\n .map((item, index) => ({\n key: item.asset_id ?? `${index}-${item.title}`,\n label: item.title as string,\n failed: item.success === false,\n }))\n : [];\n const assetLabel =\n resolvedAssetCount > 1\n ? `${resolvedAssetCount} documents`\n : primaryLabel;\n const statusTitle = isRunning\n ? \"Reviewing asset content\"\n : hasError\n ? \"Asset content review failed\"\n : hasPartialIssues\n ? \"Asset content reviewed with issues\"\n : \"Asset content review complete\";\n const badge = hasPartialIssues\n ? `${failedItems.length} ${failedItems.length === 1 ? \"issue\" : \"issues\"}`\n : resolvedAssetCount > 1\n ? `${resolvedAssetCount} sources`\n : workbookData\n ? \"Workbook review\"\n : \"Content review\";\n\n const hasContent =\n (isComplete || isIncomplete) && (resultText || workbookData);\n const errorMessage =\n status?.type === \"incomplete\"\n ? String(status.error ?? \"Content review failed\")\n : (resultError ?? (hasError && resultText ? resultText : null));\n\n return (\n <div className=\"my-1.5 w-full overflow-hidden rounded-xl border bg-background shadow-sm\">\n {/* Header */}\n <div className=\"flex items-center gap-3 px-4 py-3\">\n <div\n className={cn(\n \"flex size-9 shrink-0 items-center justify-center rounded-lg\",\n isRunning && \"bg-blue-50 text-blue-600\",\n isComplete && !hasError && \"bg-emerald-50 text-emerald-600\",\n isComplete && hasError && \"bg-red-50 text-red-500\",\n isIncomplete && \"bg-red-50 text-red-500\",\n !isRunning &&\n !isComplete &&\n !isIncomplete &&\n \"bg-muted text-muted-foreground\",\n )}\n >\n {isRunning ? (\n <LoaderIcon className=\"size-4 animate-spin\" />\n ) : hasError || isIncomplete ? (\n <AlertCircleIcon className=\"size-4\" />\n ) : (\n <BookOpenIcon className=\"size-4\" />\n )}\n </div>\n <div className=\"min-w-0 flex-1\">\n <div className=\"flex items-center gap-2\">\n <span className=\"text-[13px] font-semibold\">{statusTitle}</span>\n {isComplete && !hasError && (\n <CheckCircle2Icon className=\"size-3.5 text-emerald-500\" />\n )}\n <span className=\"rounded-full border border-border/60 bg-muted/50 px-2 py-0.5 text-[10px] font-medium uppercase tracking-wide text-muted-foreground\">\n {badge}\n </span>\n </div>\n <div className=\"flex items-center gap-1.5\">\n <FileTextIcon className=\"size-4\" />\n <span className=\"truncate text-[12px] text-muted-foreground\">\n Source: {assetLabel}\n </span>\n </div>\n </div>\n\n {/* Loading shimmer for streaming */}\n {isRunning && (\n <div className=\"flex items-center gap-1.5\">\n <div className=\"h-1.5 w-12 animate-pulse rounded-full bg-blue-100\" />\n <div className=\"h-1.5 w-8 animate-pulse rounded-full bg-blue-100\" />\n </div>\n )}\n </div>\n\n {/* Per-source checklist — actual titles with checkmarks (multi-read only;\n offloaded results carry no titles, so the header count stands alone) */}\n {sourceList.length > 1 && (\n <ul className=\"border-t px-4 py-2\">\n {sourceList.slice(0, 8).map((source) => (\n <li\n key={source.key}\n className=\"flex items-center gap-2 py-0.5 text-[12px] text-muted-foreground\"\n >\n {source.failed ? (\n <AlertCircleIcon className=\"size-3.5 shrink-0 text-red-400\" />\n ) : (\n <CheckCircle2Icon className=\"size-3.5 shrink-0 text-emerald-500\" />\n )}\n <span className=\"min-w-0 truncate\">{source.label}</span>\n </li>\n ))}\n {sourceList.length > 8 && (\n <li className=\"py-0.5 text-[11px] text-muted-foreground/70\">\n and {sourceList.length - 8} more\n </li>\n )}\n </ul>\n )}\n\n {/* Error message */}\n {hasError && errorMessage && (\n <div className=\"border-t bg-red-50/50 px-4 py-2.5\">\n <p className=\"text-[12px] leading-relaxed text-red-600\">\n {errorMessage}\n </p>\n </div>\n )}\n\n {/* Content preview (non-error) */}\n {hasContent && !hasError && (\n <div className=\"border-t\">\n <button\n type=\"button\"\n onClick={() => setExpanded(!expanded)}\n className=\"flex w-full items-center gap-2 px-4 py-2 text-left text-[11px] font-medium text-muted-foreground transition-colors hover:bg-muted/50\"\n >\n <ChevronDownIcon\n className={cn(\n \"size-3.5 shrink-0 transition-transform duration-200\",\n !expanded && \"-rotate-90\",\n )}\n />\n <span>\n {expanded ? \"Hide reviewed content\" : \"Show reviewed content\"}\n </span>\n </button>\n\n {expanded && (\n <div className=\"max-h-80 overflow-y-auto border-t bg-muted/30 px-4 py-3\">\n <div className=\"mb-2 text-[10px] font-semibold uppercase tracking-wide text-muted-foreground\">\n Reviewed content\n </div>\n {workbookData ? (\n <WorkbookPreview workbook={workbookData} />\n ) : resultText ? (\n <TextContentPreview text={resultText} />\n ) : null}\n </div>\n )}\n </div>\n )}\n </div>\n );\n};\n\nexport const ReadAssetToolUI = memo(\n ReadAssetToolUIImpl,\n) as unknown as ToolCallMessagePartComponent;\n\nReadAssetToolUI.displayName = \"ReadAssetToolUI\";\n"],"names":["tryParseJson","jsx","rangePreviewFromCellMap","RangePreviewTable","jsxs","useState","useMemo","getAssetInfo","cn","LoaderIcon","AlertCircleIcon","BookOpenIcon","CheckCircle2Icon","FileTextIcon","ChevronDownIcon","memo"],"mappings":";;;;;;;;;AAeA,SAAS,gBAAgB,QAA0B;AACjD,MAAI,OAAO,WAAW,SAAU,QAAOA,WAAAA,aAAa,MAAM,KAAK;AAC/D,MAAI,OAAO,WAAW,YAAY,WAAW,MAAM;AACjD,UAAM,MAAM;AACZ,QAAI,OAAO,IAAI,WAAW;AACxB,aAAOA,WAAAA,aAAa,IAAI,MAAM,KAAK,IAAI;AACzC,WAAO;AAAA,EACT;AACA,SAAO;AACT;AAEA,SAAS,cAAc,YAA6B;AAClD,SACE,WAAW,WAAW,qBAAqB,KAC3C,WAAW,WAAW,QAAQ;AAElC;AAWA,SAAS,sBAAsB,OAA8C;AAC3E,MAAI,CAAC,SAAS,OAAO,UAAU,SAAU,QAAO;AAChD,QAAM,OAAO;AACb,SACE,OAAO,KAAK,aAAa,YACzB,OAAO,KAAK,WAAW,YACvB,OAAO,KAAK,YAAY,YACxB,OAAO,KAAK,YAAY,aACxB,OAAO,KAAK,UAAU;AAE1B;AAEA,SAAS,eAAe,OAAuC;AAC7D,MAAI,MAAM,QAAQ,KAAK,EAAG,QAAO,MAAM,OAAO,qBAAqB;AACnE,MAAI,sBAAsB,KAAK,EAAG,QAAO,CAAC,KAAK;AAC/C,SAAO,CAAA;AACT;AAEA,SAAS,kBAAkB,OAAwC;AACjE,SAAO,MACJ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AAA,2BAAAA,IAAC,KAAA,EAAE,WAAU,4CACV,UAAA,aAAA,CACH,GACF;AAAA,IAID,cAAc,CAAC,YACdG,2BAAAA,KAAC,OAAA,EAAI,WAAU,YACb,UAAA;AAAA,MAAAA,2BAAAA;AAAAA,QAAC;AAAA,QAAA;AAAA,UACC,MAAK;AAAA,UACL,SAAS,MAAM,YAAY,CAAC,QAAQ;AAAA,UACpC,WAAU;AAAA,UAEV,UAAA;AAAA,YAAAH,2BAAAA;AAAAA,cAACa,YAAAA;AAAAA,cAAA;AAAA,gBACC,WAAWN,OAAAA;AAAAA,kBACT;AAAA,kBACA,CAAC,YAAY;AAAA,gBAAA;AAAA,cACf;AAAA,YAAA;AAAA,YAEFP,2BAAAA,IAAC,QAAA,EACE,UAAA,WAAW,0BAA0B,wBAAA,CACxC;AAAA,UAAA;AAAA,QAAA;AAAA,MAAA;AAAA,MAGD,YACCG,2BAAAA,KAAC,OAAA,EAAI,WAAU,2DACb,UAAA;AAAA,QAAAH,2BAAAA,IAAC,OAAA,EAAI,WAAU,gFAA+E,UAAA,oBAE9F;AAAA,QACC,eACCA,2BAAAA,IAAC,iBAAA,EAAgB,UAAU,aAAA,CAAc,IACvC,aACFA,2BAAAA,IAAC,oBAAA,EAAmB,MAAM,WAAA,CAAY,IACpC;AAAA,MAAA,EAAA,CACN;AAAA,IAAA,EAAA,CAEJ;AAAA,EAAA,GAEJ;AAEJ;AAEO,MAAM,kBAAkBc,WAAAA;AAAAA,EAC7B;AACF;AAEA,gBAAgB,cAAc;;"}
@@ -1,10 +1,10 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
3
  const jsxRuntime = require("react/jsx-runtime");
4
- const react$1 = require("@assistant-ui/react");
4
+ const react = require("@assistant-ui/react");
5
5
  const reactQuery = require("@tanstack/react-query");
6
6
  const lucideReact = require("lucide-react");
7
- const react = require("react");
7
+ const require$$0 = require("react");
8
8
  const useStatewireApprovalRequest = require("../chat/use-statewire-approval-request.cjs");
9
9
  const messageTime = require("../chat/message-time.cjs");
10
10
  const turnTiming = require("../chat/super-grouping/turn-timing.cjs");
@@ -129,7 +129,7 @@ function laneStepsNote({
129
129
  return arrivesLater ? `Showing the latest steps. ${leftOff} earlier ${leftOff === 1 ? "step arrives" : "steps arrive"} when this subagent finishes.` : `Showing the latest ${shown} of ${stepsLabel(total)}.`;
130
130
  }
131
131
  function useInReadOnlyThread() {
132
- return react$1.useAuiState((s) => {
132
+ return react.useAuiState((s) => {
133
133
  var _a;
134
134
  const thread = (_a = s.optional) == null ? void 0 : _a.thread;
135
135
  return thread !== void 0 && !threadExtras.hasStatewireThreadExtras(thread.extras);
@@ -162,8 +162,8 @@ function LaneStatusGlyph({ phase }) {
162
162
  );
163
163
  }
164
164
  function useRunningElapsedMs(running, startMs) {
165
- const [clock, setClock] = react.useState(null);
166
- react.useEffect(() => {
165
+ const [clock, setClock] = require$$0.useState(null);
166
+ require$$0.useEffect(() => {
167
167
  if (!running) {
168
168
  setClock(null);
169
169
  return void 0;
@@ -176,27 +176,27 @@ function useRunningElapsedMs(running, startMs) {
176
176
  if (!running || clock === null) return null;
177
177
  return Math.max(0, clock.now - (startMs ?? clock.seenAt));
178
178
  }
179
- const LaneStepComponentsContext = react.createContext(null);
179
+ const LaneStepComponentsContext = require$$0.createContext(null);
180
180
  const EmptyStepPart = () => null;
181
181
  const LaneStep = () => {
182
- const role = react$1.useAuiState((s) => s.message.role);
183
- const components = react.useContext(LaneStepComponentsContext);
182
+ const role = react.useAuiState((s) => s.message.role);
183
+ const components = require$$0.useContext(LaneStepComponentsContext);
184
184
  if (role !== "assistant") return null;
185
- return /* @__PURE__ */ jsxRuntime.jsx(react$1.MessagePrimitive.Parts, { components: { Empty: EmptyStepPart, ...components } });
185
+ return /* @__PURE__ */ jsxRuntime.jsx(react.MessagePrimitive.Parts, { components: { Empty: EmptyStepPart, ...components } });
186
186
  };
187
187
  const LANE_ROW_COMPONENTS = { Message: LaneStep };
188
188
  const ROW_KEY_SEPARATOR = "\0";
189
189
  function LaneRows() {
190
- const joinedKeys = react$1.useAuiState(
190
+ const joinedKeys = react.useAuiState(
191
191
  (s) => s.thread.messages.map((message) => messages.deepAgentRowKey(message)).join(ROW_KEY_SEPARATOR)
192
192
  );
193
- const rowKeys = react.useMemo(
193
+ const rowKeys = require$$0.useMemo(
194
194
  () => joinedKeys === "" ? [] : joinedKeys.split(ROW_KEY_SEPARATOR),
195
195
  [joinedKeys]
196
196
  );
197
- return /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children: rowKeys.map((key, index) => /* @__PURE__ */ jsxRuntime.jsx(react$1.ThreadPrimitive.MessageByIndex, { index, components: LANE_ROW_COMPONENTS }, key)) });
197
+ return /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children: rowKeys.map((key, index) => /* @__PURE__ */ jsxRuntime.jsx(react.ThreadPrimitive.MessageByIndex, { index, components: LANE_ROW_COMPONENTS }, key)) });
198
198
  }
199
- class LaneStepsBoundary extends react.Component {
199
+ class LaneStepsBoundary extends require$$0.Component {
200
200
  constructor(props) {
201
201
  super(props);
202
202
  this.state = { failed: false };
@@ -243,7 +243,7 @@ function LaneSteps({ lane, phase, result, partMessages }) {
243
243
  total: (_a = source == null ? void 0 : source.truncated) == null ? void 0 : _a.messages,
244
244
  finished: ((_b = source == null ? void 0 : source.truncated) == null ? void 0 : _b.finished) === true
245
245
  });
246
- const [convertLane] = react.useState(() => subagentTranscripts.createSubagentLaneConversion());
246
+ const [convertLane] = require$$0.useState(() => subagentTranscripts.createSubagentLaneConversion());
247
247
  const report = lane.status === "complete" && (source == null ? void 0 : source.messageId) !== void 0 ? lane.output : void 0;
248
248
  const messages2 = (source === void 0 ? void 0 : convertLane(subagentTranscripts.withLaneReport(history.steps, report), running)) ?? partMessages ?? NO_MESSAGES;
249
249
  const components = NestedPtcMessages.useNestedPtcComponents(toolFallback.ToolFallback);
@@ -282,7 +282,7 @@ function LaneSteps({ lane, phase, result, partMessages }) {
282
282
  ]
283
283
  }
284
284
  ) : null,
285
- messages2.length > 0 ? /* @__PURE__ */ jsxRuntime.jsx(LaneStepsBoundary, { name: lane.name, children: /* @__PURE__ */ jsxRuntime.jsx(LaneStepComponentsContext.Provider, { value: components, children: /* @__PURE__ */ jsxRuntime.jsx(react$1.ReadonlyThreadProvider, { messages: messages2, children: /* @__PURE__ */ jsxRuntime.jsx("div", { "data-slot": "subagent-step-rows", className: "flex min-w-0 flex-col gap-1", children: /* @__PURE__ */ jsxRuntime.jsx(LaneRows, {}) }) }) }) }) : /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-xs text-muted-foreground", children: emptyText }),
285
+ messages2.length > 0 ? /* @__PURE__ */ jsxRuntime.jsx(LaneStepsBoundary, { name: lane.name, children: /* @__PURE__ */ jsxRuntime.jsx(LaneStepComponentsContext.Provider, { value: components, children: /* @__PURE__ */ jsxRuntime.jsx(react.ReadonlyThreadProvider, { messages: messages2, children: /* @__PURE__ */ jsxRuntime.jsx("div", { "data-slot": "subagent-step-rows", className: "flex min-w-0 flex-col gap-1", children: /* @__PURE__ */ jsxRuntime.jsx(LaneRows, {}) }) }) }) }) : /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-xs text-muted-foreground", children: emptyText }),
286
286
  closing ? /* @__PURE__ */ jsxRuntime.jsxs("div", { "data-slot": "subagent-result", className: "flex min-w-0 flex-col gap-0.5", children: [
287
287
  /* @__PURE__ */ jsxRuntime.jsx(
288
288
  "p",
@@ -325,8 +325,8 @@ function laneMeta({
325
325
  function SubagentTaskCard({ toolCallId, args, status, artifact, messages: messages2 }) {
326
326
  const appearance = toolAppearance.useToolAppearance();
327
327
  const isThread = appearance === "thread";
328
- const readLane = react$1.useAuiState((s) => subagents.taskSubagentsOfTurn(s.message).get(toolCallId));
329
- const lane = react.useMemo(
328
+ const readLane = react.useAuiState((s) => subagents.taskSubagentsOfTurn(s.message).get(toolCallId));
329
+ const lane = require$$0.useMemo(
330
330
  () => readLane ?? laneFromArgs(toolCallId, args),
331
331
  [readLane, toolCallId, args]
332
332
  );
@@ -335,12 +335,12 @@ function SubagentTaskCard({ toolCallId, args, status, artifact, messages: messag
335
335
  const gatedCall = awaitingApproval ? subagents.subagentToolCallAwaitingApproval({ lane, toolCallIds: waitingToolCallIds }) : void 0;
336
336
  const phase = subagentLanePhase({ status: lane.status, partStatus: status, awaitingApproval });
337
337
  const running = phase === "running";
338
- const delegatedAt = react$1.useAuiState(
339
- (s) => running ? laneDelegatedAtMs({ sources: react$1.getExternalStoreMessages(s.message), toolCallId }) : null
338
+ const delegatedAt = react.useAuiState(
339
+ (s) => running ? laneDelegatedAtMs({ sources: react.getExternalStoreMessages(s.message), toolCallId }) : null
340
340
  );
341
341
  const runningElapsed = useRunningElapsedMs(running, delegatedAt);
342
342
  const elapsedMs = running ? runningElapsed : isSettledSubagentLanePhase(phase) ? finishedLaneDurationMs(artifact) : null;
343
- const step = react.useMemo(() => running ? latestLaneStep(lane.messages) : null, [running, lane.messages]);
343
+ const step = require$$0.useMemo(() => running ? latestLaneStep(lane.messages) : null, [running, lane.messages]);
344
344
  const hasSteps = lane.messageCount > 0 || (lane.omittedMessageCount ?? 0) > 0;
345
345
  const typeLabel = subagentTypeLabel(lane.name);
346
346
  const title = lane.description.trim() || typeLabel;
@@ -476,7 +476,7 @@ function SubagentDelegationRow({ args, result, isError, status }) {
476
476
  );
477
477
  }
478
478
  const SubagentTaskToolUIImpl = (props) => useInReadOnlyThread() ? /* @__PURE__ */ jsxRuntime.jsx(SubagentDelegationRow, { ...props }) : /* @__PURE__ */ jsxRuntime.jsx(SubagentTaskCard, { ...props });
479
- const SubagentTaskToolUI = react.memo(
479
+ const SubagentTaskToolUI = require$$0.memo(
480
480
  SubagentTaskToolUIImpl
481
481
  );
482
482
  SubagentTaskToolUI.displayName = "SubagentTaskToolUI";
@@ -1 +1 @@
1
- {"version":3,"file":"subagent-task-tool-ui.cjs","sources":["../../src/tools/subagent-task-tool-ui.tsx"],"sourcesContent":["\"use client\";\n\n/**\n * The subagent card: one `task` call the deep agent delegated, shown the way\n * Olympus shows a subagent lane.\n *\n * - On the card: where the lane is (queued, running, done, failed, stopped),\n * how many tool calls it made (the wire's cut marker counts a lane whose\n * card carries only its newest steps), how long it has run, and while it\n * runs, its newest step; a finished lane's report, or why it failed, under\n * it, clamped.\n * - Behind its disclosure: the lane's steps, live while it runs, ending on\n * what the lane ended on, whole (a failure, or a report no step carries),\n * so a lane with no steps still opens to its full result. The lane is\n * assistant-ui's native nested thread: the `task` part's `messages`, which\n * the SDK runtime's opt-in conversion fills\n * (`createSubagentTranscriptConversionCache`), rendered read-only under\n * `ReadonlyThreadProvider` with the chat's own tool UIs. A cut lane (a\n * running card always; a finished one when the provider declares the\n * lane-cut contract, `subagentLaneHistory`) says how many of its steps it\n * shows, and \"Load earlier steps\" reads the rest with `history/lane`\n * (`useDeepAgentLaneHistory`), a read under the thread's own attach.\n *\n * A read-only nested thread has no statewire thread behind it: a `task` call\n * inside a subagent's own steps renders as a static row, and the steps are\n * their own error boundary, so a tool UI that throws there never takes the\n * chat down with it.\n */\nimport {\n getExternalStoreMessages,\n MessagePrimitive,\n ReadonlyThreadProvider,\n type ThreadMessage,\n ThreadPrimitive,\n type ToolCallMessagePartComponent,\n type ToolCallMessagePartProps,\n type ToolCallMessagePartStatus,\n useAuiState,\n} from \"@assistant-ui/react\";\nimport type { LangChainMessage } from \"@assistant-ui/react-langgraph\";\nimport {\n createSubagentLaneConversion,\n deepAgentRowKey,\n hasStatewireThreadExtras,\n salientToolCallDetail,\n type SubagentDiscoverySnapshot,\n type SubagentStatus,\n subagentAwaitingApproval,\n subagentToolCallAwaitingApproval,\n taskSubagentsOfTurn,\n useDeepAgentLaneHistory,\n withLaneReport,\n} from \"@athenaintel/agent-runtime\";\nimport { QueryClientProvider } from \"@tanstack/react-query\";\nimport {\n AlertCircleIcon,\n BotIcon,\n CheckIcon,\n ChevronDownIcon,\n CircleDashedIcon,\n LoaderIcon,\n ShieldAlertIcon,\n XCircleIcon,\n} from \"lucide-react\";\nimport {\n Component,\n createContext,\n type ErrorInfo,\n type FC,\n memo,\n type ReactNode,\n useContext,\n useEffect,\n useMemo,\n useState,\n} from \"react\";\nimport { useApprovalWaitInScope } from \"../chat/use-statewire-approval-request\";\nimport { MESSAGE_CREATED_AT_KEY } from \"../chat/message-time\";\nimport { formatWorkDuration, readInstantMs } from \"../chat/super-grouping/turn-timing\";\nimport { athenaDiagnostics } from \"../diagnostics/athena-diagnostics\";\nimport { useAthenaQueryClient } from \"../lib/use-athena-rest-query\";\nimport { cn } from \"../lib/utils\";\nimport { CollapsibleTrigger } from \"../ui/collapsible\";\nimport { useNestedPtcComponents } from \"./NestedPtcMessages\";\nimport { StepText } from \"./step-text\";\nimport { useToolAppearance } from \"./tool-appearance\";\nimport { ToolFallback, ToolFallbackContent, ToolFallbackRoot } from \"./tool-fallback\";\nimport { humanizeToolName, summarizeToolCall, type ToolCallSummary } from \"./tool-summary\";\n\nconst NO_LANE_STEPS: readonly LangChainMessage[] = [];\nconst NO_MESSAGES: readonly ThreadMessage[] = [];\n\n// ─── What the card says ──────────────────────────────────────────────\n// Pure: where a lane is, how long it ran, the step it took last, and the\n// note over a cut lane's steps, tested without rendering the card.\n\n/**\n * Where a lane is, as the card shows it: the lane's own status, except that a\n * lane parked on a person's approval is `approval` (its own dispatch, or a call\n * it made, is a gated call nobody has answered), any other call the run waits\n * on an answer for is `waiting`, and one the run stopped before it settled is\n * `stopped`.\n */\nexport type SubagentLanePhase =\n | \"queued\"\n | \"approval\"\n | \"waiting\"\n | \"running\"\n | \"complete\"\n | \"error\"\n | \"stopped\";\n\nexport const SUBAGENT_LANE_PHASE_LABELS: Record<SubagentLanePhase, string> = {\n queued: \"Queued\",\n approval: \"Waiting for approval\",\n waiting: \"Waiting for you\",\n running: \"Running\",\n complete: \"Done\",\n error: \"Failed\",\n stopped: \"Stopped\",\n};\n\n/** The lane's phase from its status, the status assistant-ui gives its part, and the run's approval. */\nexport function subagentLanePhase({\n status,\n partStatus,\n awaitingApproval = false,\n}: {\n status: SubagentStatus;\n partStatus: ToolCallMessagePartStatus | undefined;\n /** The lane waits on a person's approval (agent-runtime's `subagentAwaitingApproval`). */\n awaitingApproval?: boolean;\n}): SubagentLanePhase {\n if (status === \"complete\" || status === \"error\") return status;\n if (awaitingApproval) return \"approval\";\n if (partStatus?.type === \"requires-action\") return \"waiting\";\n if (partStatus?.type === \"incomplete\") {\n return partStatus.reason === \"cancelled\" ? \"stopped\" : \"error\";\n }\n return status;\n}\n\n/** The phases a lane never leaves. */\nexport function isSettledSubagentLanePhase(phase: SubagentLanePhase): boolean {\n return phase === \"complete\" || phase === \"error\" || phase === \"stopped\";\n}\n\n/**\n * What a settled lane ended on, whole: its report, or why it failed. A lane\n * that the run's own failure ended has no result of its own, so the `task`\n * part's status says why (as the generic card shows a failed call). Empty\n * while the lane runs.\n */\nexport function subagentLaneResult({\n output,\n phase,\n partStatus,\n}: {\n /** The lane's own result text (`SubagentDiscoverySnapshot.output`). */\n output: string | undefined;\n phase: SubagentLanePhase;\n partStatus: ToolCallMessagePartStatus | undefined;\n}): string {\n if (!isSettledSubagentLanePhase(phase)) return \"\";\n const own = output?.trim() ?? \"\";\n if (own !== \"\" || phase !== \"error\" || partStatus?.type !== \"incomplete\") return own;\n const { error } = partStatus;\n if (error === undefined || error === null) return \"\";\n return (typeof error === \"string\" ? error : JSON.stringify(error)).trim();\n}\n\nfunction record(value: unknown): Record<string, unknown> | undefined {\n return value && typeof value === \"object\" && !Array.isArray(value)\n ? (value as Record<string, unknown>)\n : undefined;\n}\n\n/**\n * How long a finished lane ran, measured by the server: the `task` result's\n * `_started_at` and `_created_at`, which the deep agent's tool-call timing\n * stamps on every tool result and mirrors onto its artifact (the one field of\n * a tool message the converter hands the tool-call part). `null` when either\n * stamp is missing.\n */\nexport function finishedLaneDurationMs(artifact: unknown): number | null {\n const stamps = record(artifact);\n const startedAt = readInstantMs(stamps?._started_at);\n const finishedAt = readInstantMs(stamps?.[MESSAGE_CREATED_AT_KEY]);\n return startedAt !== null && finishedAt !== null && finishedAt >= startedAt\n ? finishedAt - startedAt\n : null;\n}\n\nconst ASSISTANT_TYPES: ReadonlySet<unknown> = new Set([\"ai\", \"AIMessageChunk\"]);\n\n/**\n * When the agent delegated the call `toolCallId`: the server stamp\n * (`_created_at`) of the assistant message that made it, among the raw\n * messages bound to the turn. A running lane's card carries no stamp of its\n * own, so its clock counts from here, the way the turn header counts from the\n * turn's own stamps. `null` without one.\n */\nexport function laneDelegatedAtMs({\n sources,\n toolCallId,\n}: {\n sources: readonly unknown[];\n toolCallId: string;\n}): number | null {\n for (const source of sources) {\n const message = record(source);\n if (!message || !ASSISTANT_TYPES.has(message.type)) continue;\n const calls = message.tool_calls;\n if (!Array.isArray(calls) || !calls.some((call) => record(call)?.id === toolCallId)) continue;\n const kwargs = record(message.additional_kwargs);\n const metadata = record(kwargs?.metadata);\n return (\n readInstantMs(metadata?.[MESSAGE_CREATED_AT_KEY]) ??\n readInstantMs(kwargs?.[MESSAGE_CREATED_AT_KEY]) ??\n readInstantMs(message[MESSAGE_CREATED_AT_KEY])\n );\n }\n return null;\n}\n\n/**\n * The lane's newest tool step as its summary line (\"Read `routes.ts`\",\n * \"Running `npm test`\"), from the lane's converted steps: the last tool call\n * of its newest assistant turn, worded for whether it has answered. `null`\n * before the lane's first tool call.\n */\nexport function latestLaneStep(messages: readonly ThreadMessage[]): ToolCallSummary | null {\n for (let index = messages.length - 1; index >= 0; index -= 1) {\n const message = messages[index];\n if (message?.role !== \"assistant\") continue;\n for (let partIndex = message.content.length - 1; partIndex >= 0; partIndex -= 1) {\n const part = message.content[partIndex];\n if (part?.type !== \"tool-call\") continue;\n const answered = part.result !== undefined && part.isPreliminary !== true;\n return summarizeToolCall({\n toolName: part.toolName,\n args: part.args,\n result: answered ? part.result : undefined,\n status: answered ? (part.isError === true ? \"error\" : \"complete\") : \"running\",\n });\n }\n }\n return null;\n}\n\n/**\n * The subagent's type as the card names it: the `task` call's `subagent_type`\n * in words, with the default `general-purpose` agent as \"Subagent\".\n */\nexport function subagentTypeLabel(name: string): string {\n const trimmed = name.trim();\n if (trimmed === \"\" || trimmed === \"subagent\" || trimmed === \"general-purpose\") return \"Subagent\";\n return humanizeToolName(trimmed);\n}\n\n/** \"1 tool call\", \"12 tool calls\". */\nexport function toolCallCountLabel(count: number): string {\n return `${count} tool call${count === 1 ? \"\" : \"s\"}`;\n}\n\n/** \"1 step\", \"12 steps\". */\nfunction stepsLabel(count: number): string {\n return `${count} step${count === 1 ? \"\" : \"s\"}`;\n}\n\n/** What the steps panel says about the steps it shows of a cut lane. */\nexport function laneStepsNote({\n shown,\n total,\n arrivesLater,\n}: {\n /** Steps the panel shows. */\n shown: number;\n /** Steps the lane stores (its cut marker), when the card carries fewer. */\n total: number | undefined;\n /**\n * A running lane on a host that pages no running lane: its card brings the\n * rest once the subagent finishes.\n */\n arrivesLater: boolean;\n}): string | null {\n if (total === undefined || total <= shown) return null;\n const leftOff = total - shown;\n return arrivesLater\n ? `Showing the latest steps. ${leftOff} earlier ${leftOff === 1 ? \"step arrives\" : \"steps arrive\"} when this subagent finishes.`\n : `Showing the latest ${shown} of ${stepsLabel(total)}.`;\n}\n\n/**\n * Whether this card renders inside a read-only nested thread (a subagent's own\n * steps, under `ReadonlyThreadProvider`), whose thread has no statewire\n * extras. Never throws: rendered outside any thread, it is not nested.\n */\nfunction useInReadOnlyThread(): boolean {\n return useAuiState((s) => {\n const thread = s.optional?.thread;\n return thread !== undefined && !hasStatewireThreadExtras(thread.extras);\n });\n}\n\n/** A lane for a call agent-runtime read no lane for: what its arguments say, queued. */\nfunction laneFromArgs(toolCallId: string, args: unknown): SubagentDiscoverySnapshot {\n const record = typeof args === \"object\" && args !== null ? (args as Record<string, unknown>) : {};\n return {\n id: toolCallId,\n name: typeof record.subagent_type === \"string\" ? record.subagent_type : \"subagent\",\n description: typeof record.description === \"string\" ? record.description : \"\",\n status: \"queued\",\n toolCallCount: 0,\n messages: NO_MESSAGES,\n messageCount: 0,\n currentText: \"\",\n };\n}\n\n// ─── Status glyph ────────────────────────────────────────────────────\n\nfunction LaneStatusGlyph({ phase }: { phase: SubagentLanePhase }) {\n const glyph =\n phase === \"running\" ? (\n <LoaderIcon className=\"size-3.5 animate-spin text-muted-foreground motion-reduce:animate-none\" />\n ) : phase === \"complete\" ? (\n <CheckIcon className=\"size-3.5 text-emerald-600\" />\n ) : phase === \"error\" ? (\n <AlertCircleIcon className=\"size-3.5 text-destructive\" />\n ) : phase === \"stopped\" ? (\n <XCircleIcon className=\"size-3.5 text-muted-foreground\" />\n ) : phase === \"waiting\" || phase === \"approval\" ? (\n <ShieldAlertIcon className=\"size-3.5 text-amber-600\" />\n ) : (\n <CircleDashedIcon className=\"size-3.5 text-muted-foreground motion-safe:animate-pulse\" />\n );\n return (\n <span\n data-slot=\"subagent-status\"\n data-phase={phase}\n aria-hidden=\"true\"\n className=\"mt-0.5 flex size-4 shrink-0 items-center justify-center\"\n >\n {glyph}\n </span>\n );\n}\n\n// ─── Clock ───────────────────────────────────────────────────────────\n\n/**\n * How long a running lane has run: since `startMs` (the server's stamp on the\n * delegating message), else since this card saw it running; `null` while it\n * does not run. Ticks once a second off the wall clock.\n */\nfunction useRunningElapsedMs(running: boolean, startMs: number | null): number | null {\n const [clock, setClock] = useState<{ seenAt: number; now: number } | null>(null);\n useEffect(() => {\n if (!running) {\n setClock(null);\n return undefined;\n }\n const seenAt = Date.now();\n setClock({ seenAt, now: seenAt });\n const timer = setInterval(() => setClock({ seenAt, now: Date.now() }), 1000);\n return () => clearInterval(timer);\n }, [running]);\n if (!running || clock === null) return null;\n return Math.max(0, clock.now - (startMs ?? clock.seenAt));\n}\n\n// ─── The lane's steps ────────────────────────────────────────────────\n\ntype NestedPartsComponents = ReturnType<typeof useNestedPtcComponents>;\n\nconst LaneStepComponentsContext = createContext<NestedPartsComponents | null>(null);\n\nconst EmptyStepPart: FC = () => null;\n\n/**\n * One row of the lane: an assistant turn's parts, through the chat's own\n * renderers (`NestedPtcComponentsProvider`, which `AthenaChat` mounts). The\n * subagent's brief (its user message) is the card's own description, so it is\n * not repeated.\n */\nconst LaneStep: FC = () => {\n const role = useAuiState((s) => s.message.role);\n const components = useContext(LaneStepComponentsContext);\n if (role !== \"assistant\") return null;\n return <MessagePrimitive.Parts components={{ Empty: EmptyStepPart, ...components }} />;\n};\n\nconst LANE_ROW_COMPONENTS = { Message: LaneStep };\n\nconst ROW_KEY_SEPARATOR = \"\\u0000\";\n\n/**\n * The nested thread's rows, each under its row key (`deepAgentRowKey`): the\n * lane's turn keeps its row while the card's cut drops its oldest steps and\n * when earlier pages land, so what the person opened in it stays open.\n */\nfunction LaneRows() {\n const joinedKeys = useAuiState((s) =>\n s.thread.messages.map((message) => deepAgentRowKey(message)).join(ROW_KEY_SEPARATOR),\n );\n const rowKeys = useMemo(\n () => (joinedKeys === \"\" ? [] : joinedKeys.split(ROW_KEY_SEPARATOR)),\n [joinedKeys],\n );\n return (\n <>\n {rowKeys.map((key, index) => (\n <ThreadPrimitive.MessageByIndex key={key} index={index} components={LANE_ROW_COMPONENTS} />\n ))}\n </>\n );\n}\n\ninterface LaneStepsBoundaryProps {\n name: string;\n children: ReactNode;\n}\n\n/**\n * The steps' own boundary: they render the chat's tool UIs (a host's own\n * among them) in a nested thread no statewire thread backs, and a card that\n * throws there must not take the chat down. Reported like a chat render\n * crash, with the lane named.\n */\nclass LaneStepsBoundary extends Component<LaneStepsBoundaryProps, { failed: boolean }> {\n constructor(props: LaneStepsBoundaryProps) {\n super(props);\n this.state = { failed: false };\n }\n\n static getDerivedStateFromError(): { failed: boolean } {\n return { failed: true };\n }\n\n componentDidCatch(error: Error, errorInfo: ErrorInfo): void {\n athenaDiagnostics.error(\n \"sdk.error\",\n error,\n {\n code: \"chat_render_crash\",\n message: \"A subagent's steps could not be shown\",\n hint: \"Inspect component_stack: a tool UI that reads the live thread fails inside a subagent's read-only steps.\",\n },\n {\n surface: \"subagent-lane\",\n subagent: this.props.name,\n component_stack: errorInfo.componentStack?.slice(0, 2000) ?? null,\n },\n );\n }\n\n render(): ReactNode {\n if (this.state.failed) {\n return (\n <p role=\"alert\" className=\"px-1 text-xs text-muted-foreground\">\n These steps couldn't be shown. The conversation is not affected.\n </p>\n );\n }\n return this.props.children;\n }\n}\n\n/** The host's `QueryClient` when one is in context, else one of the panel's own (`useAthenaQueryClient`). */\nfunction LaneQueryScope({ children }: { children: ReactNode }) {\n const queryClient = useAthenaQueryClient();\n return <QueryClientProvider client={queryClient}>{children}</QueryClientProvider>;\n}\n\ninterface LaneStepsProps {\n lane: SubagentDiscoverySnapshot;\n phase: SubagentLanePhase;\n /** What the lane ended on, whole (`subagentLaneResult`); empty while it runs. */\n result: string;\n /** The `task` part's own nested thread, shown if the panel cannot convert the lane itself. */\n partMessages: readonly ThreadMessage[] | undefined;\n}\n\n/**\n * The open card's steps: the lane the card carries, and the earlier steps the\n * person asks for. The panel converts the lane itself, with one conversion\n * memory while it is open (`createSubagentLaneConversion`), so the lane's turn\n * keeps its row key as the cut slides and pages land. It ends on what the lane\n * ended on, whole and selectable: the card clamps it.\n */\nfunction LaneSteps({ lane, phase, result, partMessages }: LaneStepsProps) {\n // The lane's card is its running placeholder, whether it streams or waits on an approval.\n const running = lane.status === \"running\" && (phase === \"running\" || phase === \"approval\");\n const source = lane.source;\n const history = useDeepAgentLaneHistory({\n messageId: source?.messageId,\n lane: source?.lane,\n carried: source?.transcript ?? NO_LANE_STEPS,\n total: source?.truncated?.messages,\n finished: source?.truncated?.finished === true,\n });\n const [convertLane] = useState(() => createSubagentLaneConversion());\n // A `task` lane that finished ends on its report, the card's content, even\n // when its stored transcript does not (`withLaneReport`), as in Olympus's drawer.\n const report =\n lane.status === \"complete\" && source?.messageId !== undefined ? lane.output : undefined;\n const messages =\n (source === undefined\n ? undefined\n : convertLane(withLaneReport(history.steps, report), running)) ??\n partMessages ??\n NO_MESSAGES;\n const components = useNestedPtcComponents(ToolFallback);\n const shown = history.steps.length;\n // A running card on a host that pages no running lane carries the rest once it finishes.\n const arrivesLater = running && source?.messageId !== undefined && !history.available;\n const note = laneStepsNote({ shown, total: history.total, arrivesLater });\n const emptyText =\n phase === \"running\"\n ? \"Starting…\"\n : phase === \"queued\" || phase === \"waiting\" || phase === \"approval\"\n ? \"Not started yet.\"\n : \"No steps were recorded for this subagent.\";\n // Why a lane failed is never one of its steps; a report is the closing\n // step of a lane with steps to close (`withLaneReport`).\n const failed = phase === \"error\";\n const closing = failed || messages.length === 0 ? result : \"\";\n\n return (\n <div data-slot=\"subagent-steps\" className=\"flex min-w-0 flex-col gap-2 px-2.5\">\n {lane.description ? (\n <p\n data-slot=\"subagent-brief\"\n className=\"whitespace-pre-wrap break-words text-xs leading-relaxed text-muted-foreground\"\n >\n {lane.description}\n </p>\n ) : null}\n {note ? (\n <div\n data-slot=\"subagent-steps-note\"\n className=\"flex flex-wrap items-center gap-x-2 gap-y-1 text-xs text-muted-foreground\"\n >\n <span>{note}</span>\n {history.hasEarlier && !arrivesLater ? (\n <button\n type=\"button\"\n onClick={history.loadEarlier}\n disabled={history.loading}\n className=\"rounded font-medium text-primary hover:underline focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring disabled:cursor-default disabled:no-underline disabled:opacity-60\"\n >\n {history.loading ? \"Loading earlier steps…\" : \"Load earlier steps\"}\n </button>\n ) : null}\n </div>\n ) : null}\n {messages.length > 0 ? (\n <LaneStepsBoundary name={lane.name}>\n <LaneStepComponentsContext.Provider value={components}>\n <ReadonlyThreadProvider messages={messages}>\n <div data-slot=\"subagent-step-rows\" className=\"flex min-w-0 flex-col gap-1\">\n <LaneRows />\n </div>\n </ReadonlyThreadProvider>\n </LaneStepComponentsContext.Provider>\n </LaneStepsBoundary>\n ) : (\n <p className=\"text-xs text-muted-foreground\">{emptyText}</p>\n )}\n {closing ? (\n <div data-slot=\"subagent-result\" className=\"flex min-w-0 flex-col gap-0.5\">\n <p\n className={cn(\n \"text-xs font-medium\",\n failed ? \"text-destructive\" : \"text-muted-foreground\",\n )}\n >\n {failed ? \"Error\" : \"Report\"}\n </p>\n <p\n data-slot=\"subagent-result-text\"\n className={cn(\n \"max-h-72 overflow-auto whitespace-pre-wrap break-words text-xs leading-relaxed\",\n failed ? \"text-destructive/80\" : \"text-foreground/80\",\n )}\n >\n {closing}\n </p>\n </div>\n ) : null}\n </div>\n );\n}\n\n// ─── The card ────────────────────────────────────────────────────────\n\n/** The card's second line: where the lane is, its tool calls, how long it ran. */\nfunction laneMeta({\n phase,\n toolCallCount,\n elapsedMs,\n}: {\n phase: SubagentLanePhase;\n toolCallCount: number;\n elapsedMs: number | null;\n}): string {\n const parts: string[] = [SUBAGENT_LANE_PHASE_LABELS[phase]];\n if (toolCallCount > 0 || isSettledSubagentLanePhase(phase)) {\n parts.push(toolCallCountLabel(toolCallCount));\n }\n if (elapsedMs !== null && (phase !== \"running\" || elapsedMs >= 1000)) {\n parts.push(formatWorkDuration(elapsedMs));\n }\n return parts.join(\" · \");\n}\n\nfunction SubagentTaskCard({ toolCallId, args, status, artifact, messages }: ToolCallMessagePartProps) {\n const appearance = useToolAppearance();\n const isThread = appearance === \"thread\";\n const readLane = useAuiState((s) => taskSubagentsOfTurn(s.message).get(toolCallId));\n const lane = useMemo(\n () => readLane ?? laneFromArgs(toolCallId, args),\n [readLane, toolCallId, args],\n );\n // A lane holding a gated call the run's approval names waits on a person:\n // no live activity, no clock, just what it waits on. Read-only (the approval\n // card answers).\n const { toolCallIds: waitingToolCallIds } = useApprovalWaitInScope();\n const awaitingApproval = subagentAwaitingApproval({ lane, toolCallIds: waitingToolCallIds });\n const gatedCall = awaitingApproval\n ? subagentToolCallAwaitingApproval({ lane, toolCallIds: waitingToolCallIds })\n : undefined;\n const phase = subagentLanePhase({ status: lane.status, partStatus: status, awaitingApproval });\n const running = phase === \"running\";\n // Only a running lane's clock reads it, so a settled card scans nothing.\n const delegatedAt = useAuiState((s) =>\n running\n ? laneDelegatedAtMs({ sources: getExternalStoreMessages<unknown>(s.message), toolCallId })\n : null,\n );\n const runningElapsed = useRunningElapsedMs(running, delegatedAt);\n const elapsedMs = running\n ? runningElapsed\n : isSettledSubagentLanePhase(phase)\n ? finishedLaneDurationMs(artifact)\n : null;\n const step = useMemo(() => (running ? latestLaneStep(lane.messages) : null), [running, lane.messages]);\n const hasSteps = lane.messageCount > 0 || (lane.omittedMessageCount ?? 0) > 0;\n const typeLabel = subagentTypeLabel(lane.name);\n const title = lane.description.trim() || typeLabel;\n const meta = laneMeta({ phase, toolCallCount: lane.toolCallCount, elapsedMs });\n const liveText = step ? null : lane.currentText.trim();\n const report = subagentLaneResult({ output: lane.output, phase, partStatus: status });\n\n const header = (\n <>\n <LaneStatusGlyph phase={phase} />\n <span className=\"flex min-w-0 flex-1 flex-col gap-0.5\">\n <span className=\"flex min-w-0 items-baseline gap-1.5\">\n <span\n data-slot=\"subagent-title\"\n title={lane.description || undefined}\n className=\"min-w-0 truncate font-medium text-foreground\"\n >\n {title}\n </span>\n {title !== typeLabel ? (\n <span\n data-slot=\"subagent-type\"\n className=\"shrink-0 rounded-full bg-muted px-1.5 py-px text-[10px] font-medium text-muted-foreground\"\n >\n {typeLabel}\n </span>\n ) : null}\n </span>\n <span\n data-slot=\"subagent-meta\"\n className={cn(\n \"text-xs tabular-nums text-muted-foreground\",\n phase === \"error\" && \"text-destructive\",\n )}\n >\n {meta}\n </span>\n {phase === \"approval\" ? (\n <span\n data-slot=\"subagent-approval\"\n className=\"flex min-w-0 items-baseline gap-1 text-xs text-muted-foreground\"\n >\n <span className=\"shrink-0 text-amber-700\">\n {gatedCall ? \"Needs approval to run\" : \"Needs approval to start\"}\n </span>\n {gatedCall ? (\n <>\n <code className=\"shrink-0 rounded bg-foreground/[0.06] px-1 py-px font-mono text-[11px] text-foreground/85\">\n {gatedCall.name}\n </code>\n <span className=\"min-w-0 truncate\">{salientToolCallDetail(gatedCall)}</span>\n </>\n ) : null}\n </span>\n ) : running ? (\n <span data-slot=\"subagent-activity\" className=\"min-w-0 truncate text-xs text-muted-foreground\">\n {step ? (\n <span title={step.detail}>\n <StepText text={step.label} code={step.code} />\n </span>\n ) : (\n liveText || \"Starting…\"\n )}\n </span>\n ) : null}\n </span>\n </>\n );\n\n return (\n <ToolFallbackRoot\n data-testid=\"subagent-task-card\"\n data-phase={phase}\n role=\"group\"\n aria-label={`Subagent: ${title}`}\n className={cn(isThread && phase === \"error\" && \"border-destructive/30 bg-destructive/5\")}\n >\n {/* A report or a failure is behind the disclosure whole, steps or none. */}\n {hasSteps || running || report ? (\n <CollapsibleTrigger\n data-slot=\"subagent-trigger\"\n className={cn(\n \"group/trigger flex w-full min-w-0 items-start gap-2 text-left text-[13px] leading-snug transition-colors hover:bg-muted/40\",\n isThread ? \"rounded-lg px-2.5 py-1.5\" : \"px-3\",\n )}\n >\n {header}\n <ChevronDownIcon\n aria-hidden=\"true\"\n className={cn(\n \"mt-0.5 size-3.5 shrink-0 text-muted-foreground/60\",\n \"transition-transform duration-(--animation-duration) ease-out\",\n \"group-data-[state=closed]/trigger:-rotate-90\",\n )}\n />\n </CollapsibleTrigger>\n ) : (\n <div\n data-slot=\"subagent-trigger\"\n className={cn(\n \"flex w-full min-w-0 items-start gap-2 text-[13px] leading-snug\",\n isThread ? \"px-2.5 py-1.5\" : \"px-3\",\n )}\n >\n {header}\n </div>\n )}\n {report ? (\n <p\n data-slot=\"subagent-report\"\n // Margins, not padding: a clamped block clips at its padding edge,\n // so bottom padding would show the top of the next line.\n className={cn(\n \"mb-1.5 line-clamp-3 whitespace-pre-line break-words text-xs leading-relaxed\",\n isThread ? \"mr-2.5 ml-8\" : \"mx-3 mt-1.5 ml-9\",\n phase === \"error\" ? \"text-destructive\" : \"text-foreground/80\",\n )}\n >\n {report}\n </p>\n ) : null}\n <ToolFallbackContent>\n <LaneQueryScope>\n <LaneSteps lane={lane} phase={phase} result={report} partMessages={messages} />\n </LaneQueryScope>\n </ToolFallbackContent>\n </ToolFallbackRoot>\n );\n}\n\n/**\n * A delegation inside a subagent's own steps: one static row. It is not the\n * run's lane to show; its steps live in the subagent's own transcript.\n */\nfunction SubagentDelegationRow({ args, result, isError, status }: ToolCallMessagePartProps) {\n const settled = result !== undefined && status?.type !== \"running\";\n const summary = summarizeToolCall({\n toolName: \"task\",\n args: typeof args === \"object\" && args !== null ? (args as Record<string, unknown>) : undefined,\n status: !settled ? \"running\" : isError === true ? \"error\" : \"complete\",\n });\n return (\n <div\n data-testid=\"subagent-delegation\"\n className=\"my-1 flex min-w-0 items-center gap-2 rounded-lg border border-border/50 bg-background px-2.5 py-1.5 text-[13px]\"\n >\n <BotIcon aria-hidden=\"true\" className=\"size-3.5 shrink-0 text-muted-foreground\" />\n <span title={summary.detail} className=\"min-w-0 truncate text-foreground\">\n {summary.label}\n </span>\n </div>\n );\n}\n\nconst SubagentTaskToolUIImpl: ToolCallMessagePartComponent = (props) =>\n useInReadOnlyThread() ? <SubagentDelegationRow {...props} /> : <SubagentTaskCard {...props} />;\n\n/**\n * The `task` tool UI (`TOOL_UI_REGISTRY.task`): the subagent card, or inside\n * a subagent's own steps, a static delegation row.\n */\nexport const SubagentTaskToolUI = memo(\n SubagentTaskToolUIImpl,\n) as unknown as ToolCallMessagePartComponent;\nSubagentTaskToolUI.displayName = \"SubagentTaskToolUI\";\n"],"names":["readInstantMs","MESSAGE_CREATED_AT_KEY","messages","summarizeToolCall","humanizeToolName","useAuiState","hasStatewireThreadExtras","record","LoaderIcon","jsx","CheckIcon","AlertCircleIcon","XCircleIcon","ShieldAlertIcon","CircleDashedIcon","useState","useEffect","createContext","useContext","MessagePrimitive","deepAgentRowKey","useMemo","Fragment","ThreadPrimitive","Component","athenaDiagnostics","useAthenaQueryClient","QueryClientProvider","useDeepAgentLaneHistory","createSubagentLaneConversion","withLaneReport","useNestedPtcComponents","ToolFallback","jsxs","ReadonlyThreadProvider","cn","formatWorkDuration","useToolAppearance","taskSubagentsOfTurn","useApprovalWaitInScope","subagentAwaitingApproval","subagentToolCallAwaitingApproval","getExternalStoreMessages","salientToolCallDetail","StepText","ToolFallbackRoot","CollapsibleTrigger","ChevronDownIcon","ToolFallbackContent","BotIcon","memo"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAyFA,MAAM,gBAA6C,CAAA;AACnD,MAAM,cAAwC,CAAA;AAsBvC,MAAM,6BAAgE;AAAA,EAC3E,QAAQ;AAAA,EACR,UAAU;AAAA,EACV,SAAS;AAAA,EACT,SAAS;AAAA,EACT,UAAU;AAAA,EACV,OAAO;AAAA,EACP,SAAS;AACX;AAGO,SAAS,kBAAkB;AAAA,EAChC;AAAA,EACA;AAAA,EACA,mBAAmB;AACrB,GAKsB;AACpB,MAAI,WAAW,cAAc,WAAW,QAAS,QAAO;AACxD,MAAI,iBAAkB,QAAO;AAC7B,OAAI,yCAAY,UAAS,kBAAmB,QAAO;AACnD,OAAI,yCAAY,UAAS,cAAc;AACrC,WAAO,WAAW,WAAW,cAAc,YAAY;AAAA,EACzD;AACA,SAAO;AACT;AAGO,SAAS,2BAA2B,OAAmC;AAC5E,SAAO,UAAU,cAAc,UAAU,WAAW,UAAU;AAChE;AAQO,SAAS,mBAAmB;AAAA,EACjC;AAAA,EACA;AAAA,EACA;AACF,GAKW;AACT,MAAI,CAAC,2BAA2B,KAAK,EAAG,QAAO;AAC/C,QAAM,OAAM,iCAAQ,WAAU;AAC9B,MAAI,QAAQ,MAAM,UAAU,YAAW,yCAAY,UAAS,aAAc,QAAO;AACjF,QAAM,EAAE,UAAU;AAClB,MAAI,UAAU,UAAa,UAAU,KAAM,QAAO;AAClD,UAAQ,OAAO,UAAU,WAAW,QAAQ,KAAK,UAAU,KAAK,GAAG,KAAA;AACrE;AAEA,SAAS,OAAO,OAAqD;AACnE,SAAO,SAAS,OAAO,UAAU,YAAY,CAAC,MAAM,QAAQ,KAAK,IAC5D,QACD;AACN;AASO,SAAS,uBAAuB,UAAkC;AACvE,QAAM,SAAS,OAAO,QAAQ;AAC9B,QAAM,YAAYA,WAAAA,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Z,WAAU;AAAA,MAEV,UAAA;AAAA,QAAAxB,2BAAAA,IAACwC,YAAAA,SAAA,EAAQ,eAAY,QAAO,WAAU,2CAA0C;AAAA,QAChFxC,2BAAAA,IAAC,UAAK,OAAO,QAAQ,QAAQ,WAAU,oCACpC,kBAAQ,MAAA,CACX;AAAA,MAAA;AAAA,IAAA;AAAA,EAAA;AAGN;AAEA,MAAM,yBAAuD,CAAC,UAC5D,oBAAA,IAAwBA,2BAAAA,IAAC,uBAAA,EAAuB,GAAG,MAAA,CAAO,IAAKA,2BAAAA,IAAC,kBAAA,EAAkB,GAAG,MAAA,CAAO;AAMvF,MAAM,qBAAqByC,MAAAA;AAAAA,EAChC;AACF;AACA,mBAAmB,cAAc;;;;;;;;;;;;"}
1
+ {"version":3,"file":"subagent-task-tool-ui.cjs","sources":["../../src/tools/subagent-task-tool-ui.tsx"],"sourcesContent":["\"use client\";\n\n/**\n * The subagent card: one `task` call the deep agent delegated, shown the way\n * Olympus shows a subagent lane.\n *\n * - On the card: where the lane is (queued, running, done, failed, stopped),\n * how many tool calls it made (the wire's cut marker counts a lane whose\n * card carries only its newest steps), how long it has run, and while it\n * runs, its newest step; a finished lane's report, or why it failed, under\n * it, clamped.\n * - Behind its disclosure: the lane's steps, live while it runs, ending on\n * what the lane ended on, whole (a failure, or a report no step carries),\n * so a lane with no steps still opens to its full result. The lane is\n * assistant-ui's native nested thread: the `task` part's `messages`, which\n * the SDK runtime's opt-in conversion fills\n * (`createSubagentTranscriptConversionCache`), rendered read-only under\n * `ReadonlyThreadProvider` with the chat's own tool UIs. A cut lane (a\n * running card always; a finished one when the provider declares the\n * lane-cut contract, `subagentLaneHistory`) says how many of its steps it\n * shows, and \"Load earlier steps\" reads the rest with `history/lane`\n * (`useDeepAgentLaneHistory`), a read under the thread's own attach.\n *\n * A read-only nested thread has no statewire thread behind it: a `task` call\n * inside a subagent's own steps renders as a static row, and the steps are\n * their own error boundary, so a tool UI that throws there never takes the\n * chat down with it.\n */\nimport {\n getExternalStoreMessages,\n MessagePrimitive,\n ReadonlyThreadProvider,\n type ThreadMessage,\n ThreadPrimitive,\n type ToolCallMessagePartComponent,\n type ToolCallMessagePartProps,\n type ToolCallMessagePartStatus,\n useAuiState,\n} from \"@assistant-ui/react\";\nimport type { LangChainMessage } from \"@assistant-ui/react-langgraph\";\nimport {\n createSubagentLaneConversion,\n deepAgentRowKey,\n hasStatewireThreadExtras,\n salientToolCallDetail,\n type SubagentDiscoverySnapshot,\n type SubagentStatus,\n subagentAwaitingApproval,\n subagentToolCallAwaitingApproval,\n taskSubagentsOfTurn,\n useDeepAgentLaneHistory,\n withLaneReport,\n} from \"@athenaintel/agent-runtime\";\nimport { QueryClientProvider } from \"@tanstack/react-query\";\nimport {\n AlertCircleIcon,\n BotIcon,\n CheckIcon,\n ChevronDownIcon,\n CircleDashedIcon,\n LoaderIcon,\n ShieldAlertIcon,\n XCircleIcon,\n} from \"lucide-react\";\nimport {\n Component,\n createContext,\n type ErrorInfo,\n type FC,\n memo,\n type ReactNode,\n useContext,\n useEffect,\n useMemo,\n useState,\n} from \"react\";\nimport { useApprovalWaitInScope } from \"../chat/use-statewire-approval-request\";\nimport { MESSAGE_CREATED_AT_KEY } from \"../chat/message-time\";\nimport { formatWorkDuration, readInstantMs } from \"../chat/super-grouping/turn-timing\";\nimport { athenaDiagnostics } from \"../diagnostics/athena-diagnostics\";\nimport { useAthenaQueryClient } from \"../lib/use-athena-rest-query\";\nimport { cn } from \"../lib/utils\";\nimport { CollapsibleTrigger } from \"../ui/collapsible\";\nimport { useNestedPtcComponents } from \"./NestedPtcMessages\";\nimport { StepText } from \"./step-text\";\nimport { useToolAppearance } from \"./tool-appearance\";\nimport { ToolFallback, ToolFallbackContent, ToolFallbackRoot } from \"./tool-fallback\";\nimport { humanizeToolName, summarizeToolCall, type ToolCallSummary } from \"./tool-summary\";\n\nconst NO_LANE_STEPS: readonly LangChainMessage[] = [];\nconst NO_MESSAGES: readonly ThreadMessage[] = [];\n\n// ─── What the card says ──────────────────────────────────────────────\n// Pure: where a lane is, how long it ran, the step it took last, and the\n// note over a cut lane's steps, tested without rendering the card.\n\n/**\n * Where a lane is, as the card shows it: the lane's own status, except that a\n * lane parked on a person's approval is `approval` (its own dispatch, or a call\n * it made, is a gated call nobody has answered), any other call the run waits\n * on an answer for is `waiting`, and one the run stopped before it settled is\n * `stopped`.\n */\nexport type SubagentLanePhase =\n | \"queued\"\n | \"approval\"\n | \"waiting\"\n | \"running\"\n | \"complete\"\n | \"error\"\n | \"stopped\";\n\nexport const SUBAGENT_LANE_PHASE_LABELS: Record<SubagentLanePhase, string> = {\n queued: \"Queued\",\n approval: \"Waiting for approval\",\n waiting: \"Waiting for you\",\n running: \"Running\",\n complete: \"Done\",\n error: \"Failed\",\n stopped: \"Stopped\",\n};\n\n/** The lane's phase from its status, the status assistant-ui gives its part, and the run's approval. */\nexport function subagentLanePhase({\n status,\n partStatus,\n awaitingApproval = false,\n}: {\n status: SubagentStatus;\n partStatus: ToolCallMessagePartStatus | undefined;\n /** The lane waits on a person's approval (agent-runtime's `subagentAwaitingApproval`). */\n awaitingApproval?: boolean;\n}): SubagentLanePhase {\n if (status === \"complete\" || status === \"error\") return status;\n if (awaitingApproval) return \"approval\";\n if (partStatus?.type === \"requires-action\") return \"waiting\";\n if (partStatus?.type === \"incomplete\") {\n return partStatus.reason === \"cancelled\" ? \"stopped\" : \"error\";\n }\n return status;\n}\n\n/** The phases a lane never leaves. */\nexport function isSettledSubagentLanePhase(phase: SubagentLanePhase): boolean {\n return phase === \"complete\" || phase === \"error\" || phase === \"stopped\";\n}\n\n/**\n * What a settled lane ended on, whole: its report, or why it failed. A lane\n * that the run's own failure ended has no result of its own, so the `task`\n * part's status says why (as the generic card shows a failed call). Empty\n * while the lane runs.\n */\nexport function subagentLaneResult({\n output,\n phase,\n partStatus,\n}: {\n /** The lane's own result text (`SubagentDiscoverySnapshot.output`). */\n output: string | undefined;\n phase: SubagentLanePhase;\n partStatus: ToolCallMessagePartStatus | undefined;\n}): string {\n if (!isSettledSubagentLanePhase(phase)) return \"\";\n const own = output?.trim() ?? \"\";\n if (own !== \"\" || phase !== \"error\" || partStatus?.type !== \"incomplete\") return own;\n const { error } = partStatus;\n if (error === undefined || error === null) return \"\";\n return (typeof error === \"string\" ? error : JSON.stringify(error)).trim();\n}\n\nfunction record(value: unknown): Record<string, unknown> | undefined {\n return value && typeof value === \"object\" && !Array.isArray(value)\n ? (value as Record<string, unknown>)\n : undefined;\n}\n\n/**\n * How long a finished lane ran, measured by the server: the `task` result's\n * `_started_at` and `_created_at`, which the deep agent's tool-call timing\n * stamps on every tool result and mirrors onto its artifact (the one field of\n * a tool message the converter hands the tool-call part). `null` when either\n * stamp is missing.\n */\nexport function finishedLaneDurationMs(artifact: unknown): number | null {\n const stamps = record(artifact);\n const startedAt = readInstantMs(stamps?._started_at);\n const finishedAt = readInstantMs(stamps?.[MESSAGE_CREATED_AT_KEY]);\n return startedAt !== null && finishedAt !== null && finishedAt >= startedAt\n ? finishedAt - startedAt\n : null;\n}\n\nconst ASSISTANT_TYPES: ReadonlySet<unknown> = new Set([\"ai\", \"AIMessageChunk\"]);\n\n/**\n * When the agent delegated the call `toolCallId`: the server stamp\n * (`_created_at`) of the assistant message that made it, among the raw\n * messages bound to the turn. A running lane's card carries no stamp of its\n * own, so its clock counts from here, the way the turn header counts from the\n * turn's own stamps. `null` without one.\n */\nexport function laneDelegatedAtMs({\n sources,\n toolCallId,\n}: {\n sources: readonly unknown[];\n toolCallId: string;\n}): number | null {\n for (const source of sources) {\n const message = record(source);\n if (!message || !ASSISTANT_TYPES.has(message.type)) continue;\n const calls = message.tool_calls;\n if (!Array.isArray(calls) || !calls.some((call) => record(call)?.id === toolCallId)) continue;\n const kwargs = record(message.additional_kwargs);\n const metadata = record(kwargs?.metadata);\n return (\n readInstantMs(metadata?.[MESSAGE_CREATED_AT_KEY]) ??\n readInstantMs(kwargs?.[MESSAGE_CREATED_AT_KEY]) ??\n readInstantMs(message[MESSAGE_CREATED_AT_KEY])\n );\n }\n return null;\n}\n\n/**\n * The lane's newest tool step as its summary line (\"Read `routes.ts`\",\n * \"Running `npm test`\"), from the lane's converted steps: the last tool call\n * of its newest assistant turn, worded for whether it has answered. `null`\n * before the lane's first tool call.\n */\nexport function latestLaneStep(messages: readonly ThreadMessage[]): ToolCallSummary | null {\n for (let index = messages.length - 1; index >= 0; index -= 1) {\n const message = messages[index];\n if (message?.role !== \"assistant\") continue;\n for (let partIndex = message.content.length - 1; partIndex >= 0; partIndex -= 1) {\n const part = message.content[partIndex];\n if (part?.type !== \"tool-call\") continue;\n const answered = part.result !== undefined && part.isPreliminary !== true;\n return summarizeToolCall({\n toolName: part.toolName,\n args: part.args,\n result: answered ? part.result : undefined,\n status: answered ? (part.isError === true ? \"error\" : \"complete\") : \"running\",\n });\n }\n }\n return null;\n}\n\n/**\n * The subagent's type as the card names it: the `task` call's `subagent_type`\n * in words, with the default `general-purpose` agent as \"Subagent\".\n */\nexport function subagentTypeLabel(name: string): string {\n const trimmed = name.trim();\n if (trimmed === \"\" || trimmed === \"subagent\" || trimmed === \"general-purpose\") return \"Subagent\";\n return humanizeToolName(trimmed);\n}\n\n/** \"1 tool call\", \"12 tool calls\". */\nexport function toolCallCountLabel(count: number): string {\n return `${count} tool call${count === 1 ? \"\" : \"s\"}`;\n}\n\n/** \"1 step\", \"12 steps\". */\nfunction stepsLabel(count: number): string {\n return `${count} step${count === 1 ? \"\" : \"s\"}`;\n}\n\n/** What the steps panel says about the steps it shows of a cut lane. */\nexport function laneStepsNote({\n shown,\n total,\n arrivesLater,\n}: {\n /** Steps the panel shows. */\n shown: number;\n /** Steps the lane stores (its cut marker), when the card carries fewer. */\n total: number | undefined;\n /**\n * A running lane on a host that pages no running lane: its card brings the\n * rest once the subagent finishes.\n */\n arrivesLater: boolean;\n}): string | null {\n if (total === undefined || total <= shown) return null;\n const leftOff = total - shown;\n return arrivesLater\n ? `Showing the latest steps. ${leftOff} earlier ${leftOff === 1 ? \"step arrives\" : \"steps arrive\"} when this subagent finishes.`\n : `Showing the latest ${shown} of ${stepsLabel(total)}.`;\n}\n\n/**\n * Whether this card renders inside a read-only nested thread (a subagent's own\n * steps, under `ReadonlyThreadProvider`), whose thread has no statewire\n * extras. Never throws: rendered outside any thread, it is not nested.\n */\nfunction useInReadOnlyThread(): boolean {\n return useAuiState((s) => {\n const thread = s.optional?.thread;\n return thread !== undefined && !hasStatewireThreadExtras(thread.extras);\n });\n}\n\n/** A lane for a call agent-runtime read no lane for: what its arguments say, queued. */\nfunction laneFromArgs(toolCallId: string, args: unknown): SubagentDiscoverySnapshot {\n const record = typeof args === \"object\" && args !== null ? (args as Record<string, unknown>) : {};\n return {\n id: toolCallId,\n name: typeof record.subagent_type === \"string\" ? record.subagent_type : \"subagent\",\n description: typeof record.description === \"string\" ? record.description : \"\",\n status: \"queued\",\n toolCallCount: 0,\n messages: NO_MESSAGES,\n messageCount: 0,\n currentText: \"\",\n };\n}\n\n// ─── Status glyph ────────────────────────────────────────────────────\n\nfunction LaneStatusGlyph({ phase }: { phase: SubagentLanePhase }) {\n const glyph =\n phase === \"running\" ? (\n <LoaderIcon className=\"size-3.5 animate-spin text-muted-foreground motion-reduce:animate-none\" />\n ) : phase === \"complete\" ? (\n <CheckIcon className=\"size-3.5 text-emerald-600\" />\n ) : phase === \"error\" ? (\n <AlertCircleIcon className=\"size-3.5 text-destructive\" />\n ) : phase === \"stopped\" ? (\n <XCircleIcon className=\"size-3.5 text-muted-foreground\" />\n ) : phase === \"waiting\" || phase === \"approval\" ? (\n <ShieldAlertIcon className=\"size-3.5 text-amber-600\" />\n ) : (\n <CircleDashedIcon className=\"size-3.5 text-muted-foreground motion-safe:animate-pulse\" />\n );\n return (\n <span\n data-slot=\"subagent-status\"\n data-phase={phase}\n aria-hidden=\"true\"\n className=\"mt-0.5 flex size-4 shrink-0 items-center justify-center\"\n >\n {glyph}\n </span>\n );\n}\n\n// ─── Clock ───────────────────────────────────────────────────────────\n\n/**\n * How long a running lane has run: since `startMs` (the server's stamp on the\n * delegating message), else since this card saw it running; `null` while it\n * does not run. Ticks once a second off the wall clock.\n */\nfunction useRunningElapsedMs(running: boolean, startMs: number | null): number | null {\n const [clock, setClock] = useState<{ seenAt: number; now: number } | null>(null);\n useEffect(() => {\n if (!running) {\n setClock(null);\n return undefined;\n }\n const seenAt = Date.now();\n setClock({ seenAt, now: seenAt });\n const timer = setInterval(() => setClock({ seenAt, now: Date.now() }), 1000);\n return () => clearInterval(timer);\n }, [running]);\n if (!running || clock === null) return null;\n return Math.max(0, clock.now - (startMs ?? clock.seenAt));\n}\n\n// ─── The lane's steps ────────────────────────────────────────────────\n\ntype NestedPartsComponents = ReturnType<typeof useNestedPtcComponents>;\n\nconst LaneStepComponentsContext = createContext<NestedPartsComponents | null>(null);\n\nconst EmptyStepPart: FC = () => null;\n\n/**\n * One row of the lane: an assistant turn's parts, through the chat's own\n * renderers (`NestedPtcComponentsProvider`, which `AthenaChat` mounts). The\n * subagent's brief (its user message) is the card's own description, so it is\n * not repeated.\n */\nconst LaneStep: FC = () => {\n const role = useAuiState((s) => s.message.role);\n const components = useContext(LaneStepComponentsContext);\n if (role !== \"assistant\") return null;\n return <MessagePrimitive.Parts components={{ Empty: EmptyStepPart, ...components }} />;\n};\n\nconst LANE_ROW_COMPONENTS = { Message: LaneStep };\n\nconst ROW_KEY_SEPARATOR = \"\\u0000\";\n\n/**\n * The nested thread's rows, each under its row key (`deepAgentRowKey`): the\n * lane's turn keeps its row while the card's cut drops its oldest steps and\n * when earlier pages land, so what the person opened in it stays open.\n */\nfunction LaneRows() {\n const joinedKeys = useAuiState((s) =>\n s.thread.messages.map((message) => deepAgentRowKey(message)).join(ROW_KEY_SEPARATOR),\n );\n const rowKeys = useMemo(\n () => (joinedKeys === \"\" ? [] : joinedKeys.split(ROW_KEY_SEPARATOR)),\n [joinedKeys],\n );\n return (\n <>\n {rowKeys.map((key, index) => (\n <ThreadPrimitive.MessageByIndex key={key} index={index} components={LANE_ROW_COMPONENTS} />\n ))}\n </>\n );\n}\n\ninterface LaneStepsBoundaryProps {\n name: string;\n children: ReactNode;\n}\n\n/**\n * The steps' own boundary: they render the chat's tool UIs (a host's own\n * among them) in a nested thread no statewire thread backs, and a card that\n * throws there must not take the chat down. Reported like a chat render\n * crash, with the lane named.\n */\nclass LaneStepsBoundary extends Component<LaneStepsBoundaryProps, { failed: boolean }> {\n constructor(props: LaneStepsBoundaryProps) {\n super(props);\n this.state = { failed: false };\n }\n\n static getDerivedStateFromError(): { failed: boolean } {\n return { failed: true };\n }\n\n componentDidCatch(error: Error, errorInfo: ErrorInfo): void {\n athenaDiagnostics.error(\n \"sdk.error\",\n error,\n {\n code: \"chat_render_crash\",\n message: \"A subagent's steps could not be shown\",\n hint: \"Inspect component_stack: a tool UI that reads the live thread fails inside a subagent's read-only steps.\",\n },\n {\n surface: \"subagent-lane\",\n subagent: this.props.name,\n component_stack: errorInfo.componentStack?.slice(0, 2000) ?? null,\n },\n );\n }\n\n render(): ReactNode {\n if (this.state.failed) {\n return (\n <p role=\"alert\" className=\"px-1 text-xs text-muted-foreground\">\n These steps couldn't be shown. The conversation is not affected.\n </p>\n );\n }\n return this.props.children;\n }\n}\n\n/** The host's `QueryClient` when one is in context, else one of the panel's own (`useAthenaQueryClient`). */\nfunction LaneQueryScope({ children }: { children: ReactNode }) {\n const queryClient = useAthenaQueryClient();\n return <QueryClientProvider client={queryClient}>{children}</QueryClientProvider>;\n}\n\ninterface LaneStepsProps {\n lane: SubagentDiscoverySnapshot;\n phase: SubagentLanePhase;\n /** What the lane ended on, whole (`subagentLaneResult`); empty while it runs. */\n result: string;\n /** The `task` part's own nested thread, shown if the panel cannot convert the lane itself. */\n partMessages: readonly ThreadMessage[] | undefined;\n}\n\n/**\n * The open card's steps: the lane the card carries, and the earlier steps the\n * person asks for. The panel converts the lane itself, with one conversion\n * memory while it is open (`createSubagentLaneConversion`), so the lane's turn\n * keeps its row key as the cut slides and pages land. It ends on what the lane\n * ended on, whole and selectable: the card clamps it.\n */\nfunction LaneSteps({ lane, phase, result, partMessages }: LaneStepsProps) {\n // The lane's card is its running placeholder, whether it streams or waits on an approval.\n const running = lane.status === \"running\" && (phase === \"running\" || phase === \"approval\");\n const source = lane.source;\n const history = useDeepAgentLaneHistory({\n messageId: source?.messageId,\n lane: source?.lane,\n carried: source?.transcript ?? NO_LANE_STEPS,\n total: source?.truncated?.messages,\n finished: source?.truncated?.finished === true,\n });\n const [convertLane] = useState(() => createSubagentLaneConversion());\n // A `task` lane that finished ends on its report, the card's content, even\n // when its stored transcript does not (`withLaneReport`), as in Olympus's drawer.\n const report =\n lane.status === \"complete\" && source?.messageId !== undefined ? lane.output : undefined;\n const messages =\n (source === undefined\n ? undefined\n : convertLane(withLaneReport(history.steps, report), running)) ??\n partMessages ??\n NO_MESSAGES;\n const components = useNestedPtcComponents(ToolFallback);\n const shown = history.steps.length;\n // A running card on a host that pages no running lane carries the rest once it finishes.\n const arrivesLater = running && source?.messageId !== undefined && !history.available;\n const note = laneStepsNote({ shown, total: history.total, arrivesLater });\n const emptyText =\n phase === \"running\"\n ? \"Starting…\"\n : phase === \"queued\" || phase === \"waiting\" || phase === \"approval\"\n ? \"Not started yet.\"\n : \"No steps were recorded for this subagent.\";\n // Why a lane failed is never one of its steps; a report is the closing\n // step of a lane with steps to close (`withLaneReport`).\n const failed = phase === \"error\";\n const closing = failed || messages.length === 0 ? result : \"\";\n\n return (\n <div data-slot=\"subagent-steps\" className=\"flex min-w-0 flex-col gap-2 px-2.5\">\n {lane.description ? (\n <p\n data-slot=\"subagent-brief\"\n className=\"whitespace-pre-wrap break-words text-xs leading-relaxed text-muted-foreground\"\n >\n {lane.description}\n </p>\n ) : null}\n {note ? (\n <div\n data-slot=\"subagent-steps-note\"\n className=\"flex flex-wrap items-center gap-x-2 gap-y-1 text-xs text-muted-foreground\"\n >\n <span>{note}</span>\n {history.hasEarlier && !arrivesLater ? (\n <button\n type=\"button\"\n onClick={history.loadEarlier}\n disabled={history.loading}\n className=\"rounded font-medium text-primary hover:underline focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring disabled:cursor-default disabled:no-underline disabled:opacity-60\"\n >\n {history.loading ? \"Loading earlier steps…\" : \"Load earlier steps\"}\n </button>\n ) : null}\n </div>\n ) : null}\n {messages.length > 0 ? (\n <LaneStepsBoundary name={lane.name}>\n <LaneStepComponentsContext.Provider value={components}>\n <ReadonlyThreadProvider messages={messages}>\n <div data-slot=\"subagent-step-rows\" className=\"flex min-w-0 flex-col gap-1\">\n <LaneRows />\n </div>\n </ReadonlyThreadProvider>\n </LaneStepComponentsContext.Provider>\n </LaneStepsBoundary>\n ) : (\n <p className=\"text-xs text-muted-foreground\">{emptyText}</p>\n )}\n {closing ? (\n <div data-slot=\"subagent-result\" className=\"flex min-w-0 flex-col gap-0.5\">\n <p\n className={cn(\n \"text-xs font-medium\",\n failed ? \"text-destructive\" : \"text-muted-foreground\",\n )}\n >\n {failed ? \"Error\" : \"Report\"}\n </p>\n <p\n data-slot=\"subagent-result-text\"\n className={cn(\n \"max-h-72 overflow-auto whitespace-pre-wrap break-words text-xs leading-relaxed\",\n failed ? \"text-destructive/80\" : \"text-foreground/80\",\n )}\n >\n {closing}\n </p>\n </div>\n ) : null}\n </div>\n );\n}\n\n// ─── The card ────────────────────────────────────────────────────────\n\n/** The card's second line: where the lane is, its tool calls, how long it ran. */\nfunction laneMeta({\n phase,\n toolCallCount,\n elapsedMs,\n}: {\n phase: SubagentLanePhase;\n toolCallCount: number;\n elapsedMs: number | null;\n}): string {\n const parts: string[] = [SUBAGENT_LANE_PHASE_LABELS[phase]];\n if (toolCallCount > 0 || isSettledSubagentLanePhase(phase)) {\n parts.push(toolCallCountLabel(toolCallCount));\n }\n if (elapsedMs !== null && (phase !== \"running\" || elapsedMs >= 1000)) {\n parts.push(formatWorkDuration(elapsedMs));\n }\n return parts.join(\" · \");\n}\n\nfunction SubagentTaskCard({ toolCallId, args, status, artifact, messages }: ToolCallMessagePartProps) {\n const appearance = useToolAppearance();\n const isThread = appearance === \"thread\";\n const readLane = useAuiState((s) => taskSubagentsOfTurn(s.message).get(toolCallId));\n const lane = useMemo(\n () => readLane ?? laneFromArgs(toolCallId, args),\n [readLane, toolCallId, args],\n );\n // A lane holding a gated call the run's approval names waits on a person:\n // no live activity, no clock, just what it waits on. Read-only (the approval\n // card answers).\n const { toolCallIds: waitingToolCallIds } = useApprovalWaitInScope();\n const awaitingApproval = subagentAwaitingApproval({ lane, toolCallIds: waitingToolCallIds });\n const gatedCall = awaitingApproval\n ? subagentToolCallAwaitingApproval({ lane, toolCallIds: waitingToolCallIds })\n : undefined;\n const phase = subagentLanePhase({ status: lane.status, partStatus: status, awaitingApproval });\n const running = phase === \"running\";\n // Only a running lane's clock reads it, so a settled card scans nothing.\n const delegatedAt = useAuiState((s) =>\n running\n ? laneDelegatedAtMs({ sources: getExternalStoreMessages<unknown>(s.message), toolCallId })\n : null,\n );\n const runningElapsed = useRunningElapsedMs(running, delegatedAt);\n const elapsedMs = running\n ? runningElapsed\n : isSettledSubagentLanePhase(phase)\n ? finishedLaneDurationMs(artifact)\n : null;\n const step = useMemo(() => (running ? latestLaneStep(lane.messages) : null), [running, lane.messages]);\n const hasSteps = lane.messageCount > 0 || (lane.omittedMessageCount ?? 0) > 0;\n const typeLabel = subagentTypeLabel(lane.name);\n const title = lane.description.trim() || typeLabel;\n const meta = laneMeta({ phase, toolCallCount: lane.toolCallCount, elapsedMs });\n const liveText = step ? null : lane.currentText.trim();\n const report = subagentLaneResult({ output: lane.output, phase, partStatus: status });\n\n const header = (\n <>\n <LaneStatusGlyph phase={phase} />\n <span className=\"flex min-w-0 flex-1 flex-col gap-0.5\">\n <span className=\"flex min-w-0 items-baseline gap-1.5\">\n <span\n data-slot=\"subagent-title\"\n title={lane.description || undefined}\n className=\"min-w-0 truncate font-medium text-foreground\"\n >\n {title}\n </span>\n {title !== typeLabel ? (\n <span\n data-slot=\"subagent-type\"\n className=\"shrink-0 rounded-full bg-muted px-1.5 py-px text-[10px] font-medium text-muted-foreground\"\n >\n {typeLabel}\n </span>\n ) : null}\n </span>\n <span\n data-slot=\"subagent-meta\"\n className={cn(\n \"text-xs tabular-nums text-muted-foreground\",\n phase === \"error\" && \"text-destructive\",\n )}\n >\n {meta}\n </span>\n {phase === \"approval\" ? (\n <span\n data-slot=\"subagent-approval\"\n className=\"flex min-w-0 items-baseline gap-1 text-xs text-muted-foreground\"\n >\n <span className=\"shrink-0 text-amber-700\">\n {gatedCall ? \"Needs approval to run\" : \"Needs approval to start\"}\n </span>\n {gatedCall ? (\n <>\n <code className=\"shrink-0 rounded bg-foreground/[0.06] px-1 py-px font-mono text-[11px] text-foreground/85\">\n {gatedCall.name}\n </code>\n <span className=\"min-w-0 truncate\">{salientToolCallDetail(gatedCall)}</span>\n </>\n ) : null}\n </span>\n ) : running ? (\n <span data-slot=\"subagent-activity\" className=\"min-w-0 truncate text-xs text-muted-foreground\">\n {step ? (\n <span title={step.detail}>\n <StepText text={step.label} code={step.code} />\n </span>\n ) : (\n liveText || \"Starting…\"\n )}\n </span>\n ) : null}\n </span>\n </>\n );\n\n return (\n <ToolFallbackRoot\n data-testid=\"subagent-task-card\"\n data-phase={phase}\n role=\"group\"\n aria-label={`Subagent: ${title}`}\n className={cn(isThread && phase === \"error\" && \"border-destructive/30 bg-destructive/5\")}\n >\n {/* A report or a failure is behind the disclosure whole, steps or none. */}\n {hasSteps || running || report ? (\n <CollapsibleTrigger\n data-slot=\"subagent-trigger\"\n className={cn(\n \"group/trigger flex w-full min-w-0 items-start gap-2 text-left text-[13px] leading-snug transition-colors hover:bg-muted/40\",\n isThread ? \"rounded-lg px-2.5 py-1.5\" : \"px-3\",\n )}\n >\n {header}\n <ChevronDownIcon\n aria-hidden=\"true\"\n className={cn(\n \"mt-0.5 size-3.5 shrink-0 text-muted-foreground/60\",\n \"transition-transform duration-(--animation-duration) ease-out\",\n \"group-data-[state=closed]/trigger:-rotate-90\",\n )}\n />\n </CollapsibleTrigger>\n ) : (\n <div\n data-slot=\"subagent-trigger\"\n className={cn(\n \"flex w-full min-w-0 items-start gap-2 text-[13px] leading-snug\",\n isThread ? \"px-2.5 py-1.5\" : \"px-3\",\n )}\n >\n {header}\n </div>\n )}\n {report ? (\n <p\n data-slot=\"subagent-report\"\n // Margins, not padding: a clamped block clips at its padding edge,\n // so bottom padding would show the top of the next line.\n className={cn(\n \"mb-1.5 line-clamp-3 whitespace-pre-line break-words text-xs leading-relaxed\",\n isThread ? \"mr-2.5 ml-8\" : \"mx-3 mt-1.5 ml-9\",\n phase === \"error\" ? \"text-destructive\" : \"text-foreground/80\",\n )}\n >\n {report}\n </p>\n ) : null}\n <ToolFallbackContent>\n <LaneQueryScope>\n <LaneSteps lane={lane} phase={phase} result={report} partMessages={messages} />\n </LaneQueryScope>\n </ToolFallbackContent>\n </ToolFallbackRoot>\n );\n}\n\n/**\n * A delegation inside a subagent's own steps: one static row. It is not the\n * run's lane to show; its steps live in the subagent's own transcript.\n */\nfunction SubagentDelegationRow({ args, result, isError, status }: ToolCallMessagePartProps) {\n const settled = result !== undefined && status?.type !== \"running\";\n const summary = summarizeToolCall({\n toolName: \"task\",\n args: typeof args === \"object\" && args !== null ? (args as Record<string, unknown>) : undefined,\n status: !settled ? \"running\" : isError === true ? \"error\" : \"complete\",\n });\n return (\n <div\n data-testid=\"subagent-delegation\"\n className=\"my-1 flex min-w-0 items-center gap-2 rounded-lg border border-border/50 bg-background px-2.5 py-1.5 text-[13px]\"\n >\n <BotIcon aria-hidden=\"true\" className=\"size-3.5 shrink-0 text-muted-foreground\" />\n <span title={summary.detail} className=\"min-w-0 truncate text-foreground\">\n {summary.label}\n </span>\n </div>\n );\n}\n\nconst SubagentTaskToolUIImpl: ToolCallMessagePartComponent = (props) =>\n useInReadOnlyThread() ? <SubagentDelegationRow {...props} /> : <SubagentTaskCard {...props} />;\n\n/**\n * The `task` tool UI (`TOOL_UI_REGISTRY.task`): the subagent card, or inside\n * a subagent's own steps, a static delegation row.\n */\nexport const SubagentTaskToolUI = memo(\n SubagentTaskToolUIImpl,\n) as unknown as ToolCallMessagePartComponent;\nSubagentTaskToolUI.displayName = \"SubagentTaskToolUI\";\n"],"names":["readInstantMs","MESSAGE_CREATED_AT_KEY","messages","summarizeToolCall","humanizeToolName","useAuiState","hasStatewireThreadExtras","record","LoaderIcon","jsx","CheckIcon","AlertCircleIcon","XCircleIcon","ShieldAlertIcon","CircleDashedIcon","useState","useEffect","createContext","useContext","MessagePrimitive","deepAgentRowKey","useMemo","Fragment","ThreadPrimitive","Component","athenaDiagnostics","useAthenaQueryClient","QueryClientProvider","useDeepAgentLaneHistory","createSubagentLaneConversion","withLaneReport","useNestedPtcComponents","ToolFallback","jsxs","ReadonlyThreadProvider","cn","formatWorkDuration","useToolAppearance","taskSubagentsOfTurn","useApprovalWaitInScope","subagentAwaitingApproval","subagentToolCallAwaitingApproval","getExternalStoreMessages","salientToolCallDetail","StepText","ToolFallbackRoot","CollapsibleTrigger","ChevronDownIcon","ToolFallbackContent","BotIcon","memo"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAyFA,MAAM,gBAA6C,CAAA;AACnD,MAAM,cAAwC,CAAA;AAsBvC,MAAM,6BAAgE;AAAA,EAC3E,QAAQ;AAAA,EACR,UAAU;AAAA,EACV,SAAS;AAAA,EACT,SAAS;AAAA,EACT,UAAU;AAAA,EACV,OAAO;AAAA,EACP,SAAS;AACX;AAGO,SAAS,kBAAkB;AAAA,EAChC;AAAA,EACA;AAAA,EACA,mBAAmB;AACrB,GAKsB;AACpB,MAAI,WAAW,cAAc,WAAW,QAAS,QAAO;AACxD,MAAI,iBAAkB,QAAO;AAC7B,OAAI,yCAAY,UAAS,kBAAmB,QAAO;AACnD,OAAI,yCAAY,UAAS,cAAc;AACrC,WAAO,WAAW,WAAW,cAAc,YAAY;AAAA,EACzD;AACA,SAAO;AACT;AAGO,SAAS,2BAA2B,OAAmC;AAC5E,SAAO,UAAU,cAAc,UAAU,WAAW,UAAU;AACh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aAAAA,qBAAA,EACC,UAAAvC,2BAAAA,IAAC,gBAAA,EACC,UAAAA,+BAAC,WAAA,EAAU,MAAY,OAAc,QAAQ,QAAQ,cAAcP,UAAA,CAAU,GAC/E,EAAA,CACF;AAAA,MAAA;AAAA,IAAA;AAAA,EAAA;AAGN;AAMA,SAAS,sBAAsB,EAAE,MAAM,QAAQ,SAAS,UAAoC;AAC1F,QAAM,UAAU,WAAW,WAAa,iCAAQ,UAAS;AACzD,QAAM,UAAUC,YAAAA,kBAAkB;AAAA,IAChC,UAAU;AAAA,IACV,MAAM,OAAO,SAAS,YAAY,SAAS,OAAQ,OAAmC;AAAA,IACtF,QAAQ,CAAC,UAAU,YAAY,YAAY,OAAO,UAAU;AAAA,EAAA,CAC7D;AACD,SACE8B,2BAAAA;AAAAA,IAAC;AAAA,IAAA;AAAA,MACC,eAAY;AAAA,MACZ,WAAU;AAAA,MAEV,UAAA;AAAA,QAAAxB,2BAAAA,IAACwC,YAAAA,SAAA,EAAQ,eAAY,QAAO,WAAU,2CAA0C;AAAA,QAChFxC,2BAAAA,IAAC,UAAK,OAAO,QAAQ,QAAQ,WAAU,oCACpC,kBAAQ,MAAA,CACX;AAAA,MAAA;AAAA,IAAA;AAAA,EAAA;AAGN;AAEA,MAAM,yBAAuD,CAAC,UAC5D,oBAAA,IAAwBA,2BAAAA,IAAC,uBAAA,EAAuB,GAAG,MAAA,CAAO,IAAKA,2BAAAA,IAAC,kBAAA,EAAkB,GAAG,MAAA,CAAO;AAMvF,MAAM,qBAAqByC,WAAAA;AAAAA,EAChC;AACF;AACA,mBAAmB,cAAc;;;;;;;;;;;;"}
@@ -2,7 +2,7 @@
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
3
  const jsxRuntime = require("react/jsx-runtime");
4
4
  const lucideReact = require("lucide-react");
5
- const react = require("react");
5
+ const require$$0 = require("react");
6
6
  const useAssetContent = require("../assets/use-asset-content.cjs");
7
7
  const AthenaContext = require("../provider/AthenaContext.cjs");
8
8
  const primitives = require("./primitives.cjs");
@@ -41,14 +41,14 @@ function TestRecordingPlayer({
41
41
  const content = useAssetContent.useAthenaAssetContent({ assetId, enabled: playback.requested });
42
42
  const src = useAssetContent.useObjectUrl(playback.requested ? content.data : void 0);
43
43
  const { refetch } = content;
44
- const retry = react.useCallback(() => {
44
+ const retry = require$$0.useCallback(() => {
45
45
  void refetch();
46
46
  }, [refetch]);
47
- const videoRef = react.useRef(null);
48
- const pendingSeekRef = react.useRef(null);
47
+ const videoRef = require$$0.useRef(null);
48
+ const pendingSeekRef = require$$0.useRef(null);
49
49
  const seekTime = (_a = playback.seek) == null ? void 0 : _a.time;
50
50
  const seekNonce = ((_b = playback.seek) == null ? void 0 : _b.nonce) ?? 0;
51
- react.useEffect(() => {
51
+ require$$0.useEffect(() => {
52
52
  var _a2;
53
53
  const video = videoRef.current;
54
54
  if (!video || !src) return;
@@ -59,7 +59,7 @@ function TestRecordingPlayer({
59
59
  (_a2 = video.play()) == null ? void 0 : _a2.catch(() => {
60
60
  });
61
61
  }, [src, seekNonce]);
62
- const handleLoadedMetadata = react.useCallback((event) => {
62
+ const handleLoadedMetadata = require$$0.useCallback((event) => {
63
63
  const pending = pendingSeekRef.current;
64
64
  pendingSeekRef.current = null;
65
65
  if (pending !== null) event.currentTarget.currentTime = pending;
@@ -233,11 +233,11 @@ function TestRow({ test, onSeek }) {
233
233
  ] });
234
234
  }
235
235
  function TestRecordingReportCard({ report, className }) {
236
- const [playback, setPlayback] = react.useState(IDLE_PLAYBACK);
237
- const play = react.useCallback(() => {
236
+ const [playback, setPlayback] = require$$0.useState(IDLE_PLAYBACK);
237
+ const play = require$$0.useCallback(() => {
238
238
  setPlayback((previous) => ({ ...previous, requested: true }));
239
239
  }, []);
240
- const seek = react.useCallback((time) => {
240
+ const seek = require$$0.useCallback((time) => {
241
241
  setPlayback((previous) => {
242
242
  var _a;
243
243
  return {
@@ -246,7 +246,7 @@ function TestRecordingReportCard({ report, className }) {
246
246
  };
247
247
  });
248
248
  }, []);
249
- const athenaConfig = react.useContext(AthenaContext.AthenaContext);
249
+ const athenaConfig = require$$0.useContext(AthenaContext.AthenaContext);
250
250
  const playableAssetId = athenaConfig ? report.assetId : null;
251
251
  const onSeek = playableAssetId ? seek : null;
252
252
  const hasFailures = report.failed > 0;
@@ -340,7 +340,7 @@ const TestRecordingStopToolUIImpl = ({
340
340
  }) => {
341
341
  const typedArgs = argsRecord(args);
342
342
  const titleArg = argString(typedArgs, "title");
343
- const parsed = react.useMemo(
343
+ const parsed = require$$0.useMemo(
344
344
  () => testRecordingReport.parseTestRecordingStopResult(result, { fallbackTitle: titleArg }),
345
345
  [result, titleArg]
346
346
  );
@@ -363,7 +363,7 @@ const TestRecordingStopToolUIImpl = ({
363
363
  }
364
364
  );
365
365
  };
366
- const TestRecordingStopToolUI = react.memo(
366
+ const TestRecordingStopToolUI = require$$0.memo(
367
367
  TestRecordingStopToolUIImpl
368
368
  );
369
369
  TestRecordingStopToolUI.displayName = "TestRecordingStopToolUI";
@@ -401,7 +401,7 @@ function TestRecordingRow({
401
401
  );
402
402
  }
403
403
  const TestRecordingStartToolUIImpl = ({ args, result, status }) => {
404
- const start = react.useMemo(
404
+ const start = require$$0.useMemo(
405
405
  () => testRecordingReport.describeTestRecordingStart({ args: argsRecord(args), result }),
406
406
  [args, result]
407
407
  );
@@ -424,7 +424,7 @@ const TestRecordingStartToolUIImpl = ({ args, result, status }) => {
424
424
  }
425
425
  );
426
426
  };
427
- const TestRecordingStartToolUI = react.memo(
427
+ const TestRecordingStartToolUI = require$$0.memo(
428
428
  TestRecordingStartToolUIImpl
429
429
  );
430
430
  TestRecordingStartToolUI.displayName = "TestRecordingStartToolUI";
@@ -461,7 +461,7 @@ const UNKNOWN_MARK_ROW = {
461
461
  labelClassName: "text-muted-foreground"
462
462
  };
463
463
  const TestRecordingMarkToolUIImpl = ({ args, result, status }) => {
464
- const mark = react.useMemo(
464
+ const mark = require$$0.useMemo(
465
465
  () => testRecordingReport.describeTestRecordingMark({ args: argsRecord(args), result }),
466
466
  [args, result]
467
467
  );
@@ -487,7 +487,7 @@ const TestRecordingMarkToolUIImpl = ({ args, result, status }) => {
487
487
  }
488
488
  );
489
489
  };
490
- const TestRecordingMarkToolUI = react.memo(
490
+ const TestRecordingMarkToolUI = require$$0.memo(
491
491
  TestRecordingMarkToolUIImpl
492
492
  );
493
493
  TestRecordingMarkToolUI.displayName = "TestRecordingMarkToolUI";