@athenaintel/react 0.42.2 → 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 (685) hide show
  1. package/README.md +225 -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/conversation-list-groups.d.ts +74 -0
  17. package/dist/agent-runtime/src/decision-checks.cjs +207 -0
  18. package/dist/agent-runtime/src/decision-checks.cjs.map +1 -0
  19. package/dist/agent-runtime/src/decision-checks.d.ts +142 -0
  20. package/dist/agent-runtime/src/decision-checks.js +207 -0
  21. package/dist/agent-runtime/src/decision-checks.js.map +1 -0
  22. package/dist/agent-runtime/src/desktop-handoff.d.ts +12 -0
  23. package/dist/agent-runtime/src/errors.cjs +18 -0
  24. package/dist/agent-runtime/src/errors.cjs.map +1 -1
  25. package/dist/agent-runtime/src/errors.d.ts +7 -0
  26. package/dist/agent-runtime/src/errors.js +18 -0
  27. package/dist/agent-runtime/src/errors.js.map +1 -1
  28. package/dist/agent-runtime/src/generated/runconfig-contract.cjs +12 -0
  29. package/dist/agent-runtime/src/generated/runconfig-contract.cjs.map +1 -1
  30. package/dist/agent-runtime/src/generated/runconfig-contract.d.ts +6 -6
  31. package/dist/agent-runtime/src/generated/runconfig-contract.js +12 -0
  32. package/dist/agent-runtime/src/generated/runconfig-contract.js.map +1 -1
  33. package/dist/agent-runtime/src/handoff-arrival.cjs +60 -0
  34. package/dist/agent-runtime/src/handoff-arrival.cjs.map +1 -0
  35. package/dist/agent-runtime/src/handoff-arrival.d.ts +46 -0
  36. package/dist/agent-runtime/src/handoff-arrival.js +60 -0
  37. package/dist/agent-runtime/src/handoff-arrival.js.map +1 -0
  38. package/dist/agent-runtime/src/index.d.ts +15 -8
  39. package/dist/agent-runtime/src/interrupts.cjs +43 -18
  40. package/dist/agent-runtime/src/interrupts.cjs.map +1 -1
  41. package/dist/agent-runtime/src/interrupts.d.ts +19 -2
  42. package/dist/agent-runtime/src/interrupts.js +28 -3
  43. package/dist/agent-runtime/src/interrupts.js.map +1 -1
  44. package/dist/agent-runtime/src/lane-history.cjs +8 -8
  45. package/dist/agent-runtime/src/lane-history.cjs.map +1 -1
  46. package/dist/agent-runtime/src/messages.cjs +43 -8
  47. package/dist/agent-runtime/src/messages.cjs.map +1 -1
  48. package/dist/agent-runtime/src/messages.d.ts +25 -3
  49. package/dist/agent-runtime/src/messages.js +43 -8
  50. package/dist/agent-runtime/src/messages.js.map +1 -1
  51. package/dist/agent-runtime/src/offline-status.cjs +36 -0
  52. package/dist/agent-runtime/src/offline-status.cjs.map +1 -0
  53. package/dist/agent-runtime/src/offline-status.d.ts +118 -3
  54. package/dist/agent-runtime/src/offline-status.js +36 -0
  55. package/dist/agent-runtime/src/offline-status.js.map +1 -0
  56. package/dist/agent-runtime/src/queue.cjs +0 -9
  57. package/dist/agent-runtime/src/queue.cjs.map +1 -1
  58. package/dist/agent-runtime/src/queue.js +0 -9
  59. package/dist/agent-runtime/src/queue.js.map +1 -1
  60. package/dist/agent-runtime/src/quota-safe-local-storage-session.cjs +9 -9
  61. package/dist/agent-runtime/src/quota-safe-local-storage-session.cjs.map +1 -1
  62. package/dist/agent-runtime/src/runtime-catalog.cjs +42 -0
  63. package/dist/agent-runtime/src/runtime-catalog.cjs.map +1 -0
  64. package/dist/agent-runtime/src/runtime-catalog.d.ts +35 -0
  65. package/dist/agent-runtime/src/runtime-catalog.js +42 -0
  66. package/dist/agent-runtime/src/runtime-catalog.js.map +1 -0
  67. package/dist/agent-runtime/src/runtime-messages.cjs.map +1 -1
  68. package/dist/agent-runtime/src/runtime-messages.d.ts +1 -1
  69. package/dist/agent-runtime/src/runtime-messages.js.map +1 -1
  70. package/dist/agent-runtime/src/runtime.d.ts +40 -0
  71. package/dist/agent-runtime/src/statewire-suspended.cjs +3 -3
  72. package/dist/agent-runtime/src/statewire-suspended.cjs.map +1 -1
  73. package/dist/agent-runtime/src/subagents.cjs +32 -2
  74. package/dist/agent-runtime/src/subagents.cjs.map +1 -1
  75. package/dist/agent-runtime/src/subagents.d.ts +9 -0
  76. package/dist/agent-runtime/src/subagents.js +30 -0
  77. package/dist/agent-runtime/src/subagents.js.map +1 -1
  78. package/dist/agent-runtime/src/thread-driver.cjs +67 -0
  79. package/dist/agent-runtime/src/thread-driver.cjs.map +1 -0
  80. package/dist/agent-runtime/src/thread-driver.d.ts +49 -0
  81. package/dist/agent-runtime/src/thread-driver.js +67 -0
  82. package/dist/agent-runtime/src/thread-driver.js.map +1 -0
  83. package/dist/agent-runtime/src/thread-handoff-flow-machine.d.ts +172 -0
  84. package/dist/agent-runtime/src/thread-handoff-protocol.d.ts +756 -0
  85. package/dist/agent-runtime/src/thread-handoff-qr.d.ts +11 -0
  86. package/dist/agent-runtime/src/thread-handoff.d.ts +3 -364
  87. package/dist/agent-runtime/src/thread-status.cjs +3 -3
  88. package/dist/agent-runtime/src/thread-status.cjs.map +1 -1
  89. package/dist/agent-runtime/src/tool-metadata.cjs +210 -33
  90. package/dist/agent-runtime/src/tool-metadata.cjs.map +1 -1
  91. package/dist/agent-runtime/src/tool-metadata.d.ts +12 -0
  92. package/dist/agent-runtime/src/tool-metadata.js +210 -33
  93. package/dist/agent-runtime/src/tool-metadata.js.map +1 -1
  94. package/dist/agent-runtime/src/tool-names.cjs +2 -0
  95. package/dist/agent-runtime/src/tool-names.cjs.map +1 -1
  96. package/dist/agent-runtime/src/tool-names.d.ts +2 -0
  97. package/dist/agent-runtime/src/tool-names.js +2 -0
  98. package/dist/agent-runtime/src/tool-names.js.map +1 -1
  99. package/dist/agent-runtime/src/types.d.ts +10 -2
  100. package/dist/agent-runtime/src/use-conversation-list.cjs +11 -11
  101. package/dist/agent-runtime/src/use-conversation-list.cjs.map +1 -1
  102. package/dist/agent-runtime/src/use-deep-agent-chat-outbox.cjs +24 -19
  103. package/dist/agent-runtime/src/use-deep-agent-chat-outbox.cjs.map +1 -1
  104. package/dist/agent-runtime/src/use-deep-agent-chat-outbox.d.ts +2 -1
  105. package/dist/agent-runtime/src/use-deep-agent-chat-outbox.js +6 -1
  106. package/dist/agent-runtime/src/use-deep-agent-chat-outbox.js.map +1 -1
  107. package/dist/agent-runtime/src/use-deep-agent-config.cjs +14 -14
  108. package/dist/agent-runtime/src/use-deep-agent-config.cjs.map +1 -1
  109. package/dist/agent-runtime/src/use-deep-agent-edit-submit.cjs +6 -6
  110. package/dist/agent-runtime/src/use-deep-agent-edit-submit.cjs.map +1 -1
  111. package/dist/agent-runtime/src/use-deep-agent-runtime.cjs +16 -16
  112. package/dist/agent-runtime/src/use-deep-agent-runtime.cjs.map +1 -1
  113. package/dist/agent-runtime/src/use-deep-agent-thread.cjs +45 -45
  114. package/dist/agent-runtime/src/use-deep-agent-thread.cjs.map +1 -1
  115. package/dist/agent-runtime/src/use-deep-agent-voice.cjs +572 -134
  116. package/dist/agent-runtime/src/use-deep-agent-voice.cjs.map +1 -1
  117. package/dist/agent-runtime/src/use-deep-agent-voice.d.ts +137 -10
  118. package/dist/agent-runtime/src/use-deep-agent-voice.js +514 -76
  119. package/dist/agent-runtime/src/use-deep-agent-voice.js.map +1 -1
  120. package/dist/agent-runtime/src/use-deep-agent-window-sync.cjs +26 -26
  121. package/dist/agent-runtime/src/use-deep-agent-window-sync.cjs.map +1 -1
  122. package/dist/agent-runtime/src/use-historical-edit-attachments.cjs +4 -4
  123. package/dist/agent-runtime/src/use-historical-edit-attachments.cjs.map +1 -1
  124. package/dist/agent-runtime/src/use-thread-handoff-flow.d.ts +28 -26
  125. package/dist/agent-runtime/src/voice-media.cjs +117 -0
  126. package/dist/agent-runtime/src/voice-media.cjs.map +1 -0
  127. package/dist/agent-runtime/src/voice-media.d.ts +49 -0
  128. package/dist/agent-runtime/src/voice-media.js +117 -0
  129. package/dist/agent-runtime/src/voice-media.js.map +1 -0
  130. package/dist/agent-runtime/src/voice-wire-types.d.ts +32 -0
  131. package/dist/assets/AssetPanel.cjs +11 -11
  132. package/dist/assets/AssetPanel.cjs.map +1 -1
  133. package/dist/assets/AthenaAssetEmbed.cjs +11 -9
  134. package/dist/assets/AthenaAssetEmbed.cjs.map +1 -1
  135. package/dist/assets/AthenaAssetEmbed.d.ts +7 -0
  136. package/dist/assets/AthenaAssetEmbed.js +4 -2
  137. package/dist/assets/AthenaAssetEmbed.js.map +1 -1
  138. package/dist/assets/AthenaLayout.cjs +16 -16
  139. package/dist/assets/AthenaLayout.cjs.map +1 -1
  140. package/dist/assets/use-asset-content.cjs +4 -4
  141. package/dist/assets/use-asset-content.cjs.map +1 -1
  142. package/dist/assets/use-asset-embed.cjs +14 -7
  143. package/dist/assets/use-asset-embed.cjs.map +1 -1
  144. package/dist/assets/use-asset-embed.d.ts +11 -1
  145. package/dist/assets/use-asset-embed.js +10 -3
  146. package/dist/assets/use-asset-embed.js.map +1 -1
  147. package/dist/auth/AthenaAuthContext.cjs +3 -3
  148. package/dist/auth/AthenaAuthContext.cjs.map +1 -1
  149. package/dist/auth/AthenaAuthProvider.cjs +8 -8
  150. package/dist/auth/AthenaAuthProvider.cjs.map +1 -1
  151. package/dist/auth/AthenaCredentialSourceContext.cjs +5 -5
  152. package/dist/auth/AthenaCredentialSourceContext.cjs.map +1 -1
  153. package/dist/auth/AthenaSSOProvider.cjs +14 -14
  154. package/dist/auth/AthenaSSOProvider.cjs.map +1 -1
  155. package/dist/auth/credential-source.cjs +26 -13
  156. package/dist/auth/credential-source.cjs.map +1 -1
  157. package/dist/auth/credential-source.d.ts +8 -0
  158. package/dist/auth/credential-source.js +26 -13
  159. package/dist/auth/credential-source.js.map +1 -1
  160. package/dist/catalog/agent-model-options.cjs +25 -17
  161. package/dist/catalog/agent-model-options.cjs.map +1 -1
  162. package/dist/catalog/agent-model-options.d.ts +38 -5
  163. package/dist/catalog/agent-model-options.js +25 -17
  164. package/dist/catalog/agent-model-options.js.map +1 -1
  165. package/dist/catalog/channel-refusal.cjs +36 -0
  166. package/dist/catalog/channel-refusal.cjs.map +1 -0
  167. package/dist/catalog/channel-refusal.d.ts +29 -0
  168. package/dist/catalog/channel-refusal.js +36 -0
  169. package/dist/catalog/channel-refusal.js.map +1 -0
  170. package/dist/catalog/chat-pickers.cjs +60 -24
  171. package/dist/catalog/chat-pickers.cjs.map +1 -1
  172. package/dist/catalog/chat-pickers.d.ts +12 -2
  173. package/dist/catalog/chat-pickers.js +56 -20
  174. package/dist/catalog/chat-pickers.js.map +1 -1
  175. package/dist/catalog/runtime-catalog.cjs +89 -23
  176. package/dist/catalog/runtime-catalog.cjs.map +1 -1
  177. package/dist/catalog/runtime-catalog.d.ts +8 -2
  178. package/dist/catalog/runtime-catalog.js +83 -17
  179. package/dist/catalog/runtime-catalog.js.map +1 -1
  180. package/dist/catalog/use-athena-chat-mode.cjs +12 -12
  181. package/dist/catalog/use-athena-chat-mode.cjs.map +1 -1
  182. package/dist/chat/AthenaChat.cjs +155 -67
  183. package/dist/chat/AthenaChat.cjs.map +1 -1
  184. package/dist/chat/AthenaChat.d.ts +42 -2
  185. package/dist/chat/AthenaChat.js +106 -18
  186. package/dist/chat/AthenaChat.js.map +1 -1
  187. package/dist/chat/AthenaChatErrorBoundary.cjs +3 -3
  188. package/dist/chat/AthenaChatErrorBoundary.cjs.map +1 -1
  189. package/dist/chat/DrivingOnChip.cjs +23 -0
  190. package/dist/chat/DrivingOnChip.cjs.map +1 -0
  191. package/dist/chat/DrivingOnChip.d.ts +17 -0
  192. package/dist/chat/DrivingOnChip.js +23 -0
  193. package/dist/chat/DrivingOnChip.js.map +1 -0
  194. package/dist/chat/StatewireApprovalCard.cjs +125 -31
  195. package/dist/chat/StatewireApprovalCard.cjs.map +1 -1
  196. package/dist/chat/StatewireApprovalCard.d.ts +73 -1
  197. package/dist/chat/StatewireApprovalCard.js +115 -21
  198. package/dist/chat/StatewireApprovalCard.js.map +1 -1
  199. package/dist/chat/StatewireClientToolBridge.cjs +2 -2
  200. package/dist/chat/StatewireClientToolBridge.cjs.map +1 -1
  201. package/dist/chat/StatewireQueuedMessages.cjs +25 -63
  202. package/dist/chat/StatewireQueuedMessages.cjs.map +1 -1
  203. package/dist/chat/StatewireQueuedMessages.d.ts +11 -13
  204. package/dist/chat/StatewireQueuedMessages.js +16 -54
  205. package/dist/chat/StatewireQueuedMessages.js.map +1 -1
  206. package/dist/chat/WaitingOnYouBanner.cjs +3 -3
  207. package/dist/chat/WaitingOnYouBanner.cjs.map +1 -1
  208. package/dist/chat/athena-chat-welcome.cjs +2 -2
  209. package/dist/chat/athena-chat-welcome.cjs.map +1 -1
  210. package/dist/chat/athena-citation-links.cjs +5 -5
  211. package/dist/chat/athena-citation-links.cjs.map +1 -1
  212. package/dist/chat/athena-composer-controls.cjs +26 -16
  213. package/dist/chat/athena-composer-controls.cjs.map +1 -1
  214. package/dist/chat/athena-composer-controls.d.ts +6 -0
  215. package/dist/chat/athena-composer-controls.js +26 -16
  216. package/dist/chat/athena-composer-controls.js.map +1 -1
  217. package/dist/chat/athena-turn-end-status.cjs +42 -0
  218. package/dist/chat/athena-turn-end-status.cjs.map +1 -0
  219. package/dist/chat/athena-turn-end-status.d.ts +24 -0
  220. package/dist/chat/athena-turn-end-status.js +42 -0
  221. package/dist/chat/athena-turn-end-status.js.map +1 -0
  222. package/dist/chat/browser-decision-check.cjs +131 -0
  223. package/dist/chat/browser-decision-check.cjs.map +1 -0
  224. package/dist/chat/browser-decision-check.d.ts +61 -0
  225. package/dist/chat/browser-decision-check.js +131 -0
  226. package/dist/chat/browser-decision-check.js.map +1 -0
  227. package/dist/chat/chat-outbox-rows.cjs +3 -3
  228. package/dist/chat/chat-outbox-rows.cjs.map +1 -1
  229. package/dist/chat/chat-voice-controls.cjs +93 -28
  230. package/dist/chat/chat-voice-controls.cjs.map +1 -1
  231. package/dist/chat/chat-voice-controls.d.ts +36 -2
  232. package/dist/chat/chat-voice-controls.js +89 -24
  233. package/dist/chat/chat-voice-controls.js.map +1 -1
  234. package/dist/chat/composer-keyboard-hint.cjs +5 -5
  235. package/dist/chat/composer-keyboard-hint.cjs.map +1 -1
  236. package/dist/chat/device-operation.cjs +29 -0
  237. package/dist/chat/device-operation.cjs.map +1 -0
  238. package/dist/chat/device-operation.d.ts +34 -0
  239. package/dist/chat/device-operation.js +29 -0
  240. package/dist/chat/device-operation.js.map +1 -0
  241. package/dist/chat/super-grouping/CollapsibleGroup.cjs +14 -14
  242. package/dist/chat/super-grouping/CollapsibleGroup.cjs.map +1 -1
  243. package/dist/chat/super-grouping/GroupedMessageParts.cjs +4 -4
  244. package/dist/chat/super-grouping/GroupedMessageParts.cjs.map +1 -1
  245. package/dist/chat/super-grouping/SuperGroupingCard.cjs +60 -38
  246. package/dist/chat/super-grouping/SuperGroupingCard.cjs.map +1 -1
  247. package/dist/chat/super-grouping/SuperGroupingCard.d.ts +24 -4
  248. package/dist/chat/super-grouping/SuperGroupingCard.js +37 -15
  249. package/dist/chat/super-grouping/SuperGroupingCard.js.map +1 -1
  250. package/dist/chat/super-grouping/SuperGroupingTranscript.cjs +32 -32
  251. package/dist/chat/super-grouping/SuperGroupingTranscript.cjs.map +1 -1
  252. package/dist/chat/super-grouping/SuperGroupingTranscript.js +3 -3
  253. package/dist/chat/super-grouping/SuperGroupingTranscript.js.map +1 -1
  254. package/dist/chat/super-grouping/ToolTimeline.cjs +97 -37
  255. package/dist/chat/super-grouping/ToolTimeline.cjs.map +1 -1
  256. package/dist/chat/super-grouping/ToolTimeline.d.ts +14 -2
  257. package/dist/chat/super-grouping/ToolTimeline.js +94 -34
  258. package/dist/chat/super-grouping/ToolTimeline.js.map +1 -1
  259. package/dist/chat/super-grouping/activity-timeline.cjs +47 -12
  260. package/dist/chat/super-grouping/activity-timeline.cjs.map +1 -1
  261. package/dist/chat/super-grouping/activity-timeline.d.ts +21 -0
  262. package/dist/chat/super-grouping/activity-timeline.js +47 -12
  263. package/dist/chat/super-grouping/activity-timeline.js.map +1 -1
  264. package/dist/chat/super-grouping/grouping-function.cjs +4 -0
  265. package/dist/chat/super-grouping/grouping-function.cjs.map +1 -1
  266. package/dist/chat/super-grouping/grouping-function.d.ts +7 -0
  267. package/dist/chat/super-grouping/grouping-function.js +5 -1
  268. package/dist/chat/super-grouping/grouping-function.js.map +1 -1
  269. package/dist/chat/super-grouping/index.cjs +6 -0
  270. package/dist/chat/super-grouping/index.cjs.map +1 -1
  271. package/dist/chat/super-grouping/index.d.ts +6 -2
  272. package/dist/chat/super-grouping/index.js +7 -1
  273. package/dist/chat/super-grouping/index.js.map +1 -1
  274. package/dist/chat/super-grouping/timeline-step.cjs +61 -2
  275. package/dist/chat/super-grouping/timeline-step.cjs.map +1 -1
  276. package/dist/chat/super-grouping/timeline-step.d.ts +13 -1
  277. package/dist/chat/super-grouping/timeline-step.js +61 -2
  278. package/dist/chat/super-grouping/timeline-step.js.map +1 -1
  279. package/dist/chat/super-grouping/tool-part-placement.cjs +17 -0
  280. package/dist/chat/super-grouping/tool-part-placement.cjs.map +1 -0
  281. package/dist/chat/super-grouping/tool-part-placement.d.ts +22 -0
  282. package/dist/chat/super-grouping/tool-part-placement.js +17 -0
  283. package/dist/chat/super-grouping/tool-part-placement.js.map +1 -0
  284. package/dist/chat/thread-scroll-to-bottom.cjs +2 -2
  285. package/dist/chat/thread-scroll-to-bottom.cjs.map +1 -1
  286. package/dist/chat/thread-scroll-to-bottom.d.ts +10 -7
  287. package/dist/chat/thread-scroll-to-bottom.js +2 -2
  288. package/dist/chat/thread-scroll-to-bottom.js.map +1 -1
  289. package/dist/chat/tooltip-icon-button.cjs +2 -2
  290. package/dist/chat/tooltip-icon-button.cjs.map +1 -1
  291. package/dist/chat/use-athena-voice-live.cjs +11 -0
  292. package/dist/chat/use-athena-voice-live.cjs.map +1 -0
  293. package/dist/chat/use-athena-voice-live.d.ts +11 -0
  294. package/dist/chat/use-athena-voice-live.js +11 -0
  295. package/dist/chat/use-athena-voice-live.js.map +1 -0
  296. package/dist/chat/use-statewire-approval-request.cjs +56 -24
  297. package/dist/chat/use-statewire-approval-request.cjs.map +1 -1
  298. package/dist/chat/use-statewire-approval-request.d.ts +33 -4
  299. package/dist/chat/use-statewire-approval-request.js +41 -9
  300. package/dist/chat/use-statewire-approval-request.js.map +1 -1
  301. package/dist/chat-ui/auth/sign-in-card.cjs +2 -2
  302. package/dist/chat-ui/auth/sign-in-card.cjs.map +1 -1
  303. package/dist/chat-ui/composer/tiptap-composer.cjs +138 -107
  304. package/dist/chat-ui/composer/tiptap-composer.cjs.map +1 -1
  305. package/dist/chat-ui/composer/tiptap-composer.d.ts +20 -4
  306. package/dist/chat-ui/composer/tiptap-composer.js +85 -54
  307. package/dist/chat-ui/composer/tiptap-composer.js.map +1 -1
  308. package/dist/chat-ui/header/conversation-history-panel.cjs +49 -23
  309. package/dist/chat-ui/header/conversation-history-panel.cjs.map +1 -1
  310. package/dist/chat-ui/header/conversation-history-panel.d.ts +12 -1
  311. package/dist/chat-ui/header/conversation-history-panel.js +38 -12
  312. package/dist/chat-ui/header/conversation-history-panel.js.map +1 -1
  313. package/dist/chat-ui/index.cjs +18 -0
  314. package/dist/chat-ui/index.cjs.map +1 -1
  315. package/dist/chat-ui/index.d.ts +7 -1
  316. package/dist/chat-ui/index.js +18 -0
  317. package/dist/chat-ui/index.js.map +1 -1
  318. package/dist/chat-ui/mentions/mention-chip.cjs +147 -38
  319. package/dist/chat-ui/mentions/mention-chip.cjs.map +1 -1
  320. package/dist/chat-ui/mentions/mention-chip.d.ts +17 -1
  321. package/dist/chat-ui/mentions/mention-chip.js +146 -37
  322. package/dist/chat-ui/mentions/mention-chip.js.map +1 -1
  323. package/dist/chat-ui/mentions/suggestions/components/mention-suggestion-list.cjs +10 -9
  324. package/dist/chat-ui/mentions/suggestions/components/mention-suggestion-list.cjs.map +1 -1
  325. package/dist/chat-ui/mentions/suggestions/components/mention-suggestion-list.js +3 -2
  326. package/dist/chat-ui/mentions/suggestions/components/mention-suggestion-list.js.map +1 -1
  327. package/dist/chat-ui/mentions/suggestions/components/mention-suggestion-popup.cjs +2 -2
  328. package/dist/chat-ui/mentions/suggestions/components/mention-suggestion-popup.cjs.map +1 -1
  329. package/dist/chat-ui/mentions/suggestions/components/menu-list.cjs +29 -6
  330. package/dist/chat-ui/mentions/suggestions/components/menu-list.cjs.map +1 -1
  331. package/dist/chat-ui/mentions/suggestions/components/menu-list.d.ts +7 -1
  332. package/dist/chat-ui/mentions/suggestions/components/menu-list.js +25 -2
  333. package/dist/chat-ui/mentions/suggestions/components/menu-list.js.map +1 -1
  334. package/dist/chat-ui/mentions/suggestions/components/use-keyboard-navigation.cjs +2 -2
  335. package/dist/chat-ui/mentions/suggestions/components/use-keyboard-navigation.cjs.map +1 -1
  336. package/dist/chat-ui/mentions/suggestions/components/use-menu-navigation.cjs +2 -2
  337. package/dist/chat-ui/mentions/suggestions/components/use-menu-navigation.cjs.map +1 -1
  338. package/dist/chat-ui/mentions/suggestions/data/api-client.cjs +3 -3
  339. package/dist/chat-ui/mentions/suggestions/data/api-client.cjs.map +1 -1
  340. package/dist/chat-ui/mentions/suggestions/data/orchestrator.cjs +56 -2
  341. package/dist/chat-ui/mentions/suggestions/data/orchestrator.cjs.map +1 -1
  342. package/dist/chat-ui/mentions/suggestions/data/orchestrator.d.ts +12 -0
  343. package/dist/chat-ui/mentions/suggestions/data/orchestrator.js +56 -2
  344. package/dist/chat-ui/mentions/suggestions/data/orchestrator.js.map +1 -1
  345. package/dist/chat-ui/mentions/suggestions/data/sources/index.cjs +24 -3
  346. package/dist/chat-ui/mentions/suggestions/data/sources/index.cjs.map +1 -1
  347. package/dist/chat-ui/mentions/suggestions/data/sources/index.d.ts +7 -0
  348. package/dist/chat-ui/mentions/suggestions/data/sources/index.js +24 -3
  349. package/dist/chat-ui/mentions/suggestions/data/sources/index.js.map +1 -1
  350. package/dist/chat-ui/mentions/suggestions/data/use-mention-suggestions.cjs +35 -13
  351. package/dist/chat-ui/mentions/suggestions/data/use-mention-suggestions.cjs.map +1 -1
  352. package/dist/chat-ui/mentions/suggestions/data/use-mention-suggestions.d.ts +15 -1
  353. package/dist/chat-ui/mentions/suggestions/data/use-mention-suggestions.js +28 -6
  354. package/dist/chat-ui/mentions/suggestions/data/use-mention-suggestions.js.map +1 -1
  355. package/dist/chat-ui/mentions/suggestions/data/use-menu-items.cjs +9 -6
  356. package/dist/chat-ui/mentions/suggestions/data/use-menu-items.cjs.map +1 -1
  357. package/dist/chat-ui/mentions/suggestions/data/use-menu-items.d.ts +3 -0
  358. package/dist/chat-ui/mentions/suggestions/data/use-menu-items.js +5 -2
  359. package/dist/chat-ui/mentions/suggestions/data/use-menu-items.js.map +1 -1
  360. package/dist/chat-ui/mentions/use-account-workspace-id.cjs +45 -10
  361. package/dist/chat-ui/mentions/use-account-workspace-id.cjs.map +1 -1
  362. package/dist/chat-ui/mentions/use-account-workspace-id.d.ts +24 -1
  363. package/dist/chat-ui/mentions/use-account-workspace-id.js +46 -11
  364. package/dist/chat-ui/mentions/use-account-workspace-id.js.map +1 -1
  365. package/dist/chat-ui/mentions/use-member-avatar.cjs +4 -4
  366. package/dist/chat-ui/mentions/use-member-avatar.cjs.map +1 -1
  367. package/dist/chat-ui/mentions/use-mention-asset.cjs +140 -0
  368. package/dist/chat-ui/mentions/use-mention-asset.cjs.map +1 -0
  369. package/dist/chat-ui/mentions/use-mention-asset.d.ts +16 -0
  370. package/dist/chat-ui/mentions/use-mention-asset.js +140 -0
  371. package/dist/chat-ui/mentions/use-mention-asset.js.map +1 -0
  372. package/dist/chat-ui/messages/answer-label.cjs +42 -0
  373. package/dist/chat-ui/messages/answer-label.cjs.map +1 -0
  374. package/dist/chat-ui/messages/answer-label.d.ts +33 -0
  375. package/dist/chat-ui/messages/answer-label.js +42 -0
  376. package/dist/chat-ui/messages/answer-label.js.map +1 -0
  377. package/dist/chat-ui/messages/arrival-animation.cjs +13 -0
  378. package/dist/chat-ui/messages/arrival-animation.cjs.map +1 -0
  379. package/dist/chat-ui/messages/arrival-animation.d.ts +14 -0
  380. package/dist/chat-ui/messages/arrival-animation.js +13 -0
  381. package/dist/chat-ui/messages/arrival-animation.js.map +1 -0
  382. package/dist/chat-ui/messages/continue-pill.cjs +5 -5
  383. package/dist/chat-ui/messages/continue-pill.cjs.map +1 -1
  384. package/dist/chat-ui/messages/handoff-arrival-divider.cjs +44 -0
  385. package/dist/chat-ui/messages/handoff-arrival-divider.cjs.map +1 -0
  386. package/dist/chat-ui/messages/handoff-arrival-divider.d.ts +17 -0
  387. package/dist/chat-ui/messages/handoff-arrival-divider.js +44 -0
  388. package/dist/chat-ui/messages/handoff-arrival-divider.js.map +1 -0
  389. package/dist/chat-ui/messages/message-actions-config.cjs +3 -3
  390. package/dist/chat-ui/messages/message-actions-config.cjs.map +1 -1
  391. package/dist/chat-ui/messages/message-components.cjs +8 -4
  392. package/dist/chat-ui/messages/message-components.cjs.map +1 -1
  393. package/dist/chat-ui/messages/message-components.js +5 -1
  394. package/dist/chat-ui/messages/message-components.js.map +1 -1
  395. package/dist/chat-ui/messages/message-images.cjs +66 -0
  396. package/dist/chat-ui/messages/message-images.cjs.map +1 -0
  397. package/dist/chat-ui/messages/message-images.d.ts +16 -0
  398. package/dist/chat-ui/messages/message-images.js +66 -0
  399. package/dist/chat-ui/messages/message-images.js.map +1 -0
  400. package/dist/chat-ui/messages/user-edit-composer.cjs +2 -2
  401. package/dist/chat-ui/messages/user-edit-composer.cjs.map +1 -1
  402. package/dist/chat-ui/messages/wake-marker.cjs +3 -3
  403. package/dist/chat-ui/messages/wake-marker.cjs.map +1 -1
  404. package/dist/chat-ui/rich-text/chat-link.cjs +7 -6
  405. package/dist/chat-ui/rich-text/chat-link.cjs.map +1 -1
  406. package/dist/chat-ui/rich-text/chat-link.d.ts +2 -3
  407. package/dist/chat-ui/rich-text/chat-link.js +6 -5
  408. package/dist/chat-ui/rich-text/chat-link.js.map +1 -1
  409. package/dist/chat-ui/rich-text/chat-message-body.cjs +8 -8
  410. package/dist/chat-ui/rich-text/chat-message-body.cjs.map +1 -1
  411. package/dist/chat-ui/rich-text/chat-node-views.cjs +7 -6
  412. package/dist/chat-ui/rich-text/chat-node-views.cjs.map +1 -1
  413. package/dist/chat-ui/rich-text/chat-node-views.js +1 -0
  414. package/dist/chat-ui/rich-text/chat-node-views.js.map +1 -1
  415. package/dist/chat-ui/rich-text/dom-output-spec.cjs +2 -2
  416. package/dist/chat-ui/rich-text/dom-output-spec.cjs.map +1 -1
  417. package/dist/chat-ui/statewire.cjs +3 -0
  418. package/dist/chat-ui/statewire.cjs.map +1 -1
  419. package/dist/chat-ui/statewire.d.ts +2 -1
  420. package/dist/chat-ui/statewire.js +3 -0
  421. package/dist/chat-ui/statewire.js.map +1 -1
  422. package/dist/chat-ui/thread/chat-thread-shell.cjs +43 -14
  423. package/dist/chat-ui/thread/chat-thread-shell.cjs.map +1 -1
  424. package/dist/chat-ui/thread/chat-thread-shell.d.ts +16 -2
  425. package/dist/chat-ui/thread/chat-thread-shell.js +35 -6
  426. package/dist/chat-ui/thread/chat-thread-shell.js.map +1 -1
  427. package/dist/chat-ui/thread/composer-send-or-stop.cjs +30 -20
  428. package/dist/chat-ui/thread/composer-send-or-stop.cjs.map +1 -1
  429. package/dist/chat-ui/thread/composer-send-or-stop.d.ts +8 -0
  430. package/dist/chat-ui/thread/composer-send-or-stop.js +29 -19
  431. package/dist/chat-ui/thread/composer-send-or-stop.js.map +1 -1
  432. package/dist/chat-ui/thread/statewire-history-edge.cjs +20 -21
  433. package/dist/chat-ui/thread/statewire-history-edge.cjs.map +1 -1
  434. package/dist/chat-ui/thread/statewire-history-edge.js +3 -4
  435. package/dist/chat-ui/thread/statewire-history-edge.js.map +1 -1
  436. package/dist/chat-ui/thread/thread-loading-overlay.cjs +5 -5
  437. package/dist/chat-ui/thread/thread-loading-overlay.cjs.map +1 -1
  438. package/dist/collab/client.cjs +40 -3
  439. package/dist/collab/client.cjs.map +1 -1
  440. package/dist/collab/client.d.ts +25 -0
  441. package/dist/collab/client.js +40 -3
  442. package/dist/collab/client.js.map +1 -1
  443. package/dist/collab/document-status.cjs +150 -0
  444. package/dist/collab/document-status.cjs.map +1 -0
  445. package/dist/collab/document-status.d.ts +68 -0
  446. package/dist/collab/document-status.js +150 -0
  447. package/dist/collab/document-status.js.map +1 -0
  448. package/dist/collab/index.cjs +7 -0
  449. package/dist/collab/index.cjs.map +1 -1
  450. package/dist/collab/index.d.ts +6 -1
  451. package/dist/collab/index.js +7 -0
  452. package/dist/collab/index.js.map +1 -1
  453. package/dist/collab/presence-react.cjs +11 -11
  454. package/dist/collab/presence-react.cjs.map +1 -1
  455. package/dist/collab/react.cjs +6 -6
  456. package/dist/collab/react.cjs.map +1 -1
  457. package/dist/composer/AttachmentContext.cjs +24 -11
  458. package/dist/composer/AttachmentContext.cjs.map +1 -1
  459. package/dist/composer/AttachmentContext.js +18 -5
  460. package/dist/composer/AttachmentContext.js.map +1 -1
  461. package/dist/composer/ComposerAttachmentPreview.cjs +78 -23
  462. package/dist/composer/ComposerAttachmentPreview.cjs.map +1 -1
  463. package/dist/composer/ComposerAttachmentPreview.d.ts +5 -3
  464. package/dist/composer/ComposerAttachmentPreview.js +79 -24
  465. package/dist/composer/ComposerAttachmentPreview.js.map +1 -1
  466. package/dist/composer/ComposerDropZone.cjs +7 -7
  467. package/dist/composer/ComposerDropZone.cjs.map +1 -1
  468. package/dist/composer/FileUploadButton.cjs +37 -22
  469. package/dist/composer/FileUploadButton.cjs.map +1 -1
  470. package/dist/composer/FileUploadButton.d.ts +6 -0
  471. package/dist/composer/FileUploadButton.js +34 -19
  472. package/dist/composer/FileUploadButton.js.map +1 -1
  473. package/dist/composer/QuoteContext.cjs +8 -8
  474. package/dist/composer/QuoteContext.cjs.map +1 -1
  475. package/dist/composer/composer-handoff.cjs +4 -4
  476. package/dist/composer/composer-handoff.cjs.map +1 -1
  477. package/dist/composer/useAppendToComposer.cjs +4 -4
  478. package/dist/composer/useAppendToComposer.cjs.map +1 -1
  479. package/dist/composer/useAttachFiles.cjs +23 -6
  480. package/dist/composer/useAttachFiles.cjs.map +1 -1
  481. package/dist/composer/useAttachFiles.d.ts +15 -7
  482. package/dist/composer/useAttachFiles.js +22 -5
  483. package/dist/composer/useAttachFiles.js.map +1 -1
  484. package/dist/composer/useComposerAttachment.cjs +4 -4
  485. package/dist/composer/useComposerAttachment.cjs.map +1 -1
  486. package/dist/composer/useFileUpload.cjs +21 -16
  487. package/dist/composer/useFileUpload.cjs.map +1 -1
  488. package/dist/composer/useFileUpload.d.ts +12 -0
  489. package/dist/composer/useFileUpload.js +12 -7
  490. package/dist/composer/useFileUpload.js.map +1 -1
  491. package/dist/composer/useReadComposerDraft.cjs +2 -2
  492. package/dist/composer/useReadComposerDraft.cjs.map +1 -1
  493. package/dist/composer/useSendMessage.cjs +4 -4
  494. package/dist/composer/useSendMessage.cjs.map +1 -1
  495. package/dist/diagnostics/useAthenaDiagnostics.cjs +4 -4
  496. package/dist/diagnostics/useAthenaDiagnostics.cjs.map +1 -1
  497. package/dist/dictation/audio-level-history.cjs +3 -3
  498. package/dist/dictation/audio-level-history.cjs.map +1 -1
  499. package/dist/dictation/dictation-controls.cjs +24 -20
  500. package/dist/dictation/dictation-controls.cjs.map +1 -1
  501. package/dist/dictation/dictation-controls.d.ts +6 -1
  502. package/dist/dictation/dictation-controls.js +24 -20
  503. package/dist/dictation/dictation-controls.js.map +1 -1
  504. package/dist/dictation/use-athena-dictation-engine.cjs +3 -3
  505. package/dist/dictation/use-athena-dictation-engine.cjs.map +1 -1
  506. package/dist/dictation/use-dictation.cjs +22 -22
  507. package/dist/dictation/use-dictation.cjs.map +1 -1
  508. package/dist/index.cjs +26 -2
  509. package/dist/index.cjs.map +1 -1
  510. package/dist/index.d.ts +15 -3
  511. package/dist/index.js +26 -2
  512. package/dist/index.js.map +1 -1
  513. package/dist/keryx-http/src/receive-only-socket.cjs +40 -0
  514. package/dist/keryx-http/src/receive-only-socket.cjs.map +1 -0
  515. package/dist/keryx-http/src/receive-only-socket.d.ts +27 -0
  516. package/dist/keryx-http/src/receive-only-socket.js +40 -0
  517. package/dist/keryx-http/src/receive-only-socket.js.map +1 -0
  518. package/dist/keryx-http/src/update-attributions.cjs +111 -0
  519. package/dist/keryx-http/src/update-attributions.cjs.map +1 -0
  520. package/dist/keryx-http/src/update-attributions.d.ts +75 -0
  521. package/dist/keryx-http/src/update-attributions.js +111 -0
  522. package/dist/keryx-http/src/update-attributions.js.map +1 -0
  523. package/dist/lib/owner-document.cjs +6 -6
  524. package/dist/lib/owner-document.cjs.map +1 -1
  525. package/dist/lib/use-athena-rest-query.cjs +4 -4
  526. package/dist/lib/use-athena-rest-query.cjs.map +1 -1
  527. package/dist/lib/use-document-active.cjs +4 -4
  528. package/dist/lib/use-document-active.cjs.map +1 -1
  529. package/dist/lib/use-prefers-reduced-motion.cjs +2 -2
  530. package/dist/lib/use-prefers-reduced-motion.cjs.map +1 -1
  531. package/dist/offline/offline-history.cjs +7 -7
  532. package/dist/offline/offline-history.cjs.map +1 -1
  533. package/dist/provider/AthenaContext.cjs +3 -3
  534. package/dist/provider/AthenaContext.cjs.map +1 -1
  535. package/dist/provider/AthenaProvider.cjs +116 -79
  536. package/dist/provider/AthenaProvider.cjs.map +1 -1
  537. package/dist/provider/AthenaProvider.js +40 -3
  538. package/dist/provider/AthenaProvider.js.map +1 -1
  539. package/dist/provider/PostHogProvider.cjs +2 -2
  540. package/dist/provider/PostHogProvider.cjs.map +1 -1
  541. package/dist/provider/agent-selection-context.cjs +2 -2
  542. package/dist/provider/agent-selection-context.cjs.map +1 -1
  543. package/dist/provider/chat-mode-context.cjs +2 -2
  544. package/dist/provider/chat-mode-context.cjs.map +1 -1
  545. package/dist/provider/session-persistence-context.cjs +10 -0
  546. package/dist/provider/session-persistence-context.cjs.map +1 -0
  547. package/dist/provider/session-persistence-context.d.ts +15 -0
  548. package/dist/provider/session-persistence-context.js +10 -0
  549. package/dist/provider/session-persistence-context.js.map +1 -0
  550. package/dist/provider/statewire-history-context.cjs +4 -4
  551. package/dist/provider/statewire-history-context.cjs.map +1 -1
  552. package/dist/provider/statewire-lifecycle-context.cjs +3 -3
  553. package/dist/provider/statewire-lifecycle-context.cjs.map +1 -1
  554. package/dist/provider/statewire-window-context.cjs +3 -3
  555. package/dist/provider/statewire-window-context.cjs.map +1 -1
  556. package/dist/provider/theme-style-context.cjs +3 -3
  557. package/dist/provider/theme-style-context.cjs.map +1 -1
  558. package/dist/react/package.json.cjs +1 -1
  559. package/dist/react/package.json.js +1 -1
  560. package/dist/references/src/tool-option-schemas.d.ts +0 -34
  561. package/dist/runtime/StatewireThreadConfigLaneSync.cjs +10 -10
  562. package/dist/runtime/StatewireThreadConfigLaneSync.cjs.map +1 -1
  563. package/dist/runtime/auth-refusal-restart.cjs +7 -7
  564. package/dist/runtime/auth-refusal-restart.cjs.map +1 -1
  565. package/dist/runtime/auth.cjs +13 -13
  566. package/dist/runtime/auth.cjs.map +1 -1
  567. package/dist/runtime/statewire-lifecycle.cjs +1 -0
  568. package/dist/runtime/statewire-lifecycle.cjs.map +1 -1
  569. package/dist/runtime/statewire-lifecycle.d.ts +3 -1
  570. package/dist/runtime/statewire-lifecycle.js +2 -1
  571. package/dist/runtime/statewire-lifecycle.js.map +1 -1
  572. package/dist/runtime/statewire-server-lane-context.cjs +2 -2
  573. package/dist/runtime/statewire-server-lane-context.cjs.map +1 -1
  574. package/dist/runtime/statewire-session-lane.cjs +4 -4
  575. package/dist/runtime/statewire-session-lane.cjs.map +1 -1
  576. package/dist/runtime/useAthenaStatewireRuntime.cjs +10 -8
  577. package/dist/runtime/useAthenaStatewireRuntime.cjs.map +1 -1
  578. package/dist/runtime/useAthenaStatewireRuntime.d.ts +2 -0
  579. package/dist/runtime/useAthenaStatewireRuntime.js +2 -0
  580. package/dist/runtime/useAthenaStatewireRuntime.js.map +1 -1
  581. package/dist/styles.css +1 -1
  582. package/dist/threads/Inbox.cjs +8 -8
  583. package/dist/threads/Inbox.cjs.map +1 -1
  584. package/dist/threads/SessionList.cjs +9 -9
  585. package/dist/threads/SessionList.cjs.map +1 -1
  586. package/dist/threads/SessionsPage.cjs +11 -11
  587. package/dist/threads/SessionsPage.cjs.map +1 -1
  588. package/dist/threads/index-triggered-refresh.cjs +10 -10
  589. package/dist/threads/index-triggered-refresh.cjs.map +1 -1
  590. package/dist/threads/mark-viewed-thread-read.cjs +12 -12
  591. package/dist/threads/mark-viewed-thread-read.cjs.map +1 -1
  592. package/dist/threads/offline-session-list.cjs +3 -3
  593. package/dist/threads/offline-session-list.cjs.map +1 -1
  594. package/dist/threads/session-list-tab-share.cjs +5 -5
  595. package/dist/threads/session-list-tab-share.cjs.map +1 -1
  596. package/dist/threads/statewire-thread-list.cjs +55 -51
  597. package/dist/threads/statewire-thread-list.cjs.map +1 -1
  598. package/dist/threads/statewire-thread-list.js +6 -2
  599. package/dist/threads/statewire-thread-list.js.map +1 -1
  600. package/dist/threads/thread-id-context.cjs +5 -5
  601. package/dist/threads/thread-id-context.cjs.map +1 -1
  602. package/dist/threads/use-athena-session-attention.cjs +2 -2
  603. package/dist/threads/use-athena-session-attention.cjs.map +1 -1
  604. package/dist/threads/use-athena-sessions.cjs +10 -10
  605. package/dist/threads/use-athena-sessions.cjs.map +1 -1
  606. package/dist/threads/use-athena-thread-model.cjs +3 -3
  607. package/dist/threads/use-athena-thread-model.cjs.map +1 -1
  608. package/dist/threads/use-rest-conversation-history.cjs +3 -3
  609. package/dist/threads/use-rest-conversation-history.cjs.map +1 -1
  610. package/dist/threads/use-statewire-conversation-history.cjs +8 -8
  611. package/dist/threads/use-statewire-conversation-history.cjs.map +1 -1
  612. package/dist/threads/use-thread-archive.cjs +9 -9
  613. package/dist/threads/use-thread-archive.cjs.map +1 -1
  614. package/dist/threads/use-thread-favorite.cjs +2 -2
  615. package/dist/threads/use-thread-favorite.cjs.map +1 -1
  616. package/dist/threads/use-thread-field-override.cjs +20 -20
  617. package/dist/threads/use-thread-field-override.cjs.map +1 -1
  618. package/dist/threads/use-thread-read-state.cjs +4 -4
  619. package/dist/threads/use-thread-read-state.cjs.map +1 -1
  620. package/dist/threads/use-thread-rename.cjs +2 -2
  621. package/dist/threads/use-thread-rename.cjs.map +1 -1
  622. package/dist/threads/useAthenaThreadManager.cjs +2 -2
  623. package/dist/threads/useAthenaThreadManager.cjs.map +1 -1
  624. package/dist/tools/NestedPtcMessages.cjs +6 -6
  625. package/dist/tools/NestedPtcMessages.cjs.map +1 -1
  626. package/dist/tools/append-document-tool-ui.cjs +7 -7
  627. package/dist/tools/append-document-tool-ui.cjs.map +1 -1
  628. package/dist/tools/file-tool-uis.cjs +2 -2
  629. package/dist/tools/file-tool-uis.cjs.map +1 -1
  630. package/dist/tools/misc-tool-uis.cjs +2 -2
  631. package/dist/tools/misc-tool-uis.cjs.map +1 -1
  632. package/dist/tools/primitives.cjs +6 -6
  633. package/dist/tools/primitives.cjs.map +1 -1
  634. package/dist/tools/read-asset-tool-ui.cjs +6 -6
  635. package/dist/tools/read-asset-tool-ui.cjs.map +1 -1
  636. package/dist/tools/subagent-task-tool-ui.cjs +21 -21
  637. package/dist/tools/subagent-task-tool-ui.cjs.map +1 -1
  638. package/dist/tools/test-recording-tool-uis.cjs +16 -16
  639. package/dist/tools/test-recording-tool-uis.cjs.map +1 -1
  640. package/dist/tools/todo-plan-store.cjs +4 -4
  641. package/dist/tools/todo-plan-store.cjs.map +1 -1
  642. package/dist/tools/tool-appearance.cjs +3 -3
  643. package/dist/tools/tool-appearance.cjs.map +1 -1
  644. package/dist/tools/tool-fallback.cjs +14 -14
  645. package/dist/tools/tool-fallback.cjs.map +1 -1
  646. package/dist/tools/tool-summary.cjs +0 -2
  647. package/dist/tools/tool-summary.cjs.map +1 -1
  648. package/dist/tools/tool-summary.js +0 -2
  649. package/dist/tools/tool-summary.js.map +1 -1
  650. package/dist/tools/tool-uis.cjs +74 -74
  651. package/dist/tools/tool-uis.cjs.map +1 -1
  652. package/dist/tools/use-elapsed-seconds.cjs +3 -3
  653. package/dist/tools/use-elapsed-seconds.cjs.map +1 -1
  654. package/dist/tools/write-todos-tool-ui.cjs +9 -9
  655. package/dist/tools/write-todos-tool-ui.cjs.map +1 -1
  656. package/dist/ui/image-viewer.cjs +382 -0
  657. package/dist/ui/image-viewer.cjs.map +1 -0
  658. package/dist/ui/image-viewer.d.ts +50 -0
  659. package/dist/ui/image-viewer.js +382 -0
  660. package/dist/ui/image-viewer.js.map +1 -0
  661. package/dist/voice/chat.cjs +6 -0
  662. package/dist/voice/chat.cjs.map +1 -1
  663. package/dist/voice/chat.d.ts +1 -1
  664. package/dist/voice/chat.js +8 -2
  665. package/dist/voice/livekit-join.cjs +52 -101
  666. package/dist/voice/livekit-join.cjs.map +1 -1
  667. package/dist/voice/livekit-join.d.ts +1 -6
  668. package/dist/voice/livekit-join.js +52 -101
  669. package/dist/voice/livekit-join.js.map +1 -1
  670. package/dist/voice/livekit.cjs.map +1 -1
  671. package/dist/voice/livekit.d.ts +11 -1
  672. package/dist/voice/livekit.js.map +1 -1
  673. package/dist/voice/use-athena-voice-session.cjs +34 -34
  674. package/dist/voice/use-athena-voice-session.cjs.map +1 -1
  675. package/dist/workbench/ComputerLiveDesktop.cjs +13 -13
  676. package/dist/workbench/ComputerLiveDesktop.cjs.map +1 -1
  677. package/dist/workbench/SessionWorkbench.cjs +22 -22
  678. package/dist/workbench/SessionWorkbench.cjs.map +1 -1
  679. package/dist/workbench/session-workbench-context.cjs +3 -3
  680. package/dist/workbench/session-workbench-context.cjs.map +1 -1
  681. package/dist/workbench/session-workbench-panes.cjs +8 -8
  682. package/dist/workbench/session-workbench-panes.cjs.map +1 -1
  683. package/dist/workbench/workbench-layout-context.cjs +3 -3
  684. package/dist/workbench/workbench-layout-context.cjs.map +1 -1
  685. package/package.json +2 -1
package/README.md CHANGED
@@ -265,7 +265,18 @@ What the statewire transport wires up in `AthenaChat`:
265
265
  `isHandledElsewhere`, and `readOnly` seams take host-specific review UIs,
266
266
  requests another surface answers, and viewers without edit rights; the
267
267
  headless `useStatewireApprovalRequest` behind it is exported for hosts with
268
- their own decision UI.
268
+ their own decision UI. Its `confirmDecision` seam runs the host's passkey
269
+ decision check ("Confirm with your passkey") before an answer that lets
270
+ anything run. The token it resolves rides as `decisionCheck` on `run/input`
271
+ or `run/lane-input`. A reject never asks, and an answer with no token is
272
+ still sent while checks are report-only. A passkey belongs to the Athena web
273
+ app's host, so an app on another origin can't run that prompt itself:
274
+ `useAthenaBrowserDecisionConfirmer()` (inside `<AthenaProvider>`, passed to
275
+ `<AthenaChat confirmDecision={…}>`) asks agora for a check, opens the web
276
+ app's check page in a new tab, and collects the token once the person
277
+ confirmed there. Its `onPending` gets the code and link to show while the
278
+ tab is open; `useBrowserDecisionConfirmer` takes your own request and opener
279
+ when the provider's don't fit (an extension, an Office add-in).
269
280
  - **Frontend tools:** tools in `frontendTools` with a local `execute` are
270
281
  declared to the backend as `client_tools` and executed by the mounted
271
282
  client-tool bridge, which resumes the run with each tool's result.
@@ -295,7 +306,14 @@ What the statewire transport wires up in `AthenaChat`:
295
306
  slots for the host's text/tool renderers and controls (`renderHeaderActions`,
296
307
  `renderRunningMeta`, `summaryDetails`, `waitingTools`, `waitingToolCallIds`,
297
308
  `expansionKey`), so Olympus and the Chrome extension mount one card instead
298
- of copies.
309
+ of copies. A host can take a call out of the card's details:
310
+ `isInlineTool(toolName, part)` keeps its tool UI on screen below the header
311
+ (the call itself comes second, so the choice can depend on what it did), and
312
+ `isStepRowTool(toolName)` draws it as its own step's row in the step list,
313
+ kept mounted while the turn is live or `mountDetails` is set. The tool UI
314
+ reads where it renders with `useToolPartPlacement()` (`'step'`, `'inline'`,
315
+ or `null`), so a call rendered in both places draws the part that belongs in
316
+ each.
299
317
  - **In-repo hosts consume the package, not the source.** `@athenaintel/react`
300
318
  is a workspace dependency of Olympus, the Chrome extension, and the Office
301
319
  add-in, resolved through this package's `exports` to the built `dist/` (the
@@ -324,6 +342,15 @@ What the statewire transport wires up in `AthenaChat`:
324
342
  `COLLAB_AGENT_CHANNEL_SESSION_MISMATCH` are exported for hosts with their
325
343
  own thread UI. Custom hosts can read all of it via
326
344
  `useAthenaStatewireLifecycle`.
345
+ - **Session persistence:** `useAthenaSessionPersistence()` exposes Core's paired
346
+ `{ threadId, sessionPersisted }` verdict from the same runtime snapshot as
347
+ the client. No verdict (or no provider) returns `null`; the flag itself is
348
+ `true`, `false`, or `null` when the state does not declare existence. Its
349
+ lifetime follows Core's thread, sync host and signed-in principal;
350
+ credential rotation preserves the verdict. A remembered snapshot may report
351
+ `true` before fresh server state arrives. This is an existence hint for the
352
+ session asset, not authorization, workspace identity, or command durability.
353
+ Actions must still pass their server permission checks.
327
354
  - **Thread list:** `enableThreadList` provides the persisted Agora session
328
355
  list; switching threads (or starting a new chat) re-attaches the statewire
329
356
  session to the selected thread while the host's own `children` stay
@@ -502,6 +529,19 @@ to the approval card (or to the composer when there is none). It never
502
529
  duplicates the card's Approve / Reject buttons. `WaitingOnYouBannerView` is
503
530
  the pure presenter for hosts that resolve the inputs themselves.
504
531
 
532
+ ### `DrivingOnChip`
533
+
534
+ "Driving on your phone": the person's newest message in this conversation came
535
+ from another of their Athena apps (the host's `state.driver`). A hint, never a
536
+ lock — sending here makes this app the driver and the chip goes away. It shows
537
+ nothing while this app drives, once the other app has been quiet for 15
538
+ minutes, during a live call (the call strip says where it is) and outside a
539
+ statewire thread. `AthenaChat` mounts it above the composer when you pass
540
+ `surface` (`"spaces"`, `"mobile"`, `"chrome"`, `"desktop"` or `"office"`, the
541
+ Athena app the chat runs in); a custom layout mounts `<DrivingOnChip here=… />`
542
+ itself. `useDrivingOn(here)` in `@athenaintel/agent-runtime/thread-driver` is the same read
543
+ without the chip.
544
+
505
545
  ### Wake markers
506
546
 
507
547
  A user turn injected by a GitHub webhook wake carries a provenance envelope
@@ -754,6 +794,23 @@ or revoked voice access releases the microphone. Dictation and realtime voice
754
794
  cannot capture together. Model, agent, mode and toolkit changes sync through the
755
795
  same model context for the next delegated task.
756
796
 
797
+ A call live on another of the person's own devices (the Athena web app, the
798
+ phone app, Chrome, the desktop app) can move to this one: the button reads
799
+ **Move call here** and the voice line reads "Live call on your phone · Move
800
+ here". Only the microphone moves; the realtime model keeps the conversation
801
+ going. The device the call left releases its microphone without ending the call
802
+ and says "Call moved to your …" for a few seconds. A move that cannot complete
803
+ leaves the call where it was. `useAthenaChatVoice` exposes the same as
804
+ `liveElsewhere`, `transferHere()` and `movedTo` for a composer of your own,
805
+ with the shared wording (`describeVoiceLiveElsewhere`, `useVoiceMovedNotice`,
806
+ `VOICE_MOVE_CALL_HERE_LABEL`) in `@athenaintel/react/voice/chat`.
807
+
808
+ After a handover the person sent in voice mode, a host passes
809
+ `continueByVoice={{ onDone }}` and the composer offers **Continue by voice**:
810
+ one tap starts a call whose model opens by saying where the conversation
811
+ stands (`start({ opening: 'recap' })`). `onDone` runs on the tap, **Not now**,
812
+ or a typed send.
813
+
757
814
  Use `<AthenaChat voice={false} />` to omit realtime voice in a host that cannot
758
815
  support it, or `voice={{ model: 'gemini-3.8-live' }}` to request a host-offered
759
816
  voice model. A custom `livekit` adapter and `onDiagnostic` observer are accepted
@@ -883,6 +940,78 @@ Both use the same bearer / API key as session creation. The full recipe
883
940
  template skill `voice-session-guide.md`. `createAthenaVoiceSession` is also
884
941
  exported if you hold the bridge state yourself.
885
942
 
943
+ ## What's new in 0.48.0
944
+
945
+ **Scrolling back through a long session no longer flashes.** Opening a long session loads its newest messages, and scrolling to the top loads older pages. When a session's first loaded turn was one long run, each page of its earlier steps joined that same turn and gave it a new id. `ChatThreadShell` (and so `AthenaChat`) keyed rows by message id, so the turn remounted on every page: it replayed its entrance animation once per page, closed anything you had opened in it, and lost the browser's scroll anchor. A 74-minute run took 16 pages and flashed 16 times. Rows are now keyed by the row key the deep-agent conversion keeps for a turn that grows at its head (`deepAgentRowKey`), so the page lands in the mounted row. `AthenaChat`'s message rows also animate in only when they arrive live (the newest message, mounted while its run is running), never when a session opens or older history loads, and they respect reduced motion. The "Loading earlier messages" row is centred on the thread column. Nothing to change in your app.
946
+
947
+ **Attached pictures show as pictures and open full screen.** A picture you attach to a draft (paperclip, drop or paste) now shows as a thumbnail above the composer instead of a name pill; other files keep their pill. Clicking a thumbnail, or a picture in a sent message, opens a full-screen viewer, as Devin does: the page dims, the picture fits the window, and a toolbar pages through the set (← →), names the file, zooms (− / + / fit), downloads and closes (Esc, or a click on the backdrop). Pictures in a sent message now preview at most 20rem tall instead of at full height. The thumbnail is a local preview (`UploadedAsset.previewUrl`, a `blob:` URL the draft frees when it lets the attachment go). `ImageViewer` is exported for your own surfaces, as are `MessageImageGallery` and `MessageImagePart` (`@athenaintel/react/chat-ui`) for a custom user message:
948
+
949
+ ```tsx
950
+ const [viewing, setViewing] = useState<number | null>(null);
951
+ <ImageViewer images={[{ src, name: 'chart.png' }]} index={viewing} onIndexChange={setViewing} />
952
+ ```
953
+
954
+ **Each answer names the agent that answered and whom it worked for.** Once a conversation's answers come from more than one agent (your own assistant and a team agent, or two team agents a message named, answering in turn) or work for more than one person, `AthenaChat` shows a small muted line above every answer: "Finance · for you", "Athena · for Priya Shah". An answer that worked for someone other than the signed-in person is labelled even when one agent answered. A 1:1 chat with your own assistant looks as it did. The line reads the stamp Athena puts on each answer (`metadata.custom.answered_by`, identity v7 D13); an answer written before Athena stamped it shows nothing. chat-ui's `createAssistantMessage` bubble shows the same line under `ChatThreadShell`, whose new optional `viewerUserId` (the viewer's Athena user id, `user_…`) makes the viewer's own answers read "for you"; `AthenaChat` passes it for you. A custom `AssistantMessage` renders the line with `AnswerLabel` from `@athenaintel/react/chat-ui` (a host without `ChatThreadShell` mounts `AnswerLabelScope` around its messages). Nothing to change in your app.
955
+
956
+ **Each agent that answers a message gets its own row.** When a message names several agents, each answers in turn, and each answer is now its own assistant message, with its own label, action bar and status, instead of one row joining them. The agent still answering has its row from its first token (a "Thinking" row before it), so nothing jumps between rows while it streams. Your `AssistantMessage` renders once per answer; nothing to change in your app.
957
+
958
+ ## What's new in 0.47.0
959
+
960
+ **A host that is also a device an agent operates stamps its approval answers.** Athena refuses a decision sent from a device while an agent is operating it: the answer may be the agent's, driving the device the person signed in on (identity v7, D11). Wrap your chat in `DeviceOperationProvider` with a `read` function that returns the device id while your app runs a tool call Athena's device tunnel sent it, and `undefined` otherwise. Every approval answer the chat sends (`run/input`, `run/lane-input`) then carries `deviceOperation`, read at the moment it is sent, and Athena refuses an approve that carries it with `device_operated`. A reject still goes through. A `read` that throws stamps `unreadable`, so an approve is refused rather than sent from a device that may be operated. Apps that aren't a device (a web app, an Office add-in) change nothing.
961
+
962
+ ```tsx
963
+ <DeviceOperationProvider read={() => tunnel.operatingDeviceId()}>
964
+ <AthenaChat />
965
+ </DeviceOperationProvider>
966
+ ```
967
+
968
+ ## What's new in 0.46.1
969
+
970
+ **A moved call plays on the device that took it.** While a call moves, both of the person's devices are briefly in the call's room. The voice room join attached every remote audio track to the call's one `<audio>` element, so the other device's microphone took the agent's place there, and once that device left, the element was empty: the device that took the call heard nothing for the rest of the call. A device now plays the agent only, and never receives the person's other device's microphone. `createDeepAgentVoiceLiveKitAdapter` hosts get this without changes; a custom `roomFactory` keeps working, and `DeepAgentVoiceLiveKitRoom` now also describes the publication and participant `trackSubscribed` passes.
971
+
972
+ ## What's new in 0.46.0
973
+
974
+ **Continue by voice after a handover.** When a conversation arrives in your app from another of the person's devices and they sent it in voice mode, pass `continueByVoice={{ onDone }}` to `AthenaChat`. The composer then shows one button above the editor, **Continue by voice**, while voice is enabled and idle. Tapping it starts a call whose model opens by saying where the conversation stands, then listens. `onDone` runs once the person answers the offer (the tap, **Not now**, or a typed or dictated send). Clear the offer then, and when the conversation changes. Nothing starts the microphone without the tap, and while the call is still live on the other device the composer offers **Move call here** instead. For a composer of your own, `useAthenaChatVoice().start({ opening: 'recap' })` starts the same call; the opening rides that start only, never an automatic reconnect. `VOICE_CONTINUE_BY_VOICE_LABEL` is the shared button label. An Athena that predates the opening ignores it and the call opens as before.
975
+
976
+ ## What's new in 0.45.0
977
+
978
+ **Move a live call to this device.** When the conversation's voice call is live on another of the person's own devices and Athena can move it, `AthenaChat`'s voice button reads **Move call here** and the voice line above the composer reads "Live call on your phone · Move here" (browser, Chrome, desktop app or Office for the others). Either one takes the call over without restarting it: this device joins the call's room, Athena moves the microphone to it at a turn boundary, and the realtime model carries on. The device the call left lets go of its microphone without ending the call and shows "Call moved to your …" for a few seconds; it can take the call back the same way. A move that cannot complete (refused, the room could not be joined, the microphone was blocked) leaves the call on the other device and says so in the voice line (`failure.kind: 'transfer_failed'`). For a composer of your own, `useAthenaChatVoice` returns `liveElsewhere`, `transferHere()` and `movedTo`, and `@athenaintel/react/voice/chat` exports the shared wording (`describeVoiceLiveElsewhere`, `describeVoiceMovedTo`, `useVoiceMovedNotice`, `VOICE_MOVE_CALL_HERE_LABEL`, `VOICE_MOVE_HERE_ACTION`). Only the same person can take a call, which Athena checks; an Athena that cannot move calls never offers it, and nothing changes there. Nothing to change in your app.
979
+
980
+ ## What's new in 0.44.3
981
+
982
+ **After the D12 refusal date, an agent's picker names the model a run takes.** From the date a deployment sets for it (`CHANNEL_REPLACEMENTS_REFUSED_FROM`; unset everywhere today), Athena no longer applies a channel's or mode's model: a run on that channel takes the agent's own model. `ChatModelPicker` and `useAthenaAgentModelOptions({ agent, channel })` used to keep showing the channel's model as the default. With a `channel`, they now read the date (`featureGateEnv.channelReplacementsRefusedFrom`) and, from it, name the agent's own model as the default (`defaultModel`, the `isDefault` option). A channel's model is offered only when the agent lists it, or the session pins it. An open picker turns at UTC midnight of the day. Before the date, and against an Athena that predates the field, nothing changes. Nothing to change in your app. See [Offering an agent's own models](#offering-an-agents-own-models).
983
+
984
+ ## What's new in 0.44.0
985
+
986
+ **One Stop for everything.** While a voice session is connecting or live, the composer's Stop control stands in for Send whenever the draft is empty, even with no run in flight. One press ends the voice session and, when a run is live (work the voice model delegated, or a typed run), stops that run too. The voice status strip no longer has an end button of its own, so there is one way to stop. While you type during a call, Stop stays beside Send: it ends the call and leaves the draft in the composer, and Send still puts the words into the live voice conversation. Hosts that build their own composer pass `liveSession={voice}` to `ComposerSendOrStop` to get the same behaviour.
987
+
988
+ **Ending a voice session never shows "Message was not sent".** A `voice/*` command the host refuses (most often an end that arrives just after the session closed on its own) no longer raises the chat's error banner; the voice controller already handles those outcomes. Agora also now answers an end of an already-closed session as done instead of refusing it.
989
+
990
+ **`AthenaTurnEndStatus`, `useAthenaTurnEnded` and `useAthenaVoiceLive`.** A quiet line under the last reply ("Athena went to sleep" by default; pass your own words as children) that shows only once the reply is complete and no run *and no voice session* is live. A live voice session is a conversation still under way between runs, so it never reads as asleep. Mount it in an `AssistantActionBar` override instead of writing your own; `useAthenaTurnEnded()` gives the same verdict as a boolean, and `useAthenaVoiceLive()` says whether a voice session is live on the thread.
991
+
992
+ ```tsx
993
+ import { AthenaAssistantActionBar, AthenaChat, AthenaTurnEndStatus } from '@athenaintel/react';
994
+
995
+ const Footer = (props) => (
996
+ <>
997
+ <AthenaTurnEndStatus />
998
+ <AthenaAssistantActionBar {...props} />
999
+ </>
1000
+ );
1001
+
1002
+ <AthenaChat components={{ AssistantActionBar: Footer }} />;
1003
+ ```
1004
+
1005
+ ## What's new in 0.43.0
1006
+
1007
+ **Asset and citation chips look and read like Olympus's.** A chip is now Olympus's mention pill in your theme's colours (grey on the default theme, still legible on a dark one): the asset's icon, its name, then the cited place in brackets (`Q4 report [p.5]`). Like Olympus's chips, it looks the asset up and shows the asset's own title and its type's icon instead of the link's label and `type=`. The lookup is agora's `getAssetsByIds` with the chat's credentials, which returns only the assets the viewer may read. Chips that render together ask in one request. Each answer is cached for a minute per backend and per signed-in person or API key (TanStack Query, on the host's `QueryClient` when there is one); a credential that names neither shares nothing beyond its own chat. Until the answer arrives, and for an asset the viewer may not read, the chip keeps the link's label and `type=`. A chip asks only where the answer changes it: never for a repository file's catalog (the chip reads as the file either way) or for a session (agora would read its whole row, transcript ledgers included). A chip with no credential to send (no token, API key or session cookie) asks for nothing.
1008
+
1009
+ **A repository file citation reads as the file and its lines, with GitHub's mark.** A citation of a GitHub repository's lines (`type=catalog&anchor=file_line_range`) now reads `route.ts:18-24` whatever label the model wrote: the repository's name, a long path, or a label in backticks. A long file name shortens before its lines do. The tooltip carries what the chip leaves out: the model's label when it says something else, the repository, the whole path and the cited passage.
1010
+
1011
+ **A place is drawn once.** A label that already ends with its place (`Q4 report p.5`, `olympus/…/route.ts:18-24`) is no longer followed by the place again. Nothing to change in your app.
1012
+
1013
+ Also first on npm in 0.43.0 (0.42.3 was tagged, not published): an asset link whose text markdown split shows its text, not `[object Object]` (#48739); a new chat's title poll waits for a session-list read already in flight (#48730); shared voice commands are scoped to their call (#48761).
1014
+
886
1015
  ## What's new in 0.42.2
887
1016
 
888
1017
  **A message one signed-in user queued is never sent as the next user who signs in to the same chat.** The chat keeps each conversation's unconfirmed commands in this browser under the signed-in user, so a reload can resend them. When the signed-in user changed while the chat stayed mounted (a sign-in provider of your own that signs a signed-out person in, or `AthenaSSOProvider` with `revalidateOnWindowFocus` picking up another account), the conversation moved to the new user's key and took the previous user's client id, command numbers and unsent commands with it. A message the previous user sent while offline, or that had not yet reached Athena, could then go out on the new user's connection, as the new user. With the chat connected at the time, the reverse happened: the new user's messages went out on the connection the previous user had opened, and Athena ran them as the previous user.
@@ -1572,6 +1701,15 @@ Pass them only when you deliberately want to override the agent — an explicit
1572
1701
  `model` is honoured as a caller override, with the agent's model as the default
1573
1702
  beneath it.
1574
1703
 
1704
+ Overrides apply only for a person who can **edit** the agent. Someone who can
1705
+ only view a published agent always runs its published version: the server
1706
+ ignores the `systemPrompt`, `tools` (with the backend-bound `frontendTools`;
1707
+ `frontendTools` with an `execute` still bind), `workbench` and `knowledgeBase`
1708
+ you pass for them, and their `model` applies only when the agent lets people pick it
1709
+ (one of its own models, or any model while **Allow any workspace model** is
1710
+ on). Settings that narrow the agent (excluded tools, a lower budget, read-only)
1711
+ still apply.
1712
+
1575
1713
  ### Offering an agent's own models
1576
1714
 
1577
1715
  An agent's author lists the models it may run (the agent editor's Models
@@ -1604,7 +1742,8 @@ For an agent with the switch off:
1604
1742
  automatic name shows the model's catalog name. A legacy agent with no list
1605
1743
  offers its single model.
1606
1744
  - The channel's model override is that channel's default, added when the list
1607
- lacks it. Picking the default hands you `null`: pass `model={undefined}` to
1745
+ lacks it, until the deployment's refusal date (below). Picking the default
1746
+ hands you `null`: pass `model={undefined}` to
1608
1747
  the provider, so the agent's (or the channel's) default runs and a session
1609
1748
  that pinned another model is unpinned. Picking it while the session pins
1610
1749
  nothing writes nothing. A choice of yours that names the default model is a
@@ -1618,6 +1757,18 @@ For an agent with the switch off:
1618
1757
  - Until the agent has been read, the workspace menu shows but replaces nothing
1619
1758
  on your behalf, since your model may be one only the agent offers.
1620
1759
 
1760
+ **A channel's model, after the deployment's refusal date.** An agent is its
1761
+ published version: a channel or mode may narrow it, and from a date each
1762
+ deployment sets (`CHANNEL_REPLACEMENTS_REFUSED_FROM`, UTC midnight; unset by
1763
+ default) Athena no longer applies a channel's model, so a run on the channel
1764
+ takes the agent's own. With a `channel`, the picker reads that date
1765
+ (`featureGateEnv.channelReplacementsRefusedFrom`, every minute while it shows)
1766
+ and from it names the agent's own model as the default on every channel, in
1767
+ both modes; a channel's model is then offered only when the agent lists it, or
1768
+ the session pins it. It turns at UTC midnight without a reload. Before the
1769
+ date, and against an Athena that predates it, nothing changes. The date is
1770
+ display only: Athena decides from its own setting at every run.
1771
+
1621
1772
  `useAthenaAgentModelOptions({ agent, channel })` is the same data for a picker
1622
1773
  of your own: `{ status, options: [{ model, label, isDefault, pinnedOutside }],
1623
1774
  defaultModel, allowAnyModel }`. Offer only `options` when `allowAnyModel` is
@@ -1865,6 +2016,8 @@ Use `AthenaAssetEmbed` to render a native Athena asset without chat, thread hist
1865
2016
 
1866
2017
  With `displayMode="minimal"`, where the viewer does not sign in, pass `allowQuickEdit` (and `readOnly={false}`) to let the viewer Quick Edit a spreadsheet or Word document with ⌘J. Its runs are billed to the asset's workspace, with an hourly cap per link.
1867
2018
 
2019
+ A minimal embed shows the asset's comment threads, read-only, only to a signed-in viewer with their own access to the asset (the bearer the component hands the frame, or an Athena session). Pass `allowComments` to show them to everyone holding the link, anonymous viewers included. No embed writes a comment. The request carries `allow_comments: true` only when you ask.
2020
+
1868
2021
  ```tsx
1869
2022
  import { useState } from 'react';
1870
2023
  import {
@@ -2057,6 +2210,43 @@ provider's credentials and re-mint before expiry on their own.
2057
2210
  `isRetryableMintError`: network errors, timeouts, 408, 429, 5xx) leaves the
2058
2211
  handle `disconnected` and is retried, immediately when the browser comes back
2059
2212
  online; a refusal (401/403/404) still ends it with `status: 'error'`.
2213
+ - `readDocumentStatus({ grant })` lets a host that can read Keryx's document
2214
+ status with the room's grant (`GET /document-status/{org}/{doc_id}?yauth=&branch=`,
2215
+ which answers no cross-origin page, so it is read from a privileged side: a
2216
+ desktop app's main process, a phone app's native code) say whether Keryx takes
2217
+ the room's writes: `handle.writesRefused` is `true` while it says the room is
2218
+ quarantined, when its socket drops every edit unconfirmed. The handle asks on
2219
+ its first connection, on the connection after a 4401 re-check close, after an
2220
+ outage longer than `offlineGateAfterMs`, once edits wait unconfirmed for 15 s
2221
+ (`UNCONFIRMED_EDITS_STALL_MS`), and every five minutes (every minute while
2222
+ refused) while connected and shown; one read at a time, given up after
2223
+ `DOCUMENT_STATUS_READ_TIMEOUT_MS`, none on a read-only grant. Resolve `null`
2224
+ when you can't answer: it reads as "takes writes".
2225
+
2226
+ A write your app makes on its own, not for the person (an editor tidying what
2227
+ an older version stored, a value restored), can be sent as housekeeping: make
2228
+ it inside `runWithDocUpdateAttributions` for the handle's document.
2229
+
2230
+ ```ts
2231
+ import {
2232
+ BACKGROUND_UPDATE_ATTRIBUTIONS,
2233
+ runWithDocUpdateAttributions,
2234
+ } from '@athenaintel/react/collab';
2235
+
2236
+ runWithDocUpdateAttributions({
2237
+ doc: handle.doc,
2238
+ attributions: BACKGROUND_UPDATE_ATTRIBUTIONS,
2239
+ run: () => handle.doc.get('meta').setAttr('normalized', true),
2240
+ });
2241
+ ```
2242
+
2243
+ The handle's socket sends that write's update with `origin: background`, so
2244
+ Athena counts it as automatic work: it is not shown as the person's edit and
2245
+ does not notify subscriptions that follow people's edits. Only a synchronous
2246
+ write inside `run` is marked, and only while the handle is connected; a write
2247
+ made offline is sent with the reconnect's sync, as the person's. On a read-only
2248
+ grant the handle's socket sends nothing that carries document content (presence
2249
+ still goes out); Athena would refuse it anyway.
2060
2250
 
2061
2251
  ### Workspace presence (admin only)
2062
2252
 
@@ -2275,6 +2465,38 @@ function WorkflowButton() {
2275
2465
  }
2276
2466
  ```
2277
2467
 
2468
+ ## Controls that need a connection
2469
+
2470
+ A host that knows Athena can't be reached (from its own reachability: a health
2471
+ read, the OS's network events) can tell the composer, so the controls that need
2472
+ Athena show off with a reason instead of failing once used:
2473
+
2474
+ ```tsx
2475
+ const NEEDS_CONNECTION =
2476
+ 'Needs a connection. This needs Athena. It’s available again when you’re back online.';
2477
+
2478
+ <AthenaChat composer={{ needsConnectionReason: reachable ? null : NEEDS_CONNECTION }} />
2479
+ ```
2480
+
2481
+ While it is set, the paperclip, the `@` button, the dictation mic and voice are
2482
+ disabled with the reason as their tooltip. They stay focusable, so the reason
2483
+ reads on focus as well as on hover, and pressing one starts nothing. Typing `@`
2484
+ still opens the mention menu, but it asks Athena nothing: what it can list
2485
+ without Athena (your tools, what it already loaded) shows, and a search or a
2486
+ category that would load from Athena says it needs a connection instead of
2487
+ spinning. A voice session already
2488
+ connecting or live keeps its Cancel and Mute. Typing goes on, and Send follows
2489
+ the chat outbox (`chatOutbox` on `AthenaProvider`): a host that has one holds
2490
+ what is sent until Athena is back. A file pasted or dropped meanwhile is refused
2491
+ by that outbox, as before. Cleared (`null`), each control works again at once.
2492
+
2493
+ The composer's pickers take the same reason: `ChatAgentPicker`,
2494
+ `ChatModelPicker` and `ChatModePicker` show `disabledReason` as their tooltip
2495
+ while `disabled`, where the pointer reaches it (a disabled button gets no
2496
+ pointer events). A menu that is open when its picker turns disabled closes and
2497
+ takes no choice, and it opens again only on the next press. `FileUploadButton`
2498
+ takes `disabledReason` too, for a composer of your own.
2499
+
2278
2500
  ## Debugging and Diagnostics
2279
2501
 
2280
2502
  The SDK emits structured diagnostic events — auth handshake, thread list,
@@ -0,0 +1,137 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
+ const core = require("@assistant-ui/core");
4
+ const ATHENA_ANSWERED_BY_KEY = "answered_by";
5
+ const ATHENA_ASSISTANT_NAME = "Athena";
6
+ const ASSISTANT_AGENT_PREFIX = "assistant:";
7
+ const PERSON_PRINCIPAL_PREFIX = "user_";
8
+ const UNNAMED_AGENT_NAME = "Agent";
9
+ const LABEL_SEPARATOR = " · ";
10
+ const NO_ANSWERS = Object.freeze([]);
11
+ const isRecord = (value) => typeof value === "object" && value !== null && !Array.isArray(value);
12
+ const optionalId = (value) => typeof value === "string" && value.length > 0 ? value : null;
13
+ const optionalName = (value) => {
14
+ if (typeof value !== "string") return null;
15
+ const trimmed = value.trim();
16
+ return trimmed.length > 0 ? trimmed : null;
17
+ };
18
+ function readAnsweredBy(value) {
19
+ if (!isRecord(value)) return null;
20
+ const agent = optionalId(value.agent);
21
+ if (agent === null) return null;
22
+ return {
23
+ agent,
24
+ agent_name: optionalName(value.agent_name),
25
+ for_id: optionalId(value.for_id),
26
+ for_name: optionalName(value.for_name)
27
+ };
28
+ }
29
+ const ANSWER_ROW_RUN_ID_PREFIX = "answered_by:";
30
+ function answerRowRunId(agent, forId) {
31
+ return `${ANSWER_ROW_RUN_ID_PREFIX}${agent}|${forId ?? ""}`;
32
+ }
33
+ function isSplitAnswerRow(message) {
34
+ var _a;
35
+ const runId = message.role === "assistant" ? (_a = message.metadata) == null ? void 0 : _a.runId : void 0;
36
+ return typeof runId === "string" && runId.startsWith(ANSWER_ROW_RUN_ID_PREFIX);
37
+ }
38
+ const isSameAnswerer = (a, b) => a.agent === b.agent && a.for_id === b.for_id;
39
+ const isPersonPrincipal = (id) => id !== null && id.startsWith(PERSON_PRINCIPAL_PREFIX);
40
+ function readLangChainAnswer(source) {
41
+ var _a;
42
+ if ((source == null ? void 0 : source.type) !== "ai") return null;
43
+ const bag = (_a = source.additional_kwargs) == null ? void 0 : _a.metadata;
44
+ return isRecord(bag) ? readAnsweredBy(bag[ATHENA_ANSWERED_BY_KEY]) : null;
45
+ }
46
+ function collectMessageAnswers(message) {
47
+ var _a, _b;
48
+ if (message.role !== "assistant") return NO_ANSWERS;
49
+ const sources = core.getExternalStoreMessages(message);
50
+ if (sources.length === 0) {
51
+ const joined = readAnsweredBy((_b = (_a = message.metadata) == null ? void 0 : _a.custom) == null ? void 0 : _b[ATHENA_ANSWERED_BY_KEY]);
52
+ return joined === null ? NO_ANSWERS : [joined];
53
+ }
54
+ let answers = null;
55
+ for (const source of sources) {
56
+ const answer = readLangChainAnswer(source);
57
+ if (answer === null || (answers == null ? void 0 : answers.some((seen) => isSameAnswerer(seen, answer)))) continue;
58
+ answers ?? (answers = []);
59
+ answers.push(answer);
60
+ }
61
+ return answers ?? NO_ANSWERS;
62
+ }
63
+ const answersByMessage = /* @__PURE__ */ new WeakMap();
64
+ function readMessageAnswers(message) {
65
+ const cached = answersByMessage.get(message);
66
+ if (cached !== void 0) return cached;
67
+ const answers = collectMessageAnswers(message);
68
+ answersByMessage.set(message, answers);
69
+ return answers;
70
+ }
71
+ function threadShowsAnswerLabels(messages) {
72
+ let first = null;
73
+ for (const message of messages) {
74
+ if (isSplitAnswerRow(message)) return true;
75
+ for (const answer of readMessageAnswers(message)) {
76
+ if (first === null) {
77
+ first = answer;
78
+ } else if (!isSameAnswerer(first, answer)) {
79
+ return true;
80
+ }
81
+ }
82
+ }
83
+ return false;
84
+ }
85
+ function showsAnswerLabel({
86
+ answers,
87
+ threadShowsLabels,
88
+ viewerId
89
+ }) {
90
+ if (answers.length === 0) return false;
91
+ if (threadShowsLabels) return true;
92
+ return viewerId !== null && answers.some((answer) => isPersonPrincipal(answer.for_id) && answer.for_id !== viewerId);
93
+ }
94
+ function answererName(answer) {
95
+ if (answer.agent_name !== null) return answer.agent_name;
96
+ return answer.agent.startsWith(ASSISTANT_AGENT_PREFIX) ? ATHENA_ASSISTANT_NAME : UNNAMED_AGENT_NAME;
97
+ }
98
+ function forWhomName(answer, viewerId) {
99
+ if (answer.for_id !== null && answer.for_id === viewerId) return "you";
100
+ if (answer.for_name !== null && isPersonPrincipal(answer.for_id)) return answer.for_name;
101
+ return null;
102
+ }
103
+ function joinNames(names) {
104
+ if (names.length <= 1) return names[0] ?? "";
105
+ return `${names.slice(0, -1).join(", ")} and ${names[names.length - 1]}`;
106
+ }
107
+ function answerLabelText({
108
+ answers,
109
+ viewerId
110
+ }) {
111
+ if (answers.length === 0) return null;
112
+ const groups = [];
113
+ for (const answer of answers) {
114
+ const name = answererName(answer);
115
+ const forWhom = forWhomName(answer, viewerId);
116
+ const group = groups.find((candidate) => candidate.forId === answer.for_id);
117
+ if (group === void 0) {
118
+ groups.push({ forId: answer.for_id, names: [name], forWhom });
119
+ continue;
120
+ }
121
+ if (!group.names.includes(name)) group.names.push(name);
122
+ group.forWhom ?? (group.forWhom = forWhom);
123
+ }
124
+ return groups.map(
125
+ ({ names, forWhom }) => forWhom === null ? joinNames(names) : `${joinNames(names)}${LABEL_SEPARATOR}for ${forWhom}`
126
+ ).join(", ");
127
+ }
128
+ exports.ATHENA_ANSWERED_BY_KEY = ATHENA_ANSWERED_BY_KEY;
129
+ exports.ATHENA_ASSISTANT_NAME = ATHENA_ASSISTANT_NAME;
130
+ exports.answerLabelText = answerLabelText;
131
+ exports.answerRowRunId = answerRowRunId;
132
+ exports.readAnsweredBy = readAnsweredBy;
133
+ exports.readLangChainAnswer = readLangChainAnswer;
134
+ exports.readMessageAnswers = readMessageAnswers;
135
+ exports.showsAnswerLabel = showsAnswerLabel;
136
+ exports.threadShowsAnswerLabels = threadShowsAnswerLabels;
137
+ //# sourceMappingURL=answer-label.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"answer-label.cjs","sources":["../../../../agent-runtime/src/answer-label.ts"],"sourcesContent":["import { getExternalStoreMessages, type ThreadMessage } from '@assistant-ui/core';\nimport type { LangChainMessage } from '@assistant-ui/react-langgraph';\n\n/**\n * `metadata.custom` key naming the agent that answered an AI message and whom\n * its run worked for (identity v7 D13: \"each answer is labelled with its\n * agent, 'for <author>'\").\n *\n * The backend stamps it on every answer a deep-agent run's model produces\n * (`agora/.../conversation_agents/answer_label.py`), under the\n * `additional_kwargs.metadata` bag the converter exposes as\n * `message.metadata.custom`, and mirrors it onto the live wire once the\n * model's turn lands. Only the server writes it. Answers written before the\n * stamp existed carry none, and get no label.\n */\nexport const ATHENA_ANSWERED_BY_KEY = 'answered_by';\n\n/** The agent that answered and whom its run worked for, as the backend stamps them. */\nexport interface DeepAgentAnsweredBy {\n /** `collab_agent:<asset id>` for a team agent, `assistant:<principal id>` for someone's own assistant. */\n agent: string;\n /** The collab agent's name when it answered; `null` for an assistant, which clients name. */\n agent_name: string | null;\n /** Whom the run worked for: a person (`user_…`), an agent's or automation's own run, or nobody (`null`). */\n for_id: string | null;\n /** That person's display name when it answered, else `null`. */\n for_name: string | null;\n}\n\n/** What a label calls someone's own assistant: the managed default agent's product name. */\nexport const ATHENA_ASSISTANT_NAME = 'Athena';\n\nconst ASSISTANT_AGENT_PREFIX = 'assistant:';\nconst PERSON_PRINCIPAL_PREFIX = 'user_';\nconst UNNAMED_AGENT_NAME = 'Agent';\nconst LABEL_SEPARATOR = ' · ';\nconst NO_ANSWERS: readonly DeepAgentAnsweredBy[] = Object.freeze([]);\n\nconst isRecord = (value: unknown): value is Record<string, unknown> =>\n typeof value === 'object' && value !== null && !Array.isArray(value);\n\nconst optionalId = (value: unknown): string | null =>\n typeof value === 'string' && value.length > 0 ? value : null;\n\nconst optionalName = (value: unknown): string | null => {\n if (typeof value !== 'string') return null;\n const trimmed = value.trim();\n return trimmed.length > 0 ? trimmed : null;\n};\n\n/**\n * Parse an `answered_by` stamp off a wire value.\n *\n * A stamp without a string `agent` is no stamp at all; absent or malformed\n * optional fields read as `null`, so a partly malformed stamp still names its\n * agent and never names a person it can't.\n */\nexport function readAnsweredBy(value: unknown): DeepAgentAnsweredBy | null {\n if (!isRecord(value)) return null;\n const agent = optionalId(value.agent);\n if (agent === null) return null;\n return {\n agent,\n agent_name: optionalName(value.agent_name),\n for_id: optionalId(value.for_id),\n for_name: optionalName(value.for_name),\n };\n}\n\n/**\n * The run id an answer's row carries when the deep-agent conversion split a\n * turn several answerers wrote into one row per answerer (`answer-rows.ts`):\n * one per agent and principal.\n */\nconst ANSWER_ROW_RUN_ID_PREFIX = 'answered_by:';\n\n/** The row run id of an answer by `agent` for `forId` (see `withAnswerRows`). */\nexport function answerRowRunId(agent: string, forId: string | null): string {\n return `${ANSWER_ROW_RUN_ID_PREFIX}${agent}|${forId ?? ''}`;\n}\n\n/**\n * Whether a converted row is one of a turn the conversion split by answerer.\n * Reads `metadata` optionally, as `collectMessageAnswers` does: a message\n * another runtime (or a test) builds may carry none.\n */\nfunction isSplitAnswerRow(message: ThreadMessage): boolean {\n const runId = message.role === 'assistant' ? message.metadata?.runId : undefined;\n return typeof runId === 'string' && runId.startsWith(ANSWER_ROW_RUN_ID_PREFIX);\n}\n\nconst isSameAnswerer = (a: DeepAgentAnsweredBy, b: DeepAgentAnsweredBy): boolean =>\n a.agent === b.agent && a.for_id === b.for_id;\n\nconst isPersonPrincipal = (id: string | null): id is string =>\n id !== null && id.startsWith(PERSON_PRINCIPAL_PREFIX);\n\n/** The `answered_by` stamp an AI message as the wire carries it holds; `null` for any other message. */\nexport function readLangChainAnswer(\n source: LangChainMessage | undefined\n): DeepAgentAnsweredBy | null {\n if (source?.type !== 'ai') return null;\n const bag = source.additional_kwargs?.metadata;\n return isRecord(bag) ? readAnsweredBy(bag[ATHENA_ANSWERED_BY_KEY]) : null;\n}\n\nfunction collectMessageAnswers(message: ThreadMessage): readonly DeepAgentAnsweredBy[] {\n if (message.role !== 'assistant') return NO_ANSWERS;\n const sources = getExternalStoreMessages<LangChainMessage>(message);\n if (sources.length === 0) {\n const joined = readAnsweredBy(message.metadata?.custom?.[ATHENA_ANSWERED_BY_KEY]);\n return joined === null ? NO_ANSWERS : [joined];\n }\n let answers: DeepAgentAnsweredBy[] | null = null;\n for (const source of sources) {\n const answer = readLangChainAnswer(source);\n if (answer === null || answers?.some((seen) => isSameAnswerer(seen, answer))) continue;\n answers ??= [];\n answers.push(answer);\n }\n return answers ?? NO_ANSWERS;\n}\n\nconst answersByMessage = new WeakMap<ThreadMessage, readonly DeepAgentAnsweredBy[]>();\n\n/**\n * The answers one thread message holds: each agent that answered in it and\n * whom it worked for, in the order they answered, one entry per agent and\n * principal.\n *\n * Read off the message's bound source messages, not its joined\n * `metadata.custom`: assistant-ui joins consecutive AI messages into one\n * turn, and its joined metadata keeps only the last stamp. The deep-agent\n * conversion gives each agent that answers one message in turn (D13 several\n * agents, one message) a row of its own (`answer-rows.ts`), so a row\n * normally holds one answer; a conversion without that split (another\n * pipeline, a stamp that never landed) still names every agent of the row.\n * A message with no bound sources (another runtime) falls back to the joined\n * value. Cached per message object: a settled message keeps its object\n * across a streamed token, so a thread-wide scan per token reads only the\n * message that changed.\n */\nexport function readMessageAnswers(message: ThreadMessage): readonly DeepAgentAnsweredBy[] {\n const cached = answersByMessage.get(message);\n if (cached !== undefined) return cached;\n const answers = collectMessageAnswers(message);\n answersByMessage.set(message, answers);\n return answers;\n}\n\n/**\n * The thread-wide half of the label decision: whether the transcript's\n * answers name two or more agents, or two or more principals they worked\n * for. Then every answer is labelled; a 1:1 chat with one agent working for\n * one person looks as it did before labels. Unstamped answers count for\n * nothing.\n *\n * It decides over the messages the client holds (on a windowed wire, the\n * pages loaded so far), as the human-author avatars do: a page of older\n * history that brings another agent or person turns the labels on. Each\n * label still names its own answer's stamp, so loading history never changes\n * what an answer is attributed to, only whether the line shows.\n *\n * A turn the conversion split into one row per answerer turns the labels on\n * too, before the next agent's stamp lands: while several agents answer one\n * message, the host's record already says a second agent is answering, so\n * the first agent's answer is labelled from the moment the second one's row\n * appears.\n */\nexport function threadShowsAnswerLabels(messages: readonly ThreadMessage[]): boolean {\n let first: DeepAgentAnsweredBy | null = null;\n for (const message of messages) {\n if (isSplitAnswerRow(message)) return true;\n for (const answer of readMessageAnswers(message)) {\n if (first === null) {\n first = answer;\n } else if (!isSameAnswerer(first, answer)) {\n return true;\n }\n }\n }\n return false;\n}\n\n/**\n * Whether a message's answers are labelled: always once the thread's answers\n * name several agents or principals (`threadShowsLabels`), and otherwise when\n * one of them worked for a person other than the viewer. Without a known\n * viewer that last rule is off, so a 1:1 chat never flashes labels while the\n * viewer loads.\n */\nexport function showsAnswerLabel({\n answers,\n threadShowsLabels,\n viewerId,\n}: {\n answers: readonly DeepAgentAnsweredBy[];\n threadShowsLabels: boolean;\n viewerId: string | null;\n}): boolean {\n if (answers.length === 0) return false;\n if (threadShowsLabels) return true;\n return (\n viewerId !== null &&\n answers.some((answer) => isPersonPrincipal(answer.for_id) && answer.for_id !== viewerId)\n );\n}\n\nfunction answererName(answer: DeepAgentAnsweredBy): string {\n if (answer.agent_name !== null) return answer.agent_name;\n return answer.agent.startsWith(ASSISTANT_AGENT_PREFIX)\n ? ATHENA_ASSISTANT_NAME\n : UNNAMED_AGENT_NAME;\n}\n\nfunction forWhomName(answer: DeepAgentAnsweredBy, viewerId: string | null): string | null {\n if (answer.for_id !== null && answer.for_id === viewerId) return 'you';\n if (answer.for_name !== null && isPersonPrincipal(answer.for_id)) return answer.for_name;\n return null;\n}\n\nfunction joinNames(names: readonly string[]): string {\n if (names.length <= 1) return names[0] ?? '';\n return `${names.slice(0, -1).join(', ')} and ${names[names.length - 1]}`;\n}\n\n/**\n * The label's words: who answered, then whom for. \"Finance · for you\",\n * \"Athena · for Priya Shah\", \"Finance\" (a run that worked for nobody, or for\n * an agent's own run). The agent is the collab agent's name, else\n * {@link ATHENA_ASSISTANT_NAME} for someone's own assistant, else \"Agent\".\n * Several agents answering for the same principal read \"Finance and Legal ·\n * for you\"; answers for different principals are listed apart, even when the\n * people share a name (\"Finance · for Alex, Legal · for Alex\"). `null` when\n * the message holds no answers.\n */\nexport function answerLabelText({\n answers,\n viewerId,\n}: {\n answers: readonly DeepAgentAnsweredBy[];\n viewerId: string | null;\n}): string | null {\n if (answers.length === 0) return null;\n // One group per principal (nobody is one too), never per displayed name: two\n // people who share a name stay two recipients.\n const groups: { forId: string | null; names: string[]; forWhom: string | null }[] = [];\n for (const answer of answers) {\n const name = answererName(answer);\n const forWhom = forWhomName(answer, viewerId);\n const group = groups.find((candidate) => candidate.forId === answer.for_id);\n if (group === undefined) {\n groups.push({ forId: answer.for_id, names: [name], forWhom });\n continue;\n }\n if (!group.names.includes(name)) group.names.push(name);\n // A recipient one answer left unnamed takes the name a later answer for\n // the same principal carries. The first name found wins: answers stamped\n // under two names for one id (a rename between runs) read as the first.\n group.forWhom ??= forWhom;\n }\n return groups\n .map(({ names, forWhom }) =>\n forWhom === null ? joinNames(names) : `${joinNames(names)}${LABEL_SEPARATOR}for ${forWhom}`\n )\n .join(', ');\n}\n"],"names":["getExternalStoreMessages"],"mappings":";;;AAeO,MAAM,yBAAyB;AAe/B,MAAM,wBAAwB;AAErC,MAAM,yBAAyB;AAC/B,MAAM,0BAA0B;AAChC,MAAM,qBAAqB;AAC3B,MAAM,kBAAkB;AACxB,MAAM,aAA6C,OAAO,OAAO,EAAE;AAEnE,MAAM,WAAW,CAAC,UAChB,OAAO,UAAU,YAAY,UAAU,QAAQ,CAAC,MAAM,QAAQ,KAAK;AAErE,MAAM,aAAa,CAAC,UAClB,OAAO,UAAU,YAAY,MAAM,SAAS,IAAI,QAAQ;AAE1D,MAAM,eAAe,CAAC,UAAkC;AACtD,MAAI,OAAO,UAAU,SAAU,QAAO;AACtC,QAAM,UAAU,MAAM,KAAA;AACtB,SAAO,QAAQ,SAAS,IAAI,UAAU;AACxC;AASO,SAAS,eAAe,OAA4C;AACzE,MAAI,CAAC,SAAS,KAAK,EAAG,QAAO;AAC7B,QAAM,QAAQ,WAAW,MAAM,KAAK;AACpC,MAAI,UAAU,KAAM,QAAO;AAC3B,SAAO;AAAA,IACL;AAAA,IACA,YAAY,aAAa,MAAM,UAAU;AAAA,IACzC,QAAQ,WAAW,MAAM,MAAM;AAAA,IAC/B,UAAU,aAAa,MAAM,QAAQ;AAAA,EAAA;AAEzC;AAOA,MAAM,2BAA2B;AAG1B,SAAS,eAAe,OAAe,OAA8B;AAC1E,SAAO,GAAG,wBAAwB,GAAG,KAAK,IAAI,SAAS,EAAE;AAC3D;AAOA,SAAS,iBAAiB,SAAiC;;AACzD,QAAM,QAAQ,QAAQ,SAAS,eAAc,aAAQ,aAAR,mBAAkB,QAAQ;AACvE,SAAO,OAAO,UAAU,YAAY,MAAM,WAAW,wBAAwB;AAC/E;AAEA,MAAM,iBAAiB,CAAC,GAAwB,MAC9C,EAAE,UAAU,EAAE,SAAS,EAAE,WAAW,EAAE;AAExC,MAAM,oBAAoB,CAAC,OACzB,OAAO,QAAQ,GAAG,WAAW,uBAAuB;AAG/C,SAAS,oBACd,QAC4B;;AAC5B,OAAI,iCAAQ,UAAS,KAAM,QAAO;AAClC,QAAM,OAAM,YAAO,sBAAP,mBAA0B;AACtC,SAAO,SAAS,GAAG,IAAI,eAAe,IAAI,sBAAsB,CAAC,IAAI;AACvE;AAEA,SAAS,sBAAsB,SAAwD;;AACrF,MAAI,QAAQ,SAAS,YAAa,QAAO;AACzC,QAAM,UAAUA,KAAAA,yBAA2C,OAAO;AAClE,MAAI,QAAQ,WAAW,GAAG;AACxB,UAAM,SAAS,gBAAe,mBAAQ,aAAR,mBAAkB,WAAlB,mBAA2B,uBAAuB;AAChF,WAAO,WAAW,OAAO,aAAa,CAAC,MAAM;AAAA,EAC/C;AACA,MAAI,UAAwC;AAC5C,aAAW,UAAU,SAAS;AAC5B,UAAM,SAAS,oBAAoB,MAAM;AACzC,QAAI,WAAW,SAAQ,mCAAS,KAAK,CAAC,SAAS,eAAe,MAAM,MAAM,IAAI;AAC9E,0BAAY,CAAA;AACZ,YAAQ,KAAK,MAAM;AAAA,EACrB;AACA,SAAO,WAAW;AACpB;AAEA,MAAM,uCAAuB,QAAA;AAmBtB,SAAS,mBAAmB,SAAwD;AACzF,QAAM,SAAS,iBAAiB,IAAI,OAAO;AAC3C,MAAI,WAAW,OAAW,QAAO;AACjC,QAAM,UAAU,sBAAsB,OAAO;AAC7C,mBAAiB,IAAI,SAAS,OAAO;AACrC,SAAO;AACT;AAqBO,SAAS,wBAAwB,UAA6C;AACnF,MAAI,QAAoC;AACxC,aAAW,WAAW,UAAU;AAC9B,QAAI,iBAAiB,OAAO,EAAG,QAAO;AACtC,eAAW,UAAU,mBAAmB,OAAO,GAAG;AAChD,UAAI,UAAU,MAAM;AAClB,gBAAQ;AAAA,MACV,WAAW,CAAC,eAAe,OAAO,MAAM,GAAG;AACzC,eAAO;AAAA,MACT;AAAA,IACF;AAAA,EACF;AACA,SAAO;AACT;AASO,SAAS,iBAAiB;AAAA,EAC/B;AAAA,EACA;AAAA,EACA;AACF,GAIY;AACV,MAAI,QAAQ,WAAW,EAAG,QAAO;AACjC,MAAI,kBAAmB,QAAO;AAC9B,SACE,aAAa,QACb,QAAQ,KAAK,CAAC,WAAW,kBAAkB,OAAO,MAAM,KAAK,OAAO,WAAW,QAAQ;AAE3F;AAEA,SAAS,aAAa,QAAqC;AACzD,MAAI,OAAO,eAAe,KAAM,QAAO,OAAO;AAC9C,SAAO,OAAO,MAAM,WAAW,sBAAsB,IACjD,wBACA;AACN;AAEA,SAAS,YAAY,QAA6B,UAAwC;AACxF,MAAI,OAAO,WAAW,QAAQ,OAAO,WAAW,SAAU,QAAO;AACjE,MAAI,OAAO,aAAa,QAAQ,kBAAkB,OAAO,MAAM,UAAU,OAAO;AAChF,SAAO;AACT;AAEA,SAAS,UAAU,OAAkC;AACnD,MAAI,MAAM,UAAU,EAAG,QAAO,MAAM,CAAC,KAAK;AAC1C,SAAO,GAAG,MAAM,MAAM,GAAG,EAAE,EAAE,KAAK,IAAI,CAAC,QAAQ,MAAM,MAAM,SAAS,CAAC,CAAC;AACxE;AAYO,SAAS,gBAAgB;AAAA,EAC9B;AAAA,EACA;AACF,GAGkB;AAChB,MAAI,QAAQ,WAAW,EAAG,QAAO;AAGjC,QAAM,SAA8E,CAAA;AACpF,aAAW,UAAU,SAAS;AAC5B,UAAM,OAAO,aAAa,MAAM;AAChC,UAAM,UAAU,YAAY,QAAQ,QAAQ;AAC5C,UAAM,QAAQ,OAAO,KAAK,CAAC,cAAc,UAAU,UAAU,OAAO,MAAM;AAC1E,QAAI,UAAU,QAAW;AACvB,aAAO,KAAK,EAAE,OAAO,OAAO,QAAQ,OAAO,CAAC,IAAI,GAAG,SAAS;AAC5D;AAAA,IACF;AACA,QAAI,CAAC,MAAM,MAAM,SAAS,IAAI,EAAG,OAAM,MAAM,KAAK,IAAI;AAItD,UAAM,YAAN,MAAM,UAAY;AAAA,EACpB;AACA,SAAO,OACJ;AAAA,IAAI,CAAC,EAAE,OAAO,QAAA,MACb,YAAY,OAAO,UAAU,KAAK,IAAI,GAAG,UAAU,KAAK,CAAC,GAAG,eAAe,OAAO,OAAO;AAAA,EAAA,EAE1F,KAAK,IAAI;AACd;;;;;;;;;;"}
@@ -0,0 +1,104 @@
1
+ import { type ThreadMessage } from '@assistant-ui/core';
2
+ import type { LangChainMessage } from '@assistant-ui/react-langgraph';
3
+ /**
4
+ * `metadata.custom` key naming the agent that answered an AI message and whom
5
+ * its run worked for (identity v7 D13: "each answer is labelled with its
6
+ * agent, 'for <author>'").
7
+ *
8
+ * The backend stamps it on every answer a deep-agent run's model produces
9
+ * (`agora/.../conversation_agents/answer_label.py`), under the
10
+ * `additional_kwargs.metadata` bag the converter exposes as
11
+ * `message.metadata.custom`, and mirrors it onto the live wire once the
12
+ * model's turn lands. Only the server writes it. Answers written before the
13
+ * stamp existed carry none, and get no label.
14
+ */
15
+ export declare const ATHENA_ANSWERED_BY_KEY = "answered_by";
16
+ /** The agent that answered and whom its run worked for, as the backend stamps them. */
17
+ export interface DeepAgentAnsweredBy {
18
+ /** `collab_agent:<asset id>` for a team agent, `assistant:<principal id>` for someone's own assistant. */
19
+ agent: string;
20
+ /** The collab agent's name when it answered; `null` for an assistant, which clients name. */
21
+ agent_name: string | null;
22
+ /** Whom the run worked for: a person (`user_…`), an agent's or automation's own run, or nobody (`null`). */
23
+ for_id: string | null;
24
+ /** That person's display name when it answered, else `null`. */
25
+ for_name: string | null;
26
+ }
27
+ /** What a label calls someone's own assistant: the managed default agent's product name. */
28
+ export declare const ATHENA_ASSISTANT_NAME = "Athena";
29
+ /**
30
+ * Parse an `answered_by` stamp off a wire value.
31
+ *
32
+ * A stamp without a string `agent` is no stamp at all; absent or malformed
33
+ * optional fields read as `null`, so a partly malformed stamp still names its
34
+ * agent and never names a person it can't.
35
+ */
36
+ export declare function readAnsweredBy(value: unknown): DeepAgentAnsweredBy | null;
37
+ /** The row run id of an answer by `agent` for `forId` (see `withAnswerRows`). */
38
+ export declare function answerRowRunId(agent: string, forId: string | null): string;
39
+ /** The `answered_by` stamp an AI message as the wire carries it holds; `null` for any other message. */
40
+ export declare function readLangChainAnswer(source: LangChainMessage | undefined): DeepAgentAnsweredBy | null;
41
+ /**
42
+ * The answers one thread message holds: each agent that answered in it and
43
+ * whom it worked for, in the order they answered, one entry per agent and
44
+ * principal.
45
+ *
46
+ * Read off the message's bound source messages, not its joined
47
+ * `metadata.custom`: assistant-ui joins consecutive AI messages into one
48
+ * turn, and its joined metadata keeps only the last stamp. The deep-agent
49
+ * conversion gives each agent that answers one message in turn (D13 several
50
+ * agents, one message) a row of its own (`answer-rows.ts`), so a row
51
+ * normally holds one answer; a conversion without that split (another
52
+ * pipeline, a stamp that never landed) still names every agent of the row.
53
+ * A message with no bound sources (another runtime) falls back to the joined
54
+ * value. Cached per message object: a settled message keeps its object
55
+ * across a streamed token, so a thread-wide scan per token reads only the
56
+ * message that changed.
57
+ */
58
+ export declare function readMessageAnswers(message: ThreadMessage): readonly DeepAgentAnsweredBy[];
59
+ /**
60
+ * The thread-wide half of the label decision: whether the transcript's
61
+ * answers name two or more agents, or two or more principals they worked
62
+ * for. Then every answer is labelled; a 1:1 chat with one agent working for
63
+ * one person looks as it did before labels. Unstamped answers count for
64
+ * nothing.
65
+ *
66
+ * It decides over the messages the client holds (on a windowed wire, the
67
+ * pages loaded so far), as the human-author avatars do: a page of older
68
+ * history that brings another agent or person turns the labels on. Each
69
+ * label still names its own answer's stamp, so loading history never changes
70
+ * what an answer is attributed to, only whether the line shows.
71
+ *
72
+ * A turn the conversion split into one row per answerer turns the labels on
73
+ * too, before the next agent's stamp lands: while several agents answer one
74
+ * message, the host's record already says a second agent is answering, so
75
+ * the first agent's answer is labelled from the moment the second one's row
76
+ * appears.
77
+ */
78
+ export declare function threadShowsAnswerLabels(messages: readonly ThreadMessage[]): boolean;
79
+ /**
80
+ * Whether a message's answers are labelled: always once the thread's answers
81
+ * name several agents or principals (`threadShowsLabels`), and otherwise when
82
+ * one of them worked for a person other than the viewer. Without a known
83
+ * viewer that last rule is off, so a 1:1 chat never flashes labels while the
84
+ * viewer loads.
85
+ */
86
+ export declare function showsAnswerLabel({ answers, threadShowsLabels, viewerId, }: {
87
+ answers: readonly DeepAgentAnsweredBy[];
88
+ threadShowsLabels: boolean;
89
+ viewerId: string | null;
90
+ }): boolean;
91
+ /**
92
+ * The label's words: who answered, then whom for. "Finance · for you",
93
+ * "Athena · for Priya Shah", "Finance" (a run that worked for nobody, or for
94
+ * an agent's own run). The agent is the collab agent's name, else
95
+ * {@link ATHENA_ASSISTANT_NAME} for someone's own assistant, else "Agent".
96
+ * Several agents answering for the same principal read "Finance and Legal ·
97
+ * for you"; answers for different principals are listed apart, even when the
98
+ * people share a name ("Finance · for Alex, Legal · for Alex"). `null` when
99
+ * the message holds no answers.
100
+ */
101
+ export declare function answerLabelText({ answers, viewerId, }: {
102
+ answers: readonly DeepAgentAnsweredBy[];
103
+ viewerId: string | null;
104
+ }): string | null;