@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
package/dist/index.d.ts CHANGED
@@ -20,15 +20,21 @@ export { AthenaAssistantActionBar, AthenaAssistantMessage, AthenaChat, AthenaRea
20
20
  export type { AthenaAssistantActionBarProps, AthenaAssistantMessageProps, AthenaChatComponents, AthenaChatMessagePartComponents, AthenaChatProps, AthenaChatVoiceOptions, AthenaReasoningPartProps, AthenaUserMessageProps, } from './chat/AthenaChat';
21
21
  export type { WelcomeSuggestion } from './chat/athena-chat-welcome';
22
22
  export { AthenaChatErrorBoundary } from './chat/AthenaChatErrorBoundary';
23
- export { type ActivityItem, type ActivityPhase, type ActivityTimelineOptions, type ActivityToolState, buildActivityTimeline, CollapsibleGroup, type CollapsibleGroupProps, countActivityTools, createToolBasedGroupingFunction, DEFAULT_TOOLKIT_THEME, defaultGetToolGroupKey, excludeFinalTextFromGroups, excludePartsFromGroups, type FinalTextPart, type FinalTextSegment, formatWorkDuration, getActivityItemLabel, getActivitySummary, getActivityToolState, getFinalText, getFinalTextParts, getReasoningLabel, type GetToolGroupKey, type GroupablePart, GroupedMessageParts, type GroupedMessagePartsProps, type GroupingFunction, type MessagePartGroup, readTurnTiming, resetRememberedExpansionsForTests, resolveActivityPhase, splitTurnSegments, SuperGroupingCard, type SuperGroupingCardProps, SuperGroupingFinalText, SuperGroupingProvider, SuperGroupingTranscript, type SuperGroupingTranscriptProps, TOOLKIT_THEMES, type ToolGroupKeyOptions, type ToolkitTheme, type TurnSegment, type TurnTiming, useActivityExpansion, workedDurationMs, } from './chat/super-grouping';
23
+ export { type ActivityItem, type ActivityPhase, type ActivityTimelineOptions, type ActivityToolState, buildActivityTimeline, CollapsibleGroup, type CollapsibleGroupProps, countActivityDelegations, countActivityTools, createToolBasedGroupingFunction, DEFAULT_TOOLKIT_THEME, defaultGetToolGroupKey, excludeFinalTextFromGroups, excludePartsFromGroups, type FinalTextPart, type FinalTextSegment, formatWorkDuration, getActivityItemLabel, getActivitySummary, getActivityToolState, getFinalText, getFinalTextParts, getReasoningLabel, type GetToolGroupKey, type GroupablePart, GroupedMessageParts, type GroupedMessagePartsProps, type GroupingFunction, type MessagePartGroup, readTurnTiming, resetRememberedExpansionsForTests, resolveActivityPhase, splitTurnSegments, SuperGroupingCard, type SuperGroupingCardProps, SuperGroupingFinalText, SuperGroupingProvider, SuperGroupingTranscript, type SuperGroupingTranscriptProps, TOOLKIT_THEMES, type ToolGroupKeyOptions, type ToolkitTheme, type ToolPartPlacement, ToolPartPlacementProvider, type TurnSegment, type TurnTiming, useActivityExpansion, useToolPartPlacement, workedDurationMs, } from './chat/super-grouping';
24
24
  export { StatewireApprovalCard } from './chat/StatewireApprovalCard';
25
- export type { StatewireApprovalCardProps, StatewireApprovalEditorContext, StatewireApprovalRequestContext, } from './chat/StatewireApprovalCard';
25
+ export type { StatewireApprovalCardProps, StatewireApprovalEditorContext, StatewireApprovalRequestContext, StatewireDecisionAnswer, StatewireDecisionConfirmer, } from './chat/StatewireApprovalCard';
26
26
  export { useStatewireApprovalRequest } from './chat/use-statewire-approval-request';
27
+ export { DeviceOperationProvider, deviceOperationStamp, UNREADABLE_DEVICE_OPERATION, useDeviceOperationReader, } from './chat/device-operation';
28
+ export type { DeviceOperationReader } from './chat/device-operation';
29
+ export { agoraApiRoot, useAthenaBrowserDecisionConfirmer, useBrowserDecisionConfirmer, } from './chat/browser-decision-check';
30
+ export type { AthenaBrowserDecisionConfirmerOptions, BrowserDecisionConfirmerOptions, PendingBrowserDecisionConfirm, } from './chat/browser-decision-check';
27
31
  export type { StatewireApprovalRequest, StatewireInterruptPredicate, UseStatewireApprovalRequestOptions, } from './chat/use-statewire-approval-request';
28
32
  export { useStatewireApprovalWait } from './chat/use-statewire-approval-request';
29
33
  export type { StatewireApprovalWait } from './chat/use-statewire-approval-request';
30
34
  export { useTurnToolCallsAwaitingApproval } from './agent-runtime/src/index';
31
35
  export { useAthenaRunLive } from './chat/use-athena-run-live';
36
+ export { useAthenaVoiceLive } from './chat/use-athena-voice-live';
37
+ export { AthenaTurnEndStatus, type AthenaTurnEndStatusProps, useAthenaTurnEnded, } from './chat/athena-turn-end-status';
32
38
  export { StatewireHistoryEdge } from './chat-ui/thread/statewire-history-edge';
33
39
  export type { StatewireHistoryEdgeProps } from './chat-ui/thread/statewire-history-edge';
34
40
  export { ThreadLoadingOverlay } from './chat-ui/thread/thread-loading-overlay';
@@ -50,6 +56,8 @@ export { athenaStatewireErrorNotice } from './runtime/statewire-lifecycle';
50
56
  export type { AthenaStatewireErrorNotice, AthenaStatewireLifecycleState, } from './runtime/statewire-lifecycle';
51
57
  export { threadSummaryFromConversation, useAthenaStatewireThreadList, } from './threads/statewire-thread-list';
52
58
  export type { AthenaStatewireThreadListState, AthenaStatewireThreadSummary, } from './threads/statewire-thread-list';
59
+ export { DrivingOnChip } from './chat/DrivingOnChip';
60
+ export type { DrivingOnChipProps } from './chat/DrivingOnChip';
53
61
  export { WaitingOnYouBanner, WaitingOnYouBannerView } from './chat/WaitingOnYouBanner';
54
62
  export type { WaitingOnYouBannerProps, WaitingOnYouBannerViewProps, } from './chat/WaitingOnYouBanner';
55
63
  export { WakeMarkerCard, WakeMarkerMessage } from './chat-ui/messages/wake-marker';
@@ -158,6 +166,8 @@ export type { ThreadFavoriteResponse, ThreadInboxDismissResponse, ThreadListFilt
158
166
  export { useRefreshThreadList } from './threads/statewire-thread-list';
159
167
  export { useAthenaThreadId, AthenaThreadIdContext, useAthenaStatewireThreadId, } from './threads/thread-id-context';
160
168
  export { useAthenaThreadModel } from './threads/use-athena-thread-model';
169
+ export { useAthenaSessionPersistence } from './provider/session-persistence-context';
170
+ export type { AthenaSessionPersistence } from './provider/session-persistence-context';
161
171
  export type { AthenaThreadModel } from './threads/use-athena-thread-model';
162
172
  export { listThreads, archiveThread, getThreadState, createThread, renameThread, setThreadReadState, setThreadFavorite, dismissThreadFromInbox, isThreadArchiveUnavailableError, isThreadFavoriteUnavailableError, isThreadRenameUnavailableError, THREAD_TITLE_MAX_LENGTH, } from './threads/api';
163
173
  export type { ThreadFavoriteTarget } from './threads/use-thread-favorite';
@@ -178,7 +188,7 @@ export type { DictationTranscribeContext, DictationTranscriber, RecordedDictatio
178
188
  export { useAthenaDictationEngine } from './dictation/use-athena-dictation-engine';
179
189
  export { composeDictationDraft, DICTATION_STATUSES } from './dictation/dictation-state';
180
190
  export type { DictationStatus, DictationTranscript } from './dictation/dictation-state';
181
- export type { AthenaChatComposerSlots, AthenaChatDictationOptions } from './chat/AthenaChat';
191
+ export type { AthenaChatComposerSlots, AthenaChatContinueByVoice, AthenaChatDictationOptions, } from './chat/AthenaChat';
182
192
  export { useAppendToComposer } from './composer/useAppendToComposer';
183
193
  export type { AppendToComposerOptions } from './composer/useAppendToComposer';
184
194
  export { useComposerReady, useFocusComposer } from './composer/composer-handoff';
@@ -218,6 +228,8 @@ export type { AthenaEnvironment } from './lib/athena-urls';
218
228
  export { Button, buttonVariants } from './ui/button';
219
229
  export { Tooltip, TooltipTrigger, TooltipContent, TooltipProvider } from './ui/tooltip';
220
230
  export { Collapsible, CollapsibleTrigger, CollapsibleContent } from './ui/collapsible';
231
+ export { ImageViewer } from './ui/image-viewer';
232
+ export type { ImageViewerImage, ImageViewerProps } from './ui/image-viewer';
221
233
  export { OwnerDocumentProvider, useIsInPopoutDocument, useOwnerDocument, usePortalContainer, } from './lib/owner-document';
222
234
  export type { OwnerDocumentProviderProps } from './lib/owner-document';
223
235
  export { a1AnchorCell, a1RangeBounds, columnLettersToNumber, columnNumberToLetters, formatA1Cell, formatA1Range, parseA1Range, RANGE_PREVIEW_MAX_COLUMNS, RANGE_PREVIEW_MAX_ROWS, RangePreviewTable, rangePreviewFromCellMap, rangePreviewFromRows, rangePreviewToTableData, SHEET_MAX_COLUMN, SHEET_MAX_ROW, splitSheetPrefix, } from './sheet-range';
package/dist/index.js CHANGED
@@ -10,18 +10,24 @@ import { capturePosthogEvent, capturePosthogException, getPosthogCaptureGate, wr
10
10
  import { buildCoalescedCaptureProperties, isCriticalPosthogEvent, withCaptureGateBypass } from "./lib/posthog/capture-gate.js";
11
11
  import { AthenaAssistantActionBar, AthenaAssistantMessage, AthenaChat, AthenaReasoningPart, AthenaUserMessage } from "./chat/AthenaChat.js";
12
12
  import { AthenaChatErrorBoundary } from "./chat/AthenaChatErrorBoundary.js";
13
- import { buildActivityTimeline, countActivityTools, excludeFinalTextFromGroups, excludePartsFromGroups, getActivityItemLabel, getActivitySummary, getActivityToolState, getFinalText, getFinalTextParts, getReasoningLabel, resolveActivityPhase } from "./chat/super-grouping/activity-timeline.js";
13
+ import { buildActivityTimeline, countActivityDelegations, countActivityTools, excludeFinalTextFromGroups, excludePartsFromGroups, getActivityItemLabel, getActivitySummary, getActivityToolState, getFinalText, getFinalTextParts, getReasoningLabel, resolveActivityPhase } from "./chat/super-grouping/activity-timeline.js";
14
14
  import { CollapsibleGroup, DEFAULT_TOOLKIT_THEME, SuperGroupingProvider, TOOLKIT_THEMES } from "./chat/super-grouping/CollapsibleGroup.js";
15
15
  import { GroupedMessageParts } from "./chat/super-grouping/GroupedMessageParts.js";
16
16
  import { createToolBasedGroupingFunction } from "./chat/super-grouping/grouping-function.js";
17
17
  import { SuperGroupingCard, SuperGroupingFinalText, resetRememberedExpansionsForTests, useActivityExpansion } from "./chat/super-grouping/SuperGroupingCard.js";
18
18
  import { SuperGroupingTranscript } from "./chat/super-grouping/SuperGroupingTranscript.js";
19
+ import { ToolPartPlacementProvider, useToolPartPlacement } from "./chat/super-grouping/tool-part-placement.js";
19
20
  import { splitTurnSegments } from "./chat/super-grouping/turn-segments.js";
20
21
  import { formatWorkDuration, readTurnTiming, workedDurationMs } from "./chat/super-grouping/turn-timing.js";
21
22
  import { defaultGetToolGroupKey } from "./chat/super-grouping/toolkit-map.js";
23
+ import { isSdkInlineTool } from "./tools/inline-tools.js";
22
24
  import { StatewireApprovalCard } from "./chat/StatewireApprovalCard.js";
23
25
  import { useStatewireApprovalRequest, useStatewireApprovalWait } from "./chat/use-statewire-approval-request.js";
26
+ import { DeviceOperationProvider, UNREADABLE_DEVICE_OPERATION, deviceOperationStamp, useDeviceOperationReader } from "./chat/device-operation.js";
27
+ import { agoraApiRoot, useAthenaBrowserDecisionConfirmer, useBrowserDecisionConfirmer } from "./chat/browser-decision-check.js";
24
28
  import { useAthenaRunLive } from "./chat/use-athena-run-live.js";
29
+ import { useAthenaVoiceLive } from "./chat/use-athena-voice-live.js";
30
+ import { AthenaTurnEndStatus, useAthenaTurnEnded } from "./chat/athena-turn-end-status.js";
25
31
  import { StatewireHistoryEdge } from "./chat-ui/thread/statewire-history-edge.js";
26
32
  import { ThreadLoadingOverlay } from "./chat-ui/thread/thread-loading-overlay.js";
27
33
  import { useStatewireToolOutputs } from "./provider/statewire-window-context.js";
@@ -34,6 +40,7 @@ import { collectStatewireClientTools, statewireClientToolWireEntries } from "./c
34
40
  import { useAthenaStatewireLifecycle } from "./provider/statewire-lifecycle-context.js";
35
41
  import { athenaStatewireErrorNotice } from "./runtime/statewire-lifecycle.js";
36
42
  import { threadSummaryFromConversation, useAthenaStatewireThreadList, useRefreshThreadList } from "./threads/statewire-thread-list.js";
43
+ import { DrivingOnChip } from "./chat/DrivingOnChip.js";
37
44
  import { WaitingOnYouBanner, WaitingOnYouBannerView } from "./chat/WaitingOnYouBanner.js";
38
45
  import { WakeMarkerCard, WakeMarkerMessage } from "./chat-ui/messages/wake-marker.js";
39
46
  import { OFFLINE_SNAPSHOT_READ_WAIT_MS, OfflineSnapshotBanner, formatOfflineSnapshotTime, useAthenaOfflineSnapshotAt } from "./offline/offline-history.js";
@@ -54,7 +61,6 @@ import { ToolFallback, ToolFallbackAppearanceProvider, ToolFallbackArgs, ToolFal
54
61
  import { VoiceUpdateCard, VoiceUpdateToolUI } from "./tools/voice-update-tool-ui.js";
55
62
  import { TestRecordingMarkToolUI, TestRecordingReportCard, TestRecordingStartToolUI, TestRecordingStopToolUI } from "./tools/test-recording-tool-uis.js";
56
63
  import { TEST_RECORDING_MARK_TOOL, TEST_RECORDING_START_TOOL, TEST_RECORDING_STOP_TOOL, describeTestRecordingMark, describeTestRecordingStart, formatRecordingClock, formatTestRecordingCounts, parseTestRecordingStopResult } from "./tools/test-recording-report.js";
57
- import { isSdkInlineTool } from "./tools/inline-tools.js";
58
64
  import { VoiceDelegationCard, VoiceDelegationMessage } from "./chat-ui/messages/voice-delegation-card.js";
59
65
  import { NestedPtcComponentsProvider, NestedPtcMessages, useNestedPtcComponents } from "./tools/NestedPtcMessages.js";
60
66
  import { ReadAssetToolUI } from "./tools/read-asset-tool-ui.js";
@@ -89,6 +95,7 @@ import { SESSIONS_COLUMNS, agentLabel, channelLabel, creatorLabel, groupSessions
89
95
  import { WEB_APP_ORIGIN_LABEL, groupSessions, orderedPullRequests, pullRequestChip, pullRequestChipState, sessionIndicator, sessionListGroupOf, sessionOriginBadge, sessionOriginLabel, sessionSecondaryLine } from "./threads/session-list-model.js";
90
96
  import { AthenaThreadIdContext, useAthenaStatewireThreadId, useAthenaThreadId } from "./threads/thread-id-context.js";
91
97
  import { useAthenaThreadModel } from "./threads/use-athena-thread-model.js";
98
+ import { useAthenaSessionPersistence } from "./provider/session-persistence-context.js";
92
99
  import { THREAD_TITLE_MAX_LENGTH, archiveThread, createThread, dismissThreadFromInbox, getThreadState, isThreadArchiveUnavailableError, isThreadFavoriteUnavailableError, isThreadRenameUnavailableError, listThreads, renameThread, setThreadFavorite, setThreadReadState } from "./threads/api.js";
93
100
  import { THREAD_PREFETCH_HOVER_DELAY_MS, THREAD_PREFETCH_MAX_CONCURRENT } from "./threads/thread-prefetcher.js";
94
101
  import { conversationDisplayTitle, useRestConversationHistory } from "./threads/use-rest-conversation-history.js";
@@ -119,6 +126,7 @@ import { DEFAULT_APP_URL, DEFAULT_STATEWIRE_SYNC_URL, athenaLinkAppUrl, createAt
119
126
  import { Button, buttonVariants } from "./ui/button.js";
120
127
  import { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from "./ui/tooltip.js";
121
128
  import { Collapsible, CollapsibleContent, CollapsibleTrigger } from "./ui/collapsible.js";
129
+ import { ImageViewer } from "./ui/image-viewer.js";
122
130
  import { OwnerDocumentProvider, useIsInPopoutDocument, useOwnerDocument, usePortalContainer } from "./lib/owner-document.js";
123
131
  import { SHEET_MAX_COLUMN, SHEET_MAX_ROW, a1AnchorCell, a1RangeBounds, columnLettersToNumber, columnNumberToLetters, formatA1Cell, formatA1Range, parseA1Range, splitSheetPrefix } from "./sheet-range/a1.js";
124
132
  import { RANGE_PREVIEW_MAX_COLUMNS, RANGE_PREVIEW_MAX_ROWS, rangePreviewFromCellMap, rangePreviewFromRows, rangePreviewToTableData } from "./sheet-range/range-preview.js";
@@ -153,6 +161,7 @@ export {
153
161
  AthenaReasoningPart,
154
162
  AthenaSdkError,
155
163
  AthenaThreadIdContext,
164
+ AthenaTurnEndStatus,
156
165
  AthenaUserMessage,
157
166
  AttachmentProvider,
158
167
  BrowseToolUI,
@@ -187,8 +196,10 @@ export {
187
196
  DICTATION_ENGINE_ERROR_KINDS,
188
197
  DICTATION_STATUSES,
189
198
  DescribeDatabaseToolUI,
199
+ DeviceOperationProvider,
190
200
  DictationStrip,
191
201
  DictationWaveform,
202
+ DrivingOnChip,
192
203
  EditFileToolUI,
193
204
  EmailSearchToolUI,
194
205
  ExpandableSection,
@@ -200,6 +211,7 @@ export {
200
211
  INBOX_PAGE_SIZE,
201
212
  INBOX_QUERY,
202
213
  INBOX_UNREAD_QUERY,
214
+ ImageViewer,
203
215
  Inbox,
204
216
  InboxButton,
205
217
  InstallPackageToolUI,
@@ -287,12 +299,14 @@ export {
287
299
  ToolFallbackResult,
288
300
  ToolFallbackRoot,
289
301
  ToolFallbackTrigger,
302
+ ToolPartPlacementProvider,
290
303
  Toolkits,
291
304
  Tooltip,
292
305
  TooltipContent,
293
306
  TooltipIconButton,
294
307
  TooltipProvider,
295
308
  TooltipTrigger,
309
+ UNREADABLE_DEVICE_OPERATION,
296
310
  UpdateSheetRangeToolUI,
297
311
  VoiceDelegationCard,
298
312
  VoiceDelegationMessage,
@@ -309,6 +323,7 @@ export {
309
323
  a1AnchorCell,
310
324
  a1RangeBounds,
311
325
  agentLabel,
326
+ agoraApiRoot,
312
327
  appendCitationReferenceParams,
313
328
  archiveThread,
314
329
  asHitlApproval,
@@ -341,6 +356,7 @@ export {
341
356
  computerStatusPath,
342
357
  conversationDisplayTitle,
343
358
  conversationSummaryFromIndexEntry,
359
+ countActivityDelegations,
344
360
  countActivityTools,
345
361
  countChatOutboxMessages,
346
362
  createAssetToolUI,
@@ -364,6 +380,7 @@ export {
364
380
  describeTestRecordingMark,
365
381
  describeTestRecordingStart,
366
382
  describeToolArgs,
383
+ deviceOperationStamp,
367
384
  dismissThreadFromInbox,
368
385
  excludeFinalTextFromGroups,
369
386
  excludePartsFromGroups,
@@ -492,6 +509,7 @@ export {
492
509
  useAthenaAgentCatalog,
493
510
  useAthenaAgentModelOptions,
494
511
  useAthenaAssetContent,
512
+ useAthenaBrowserDecisionConfirmer,
495
513
  useAthenaChatMode,
496
514
  useAthenaCitationLinkHandler,
497
515
  useAthenaComputerSshAccess,
@@ -506,6 +524,7 @@ export {
506
524
  useAthenaRepoSearch,
507
525
  useAthenaRunLive,
508
526
  useAthenaSessionAttention,
527
+ useAthenaSessionPersistence,
509
528
  useAthenaSessionWorkspace,
510
529
  useAthenaSessions,
511
530
  useAthenaStatewireLifecycle,
@@ -515,9 +534,13 @@ export {
515
534
  useAthenaThreadId,
516
535
  useAthenaThreadManager,
517
536
  useAthenaThreadModel,
537
+ useAthenaTurnEnded,
538
+ useAthenaVoiceLive,
518
539
  useAttachments,
540
+ useBrowserDecisionConfirmer,
519
541
  useComposerAttachment,
520
542
  useComposerReady,
543
+ useDeviceOperationReader,
521
544
  useDictation,
522
545
  useFileUpload,
523
546
  useFocusComposer,
@@ -542,6 +565,7 @@ export {
542
565
  useStatewireHistory,
543
566
  useStatewireToolOutputs,
544
567
  useToolAppearance,
568
+ useToolPartPlacement,
545
569
  useTurnToolCallsAwaitingApproval,
546
570
  windowInFrontSignal,
547
571
  withCaptureGateBypass,
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -0,0 +1,40 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
+ const updateAttributions = require("./update-attributions.cjs");
4
+ const MESSAGE_SYNC = 0;
5
+ const MESSAGE_SYNC_STEP_1 = 0;
6
+ function isDocContentFrame(frame) {
7
+ const type = updateAttributions.readVarUint({ bytes: frame, start: 0 });
8
+ if ((type == null ? void 0 : type.value) !== MESSAGE_SYNC) return false;
9
+ const syncType = updateAttributions.readVarUint({ bytes: frame, start: type.next });
10
+ if ((syncType == null ? void 0 : syncType.value) !== MESSAGE_SYNC_STEP_1) return true;
11
+ const length = updateAttributions.readVarUint({ bytes: frame, start: syncType.next });
12
+ return length === null || length.next + length.value !== frame.length;
13
+ }
14
+ function frameBytes(data) {
15
+ if (data instanceof Uint8Array) return data;
16
+ if (ArrayBuffer.isView(data))
17
+ return new Uint8Array(data.buffer, data.byteOffset, data.byteLength);
18
+ if (data instanceof ArrayBuffer) return new Uint8Array(data);
19
+ return null;
20
+ }
21
+ function receiveOnlyWebSocket({
22
+ Base
23
+ }) {
24
+ if (typeof Base !== "function") return Base;
25
+ return new Proxy(Base, {
26
+ construct(target, args) {
27
+ const socket = Reflect.construct(target, args);
28
+ const send = socket.send.bind(socket);
29
+ socket.send = (data) => {
30
+ const bytes = frameBytes(data);
31
+ if (bytes === null || isDocContentFrame(bytes)) return;
32
+ send(data);
33
+ };
34
+ return socket;
35
+ }
36
+ });
37
+ }
38
+ exports.isDocContentFrame = isDocContentFrame;
39
+ exports.receiveOnlyWebSocket = receiveOnlyWebSocket;
40
+ //# sourceMappingURL=receive-only-socket.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"receive-only-socket.cjs","sources":["../../../../keryx-http/src/receive-only-socket.ts"],"sourcesContent":["/**\n * The socket of a receive-only Keryx room (Olympus's `KeryxYjsProviderV14` with `receiveOnly`;\n * `@athenaintel/react/collab`'s `connectGenericDoc` on a read-only grant): no frame that carries\n * document content leaves it, whatever the room's token would let Keryx accept.\n *\n * y-websocket writes a sync message as `messageSync` (0), then the sync type: a sync step 1 (0)\n * holds only the client's state vector, a sync step 2 (1) and an update (2) hold content. A\n * client answers the sync step 1 Keryx sends as the socket opens with a sync step 2 of everything\n * its doc holds that Keryx lacks, so a write the client made locally would reach the room that way\n * even when its own update was never sent. Awareness, query-awareness and auth frames pass.\n */\nimport { readVarUint, type SendingSocket } from './update-attributions.js';\n\n/** y-protocols: a sync message, and its state-vector-only sub-type. */\nconst MESSAGE_SYNC = 0;\nconst MESSAGE_SYNC_STEP_1 = 0;\n\n/**\n * Whether `frame` could write to the document: a sync message that is not exactly one sync step 1\n * (the state vector and nothing after it). A frame that cannot be read is judged by its first\n * field alone, so only a sync frame is ever dropped.\n */\nexport function isDocContentFrame(frame: Uint8Array): boolean {\n const type = readVarUint({ bytes: frame, start: 0 });\n if (type?.value !== MESSAGE_SYNC) return false;\n const syncType = readVarUint({ bytes: frame, start: type.next });\n if (syncType?.value !== MESSAGE_SYNC_STEP_1) return true;\n const length = readVarUint({ bytes: frame, start: syncType.next });\n return length === null || length.next + length.value !== frame.length;\n}\n\n/** The bytes of a binary frame, or `null` for a frame that is not binary (a string, a `Blob`). */\nfunction frameBytes(data: string | ArrayBufferLike | Blob | ArrayBufferView): Uint8Array | null {\n if (data instanceof Uint8Array) return data;\n if (ArrayBuffer.isView(data))\n return new Uint8Array(data.buffer, data.byteOffset, data.byteLength);\n if (data instanceof ArrayBuffer) return new Uint8Array(data);\n return null;\n}\n\n/**\n * `Base` with `send` dropping every frame that could write to the document. A frame it cannot\n * read as bytes is dropped too: y-websocket sends only binary frames, so nothing it needs is lost.\n * A `Proxy` keeps the constructor's statics and type, so it drops in as y-websocket's\n * `WebSocketPolyfill`.\n */\nexport function receiveOnlyWebSocket<TBase extends new (...args: never[]) => SendingSocket>({\n Base,\n}: {\n Base: TBase;\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 bytes = frameBytes(data);\n if (bytes === null || isDocContentFrame(bytes)) return;\n send(data);\n };\n return socket;\n },\n });\n}\n"],"names":["readVarUint"],"mappings":";;;AAcA,MAAM,eAAe;AACrB,MAAM,sBAAsB;AAOrB,SAAS,kBAAkB,OAA4B;AAC5D,QAAM,OAAOA,mBAAAA,YAAY,EAAE,OAAO,OAAO,OAAO,GAAG;AACnD,OAAI,6BAAM,WAAU,aAAc,QAAO;AACzC,QAAM,WAAWA,mBAAAA,YAAY,EAAE,OAAO,OAAO,OAAO,KAAK,MAAM;AAC/D,OAAI,qCAAU,WAAU,oBAAqB,QAAO;AACpD,QAAM,SAASA,mBAAAA,YAAY,EAAE,OAAO,OAAO,OAAO,SAAS,MAAM;AACjE,SAAO,WAAW,QAAQ,OAAO,OAAO,OAAO,UAAU,MAAM;AACjE;AAGA,SAAS,WAAW,MAA4E;AAC9F,MAAI,gBAAgB,WAAY,QAAO;AACvC,MAAI,YAAY,OAAO,IAAI;AACzB,WAAO,IAAI,WAAW,KAAK,QAAQ,KAAK,YAAY,KAAK,UAAU;AACrE,MAAI,gBAAgB,YAAa,QAAO,IAAI,WAAW,IAAI;AAC3D,SAAO;AACT;AAQO,SAAS,qBAA4E;AAAA,EAC1F;AACF,GAEU;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,QAAQ,WAAW,IAAI;AAC7B,YAAI,UAAU,QAAQ,kBAAkB,KAAK,EAAG;AAChD,aAAK,IAAI;AAAA,MACX;AACA,aAAO;AAAA,IACT;AAAA,EAAA,CACD;AACH;;;"}
@@ -0,0 +1,27 @@
1
+ /**
2
+ * The socket of a receive-only Keryx room (Olympus's `KeryxYjsProviderV14` with `receiveOnly`;
3
+ * `@athenaintel/react/collab`'s `connectGenericDoc` on a read-only grant): no frame that carries
4
+ * document content leaves it, whatever the room's token would let Keryx accept.
5
+ *
6
+ * y-websocket writes a sync message as `messageSync` (0), then the sync type: a sync step 1 (0)
7
+ * holds only the client's state vector, a sync step 2 (1) and an update (2) hold content. A
8
+ * client answers the sync step 1 Keryx sends as the socket opens with a sync step 2 of everything
9
+ * its doc holds that Keryx lacks, so a write the client made locally would reach the room that way
10
+ * even when its own update was never sent. Awareness, query-awareness and auth frames pass.
11
+ */
12
+ import { type SendingSocket } from './update-attributions.js';
13
+ /**
14
+ * Whether `frame` could write to the document: a sync message that is not exactly one sync step 1
15
+ * (the state vector and nothing after it). A frame that cannot be read is judged by its first
16
+ * field alone, so only a sync frame is ever dropped.
17
+ */
18
+ export declare function isDocContentFrame(frame: Uint8Array): boolean;
19
+ /**
20
+ * `Base` with `send` dropping every frame that could write to the document. A frame it cannot
21
+ * read as bytes is dropped too: y-websocket sends only binary frames, so nothing it needs is lost.
22
+ * A `Proxy` keeps the constructor's statics and type, so it drops in as y-websocket's
23
+ * `WebSocketPolyfill`.
24
+ */
25
+ export declare function receiveOnlyWebSocket<TBase extends new (...args: never[]) => SendingSocket>({ Base, }: {
26
+ Base: TBase;
27
+ }): TBase;
@@ -0,0 +1,40 @@
1
+ import { readVarUint } from "./update-attributions.js";
2
+ const MESSAGE_SYNC = 0;
3
+ const MESSAGE_SYNC_STEP_1 = 0;
4
+ function isDocContentFrame(frame) {
5
+ const type = readVarUint({ bytes: frame, start: 0 });
6
+ if ((type == null ? void 0 : type.value) !== MESSAGE_SYNC) return false;
7
+ const syncType = readVarUint({ bytes: frame, start: type.next });
8
+ if ((syncType == null ? void 0 : syncType.value) !== MESSAGE_SYNC_STEP_1) return true;
9
+ const length = readVarUint({ bytes: frame, start: syncType.next });
10
+ return length === null || length.next + length.value !== frame.length;
11
+ }
12
+ function frameBytes(data) {
13
+ if (data instanceof Uint8Array) return data;
14
+ if (ArrayBuffer.isView(data))
15
+ return new Uint8Array(data.buffer, data.byteOffset, data.byteLength);
16
+ if (data instanceof ArrayBuffer) return new Uint8Array(data);
17
+ return null;
18
+ }
19
+ function receiveOnlyWebSocket({
20
+ Base
21
+ }) {
22
+ if (typeof Base !== "function") return Base;
23
+ return new Proxy(Base, {
24
+ construct(target, args) {
25
+ const socket = Reflect.construct(target, args);
26
+ const send = socket.send.bind(socket);
27
+ socket.send = (data) => {
28
+ const bytes = frameBytes(data);
29
+ if (bytes === null || isDocContentFrame(bytes)) return;
30
+ send(data);
31
+ };
32
+ return socket;
33
+ }
34
+ });
35
+ }
36
+ export {
37
+ isDocContentFrame,
38
+ receiveOnlyWebSocket
39
+ };
40
+ //# sourceMappingURL=receive-only-socket.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"receive-only-socket.js","sources":["../../../../keryx-http/src/receive-only-socket.ts"],"sourcesContent":["/**\n * The socket of a receive-only Keryx room (Olympus's `KeryxYjsProviderV14` with `receiveOnly`;\n * `@athenaintel/react/collab`'s `connectGenericDoc` on a read-only grant): no frame that carries\n * document content leaves it, whatever the room's token would let Keryx accept.\n *\n * y-websocket writes a sync message as `messageSync` (0), then the sync type: a sync step 1 (0)\n * holds only the client's state vector, a sync step 2 (1) and an update (2) hold content. A\n * client answers the sync step 1 Keryx sends as the socket opens with a sync step 2 of everything\n * its doc holds that Keryx lacks, so a write the client made locally would reach the room that way\n * even when its own update was never sent. Awareness, query-awareness and auth frames pass.\n */\nimport { readVarUint, type SendingSocket } from './update-attributions.js';\n\n/** y-protocols: a sync message, and its state-vector-only sub-type. */\nconst MESSAGE_SYNC = 0;\nconst MESSAGE_SYNC_STEP_1 = 0;\n\n/**\n * Whether `frame` could write to the document: a sync message that is not exactly one sync step 1\n * (the state vector and nothing after it). A frame that cannot be read is judged by its first\n * field alone, so only a sync frame is ever dropped.\n */\nexport function isDocContentFrame(frame: Uint8Array): boolean {\n const type = readVarUint({ bytes: frame, start: 0 });\n if (type?.value !== MESSAGE_SYNC) return false;\n const syncType = readVarUint({ bytes: frame, start: type.next });\n if (syncType?.value !== MESSAGE_SYNC_STEP_1) return true;\n const length = readVarUint({ bytes: frame, start: syncType.next });\n return length === null || length.next + length.value !== frame.length;\n}\n\n/** The bytes of a binary frame, or `null` for a frame that is not binary (a string, a `Blob`). */\nfunction frameBytes(data: string | ArrayBufferLike | Blob | ArrayBufferView): Uint8Array | null {\n if (data instanceof Uint8Array) return data;\n if (ArrayBuffer.isView(data))\n return new Uint8Array(data.buffer, data.byteOffset, data.byteLength);\n if (data instanceof ArrayBuffer) return new Uint8Array(data);\n return null;\n}\n\n/**\n * `Base` with `send` dropping every frame that could write to the document. A frame it cannot\n * read as bytes is dropped too: y-websocket sends only binary frames, so nothing it needs is lost.\n * A `Proxy` keeps the constructor's statics and type, so it drops in as y-websocket's\n * `WebSocketPolyfill`.\n */\nexport function receiveOnlyWebSocket<TBase extends new (...args: never[]) => SendingSocket>({\n Base,\n}: {\n Base: TBase;\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 bytes = frameBytes(data);\n if (bytes === null || isDocContentFrame(bytes)) return;\n send(data);\n };\n return socket;\n },\n });\n}\n"],"names":[],"mappings":";AAcA,MAAM,eAAe;AACrB,MAAM,sBAAsB;AAOrB,SAAS,kBAAkB,OAA4B;AAC5D,QAAM,OAAO,YAAY,EAAE,OAAO,OAAO,OAAO,GAAG;AACnD,OAAI,6BAAM,WAAU,aAAc,QAAO;AACzC,QAAM,WAAW,YAAY,EAAE,OAAO,OAAO,OAAO,KAAK,MAAM;AAC/D,OAAI,qCAAU,WAAU,oBAAqB,QAAO;AACpD,QAAM,SAAS,YAAY,EAAE,OAAO,OAAO,OAAO,SAAS,MAAM;AACjE,SAAO,WAAW,QAAQ,OAAO,OAAO,OAAO,UAAU,MAAM;AACjE;AAGA,SAAS,WAAW,MAA4E;AAC9F,MAAI,gBAAgB,WAAY,QAAO;AACvC,MAAI,YAAY,OAAO,IAAI;AACzB,WAAO,IAAI,WAAW,KAAK,QAAQ,KAAK,YAAY,KAAK,UAAU;AACrE,MAAI,gBAAgB,YAAa,QAAO,IAAI,WAAW,IAAI;AAC3D,SAAO;AACT;AAQO,SAAS,qBAA4E;AAAA,EAC1F;AACF,GAEU;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,QAAQ,WAAW,IAAI;AAC7B,YAAI,UAAU,QAAQ,kBAAkB,KAAK,EAAG;AAChD,aAAK,IAAI;AAAA,MACX;AACA,aAAO;AAAA,IACT;AAAA,EAAA,CACD;AACH;"}
@@ -0,0 +1,111 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
+ const BACKGROUND_UPDATE_ATTRIBUTIONS = [
4
+ { k: "origin", v: "background" }
5
+ ];
6
+ const UPDATE_ATTRIBUTIONS_TRAILER_V1 = 1;
7
+ const MESSAGE_SYNC = 0;
8
+ const MESSAGE_SYNC_UPDATE = 2;
9
+ const DOC_SCOPES = Symbol.for("@athenaintel/keryx-http/update-attribution-scopes");
10
+ function docScopes() {
11
+ const host = globalThis;
12
+ return host[DOC_SCOPES] ?? (host[DOC_SCOPES] = /* @__PURE__ */ new WeakMap());
13
+ }
14
+ function runWithDocUpdateAttributions({
15
+ doc,
16
+ attributions,
17
+ run
18
+ }) {
19
+ const scopes = docScopes();
20
+ const outer = scopes.get(doc);
21
+ scopes.set(doc, attributions);
22
+ try {
23
+ return run();
24
+ } finally {
25
+ if (outer === void 0) scopes.delete(doc);
26
+ else scopes.set(doc, outer);
27
+ }
28
+ }
29
+ function docUpdateAttributions(doc) {
30
+ return docScopes().get(doc);
31
+ }
32
+ function readVarUint({
33
+ bytes,
34
+ start
35
+ }) {
36
+ let value = 0;
37
+ let multiplier = 1;
38
+ for (let pos = start; pos < bytes.length; pos += 1) {
39
+ const byte = bytes[pos];
40
+ if (byte === void 0) return null;
41
+ value += (byte & 127) * multiplier;
42
+ if (byte < 128) return { value, next: pos + 1 };
43
+ multiplier *= 128;
44
+ if (multiplier > Number.MAX_SAFE_INTEGER) return null;
45
+ }
46
+ return null;
47
+ }
48
+ function writeVarUint({ out, value }) {
49
+ let rest = value;
50
+ while (rest > 127) {
51
+ out.push(128 | rest % 128);
52
+ rest = Math.floor(rest / 128);
53
+ }
54
+ out.push(rest);
55
+ }
56
+ function isBareSyncUpdate(message) {
57
+ const type = readVarUint({ bytes: message, start: 0 });
58
+ if ((type == null ? void 0 : type.value) !== MESSAGE_SYNC) return false;
59
+ const syncType = readVarUint({ bytes: message, start: type.next });
60
+ if ((syncType == null ? void 0 : syncType.value) !== MESSAGE_SYNC_UPDATE) return false;
61
+ const length = readVarUint({ bytes: message, start: syncType.next });
62
+ return length !== null && length.next + length.value === message.length;
63
+ }
64
+ function withUpdateAttributionsTrailer({
65
+ message,
66
+ attributions
67
+ }) {
68
+ if (attributions.length === 0 || !isBareSyncUpdate(message)) return message;
69
+ const trailer = [];
70
+ writeVarUint({ out: trailer, value: UPDATE_ATTRIBUTIONS_TRAILER_V1 });
71
+ writeVarUint({ out: trailer, value: attributions.length });
72
+ const utf8 = new TextEncoder();
73
+ for (const { k, v } of attributions) {
74
+ for (const text of [k, v]) {
75
+ const bytes = utf8.encode(text);
76
+ writeVarUint({ out: trailer, value: bytes.length });
77
+ for (const byte of bytes) trailer.push(byte);
78
+ }
79
+ }
80
+ const out = new Uint8Array(message.length + trailer.length);
81
+ out.set(message, 0);
82
+ out.set(trailer, message.length);
83
+ return out;
84
+ }
85
+ function attributingWebSocket({
86
+ Base,
87
+ attributionsFor
88
+ }) {
89
+ if (typeof Base !== "function") return Base;
90
+ return new Proxy(Base, {
91
+ construct(target, args) {
92
+ const socket = Reflect.construct(target, args);
93
+ const send = socket.send.bind(socket);
94
+ socket.send = (data) => {
95
+ const attributions = attributionsFor();
96
+ send(
97
+ attributions && data instanceof Uint8Array ? withUpdateAttributionsTrailer({ message: data, attributions }) : data
98
+ );
99
+ };
100
+ return socket;
101
+ }
102
+ });
103
+ }
104
+ exports.BACKGROUND_UPDATE_ATTRIBUTIONS = BACKGROUND_UPDATE_ATTRIBUTIONS;
105
+ exports.UPDATE_ATTRIBUTIONS_TRAILER_V1 = UPDATE_ATTRIBUTIONS_TRAILER_V1;
106
+ exports.attributingWebSocket = attributingWebSocket;
107
+ exports.docUpdateAttributions = docUpdateAttributions;
108
+ exports.readVarUint = readVarUint;
109
+ exports.runWithDocUpdateAttributions = runWithDocUpdateAttributions;
110
+ exports.withUpdateAttributionsTrailer = withUpdateAttributionsTrailer;
111
+ //# sourceMappingURL=update-attributions.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"update-attributions.cjs","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;;;;;;;;"}
@@ -0,0 +1,75 @@
1
+ /**
2
+ * Attributions one Keryx socket update carries of its own.
3
+ *
4
+ * A Keryx connection's attributions are fixed when its socket opens, so every update a client
5
+ * sends is attributed to the person whose client it is. A write the client makes on its own (the
6
+ * sheet leader re-issuing `=AOP` formulas or re-pushing `=IMPORTRANGE` values, a restored result,
7
+ * an editor binding re-keying what an older binding stored) read as that person's edit and woke
8
+ * "people only" subscriptions. Keryx reads a trailer after the update in a sync update message
9
+ * (`readUpdateAttributions` in `patches/@y%2Fhub@0.10.1.patch`): `varUint(1)`, `varUint(n)`, then
10
+ * `n` pairs of `varString` key and value. It accepts only `origin: background`, which it counts as
11
+ * system work (`actorOf` in `keryx/src/compaction-activity.ts`), and the pairs that name a Quick
12
+ * Edit step (`@athenaintel/keryx-http/quick-edit`: `session_id`/`run_kind` on the apply,
13
+ * `quick_edit_undo`/`quick_edit_redo` with `quick_edit_op` on an undo or redo), each value in
14
+ * exactly its shape. A Keryx without that hunk reads the update and ignores the bytes after it, so
15
+ * a trailer never costs an update; a pair it does not allow is dropped and the rest kept.
16
+ *
17
+ * A writer marks its writes by making them inside {@link runWithDocUpdateAttributions} for the
18
+ * doc; the transport's socket ({@link attributingWebSocket}) appends the trailer to each sync
19
+ * update it sends while that scope is open. Both Keryx transports wrap their sockets with it:
20
+ * Olympus's rooms (`KeryxYjsProviderV14`) and `@athenaintel/react/collab`'s `connectGenericDoc`
21
+ * (Midas, the phone's editor page). y-websocket sends a local update from inside the doc's
22
+ * `update` event, which fires inside the write itself, so the trailer always rides on the update
23
+ * the scope wrote. An update sent later (a reconnect's sync step 2 after the socket was down)
24
+ * carries none and stays the person's, as before.
25
+ */
26
+ /** One custom attribution, as Keryx stores it on the items an update wrote. */
27
+ export interface UpdateAttribution {
28
+ k: string;
29
+ v: string;
30
+ }
31
+ /** The pair a housekeeping write carries; Agora and Keryx spell it the same way. */
32
+ export declare const BACKGROUND_UPDATE_ATTRIBUTIONS: readonly UpdateAttribution[];
33
+ /** The trailer format Keryx reads (`updateAttributionsTrailerV1`). */
34
+ export declare const UPDATE_ATTRIBUTIONS_TRAILER_V1 = 1;
35
+ /**
36
+ * Run `run` with every update it writes into `doc` marked with `attributions`. Synchronous only:
37
+ * the scope ends when `run` returns. Nested scopes restore the outer one.
38
+ */
39
+ export declare function runWithDocUpdateAttributions<T>({ doc, attributions, run, }: {
40
+ doc: object;
41
+ attributions: readonly UpdateAttribution[];
42
+ run: () => T;
43
+ }): T;
44
+ /** The attributions the update being written into `doc` right now carries, if any. */
45
+ export declare function docUpdateAttributions(doc: object): readonly UpdateAttribution[] | undefined;
46
+ /** The lib0 varUint at `start` in `bytes` and where the next field begins; `null` past the end. */
47
+ export declare function readVarUint({ bytes, start, }: {
48
+ bytes: Uint8Array;
49
+ start: number;
50
+ }): {
51
+ value: number;
52
+ next: number;
53
+ } | null;
54
+ /**
55
+ * `message` with the trailer for `attributions` appended, when it is a bare sync update message;
56
+ * any other message (sync step 1 or 2, awareness, one that already ends in a trailer) is returned
57
+ * as it is.
58
+ */
59
+ export declare function withUpdateAttributionsTrailer({ message, attributions, }: {
60
+ message: Uint8Array;
61
+ attributions: readonly UpdateAttribution[];
62
+ }): Uint8Array;
63
+ /** What {@link attributingWebSocket} needs of a socket: the `send` y-websocket writes frames with. */
64
+ export interface SendingSocket {
65
+ send(data: string | ArrayBufferLike | Blob | ArrayBufferView): void;
66
+ }
67
+ /**
68
+ * `Base` with `send` appending the trailer of `attributionsFor()` to each sync update it sends.
69
+ * A `Proxy` keeps the constructor's statics and type, so it drops in as y-websocket's
70
+ * `WebSocketPolyfill`.
71
+ */
72
+ export declare function attributingWebSocket<TBase extends new (...args: never[]) => SendingSocket>({ Base, attributionsFor, }: {
73
+ Base: TBase;
74
+ attributionsFor: () => readonly UpdateAttribution[] | undefined;
75
+ }): TBase;