@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
@@ -0,0 +1,111 @@
1
+ const BACKGROUND_UPDATE_ATTRIBUTIONS = [
2
+ { k: "origin", v: "background" }
3
+ ];
4
+ const UPDATE_ATTRIBUTIONS_TRAILER_V1 = 1;
5
+ const MESSAGE_SYNC = 0;
6
+ const MESSAGE_SYNC_UPDATE = 2;
7
+ const DOC_SCOPES = Symbol.for("@athenaintel/keryx-http/update-attribution-scopes");
8
+ function docScopes() {
9
+ const host = globalThis;
10
+ return host[DOC_SCOPES] ?? (host[DOC_SCOPES] = /* @__PURE__ */ new WeakMap());
11
+ }
12
+ function runWithDocUpdateAttributions({
13
+ doc,
14
+ attributions,
15
+ run
16
+ }) {
17
+ const scopes = docScopes();
18
+ const outer = scopes.get(doc);
19
+ scopes.set(doc, attributions);
20
+ try {
21
+ return run();
22
+ } finally {
23
+ if (outer === void 0) scopes.delete(doc);
24
+ else scopes.set(doc, outer);
25
+ }
26
+ }
27
+ function docUpdateAttributions(doc) {
28
+ return docScopes().get(doc);
29
+ }
30
+ function readVarUint({
31
+ bytes,
32
+ start
33
+ }) {
34
+ let value = 0;
35
+ let multiplier = 1;
36
+ for (let pos = start; pos < bytes.length; pos += 1) {
37
+ const byte = bytes[pos];
38
+ if (byte === void 0) return null;
39
+ value += (byte & 127) * multiplier;
40
+ if (byte < 128) return { value, next: pos + 1 };
41
+ multiplier *= 128;
42
+ if (multiplier > Number.MAX_SAFE_INTEGER) return null;
43
+ }
44
+ return null;
45
+ }
46
+ function writeVarUint({ out, value }) {
47
+ let rest = value;
48
+ while (rest > 127) {
49
+ out.push(128 | rest % 128);
50
+ rest = Math.floor(rest / 128);
51
+ }
52
+ out.push(rest);
53
+ }
54
+ function isBareSyncUpdate(message) {
55
+ const type = readVarUint({ bytes: message, start: 0 });
56
+ if ((type == null ? void 0 : type.value) !== MESSAGE_SYNC) return false;
57
+ const syncType = readVarUint({ bytes: message, start: type.next });
58
+ if ((syncType == null ? void 0 : syncType.value) !== MESSAGE_SYNC_UPDATE) return false;
59
+ const length = readVarUint({ bytes: message, start: syncType.next });
60
+ return length !== null && length.next + length.value === message.length;
61
+ }
62
+ function withUpdateAttributionsTrailer({
63
+ message,
64
+ attributions
65
+ }) {
66
+ if (attributions.length === 0 || !isBareSyncUpdate(message)) return message;
67
+ const trailer = [];
68
+ writeVarUint({ out: trailer, value: UPDATE_ATTRIBUTIONS_TRAILER_V1 });
69
+ writeVarUint({ out: trailer, value: attributions.length });
70
+ const utf8 = new TextEncoder();
71
+ for (const { k, v } of attributions) {
72
+ for (const text of [k, v]) {
73
+ const bytes = utf8.encode(text);
74
+ writeVarUint({ out: trailer, value: bytes.length });
75
+ for (const byte of bytes) trailer.push(byte);
76
+ }
77
+ }
78
+ const out = new Uint8Array(message.length + trailer.length);
79
+ out.set(message, 0);
80
+ out.set(trailer, message.length);
81
+ return out;
82
+ }
83
+ function attributingWebSocket({
84
+ Base,
85
+ attributionsFor
86
+ }) {
87
+ if (typeof Base !== "function") return Base;
88
+ return new Proxy(Base, {
89
+ construct(target, args) {
90
+ const socket = Reflect.construct(target, args);
91
+ const send = socket.send.bind(socket);
92
+ socket.send = (data) => {
93
+ const attributions = attributionsFor();
94
+ send(
95
+ attributions && data instanceof Uint8Array ? withUpdateAttributionsTrailer({ message: data, attributions }) : data
96
+ );
97
+ };
98
+ return socket;
99
+ }
100
+ });
101
+ }
102
+ export {
103
+ BACKGROUND_UPDATE_ATTRIBUTIONS,
104
+ UPDATE_ATTRIBUTIONS_TRAILER_V1,
105
+ attributingWebSocket,
106
+ docUpdateAttributions,
107
+ readVarUint,
108
+ runWithDocUpdateAttributions,
109
+ withUpdateAttributionsTrailer
110
+ };
111
+ //# sourceMappingURL=update-attributions.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"update-attributions.js","sources":["../../../../keryx-http/src/update-attributions.ts"],"sourcesContent":["/**\n * Attributions one Keryx socket update carries of its own.\n *\n * A Keryx connection's attributions are fixed when its socket opens, so every update a client\n * sends is attributed to the person whose client it is. A write the client makes on its own (the\n * sheet leader re-issuing `=AOP` formulas or re-pushing `=IMPORTRANGE` values, a restored result,\n * an editor binding re-keying what an older binding stored) read as that person's edit and woke\n * \"people only\" subscriptions. Keryx reads a trailer after the update in a sync update message\n * (`readUpdateAttributions` in `patches/@y%2Fhub@0.10.1.patch`): `varUint(1)`, `varUint(n)`, then\n * `n` pairs of `varString` key and value. It accepts only `origin: background`, which it counts as\n * system work (`actorOf` in `keryx/src/compaction-activity.ts`), and the pairs that name a Quick\n * Edit step (`@athenaintel/keryx-http/quick-edit`: `session_id`/`run_kind` on the apply,\n * `quick_edit_undo`/`quick_edit_redo` with `quick_edit_op` on an undo or redo), each value in\n * exactly its shape. A Keryx without that hunk reads the update and ignores the bytes after it, so\n * a trailer never costs an update; a pair it does not allow is dropped and the rest kept.\n *\n * A writer marks its writes by making them inside {@link runWithDocUpdateAttributions} for the\n * doc; the transport's socket ({@link attributingWebSocket}) appends the trailer to each sync\n * update it sends while that scope is open. Both Keryx transports wrap their sockets with it:\n * Olympus's rooms (`KeryxYjsProviderV14`) and `@athenaintel/react/collab`'s `connectGenericDoc`\n * (Midas, the phone's editor page). y-websocket sends a local update from inside the doc's\n * `update` event, which fires inside the write itself, so the trailer always rides on the update\n * the scope wrote. An update sent later (a reconnect's sync step 2 after the socket was down)\n * carries none and stays the person's, as before.\n */\n\n/** One custom attribution, as Keryx stores it on the items an update wrote. */\nexport interface UpdateAttribution {\n k: string;\n v: string;\n}\n\n/** The pair a housekeeping write carries; Agora and Keryx spell it the same way. */\nexport const BACKGROUND_UPDATE_ATTRIBUTIONS: readonly UpdateAttribution[] = [\n { k: 'origin', v: 'background' },\n];\n\n/** The trailer format Keryx reads (`updateAttributionsTrailerV1`). */\nexport const UPDATE_ATTRIBUTIONS_TRAILER_V1 = 1;\n\n/** y-protocols: a sync message, and its update sub-type. */\nconst MESSAGE_SYNC = 0;\nconst MESSAGE_SYNC_UPDATE = 2;\n\n/**\n * The open scopes live on `globalThis`, not in module scope, because two copies of this module can\n * run in one page: `@athenaintel/react` bundles it into its dist (this package is private, so the\n * published SDK must inline it) while a host may import it from this package. A scope a writer\n * opens through one copy must be the one the transport's socket reads through the other.\n */\nconst DOC_SCOPES = Symbol.for('@athenaintel/keryx-http/update-attribution-scopes');\n\ntype DocScopesHost = typeof globalThis & {\n [DOC_SCOPES]?: WeakMap<object, readonly UpdateAttribution[]>;\n};\n\n// process-local: browser-only scopes, each keyed by the doc it guards and cleared in the same synchronous call that set it\nfunction docScopes(): WeakMap<object, readonly UpdateAttribution[]> {\n const host = globalThis as DocScopesHost;\n return (host[DOC_SCOPES] ??= new WeakMap());\n}\n\n/**\n * Run `run` with every update it writes into `doc` marked with `attributions`. Synchronous only:\n * the scope ends when `run` returns. Nested scopes restore the outer one.\n */\nexport function runWithDocUpdateAttributions<T>({\n doc,\n attributions,\n run,\n}: {\n doc: object;\n attributions: readonly UpdateAttribution[];\n run: () => T;\n}): T {\n const scopes = docScopes();\n const outer = scopes.get(doc);\n scopes.set(doc, attributions);\n try {\n return run();\n } finally {\n if (outer === undefined) scopes.delete(doc);\n else scopes.set(doc, outer);\n }\n}\n\n/** The attributions the update being written into `doc` right now carries, if any. */\nexport function docUpdateAttributions(doc: object): readonly UpdateAttribution[] | undefined {\n return docScopes().get(doc);\n}\n\n/** The lib0 varUint at `start` in `bytes` and where the next field begins; `null` past the end. */\nexport function readVarUint({\n bytes,\n start,\n}: {\n bytes: Uint8Array;\n start: number;\n}): { value: number; next: number } | null {\n let value = 0;\n let multiplier = 1;\n for (let pos = start; pos < bytes.length; pos += 1) {\n const byte = bytes[pos];\n if (byte === undefined) return null;\n value += (byte & 0x7f) * multiplier;\n if (byte < 0x80) return { value, next: pos + 1 };\n multiplier *= 0x80;\n if (multiplier > Number.MAX_SAFE_INTEGER) return null;\n }\n return null;\n}\n\n/** Append `value` to `out` as a lib0 varUint. */\nfunction writeVarUint({ out, value }: { out: number[]; value: number }): void {\n let rest = value;\n while (rest > 0x7f) {\n out.push(0x80 | (rest % 0x80));\n rest = Math.floor(rest / 0x80);\n }\n out.push(rest);\n}\n\n/** Exactly one sync update message, with nothing after the update. */\nfunction isBareSyncUpdate(message: Uint8Array): boolean {\n const type = readVarUint({ bytes: message, start: 0 });\n if (type?.value !== MESSAGE_SYNC) return false;\n const syncType = readVarUint({ bytes: message, start: type.next });\n if (syncType?.value !== MESSAGE_SYNC_UPDATE) return false;\n const length = readVarUint({ bytes: message, start: syncType.next });\n return length !== null && length.next + length.value === message.length;\n}\n\n/**\n * `message` with the trailer for `attributions` appended, when it is a bare sync update message;\n * any other message (sync step 1 or 2, awareness, one that already ends in a trailer) is returned\n * as it is.\n */\nexport function withUpdateAttributionsTrailer({\n message,\n attributions,\n}: {\n message: Uint8Array;\n attributions: readonly UpdateAttribution[];\n}): Uint8Array {\n if (attributions.length === 0 || !isBareSyncUpdate(message)) return message;\n const trailer: number[] = [];\n writeVarUint({ out: trailer, value: UPDATE_ATTRIBUTIONS_TRAILER_V1 });\n writeVarUint({ out: trailer, value: attributions.length });\n const utf8 = new TextEncoder();\n for (const { k, v } of attributions) {\n for (const text of [k, v]) {\n const bytes = utf8.encode(text);\n writeVarUint({ out: trailer, value: bytes.length });\n for (const byte of bytes) trailer.push(byte);\n }\n }\n const out = new Uint8Array(message.length + trailer.length);\n out.set(message, 0);\n out.set(trailer, message.length);\n return out;\n}\n\n/** What {@link attributingWebSocket} needs of a socket: the `send` y-websocket writes frames with. */\nexport interface SendingSocket {\n send(data: string | ArrayBufferLike | Blob | ArrayBufferView): void;\n}\n\n/**\n * `Base` with `send` appending the trailer of `attributionsFor()` to each sync update it sends.\n * A `Proxy` keeps the constructor's statics and type, so it drops in as y-websocket's\n * `WebSocketPolyfill`.\n */\nexport function attributingWebSocket<TBase extends new (...args: never[]) => SendingSocket>({\n Base,\n attributionsFor,\n}: {\n Base: TBase;\n attributionsFor: () => readonly UpdateAttribution[] | undefined;\n}): TBase {\n // No WebSocket where the provider is built (server render, a test without one): nothing to wrap,\n // and the transport fails at connect as it always did.\n if (typeof Base !== 'function') return Base;\n return new Proxy(Base, {\n construct(target, args) {\n const socket: SendingSocket = Reflect.construct(target, args);\n const send = socket.send.bind(socket);\n socket.send = (data) => {\n const attributions = attributionsFor();\n send(\n attributions && data instanceof Uint8Array\n ? withUpdateAttributionsTrailer({ message: data, attributions })\n : data\n );\n };\n return socket;\n },\n });\n}\n"],"names":[],"mappings":"AAiCO,MAAM,iCAA+D;AAAA,EAC1E,EAAE,GAAG,UAAU,GAAG,aAAA;AACpB;AAGO,MAAM,iCAAiC;AAG9C,MAAM,eAAe;AACrB,MAAM,sBAAsB;AAQ5B,MAAM,aAAa,OAAO,IAAI,mDAAmD;AAOjF,SAAS,YAA2D;AAClE,QAAM,OAAO;AACb,SAAQ,wCAAqB,oBAAI,QAAA;AACnC;AAMO,SAAS,6BAAgC;AAAA,EAC9C;AAAA,EACA;AAAA,EACA;AACF,GAIM;AACJ,QAAM,SAAS,UAAA;AACf,QAAM,QAAQ,OAAO,IAAI,GAAG;AAC5B,SAAO,IAAI,KAAK,YAAY;AAC5B,MAAI;AACF,WAAO,IAAA;AAAA,EACT,UAAA;AACE,QAAI,UAAU,OAAW,QAAO,OAAO,GAAG;AAAA,QACrC,QAAO,IAAI,KAAK,KAAK;AAAA,EAC5B;AACF;AAGO,SAAS,sBAAsB,KAAuD;AAC3F,SAAO,UAAA,EAAY,IAAI,GAAG;AAC5B;AAGO,SAAS,YAAY;AAAA,EAC1B;AAAA,EACA;AACF,GAG2C;AACzC,MAAI,QAAQ;AACZ,MAAI,aAAa;AACjB,WAAS,MAAM,OAAO,MAAM,MAAM,QAAQ,OAAO,GAAG;AAClD,UAAM,OAAO,MAAM,GAAG;AACtB,QAAI,SAAS,OAAW,QAAO;AAC/B,cAAU,OAAO,OAAQ;AACzB,QAAI,OAAO,IAAM,QAAO,EAAE,OAAO,MAAM,MAAM,EAAA;AAC7C,kBAAc;AACd,QAAI,aAAa,OAAO,iBAAkB,QAAO;AAAA,EACnD;AACA,SAAO;AACT;AAGA,SAAS,aAAa,EAAE,KAAK,SAAiD;AAC5E,MAAI,OAAO;AACX,SAAO,OAAO,KAAM;AAClB,QAAI,KAAK,MAAQ,OAAO,GAAK;AAC7B,WAAO,KAAK,MAAM,OAAO,GAAI;AAAA,EAC/B;AACA,MAAI,KAAK,IAAI;AACf;AAGA,SAAS,iBAAiB,SAA8B;AACtD,QAAM,OAAO,YAAY,EAAE,OAAO,SAAS,OAAO,GAAG;AACrD,OAAI,6BAAM,WAAU,aAAc,QAAO;AACzC,QAAM,WAAW,YAAY,EAAE,OAAO,SAAS,OAAO,KAAK,MAAM;AACjE,OAAI,qCAAU,WAAU,oBAAqB,QAAO;AACpD,QAAM,SAAS,YAAY,EAAE,OAAO,SAAS,OAAO,SAAS,MAAM;AACnE,SAAO,WAAW,QAAQ,OAAO,OAAO,OAAO,UAAU,QAAQ;AACnE;AAOO,SAAS,8BAA8B;AAAA,EAC5C;AAAA,EACA;AACF,GAGe;AACb,MAAI,aAAa,WAAW,KAAK,CAAC,iBAAiB,OAAO,EAAG,QAAO;AACpE,QAAM,UAAoB,CAAA;AAC1B,eAAa,EAAE,KAAK,SAAS,OAAO,gCAAgC;AACpE,eAAa,EAAE,KAAK,SAAS,OAAO,aAAa,QAAQ;AACzD,QAAM,OAAO,IAAI,YAAA;AACjB,aAAW,EAAE,GAAG,EAAA,KAAO,cAAc;AACnC,eAAW,QAAQ,CAAC,GAAG,CAAC,GAAG;AACzB,YAAM,QAAQ,KAAK,OAAO,IAAI;AAC9B,mBAAa,EAAE,KAAK,SAAS,OAAO,MAAM,QAAQ;AAClD,iBAAW,QAAQ,MAAO,SAAQ,KAAK,IAAI;AAAA,IAC7C;AAAA,EACF;AACA,QAAM,MAAM,IAAI,WAAW,QAAQ,SAAS,QAAQ,MAAM;AAC1D,MAAI,IAAI,SAAS,CAAC;AAClB,MAAI,IAAI,SAAS,QAAQ,MAAM;AAC/B,SAAO;AACT;AAYO,SAAS,qBAA4E;AAAA,EAC1F;AAAA,EACA;AACF,GAGU;AAGR,MAAI,OAAO,SAAS,WAAY,QAAO;AACvC,SAAO,IAAI,MAAM,MAAM;AAAA,IACrB,UAAU,QAAQ,MAAM;AACtB,YAAM,SAAwB,QAAQ,UAAU,QAAQ,IAAI;AAC5D,YAAM,OAAO,OAAO,KAAK,KAAK,MAAM;AACpC,aAAO,OAAO,CAAC,SAAS;AACtB,cAAM,eAAe,gBAAA;AACrB;AAAA,UACE,gBAAgB,gBAAgB,aAC5B,8BAA8B,EAAE,SAAS,MAAM,aAAA,CAAc,IAC7D;AAAA,QAAA;AAAA,MAER;AACA,aAAO;AAAA,IACT;AAAA,EAAA,CACD;AACH;"}
@@ -1,23 +1,23 @@
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");
5
- const OwnerDocumentContext = react.createContext(null);
4
+ const require$$0 = require("react");
5
+ const OwnerDocumentContext = require$$0.createContext(null);
6
6
  function OwnerDocumentProvider({ document: doc, children }) {
7
7
  return /* @__PURE__ */ jsxRuntime.jsx(OwnerDocumentContext.Provider, { value: doc, children });
8
8
  }
9
9
  function useOwnerDocument() {
10
- const provided = react.useContext(OwnerDocumentContext);
10
+ const provided = require$$0.useContext(OwnerDocumentContext);
11
11
  if (provided) return provided;
12
12
  return typeof document !== "undefined" ? document : null;
13
13
  }
14
14
  function useIsInPopoutDocument() {
15
- const provided = react.useContext(OwnerDocumentContext);
15
+ const provided = require$$0.useContext(OwnerDocumentContext);
16
16
  return provided !== null && typeof document !== "undefined" && provided !== document;
17
17
  }
18
18
  function usePortalContainer() {
19
- const provided = react.useContext(OwnerDocumentContext);
20
- return react.useMemo(() => {
19
+ const provided = require$$0.useContext(OwnerDocumentContext);
20
+ return require$$0.useMemo(() => {
21
21
  var _a;
22
22
  if (!provided) return void 0;
23
23
  if (typeof document !== "undefined" && provided === document) return void 0;
@@ -1 +1 @@
1
- {"version":3,"file":"owner-document.cjs","sources":["../../src/lib/owner-document.tsx"],"sourcesContent":["'use client';\n\nimport { createContext, type ReactNode, useContext, useMemo } from 'react';\n\n/**\n * Which browser document a component is rendered into.\n *\n * A host pops a pane out by portaling it into a second browser window (Olympus's\n * Spaces popouts, a desktop shell's pop-out windows): the React tree keeps\n * running in the main window while its DOM lives in the popout's document.\n * Anything that reaches for the global `document` then talks to the wrong\n * window — most visibly Radix/shadcn portals, which mount menus, dialogs and\n * tooltips into the MAIN window's body while their trigger sits in the popout.\n *\n * `OwnerDocumentProvider` is mounted by the host around every popped-out\n * subtree (Olympus's Spaces popout frame wraps every tab and the popout\n * window's own layout chrome). The SDK's own portaled UI (popover, tooltip,\n * the composer's mention menu) and the host's portals read the same context.\n * In the main window nothing is provided and the hooks fall back to the\n * globals, with `usePortalContainer()` returning `undefined` so every library\n * keeps its default container.\n */\nconst OwnerDocumentContext = createContext<Document | null>(null);\n\nexport interface OwnerDocumentProviderProps {\n /** The document hosting this subtree; `null` for the main window. */\n document: Document | null;\n children: ReactNode;\n}\n\nexport function OwnerDocumentProvider({ document: doc, children }: OwnerDocumentProviderProps) {\n return <OwnerDocumentContext.Provider value={doc}>{children}</OwnerDocumentContext.Provider>;\n}\n\n/** The document this subtree renders into, or the global document when not in a popout. */\nexport function useOwnerDocument(): Document | null {\n const provided = useContext(OwnerDocumentContext);\n if (provided) return provided;\n return typeof document !== 'undefined' ? document : null;\n}\n\n/** `true` when the subtree is hosted by a popout window rather than the main document. */\nexport function useIsInPopoutDocument(): boolean {\n const provided = useContext(OwnerDocumentContext);\n return provided !== null && typeof document !== 'undefined' && provided !== document;\n}\n\n/**\n * The `container` to hand a portal so it opens in the window its trigger is\n * in: the popout's `body`, or `undefined` in the main window so the library\n * default applies. Guards against a since-closed popout window.\n */\nexport function usePortalContainer(): HTMLElement | undefined {\n const provided = useContext(OwnerDocumentContext);\n return useMemo(() => {\n if (!provided) return undefined;\n if (typeof document !== 'undefined' && provided === document) return undefined;\n if (provided.defaultView?.closed) return undefined;\n return provided.body;\n }, [provided]);\n}\n"],"names":["createContext","useContext","useMemo"],"mappings":";;;;AAsBA,MAAM,uBAAuBA,MAAAA,cAA+B,IAAI;AAQzD,SAAS,sBAAsB,EAAE,UAAU,KAAK,YAAwC;AAC7F,wCAAQ,qBAAqB,UAArB,EAA8B,OAAO,KAAM,UAAS;AAC9D;AAGO,SAAS,mBAAoC;AAClD,QAAM,WAAWC,MAAAA,WAAW,oBAAoB;AAChD,MAAI,SAAU,QAAO;AACrB,SAAO,OAAO,aAAa,cAAc,WAAW;AACtD;AAGO,SAAS,wBAAiC;AAC/C,QAAM,WAAWA,MAAAA,WAAW,oBAAoB;AAChD,SAAO,aAAa,QAAQ,OAAO,aAAa,eAAe,aAAa;AAC9E;AAOO,SAAS,qBAA8C;AAC5D,QAAM,WAAWA,MAAAA,WAAW,oBAAoB;AAChD,SAAOC,MAAAA,QAAQ,MAAM;;AACnB,QAAI,CAAC,SAAU,QAAO;AACtB,QAAI,OAAO,aAAa,eAAe,aAAa,SAAU,QAAO;AACrE,SAAI,cAAS,gBAAT,mBAAsB,OAAQ,QAAO;AACzC,WAAO,SAAS;AAAA,EAClB,GAAG,CAAC,QAAQ,CAAC;AACf;;;;;"}
1
+ {"version":3,"file":"owner-document.cjs","sources":["../../src/lib/owner-document.tsx"],"sourcesContent":["'use client';\n\nimport { createContext, type ReactNode, useContext, useMemo } from 'react';\n\n/**\n * Which browser document a component is rendered into.\n *\n * A host pops a pane out by portaling it into a second browser window (Olympus's\n * Spaces popouts, a desktop shell's pop-out windows): the React tree keeps\n * running in the main window while its DOM lives in the popout's document.\n * Anything that reaches for the global `document` then talks to the wrong\n * window — most visibly Radix/shadcn portals, which mount menus, dialogs and\n * tooltips into the MAIN window's body while their trigger sits in the popout.\n *\n * `OwnerDocumentProvider` is mounted by the host around every popped-out\n * subtree (Olympus's Spaces popout frame wraps every tab and the popout\n * window's own layout chrome). The SDK's own portaled UI (popover, tooltip,\n * the composer's mention menu) and the host's portals read the same context.\n * In the main window nothing is provided and the hooks fall back to the\n * globals, with `usePortalContainer()` returning `undefined` so every library\n * keeps its default container.\n */\nconst OwnerDocumentContext = createContext<Document | null>(null);\n\nexport interface OwnerDocumentProviderProps {\n /** The document hosting this subtree; `null` for the main window. */\n document: Document | null;\n children: ReactNode;\n}\n\nexport function OwnerDocumentProvider({ document: doc, children }: OwnerDocumentProviderProps) {\n return <OwnerDocumentContext.Provider value={doc}>{children}</OwnerDocumentContext.Provider>;\n}\n\n/** The document this subtree renders into, or the global document when not in a popout. */\nexport function useOwnerDocument(): Document | null {\n const provided = useContext(OwnerDocumentContext);\n if (provided) return provided;\n return typeof document !== 'undefined' ? document : null;\n}\n\n/** `true` when the subtree is hosted by a popout window rather than the main document. */\nexport function useIsInPopoutDocument(): boolean {\n const provided = useContext(OwnerDocumentContext);\n return provided !== null && typeof document !== 'undefined' && provided !== document;\n}\n\n/**\n * The `container` to hand a portal so it opens in the window its trigger is\n * in: the popout's `body`, or `undefined` in the main window so the library\n * default applies. Guards against a since-closed popout window.\n */\nexport function usePortalContainer(): HTMLElement | undefined {\n const provided = useContext(OwnerDocumentContext);\n return useMemo(() => {\n if (!provided) return undefined;\n if (typeof document !== 'undefined' && provided === document) return undefined;\n if (provided.defaultView?.closed) return undefined;\n return provided.body;\n }, [provided]);\n}\n"],"names":["createContext","useContext","useMemo"],"mappings":";;;;AAsBA,MAAM,uBAAuBA,WAAAA,cAA+B,IAAI;AAQzD,SAAS,sBAAsB,EAAE,UAAU,KAAK,YAAwC;AAC7F,wCAAQ,qBAAqB,UAArB,EAA8B,OAAO,KAAM,UAAS;AAC9D;AAGO,SAAS,mBAAoC;AAClD,QAAM,WAAWC,WAAAA,WAAW,oBAAoB;AAChD,MAAI,SAAU,QAAO;AACrB,SAAO,OAAO,aAAa,cAAc,WAAW;AACtD;AAGO,SAAS,wBAAiC;AAC/C,QAAM,WAAWA,WAAAA,WAAW,oBAAoB;AAChD,SAAO,aAAa,QAAQ,OAAO,aAAa,eAAe,aAAa;AAC9E;AAOO,SAAS,qBAA8C;AAC5D,QAAM,WAAWA,WAAAA,WAAW,oBAAoB;AAChD,SAAOC,WAAAA,QAAQ,MAAM;;AACnB,QAAI,CAAC,SAAU,QAAO;AACtB,QAAI,OAAO,aAAa,eAAe,aAAa,SAAU,QAAO;AACrE,SAAI,cAAS,gBAAT,mBAAsB,OAAQ,QAAO;AACzC,WAAO,SAAS;AAAA,EAClB,GAAG,CAAC,QAAQ,CAAC;AACf;;;;;"}
@@ -1,11 +1,11 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
3
  const reactQuery = require("@tanstack/react-query");
4
- const react = require("react");
4
+ const require$$0 = require("react");
5
5
  const AthenaAuthContext = require("../auth/AthenaAuthContext.cjs");
6
6
  function useAthenaQueryClient() {
7
- const contextClient = react.useContext(reactQuery.QueryClientContext);
8
- const fallbackRef = react.useRef(null);
7
+ const contextClient = require$$0.useContext(reactQuery.QueryClientContext);
8
+ const fallbackRef = require$$0.useRef(null);
9
9
  if (contextClient) return contextClient;
10
10
  fallbackRef.current ?? (fallbackRef.current = new reactQuery.QueryClient());
11
11
  return fallbackRef.current;
@@ -28,7 +28,7 @@ function credentialFingerprint(auth) {
28
28
  }
29
29
  function useAthenaQueryIdentity(auth) {
30
30
  var _a, _b;
31
- const principal = ((_b = (_a = react.useContext(AthenaAuthContext.AthenaAuthContext)) == null ? void 0 : _a.user) == null ? void 0 : _b.userId) ?? "";
31
+ const principal = ((_b = (_a = require$$0.useContext(AthenaAuthContext.AthenaAuthContext)) == null ? void 0 : _a.user) == null ? void 0 : _b.userId) ?? "";
32
32
  return [principal, credentialFingerprint(auth)];
33
33
  }
34
34
  exports.credentialFingerprint = credentialFingerprint;
@@ -1 +1 @@
1
- {"version":3,"file":"use-athena-rest-query.cjs","sources":["../../src/lib/use-athena-rest-query.ts"],"sourcesContent":["/**\n * The two pieces every SDK hook that reads an Agora REST route through\n * TanStack Query needs: a `QueryClient` under any `<AthenaProvider>`, and a\n * query-key component naming who the read is made as — without ever putting\n * the credential itself in a key.\n */\nimport { QueryClient, QueryClientContext } from '@tanstack/react-query';\nimport { useContext, useRef } from 'react';\nimport { AthenaAuthContext } from '../auth/AthenaAuthContext';\nimport type { StatewireAuthSource } from '../runtime/statewire-auth-headers';\n\n/**\n * The host's `QueryClient` when one is in context (`enableThreadList` mounts\n * the SDK's own), else a client scoped to the calling hook's component.\n */\nexport function useAthenaQueryClient(): QueryClient {\n const contextClient = useContext(QueryClientContext);\n const fallbackRef = useRef<QueryClient | null>(null);\n if (contextClient) return contextClient;\n fallbackRef.current ??= new QueryClient();\n return fallbackRef.current;\n}\n\n/** 32-bit FNV-1a of `text`, as hex. */\nfunction fnv1a(text: string): string {\n let hash = 0x811c9dc5;\n for (let index = 0; index < text.length; index += 1) {\n hash ^= text.charCodeAt(index);\n hash = Math.imul(hash, 0x01000193);\n }\n return (hash >>> 0).toString(16).padStart(8, '0');\n}\n\n/**\n * A one-way fingerprint of a query-key part that can carry a credential (an\n * opaque token or an API key inside an identity string), so the key names\n * whose it is without holding the secret.\n */\nexport function keyPartFingerprint(text: string): string {\n return fnv1a(text);\n}\n\n/**\n * A short, one-way fingerprint of the credential a request presents (the API\n * key, the token the host holds, whether a live `getToken` resolves it). It is\n * the same for every hook and every mount that reads with the same\n * credential, and different once the credential changes, so a cache entry\n * written with one credential is never read with another — while the key\n * itself carries 32 bits of hash, never the secret.\n */\nexport function credentialFingerprint(auth: StatewireAuthSource): string {\n return fnv1a(\n [auth.apiKey ?? '', auth.token ?? '', auth.getToken === undefined ? '0' : '1'].join('\\u0000'),\n );\n}\n\n/**\n * Who a query reads as, for its key: the signed-in principal (`''` when the\n * provider knows none) and the credential fingerprint. The principal covers\n * an identity switch the credential cannot show — a stable `getToken`, or a\n * same-origin cookie; the fingerprint covers a swapped API key or token. Both\n * are stable across mounts, so a pane mounted after a switch never reads the\n * previous account's cached answer.\n */\nexport function useAthenaQueryIdentity(auth: StatewireAuthSource): readonly [string, string] {\n const principal = useContext(AthenaAuthContext)?.user?.userId ?? '';\n return [principal, credentialFingerprint(auth)];\n}\n"],"names":["useContext","QueryClientContext","useRef","QueryClient","AthenaAuthContext"],"mappings":";;;;;AAeO,SAAS,uBAAoC;AAClD,QAAM,gBAAgBA,MAAAA,WAAWC,6BAAkB;AACnD,QAAM,cAAcC,MAAAA,OAA2B,IAAI;AACnD,MAAI,cAAe,QAAO;AAC1B,cAAY,YAAZ,YAAY,UAAY,IAAIC,uBAAA;AAC5B,SAAO,YAAY;AACrB;AAGA,SAAS,MAAM,MAAsB;AACnC,MAAI,OAAO;AACX,WAAS,QAAQ,GAAG,QAAQ,KAAK,QAAQ,SAAS,GAAG;AACnD,YAAQ,KAAK,WAAW,KAAK;AAC7B,WAAO,KAAK,KAAK,MAAM,QAAU;AAAA,EACnC;AACA,UAAQ,SAAS,GAAG,SAAS,EAAE,EAAE,SAAS,GAAG,GAAG;AAClD;AAOO,SAAS,mBAAmB,MAAsB;AACvD,SAAO,MAAM,IAAI;AACnB;AAUO,SAAS,sBAAsB,MAAmC;AACvE,SAAO;AAAA,IACL,CAAC,KAAK,UAAU,IAAI,KAAK,SAAS,IAAI,KAAK,aAAa,SAAY,MAAM,GAAG,EAAE,KAAK,IAAQ;AAAA,EAAA;AAEhG;AAUO,SAAS,uBAAuB,MAAsD;;AAC3F,QAAM,cAAYH,iBAAAA,WAAWI,kBAAAA,iBAAiB,MAA5BJ,mBAA+B,SAA/BA,mBAAqC,WAAU;AACjE,SAAO,CAAC,WAAW,sBAAsB,IAAI,CAAC;AAChD;;;;;"}
1
+ {"version":3,"file":"use-athena-rest-query.cjs","sources":["../../src/lib/use-athena-rest-query.ts"],"sourcesContent":["/**\n * The two pieces every SDK hook that reads an Agora REST route through\n * TanStack Query needs: a `QueryClient` under any `<AthenaProvider>`, and a\n * query-key component naming who the read is made as — without ever putting\n * the credential itself in a key.\n */\nimport { QueryClient, QueryClientContext } from '@tanstack/react-query';\nimport { useContext, useRef } from 'react';\nimport { AthenaAuthContext } from '../auth/AthenaAuthContext';\nimport type { StatewireAuthSource } from '../runtime/statewire-auth-headers';\n\n/**\n * The host's `QueryClient` when one is in context (`enableThreadList` mounts\n * the SDK's own), else a client scoped to the calling hook's component.\n */\nexport function useAthenaQueryClient(): QueryClient {\n const contextClient = useContext(QueryClientContext);\n const fallbackRef = useRef<QueryClient | null>(null);\n if (contextClient) return contextClient;\n fallbackRef.current ??= new QueryClient();\n return fallbackRef.current;\n}\n\n/** 32-bit FNV-1a of `text`, as hex. */\nfunction fnv1a(text: string): string {\n let hash = 0x811c9dc5;\n for (let index = 0; index < text.length; index += 1) {\n hash ^= text.charCodeAt(index);\n hash = Math.imul(hash, 0x01000193);\n }\n return (hash >>> 0).toString(16).padStart(8, '0');\n}\n\n/**\n * A one-way fingerprint of a query-key part that can carry a credential (an\n * opaque token or an API key inside an identity string), so the key names\n * whose it is without holding the secret.\n */\nexport function keyPartFingerprint(text: string): string {\n return fnv1a(text);\n}\n\n/**\n * A short, one-way fingerprint of the credential a request presents (the API\n * key, the token the host holds, whether a live `getToken` resolves it). It is\n * the same for every hook and every mount that reads with the same\n * credential, and different once the credential changes, so a cache entry\n * written with one credential is never read with another — while the key\n * itself carries 32 bits of hash, never the secret.\n */\nexport function credentialFingerprint(auth: StatewireAuthSource): string {\n return fnv1a(\n [auth.apiKey ?? '', auth.token ?? '', auth.getToken === undefined ? '0' : '1'].join('\\u0000'),\n );\n}\n\n/**\n * Who a query reads as, for its key: the signed-in principal (`''` when the\n * provider knows none) and the credential fingerprint. The principal covers\n * an identity switch the credential cannot show — a stable `getToken`, or a\n * same-origin cookie; the fingerprint covers a swapped API key or token. Both\n * are stable across mounts, so a pane mounted after a switch never reads the\n * previous account's cached answer.\n */\nexport function useAthenaQueryIdentity(auth: StatewireAuthSource): readonly [string, string] {\n const principal = useContext(AthenaAuthContext)?.user?.userId ?? '';\n return [principal, credentialFingerprint(auth)];\n}\n"],"names":["useContext","QueryClientContext","useRef","QueryClient","AthenaAuthContext"],"mappings":";;;;;AAeO,SAAS,uBAAoC;AAClD,QAAM,gBAAgBA,WAAAA,WAAWC,6BAAkB;AACnD,QAAM,cAAcC,WAAAA,OAA2B,IAAI;AACnD,MAAI,cAAe,QAAO;AAC1B,cAAY,YAAZ,YAAY,UAAY,IAAIC,uBAAA;AAC5B,SAAO,YAAY;AACrB;AAGA,SAAS,MAAM,MAAsB;AACnC,MAAI,OAAO;AACX,WAAS,QAAQ,GAAG,QAAQ,KAAK,QAAQ,SAAS,GAAG;AACnD,YAAQ,KAAK,WAAW,KAAK;AAC7B,WAAO,KAAK,KAAK,MAAM,QAAU;AAAA,EACnC;AACA,UAAQ,SAAS,GAAG,SAAS,EAAE,EAAE,SAAS,GAAG,GAAG;AAClD;AAOO,SAAS,mBAAmB,MAAsB;AACvD,SAAO,MAAM,IAAI;AACnB;AAUO,SAAS,sBAAsB,MAAmC;AACvE,SAAO;AAAA,IACL,CAAC,KAAK,UAAU,IAAI,KAAK,SAAS,IAAI,KAAK,aAAa,SAAY,MAAM,GAAG,EAAE,KAAK,IAAQ;AAAA,EAAA;AAEhG;AAUO,SAAS,uBAAuB,MAAsD;;AAC3F,QAAM,cAAYH,sBAAAA,WAAWI,kBAAAA,iBAAiB,MAA5BJ,mBAA+B,SAA/BA,mBAAqC,WAAU;AACjE,SAAO,CAAC,WAAW,sBAAsB,IAAI,CAAC;AAChD;;;;;"}
@@ -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
  function isActive(doc) {
5
5
  if (!doc) return false;
6
6
  return doc.visibilityState === "visible" && doc.hasFocus();
@@ -32,9 +32,9 @@ function subscribeTo(doc, onChange) {
32
32
  };
33
33
  }
34
34
  function useDocumentActive(doc) {
35
- const subscribe = react.useCallback((onChange) => subscribeTo(doc, onChange), [doc]);
36
- const getSnapshot = react.useCallback(() => isActive(doc), [doc]);
37
- return react.useSyncExternalStore(subscribe, getSnapshot, getServerSnapshot);
35
+ const subscribe = require$$0.useCallback((onChange) => subscribeTo(doc, onChange), [doc]);
36
+ const getSnapshot = require$$0.useCallback(() => isActive(doc), [doc]);
37
+ return require$$0.useSyncExternalStore(subscribe, getSnapshot, getServerSnapshot);
38
38
  }
39
39
  exports.useDocumentActive = useDocumentActive;
40
40
  //# sourceMappingURL=use-document-active.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"use-document-active.cjs","sources":["../../src/lib/use-document-active.ts"],"sourcesContent":["import { useCallback, useSyncExternalStore } from 'react';\n\nfunction isActive(doc: Document | null): boolean {\n if (!doc) return false;\n return doc.visibilityState === 'visible' && doc.hasFocus();\n}\n\nfunction getServerSnapshot(): boolean {\n return false;\n}\n\nfunction subscribeTo(doc: Document | null, onChange: () => void): () => void {\n const view = doc?.defaultView;\n if (!doc || !view) return () => {};\n let afterBlur: ReturnType<typeof setTimeout> | null = null;\n // `blur` fires before focus has landed. Focus that moved into a frame of\n // this page (a computer's live desktop, an embedded asset) leaves the\n // document focused, so it is read again once the browser has moved it.\n const onBlur = () => {\n onChange();\n if (afterBlur !== null) clearTimeout(afterBlur);\n afterBlur = setTimeout(() => {\n afterBlur = null;\n onChange();\n }, 0);\n };\n view.addEventListener('focus', onChange);\n view.addEventListener('blur', onBlur);\n doc.addEventListener('visibilitychange', onChange);\n return () => {\n view.removeEventListener('focus', onChange);\n view.removeEventListener('blur', onBlur);\n doc.removeEventListener('visibilitychange', onChange);\n if (afterBlur !== null) clearTimeout(afterBlur);\n };\n}\n\n/**\n * Whether `doc` is in front of the person: visible and focused\n * (`hasFocus()`, which stays true while focus is inside a frame of the page).\n * Pass the document a subtree renders into (`useOwnerDocument()`), so a pane\n * popped out into another window reads that window. Re-read on its window's\n * `focus` / `blur` and its `visibilitychange`; nothing polls. `false` on the\n * server and without a document.\n */\nexport function useDocumentActive(doc: Document | null): boolean {\n const subscribe = useCallback((onChange: () => void) => subscribeTo(doc, onChange), [doc]);\n const getSnapshot = useCallback(() => isActive(doc), [doc]);\n return useSyncExternalStore(subscribe, getSnapshot, getServerSnapshot);\n}\n"],"names":["useCallback","useSyncExternalStore"],"mappings":";;;AAEA,SAAS,SAAS,KAA+B;AAC/C,MAAI,CAAC,IAAK,QAAO;AACjB,SAAO,IAAI,oBAAoB,aAAa,IAAI,SAAA;AAClD;AAEA,SAAS,oBAA6B;AACpC,SAAO;AACT;AAEA,SAAS,YAAY,KAAsB,UAAkC;AAC3E,QAAM,OAAO,2BAAK;AAClB,MAAI,CAAC,OAAO,CAAC,aAAa,MAAM;AAAA,EAAC;AACjC,MAAI,YAAkD;AAItD,QAAM,SAAS,MAAM;AACnB,aAAA;AACA,QAAI,cAAc,KAAM,cAAa,SAAS;AAC9C,gBAAY,WAAW,MAAM;AAC3B,kBAAY;AACZ,eAAA;AAAA,IACF,GAAG,CAAC;AAAA,EACN;AACA,OAAK,iBAAiB,SAAS,QAAQ;AACvC,OAAK,iBAAiB,QAAQ,MAAM;AACpC,MAAI,iBAAiB,oBAAoB,QAAQ;AACjD,SAAO,MAAM;AACX,SAAK,oBAAoB,SAAS,QAAQ;AAC1C,SAAK,oBAAoB,QAAQ,MAAM;AACvC,QAAI,oBAAoB,oBAAoB,QAAQ;AACpD,QAAI,cAAc,KAAM,cAAa,SAAS;AAAA,EAChD;AACF;AAUO,SAAS,kBAAkB,KAA+B;AAC/D,QAAM,YAAYA,kBAAY,CAAC,aAAyB,YAAY,KAAK,QAAQ,GAAG,CAAC,GAAG,CAAC;AACzF,QAAM,cAAcA,MAAAA,YAAY,MAAM,SAAS,GAAG,GAAG,CAAC,GAAG,CAAC;AAC1D,SAAOC,2BAAqB,WAAW,aAAa,iBAAiB;AACvE;;"}
1
+ {"version":3,"file":"use-document-active.cjs","sources":["../../src/lib/use-document-active.ts"],"sourcesContent":["import { useCallback, useSyncExternalStore } from 'react';\n\nfunction isActive(doc: Document | null): boolean {\n if (!doc) return false;\n return doc.visibilityState === 'visible' && doc.hasFocus();\n}\n\nfunction getServerSnapshot(): boolean {\n return false;\n}\n\nfunction subscribeTo(doc: Document | null, onChange: () => void): () => void {\n const view = doc?.defaultView;\n if (!doc || !view) return () => {};\n let afterBlur: ReturnType<typeof setTimeout> | null = null;\n // `blur` fires before focus has landed. Focus that moved into a frame of\n // this page (a computer's live desktop, an embedded asset) leaves the\n // document focused, so it is read again once the browser has moved it.\n const onBlur = () => {\n onChange();\n if (afterBlur !== null) clearTimeout(afterBlur);\n afterBlur = setTimeout(() => {\n afterBlur = null;\n onChange();\n }, 0);\n };\n view.addEventListener('focus', onChange);\n view.addEventListener('blur', onBlur);\n doc.addEventListener('visibilitychange', onChange);\n return () => {\n view.removeEventListener('focus', onChange);\n view.removeEventListener('blur', onBlur);\n doc.removeEventListener('visibilitychange', onChange);\n if (afterBlur !== null) clearTimeout(afterBlur);\n };\n}\n\n/**\n * Whether `doc` is in front of the person: visible and focused\n * (`hasFocus()`, which stays true while focus is inside a frame of the page).\n * Pass the document a subtree renders into (`useOwnerDocument()`), so a pane\n * popped out into another window reads that window. Re-read on its window's\n * `focus` / `blur` and its `visibilitychange`; nothing polls. `false` on the\n * server and without a document.\n */\nexport function useDocumentActive(doc: Document | null): boolean {\n const subscribe = useCallback((onChange: () => void) => subscribeTo(doc, onChange), [doc]);\n const getSnapshot = useCallback(() => isActive(doc), [doc]);\n return useSyncExternalStore(subscribe, getSnapshot, getServerSnapshot);\n}\n"],"names":["useCallback","useSyncExternalStore"],"mappings":";;;AAEA,SAAS,SAAS,KAA+B;AAC/C,MAAI,CAAC,IAAK,QAAO;AACjB,SAAO,IAAI,oBAAoB,aAAa,IAAI,SAAA;AAClD;AAEA,SAAS,oBAA6B;AACpC,SAAO;AACT;AAEA,SAAS,YAAY,KAAsB,UAAkC;AAC3E,QAAM,OAAO,2BAAK;AAClB,MAAI,CAAC,OAAO,CAAC,aAAa,MAAM;AAAA,EAAC;AACjC,MAAI,YAAkD;AAItD,QAAM,SAAS,MAAM;AACnB,aAAA;AACA,QAAI,cAAc,KAAM,cAAa,SAAS;AAC9C,gBAAY,WAAW,MAAM;AAC3B,kBAAY;AACZ,eAAA;AAAA,IACF,GAAG,CAAC;AAAA,EACN;AACA,OAAK,iBAAiB,SAAS,QAAQ;AACvC,OAAK,iBAAiB,QAAQ,MAAM;AACpC,MAAI,iBAAiB,oBAAoB,QAAQ;AACjD,SAAO,MAAM;AACX,SAAK,oBAAoB,SAAS,QAAQ;AAC1C,SAAK,oBAAoB,QAAQ,MAAM;AACvC,QAAI,oBAAoB,oBAAoB,QAAQ;AACpD,QAAI,cAAc,KAAM,cAAa,SAAS;AAAA,EAChD;AACF;AAUO,SAAS,kBAAkB,KAA+B;AAC/D,QAAM,YAAYA,uBAAY,CAAC,aAAyB,YAAY,KAAK,QAAQ,GAAG,CAAC,GAAG,CAAC;AACzF,QAAM,cAAcA,WAAAA,YAAY,MAAM,SAAS,GAAG,GAAG,CAAC,GAAG,CAAC;AAC1D,SAAOC,gCAAqB,WAAW,aAAa,iBAAiB;AACvE;;"}
@@ -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 REDUCED_MOTION_QUERY = "(prefers-reduced-motion: reduce)";
5
5
  function mediaQuery() {
6
6
  if (typeof window === "undefined" || typeof window.matchMedia !== "function") {
@@ -23,7 +23,7 @@ function getServerSnapshot() {
23
23
  return false;
24
24
  }
25
25
  function usePrefersReducedMotion() {
26
- return react.useSyncExternalStore(subscribe, getSnapshot, getServerSnapshot);
26
+ return require$$0.useSyncExternalStore(subscribe, getSnapshot, getServerSnapshot);
27
27
  }
28
28
  exports.usePrefersReducedMotion = usePrefersReducedMotion;
29
29
  //# sourceMappingURL=use-prefers-reduced-motion.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"use-prefers-reduced-motion.cjs","sources":["../../src/lib/use-prefers-reduced-motion.ts"],"sourcesContent":["import { useSyncExternalStore } from \"react\";\n\nconst REDUCED_MOTION_QUERY = \"(prefers-reduced-motion: reduce)\";\n\nfunction mediaQuery(): MediaQueryList | null {\n if (typeof window === \"undefined\" || typeof window.matchMedia !== \"function\") {\n return null;\n }\n return window.matchMedia(REDUCED_MOTION_QUERY);\n}\n\nfunction subscribe(onChange: () => void): () => void {\n const media = mediaQuery();\n if (!media) return () => {};\n media.addEventListener(\"change\", onChange);\n return () => media.removeEventListener(\"change\", onChange);\n}\n\nfunction getSnapshot(): boolean {\n return mediaQuery()?.matches ?? false;\n}\n\nfunction getServerSnapshot(): boolean {\n return false;\n}\n\n/**\n * Whether the viewer asked the OS for reduced motion. Read synchronously on\n * the client's first render (no animate-then-cancel flash); `false` on the\n * server and in environments without `matchMedia`.\n */\nexport function usePrefersReducedMotion(): boolean {\n return useSyncExternalStore(subscribe, getSnapshot, getServerSnapshot);\n}\n"],"names":["useSyncExternalStore"],"mappings":";;;AAEA,MAAM,uBAAuB;AAE7B,SAAS,aAAoC;AAC3C,MAAI,OAAO,WAAW,eAAe,OAAO,OAAO,eAAe,YAAY;AAC5E,WAAO;AAAA,EACT;AACA,SAAO,OAAO,WAAW,oBAAoB;AAC/C;AAEA,SAAS,UAAU,UAAkC;AACnD,QAAM,QAAQ,WAAA;AACd,MAAI,CAAC,MAAO,QAAO,MAAM;AAAA,EAAC;AAC1B,QAAM,iBAAiB,UAAU,QAAQ;AACzC,SAAO,MAAM,MAAM,oBAAoB,UAAU,QAAQ;AAC3D;AAEA,SAAS,cAAuB;;AAC9B,WAAO,gBAAA,MAAA,mBAAc,YAAW;AAClC;AAEA,SAAS,oBAA6B;AACpC,SAAO;AACT;AAOO,SAAS,0BAAmC;AACjD,SAAOA,2BAAqB,WAAW,aAAa,iBAAiB;AACvE;;"}
1
+ {"version":3,"file":"use-prefers-reduced-motion.cjs","sources":["../../src/lib/use-prefers-reduced-motion.ts"],"sourcesContent":["import { useSyncExternalStore } from \"react\";\n\nconst REDUCED_MOTION_QUERY = \"(prefers-reduced-motion: reduce)\";\n\nfunction mediaQuery(): MediaQueryList | null {\n if (typeof window === \"undefined\" || typeof window.matchMedia !== \"function\") {\n return null;\n }\n return window.matchMedia(REDUCED_MOTION_QUERY);\n}\n\nfunction subscribe(onChange: () => void): () => void {\n const media = mediaQuery();\n if (!media) return () => {};\n media.addEventListener(\"change\", onChange);\n return () => media.removeEventListener(\"change\", onChange);\n}\n\nfunction getSnapshot(): boolean {\n return mediaQuery()?.matches ?? false;\n}\n\nfunction getServerSnapshot(): boolean {\n return false;\n}\n\n/**\n * Whether the viewer asked the OS for reduced motion. Read synchronously on\n * the client's first render (no animate-then-cancel flash); `false` on the\n * server and in environments without `matchMedia`.\n */\nexport function usePrefersReducedMotion(): boolean {\n return useSyncExternalStore(subscribe, getSnapshot, getServerSnapshot);\n}\n"],"names":["useSyncExternalStore"],"mappings":";;;AAEA,MAAM,uBAAuB;AAE7B,SAAS,aAAoC;AAC3C,MAAI,OAAO,WAAW,eAAe,OAAO,OAAO,eAAe,YAAY;AAC5E,WAAO;AAAA,EACT;AACA,SAAO,OAAO,WAAW,oBAAoB;AAC/C;AAEA,SAAS,UAAU,UAAkC;AACnD,QAAM,QAAQ,WAAA;AACd,MAAI,CAAC,MAAO,QAAO,MAAM;AAAA,EAAC;AAC1B,QAAM,iBAAiB,UAAU,QAAQ;AACzC,SAAO,MAAM,MAAM,oBAAoB,UAAU,QAAQ;AAC3D;AAEA,SAAS,cAAuB;;AAC9B,WAAO,gBAAA,MAAA,mBAAc,YAAW;AAClC;AAEA,SAAS,oBAA6B;AACpC,SAAO;AACT;AAOO,SAAS,0BAAmC;AACjD,SAAOA,gCAAqB,WAAW,aAAa,iBAAiB;AACvE;;"}
@@ -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 threadIdContext = require("../threads/thread-id-context.cjs");
7
7
  const cnfast = require("cnfast");
8
8
  const OFFLINE_SNAPSHOT_READ_WAIT_MS = 1500;
@@ -12,8 +12,8 @@ function useKeptSnapshotsGate({
12
12
  isOffline,
13
13
  waitMs = OFFLINE_SNAPSHOT_READ_WAIT_MS
14
14
  }) {
15
- const [readFor, setReadFor] = react.useState(void 0);
16
- react.useEffect(() => {
15
+ const [readFor, setReadFor] = require$$0.useState(void 0);
16
+ require$$0.useEffect(() => {
17
17
  if (!cache) return;
18
18
  let live = true;
19
19
  const settle = () => {
@@ -30,15 +30,15 @@ function useKeptSnapshotsGate({
30
30
  clearTimeout(timer);
31
31
  };
32
32
  }, [cache, ownerId, waitMs]);
33
- const [mountedOffline] = react.useState(() => cache !== null && isOffline());
33
+ const [mountedOffline] = require$$0.useState(() => cache !== null && isOffline());
34
34
  return mountedOffline && ownerId !== null && readFor !== ownerId;
35
35
  }
36
- const AthenaOfflineSnapshotsContext = react.createContext(null);
36
+ const AthenaOfflineSnapshotsContext = require$$0.createContext(null);
37
37
  const noSubscription = () => () => void 0;
38
38
  const serverSnapshot = () => null;
39
39
  function useAthenaOfflineSnapshotAt(threadId) {
40
- const snapshots = react.useContext(AthenaOfflineSnapshotsContext);
41
- return react.useSyncExternalStore(
40
+ const snapshots = require$$0.useContext(AthenaOfflineSnapshotsContext);
41
+ return require$$0.useSyncExternalStore(
42
42
  snapshots ? (listener) => snapshots.subscribeOfflineSeeds(listener) : noSubscription,
43
43
  () => snapshots && threadId ? snapshots.offlineSeedAt(threadId) : null,
44
44
  serverSnapshot
@@ -1 +1 @@
1
- {"version":3,"file":"offline-history.cjs","sources":["../../src/offline/offline-history.tsx"],"sourcesContent":["import type { DurableThreadSnapshotCache } from '@athenaintel/agent-runtime';\nimport { CloudOffIcon } from 'lucide-react';\nimport {\n createContext,\n type FC,\n useContext,\n useEffect,\n useState,\n useSyncExternalStore,\n} from 'react';\nimport { cn } from '../lib/utils';\nimport { useAthenaThreadId } from '../threads/thread-id-context';\n\n/**\n * Opt-in: keep the chat's recent conversations, and the session list, on this device, sealed with\n * the host's key, so a reload paints them at once and they can be read while Athena can't be\n * reached (`AthenaProvider`'s `offlineHistory`). Without it nothing is stored, as before.\n *\n * - `ownerId` names whose they are (the signed-in person). Changing it drops what the previous\n * owner kept, in memory and on the device (the session list's cached pages too); nothing kept\n * under one owner is ever shown to another. Passing no `offlineHistory` any more (a deployment\n * that now keeps nothing on devices) drops it all the same.\n * - `getKey` returns the AES-GCM key that seals them, for that owner, or `null` to keep nothing\n * (no key, a deployment that keeps nothing on devices). Midas's comes from its main process,\n * kept with the OS keychain and handed to the page only for the signed-in person.\n * - `isOffline` says Athena can't be reached (the browser's own offline when omitted): then a\n * conversation opens on its last resting transcript this device holds, up to 30 days old, marked\n * \"as of\" when it was captured; a chat that mounts offline waits (at most\n * {@link OFFLINE_SNAPSHOT_READ_WAIT_MS}) for what the device kept to be read.\n */\nexport interface AthenaOfflineHistory {\n ownerId: string;\n getKey: () => Promise<CryptoKey | null>;\n isOffline?: () => boolean;\n}\n\n/**\n * How long a chat that mounts offline waits for what this device kept before it mounts without:\n * the host's key and IndexedDB answer in milliseconds unless something is stuck.\n */\nexport const OFFLINE_SNAPSHOT_READ_WAIT_MS = 1_500;\n\n/**\n * Binds `cache` to `ownerId`, and says whether a chat that mounted offline still waits for what\n * this device kept for that owner to be read (at most `waitMs`). The runtime takes a thread's seed\n * once, as it mounts, and offline that seed is all a thread can show; online it never waits, the\n * attach delivers the thread.\n */\nexport function useKeptSnapshotsGate({\n cache,\n ownerId,\n isOffline,\n waitMs = OFFLINE_SNAPSHOT_READ_WAIT_MS,\n}: {\n cache: Pick<DurableThreadSnapshotCache, 'setOwner'> | null;\n ownerId: string | null;\n isOffline: () => boolean;\n waitMs?: number;\n}): boolean {\n const [readFor, setReadFor] = useState<string | null | undefined>(undefined);\n useEffect(() => {\n if (!cache) return;\n let live = true;\n const settle = () => {\n if (live) setReadFor(ownerId);\n };\n const timer = setTimeout(settle, waitMs);\n const done = () => {\n clearTimeout(timer);\n settle();\n };\n void cache.setOwner(ownerId).then(done, done);\n return () => {\n live = false;\n clearTimeout(timer);\n };\n }, [cache, ownerId, waitMs]);\n const [mountedOffline] = useState(() => cache !== null && isOffline());\n return mountedOffline && ownerId !== null && readFor !== ownerId;\n}\n\n/** The provider's offline snapshots: when a thread on screen was captured, if it opened offline. */\nexport type AthenaOfflineSnapshots = Pick<\n DurableThreadSnapshotCache,\n 'offlineSeedAt' | 'subscribeOfflineSeeds'\n>;\n\nexport const AthenaOfflineSnapshotsContext = createContext<AthenaOfflineSnapshots | null>(null);\n\nconst noSubscription = (): (() => void) => () => undefined;\nconst serverSnapshot = (): number | null => null;\n\n/**\n * When the transcript `threadId` shows was captured, if it opened from this device while Athena\n * could not be reached; `null` once the thread's own state arrives, outside an `offlineHistory`\n * provider, or for a new chat.\n */\nexport function useAthenaOfflineSnapshotAt(threadId: string | undefined): number | null {\n const snapshots = useContext(AthenaOfflineSnapshotsContext);\n return useSyncExternalStore(\n snapshots ? (listener) => snapshots.subscribeOfflineSeeds(listener) : noSubscription,\n () => (snapshots && threadId ? snapshots.offlineSeedAt(threadId) : null),\n serverSnapshot,\n );\n}\n\nexport function formatOfflineSnapshotTime(at: number): string {\n return new Intl.DateTimeFormat(undefined, { dateStyle: 'medium', timeStyle: 'short' }).format(at);\n}\n\nexport interface OfflineSnapshotBannerProps {\n /** Applied to the outer wrapper (host padding); the banner itself is width-capped inside it. */\n className?: string;\n}\n\n/**\n * Above a conversation that opened from this device while Athena can't be reached: what is shown\n * is the conversation as it was then, not live. Renders nothing otherwise.\n */\nexport const OfflineSnapshotBanner: FC<OfflineSnapshotBannerProps> = ({ className }) => {\n const at = useAthenaOfflineSnapshotAt(useAthenaThreadId());\n if (at === null) return null;\n return (\n <div className={className}>\n <div\n role=\"status\"\n className={cn(\n 'mx-auto flex w-full max-w-(--thread-max-width) items-center gap-2 rounded-md border px-3 py-2 text-xs',\n 'border-border bg-muted text-muted-foreground',\n )}\n >\n <CloudOffIcon className=\"size-3.5 shrink-0\" aria-hidden />\n <span>Offline · this conversation as of {formatOfflineSnapshotTime(at)}</span>\n </div>\n </div>\n );\n};\n"],"names":["useState","useEffect","createContext","useContext","useSyncExternalStore","useAthenaThreadId","jsx","jsxs","cn","CloudOffIcon"],"mappings":";;;;;;;AAwCO,MAAM,gCAAgC;AAQtC,SAAS,qBAAqB;AAAA,EACnC;AAAA,EACA;AAAA,EACA;AAAA,EACA,SAAS;AACX,GAKY;AACV,QAAM,CAAC,SAAS,UAAU,IAAIA,MAAAA,SAAoC,MAAS;AAC3EC,QAAAA,UAAU,MAAM;AACd,QAAI,CAAC,MAAO;AACZ,QAAI,OAAO;AACX,UAAM,SAAS,MAAM;AACnB,UAAI,iBAAiB,OAAO;AAAA,IAC9B;AACA,UAAM,QAAQ,WAAW,QAAQ,MAAM;AACvC,UAAM,OAAO,MAAM;AACjB,mBAAa,KAAK;AAClB,aAAA;AAAA,IACF;AACA,SAAK,MAAM,SAAS,OAAO,EAAE,KAAK,MAAM,IAAI;AAC5C,WAAO,MAAM;AACX,aAAO;AACP,mBAAa,KAAK;AAAA,IACpB;AAAA,EACF,GAAG,CAAC,OAAO,SAAS,MAAM,CAAC;AAC3B,QAAM,CAAC,cAAc,IAAID,MAAAA,SAAS,MAAM,UAAU,QAAQ,WAAW;AACrE,SAAO,kBAAkB,YAAY,QAAQ,YAAY;AAC3D;AAQO,MAAM,gCAAgCE,MAAAA,cAA6C,IAAI;AAE9F,MAAM,iBAAiB,MAAoB,MAAM;AACjD,MAAM,iBAAiB,MAAqB;AAOrC,SAAS,2BAA2B,UAA6C;AACtF,QAAM,YAAYC,MAAAA,WAAW,6BAA6B;AAC1D,SAAOC,MAAAA;AAAAA,IACL,YAAY,CAAC,aAAa,UAAU,sBAAsB,QAAQ,IAAI;AAAA,IACtE,MAAO,aAAa,WAAW,UAAU,cAAc,QAAQ,IAAI;AAAA,IACnE;AAAA,EAAA;AAEJ;AAEO,SAAS,0BAA0B,IAAoB;AAC5D,SAAO,IAAI,KAAK,eAAe,QAAW,EAAE,WAAW,UAAU,WAAW,QAAA,CAAS,EAAE,OAAO,EAAE;AAClG;AAWO,MAAM,wBAAwD,CAAC,EAAE,gBAAgB;AACtF,QAAM,KAAK,2BAA2BC,gBAAAA,mBAAmB;AACzD,MAAI,OAAO,KAAM,QAAO;AACxB,SACEC,2BAAAA,IAAC,SAAI,WACH,UAAAC,2BAAAA;AAAAA,IAAC;AAAA,IAAA;AAAA,MACC,MAAK;AAAA,MACL,WAAWC,OAAAA;AAAAA,QACT;AAAA,QACA;AAAA,MAAA;AAAA,MAGF,UAAA;AAAA,QAAAF,2BAAAA,IAACG,YAAAA,cAAA,EAAa,WAAU,qBAAoB,eAAW,MAAC;AAAA,wCACvD,QAAA,EAAK,UAAA;AAAA,UAAA;AAAA,UAAmC,0BAA0B,EAAE;AAAA,QAAA,EAAA,CAAE;AAAA,MAAA;AAAA,IAAA;AAAA,EAAA,GAE3E;AAEJ;;;;;;;"}
1
+ {"version":3,"file":"offline-history.cjs","sources":["../../src/offline/offline-history.tsx"],"sourcesContent":["import type { DurableThreadSnapshotCache } from '@athenaintel/agent-runtime';\nimport { CloudOffIcon } from 'lucide-react';\nimport {\n createContext,\n type FC,\n useContext,\n useEffect,\n useState,\n useSyncExternalStore,\n} from 'react';\nimport { cn } from '../lib/utils';\nimport { useAthenaThreadId } from '../threads/thread-id-context';\n\n/**\n * Opt-in: keep the chat's recent conversations, and the session list, on this device, sealed with\n * the host's key, so a reload paints them at once and they can be read while Athena can't be\n * reached (`AthenaProvider`'s `offlineHistory`). Without it nothing is stored, as before.\n *\n * - `ownerId` names whose they are (the signed-in person). Changing it drops what the previous\n * owner kept, in memory and on the device (the session list's cached pages too); nothing kept\n * under one owner is ever shown to another. Passing no `offlineHistory` any more (a deployment\n * that now keeps nothing on devices) drops it all the same.\n * - `getKey` returns the AES-GCM key that seals them, for that owner, or `null` to keep nothing\n * (no key, a deployment that keeps nothing on devices). Midas's comes from its main process,\n * kept with the OS keychain and handed to the page only for the signed-in person.\n * - `isOffline` says Athena can't be reached (the browser's own offline when omitted): then a\n * conversation opens on its last resting transcript this device holds, up to 30 days old, marked\n * \"as of\" when it was captured; a chat that mounts offline waits (at most\n * {@link OFFLINE_SNAPSHOT_READ_WAIT_MS}) for what the device kept to be read.\n */\nexport interface AthenaOfflineHistory {\n ownerId: string;\n getKey: () => Promise<CryptoKey | null>;\n isOffline?: () => boolean;\n}\n\n/**\n * How long a chat that mounts offline waits for what this device kept before it mounts without:\n * the host's key and IndexedDB answer in milliseconds unless something is stuck.\n */\nexport const OFFLINE_SNAPSHOT_READ_WAIT_MS = 1_500;\n\n/**\n * Binds `cache` to `ownerId`, and says whether a chat that mounted offline still waits for what\n * this device kept for that owner to be read (at most `waitMs`). The runtime takes a thread's seed\n * once, as it mounts, and offline that seed is all a thread can show; online it never waits, the\n * attach delivers the thread.\n */\nexport function useKeptSnapshotsGate({\n cache,\n ownerId,\n isOffline,\n waitMs = OFFLINE_SNAPSHOT_READ_WAIT_MS,\n}: {\n cache: Pick<DurableThreadSnapshotCache, 'setOwner'> | null;\n ownerId: string | null;\n isOffline: () => boolean;\n waitMs?: number;\n}): boolean {\n const [readFor, setReadFor] = useState<string | null | undefined>(undefined);\n useEffect(() => {\n if (!cache) return;\n let live = true;\n const settle = () => {\n if (live) setReadFor(ownerId);\n };\n const timer = setTimeout(settle, waitMs);\n const done = () => {\n clearTimeout(timer);\n settle();\n };\n void cache.setOwner(ownerId).then(done, done);\n return () => {\n live = false;\n clearTimeout(timer);\n };\n }, [cache, ownerId, waitMs]);\n const [mountedOffline] = useState(() => cache !== null && isOffline());\n return mountedOffline && ownerId !== null && readFor !== ownerId;\n}\n\n/** The provider's offline snapshots: when a thread on screen was captured, if it opened offline. */\nexport type AthenaOfflineSnapshots = Pick<\n DurableThreadSnapshotCache,\n 'offlineSeedAt' | 'subscribeOfflineSeeds'\n>;\n\nexport const AthenaOfflineSnapshotsContext = createContext<AthenaOfflineSnapshots | null>(null);\n\nconst noSubscription = (): (() => void) => () => undefined;\nconst serverSnapshot = (): number | null => null;\n\n/**\n * When the transcript `threadId` shows was captured, if it opened from this device while Athena\n * could not be reached; `null` once the thread's own state arrives, outside an `offlineHistory`\n * provider, or for a new chat.\n */\nexport function useAthenaOfflineSnapshotAt(threadId: string | undefined): number | null {\n const snapshots = useContext(AthenaOfflineSnapshotsContext);\n return useSyncExternalStore(\n snapshots ? (listener) => snapshots.subscribeOfflineSeeds(listener) : noSubscription,\n () => (snapshots && threadId ? snapshots.offlineSeedAt(threadId) : null),\n serverSnapshot,\n );\n}\n\nexport function formatOfflineSnapshotTime(at: number): string {\n return new Intl.DateTimeFormat(undefined, { dateStyle: 'medium', timeStyle: 'short' }).format(at);\n}\n\nexport interface OfflineSnapshotBannerProps {\n /** Applied to the outer wrapper (host padding); the banner itself is width-capped inside it. */\n className?: string;\n}\n\n/**\n * Above a conversation that opened from this device while Athena can't be reached: what is shown\n * is the conversation as it was then, not live. Renders nothing otherwise.\n */\nexport const OfflineSnapshotBanner: FC<OfflineSnapshotBannerProps> = ({ className }) => {\n const at = useAthenaOfflineSnapshotAt(useAthenaThreadId());\n if (at === null) return null;\n return (\n <div className={className}>\n <div\n role=\"status\"\n className={cn(\n 'mx-auto flex w-full max-w-(--thread-max-width) items-center gap-2 rounded-md border px-3 py-2 text-xs',\n 'border-border bg-muted text-muted-foreground',\n )}\n >\n <CloudOffIcon className=\"size-3.5 shrink-0\" aria-hidden />\n <span>Offline · this conversation as of {formatOfflineSnapshotTime(at)}</span>\n </div>\n </div>\n );\n};\n"],"names":["useState","useEffect","createContext","useContext","useSyncExternalStore","useAthenaThreadId","jsx","jsxs","cn","CloudOffIcon"],"mappings":";;;;;;;AAwCO,MAAM,gCAAgC;AAQtC,SAAS,qBAAqB;AAAA,EACnC;AAAA,EACA;AAAA,EACA;AAAA,EACA,SAAS;AACX,GAKY;AACV,QAAM,CAAC,SAAS,UAAU,IAAIA,WAAAA,SAAoC,MAAS;AAC3EC,aAAAA,UAAU,MAAM;AACd,QAAI,CAAC,MAAO;AACZ,QAAI,OAAO;AACX,UAAM,SAAS,MAAM;AACnB,UAAI,iBAAiB,OAAO;AAAA,IAC9B;AACA,UAAM,QAAQ,WAAW,QAAQ,MAAM;AACvC,UAAM,OAAO,MAAM;AACjB,mBAAa,KAAK;AAClB,aAAA;AAAA,IACF;AACA,SAAK,MAAM,SAAS,OAAO,EAAE,KAAK,MAAM,IAAI;AAC5C,WAAO,MAAM;AACX,aAAO;AACP,mBAAa,KAAK;AAAA,IACpB;AAAA,EACF,GAAG,CAAC,OAAO,SAAS,MAAM,CAAC;AAC3B,QAAM,CAAC,cAAc,IAAID,WAAAA,SAAS,MAAM,UAAU,QAAQ,WAAW;AACrE,SAAO,kBAAkB,YAAY,QAAQ,YAAY;AAC3D;AAQO,MAAM,gCAAgCE,WAAAA,cAA6C,IAAI;AAE9F,MAAM,iBAAiB,MAAoB,MAAM;AACjD,MAAM,iBAAiB,MAAqB;AAOrC,SAAS,2BAA2B,UAA6C;AACtF,QAAM,YAAYC,WAAAA,WAAW,6BAA6B;AAC1D,SAAOC,WAAAA;AAAAA,IACL,YAAY,CAAC,aAAa,UAAU,sBAAsB,QAAQ,IAAI;AAAA,IACtE,MAAO,aAAa,WAAW,UAAU,cAAc,QAAQ,IAAI;AAAA,IACnE;AAAA,EAAA;AAEJ;AAEO,SAAS,0BAA0B,IAAoB;AAC5D,SAAO,IAAI,KAAK,eAAe,QAAW,EAAE,WAAW,UAAU,WAAW,QAAA,CAAS,EAAE,OAAO,EAAE;AAClG;AAWO,MAAM,wBAAwD,CAAC,EAAE,gBAAgB;AACtF,QAAM,KAAK,2BAA2BC,gBAAAA,mBAAmB;AACzD,MAAI,OAAO,KAAM,QAAO;AACxB,SACEC,2BAAAA,IAAC,SAAI,WACH,UAAAC,2BAAAA;AAAAA,IAAC;AAAA,IAAA;AAAA,MACC,MAAK;AAAA,MACL,WAAWC,OAAAA;AAAAA,QACT;AAAA,QACA;AAAA,MAAA;AAAA,MAGF,UAAA;AAAA,QAAAF,2BAAAA,IAACG,YAAAA,cAAA,EAAa,WAAU,qBAAoB,eAAW,MAAC;AAAA,wCACvD,QAAA,EAAK,UAAA;AAAA,UAAA;AAAA,UAAmC,0BAA0B,EAAE;AAAA,QAAA,EAAA,CAAE;AAAA,MAAA;AAAA,IAAA;AAAA,EAAA,GAE3E;AAEJ;;;;;;;"}
@@ -1,9 +1,9 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const react = require("react");
4
- const AthenaContext = react.createContext(null);
3
+ const require$$0 = require("react");
4
+ const AthenaContext = require$$0.createContext(null);
5
5
  function useAthenaConfig() {
6
- const ctx = react.useContext(AthenaContext);
6
+ const ctx = require$$0.useContext(AthenaContext);
7
7
  if (!ctx) {
8
8
  throw new Error("[AthenaSDK] useAthenaConfig must be used within <AthenaProvider>");
9
9
  }
@@ -1 +1 @@
1
- {"version":3,"file":"AthenaContext.cjs","sources":["../../src/provider/AthenaContext.ts"],"sourcesContent":["import { createContext, useContext } from 'react';\nimport type { AthenaStatewireTokenGetter } from '../runtime/statewire-auth-headers';\nimport type { AthenaProviderConfig } from './config';\nimport type { AthenaCitationLinkOptions, AthenaLinkClickOptions } from './citation-links';\n\nexport interface AthenaConfig extends Pick<AthenaProviderConfig, 'apiKey' | 'token'> {\n backendUrl: string;\n /**\n * The SDK's live token resolver, for SDK hooks that call agora's REST\n * surface directly. Every sign-in mode feeds it (the host's `getToken`, a\n * sign-in provider, the Marathon or parent-window bridge); pass\n * `{ force: true }` after a 401 to renew the token before one resend.\n * Undefined when there is no token to resolve (API key alone).\n */\n getToken?: AthenaStatewireTokenGetter;\n appUrl: string;\n enabledToolkits: string[];\n linkClicks?: AthenaLinkClickOptions;\n citationLinks?: AthenaCitationLinkOptions;\n}\n\nexport const AthenaContext = createContext<AthenaConfig | null>(null);\n\nexport function useAthenaConfig(): AthenaConfig {\n const ctx = useContext(AthenaContext);\n if (!ctx) {\n throw new Error('[AthenaSDK] useAthenaConfig must be used within <AthenaProvider>');\n }\n return ctx;\n}\n"],"names":["createContext","useContext"],"mappings":";;;AAqBO,MAAM,gBAAgBA,MAAAA,cAAmC,IAAI;AAE7D,SAAS,kBAAgC;AAC9C,QAAM,MAAMC,MAAAA,WAAW,aAAa;AACpC,MAAI,CAAC,KAAK;AACR,UAAM,IAAI,MAAM,kEAAkE;AAAA,EACpF;AACA,SAAO;AACT;;;"}
1
+ {"version":3,"file":"AthenaContext.cjs","sources":["../../src/provider/AthenaContext.ts"],"sourcesContent":["import { createContext, useContext } from 'react';\nimport type { AthenaStatewireTokenGetter } from '../runtime/statewire-auth-headers';\nimport type { AthenaProviderConfig } from './config';\nimport type { AthenaCitationLinkOptions, AthenaLinkClickOptions } from './citation-links';\n\nexport interface AthenaConfig extends Pick<AthenaProviderConfig, 'apiKey' | 'token'> {\n backendUrl: string;\n /**\n * The SDK's live token resolver, for SDK hooks that call agora's REST\n * surface directly. Every sign-in mode feeds it (the host's `getToken`, a\n * sign-in provider, the Marathon or parent-window bridge); pass\n * `{ force: true }` after a 401 to renew the token before one resend.\n * Undefined when there is no token to resolve (API key alone).\n */\n getToken?: AthenaStatewireTokenGetter;\n appUrl: string;\n enabledToolkits: string[];\n linkClicks?: AthenaLinkClickOptions;\n citationLinks?: AthenaCitationLinkOptions;\n}\n\nexport const AthenaContext = createContext<AthenaConfig | null>(null);\n\nexport function useAthenaConfig(): AthenaConfig {\n const ctx = useContext(AthenaContext);\n if (!ctx) {\n throw new Error('[AthenaSDK] useAthenaConfig must be used within <AthenaProvider>');\n }\n return ctx;\n}\n"],"names":["createContext","useContext"],"mappings":";;;AAqBO,MAAM,gBAAgBA,WAAAA,cAAmC,IAAI;AAE7D,SAAS,kBAAgC;AAC9C,QAAM,MAAMC,WAAAA,WAAW,aAAa;AACpC,MAAI,CAAC,KAAK;AACR,UAAM,IAAI,MAAM,kEAAkE;AAAA,EACpF;AACA,SAAO;AACT;;;"}