@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":"user-edit-composer.cjs","sources":["../../../src/chat-ui/messages/user-edit-composer.tsx"],"sourcesContent":["import { ComposerPrimitive, useAuiState } from \"@assistant-ui/react\";\nimport {\n CHAT_EDIT_KEPT_MESSAGE,\n ChatEditUnreachableError,\n useChatOutboxReachable,\n useDeepAgentChatOutboxContext,\n useDeepAgentMessageEditSubmit,\n} from \"@athenaintel/agent-runtime\";\nimport { type FC, type KeyboardEvent, useState } from \"react\";\n\n/**\n * Rendered in place of a user message while it is being edited (entered via\n * the action bar's Edit control, which seeds this composer with the message\n * text). Sending leaves as a `run/edit` anchored on the host's own parent of\n * the message (`useDeepAgentMessageEditSubmit`) — on a windowed wire the\n * lane's `anchorBefore` at the window edge — so the rewind is never rejected\n * `wrong-anchor` the way the library's converted-message anchor is after a\n * chunked assistant turn; Escape/Cancel exits edit mode. An edit submitted\n * while the host's chat outbox says Athena can't be reached is refused: the\n * draft stays here and the composer says why until Athena answers again.\n */\nexport const UserEditComposer: FC = () => {\n const submit = useDeepAgentMessageEditSubmit();\n const isEmpty = useAuiState((s) => s.message.composer.isEmpty);\n const reachable = useChatOutboxReachable(useDeepAgentChatOutboxContext());\n const [refused, setRefused] = useState(false);\n const send = () => {\n setRefused(false);\n submit().catch((error: unknown) => {\n if (!(error instanceof ChatEditUnreachableError)) throw error;\n setRefused(true);\n });\n };\n const onKeyDown = (event: KeyboardEvent<HTMLTextAreaElement>) => {\n if (event.key !== \"Enter\" || event.shiftKey || event.nativeEvent.isComposing) return;\n event.preventDefault();\n send();\n };\n return (\n <div className=\"mb-3 flex justify-end\" data-testid=\"chat-user-edit-composer\">\n <ComposerPrimitive.Root className=\"flex w-full max-w-[85%] flex-col gap-2 rounded-2xl rounded-br-md border border-border bg-muted px-3.5 py-2.5\">\n <ComposerPrimitive.Input\n autoFocus\n submitMode=\"none\"\n onKeyDown={onKeyDown}\n className=\"w-full resize-none bg-transparent text-sm text-foreground outline-none placeholder:text-muted-foreground\"\n />\n {refused && !reachable && (\n <p role=\"status\" data-testid=\"chat-user-edit-refused\" className=\"text-xs text-muted-foreground\">\n {CHAT_EDIT_KEPT_MESSAGE}\n </p>\n )}\n <div className=\"flex items-center justify-end gap-1.5\">\n <ComposerPrimitive.Cancel asChild>\n <button\n type=\"button\"\n className=\"rounded-lg px-2.5 py-1 text-xs font-medium text-muted-foreground transition-colors hover:bg-accent hover:text-foreground\"\n >\n Cancel\n </button>\n </ComposerPrimitive.Cancel>\n <button\n type=\"button\"\n data-testid=\"chat-user-edit-send\"\n disabled={isEmpty}\n onClick={send}\n className=\"rounded-lg bg-foreground px-2.5 py-1 text-xs font-medium text-background shadow-sm transition-colors hover:bg-foreground/80 disabled:cursor-not-allowed disabled:opacity-60\"\n >\n Send\n </button>\n </div>\n </ComposerPrimitive.Root>\n </div>\n );\n};\n"],"names":["useDeepAgentMessageEditSubmit","useAuiState","useChatOutboxReachable","useDeepAgentChatOutboxContext","useState","ChatEditUnreachableError","jsx","jsxs","ComposerPrimitive","CHAT_EDIT_KEPT_MESSAGE"],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;AAAAA,QAAC;AAAA,QAAA;AAAA,UACC,MAAK;AAAA,UACL,eAAY;AAAA,UACZ,UAAU;AAAA,UACV,SAAS;AAAA,UACT,WAAU;AAAA,UACX,UAAA;AAAA,QAAA;AAAA,MAAA;AAAA,IAED,EAAA,CACF;AAAA,EAAA,EAAA,CACF,EAAA,CACF;AAEJ;;"}
1
+ {"version":3,"file":"user-edit-composer.cjs","sources":["../../../src/chat-ui/messages/user-edit-composer.tsx"],"sourcesContent":["import { ComposerPrimitive, useAuiState } from \"@assistant-ui/react\";\nimport {\n CHAT_EDIT_KEPT_MESSAGE,\n ChatEditUnreachableError,\n useChatOutboxReachable,\n useDeepAgentChatOutboxContext,\n useDeepAgentMessageEditSubmit,\n} from \"@athenaintel/agent-runtime\";\nimport { type FC, type KeyboardEvent, useState } from \"react\";\n\n/**\n * Rendered in place of a user message while it is being edited (entered via\n * the action bar's Edit control, which seeds this composer with the message\n * text). Sending leaves as a `run/edit` anchored on the host's own parent of\n * the message (`useDeepAgentMessageEditSubmit`) — on a windowed wire the\n * lane's `anchorBefore` at the window edge — so the rewind is never rejected\n * `wrong-anchor` the way the library's converted-message anchor is after a\n * chunked assistant turn; Escape/Cancel exits edit mode. An edit submitted\n * while the host's chat outbox says Athena can't be reached is refused: the\n * draft stays here and the composer says why until Athena answers again.\n */\nexport const UserEditComposer: FC = () => {\n const submit = useDeepAgentMessageEditSubmit();\n const isEmpty = useAuiState((s) => s.message.composer.isEmpty);\n const reachable = useChatOutboxReachable(useDeepAgentChatOutboxContext());\n const [refused, setRefused] = useState(false);\n const send = () => {\n setRefused(false);\n submit().catch((error: unknown) => {\n if (!(error instanceof ChatEditUnreachableError)) throw error;\n setRefused(true);\n });\n };\n const onKeyDown = (event: KeyboardEvent<HTMLTextAreaElement>) => {\n if (event.key !== \"Enter\" || event.shiftKey || event.nativeEvent.isComposing) return;\n event.preventDefault();\n send();\n };\n return (\n <div className=\"mb-3 flex justify-end\" data-testid=\"chat-user-edit-composer\">\n <ComposerPrimitive.Root className=\"flex w-full max-w-[85%] flex-col gap-2 rounded-2xl rounded-br-md border border-border bg-muted px-3.5 py-2.5\">\n <ComposerPrimitive.Input\n autoFocus\n submitMode=\"none\"\n onKeyDown={onKeyDown}\n className=\"w-full resize-none bg-transparent text-sm text-foreground outline-none placeholder:text-muted-foreground\"\n />\n {refused && !reachable && (\n <p role=\"status\" data-testid=\"chat-user-edit-refused\" className=\"text-xs text-muted-foreground\">\n {CHAT_EDIT_KEPT_MESSAGE}\n </p>\n )}\n <div className=\"flex items-center justify-end gap-1.5\">\n <ComposerPrimitive.Cancel asChild>\n <button\n type=\"button\"\n className=\"rounded-lg px-2.5 py-1 text-xs font-medium text-muted-foreground transition-colors hover:bg-accent hover:text-foreground\"\n >\n Cancel\n </button>\n </ComposerPrimitive.Cancel>\n <button\n type=\"button\"\n data-testid=\"chat-user-edit-send\"\n disabled={isEmpty}\n onClick={send}\n className=\"rounded-lg bg-foreground px-2.5 py-1 text-xs font-medium text-background shadow-sm transition-colors hover:bg-foreground/80 disabled:cursor-not-allowed disabled:opacity-60\"\n >\n Send\n </button>\n </div>\n </ComposerPrimitive.Root>\n </div>\n );\n};\n"],"names":["useDeepAgentMessageEditSubmit","useAuiState","useChatOutboxReachable","useDeepAgentChatOutboxContext","useState","ChatEditUnreachableError","jsx","jsxs","ComposerPrimitive","CHAT_EDIT_KEPT_MESSAGE"],"mappings":";;;;;;;;AAqBO,MAAM,mBAAuB,MAAM;AACxC,QAAM,SAASA,uBAAAA,8BAAA;AACf,QAAM,UAAUC,MAAAA,YAAY,CAAC,MAAM,EAAE,QAAQ,SAAS,OAAO;AAC7D,QAAM,YAAYC,8CAAuBC,uBAAAA,+BAA+B;AACxE,QAAM,CAAC,SAAS,UAAU,IAAIC,WAAAA,SAAS,KAAK;AAC5C,QAAM,OAAO,MAAM;AACjB,eAAW,KAAK;AAChB,WAAA,EAAS,MAAM,CAAC,UAAmB;AACjC,UAAI,EAAE,iBAAiBC,qCAA2B,OAAM;AACxD,iBAAW,IAAI;AAAA,IACjB,CAAC;AAAA,EACH;AACA,QAAM,YAAY,CAAC,UAA8C;AAC/D,QAAI,MAAM,QAAQ,WAAW,MAAM,YAAY,MAAM,YAAY,YAAa;AAC9E,UAAM,eAAA;AACN,SAAA;AAAA,EACF;AACA,SACEC,2BAAAA,IAAC,OAAA,EAAI,WAAU,yBAAwB,eAAY,2BACjD,UAAAC,2BAAAA,KAACC,MAAAA,kBAAkB,MAAlB,EAAuB,WAAU,gHAChC,UAAA;AAAA,IAAAF,2BAAAA;AAAAA,MAACE,MAAAA,kBAAkB;AAAA,MAAlB;AAAA,QACC,WAAS;AAAA,QACT,YAAW;AAAA,QACX;AAAA,QACA,WAAU;AAAA,MAAA;AAAA,IAAA;AAAA,IAEX,WAAW,CAAC,aACXF,2BAAAA,IAAC,KAAA,EAAE,MAAK,UAAS,eAAY,0BAAyB,WAAU,iCAC7D,UAAAG,WAAAA,uBAAA,CACH;AAAA,IAEFF,2BAAAA,KAAC,OAAA,EAAI,WAAU,yCACb,UAAA;AAAA,MAAAD,2BAAAA,IAACE,MAAAA,kBAAkB,QAAlB,EAAyB,SAAO,MAC/B,UAAAF,2BAAAA;AAAAA,QAAC;AAAA,QAAA;AAAA,UACC,MAAK;AAAA,UACL,WAAU;AAAA,UACX,UAAA;AAAA,QAAA;AAAA,MAAA,GAGH;AAAA,MACAA,2BAAAA;AAAAA,QAAC;AAAA,QAAA;AAAA,UACC,MAAK;AAAA,UACL,eAAY;AAAA,UACZ,UAAU;AAAA,UACV,SAAS;AAAA,UACT,WAAU;AAAA,UACX,UAAA;AAAA,QAAA;AAAA,MAAA;AAAA,IAED,EAAA,CACF;AAAA,EAAA,EAAA,CACF,EAAA,CACF;AAEJ;;"}
@@ -3,7 +3,7 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
3
  const jsxRuntime = require("react/jsx-runtime");
4
4
  const react = require("@assistant-ui/react");
5
5
  const lucideReact = require("lucide-react");
6
- const react$1 = require("react");
6
+ const require$$0 = require("react");
7
7
  const githubWakeEvent = require("../../agent-runtime/src/github-wake-event.cjs");
8
8
  const subscriptionWakeEvent = require("../../agent-runtime/src/subscription-wake-event.cjs");
9
9
  const cnfast = require("cnfast");
@@ -90,8 +90,8 @@ const WakeMarkerMessage = ({ className }) => {
90
90
  var _a;
91
91
  return (_a = s.message.metadata) == null ? void 0 : _a.custom;
92
92
  });
93
- const subscription = react$1.useMemo(() => subscriptionWakeEvent.readSubscriptionWakeEvent(custom), [custom]);
94
- const github = react$1.useMemo(() => githubWakeEvent.readGithubWakeEvent(custom), [custom]);
93
+ const subscription = require$$0.useMemo(() => subscriptionWakeEvent.readSubscriptionWakeEvent(custom), [custom]);
94
+ const github = require$$0.useMemo(() => githubWakeEvent.readGithubWakeEvent(custom), [custom]);
95
95
  if (subscription) {
96
96
  return /* @__PURE__ */ jsxRuntime.jsx(SubscriptionWakeMarkerCard, { event: subscription, className });
97
97
  }
@@ -1 +1 @@
1
- {"version":3,"file":"wake-marker.cjs","sources":["../../../src/chat-ui/messages/wake-marker.tsx"],"sourcesContent":["/**\n * The runtime marker for a wake turn: a GitHub webhook woke the session and\n * injected a user message (see `@athenaintel/agent-runtime`'s\n * `github-wake-event.ts`), or an asset subscription delivered an event\n * (`subscription-wake-event.ts`). It renders in the same visual language as\n * the runtime-ending card (`RuntimeMessageCard`) — a compact status row, not a\n * user bubble quoting the whole wake text.\n */\nimport { useAuiState } from \"@assistant-ui/react\";\nimport {\n type GithubWakeEvent,\n githubWakeEventLabel,\n githubWakeReference,\n readGithubWakeEvent,\n readSubscriptionWakeEvent,\n type SubscriptionWakeEvent,\n subscriptionWakeDetail,\n subscriptionWakeHeadline,\n} from \"@athenaintel/agent-runtime\";\nimport { AlarmClockIcon, BellIcon, GitPullRequestIcon } from \"lucide-react\";\nimport { type ComponentPropsWithoutRef, type FC, useMemo } from \"react\";\nimport { cn } from \"../../lib/utils\";\n\nexport interface WakeMarkerCardProps\n extends Omit<ComponentPropsWithoutRef<\"div\">, \"children\" | \"role\"> {\n event: GithubWakeEvent;\n}\n\n/** The \"Woke: review comment on #36337\" row; pure presenter. */\nexport const WakeMarkerCard: FC<WakeMarkerCardProps> = ({ event, className, ...rest }) => {\n const target = event.number !== null ? `#${event.number}` : event.repo;\n const reference = githubWakeReference(event);\n return (\n <div\n {...rest}\n role=\"status\"\n data-runtime-message-kind=\"wake\"\n data-testid=\"wake-marker\"\n className={cn(\n \"my-2 flex w-full items-start gap-2 rounded-lg border border-border bg-muted/40 px-3 py-2 text-muted-foreground text-sm\",\n className,\n )}\n >\n <GitPullRequestIcon className=\"mt-0.5 size-4 shrink-0\" aria-hidden=\"true\" />\n <div className=\"flex min-w-0 flex-1 flex-col gap-0.5 [overflow-wrap:anywhere]\">\n <span className=\"font-medium\">\n Woke: {githubWakeEventLabel(event)} on{\" \"}\n {event.url ? (\n <a\n href={event.url}\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n title={event.title ?? reference}\n className=\"underline-offset-2 hover:underline\"\n >\n {target}\n </a>\n ) : (\n <span title={event.title ?? reference}>{target}</span>\n )}\n </span>\n {event.sender || event.title ? (\n <span className=\"text-xs opacity-90\">\n {event.sender ? `by ${event.sender}` : null}\n {event.sender && event.title ? \" · \" : null}\n {event.title}\n </span>\n ) : null}\n {event.bodyExcerpt ? (\n <span className=\"truncate text-xs italic opacity-90\" title={event.bodyExcerpt}>\n “{event.bodyExcerpt}”\n </span>\n ) : null}\n </div>\n </div>\n );\n};\n\nexport interface SubscriptionWakeMarkerCardProps\n extends Omit<ComponentPropsWithoutRef<\"div\">, \"children\" | \"role\"> {\n event: SubscriptionWakeEvent;\n}\n\n/**\n * An asset subscription's delivery: \"Brendon Geils set B4 to Target\" over\n * \"Series A Investors · subscribed to B2:B11 · 99 runs left\", or \"Scheduled\n * check-in you set on Oct 8\" over its note. The text the agent received\n * stays the message; this is what a person sees. Pure presenter.\n */\nexport const SubscriptionWakeMarkerCard: FC<SubscriptionWakeMarkerCardProps> = ({\n event,\n className,\n ...rest\n}) => {\n const Icon = event.kind === \"schedule\" ? AlarmClockIcon : BellIcon;\n const detail = subscriptionWakeDetail(event);\n return (\n <div\n {...rest}\n role=\"status\"\n data-runtime-message-kind=\"wake\"\n data-wake-source=\"subscription\"\n data-testid=\"wake-marker\"\n className={cn(\n \"my-2 flex w-full items-start gap-2 rounded-lg border border-border bg-muted/40 px-3 py-2 text-muted-foreground text-sm\",\n className,\n )}\n >\n <Icon className=\"mt-0.5 size-4 shrink-0\" aria-hidden=\"true\" />\n <div className=\"flex min-w-0 flex-1 flex-col gap-0.5 [overflow-wrap:anywhere]\">\n <span className=\"font-medium\">{subscriptionWakeHeadline({ event })}</span>\n {detail ? <span className=\"text-xs opacity-90\">{detail}</span> : null}\n </div>\n </div>\n );\n};\n\n/**\n * The wake marker for the assistant-ui message in scope — a subscription's\n * delivery or a GitHub wake, whichever envelope it carries. Selects the\n * message's `metadata.custom` (a stable store reference) and derives the\n * envelope from it: the readers allocate a fresh object per call, so\n * selecting their result directly would re-render on every store update.\n */\nexport const WakeMarkerMessage: FC<{ className?: string }> = ({ className }) => {\n const custom = useAuiState((s) => s.message.metadata?.custom);\n const subscription = useMemo(() => readSubscriptionWakeEvent(custom), [custom]);\n const github = useMemo(() => readGithubWakeEvent(custom), [custom]);\n if (subscription) {\n return <SubscriptionWakeMarkerCard event={subscription} className={className} />;\n }\n if (github) return <WakeMarkerCard event={github} className={className} />;\n return null;\n};\n"],"names":["githubWakeReference","jsxs","cn","jsx","GitPullRequestIcon","githubWakeEventLabel","AlarmClockIcon","BellIcon","subscriptionWakeDetail","useAuiState","useMemo","readSubscriptionWakeEvent","readGithubWakeEvent"],"mappings":";;;;;;;;;AA6BO,MAAM,iBAA0C,CAAC,EAAE,OAAO,WAAW,GAAG,WAAW;AACxF,QAAM,SAAS,MAAM,WAAW,OAAO,IAAI,MAAM,MAAM,KAAK,MAAM;AAClE,QAAM,YAAYA,gBAAAA,oBAAoB,KAAK;AAC3C,S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/chat-ui/messages/wake-marker.tsx"],"sourcesContent":["/**\n * The runtime marker for a wake turn: a GitHub webhook woke the session and\n * injected a user message (see `@athenaintel/agent-runtime`'s\n * `github-wake-event.ts`), or an asset subscription delivered an event\n * (`subscription-wake-event.ts`). It renders in the same visual language as\n * the runtime-ending card (`RuntimeMessageCard`) — a compact status row, not a\n * user bubble quoting the whole wake text.\n */\nimport { useAuiState } from \"@assistant-ui/react\";\nimport {\n type GithubWakeEvent,\n githubWakeEventLabel,\n githubWakeReference,\n readGithubWakeEvent,\n readSubscriptionWakeEvent,\n type SubscriptionWakeEvent,\n subscriptionWakeDetail,\n subscriptionWakeHeadline,\n} from \"@athenaintel/agent-runtime\";\nimport { AlarmClockIcon, BellIcon, GitPullRequestIcon } from \"lucide-react\";\nimport { type ComponentPropsWithoutRef, type FC, useMemo } from \"react\";\nimport { cn } from \"../../lib/utils\";\n\nexport interface WakeMarkerCardProps\n extends Omit<ComponentPropsWithoutRef<\"div\">, \"children\" | \"role\"> {\n event: GithubWakeEvent;\n}\n\n/** The \"Woke: review comment on #36337\" row; pure presenter. */\nexport const WakeMarkerCard: FC<WakeMarkerCardProps> = ({ event, className, ...rest }) => {\n const target = event.number !== null ? `#${event.number}` : event.repo;\n const reference = githubWakeReference(event);\n return (\n <div\n {...rest}\n role=\"status\"\n data-runtime-message-kind=\"wake\"\n data-testid=\"wake-marker\"\n className={cn(\n \"my-2 flex w-full items-start gap-2 rounded-lg border border-border bg-muted/40 px-3 py-2 text-muted-foreground text-sm\",\n className,\n )}\n >\n <GitPullRequestIcon className=\"mt-0.5 size-4 shrink-0\" aria-hidden=\"true\" />\n <div className=\"flex min-w-0 flex-1 flex-col gap-0.5 [overflow-wrap:anywhere]\">\n <span className=\"font-medium\">\n Woke: {githubWakeEventLabel(event)} on{\" \"}\n {event.url ? (\n <a\n href={event.url}\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n title={event.title ?? reference}\n className=\"underline-offset-2 hover:underline\"\n >\n {target}\n </a>\n ) : (\n <span title={event.title ?? reference}>{target}</span>\n )}\n </span>\n {event.sender || event.title ? (\n <span className=\"text-xs opacity-90\">\n {event.sender ? `by ${event.sender}` : null}\n {event.sender && event.title ? \" · \" : null}\n {event.title}\n </span>\n ) : null}\n {event.bodyExcerpt ? (\n <span className=\"truncate text-xs italic opacity-90\" title={event.bodyExcerpt}>\n “{event.bodyExcerpt}”\n </span>\n ) : null}\n </div>\n </div>\n );\n};\n\nexport interface SubscriptionWakeMarkerCardProps\n extends Omit<ComponentPropsWithoutRef<\"div\">, \"children\" | \"role\"> {\n event: SubscriptionWakeEvent;\n}\n\n/**\n * An asset subscription's delivery: \"Brendon Geils set B4 to Target\" over\n * \"Series A Investors · subscribed to B2:B11 · 99 runs left\", or \"Scheduled\n * check-in you set on Oct 8\" over its note. The text the agent received\n * stays the message; this is what a person sees. Pure presenter.\n */\nexport const SubscriptionWakeMarkerCard: FC<SubscriptionWakeMarkerCardProps> = ({\n event,\n className,\n ...rest\n}) => {\n const Icon = event.kind === \"schedule\" ? AlarmClockIcon : BellIcon;\n const detail = subscriptionWakeDetail(event);\n return (\n <div\n {...rest}\n role=\"status\"\n data-runtime-message-kind=\"wake\"\n data-wake-source=\"subscription\"\n data-testid=\"wake-marker\"\n className={cn(\n \"my-2 flex w-full items-start gap-2 rounded-lg border border-border bg-muted/40 px-3 py-2 text-muted-foreground text-sm\",\n className,\n )}\n >\n <Icon className=\"mt-0.5 size-4 shrink-0\" aria-hidden=\"true\" />\n <div className=\"flex min-w-0 flex-1 flex-col gap-0.5 [overflow-wrap:anywhere]\">\n <span className=\"font-medium\">{subscriptionWakeHeadline({ event })}</span>\n {detail ? <span className=\"text-xs opacity-90\">{detail}</span> : null}\n </div>\n </div>\n );\n};\n\n/**\n * The wake marker for the assistant-ui message in scope — a subscription's\n * delivery or a GitHub wake, whichever envelope it carries. Selects the\n * message's `metadata.custom` (a stable store reference) and derives the\n * envelope from it: the readers allocate a fresh object per call, so\n * selecting their result directly would re-render on every store update.\n */\nexport const WakeMarkerMessage: FC<{ className?: string }> = ({ className }) => {\n const custom = useAuiState((s) => s.message.metadata?.custom);\n const subscription = useMemo(() => readSubscriptionWakeEvent(custom), [custom]);\n const github = useMemo(() => readGithubWakeEvent(custom), [custom]);\n if (subscription) {\n return <SubscriptionWakeMarkerCard event={subscription} className={className} />;\n }\n if (github) return <WakeMarkerCard event={github} className={className} />;\n return null;\n};\n"],"names":["githubWakeReference","jsxs","cn","jsx","GitPullRequestIcon","githubWakeEventLabel","AlarmClockIcon","BellIcon","subscriptionWakeDetail","useAuiState","useMemo","readSubscriptionWakeEvent","readGithubWakeEvent"],"mappings":";;;;;;;;;AA6BO,MAAM,iBAA0C,CAAC,EAAE,OAAO,WAAW,GAAG,WAAW;AACxF,QAAM,SAAS,MAAM,WAAW,OAAO,IAAI,MAAM,MAAM,KAAK,MAAM;AAClE,QAAM,YAAYA,gBAAAA,oBAAoB,KAAK;AAC3C,SACEC,2BAAAA;AAAAA,IAAC;AAAA,IAAA;AAAA,MACE,GAAG;AAAA,MACJ,MAAK;AAAA,MACL,6BAA0B;AAAA,MAC1B,eAAY;AAAA,MACZ,WAAWC,OAAAA;AAAAA,QACT;AAAA,QACA;AAAA,MAAA;AAAA,MAGF,UAAA;AAAA,QAAAC,2BAAAA,IAACC,YAAAA,oBAAA,EAAmB,WAAU,0BAAyB,eAAY,QAAO;AAAA,QAC1EH,2BAAAA,KAAC,OAAA,EAAI,WAAU,iEACb,UAAA;AAAA,UAAAA,2BAAAA,KAAC,QAAA,EAAK,WAAU,eAAc,UAAA;AAAA,YAAA;AAAA,YACrBI,gBAAAA,qBAAqB,KAAK;AAAA,YAAE;AAAA,YAAI;AAAA,YACtC,MAAM,MACLF,2BAAAA;AAAAA,cAAC;AAAA,cAAA;AAAA,gBACC,MAAM,MAAM;AAAA,gBACZ,QAAO;AAAA,gBACP,KAAI;AAAA,gBACJ,OAAO,MAAM,SAAS;AAAA,gBACtB,WAAU;AAAA,gBAET,UAAA;AA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AA,EAAA,CACnE;AAAA,MAAA;AAAA,IAAA;AAAA,EAAA;AAGN;AASO,MAAM,oBAAgD,CAAC,EAAE,gBAAgB;AAC9E,QAAM,SAASM,MAAAA,YAAY,CAAC;;AAAM,mBAAE,QAAQ,aAAV,mBAAoB;AAAA,GAAM;AAC5D,QAAM,eAAeC,WAAAA,QAAQ,MAAMC,sBAAAA,0BAA0B,MAAM,GAAG,CAAC,MAAM,CAAC;AAC9E,QAAM,SAASD,WAAAA,QAAQ,MAAME,gBAAAA,oBAAoB,MAAM,GAAG,CAAC,MAAM,CAAC;AAClE,MAAI,cAAc;AAChB,WAAOT,2BAAAA,IAAC,4BAAA,EAA2B,OAAO,cAAc,UAAA,CAAsB;AAAA,EAChF;AACA,MAAI,OAAQ,QAAOA,+BAAC,gBAAA,EAAe,OAAO,QAAQ,WAAsB;AACxE,SAAO;AACT;;;;"}
@@ -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 mentionChip = require("../mentions/mention-chip.cjs");
7
7
  const citationAnchors = require("./citation-anchors.cjs");
8
8
  const cnfast = require("cnfast");
@@ -39,7 +39,7 @@ function SourceChip({
39
39
  );
40
40
  }
41
41
  function SourceFavicon({ href }) {
42
- const [failed, setFailed] = react.useState(false);
42
+ const [failed, setFailed] = require$$0.useState(false);
43
43
  const src = failed ? null : citationAnchors.sourceFaviconUrl(href);
44
44
  if (!src) {
45
45
  return /* @__PURE__ */ jsxRuntime.jsx(
@@ -1 +1 @@
1
- {"version":3,"file":"chat-link.cjs","sources":["../../../src/chat-ui/rich-text/chat-link.tsx"],"sourcesContent":["import { Globe2Icon } from \"lucide-react\";\nimport { type ReactNode, useState } from \"react\";\nimport { CHIP_ICON_CLASS, CHIP_LINK_CLASS, CHIP_PILL_CLASS, MentionLink } from \"../mentions/mention-chip\";\nimport { cn } from \"../../lib/utils\";\nimport {\n buildScrollToTextUrl,\n isWebHref,\n sourceFaviconUrl,\n} from \"./citation-anchors\";\n\n/**\n * A link mark of the static message body. A web source the model cited with\n * an excerpt renders as a source chip; everything else goes through\n * `MentionLink`, which draws mention and Spaces hrefs as asset chips,\n * screen points as coordinate chips, and the rest as a plain link.\n */\nexport function ChatLink({\n href,\n excerpt,\n children,\n}: {\n href: string | null | undefined;\n excerpt?: string | null;\n children: ReactNode;\n}) {\n if (href && excerpt && isWebHref(href)) {\n return (\n <SourceChip href={href} excerpt={excerpt}>\n {children}\n </SourceChip>\n );\n }\n return <MentionLink href={href ?? undefined}>{children}</MentionLink>;\n}\n\n/**\n * A cited web page: the site's favicon, the model's label, the excerpt as\n * the tooltip, opening the page at the excerpt (scroll-to-text) in a new tab.\n * The asset mention chip's pill (`CHIP_PILL_CLASS`), so a sentence that cites\n * a PDF and a web page reads as one row of sources.\n */\nexport function SourceChip({\n href,\n excerpt,\n children,\n}: {\n href: string;\n excerpt: string;\n children: ReactNode;\n}) {\n return (\n <a\n href={buildScrollToTextUrl(href, excerpt)}\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n title={excerpt}\n data-chat-source=\"\"\n data-excerpt={excerpt}\n className={cn(CHIP_PILL_CLASS, \"max-w-[240px]\", CHIP_LINK_CLASS)}\n >\n <SourceFavicon href={href} />\n <span className=\"min-w-0 max-w-[200px] overflow-hidden text-ellipsis\">\n {children}\n </span>\n </a>\n );\n}\n\n/** The site's favicon; a globe once the favicon service has no icon for the host. */\nfunction SourceFavicon({ href }: { href: string }) {\n const [failed, setFailed] = useState(false);\n const src = failed ? null : sourceFaviconUrl(href);\n if (!src) {\n return (\n <Globe2Icon\n className={cn(CHIP_ICON_CLASS, \"text-muted-foreground\")}\n aria-hidden=\"true\"\n />\n );\n }\n return (\n <img\n src={src}\n alt=\"\"\n width={14}\n height={14}\n className={cn(CHIP_ICON_CLASS, \"rounded-[3px]\")}\n loading=\"lazy\"\n referrerPolicy=\"no-referrer\"\n draggable={false}\n onError={() => setFailed(true)}\n />\n );\n}\n"],"names":["isWebHref","jsx","MentionLink","jsxs","buildScrollToTextUrl","cn","CHIP_PILL_CLASS","CHIP_LINK_CLASS","useState","sourceFaviconUrl","Globe2Icon","CHIP_ICON_CLASS"],"mappings":";;;;;;;;AAgBO,SAAS,SAAS;AAAA,EACvB;AAAA,EACA;AAAA,EACA;AACF,GAIG;AACD,MAAI,QAAQ,WAAWA,gBAAAA,UAAU,IAAI,GAAG;AACtC,WACEC,2BAAAA,IAAC,YAAA,EAAW,MAAY,SACrB,SAAA,CACH;AAAA,EAEJ;AACA,SAAOA,2BAAAA,IAACC,YAAAA,aAAA,EAAY,MAAM,QAAQ,QAAY,UAAS;AACzD;AAQO,SAAS,WAAW;AAAA,EACzB;AAAA,EACA;AAAA,EACA;AACF,GAIG;AACD,SACEC,2BAAAA;AAAAA,IAAC;AAAA,IAAA;AAAA,MACC,MAAMC,gBAAAA,qBAAqB,MAAM,OAAO;AAAA,MACxC,QAAO;AAAA,MACP,KAAI;AAAA,MACJ,OAAO;AAAA,MACP,oBAAiB;AAAA,MACjB,gBAAc;AAAA,MACd,WAAWC,OAAAA,GAAGC,6BAAiB,iBAAiBC,YAAAA,eAAe;AAAA,MAE/D,UAAA;AAAA,QAAAN,+BAAC,iBAAc,MAAY;AAAA,QAC3BA,2BAAAA,IAAC,QAAA,EAAK,WAAU,uDACb,SAAA,CACH;AAAA,MAAA;AAAA,IAAA;AAAA,EAAA;AAGN;AAGA,SAAS,cAAc,EAAE,QAA0B;AACjD,QAAM,CAAC,QAAQ,SAAS,IAAIO,MAAAA,SAAS,KAAK;AAC1C,QAAM,MAAM,SAAS,OAAOC,gBAAAA,iBAAiB,IAAI;AACjD,MAAI,CAAC,KAAK;AACR,WACER,2BAAAA;AAAAA,MAACS,YAAAA;AAAAA,MAAA;AAAA,QACC,WAAWL,OAAAA,GAAGM,YAAAA,iBAAiB,uBAAuB;AAAA,QACtD,eAAY;AAAA,MAAA;AAAA,IAAA;AAAA,EAGlB;AACA,SACEV,2BAAAA;AAAAA,IAAC;AAAA,IAAA;AAAA,MACC;AAAA,MACA,KAAI;AAAA,MACJ,OAAO;AAAA,MACP,QAAQ;AAAA,MACR,WAAWI,OAAAA,GAAGM,YAAAA,iBAAiB,eAAe;AAAA,MAC9C,SAAQ;AAAA,MACR,gBAAe;AAAA,MACf,WAAW;AAAA,MACX,SAAS,MAAM,UAAU,IAAI;AAAA,IAAA;AAAA,EAAA;AAGnC;;;"}
1
+ {"version":3,"file":"chat-link.cjs","sources":["../../../src/chat-ui/rich-text/chat-link.tsx"],"sourcesContent":["import { Globe2Icon } from \"lucide-react\";\nimport { type ReactNode, useState } from \"react\";\nimport { CHIP_ICON_CLASS, CHIP_LINK_CLASS, CHIP_PILL_CLASS, MentionLink } from \"../mentions/mention-chip\";\nimport { cn } from \"../../lib/utils\";\nimport {\n buildScrollToTextUrl,\n isWebHref,\n sourceFaviconUrl,\n} from \"./citation-anchors\";\n\n/**\n * A link mark of the static message body. A web source the model cited with\n * an excerpt renders as a source chip; everything else goes through\n * `MentionLink`, which draws mention and Spaces hrefs as asset chips,\n * screen points as coordinate chips, and the rest as a plain link.\n */\nexport function ChatLink({\n href,\n excerpt,\n children,\n}: {\n href: string | null | undefined;\n excerpt?: string | null;\n children: ReactNode;\n}) {\n if (href && excerpt && isWebHref(href)) {\n return (\n <SourceChip href={href} excerpt={excerpt}>\n {children}\n </SourceChip>\n );\n }\n return <MentionLink href={href ?? undefined}>{children}</MentionLink>;\n}\n\n/**\n * A cited web page: the site's favicon, the model's label, the excerpt as\n * the tooltip, opening the page at the excerpt (scroll-to-text) in a new tab.\n * The asset mention chip's pill (`CHIP_PILL_CLASS`), so a sentence that cites\n * a PDF and a web page reads as one row of sources.\n */\nexport function SourceChip({\n href,\n excerpt,\n children,\n}: {\n href: string;\n excerpt: string;\n children: ReactNode;\n}) {\n return (\n <a\n href={buildScrollToTextUrl(href, excerpt)}\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n title={excerpt}\n data-chat-source=\"\"\n data-excerpt={excerpt}\n className={cn(CHIP_PILL_CLASS, \"max-w-[240px]\", CHIP_LINK_CLASS)}\n >\n <SourceFavicon href={href} />\n <span className=\"min-w-0 max-w-[200px] overflow-hidden text-ellipsis\">\n {children}\n </span>\n </a>\n );\n}\n\n/** The site's favicon; a globe once the favicon service has no icon for the host. */\nfunction SourceFavicon({ href }: { href: string }) {\n const [failed, setFailed] = useState(false);\n const src = failed ? null : sourceFaviconUrl(href);\n if (!src) {\n return (\n <Globe2Icon\n className={cn(CHIP_ICON_CLASS, \"text-muted-foreground\")}\n aria-hidden=\"true\"\n />\n );\n }\n return (\n <img\n src={src}\n alt=\"\"\n width={14}\n height={14}\n className={cn(CHIP_ICON_CLASS, \"rounded-[3px]\")}\n loading=\"lazy\"\n referrerPolicy=\"no-referrer\"\n draggable={false}\n onError={() => setFailed(true)}\n />\n );\n}\n"],"names":["isWebHref","jsx","MentionLink","jsxs","buildScrollToTextUrl","cn","CHIP_PILL_CLASS","CHIP_LINK_CLASS","useState","sourceFaviconUrl","Globe2Icon","CHIP_ICON_CLASS"],"mappings":";;;;;;;;AAgBO,SAAS,SAAS;AAAA,EACvB;AAAA,EACA;AAAA,EACA;AACF,GAIG;AACD,MAAI,QAAQ,WAAWA,gBAAAA,UAAU,IAAI,GAAG;AACtC,WACEC,2BAAAA,IAAC,YAAA,EAAW,MAAY,SACrB,SAAA,CACH;AAAA,EAEJ;AACA,SAAOA,2BAAAA,IAACC,YAAAA,aAAA,EAAY,MAAM,QAAQ,QAAY,UAAS;AACzD;AAQO,SAAS,WAAW;AAAA,EACzB;AAAA,EACA;AAAA,EACA;AACF,GAIG;AACD,SACEC,2BAAAA;AAAAA,IAAC;AAAA,IAAA;AAAA,MACC,MAAMC,gBAAAA,qBAAqB,MAAM,OAAO;AAAA,MACxC,QAAO;AAAA,MACP,KAAI;AAAA,MACJ,OAAO;AAAA,MACP,oBAAiB;AAAA,MACjB,gBAAc;AAAA,MACd,WAAWC,OAAAA,GAAGC,6BAAiB,iBAAiBC,YAAAA,eAAe;AAAA,MAE/D,UAAA;AAAA,QAAAN,+BAAC,iBAAc,MAAY;AAAA,QAC3BA,2BAAAA,IAAC,QAAA,EAAK,WAAU,uDACb,SAAA,CACH;AAAA,MAAA;AAAA,IAAA;AAAA,EAAA;AAGN;AAGA,SAAS,cAAc,EAAE,QAA0B;AACjD,QAAM,CAAC,QAAQ,SAAS,IAAIO,WAAAA,SAAS,KAAK;AAC1C,QAAM,MAAM,SAAS,OAAOC,gBAAAA,iBAAiB,IAAI;AACjD,MAAI,CAAC,KAAK;AACR,WACER,2BAAAA;AAAAA,MAACS,YAAAA;AAAAA,MAAA;AAAA,QACC,WAAWL,OAAAA,GAAGM,YAAAA,iBAAiB,uBAAuB;AAAA,QACtD,eAAY;AAAA,MAAA;AAAA,IAAA;AAAA,EAGlB;AACA,SACEV,2BAAAA;AAAAA,IAAC;AAAA,IAAA;AAAA,MACC;AAAA,MACA,KAAI;AAAA,MACJ,OAAO;AAAA,MACP,QAAQ;AAAA,MACR,WAAWI,OAAAA,GAAGM,YAAAA,iBAAiB,eAAe;AAAA,MAC9C,SAAQ;AAAA,MACR,gBAAe;AAAA,MACf,WAAW;AAAA,MACX,SAAS,MAAM,UAAU,IAAI;AAAA,IAAA;AAAA,EAAA;AAGnC;;;"}
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
3
  const jsxRuntime = require("react/jsx-runtime");
4
- const react = require("react");
4
+ const require$$0 = require("react");
5
5
  const athenaCitationLinks = require("../../chat/athena-citation-links.cjs");
6
6
  const chatBlocks = require("./chat-blocks.cjs");
7
7
  const chatLink = require("./chat-link.cjs");
@@ -17,13 +17,13 @@ function ChatMessageBody({
17
17
  isRunning = false,
18
18
  typed = false
19
19
  }) {
20
- const hasDom = react.useSyncExternalStore(
20
+ const hasDom = require$$0.useSyncExternalStore(
21
21
  subscribe,
22
22
  browserSnapshot,
23
23
  serverSnapshot
24
24
  );
25
25
  const onClick = useChatLinkClick();
26
- const { blocks, definitions } = react.useMemo(
26
+ const { blocks, definitions } = require$$0.useMemo(
27
27
  () => chatBlocks.splitChatBlocks(text, { streaming: isRunning }),
28
28
  [text, isRunning]
29
29
  );
@@ -52,7 +52,7 @@ function ChatMessageBody({
52
52
  )
53
53
  );
54
54
  }
55
- const ChatBlock = react.memo(function ChatBlock2({
55
+ const ChatBlock = require$$0.memo(function ChatBlock2({
56
56
  text,
57
57
  definitions,
58
58
  openFence,
@@ -60,7 +60,7 @@ const ChatBlock = react.memo(function ChatBlock2({
60
60
  typed
61
61
  }) {
62
62
  const open = streaming ? openFence : null;
63
- const doc = react.useMemo(() => {
63
+ const doc = require$$0.useMemo(() => {
64
64
  if (open) return null;
65
65
  const markdown = definitions ? `${text}
66
66
 
@@ -87,7 +87,7 @@ function isEmptyDoc(doc) {
87
87
  }
88
88
  function useChatLinkClick() {
89
89
  const handleLinkClick = athenaCitationLinks.useAthenaLinkClickHandler();
90
- return react.useCallback(
90
+ return require$$0.useCallback(
91
91
  (event) => {
92
92
  if (event.button !== 0 || event.defaultPrevented || event.metaKey || event.ctrlKey || event.shiftKey || event.altKey) {
93
93
  return;
@@ -188,7 +188,7 @@ function renderMarkRuns(nodes, depth, tail) {
188
188
  const node = nodes[index];
189
189
  const mark = node.marks[depth];
190
190
  if (!mark) {
191
- children.push(/* @__PURE__ */ jsxRuntime.jsx(react.Fragment, { children: renderNode(node, tail) }, index));
191
+ children.push(/* @__PURE__ */ jsxRuntime.jsx(require$$0.Fragment, { children: renderNode(node, tail) }, index));
192
192
  index++;
193
193
  continue;
194
194
  }
@@ -198,7 +198,7 @@ function renderMarkRuns(nodes, depth, tail) {
198
198
  }
199
199
  const content = renderMarkRuns(nodes.slice(index, end), depth + 1, tail);
200
200
  const rendered = mark.type.name === "link" ? /* @__PURE__ */ jsxRuntime.jsx(chatLink.ChatLink, { href: mark.attrs.href, excerpt: mark.attrs.excerpt, children: content }) : mark.type.spec.toDOM ? domOutputSpec.renderDOMOutputSpec(mark.type.spec.toDOM(mark, true), content) : content;
201
- children.push(/* @__PURE__ */ jsxRuntime.jsx(react.Fragment, { children: rendered }, index));
201
+ children.push(/* @__PURE__ */ jsxRuntime.jsx(require$$0.Fragment, { children: rendered }, index));
202
202
  index = end;
203
203
  }
204
204
  return children;
@@ -1 +1 @@
1
- {"version":3,"file":"chat-message-body.cjs","sources":["../../../src/chat-ui/rich-text/chat-message-body.tsx"],"sourcesContent":["import type { Node as ProseMirrorNode } from \"@tiptap/pm/model\";\nimport {\n Fragment,\n memo,\n type MouseEvent,\n type ReactNode,\n useCallback,\n useMemo,\n useSyncExternalStore,\n} from \"react\";\nimport { useAthenaLinkClickHandler } from \"../../chat/athena-citation-links\";\nimport { type OpenFence, splitChatBlocks } from \"./chat-blocks\";\nimport { ChatLink } from \"./chat-link\";\nimport {\n ChatCodeBlock,\n ChatMention,\n StreamingCodeBlock,\n} from \"./chat-node-views\";\nimport {\n CHAT_TEXT_CLASS,\n parseChatText,\n parseTypedChatText,\n} from \"./chat-text-schema\";\nimport { renderDOMOutputSpec } from \"./dom-output-spec\";\n\nconst subscribe = () => () => {};\nconst browserSnapshot = () => true;\nconst serverSnapshot = () => false;\n\n/**\n * Render the composer's document schema through its own node/mark serializers.\n *\n * The text is split into its top-level blocks (`splitChatBlocks`), each parsed\n * and drawn by its own memoized component under one `CHAT_TEXT_CLASS`\n * wrapper. While a reply streams, only the trailing block re-parses with each\n * token; every finished block keeps its parse and its DOM. The trailing block\n * reveals its newest words with a settle tint and a caret, and a fenced code\n * block still being written renders as plain code until its fence closes.\n *\n * `typed` reads the text as a person typed it (`parseTypedChatText`: raw HTML\n * and underscore emphasis stay the characters they were typed with), for the\n * user bubble; assistant text keeps the full reading.\n */\nexport function ChatMessageBody({\n text,\n isRunning = false,\n typed = false,\n}: {\n text: string;\n isRunning?: boolean;\n typed?: boolean;\n}) {\n const hasDom = useSyncExternalStore(\n subscribe,\n browserSnapshot,\n serverSnapshot,\n );\n const onClick = useChatLinkClick();\n const { blocks, definitions } = useMemo(\n () => splitChatBlocks(text, { streaming: isRunning }),\n [text, isRunning],\n );\n return (\n // The click handler only delegates for the anchors inside, which are\n // themselves focusable and keyboard-operable; the wrapper is not a control.\n <div\n className={CHAT_TEXT_CLASS}\n data-chat-text=\"\"\n data-status={isRunning ? \"running\" : \"complete\"}\n onClick={onClick}\n >\n {hasDom\n ? blocks.map((block, index) => (\n <ChatBlock\n key={index}\n text={block.text}\n definitions={definitions}\n openFence={block.openFence}\n streaming={isRunning && index === blocks.length - 1}\n typed={typed}\n />\n ))\n : text}\n </div>\n );\n}\n\n/**\n * One top-level block. Memoized on its inputs: a finished block's `text` never\n * changes again, so React skips it on every token that lands in the block\n * after it. Only the trailing block carries `streaming` (and, while its code\n * fence is open, `openFence`).\n */\nconst ChatBlock = memo(function ChatBlock({\n text,\n definitions,\n openFence,\n streaming,\n typed,\n}: {\n text: string;\n definitions: string;\n openFence: OpenFence | null;\n streaming: boolean;\n typed: boolean;\n}) {\n // A fence is only \"open\" while the part streams. A message that ended\n // mid-fence parses as the code block it is (markdown-it closes it at the\n // end), copy action and all, with no caret.\n const open = streaming ? openFence : null;\n const doc = useMemo(() => {\n if (open) return null;\n const markdown = definitions ? `${text}\\n\\n${definitions}` : text;\n return typed ? parseTypedChatText(markdown) : parseChatText(markdown);\n }, [text, definitions, open, typed]);\n if (open) {\n return (\n <StreamingCodeBlock\n language={open.language}\n code={open.code}\n caret={<StreamingCaret />}\n />\n );\n }\n // A block of nothing but reference definitions parses to one empty\n // paragraph (the schema's default content); draw nothing for it.\n if (!doc || isEmptyDoc(doc)) return null;\n return <>{renderContent(doc, streaming ? findStreamingTail(doc) : null)}</>;\n});\n\nfunction isEmptyDoc(doc: ProseMirrorNode): boolean {\n if (doc.childCount === 0) return true;\n const only = doc.firstChild;\n return doc.childCount === 1 && only !== null && only.isTextblock && only.content.size === 0;\n}\n\n/**\n * One delegated click handler per body: a click on any rendered anchor —\n * source chip, asset chip, plain link — goes through the SDK's link-click\n * path (`linkClicks` on the provider, then the asset panel for an Athena\n * citation) and is cancelled when that path handled it; otherwise the\n * anchor's own `target=\"_blank\"` navigation runs. Only the native `click`\n * can be cancelled — a `mouseup` handler cannot stop the navigation. A\n * modified click (Cmd/Ctrl for a new tab, Shift for a new window, Alt for a\n * download) is the browser's and is never intercepted.\n */\nfunction useChatLinkClick() {\n const handleLinkClick = useAthenaLinkClickHandler();\n return useCallback(\n (event: MouseEvent<HTMLDivElement>) => {\n if (\n event.button !== 0 ||\n event.defaultPrevented ||\n event.metaKey ||\n event.ctrlKey ||\n event.shiftKey ||\n event.altKey\n ) {\n return;\n }\n const target = event.target;\n const element =\n target instanceof Element\n ? target\n : target instanceof Node\n ? target.parentElement\n : null;\n const anchor = element?.closest(\"a[href]\");\n if (\n !(anchor instanceof HTMLAnchorElement) ||\n !event.currentTarget.contains(anchor)\n ) {\n return;\n }\n const handled = handleLinkClick({\n href: anchor.getAttribute(\"href\") ?? anchor.href,\n // A citation chip's text ends with its place (`p.10`); the asset is named without it.\n linkText: anchor.getAttribute(\"data-mention-name\") ?? anchor.textContent,\n target: anchor.target,\n nativeEvent: event.nativeEvent,\n });\n if (handled) event.preventDefault();\n },\n [handleLinkClick],\n );\n}\n\n/** Where the block still being written ends: its last text block, and that block's last text node (none inside code). */\ninterface StreamingTail {\n textblock: ProseMirrorNode | null;\n text: ProseMirrorNode | null;\n}\n\nfunction findStreamingTail(doc: ProseMirrorNode): StreamingTail {\n const tail: StreamingTail = { textblock: null, text: null };\n doc.descendants((node) => {\n if (node.isTextblock) {\n tail.textblock = node;\n tail.text = null;\n } else if (\n node.isText &&\n tail.textblock &&\n tail.textblock.type.name !== \"codeBlock\"\n ) {\n tail.text = node;\n }\n return true;\n });\n return tail;\n}\n\n/** How many trailing words keep their own span, so a word's settle animation outlives the tokens after it. */\nconst FRESH_WORD_WINDOW = 6;\nconst WORD = /\\s*\\S+/g;\n\n/**\n * The newest words of the streaming block, each in a span keyed by its\n * position so the same element persists while the word grows and the words\n * after it arrive; a span mounts tinted and settles to ink through\n * `animate-chat-word-settle`. Words that leave the window render as text.\n */\nfunction renderFreshWords(text: string): ReactNode {\n const words = [...text.matchAll(WORD)];\n if (words.length === 0) return text;\n const from = Math.max(0, words.length - FRESH_WORD_WINDOW);\n const first = words[from]!;\n const last = words[words.length - 1]!;\n return (\n <>\n {text.slice(0, first.index)}\n {words.slice(from).map((word, offset) => (\n <span\n key={from + offset}\n className=\"animate-chat-word-settle motion-reduce:animate-none\"\n data-chat-fresh=\"\"\n >\n {word[0]}\n </span>\n ))}\n {text.slice(last.index + last[0].length)}\n </>\n );\n}\n\n/** A thin blinking caret after the newest text while the part streams; no layout of its own beyond a hairline. */\nfunction StreamingCaret() {\n return (\n <span\n aria-hidden=\"true\"\n data-chat-caret=\"\"\n className=\"ml-0.5 inline-block h-[1em] w-0.5 rounded-full bg-primary align-[-0.125em] animate-chat-caret-blink motion-reduce:animate-none\"\n />\n );\n}\n\nfunction renderNode(\n node: ProseMirrorNode,\n tail: StreamingTail | null,\n): ReactNode {\n if (node.isText) {\n return tail?.text === node ? renderFreshWords(node.text ?? \"\") : node.text;\n }\n if (node.type.name === \"mention\") return <ChatMention node={node} />;\n if (node.type.name === \"codeBlock\") {\n return (\n <ChatCodeBlock node={node}>\n <code>\n {node.textContent}\n {tail?.textblock === node ? <StreamingCaret /> : null}\n </code>\n </ChatCodeBlock>\n );\n }\n const toDOM = node.type.spec.toDOM;\n if (!toDOM) return null;\n if (node.isLeaf) return renderDOMOutputSpec(toDOM(node), null);\n const content = renderContent(node, tail);\n if (tail?.textblock === node) content.push(<StreamingCaret key=\"caret\" />);\n return renderDOMOutputSpec(toDOM(node), content);\n}\n\nfunction renderContent(\n parent: ProseMirrorNode,\n tail: StreamingTail | null,\n): ReactNode[] {\n const nodes: ProseMirrorNode[] = [];\n parent.forEach((node) => {\n nodes.push(node);\n });\n return renderMarkRuns(nodes, 0, tail);\n}\n\n/** Match ProseMirror's spanning marks: a link with bold words stays one link. */\nfunction renderMarkRuns(\n nodes: readonly ProseMirrorNode[],\n depth: number,\n tail: StreamingTail | null,\n): ReactNode[] {\n const children: ReactNode[] = [];\n let index = 0;\n while (index < nodes.length) {\n const node = nodes[index]!;\n const mark = node.marks[depth];\n if (!mark) {\n children.push(<Fragment key={index}>{renderNode(node, tail)}</Fragment>);\n index++;\n continue;\n }\n let end = index + 1;\n if (mark.type.spec.spanning !== false) {\n while (end < nodes.length && nodes[end]?.marks[depth]?.eq(mark)) end++;\n }\n const content = renderMarkRuns(nodes.slice(index, end), depth + 1, tail);\n const rendered =\n mark.type.name === \"link\" ? (\n <ChatLink href={mark.attrs.href} excerpt={mark.attrs.excerpt}>\n {content}\n </ChatLink>\n ) : mark.type.spec.toDOM ? (\n renderDOMOutputSpec(mark.type.spec.toDOM(mark, true), content)\n ) : (\n content\n );\n children.push(<Fragment key={index}>{rendered}</Fragment>);\n index = end;\n }\n return children;\n}\n"],"names":["useSyncExternalStore","useMemo","splitChatBlocks","jsx","CHAT_TEXT_CLASS","memo","ChatBlock","parseTypedChatText","parseChatText","StreamingCodeBlock","Fragment","useAthenaLinkClickHandler","useCallback","jsxs","ChatMention","ChatCodeBlock","renderDOMOutputSpec","ChatLink"],"mappings":";;;;;;;;;;AAyBA,MAAM,YAAY,MAAM,MAAM;AAAC;AAC/B,MAAM,kBAAkB,MAAM;AAC9B,MAAM,iBAAiB,MAAM;AAgBtB,SAAS,gBAAgB;AAAA,EAC9B;AAAA,EACA,YAAY;AAAA,EACZ,QAAQ;AACV,GAIG;AACD,QAAM,SAASA,MAAAA;AAAAA,IACb;AAAA,IACA;AAAA,IACA;AAAA,EAAA;AAEF,QAAM,UAAU,iBAAA;AAChB,QAAM,EAAE,QAAQ,YAAA,IAAgBC,MAAAA;AAAAA,IAC9B,MAAMC,WAAAA,gBAAgB,MAAM,EAAE,WA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AS,KAAKb,2BAAAA,IAACO,MAAAA,UAAA,EAAsB,UAAA,SAAA,GAAR,KAAiB,CAAW;AACzD,YAAQ;AAAA,EACV;AACA,SAAO;AACT;;"}
1
+ {"version":3,"file":"chat-message-body.cjs","sources":["../../../src/chat-ui/rich-text/chat-message-body.tsx"],"sourcesContent":["import type { Node as ProseMirrorNode } from \"@tiptap/pm/model\";\nimport {\n Fragment,\n memo,\n type MouseEvent,\n type ReactNode,\n useCallback,\n useMemo,\n useSyncExternalStore,\n} from \"react\";\nimport { useAthenaLinkClickHandler } from \"../../chat/athena-citation-links\";\nimport { type OpenFence, splitChatBlocks } from \"./chat-blocks\";\nimport { ChatLink } from \"./chat-link\";\nimport {\n ChatCodeBlock,\n ChatMention,\n StreamingCodeBlock,\n} from \"./chat-node-views\";\nimport {\n CHAT_TEXT_CLASS,\n parseChatText,\n parseTypedChatText,\n} from \"./chat-text-schema\";\nimport { renderDOMOutputSpec } from \"./dom-output-spec\";\n\nconst subscribe = () => () => {};\nconst browserSnapshot = () => true;\nconst serverSnapshot = () => false;\n\n/**\n * Render the composer's document schema through its own node/mark serializers.\n *\n * The text is split into its top-level blocks (`splitChatBlocks`), each parsed\n * and drawn by its own memoized component under one `CHAT_TEXT_CLASS`\n * wrapper. While a reply streams, only the trailing block re-parses with each\n * token; every finished block keeps its parse and its DOM. The trailing block\n * reveals its newest words with a settle tint and a caret, and a fenced code\n * block still being written renders as plain code until its fence closes.\n *\n * `typed` reads the text as a person typed it (`parseTypedChatText`: raw HTML\n * and underscore emphasis stay the characters they were typed with), for the\n * user bubble; assistant text keeps the full reading.\n */\nexport function ChatMessageBody({\n text,\n isRunning = false,\n typed = false,\n}: {\n text: string;\n isRunning?: boolean;\n typed?: boolean;\n}) {\n const hasDom = useSyncExternalStore(\n subscribe,\n browserSnapshot,\n serverSnapshot,\n );\n const onClick = useChatLinkClick();\n const { blocks, definitions } = useMemo(\n () => splitChatBlocks(text, { streaming: isRunning }),\n [text, isRunning],\n );\n return (\n // The click handler only delegates for the anchors inside, which are\n // themselves focusable and keyboard-operable; the wrapper is not a control.\n <div\n className={CHAT_TEXT_CLASS}\n data-chat-text=\"\"\n data-status={isRunning ? \"running\" : \"complete\"}\n onClick={onClick}\n >\n {hasDom\n ? blocks.map((block, index) => (\n <ChatBlock\n key={index}\n text={block.text}\n definitions={definitions}\n openFence={block.openFence}\n streaming={isRunning && index === blocks.length - 1}\n typed={typed}\n />\n ))\n : text}\n </div>\n );\n}\n\n/**\n * One top-level block. Memoized on its inputs: a finished block's `text` never\n * changes again, so React skips it on every token that lands in the block\n * after it. Only the trailing block carries `streaming` (and, while its code\n * fence is open, `openFence`).\n */\nconst ChatBlock = memo(function ChatBlock({\n text,\n definitions,\n openFence,\n streaming,\n typed,\n}: {\n text: string;\n definitions: string;\n openFence: OpenFence | null;\n streaming: boolean;\n typed: boolean;\n}) {\n // A fence is only \"open\" while the part streams. A message that ended\n // mid-fence parses as the code block it is (markdown-it closes it at the\n // end), copy action and all, with no caret.\n const open = streaming ? openFence : null;\n const doc = useMemo(() => {\n if (open) return null;\n const markdown = definitions ? `${text}\\n\\n${definitions}` : text;\n return typed ? parseTypedChatText(markdown) : parseChatText(markdown);\n }, [text, definitions, open, typed]);\n if (open) {\n return (\n <StreamingCodeBlock\n language={open.language}\n code={open.code}\n caret={<StreamingCaret />}\n />\n );\n }\n // A block of nothing but reference definitions parses to one empty\n // paragraph (the schema's default content); draw nothing for it.\n if (!doc || isEmptyDoc(doc)) return null;\n return <>{renderContent(doc, streaming ? findStreamingTail(doc) : null)}</>;\n});\n\nfunction isEmptyDoc(doc: ProseMirrorNode): boolean {\n if (doc.childCount === 0) return true;\n const only = doc.firstChild;\n return doc.childCount === 1 && only !== null && only.isTextblock && only.content.size === 0;\n}\n\n/**\n * One delegated click handler per body: a click on any rendered anchor —\n * source chip, asset chip, plain link — goes through the SDK's link-click\n * path (`linkClicks` on the provider, then the asset panel for an Athena\n * citation) and is cancelled when that path handled it; otherwise the\n * anchor's own `target=\"_blank\"` navigation runs. Only the native `click`\n * can be cancelled — a `mouseup` handler cannot stop the navigation. A\n * modified click (Cmd/Ctrl for a new tab, Shift for a new window, Alt for a\n * download) is the browser's and is never intercepted.\n */\nfunction useChatLinkClick() {\n const handleLinkClick = useAthenaLinkClickHandler();\n return useCallback(\n (event: MouseEvent<HTMLDivElement>) => {\n if (\n event.button !== 0 ||\n event.defaultPrevented ||\n event.metaKey ||\n event.ctrlKey ||\n event.shiftKey ||\n event.altKey\n ) {\n return;\n }\n const target = event.target;\n const element =\n target instanceof Element\n ? target\n : target instanceof Node\n ? target.parentElement\n : null;\n const anchor = element?.closest(\"a[href]\");\n if (\n !(anchor instanceof HTMLAnchorElement) ||\n !event.currentTarget.contains(anchor)\n ) {\n return;\n }\n const handled = handleLinkClick({\n href: anchor.getAttribute(\"href\") ?? anchor.href,\n // A citation chip's text ends with its place (`p.10`); the asset is named without it.\n linkText: anchor.getAttribute(\"data-mention-name\") ?? anchor.textContent,\n target: anchor.target,\n nativeEvent: event.nativeEvent,\n });\n if (handled) event.preventDefault();\n },\n [handleLinkClick],\n );\n}\n\n/** Where the block still being written ends: its last text block, and that block's last text node (none inside code). */\ninterface StreamingTail {\n textblock: ProseMirrorNode | null;\n text: ProseMirrorNode | null;\n}\n\nfunction findStreamingTail(doc: ProseMirrorNode): StreamingTail {\n const tail: StreamingTail = { textblock: null, text: null };\n doc.descendants((node) => {\n if (node.isTextblock) {\n tail.textblock = node;\n tail.text = null;\n } else if (\n node.isText &&\n tail.textblock &&\n tail.textblock.type.name !== \"codeBlock\"\n ) {\n tail.text = node;\n }\n return true;\n });\n return tail;\n}\n\n/** How many trailing words keep their own span, so a word's settle animation outlives the tokens after it. */\nconst FRESH_WORD_WINDOW = 6;\nconst WORD = /\\s*\\S+/g;\n\n/**\n * The newest words of the streaming block, each in a span keyed by its\n * position so the same element persists while the word grows and the words\n * after it arrive; a span mounts tinted and settles to ink through\n * `animate-chat-word-settle`. Words that leave the window render as text.\n */\nfunction renderFreshWords(text: string): ReactNode {\n const words = [...text.matchAll(WORD)];\n if (words.length === 0) return text;\n const from = Math.max(0, words.length - FRESH_WORD_WINDOW);\n const first = words[from]!;\n const last = words[words.length - 1]!;\n return (\n <>\n {text.slice(0, first.index)}\n {words.slice(from).map((word, offset) => (\n <span\n key={from + offset}\n className=\"animate-chat-word-settle motion-reduce:animate-none\"\n data-chat-fresh=\"\"\n >\n {word[0]}\n </span>\n ))}\n {text.slice(last.index + last[0].length)}\n </>\n );\n}\n\n/** A thin blinking caret after the newest text while the part streams; no layout of its own beyond a hairline. */\nfunction StreamingCaret() {\n return (\n <span\n aria-hidden=\"true\"\n data-chat-caret=\"\"\n className=\"ml-0.5 inline-block h-[1em] w-0.5 rounded-full bg-primary align-[-0.125em] animate-chat-caret-blink motion-reduce:animate-none\"\n />\n );\n}\n\nfunction renderNode(\n node: ProseMirrorNode,\n tail: StreamingTail | null,\n): ReactNode {\n if (node.isText) {\n return tail?.text === node ? renderFreshWords(node.text ?? \"\") : node.text;\n }\n if (node.type.name === \"mention\") return <ChatMention node={node} />;\n if (node.type.name === \"codeBlock\") {\n return (\n <ChatCodeBlock node={node}>\n <code>\n {node.textContent}\n {tail?.textblock === node ? <StreamingCaret /> : null}\n </code>\n </ChatCodeBlock>\n );\n }\n const toDOM = node.type.spec.toDOM;\n if (!toDOM) return null;\n if (node.isLeaf) return renderDOMOutputSpec(toDOM(node), null);\n const content = renderContent(node, tail);\n if (tail?.textblock === node) content.push(<StreamingCaret key=\"caret\" />);\n return renderDOMOutputSpec(toDOM(node), content);\n}\n\nfunction renderContent(\n parent: ProseMirrorNode,\n tail: StreamingTail | null,\n): ReactNode[] {\n const nodes: ProseMirrorNode[] = [];\n parent.forEach((node) => {\n nodes.push(node);\n });\n return renderMarkRuns(nodes, 0, tail);\n}\n\n/** Match ProseMirror's spanning marks: a link with bold words stays one link. */\nfunction renderMarkRuns(\n nodes: readonly ProseMirrorNode[],\n depth: number,\n tail: StreamingTail | null,\n): ReactNode[] {\n const children: ReactNode[] = [];\n let index = 0;\n while (index < nodes.length) {\n const node = nodes[index]!;\n const mark = node.marks[depth];\n if (!mark) {\n children.push(<Fragment key={index}>{renderNode(node, tail)}</Fragment>);\n index++;\n continue;\n }\n let end = index + 1;\n if (mark.type.spec.spanning !== false) {\n while (end < nodes.length && nodes[end]?.marks[depth]?.eq(mark)) end++;\n }\n const content = renderMarkRuns(nodes.slice(index, end), depth + 1, tail);\n const rendered =\n mark.type.name === \"link\" ? (\n <ChatLink href={mark.attrs.href} excerpt={mark.attrs.excerpt}>\n {content}\n </ChatLink>\n ) : mark.type.spec.toDOM ? (\n renderDOMOutputSpec(mark.type.spec.toDOM(mark, true), content)\n ) : (\n content\n );\n children.push(<Fragment key={index}>{rendered}</Fragment>);\n index = end;\n }\n return children;\n}\n"],"names":["useSyncExternalStore","useMemo","splitChatBlocks","jsx","CHAT_TEXT_CLASS","memo","ChatBlock","parseTypedChatText","parseChatText","StreamingCodeBlock","Fragment","useAthenaLinkClickHandler","useCallback","jsxs","ChatMention","ChatCodeBlock","renderDOMOutputSpec","ChatLink"],"mappings":";;;;;;;;;;AAyBA,MAAM,YAAY,MAAM,MAAM;AAAC;AAC/B,MAAM,kBAAkB,MAAM;AAC9B,MAAM,iBAAiB,MAAM;AAgBtB,SAAS,gBAAgB;AAAA,EAC9B;AAAA,EACA,YAAY;AAAA,EACZ,QAAQ;AACV,GAIG;AACD,QAAM,SAASA,WAAAA;AAAAA,IACb;AAAA,IACA;AAAA,IACA;AAAA,EAAA;AAEF,QAAM,UAAU,iBAAA;AAChB,QAAM,EAAE,QAAQ,YAAA,IAAgBC,WAAAA;AAAAA,IAC9B,MAAMC,WAAAA,gBAAgB,MAAM,EAAE,WAAW,WAAW;AAAA,IACpD,CAAC,MAAM,SAAS;AAAA,EAAA;AAElB;AAAA;AAAA;AAAA,IAGEC,2BAAAA;AAAAA,MAAC;AAAA,MAAA;AAAA,QACC,WAAWC,eAAAA;AAAAA,QACX,kBAAe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.toStringTag, { value: "Module" });
3
3
  const jsxRuntime = require("react/jsx-runtime");
4
4
  const react = require("@tiptap/react");
5
5
  const lucideReact = require("lucide-react");
6
- const react$1 = require("react");
6
+ const require$$0 = require("react");
7
7
  const mentionChip = require("../mentions/mention-chip.cjs");
8
8
  const mentionExtension = require("../mentions/mention-extension.cjs");
9
9
  const cnfast = require("cnfast");
@@ -38,20 +38,20 @@ function ChatMentionNodeView({ node, editor }) {
38
38
  }
39
39
  const COPIED_RESET_MS = 1500;
40
40
  function CodeBlockCopyButton({ node }) {
41
- const [status, setStatus] = react$1.useState("idle");
42
- const resetTimer = react$1.useRef(null);
43
- react$1.useEffect(
41
+ const [status, setStatus] = require$$0.useState("idle");
42
+ const resetTimer = require$$0.useRef(null);
43
+ require$$0.useEffect(
44
44
  () => () => {
45
45
  if (resetTimer.current) clearTimeout(resetTimer.current);
46
46
  },
47
47
  []
48
48
  );
49
- const flash = react$1.useCallback((next) => {
49
+ const flash = require$$0.useCallback((next) => {
50
50
  setStatus(next);
51
51
  if (resetTimer.current) clearTimeout(resetTimer.current);
52
52
  resetTimer.current = setTimeout(() => setStatus("idle"), COPIED_RESET_MS);
53
53
  }, []);
54
- const onCopy = react$1.useCallback(() => {
54
+ const onCopy = require$$0.useCallback(() => {
55
55
  if (typeof navigator === "undefined" || !navigator.clipboard) {
56
56
  flash("failed");
57
57
  return;
@@ -1 +1 @@
1
- {"version":3,"file":"chat-node-views.cjs","sources":["../../../src/chat-ui/rich-text/chat-node-views.tsx"],"sourcesContent":["import type { Node as ProseMirrorNode } from \"@tiptap/pm/model\";\nimport {\n NodeViewContent,\n NodeViewWrapper,\n type NodeViewProps,\n} from \"@tiptap/react\";\nimport { CheckIcon, CopyIcon, XIcon } from \"lucide-react\";\nimport { type ReactNode, useCallback, useEffect, useRef, useState } from \"react\";\nimport { cn } from \"../../lib/utils\";\nimport { MentionLink } from \"../mentions/mention-chip\";\nimport {\n makeMentionUrl,\n type MentionNodeAttrs,\n} from \"../mentions/mention-extension\";\n\nexport function ChatMention({\n node,\n interactive = true,\n}: {\n node: ProseMirrorNode;\n interactive?: boolean;\n}) {\n return (\n <span\n className=\"mention-chip\"\n // The chip inside draws the pill; the host draws no box of its own (styles.css).\n data-chip-host=\"\"\n data-mention=\"\"\n data-type={node.attrs.type}\n data-name={node.attrs.name}\n data-id={node.attrs.id}\n data-asset-type={node.attrs.assetType}\n data-display-as-preview={String(node.attrs.displayAsPreview === true)}\n >\n <MentionLink\n href={makeMentionUrl(node.attrs as MentionNodeAttrs)}\n interactive={interactive}\n >\n {node.attrs.name}\n </MentionLink>\n </span>\n );\n}\n\nexport function ChatMentionNodeView({ node, editor }: NodeViewProps) {\n return (\n <NodeViewWrapper as=\"span\">\n <ChatMention node={node} interactive={!editor.isEditable} />\n </NodeViewWrapper>\n );\n}\n\nconst COPIED_RESET_MS = 1500;\n\n/**\n * Copies the block's source. Reads `node.textContent` at click time so a\n * still-streaming block copies what is on screen, not a stale snapshot.\n */\nfunction CodeBlockCopyButton({ node }: { node: ProseMirrorNode }) {\n const [status, setStatus] = useState<\"idle\" | \"copied\" | \"failed\">(\"idle\");\n const resetTimer = useRef<ReturnType<typeof setTimeout> | null>(null);\n useEffect(\n () => () => {\n if (resetTimer.current) clearTimeout(resetTimer.current);\n },\n [],\n );\n const flash = useCallback((next: \"copied\" | \"failed\") => {\n setStatus(next);\n if (resetTimer.current) clearTimeout(resetTimer.current);\n resetTimer.current = setTimeout(() => setStatus(\"idle\"), COPIED_RESET_MS);\n }, []);\n const onCopy = useCallback(() => {\n // writeText rejects when clipboard-write is denied (permissions, an\n // embedding iframe without the allow attribute); surface that instead of\n // leaving an unhandled rejection and a button that looks like it worked.\n if (typeof navigator === \"undefined\" || !navigator.clipboard) {\n flash(\"failed\");\n return;\n }\n navigator.clipboard.writeText(node.textContent).then(\n () => flash(\"copied\"),\n () => flash(\"failed\"),\n );\n }, [node, flash]);\n const label =\n status === \"copied\" ? \"Copied\" : status === \"failed\" ? \"Copy failed\" : \"Copy code\";\n return (\n <button\n type=\"button\"\n title={label}\n aria-label={label}\n onClick={onCopy}\n className={cn(\n \"inline-flex size-6 items-center justify-center rounded text-muted-foreground transition-colors hover:bg-accent hover:text-accent-foreground\",\n \"opacity-0 transition-opacity group-hover/code-block:opacity-100 focus-visible:opacity-100\",\n status !== \"idle\" && \"opacity-100\",\n status === \"failed\" && \"text-destructive\",\n )}\n >\n {status === \"copied\" ? (\n <CheckIcon className=\"size-3.5\" />\n ) : status === \"failed\" ? (\n <XIcon className=\"size-3.5\" />\n ) : (\n <CopyIcon className=\"size-3.5\" />\n )}\n </button>\n );\n}\n\n/** The frame both code renderings share: language label, an optional corner action, the `<pre>`. */\nfunction CodeBlockFrame({\n language,\n action,\n children,\n ...attributes\n}: {\n language: string | null | undefined;\n action?: ReactNode;\n children: ReactNode;\n \"data-chat-open-fence\"?: string;\n}) {\n return (\n <div\n className=\"not-prose group/code-block relative my-2 overflow-hidden rounded-lg border border-border bg-muted/30\"\n {...attributes}\n >\n {language && (\n <div className=\"border-b border-border bg-muted/50 px-3 py-1 text-[10px] font-medium text-muted-foreground\">\n {language}\n </div>\n )}\n {action && (\n <div className=\"absolute top-1 right-1\" contentEditable={false}>\n {action}\n </div>\n )}\n <pre className=\"overflow-x-auto p-3 pr-9 font-mono text-xs leading-relaxed text-foreground\">\n {children}\n </pre>\n </div>\n );\n}\n\nexport function ChatCodeBlock({\n node,\n children,\n}: {\n node: ProseMirrorNode;\n children: ReactNode;\n}) {\n return (\n <CodeBlockFrame\n language={node.attrs.language}\n action={<CodeBlockCopyButton node={node} />}\n >\n {children}\n </CodeBlockFrame>\n );\n}\n\n/**\n * A fenced block whose closing fence has not arrived: the same frame with the\n * code as plain text and no copy action (there is no settled source to copy\n * yet). Anything that decorates code — highlighting, a language pick — belongs\n * after the fence closes, when the block parses into a `codeBlock` node.\n */\nexport function StreamingCodeBlock({\n language,\n code,\n caret,\n}: {\n language: string;\n code: string;\n caret?: ReactNode;\n}) {\n return (\n <CodeBlockFrame language={language || null} data-chat-open-fence=\"\">\n <code>\n {code}\n {caret}\n </code>\n </CodeBlockFrame>\n );\n}\n\nexport function ChatCodeBlockNodeView({ node }: NodeViewProps) {\n return (\n <NodeViewWrapper>\n <ChatCodeBlock node={node}>\n <NodeViewContent<\"code\"> as=\"code\" />\n </ChatCodeBlock>\n </NodeViewWrapper>\n );\n}\n"],"names":["jsx","MentionLink","makeMentionUrl","NodeViewWrapper","useState","useRef","useEffect","useCallback","cn","CheckIcon","XIcon","CopyIcon","jsxs","NodeViewContent"],"mappings":";;;;;;;;;AAeO,SAAS,YAAY;AAAA,EAC1B;AAAA,EACA,cAAc;AAChB,GAGG;AACD,SACEA,2BAAAA;AAAAA,IAAC;AAAA,IAAA;AAAA,MACC,WAAU;AAAA,MAEV,kBAAe;AAAA,MACf,gBAAa;AAAA,MACb,aAAW,KAAK,MAAM;AAAA,MACtB,aAAW,KAAK,MAAM;AAAA,MACtB,WAAS,KAAK,MAAM;AAAA,MACpB,mBAAiB,KAAK,MAAM;AAAA,MAC5B,2BAAyB,OAAO,KAAK,MAAM,qBAAqB,IAAI;AAAA,MAEpE,UAAAA,2BAAAA;AAAAA,QAACC,YAAAA;AAAAA,QAAA;AAAA,UACC,MAAMC,iBAAAA,eAAe,KAAK,KAAyB;AAAA,UACnD;AAAA,UAEC,eAAK,MAAM;AAAA,QAAA;AAAA,MAAA;AAAA,IACd;AAAA,EAAA;AAGN;AAEO,SAAS,oBAAoB,EAAE,MAAM,UAAyB;AACnE,SACEF,2BAAAA,IAACG,MAAAA,iBAAA,EAAgB,IAAG,QAClB,UAAAH,2BAAAA,IAAC,aAAA,EAAY,MAAY,aAAa,CAAC,OAAO,WAAA,CAAY,EAAA,CAC5D;AAEJ;AAEA,MAAM,kBAAkB;AAMxB,SAAS,oBAAoB,EAAE,QAAmC;AAChE,QAAM,CAAC,QAAQ,SAAS,IAAII,QAAAA,SAAuC,MAAM;AACzE,QAAM,aAAaC,QAAAA,OAA6C,IAA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A,MACT,GAAG;AAAA,MAEH,UAAA;AAAA,QAAA,YACCZ,2BAAAA,IAAC,OAAA,EAAI,WAAU,8FACZ,UAAA,UACH;AAAA,QAED,UACCA,2BAAAA,IAAC,OAAA,EAAI,WAAU,0BAAyB,iBAAiB,OACtD,UAAA,QACH;AAAA,QAEFA,2BAAAA,IAAC,OAAA,EAAI,WAAU,8EACZ,SAAA,CACH;AAAA,MAAA;AAAA,IAAA;AAAA,EAAA;AAGN;AAEO,SAAS,cAAc;AAAA,EAC5B;AAAA,EACA;AACF,GAGG;AACD,SACEA,2BAAAA;AAAAA,IAAC;AAAA,IAAA;AAAA,MACC,UAAU,KAAK,MAAM;AAAA,MACrB,QAAQA,2BAAAA,IAAC,qBAAA,EAAoB,KAAA,CAAY;AAAA,MAExC;AAAA,IAAA;AAAA,EAAA;AAGP;AAQO,SAAS,mBAAmB;AAAA,EACjC;AAAA,EACA;AAAA,EACA;AACF,GAIG;AACD,SACEA,2BAAAA,IAAC,kBAAe,UAAU,YAAY,MAAM,wBAAqB,IAC/D,0CAAC,QAAA,EACE,UAAA;AAAA,IAAA;AAAA,IACA;AAAA,EAAA,EAAA,CACH,EAAA,CACF;AAEJ;AAEO,SAAS,sBAAsB,EAAE,QAAuB;AAC7D,SACEA,2BAAAA,IAACG,MAAAA,iBAAA,EACC,UAAAH,2BAAAA,IAAC,eAAA,EAAc,MACb,yCAACa,MAAAA,iBAAA,EAAwB,IAAG,OAAA,CAAO,EAAA,CACrC,GACF;AAEJ;;;;;;"}
1
+ {"version":3,"file":"chat-node-views.cjs","sources":["../../../src/chat-ui/rich-text/chat-node-views.tsx"],"sourcesContent":["import type { Node as ProseMirrorNode } from \"@tiptap/pm/model\";\nimport {\n NodeViewContent,\n NodeViewWrapper,\n type NodeViewProps,\n} from \"@tiptap/react\";\nimport { CheckIcon, CopyIcon, XIcon } from \"lucide-react\";\nimport { type ReactNode, useCallback, useEffect, useRef, useState } from \"react\";\nimport { cn } from \"../../lib/utils\";\nimport { MentionLink } from \"../mentions/mention-chip\";\nimport {\n makeMentionUrl,\n type MentionNodeAttrs,\n} from \"../mentions/mention-extension\";\n\nexport function ChatMention({\n node,\n interactive = true,\n}: {\n node: ProseMirrorNode;\n interactive?: boolean;\n}) {\n return (\n <span\n className=\"mention-chip\"\n // The chip inside draws the pill; the host draws no box of its own (styles.css).\n data-chip-host=\"\"\n data-mention=\"\"\n data-type={node.attrs.type}\n data-name={node.attrs.name}\n data-id={node.attrs.id}\n data-asset-type={node.attrs.assetType}\n data-display-as-preview={String(node.attrs.displayAsPreview === true)}\n >\n <MentionLink\n href={makeMentionUrl(node.attrs as MentionNodeAttrs)}\n interactive={interactive}\n >\n {node.attrs.name}\n </MentionLink>\n </span>\n );\n}\n\nexport function ChatMentionNodeView({ node, editor }: NodeViewProps) {\n return (\n <NodeViewWrapper as=\"span\">\n <ChatMention node={node} interactive={!editor.isEditable} />\n </NodeViewWrapper>\n );\n}\n\nconst COPIED_RESET_MS = 1500;\n\n/**\n * Copies the block's source. Reads `node.textContent` at click time so a\n * still-streaming block copies what is on screen, not a stale snapshot.\n */\nfunction CodeBlockCopyButton({ node }: { node: ProseMirrorNode }) {\n const [status, setStatus] = useState<\"idle\" | \"copied\" | \"failed\">(\"idle\");\n const resetTimer = useRef<ReturnType<typeof setTimeout> | null>(null);\n useEffect(\n () => () => {\n if (resetTimer.current) clearTimeout(resetTimer.current);\n },\n [],\n );\n const flash = useCallback((next: \"copied\" | \"failed\") => {\n setStatus(next);\n if (resetTimer.current) clearTimeout(resetTimer.current);\n resetTimer.current = setTimeout(() => setStatus(\"idle\"), COPIED_RESET_MS);\n }, []);\n const onCopy = useCallback(() => {\n // writeText rejects when clipboard-write is denied (permissions, an\n // embedding iframe without the allow attribute); surface that instead of\n // leaving an unhandled rejection and a button that looks like it worked.\n if (typeof navigator === \"undefined\" || !navigator.clipboard) {\n flash(\"failed\");\n return;\n }\n navigator.clipboard.writeText(node.textContent).then(\n () => flash(\"copied\"),\n () => flash(\"failed\"),\n );\n }, [node, flash]);\n const label =\n status === \"copied\" ? \"Copied\" : status === \"failed\" ? \"Copy failed\" : \"Copy code\";\n return (\n <button\n type=\"button\"\n title={label}\n aria-label={label}\n onClick={onCopy}\n className={cn(\n \"inline-flex size-6 items-center justify-center rounded text-muted-foreground transition-colors hover:bg-accent hover:text-accent-foreground\",\n \"opacity-0 transition-opacity group-hover/code-block:opacity-100 focus-visible:opacity-100\",\n status !== \"idle\" && \"opacity-100\",\n status === \"failed\" && \"text-destructive\",\n )}\n >\n {status === \"copied\" ? (\n <CheckIcon className=\"size-3.5\" />\n ) : status === \"failed\" ? (\n <XIcon className=\"size-3.5\" />\n ) : (\n <CopyIcon className=\"size-3.5\" />\n )}\n </button>\n );\n}\n\n/** The frame both code renderings share: language label, an optional corner action, the `<pre>`. */\nfunction CodeBlockFrame({\n language,\n action,\n children,\n ...attributes\n}: {\n language: string | null | undefined;\n action?: ReactNode;\n children: ReactNode;\n \"data-chat-open-fence\"?: string;\n}) {\n return (\n <div\n className=\"not-prose group/code-block relative my-2 overflow-hidden rounded-lg border border-border bg-muted/30\"\n {...attributes}\n >\n {language && (\n <div className=\"border-b border-border bg-muted/50 px-3 py-1 text-[10px] font-medium text-muted-foreground\">\n {language}\n </div>\n )}\n {action && (\n <div className=\"absolute top-1 right-1\" contentEditable={false}>\n {action}\n </div>\n )}\n <pre className=\"overflow-x-auto p-3 pr-9 font-mono text-xs leading-relaxed text-foreground\">\n {children}\n </pre>\n </div>\n );\n}\n\nexport function ChatCodeBlock({\n node,\n children,\n}: {\n node: ProseMirrorNode;\n children: ReactNode;\n}) {\n return (\n <CodeBlockFrame\n language={node.attrs.language}\n action={<CodeBlockCopyButton node={node} />}\n >\n {children}\n </CodeBlockFrame>\n );\n}\n\n/**\n * A fenced block whose closing fence has not arrived: the same frame with the\n * code as plain text and no copy action (there is no settled source to copy\n * yet). Anything that decorates code — highlighting, a language pick — belongs\n * after the fence closes, when the block parses into a `codeBlock` node.\n */\nexport function StreamingCodeBlock({\n language,\n code,\n caret,\n}: {\n language: string;\n code: string;\n caret?: ReactNode;\n}) {\n return (\n <CodeBlockFrame language={language || null} data-chat-open-fence=\"\">\n <code>\n {code}\n {caret}\n </code>\n </CodeBlockFrame>\n );\n}\n\nexport function ChatCodeBlockNodeView({ node }: NodeViewProps) {\n return (\n <NodeViewWrapper>\n <ChatCodeBlock node={node}>\n <NodeViewContent<\"code\"> as=\"code\" />\n </ChatCodeBlock>\n </NodeViewWrapper>\n );\n}\n"],"names":["jsx","MentionLink","makeMentionUrl","NodeViewWrapper","useState","useRef","useEffect","useCallback","cn","CheckIcon","XIcon","CopyIcon","jsxs","NodeViewContent"],"mappings":";;;;;;;;;AAeO,SAAS,YAAY;AAAA,EAC1B;AAAA,EACA,cAAc;AAChB,GAGG;AACD,SACEA,2BAAAA;AAAAA,IAAC;AAAA,IAAA;AAAA,MACC,WAAU;AAAA,MAEV,kBAAe;AAAA,MACf,gBAAa;AAAA,MACb,aAAW,KAAK,MAAM;AAAA,MACtB,aAAW,KAAK,MAAM;AAAA,MACtB,WAAS,KAAK,MAAM;AAAA,MACpB,mBAAiB,KAAK,MAAM;AAAA,MAC5B,2BAAyB,OAAO,KAAK,MAAM,qBAAqB,IAAI;AAAA,MAEpE,UAAAA,2BAAAA;AAAAA,QAACC,YAAAA;AAAAA,QAAA;AAAA,UACC,MAAMC,iBAAAA,eAAe,KAAK,KAAyB;AAAA,UACnD;AAAA,UAEC,eAAK,MAAM;AAAA,QAAA;AAAA,MAAA;AAAA,IACd;AAAA,EAAA;AAGN;AAEO,SAAS,oBAAoB,EAAE,MAAM,UAAyB;AACnE,SACEF,2BAAAA,IAACG,MAAAA,iBAAA,EAAgB,IAAG,QAClB,UAAAH,2BAAAA,IAAC,aAAA,EAAY,MAAY,aAAa,CAAC,OAAO,WAAA,CAAY,EAAA,CAC5D;AAEJ;AAEA,MAAM,kBAAkB;AAMxB,SAAS,oBAAoB,EAAE,QAAmC;AAChE,QAAM,CAAC,QAAQ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,GAKG;AACD,SACEC,2BAAAA;AAAAA,IAAC;AAAA,IAAA;AAAA,MACC,WAAU;AAAA,MACT,GAAG;AAAA,MAEH,UAAA;AAAA,QAAA,YACCZ,2BAAAA,IAAC,OAAA,EAAI,WAAU,8FACZ,UAAA,UACH;AAAA,QAED,UACCA,2BAAAA,IAAC,OAAA,EAAI,WAAU,0BAAyB,iBAAiB,OACtD,UAAA,QACH;AAAA,QAEFA,2BAAAA,IAAC,OAAA,EAAI,WAAU,8EACZ,SAAA,CACH;AAAA,MAAA;AAAA,IAAA;AAAA,EAAA;AAGN;AAEO,SAAS,cAAc;AAAA,EAC5B;AAAA,EACA;AACF,GAGG;AACD,SACEA,2BAAAA;AAAAA,IAAC;AAAA,IAAA;AAAA,MACC,UAAU,KAAK,MAAM;AAAA,MACrB,QAAQA,2BAAAA,IAAC,qBAAA,EAAoB,KAAA,CAAY;AAAA,MAExC;AAAA,IAAA;AAAA,EAAA;AAGP;AAQO,SAAS,mBAAmB;AAAA,EACjC;AAAA,EACA;AAAA,EACA;AACF,GAIG;AACD,SACEA,2BAAAA,IAAC,kBAAe,UAAU,YAAY,MAAM,wBAAqB,IAC/D,0CAAC,QAAA,EACE,UAAA;AAAA,IAAA;AAAA,IACA;AAAA,EAAA,EAAA,CACH,EAAA,CACF;AAEJ;AAEO,SAAS,sBAAsB,EAAE,QAAuB;AAC7D,SACEA,2BAAAA,IAACG,MAAAA,iBAAA,EACC,UAAAH,2BAAAA,IAAC,eAAA,EAAc,MACb,yCAACa,MAAAA,iBAAA,EAAwB,IAAG,OAAA,CAAO,EAAA,CACrC,GACF;AAEJ;;;;;;"}
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const react = require("react");
3
+ const require$$0 = require("react");
4
4
  const ATTRIBUTE_PROPS = {
5
5
  class: "className",
6
6
  for: "htmlFor",
@@ -75,7 +75,7 @@ function renderDOMOutputSpec(spec, content, key) {
75
75
  const props = attributesToProps(attrs);
76
76
  if (tagName === "input") props.disabled = true;
77
77
  if (key !== void 0) props.key = key;
78
- return react.createElement(tagName, props, ...rendered);
78
+ return require$$0.createElement(tagName, props, ...rendered);
79
79
  }
80
80
  exports.attributesToProps = attributesToProps;
81
81
  exports.renderDOMOutputSpec = renderDOMOutputSpec;
@@ -1 +1 @@
1
- {"version":3,"file":"dom-output-spec.cjs","sources":["../../../src/chat-ui/rich-text/dom-output-spec.tsx"],"sourcesContent":["import type { DOMOutputSpec } from \"@tiptap/pm/model\";\nimport { type CSSProperties, createElement, type ReactNode } from \"react\";\n\n/**\n * ProseMirror's `DOMOutputSpec` (what every node and mark's `renderHTML`\n * returns) rendered as React elements, so the static message body draws a\n * node exactly as the editor's DOM serializer would — same tag, same\n * attributes, same nesting — with the node's content placed at the spec's hole.\n *\n * Only the array form is supported. A spec that hands back a live DOM node\n * belongs to a node view, and those nodes never reach this renderer (the parser\n * reports them as unsupported).\n */\n\n/** HTML attribute names whose React prop is spelled differently. */\nconst ATTRIBUTE_PROPS: Readonly<Record<string, string>> = {\n class: \"className\",\n for: \"htmlFor\",\n tabindex: \"tabIndex\",\n contenteditable: \"contentEditable\",\n spellcheck: \"spellCheck\",\n colspan: \"colSpan\",\n rowspan: \"rowSpan\",\n readonly: \"readOnly\",\n maxlength: \"maxLength\",\n autocomplete: \"autoComplete\",\n crossorigin: \"crossOrigin\",\n srcset: \"srcSet\",\n datetime: \"dateTime\",\n};\n\n/** `text-align: center; --x: 1` → `{ textAlign: 'center', '--x': '1' }`. */\nexport function styleTextToObject(style: string): CSSProperties {\n const result: Record<string, string> = {};\n for (const declaration of style.split(\";\")) {\n const separator = declaration.indexOf(\":\");\n if (separator === -1) continue;\n const property = declaration.slice(0, separator).trim();\n const value = declaration.slice(separator + 1).trim();\n if (property === \"\" || value === \"\") continue;\n const key = property.startsWith(\"--\")\n ? property\n : property.replace(/-([a-z])/g, (_match, letter: string) =>\n letter.toUpperCase(),\n );\n result[key] = value;\n }\n return result as CSSProperties;\n}\n\n/** A spec's attribute object as React props. `null`/`undefined` values are dropped, like the serializer drops them. */\nexport function attributesToProps(\n attrs: Record<string, unknown>,\n): Record<string, unknown> {\n const props: Record<string, unknown> = {};\n for (const [name, value] of Object.entries(attrs)) {\n if (value === null || value === undefined) continue;\n if (name === \"style\" && typeof value === \"string\") {\n props.style = styleTextToObject(value);\n continue;\n }\n // A checkbox spec carries `checked: 'checked'` (or null): an uncontrolled input.\n if (name === \"checked\") {\n props.defaultChecked = value !== false;\n continue;\n }\n props[ATTRIBUTE_PROPS[name] ?? name] = value;\n }\n return props;\n}\n\nfunction isAttributeObject(value: unknown): value is Record<string, unknown> {\n return (\n typeof value === \"object\" &&\n value !== null &&\n !Array.isArray(value) &&\n !(typeof Node !== \"undefined\" && value instanceof Node)\n );\n}\n\n/**\n * Render a spec, placing `content` at its hole (`0`). Throws for a spec the\n * array grammar cannot express (a DOM node, a `{ dom, contentDOM }` pair).\n */\nexport function renderDOMOutputSpec(\n spec: DOMOutputSpec,\n content: ReactNode,\n key?: string | number,\n): ReactNode {\n if (typeof spec === \"string\") return spec;\n if (!Array.isArray(spec)) {\n throw new Error(\n \"static message body: DOMOutputSpec must use the array form\",\n );\n }\n const [tag, ...rest] = spec;\n if (typeof tag !== \"string\") {\n throw new Error(\"static message body: DOMOutputSpec tag must be a string\");\n }\n // A namespaced tag (`svg:...`) is never produced by the message schema.\n const tagName = tag.includes(\" \") ? tag.slice(tag.lastIndexOf(\" \") + 1) : tag;\n let attrs: Record<string, unknown> = {};\n let children: unknown[] = rest;\n if (rest.length > 0 && isAttributeObject(rest[0])) {\n attrs = rest[0];\n children = rest.slice(1);\n }\n const rendered = children.map((child, index) =>\n child === 0\n ? content\n : renderDOMOutputSpec(child as DOMOutputSpec, content, index),\n );\n const props = attributesToProps(attrs);\n if (tagName === \"input\") props.disabled = true;\n if (key !== undefined) props.key = key;\n return createElement(tagName, props, ...rendered);\n}\n"],"names":["createElement"],"mappings":";;;AAeA,M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AAiB;AAEtD;AAMO,SAAS,oBACd,MACA,SACA,KACW;AACX,MAAI,OAAO,SAAS,SAAU,QAAO;AACrC,MAAI,CAAC,MAAM,QAAQ,IAAI,GAAG;AACxB,UAAM,IAAI;AAAA,MACR;AAAA,IAAA;AAAA,EAEJ;AACA,QAAM,CAAC,KAAK,GAAG,IAAI,IAAI;AACvB,MAAI,OAAO,QAAQ,UAAU;AAC3B,UAAM,IAAI,MAAM,yDAAyD;AAAA,EAC3E;AAEA,QAAM,UAAU,IAAI,SAAS,GAAG,IAAI,IAAI,MAAM,IAAI,YAAY,GAAG,IAAI,CAAC,IAAI;AAC1E,MAAI,QAAiC,CAAA;AACrC,MAAI,WAAsB;AAC1B,MAAI,KAAK,SAAS,KAAK,kBAAkB,KAAK,CAAC,CAAC,GAAG;AACjD,YAAQ,KAAK,CAAC;AACd,eAAW,KAAK,MAAM,CAAC;AAAA,EACzB;AACA,QAAM,WAAW,SAAS;AAAA,IAAI,CAAC,OAAO,UACpC,UAAU,IACN,UACA,oBAAoB,OAAwB,SAAS,KAAK;AAAA,EAAA;AAEhE,QAAM,QAAQ,kBAAkB,KAAK;AACrC,MAAI,YAAY,QAAS,OAAM,WAAW;AAC1C,MAAI,QAAQ,OAAW,OAAM,MAAM;AACnC,SAAOA,oBAAc,SAAS,OAAO,GAAG,QAAQ;AAClD;;;;"}
1
+ {"version":3,"file":"dom-output-spec.cjs","sources":["../../../src/chat-ui/rich-text/dom-output-spec.tsx"],"sourcesContent":["import type { DOMOutputSpec } from \"@tiptap/pm/model\";\nimport { type CSSProperties, createElement, type ReactNode } from \"react\";\n\n/**\n * ProseMirror's `DOMOutputSpec` (what every node and mark's `renderHTML`\n * returns) rendered as React elements, so the static message body draws a\n * node exactly as the editor's DOM serializer would — same tag, same\n * attributes, same nesting — with the node's content placed at the spec's hole.\n *\n * Only the array form is supported. A spec that hands back a live DOM node\n * belongs to a node view, and those nodes never reach this renderer (the parser\n * reports them as unsupported).\n */\n\n/** HTML attribute names whose React prop is spelled differently. */\nconst ATTRIBUTE_PROPS: Readonly<Record<string, string>> = {\n class: \"className\",\n for: \"htmlFor\",\n tabindex: \"tabIndex\",\n contenteditable: \"contentEditable\",\n spellcheck: \"spellCheck\",\n colspan: \"colSpan\",\n rowspan: \"rowSpan\",\n readonly: \"readOnly\",\n maxlength: \"maxLength\",\n autocomplete: \"autoComplete\",\n crossorigin: \"crossOrigin\",\n srcset: \"srcSet\",\n datetime: \"dateTime\",\n};\n\n/** `text-align: center; --x: 1` → `{ textAlign: 'center', '--x': '1' }`. */\nexport function styleTextToObject(style: string): CSSProperties {\n const result: Record<string, string> = {};\n for (const declaration of style.split(\";\")) {\n const separator = declaration.indexOf(\":\");\n if (separator === -1) continue;\n const property = declaration.slice(0, separator).trim();\n const value = declaration.slice(separator + 1).trim();\n if (property === \"\" || value === \"\") continue;\n const key = property.startsWith(\"--\")\n ? property\n : property.replace(/-([a-z])/g, (_match, letter: string) =>\n letter.toUpperCase(),\n );\n result[key] = value;\n }\n return result as CSSProperties;\n}\n\n/** A spec's attribute object as React props. `null`/`undefined` values are dropped, like the serializer drops them. */\nexport function attributesToProps(\n attrs: Record<string, unknown>,\n): Record<string, unknown> {\n const props: Record<string, unknown> = {};\n for (const [name, value] of Object.entries(attrs)) {\n if (value === null || value === undefined) continue;\n if (name === \"style\" && typeof value === \"string\") {\n props.style = styleTextToObject(value);\n continue;\n }\n // A checkbox spec carries `checked: 'checked'` (or null): an uncontrolled input.\n if (name === \"checked\") {\n props.defaultChecked = value !== false;\n continue;\n }\n props[ATTRIBUTE_PROPS[name] ?? name] = value;\n }\n return props;\n}\n\nfunction isAttributeObject(value: unknown): value is Record<string, unknown> {\n return (\n typeof value === \"object\" &&\n value !== null &&\n !Array.isArray(value) &&\n !(typeof Node !== \"undefined\" && value instanceof Node)\n );\n}\n\n/**\n * Render a spec, placing `content` at its hole (`0`). Throws for a spec the\n * array grammar cannot express (a DOM node, a `{ dom, contentDOM }` pair).\n */\nexport function renderDOMOutputSpec(\n spec: DOMOutputSpec,\n content: ReactNode,\n key?: string | number,\n): ReactNode {\n if (typeof spec === \"string\") return spec;\n if (!Array.isArray(spec)) {\n throw new Error(\n \"static message body: DOMOutputSpec must use the array form\",\n );\n }\n const [tag, ...rest] = spec;\n if (typeof tag !== \"string\") {\n throw new Error(\"static message body: DOMOutputSpec tag must be a string\");\n }\n // A namespaced tag (`svg:...`) is never produced by the message schema.\n const tagName = tag.includes(\" \") ? tag.slice(tag.lastIndexOf(\" \") + 1) : tag;\n let attrs: Record<string, unknown> = {};\n let children: unknown[] = rest;\n if (rest.length > 0 && isAttributeObject(rest[0])) {\n attrs = rest[0];\n children = rest.slice(1);\n }\n const rendered = children.map((child, index) =>\n child === 0\n ? content\n : renderDOMOutputSpec(child as DOMOutputSpec, content, index),\n );\n const props = attributesToProps(attrs);\n if (tagName === \"input\") props.disabled = true;\n if (key !== undefined) props.key = key;\n return createElement(tagName, props, ...rendered);\n}\n"],"names":["createElement"],"mappings":";;;AAeA,MAAM,kBAAoD;AAAA,EACxD,OAAO;AAAA,EACP,KAAK;AAAA,EACL,UAAU;AAAA,EACV,iBAAiB;AAAA,EACjB,YAAY;AAAA,EACZ,SAAS;AAAA,EACT,SAAS;AAAA,EACT,UAAU;AAAA,EACV,WAAW;AAAA,EACX,cAAc;AAAA,EACd,aAAa;AAAA,EACb,QAAQ;AAAA,EACR,UAAU;AACZ;AAGO,SAAS,kBAAkB,OAA8B;AAC9D,QAAM,SAAiC,CAAA;AACvC,aAAW,eAAe,MAAM,MAAM,GAAG,GAAG;AAC1C,UAAM,YAAY,YAAY,QAAQ,GAAG;AACzC,QAAI,cAAc,GAAI;AACtB,UAAM,WAAW,YAAY,MAAM,GAAG,SAAS,EAAE,KAAA;AACjD,UAAM,QAAQ,YAAY,MAAM,YAAY,CAAC,EAAE,KAAA;AAC/C,QAAI,aAAa,MAAM,UAAU,GAAI;AACrC,UAAM,MAAM,SAAS,WAAW,IAAI,IAChC,WACA,SAAS;AAAA,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UACpC,UAAU,IACN,UACA,oBAAoB,OAAwB,SAAS,KAAK;AAAA,EAAA;AAEhE,QAAM,QAAQ,kBAAkB,KAAK;AACrC,MAAI,YAAY,QAAS,OAAM,WAAW;AAC1C,MAAI,QAAQ,OAAW,OAAM,MAAM;AACnC,SAAOA,yBAAc,SAAS,OAAO,GAAG,QAAQ;AAClD;;;;"}
@@ -1,6 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
3
  const StatewireApprovalCard = require("../chat/StatewireApprovalCard.cjs");
4
+ const browserDecisionCheck = require("../chat/browser-decision-check.cjs");
4
5
  const useStatewireApprovalRequest = require("../chat/use-statewire-approval-request.cjs");
5
6
  const StatewireRunRefusalNotice = require("../chat/StatewireRunRefusalNotice.cjs");
6
7
  const StatewireQueuedMessages = require("../chat/StatewireQueuedMessages.cjs");
@@ -13,6 +14,8 @@ const WaitingOnYouBanner = require("../chat/WaitingOnYouBanner.cjs");
13
14
  const statewireContinueRun = require("./messages/statewire-continue-run.cjs");
14
15
  const interrupts = require("../agent-runtime/src/interrupts.cjs");
15
16
  exports.StatewireApprovalCard = StatewireApprovalCard.StatewireApprovalCard;
17
+ exports.useAthenaBrowserDecisionConfirmer = browserDecisionCheck.useAthenaBrowserDecisionConfirmer;
18
+ exports.useBrowserDecisionConfirmer = browserDecisionCheck.useBrowserDecisionConfirmer;
16
19
  exports.useStatewireApprovalRequest = useStatewireApprovalRequest.useStatewireApprovalRequest;
17
20
  exports.useStatewireApprovalWait = useStatewireApprovalRequest.useStatewireApprovalWait;
18
21
  exports.RUN_START_REFUSAL_FALLBACK_MESSAGE = StatewireRunRefusalNotice.RUN_START_REFUSAL_FALLBACK_MESSAGE;
@@ -1 +1 @@
1
- {"version":3,"file":"statewire.cjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"statewire.cjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -9,7 +9,8 @@
9
9
  *
10
10
  * Published as the `@athenaintel/react/chat-ui/statewire` sub-path.
11
11
  */
12
- export { StatewireApprovalCard, type StatewireApprovalCardProps, type StatewireApprovalEditorContext, type StatewireApprovalRequestContext, } from "../chat/StatewireApprovalCard";
12
+ export { StatewireApprovalCard, type StatewireApprovalCardProps, type StatewireApprovalEditorContext, type StatewireApprovalRequestContext, type StatewireDecisionAnswer, type StatewireDecisionConfirmer, } from "../chat/StatewireApprovalCard";
13
+ export { type AthenaBrowserDecisionConfirmerOptions, type BrowserDecisionConfirmerOptions, type PendingBrowserDecisionConfirm, useAthenaBrowserDecisionConfirmer, useBrowserDecisionConfirmer, } from "../chat/browser-decision-check";
13
14
  export { type StatewireApprovalRequest, type StatewireApprovalWait, type StatewireInterruptPredicate, type UseStatewireApprovalRequestOptions, useStatewireApprovalRequest, useStatewireApprovalWait, } from "../chat/use-statewire-approval-request";
14
15
  export { RUN_START_REFUSAL_FALLBACK_MESSAGE, StatewireRunRefusalNotice, type StatewireRunRefusalNoticeProps, } from "../chat/StatewireRunRefusalNotice";
15
16
  export { StatewireQueuedMessages, type StatewireQueueEditorContext, type StatewireQueueEvent, type StatewireQueueRowContentContext, type StatewireQueueRowMarkerContext, type StatewireQueuedMessagesProps, } from "../chat/StatewireQueuedMessages";
@@ -1,4 +1,5 @@
1
1
  import { StatewireApprovalCard } from "../chat/StatewireApprovalCard.js";
2
+ import { useAthenaBrowserDecisionConfirmer, useBrowserDecisionConfirmer } from "../chat/browser-decision-check.js";
2
3
  import { useStatewireApprovalRequest, useStatewireApprovalWait } from "../chat/use-statewire-approval-request.js";
3
4
  import { RUN_START_REFUSAL_FALLBACK_MESSAGE, StatewireRunRefusalNotice } from "../chat/StatewireRunRefusalNotice.js";
4
5
  import { StatewireQueuedMessages } from "../chat/StatewireQueuedMessages.js";
@@ -28,6 +29,8 @@ export {
28
29
  WaitingOnYouBannerView,
29
30
  WakeMarkerCard,
30
31
  WakeMarkerMessage,
32
+ useAthenaBrowserDecisionConfirmer,
33
+ useBrowserDecisionConfirmer,
31
34
  useStatewireApprovalRequest,
32
35
  useStatewireApprovalWait,
33
36
  useStatewireToolOutputs
@@ -1 +1 @@
1
- {"version":3,"file":"statewire.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;"}
1
+ {"version":3,"file":"statewire.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;"}
@@ -1,19 +1,46 @@
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 lucideReact = require("lucide-react");
6
- const react = require("react");
6
+ const require$$0 = require("react");
7
7
  const messageComponents = require("../messages/message-components.cjs");
8
+ const answerLabel = require("../messages/answer-label.cjs");
8
9
  const messageActionsConfig = require("../messages/message-actions-config.cjs");
9
10
  const userEditComposer = require("../messages/user-edit-composer.cjs");
10
11
  const runningIndicator = require("../messages/running-indicator.cjs");
12
+ const handoffArrivalDivider = require("../messages/handoff-arrival-divider.cjs");
11
13
  const threadChrome = require("../messages/thread-chrome.cjs");
14
+ const messages = require("../../agent-runtime/src/messages.cjs");
15
+ const withArrivalDivider = /* @__PURE__ */ (() => {
16
+ const wrapped = /* @__PURE__ */ new WeakMap();
17
+ return (Message) => {
18
+ const existing = wrapped.get(Message);
19
+ if (existing) return existing;
20
+ const WithArrivalDivider = () => /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
21
+ /* @__PURE__ */ jsxRuntime.jsx(Message, {}),
22
+ /* @__PURE__ */ jsxRuntime.jsx(handoffArrivalDivider.HandoffArrivalAfterMessage, {})
23
+ ] });
24
+ wrapped.set(Message, WithArrivalDivider);
25
+ return WithArrivalDivider;
26
+ };
27
+ })();
28
+ const ROW_KEY_SEPARATOR = "\0";
29
+ const ThreadRows = ({ components }) => {
30
+ const joinedKeys = react.useAuiState(
31
+ (s) => s.thread.messages.map((message) => messages.deepAgentRowKey(message)).join(ROW_KEY_SEPARATOR)
32
+ );
33
+ const rowKeys = require$$0.useMemo(
34
+ () => joinedKeys === "" ? [] : joinedKeys.split(ROW_KEY_SEPARATOR),
35
+ [joinedKeys]
36
+ );
37
+ return /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children: rowKeys.map((key, index) => /* @__PURE__ */ jsxRuntime.jsx(react.ThreadPrimitive.MessageByIndex, { index, components }, key)) });
38
+ };
12
39
  const DEFAULT_VIEWPORT_CLASS = "relative flex flex-1 flex-col overflow-y-auto scroll-smooth";
13
40
  const DEFAULT_CONTENT_CLASS = "w-full flex-1 px-3 pt-3";
14
41
  const DEFAULT_VIEWPORT_FOOTER_CLASS = "sticky bottom-0";
15
- const DefaultScrollToBottom = () => /* @__PURE__ */ jsxRuntime.jsx(react$1.AuiIf, { condition: (state) => !state.thread.isEmpty, children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex justify-center pb-0.5", children: /* @__PURE__ */ jsxRuntime.jsx(
16
- react$1.ThreadPrimitive.ScrollToBottom,
42
+ const DefaultScrollToBottom = () => /* @__PURE__ */ jsxRuntime.jsx(react.AuiIf, { condition: (state) => !state.thread.isEmpty, children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex justify-center pb-0.5", children: /* @__PURE__ */ jsxRuntime.jsx(
43
+ react.ThreadPrimitive.ScrollToBottom,
17
44
  {
18
45
  "aria-label": "Scroll to bottom",
19
46
  title: "Scroll to bottom",
@@ -41,24 +68,26 @@ function ChatThreadShell({
41
68
  scrollToBottom = /* @__PURE__ */ jsxRuntime.jsx(DefaultScrollToBottom, {}),
42
69
  viewportFooter,
43
70
  viewportFooterClassName,
44
- readOnly = false
71
+ readOnly = false,
72
+ arrivalThreadId = null,
73
+ viewerUserId = null
45
74
  }) {
46
75
  const {
47
76
  UserMessage,
48
77
  AssistantMessage,
49
78
  UserEditComposer: UserEditComposerComponent = userEditComposer.UserEditComposer
50
79
  } = components;
51
- const messageComponents2 = react.useMemo(
80
+ const messageComponents2 = require$$0.useMemo(
52
81
  () => ({
53
- UserMessage,
54
- AssistantMessage,
82
+ UserMessage: withArrivalDivider(UserMessage),
83
+ AssistantMessage: withArrivalDivider(AssistantMessage),
55
84
  UserEditComposer: UserEditComposerComponent
56
85
  }),
57
86
  [UserMessage, AssistantMessage, UserEditComposerComponent]
58
87
  );
59
- const messages = /* @__PURE__ */ jsxRuntime.jsx(react$1.ThreadPrimitive.Messages, { components: messageComponents2 });
88
+ const messages2 = /* @__PURE__ */ jsxRuntime.jsx(handoffArrivalDivider.HandoffArrivalScope, { threadId: arrivalThreadId, children: /* @__PURE__ */ jsxRuntime.jsx(answerLabel.AnswerLabelScope, { viewerUserId, children: /* @__PURE__ */ jsxRuntime.jsx(ThreadRows, { components: messageComponents2 }) }) });
60
89
  return /* @__PURE__ */ jsxRuntime.jsx(messageActionsConfig.MessageActionsReadOnlyProvider, { readOnly, children: /* @__PURE__ */ jsxRuntime.jsxs(
61
- react$1.ThreadPrimitive.Root,
90
+ react.ThreadPrimitive.Root,
62
91
  {
63
92
  className: panelClassName ?? threadChrome.THREAD_PANEL_CLASS,
64
93
  style: { "--thread-max-width": maxWidth },
@@ -67,7 +96,7 @@ function ChatThreadShell({
67
96
  header,
68
97
  banners,
69
98
  /* @__PURE__ */ jsxRuntime.jsxs(
70
- react$1.ThreadPrimitive.Viewport,
99
+ react.ThreadPrimitive.Viewport,
71
100
  {
72
101
  turnAnchor,
73
102
  className: viewportClassName ?? DEFAULT_VIEWPORT_CLASS,
@@ -75,13 +104,13 @@ function ChatThreadShell({
75
104
  children: [
76
105
  viewportOverlay,
77
106
  /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex flex-1 flex-col items-center", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: contentClassName ?? DEFAULT_CONTENT_CLASS, children: [
78
- welcome != null ? /* @__PURE__ */ jsxRuntime.jsx(react$1.ThreadPrimitive.Empty, { children: welcome }) : null,
107
+ welcome != null ? /* @__PURE__ */ jsxRuntime.jsx(react.ThreadPrimitive.Empty, { children: welcome }) : null,
79
108
  beforeMessages,
80
- renderMessages ? renderMessages(messages) : messages,
109
+ renderMessages ? renderMessages(messages2) : messages2,
81
110
  runningIndicator$1
82
111
  ] }) }),
83
112
  /* @__PURE__ */ jsxRuntime.jsxs(
84
- react$1.ThreadPrimitive.ViewportFooter,
113
+ react.ThreadPrimitive.ViewportFooter,
85
114
  {
86
115
  className: viewportFooterClassName ?? DEFAULT_VIEWPORT_FOOTER_CLASS,
87
116
  children: [