@athenaintel/react 0.43.0 → 0.50.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 (746) hide show
  1. package/README.md +258 -8
  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/call-recap.cjs +319 -0
  13. package/dist/agent-runtime/src/call-recap.cjs.map +1 -0
  14. package/dist/agent-runtime/src/call-recap.d.ts +142 -0
  15. package/dist/agent-runtime/src/call-recap.js +319 -0
  16. package/dist/agent-runtime/src/call-recap.js.map +1 -0
  17. package/dist/agent-runtime/src/chat-outbox-store.cjs +1 -0
  18. package/dist/agent-runtime/src/chat-outbox-store.cjs.map +1 -1
  19. package/dist/agent-runtime/src/chat-outbox-store.d.ts +7 -0
  20. package/dist/agent-runtime/src/chat-outbox-store.js +1 -0
  21. package/dist/agent-runtime/src/chat-outbox-store.js.map +1 -1
  22. package/dist/agent-runtime/src/chat-outbox.cjs +46 -5
  23. package/dist/agent-runtime/src/chat-outbox.cjs.map +1 -1
  24. package/dist/agent-runtime/src/chat-outbox.d.ts +29 -0
  25. package/dist/agent-runtime/src/chat-outbox.js +46 -5
  26. package/dist/agent-runtime/src/chat-outbox.js.map +1 -1
  27. package/dist/agent-runtime/src/client-tool-bridge.cjs +15 -15
  28. package/dist/agent-runtime/src/client-tool-bridge.cjs.map +1 -1
  29. package/dist/agent-runtime/src/conversation-index.cjs +8 -8
  30. package/dist/agent-runtime/src/conversation-index.cjs.map +1 -1
  31. package/dist/agent-runtime/src/conversation-index.d.ts +7 -0
  32. package/dist/agent-runtime/src/conversation-index.js.map +1 -1
  33. package/dist/agent-runtime/src/conversation-list.cjs +2 -1
  34. package/dist/agent-runtime/src/conversation-list.cjs.map +1 -1
  35. package/dist/agent-runtime/src/conversation-list.d.ts +19 -3
  36. package/dist/agent-runtime/src/conversation-list.js +2 -1
  37. package/dist/agent-runtime/src/conversation-list.js.map +1 -1
  38. package/dist/agent-runtime/src/decision-checks.cjs +207 -0
  39. package/dist/agent-runtime/src/decision-checks.cjs.map +1 -0
  40. package/dist/agent-runtime/src/decision-checks.d.ts +142 -0
  41. package/dist/agent-runtime/src/decision-checks.js +207 -0
  42. package/dist/agent-runtime/src/decision-checks.js.map +1 -0
  43. package/dist/agent-runtime/src/desktop-handoff.d.ts +12 -0
  44. package/dist/agent-runtime/src/errors.cjs +18 -0
  45. package/dist/agent-runtime/src/errors.cjs.map +1 -1
  46. package/dist/agent-runtime/src/errors.d.ts +7 -0
  47. package/dist/agent-runtime/src/errors.js +18 -0
  48. package/dist/agent-runtime/src/errors.js.map +1 -1
  49. package/dist/agent-runtime/src/generated/runconfig-contract.cjs +12 -0
  50. package/dist/agent-runtime/src/generated/runconfig-contract.cjs.map +1 -1
  51. package/dist/agent-runtime/src/generated/runconfig-contract.d.ts +6 -6
  52. package/dist/agent-runtime/src/generated/runconfig-contract.js +12 -0
  53. package/dist/agent-runtime/src/generated/runconfig-contract.js.map +1 -1
  54. package/dist/agent-runtime/src/handoff-arrival.cjs +60 -0
  55. package/dist/agent-runtime/src/handoff-arrival.cjs.map +1 -0
  56. package/dist/agent-runtime/src/handoff-arrival.d.ts +46 -0
  57. package/dist/agent-runtime/src/handoff-arrival.js +60 -0
  58. package/dist/agent-runtime/src/handoff-arrival.js.map +1 -0
  59. package/dist/agent-runtime/src/index.d.ts +16 -9
  60. package/dist/agent-runtime/src/interrupts.cjs +71 -19
  61. package/dist/agent-runtime/src/interrupts.cjs.map +1 -1
  62. package/dist/agent-runtime/src/interrupts.d.ts +40 -3
  63. package/dist/agent-runtime/src/interrupts.js +56 -4
  64. package/dist/agent-runtime/src/interrupts.js.map +1 -1
  65. package/dist/agent-runtime/src/lane-history.cjs +8 -8
  66. package/dist/agent-runtime/src/lane-history.cjs.map +1 -1
  67. package/dist/agent-runtime/src/messages.cjs +43 -8
  68. package/dist/agent-runtime/src/messages.cjs.map +1 -1
  69. package/dist/agent-runtime/src/messages.d.ts +25 -3
  70. package/dist/agent-runtime/src/messages.js +43 -8
  71. package/dist/agent-runtime/src/messages.js.map +1 -1
  72. package/dist/agent-runtime/src/model-context.cjs +3 -2
  73. package/dist/agent-runtime/src/model-context.cjs.map +1 -1
  74. package/dist/agent-runtime/src/model-context.d.ts +6 -1
  75. package/dist/agent-runtime/src/model-context.js +3 -2
  76. package/dist/agent-runtime/src/model-context.js.map +1 -1
  77. package/dist/agent-runtime/src/offline-status.cjs +36 -0
  78. package/dist/agent-runtime/src/offline-status.cjs.map +1 -0
  79. package/dist/agent-runtime/src/offline-status.d.ts +118 -3
  80. package/dist/agent-runtime/src/offline-status.js +36 -0
  81. package/dist/agent-runtime/src/offline-status.js.map +1 -0
  82. package/dist/agent-runtime/src/queue.cjs +0 -9
  83. package/dist/agent-runtime/src/queue.cjs.map +1 -1
  84. package/dist/agent-runtime/src/queue.js +0 -9
  85. package/dist/agent-runtime/src/queue.js.map +1 -1
  86. package/dist/agent-runtime/src/quota-safe-local-storage-session.cjs +9 -9
  87. package/dist/agent-runtime/src/quota-safe-local-storage-session.cjs.map +1 -1
  88. package/dist/agent-runtime/src/runtime-catalog.cjs +42 -0
  89. package/dist/agent-runtime/src/runtime-catalog.cjs.map +1 -0
  90. package/dist/agent-runtime/src/runtime-catalog.d.ts +35 -0
  91. package/dist/agent-runtime/src/runtime-catalog.js +42 -0
  92. package/dist/agent-runtime/src/runtime-catalog.js.map +1 -0
  93. package/dist/agent-runtime/src/runtime-messages.cjs.map +1 -1
  94. package/dist/agent-runtime/src/runtime-messages.d.ts +1 -1
  95. package/dist/agent-runtime/src/runtime-messages.js.map +1 -1
  96. package/dist/agent-runtime/src/runtime.d.ts +41 -0
  97. package/dist/agent-runtime/src/send-recovery.cjs +37 -3
  98. package/dist/agent-runtime/src/send-recovery.cjs.map +1 -1
  99. package/dist/agent-runtime/src/send-recovery.d.ts +19 -0
  100. package/dist/agent-runtime/src/send-recovery.js +37 -3
  101. package/dist/agent-runtime/src/send-recovery.js.map +1 -1
  102. package/dist/agent-runtime/src/statewire-suspended.cjs +3 -3
  103. package/dist/agent-runtime/src/statewire-suspended.cjs.map +1 -1
  104. package/dist/agent-runtime/src/subagents.cjs +32 -2
  105. package/dist/agent-runtime/src/subagents.cjs.map +1 -1
  106. package/dist/agent-runtime/src/subagents.d.ts +9 -0
  107. package/dist/agent-runtime/src/subagents.js +30 -0
  108. package/dist/agent-runtime/src/subagents.js.map +1 -1
  109. package/dist/agent-runtime/src/thread-driver.cjs +67 -0
  110. package/dist/agent-runtime/src/thread-driver.cjs.map +1 -0
  111. package/dist/agent-runtime/src/thread-driver.d.ts +49 -0
  112. package/dist/agent-runtime/src/thread-driver.js +67 -0
  113. package/dist/agent-runtime/src/thread-driver.js.map +1 -0
  114. package/dist/agent-runtime/src/thread-handoff-flow-machine.d.ts +172 -0
  115. package/dist/agent-runtime/src/thread-handoff-protocol.d.ts +868 -0
  116. package/dist/agent-runtime/src/thread-handoff-qr.d.ts +11 -0
  117. package/dist/agent-runtime/src/thread-handoff.d.ts +3 -364
  118. package/dist/agent-runtime/src/thread-status.cjs +3 -3
  119. package/dist/agent-runtime/src/thread-status.cjs.map +1 -1
  120. package/dist/agent-runtime/src/tool-metadata.cjs +210 -25
  121. package/dist/agent-runtime/src/tool-metadata.cjs.map +1 -1
  122. package/dist/agent-runtime/src/tool-metadata.d.ts +12 -0
  123. package/dist/agent-runtime/src/tool-metadata.js +210 -25
  124. package/dist/agent-runtime/src/tool-metadata.js.map +1 -1
  125. package/dist/agent-runtime/src/tool-names.cjs +2 -0
  126. package/dist/agent-runtime/src/tool-names.cjs.map +1 -1
  127. package/dist/agent-runtime/src/tool-names.d.ts +2 -0
  128. package/dist/agent-runtime/src/tool-names.js +2 -0
  129. package/dist/agent-runtime/src/tool-names.js.map +1 -1
  130. package/dist/agent-runtime/src/types.d.ts +10 -2
  131. package/dist/agent-runtime/src/use-conversation-list.cjs +14 -13
  132. package/dist/agent-runtime/src/use-conversation-list.cjs.map +1 -1
  133. package/dist/agent-runtime/src/use-conversation-list.d.ts +6 -0
  134. package/dist/agent-runtime/src/use-conversation-list.js +3 -2
  135. package/dist/agent-runtime/src/use-conversation-list.js.map +1 -1
  136. package/dist/agent-runtime/src/use-deep-agent-chat-outbox.cjs +45 -20
  137. package/dist/agent-runtime/src/use-deep-agent-chat-outbox.cjs.map +1 -1
  138. package/dist/agent-runtime/src/use-deep-agent-chat-outbox.d.ts +10 -3
  139. package/dist/agent-runtime/src/use-deep-agent-chat-outbox.js +27 -2
  140. package/dist/agent-runtime/src/use-deep-agent-chat-outbox.js.map +1 -1
  141. package/dist/agent-runtime/src/use-deep-agent-config.cjs +14 -14
  142. package/dist/agent-runtime/src/use-deep-agent-config.cjs.map +1 -1
  143. package/dist/agent-runtime/src/use-deep-agent-edit-submit.cjs +6 -6
  144. package/dist/agent-runtime/src/use-deep-agent-edit-submit.cjs.map +1 -1
  145. package/dist/agent-runtime/src/use-deep-agent-runtime.cjs +40 -22
  146. package/dist/agent-runtime/src/use-deep-agent-runtime.cjs.map +1 -1
  147. package/dist/agent-runtime/src/use-deep-agent-runtime.d.ts +17 -0
  148. package/dist/agent-runtime/src/use-deep-agent-runtime.js +24 -6
  149. package/dist/agent-runtime/src/use-deep-agent-runtime.js.map +1 -1
  150. package/dist/agent-runtime/src/use-deep-agent-thread.cjs +45 -45
  151. package/dist/agent-runtime/src/use-deep-agent-thread.cjs.map +1 -1
  152. package/dist/agent-runtime/src/use-deep-agent-voice.cjs +588 -130
  153. package/dist/agent-runtime/src/use-deep-agent-voice.cjs.map +1 -1
  154. package/dist/agent-runtime/src/use-deep-agent-voice.d.ts +162 -10
  155. package/dist/agent-runtime/src/use-deep-agent-voice.js +529 -71
  156. package/dist/agent-runtime/src/use-deep-agent-voice.js.map +1 -1
  157. package/dist/agent-runtime/src/use-deep-agent-window-sync.cjs +26 -26
  158. package/dist/agent-runtime/src/use-deep-agent-window-sync.cjs.map +1 -1
  159. package/dist/agent-runtime/src/use-historical-edit-attachments.cjs +4 -4
  160. package/dist/agent-runtime/src/use-historical-edit-attachments.cjs.map +1 -1
  161. package/dist/agent-runtime/src/use-thread-handoff-flow.d.ts +34 -26
  162. package/dist/agent-runtime/src/voice-earcon.cjs +139 -0
  163. package/dist/agent-runtime/src/voice-earcon.cjs.map +1 -0
  164. package/dist/agent-runtime/src/voice-earcon.d.ts +38 -0
  165. package/dist/agent-runtime/src/voice-earcon.js +139 -0
  166. package/dist/agent-runtime/src/voice-earcon.js.map +1 -0
  167. package/dist/agent-runtime/src/voice-media.cjs +117 -0
  168. package/dist/agent-runtime/src/voice-media.cjs.map +1 -0
  169. package/dist/agent-runtime/src/voice-media.d.ts +63 -0
  170. package/dist/agent-runtime/src/voice-media.js +117 -0
  171. package/dist/agent-runtime/src/voice-media.js.map +1 -0
  172. package/dist/agent-runtime/src/voice-presentation.cjs +2 -0
  173. package/dist/agent-runtime/src/voice-presentation.cjs.map +1 -1
  174. package/dist/agent-runtime/src/voice-presentation.js +2 -0
  175. package/dist/agent-runtime/src/voice-presentation.js.map +1 -1
  176. package/dist/agent-runtime/src/voice-wire-types.d.ts +32 -0
  177. package/dist/assets/AssetPanel.cjs +11 -11
  178. package/dist/assets/AssetPanel.cjs.map +1 -1
  179. package/dist/assets/AthenaAssetEmbed.cjs +11 -9
  180. package/dist/assets/AthenaAssetEmbed.cjs.map +1 -1
  181. package/dist/assets/AthenaAssetEmbed.d.ts +18 -5
  182. package/dist/assets/AthenaAssetEmbed.js +4 -2
  183. package/dist/assets/AthenaAssetEmbed.js.map +1 -1
  184. package/dist/assets/AthenaLayout.cjs +16 -16
  185. package/dist/assets/AthenaLayout.cjs.map +1 -1
  186. package/dist/assets/use-asset-content.cjs +4 -4
  187. package/dist/assets/use-asset-content.cjs.map +1 -1
  188. package/dist/assets/use-asset-embed.cjs +14 -7
  189. package/dist/assets/use-asset-embed.cjs.map +1 -1
  190. package/dist/assets/use-asset-embed.d.ts +23 -6
  191. package/dist/assets/use-asset-embed.js +10 -3
  192. package/dist/assets/use-asset-embed.js.map +1 -1
  193. package/dist/auth/AthenaAuthContext.cjs +3 -3
  194. package/dist/auth/AthenaAuthContext.cjs.map +1 -1
  195. package/dist/auth/AthenaAuthProvider.cjs +8 -8
  196. package/dist/auth/AthenaAuthProvider.cjs.map +1 -1
  197. package/dist/auth/AthenaCredentialSourceContext.cjs +5 -5
  198. package/dist/auth/AthenaCredentialSourceContext.cjs.map +1 -1
  199. package/dist/auth/AthenaSSOProvider.cjs +14 -14
  200. package/dist/auth/AthenaSSOProvider.cjs.map +1 -1
  201. package/dist/auth/credential-source.cjs +26 -13
  202. package/dist/auth/credential-source.cjs.map +1 -1
  203. package/dist/auth/credential-source.d.ts +8 -0
  204. package/dist/auth/credential-source.js +26 -13
  205. package/dist/auth/credential-source.js.map +1 -1
  206. package/dist/catalog/agent-model-options.cjs +25 -17
  207. package/dist/catalog/agent-model-options.cjs.map +1 -1
  208. package/dist/catalog/agent-model-options.d.ts +38 -5
  209. package/dist/catalog/agent-model-options.js +25 -17
  210. package/dist/catalog/agent-model-options.js.map +1 -1
  211. package/dist/catalog/channel-refusal.cjs +36 -0
  212. package/dist/catalog/channel-refusal.cjs.map +1 -0
  213. package/dist/catalog/channel-refusal.d.ts +29 -0
  214. package/dist/catalog/channel-refusal.js +36 -0
  215. package/dist/catalog/channel-refusal.js.map +1 -0
  216. package/dist/catalog/chat-pickers.cjs +60 -24
  217. package/dist/catalog/chat-pickers.cjs.map +1 -1
  218. package/dist/catalog/chat-pickers.d.ts +12 -2
  219. package/dist/catalog/chat-pickers.js +56 -20
  220. package/dist/catalog/chat-pickers.js.map +1 -1
  221. package/dist/catalog/runtime-catalog.cjs +89 -23
  222. package/dist/catalog/runtime-catalog.cjs.map +1 -1
  223. package/dist/catalog/runtime-catalog.d.ts +8 -2
  224. package/dist/catalog/runtime-catalog.js +83 -17
  225. package/dist/catalog/runtime-catalog.js.map +1 -1
  226. package/dist/catalog/use-athena-chat-mode.cjs +12 -12
  227. package/dist/catalog/use-athena-chat-mode.cjs.map +1 -1
  228. package/dist/chat/AthenaChat.cjs +155 -67
  229. package/dist/chat/AthenaChat.cjs.map +1 -1
  230. package/dist/chat/AthenaChat.d.ts +42 -2
  231. package/dist/chat/AthenaChat.js +106 -18
  232. package/dist/chat/AthenaChat.js.map +1 -1
  233. package/dist/chat/AthenaChatErrorBoundary.cjs +3 -3
  234. package/dist/chat/AthenaChatErrorBoundary.cjs.map +1 -1
  235. package/dist/chat/DrivingOnChip.cjs +23 -0
  236. package/dist/chat/DrivingOnChip.cjs.map +1 -0
  237. package/dist/chat/DrivingOnChip.d.ts +17 -0
  238. package/dist/chat/DrivingOnChip.js +23 -0
  239. package/dist/chat/DrivingOnChip.js.map +1 -0
  240. package/dist/chat/StatewireApprovalCard.cjs +166 -37
  241. package/dist/chat/StatewireApprovalCard.cjs.map +1 -1
  242. package/dist/chat/StatewireApprovalCard.d.ts +91 -2
  243. package/dist/chat/StatewireApprovalCard.js +156 -27
  244. package/dist/chat/StatewireApprovalCard.js.map +1 -1
  245. package/dist/chat/StatewireClientToolBridge.cjs +2 -2
  246. package/dist/chat/StatewireClientToolBridge.cjs.map +1 -1
  247. package/dist/chat/StatewireQueuedMessages.cjs +81 -69
  248. package/dist/chat/StatewireQueuedMessages.cjs.map +1 -1
  249. package/dist/chat/StatewireQueuedMessages.d.ts +25 -13
  250. package/dist/chat/StatewireQueuedMessages.js +73 -61
  251. package/dist/chat/StatewireQueuedMessages.js.map +1 -1
  252. package/dist/chat/WaitingOnYouBanner.cjs +9 -5
  253. package/dist/chat/WaitingOnYouBanner.cjs.map +1 -1
  254. package/dist/chat/WaitingOnYouBanner.js +7 -3
  255. package/dist/chat/WaitingOnYouBanner.js.map +1 -1
  256. package/dist/chat/athena-chat-welcome.cjs +2 -2
  257. package/dist/chat/athena-chat-welcome.cjs.map +1 -1
  258. package/dist/chat/athena-citation-links.cjs +5 -5
  259. package/dist/chat/athena-citation-links.cjs.map +1 -1
  260. package/dist/chat/athena-composer-controls.cjs +26 -16
  261. package/dist/chat/athena-composer-controls.cjs.map +1 -1
  262. package/dist/chat/athena-composer-controls.d.ts +6 -0
  263. package/dist/chat/athena-composer-controls.js +26 -16
  264. package/dist/chat/athena-composer-controls.js.map +1 -1
  265. package/dist/chat/athena-turn-end-status.cjs +42 -0
  266. package/dist/chat/athena-turn-end-status.cjs.map +1 -0
  267. package/dist/chat/athena-turn-end-status.d.ts +24 -0
  268. package/dist/chat/athena-turn-end-status.js +42 -0
  269. package/dist/chat/athena-turn-end-status.js.map +1 -0
  270. package/dist/chat/browser-decision-check.cjs +131 -0
  271. package/dist/chat/browser-decision-check.cjs.map +1 -0
  272. package/dist/chat/browser-decision-check.d.ts +61 -0
  273. package/dist/chat/browser-decision-check.js +131 -0
  274. package/dist/chat/browser-decision-check.js.map +1 -0
  275. package/dist/chat/chat-outbox-rows.cjs +3 -3
  276. package/dist/chat/chat-outbox-rows.cjs.map +1 -1
  277. package/dist/chat/chat-voice-controls.cjs +96 -29
  278. package/dist/chat/chat-voice-controls.cjs.map +1 -1
  279. package/dist/chat/chat-voice-controls.d.ts +42 -3
  280. package/dist/chat/chat-voice-controls.js +92 -25
  281. package/dist/chat/chat-voice-controls.js.map +1 -1
  282. package/dist/chat/composer-keyboard-hint.cjs +5 -5
  283. package/dist/chat/composer-keyboard-hint.cjs.map +1 -1
  284. package/dist/chat/device-operation.cjs +29 -0
  285. package/dist/chat/device-operation.cjs.map +1 -0
  286. package/dist/chat/device-operation.d.ts +34 -0
  287. package/dist/chat/device-operation.js +29 -0
  288. package/dist/chat/device-operation.js.map +1 -0
  289. package/dist/chat/super-grouping/CollapsibleGroup.cjs +14 -14
  290. package/dist/chat/super-grouping/CollapsibleGroup.cjs.map +1 -1
  291. package/dist/chat/super-grouping/GroupedMessageParts.cjs +4 -4
  292. package/dist/chat/super-grouping/GroupedMessageParts.cjs.map +1 -1
  293. package/dist/chat/super-grouping/SuperGroupingCard.cjs +52 -36
  294. package/dist/chat/super-grouping/SuperGroupingCard.cjs.map +1 -1
  295. package/dist/chat/super-grouping/SuperGroupingCard.d.ts +19 -4
  296. package/dist/chat/super-grouping/SuperGroupingCard.js +29 -13
  297. package/dist/chat/super-grouping/SuperGroupingCard.js.map +1 -1
  298. package/dist/chat/super-grouping/SuperGroupingTranscript.cjs +32 -32
  299. package/dist/chat/super-grouping/SuperGroupingTranscript.cjs.map +1 -1
  300. package/dist/chat/super-grouping/SuperGroupingTranscript.js +3 -3
  301. package/dist/chat/super-grouping/SuperGroupingTranscript.js.map +1 -1
  302. package/dist/chat/super-grouping/ToolTimeline.cjs +73 -40
  303. package/dist/chat/super-grouping/ToolTimeline.cjs.map +1 -1
  304. package/dist/chat/super-grouping/ToolTimeline.d.ts +10 -2
  305. package/dist/chat/super-grouping/ToolTimeline.js +69 -36
  306. package/dist/chat/super-grouping/ToolTimeline.js.map +1 -1
  307. package/dist/chat/super-grouping/activity-timeline.cjs +47 -12
  308. package/dist/chat/super-grouping/activity-timeline.cjs.map +1 -1
  309. package/dist/chat/super-grouping/activity-timeline.d.ts +21 -0
  310. package/dist/chat/super-grouping/activity-timeline.js +47 -12
  311. package/dist/chat/super-grouping/activity-timeline.js.map +1 -1
  312. package/dist/chat/super-grouping/grouping-function.cjs +4 -0
  313. package/dist/chat/super-grouping/grouping-function.cjs.map +1 -1
  314. package/dist/chat/super-grouping/grouping-function.d.ts +7 -0
  315. package/dist/chat/super-grouping/grouping-function.js +5 -1
  316. package/dist/chat/super-grouping/grouping-function.js.map +1 -1
  317. package/dist/chat/super-grouping/index.cjs +6 -0
  318. package/dist/chat/super-grouping/index.cjs.map +1 -1
  319. package/dist/chat/super-grouping/index.d.ts +5 -2
  320. package/dist/chat/super-grouping/index.js +7 -1
  321. package/dist/chat/super-grouping/index.js.map +1 -1
  322. package/dist/chat/super-grouping/tool-part-placement.cjs +17 -0
  323. package/dist/chat/super-grouping/tool-part-placement.cjs.map +1 -0
  324. package/dist/chat/super-grouping/tool-part-placement.d.ts +22 -0
  325. package/dist/chat/super-grouping/tool-part-placement.js +17 -0
  326. package/dist/chat/super-grouping/tool-part-placement.js.map +1 -0
  327. package/dist/chat/thread-scroll-to-bottom.cjs +2 -2
  328. package/dist/chat/thread-scroll-to-bottom.cjs.map +1 -1
  329. package/dist/chat/thread-scroll-to-bottom.d.ts +10 -7
  330. package/dist/chat/thread-scroll-to-bottom.js +2 -2
  331. package/dist/chat/thread-scroll-to-bottom.js.map +1 -1
  332. package/dist/chat/tooltip-icon-button.cjs +2 -2
  333. package/dist/chat/tooltip-icon-button.cjs.map +1 -1
  334. package/dist/chat/use-athena-voice-live.cjs +11 -0
  335. package/dist/chat/use-athena-voice-live.cjs.map +1 -0
  336. package/dist/chat/use-athena-voice-live.d.ts +11 -0
  337. package/dist/chat/use-athena-voice-live.js +11 -0
  338. package/dist/chat/use-athena-voice-live.js.map +1 -0
  339. package/dist/chat/use-statewire-approval-request.cjs +56 -24
  340. package/dist/chat/use-statewire-approval-request.cjs.map +1 -1
  341. package/dist/chat/use-statewire-approval-request.d.ts +33 -4
  342. package/dist/chat/use-statewire-approval-request.js +41 -9
  343. package/dist/chat/use-statewire-approval-request.js.map +1 -1
  344. package/dist/chat-ui/auth/sign-in-card.cjs +2 -2
  345. package/dist/chat-ui/auth/sign-in-card.cjs.map +1 -1
  346. package/dist/chat-ui/composer/tiptap-composer.cjs +138 -107
  347. package/dist/chat-ui/composer/tiptap-composer.cjs.map +1 -1
  348. package/dist/chat-ui/composer/tiptap-composer.d.ts +20 -4
  349. package/dist/chat-ui/composer/tiptap-composer.js +85 -54
  350. package/dist/chat-ui/composer/tiptap-composer.js.map +1 -1
  351. package/dist/chat-ui/header/conversation-history-panel.cjs +49 -23
  352. package/dist/chat-ui/header/conversation-history-panel.cjs.map +1 -1
  353. package/dist/chat-ui/header/conversation-history-panel.d.ts +12 -1
  354. package/dist/chat-ui/header/conversation-history-panel.js +38 -12
  355. package/dist/chat-ui/header/conversation-history-panel.js.map +1 -1
  356. package/dist/chat-ui/index.cjs +21 -0
  357. package/dist/chat-ui/index.cjs.map +1 -1
  358. package/dist/chat-ui/index.d.ts +8 -1
  359. package/dist/chat-ui/index.js +21 -0
  360. package/dist/chat-ui/index.js.map +1 -1
  361. package/dist/chat-ui/mentions/mention-chip.cjs +4 -4
  362. package/dist/chat-ui/mentions/mention-chip.cjs.map +1 -1
  363. package/dist/chat-ui/mentions/suggestions/components/mention-suggestion-list.cjs +10 -9
  364. package/dist/chat-ui/mentions/suggestions/components/mention-suggestion-list.cjs.map +1 -1
  365. package/dist/chat-ui/mentions/suggestions/components/mention-suggestion-list.js +3 -2
  366. package/dist/chat-ui/mentions/suggestions/components/mention-suggestion-list.js.map +1 -1
  367. package/dist/chat-ui/mentions/suggestions/components/mention-suggestion-popup.cjs +2 -2
  368. package/dist/chat-ui/mentions/suggestions/components/mention-suggestion-popup.cjs.map +1 -1
  369. package/dist/chat-ui/mentions/suggestions/components/menu-list.cjs +29 -6
  370. package/dist/chat-ui/mentions/suggestions/components/menu-list.cjs.map +1 -1
  371. package/dist/chat-ui/mentions/suggestions/components/menu-list.d.ts +7 -1
  372. package/dist/chat-ui/mentions/suggestions/components/menu-list.js +25 -2
  373. package/dist/chat-ui/mentions/suggestions/components/menu-list.js.map +1 -1
  374. package/dist/chat-ui/mentions/suggestions/components/use-keyboard-navigation.cjs +2 -2
  375. package/dist/chat-ui/mentions/suggestions/components/use-keyboard-navigation.cjs.map +1 -1
  376. package/dist/chat-ui/mentions/suggestions/components/use-menu-navigation.cjs +2 -2
  377. package/dist/chat-ui/mentions/suggestions/components/use-menu-navigation.cjs.map +1 -1
  378. package/dist/chat-ui/mentions/suggestions/data/api-client.cjs +3 -3
  379. package/dist/chat-ui/mentions/suggestions/data/api-client.cjs.map +1 -1
  380. package/dist/chat-ui/mentions/suggestions/data/orchestrator.cjs +56 -2
  381. package/dist/chat-ui/mentions/suggestions/data/orchestrator.cjs.map +1 -1
  382. package/dist/chat-ui/mentions/suggestions/data/orchestrator.d.ts +12 -0
  383. package/dist/chat-ui/mentions/suggestions/data/orchestrator.js +56 -2
  384. package/dist/chat-ui/mentions/suggestions/data/orchestrator.js.map +1 -1
  385. package/dist/chat-ui/mentions/suggestions/data/sources/index.cjs +24 -3
  386. package/dist/chat-ui/mentions/suggestions/data/sources/index.cjs.map +1 -1
  387. package/dist/chat-ui/mentions/suggestions/data/sources/index.d.ts +7 -0
  388. package/dist/chat-ui/mentions/suggestions/data/sources/index.js +24 -3
  389. package/dist/chat-ui/mentions/suggestions/data/sources/index.js.map +1 -1
  390. package/dist/chat-ui/mentions/suggestions/data/use-mention-suggestions.cjs +35 -13
  391. package/dist/chat-ui/mentions/suggestions/data/use-mention-suggestions.cjs.map +1 -1
  392. package/dist/chat-ui/mentions/suggestions/data/use-mention-suggestions.d.ts +15 -1
  393. package/dist/chat-ui/mentions/suggestions/data/use-mention-suggestions.js +28 -6
  394. package/dist/chat-ui/mentions/suggestions/data/use-mention-suggestions.js.map +1 -1
  395. package/dist/chat-ui/mentions/suggestions/data/use-menu-items.cjs +9 -6
  396. package/dist/chat-ui/mentions/suggestions/data/use-menu-items.cjs.map +1 -1
  397. package/dist/chat-ui/mentions/suggestions/data/use-menu-items.d.ts +3 -0
  398. package/dist/chat-ui/mentions/suggestions/data/use-menu-items.js +5 -2
  399. package/dist/chat-ui/mentions/suggestions/data/use-menu-items.js.map +1 -1
  400. package/dist/chat-ui/mentions/use-account-workspace-id.cjs +45 -10
  401. package/dist/chat-ui/mentions/use-account-workspace-id.cjs.map +1 -1
  402. package/dist/chat-ui/mentions/use-account-workspace-id.d.ts +24 -1
  403. package/dist/chat-ui/mentions/use-account-workspace-id.js +46 -11
  404. package/dist/chat-ui/mentions/use-account-workspace-id.js.map +1 -1
  405. package/dist/chat-ui/mentions/use-member-avatar.cjs +4 -4
  406. package/dist/chat-ui/mentions/use-member-avatar.cjs.map +1 -1
  407. package/dist/chat-ui/mentions/use-mention-asset.cjs +3 -3
  408. package/dist/chat-ui/mentions/use-mention-asset.cjs.map +1 -1
  409. package/dist/chat-ui/messages/answer-label.cjs +42 -0
  410. package/dist/chat-ui/messages/answer-label.cjs.map +1 -0
  411. package/dist/chat-ui/messages/answer-label.d.ts +33 -0
  412. package/dist/chat-ui/messages/answer-label.js +42 -0
  413. package/dist/chat-ui/messages/answer-label.js.map +1 -0
  414. package/dist/chat-ui/messages/arrival-animation.cjs +13 -0
  415. package/dist/chat-ui/messages/arrival-animation.cjs.map +1 -0
  416. package/dist/chat-ui/messages/arrival-animation.d.ts +14 -0
  417. package/dist/chat-ui/messages/arrival-animation.js +13 -0
  418. package/dist/chat-ui/messages/arrival-animation.js.map +1 -0
  419. package/dist/chat-ui/messages/continue-pill.cjs +5 -5
  420. package/dist/chat-ui/messages/continue-pill.cjs.map +1 -1
  421. package/dist/chat-ui/messages/from-the-call-card.cjs +124 -0
  422. package/dist/chat-ui/messages/from-the-call-card.cjs.map +1 -0
  423. package/dist/chat-ui/messages/from-the-call-card.d.ts +17 -0
  424. package/dist/chat-ui/messages/from-the-call-card.js +124 -0
  425. package/dist/chat-ui/messages/from-the-call-card.js.map +1 -0
  426. package/dist/chat-ui/messages/handoff-arrival-divider.cjs +44 -0
  427. package/dist/chat-ui/messages/handoff-arrival-divider.cjs.map +1 -0
  428. package/dist/chat-ui/messages/handoff-arrival-divider.d.ts +17 -0
  429. package/dist/chat-ui/messages/handoff-arrival-divider.js +44 -0
  430. package/dist/chat-ui/messages/handoff-arrival-divider.js.map +1 -0
  431. package/dist/chat-ui/messages/message-actions-config.cjs +3 -3
  432. package/dist/chat-ui/messages/message-actions-config.cjs.map +1 -1
  433. package/dist/chat-ui/messages/message-components.cjs +8 -4
  434. package/dist/chat-ui/messages/message-components.cjs.map +1 -1
  435. package/dist/chat-ui/messages/message-components.js +5 -1
  436. package/dist/chat-ui/messages/message-components.js.map +1 -1
  437. package/dist/chat-ui/messages/message-images.cjs +66 -0
  438. package/dist/chat-ui/messages/message-images.cjs.map +1 -0
  439. package/dist/chat-ui/messages/message-images.d.ts +16 -0
  440. package/dist/chat-ui/messages/message-images.js +66 -0
  441. package/dist/chat-ui/messages/message-images.js.map +1 -0
  442. package/dist/chat-ui/messages/user-edit-composer.cjs +2 -2
  443. package/dist/chat-ui/messages/user-edit-composer.cjs.map +1 -1
  444. package/dist/chat-ui/messages/wake-marker.cjs +3 -3
  445. package/dist/chat-ui/messages/wake-marker.cjs.map +1 -1
  446. package/dist/chat-ui/rich-text/chat-link.cjs +3 -2
  447. package/dist/chat-ui/rich-text/chat-link.cjs.map +1 -1
  448. package/dist/chat-ui/rich-text/chat-link.d.ts +4 -0
  449. package/dist/chat-ui/rich-text/chat-link.js +4 -3
  450. package/dist/chat-ui/rich-text/chat-link.js.map +1 -1
  451. package/dist/chat-ui/rich-text/chat-message-body.cjs +9 -8
  452. package/dist/chat-ui/rich-text/chat-message-body.cjs.map +1 -1
  453. package/dist/chat-ui/rich-text/chat-message-body.d.ts +12 -0
  454. package/dist/chat-ui/rich-text/chat-message-body.js +2 -1
  455. package/dist/chat-ui/rich-text/chat-message-body.js.map +1 -1
  456. package/dist/chat-ui/rich-text/chat-node-views.cjs +6 -6
  457. package/dist/chat-ui/rich-text/chat-node-views.cjs.map +1 -1
  458. package/dist/chat-ui/rich-text/dom-output-spec.cjs +2 -2
  459. package/dist/chat-ui/rich-text/dom-output-spec.cjs.map +1 -1
  460. package/dist/chat-ui/statewire.cjs +3 -0
  461. package/dist/chat-ui/statewire.cjs.map +1 -1
  462. package/dist/chat-ui/statewire.d.ts +2 -1
  463. package/dist/chat-ui/statewire.js +3 -0
  464. package/dist/chat-ui/statewire.js.map +1 -1
  465. package/dist/chat-ui/thread/chat-thread-shell.cjs +45 -14
  466. package/dist/chat-ui/thread/chat-thread-shell.cjs.map +1 -1
  467. package/dist/chat-ui/thread/chat-thread-shell.d.ts +16 -2
  468. package/dist/chat-ui/thread/chat-thread-shell.js +37 -6
  469. package/dist/chat-ui/thread/chat-thread-shell.js.map +1 -1
  470. package/dist/chat-ui/thread/composer-send-or-stop.cjs +30 -20
  471. package/dist/chat-ui/thread/composer-send-or-stop.cjs.map +1 -1
  472. package/dist/chat-ui/thread/composer-send-or-stop.d.ts +8 -0
  473. package/dist/chat-ui/thread/composer-send-or-stop.js +29 -19
  474. package/dist/chat-ui/thread/composer-send-or-stop.js.map +1 -1
  475. package/dist/chat-ui/thread/statewire-history-edge.cjs +20 -21
  476. package/dist/chat-ui/thread/statewire-history-edge.cjs.map +1 -1
  477. package/dist/chat-ui/thread/statewire-history-edge.js +3 -4
  478. package/dist/chat-ui/thread/statewire-history-edge.js.map +1 -1
  479. package/dist/chat-ui/thread/thread-loading-overlay.cjs +5 -5
  480. package/dist/chat-ui/thread/thread-loading-overlay.cjs.map +1 -1
  481. package/dist/collab/client.cjs +52 -3
  482. package/dist/collab/client.cjs.map +1 -1
  483. package/dist/collab/client.d.ts +27 -0
  484. package/dist/collab/client.js +52 -3
  485. package/dist/collab/client.js.map +1 -1
  486. package/dist/collab/document-status.cjs +150 -0
  487. package/dist/collab/document-status.cjs.map +1 -0
  488. package/dist/collab/document-status.d.ts +68 -0
  489. package/dist/collab/document-status.js +150 -0
  490. package/dist/collab/document-status.js.map +1 -0
  491. package/dist/collab/index.cjs +7 -0
  492. package/dist/collab/index.cjs.map +1 -1
  493. package/dist/collab/index.d.ts +6 -1
  494. package/dist/collab/index.js +7 -0
  495. package/dist/collab/index.js.map +1 -1
  496. package/dist/collab/presence-react.cjs +11 -11
  497. package/dist/collab/presence-react.cjs.map +1 -1
  498. package/dist/collab/react.cjs +6 -6
  499. package/dist/collab/react.cjs.map +1 -1
  500. package/dist/composer/AttachmentContext.cjs +24 -11
  501. package/dist/composer/AttachmentContext.cjs.map +1 -1
  502. package/dist/composer/AttachmentContext.js +18 -5
  503. package/dist/composer/AttachmentContext.js.map +1 -1
  504. package/dist/composer/ComposerAttachmentPreview.cjs +78 -23
  505. package/dist/composer/ComposerAttachmentPreview.cjs.map +1 -1
  506. package/dist/composer/ComposerAttachmentPreview.d.ts +5 -3
  507. package/dist/composer/ComposerAttachmentPreview.js +79 -24
  508. package/dist/composer/ComposerAttachmentPreview.js.map +1 -1
  509. package/dist/composer/ComposerDropZone.cjs +7 -7
  510. package/dist/composer/ComposerDropZone.cjs.map +1 -1
  511. package/dist/composer/FileUploadButton.cjs +37 -22
  512. package/dist/composer/FileUploadButton.cjs.map +1 -1
  513. package/dist/composer/FileUploadButton.d.ts +6 -0
  514. package/dist/composer/FileUploadButton.js +34 -19
  515. package/dist/composer/FileUploadButton.js.map +1 -1
  516. package/dist/composer/QuoteContext.cjs +8 -8
  517. package/dist/composer/QuoteContext.cjs.map +1 -1
  518. package/dist/composer/composer-handoff.cjs +4 -4
  519. package/dist/composer/composer-handoff.cjs.map +1 -1
  520. package/dist/composer/index.d.ts +1 -1
  521. package/dist/composer/useAppendToComposer.cjs +4 -4
  522. package/dist/composer/useAppendToComposer.cjs.map +1 -1
  523. package/dist/composer/useAttachFiles.cjs +23 -6
  524. package/dist/composer/useAttachFiles.cjs.map +1 -1
  525. package/dist/composer/useAttachFiles.d.ts +15 -7
  526. package/dist/composer/useAttachFiles.js +22 -5
  527. package/dist/composer/useAttachFiles.js.map +1 -1
  528. package/dist/composer/useComposerAttachment.cjs +4 -4
  529. package/dist/composer/useComposerAttachment.cjs.map +1 -1
  530. package/dist/composer/useFileUpload.cjs +21 -16
  531. package/dist/composer/useFileUpload.cjs.map +1 -1
  532. package/dist/composer/useFileUpload.d.ts +12 -0
  533. package/dist/composer/useFileUpload.js +12 -7
  534. package/dist/composer/useFileUpload.js.map +1 -1
  535. package/dist/composer/useReadComposerDraft.cjs +27 -8
  536. package/dist/composer/useReadComposerDraft.cjs.map +1 -1
  537. package/dist/composer/useReadComposerDraft.d.ts +23 -1
  538. package/dist/composer/useReadComposerDraft.js +27 -8
  539. package/dist/composer/useReadComposerDraft.js.map +1 -1
  540. package/dist/composer/useSendMessage.cjs +4 -4
  541. package/dist/composer/useSendMessage.cjs.map +1 -1
  542. package/dist/diagnostics/useAthenaDiagnostics.cjs +4 -4
  543. package/dist/diagnostics/useAthenaDiagnostics.cjs.map +1 -1
  544. package/dist/dictation/audio-level-history.cjs +3 -3
  545. package/dist/dictation/audio-level-history.cjs.map +1 -1
  546. package/dist/dictation/dictation-controls.cjs +24 -20
  547. package/dist/dictation/dictation-controls.cjs.map +1 -1
  548. package/dist/dictation/dictation-controls.d.ts +6 -1
  549. package/dist/dictation/dictation-controls.js +24 -20
  550. package/dist/dictation/dictation-controls.js.map +1 -1
  551. package/dist/dictation/use-athena-dictation-engine.cjs +3 -3
  552. package/dist/dictation/use-athena-dictation-engine.cjs.map +1 -1
  553. package/dist/dictation/use-dictation.cjs +22 -22
  554. package/dist/dictation/use-dictation.cjs.map +1 -1
  555. package/dist/index.cjs +29 -2
  556. package/dist/index.cjs.map +1 -1
  557. package/dist/index.d.ts +18 -4
  558. package/dist/index.js +30 -3
  559. package/dist/index.js.map +1 -1
  560. package/dist/keryx-http/src/receive-only-socket.cjs +40 -0
  561. package/dist/keryx-http/src/receive-only-socket.cjs.map +1 -0
  562. package/dist/keryx-http/src/receive-only-socket.d.ts +27 -0
  563. package/dist/keryx-http/src/receive-only-socket.js +40 -0
  564. package/dist/keryx-http/src/receive-only-socket.js.map +1 -0
  565. package/dist/keryx-http/src/unconfirmed-update-attributions.cjs +190 -0
  566. package/dist/keryx-http/src/unconfirmed-update-attributions.cjs.map +1 -0
  567. package/dist/keryx-http/src/unconfirmed-update-attributions.d.ts +132 -0
  568. package/dist/keryx-http/src/unconfirmed-update-attributions.js +190 -0
  569. package/dist/keryx-http/src/unconfirmed-update-attributions.js.map +1 -0
  570. package/dist/keryx-http/src/update-attributions.cjs +141 -0
  571. package/dist/keryx-http/src/update-attributions.cjs.map +1 -0
  572. package/dist/keryx-http/src/update-attributions.d.ts +107 -0
  573. package/dist/keryx-http/src/update-attributions.js +141 -0
  574. package/dist/keryx-http/src/update-attributions.js.map +1 -0
  575. package/dist/lib/owner-document.cjs +6 -6
  576. package/dist/lib/owner-document.cjs.map +1 -1
  577. package/dist/lib/use-athena-rest-query.cjs +4 -4
  578. package/dist/lib/use-athena-rest-query.cjs.map +1 -1
  579. package/dist/lib/use-document-active.cjs +4 -4
  580. package/dist/lib/use-document-active.cjs.map +1 -1
  581. package/dist/lib/use-prefers-reduced-motion.cjs +2 -2
  582. package/dist/lib/use-prefers-reduced-motion.cjs.map +1 -1
  583. package/dist/offline/offline-history.cjs +7 -7
  584. package/dist/offline/offline-history.cjs.map +1 -1
  585. package/dist/provider/AthenaContext.cjs +3 -3
  586. package/dist/provider/AthenaContext.cjs.map +1 -1
  587. package/dist/provider/AthenaProvider.cjs +120 -79
  588. package/dist/provider/AthenaProvider.cjs.map +1 -1
  589. package/dist/provider/AthenaProvider.d.ts +11 -1
  590. package/dist/provider/AthenaProvider.js +44 -3
  591. package/dist/provider/AthenaProvider.js.map +1 -1
  592. package/dist/provider/PostHogProvider.cjs +2 -2
  593. package/dist/provider/PostHogProvider.cjs.map +1 -1
  594. package/dist/provider/agent-selection-context.cjs +2 -2
  595. package/dist/provider/agent-selection-context.cjs.map +1 -1
  596. package/dist/provider/chat-mode-context.cjs +2 -2
  597. package/dist/provider/chat-mode-context.cjs.map +1 -1
  598. package/dist/provider/session-persistence-context.cjs +10 -0
  599. package/dist/provider/session-persistence-context.cjs.map +1 -0
  600. package/dist/provider/session-persistence-context.d.ts +15 -0
  601. package/dist/provider/session-persistence-context.js +10 -0
  602. package/dist/provider/session-persistence-context.js.map +1 -0
  603. package/dist/provider/statewire-history-context.cjs +4 -4
  604. package/dist/provider/statewire-history-context.cjs.map +1 -1
  605. package/dist/provider/statewire-lifecycle-context.cjs +3 -3
  606. package/dist/provider/statewire-lifecycle-context.cjs.map +1 -1
  607. package/dist/provider/statewire-window-context.cjs +3 -3
  608. package/dist/provider/statewire-window-context.cjs.map +1 -1
  609. package/dist/provider/theme-style-context.cjs +3 -3
  610. package/dist/provider/theme-style-context.cjs.map +1 -1
  611. package/dist/react/package.json.cjs +1 -1
  612. package/dist/react/package.json.js +1 -1
  613. package/dist/runtime/StatewireThreadConfigLaneSync.cjs +10 -10
  614. package/dist/runtime/StatewireThreadConfigLaneSync.cjs.map +1 -1
  615. package/dist/runtime/auth-refusal-restart.cjs +7 -7
  616. package/dist/runtime/auth-refusal-restart.cjs.map +1 -1
  617. package/dist/runtime/auth.cjs +13 -13
  618. package/dist/runtime/auth.cjs.map +1 -1
  619. package/dist/runtime/statewire-lifecycle.cjs +1 -0
  620. package/dist/runtime/statewire-lifecycle.cjs.map +1 -1
  621. package/dist/runtime/statewire-lifecycle.d.ts +3 -1
  622. package/dist/runtime/statewire-lifecycle.js +2 -1
  623. package/dist/runtime/statewire-lifecycle.js.map +1 -1
  624. package/dist/runtime/statewire-server-lane-context.cjs +2 -2
  625. package/dist/runtime/statewire-server-lane-context.cjs.map +1 -1
  626. package/dist/runtime/statewire-session-lane.cjs +4 -4
  627. package/dist/runtime/statewire-session-lane.cjs.map +1 -1
  628. package/dist/runtime/useAthenaStatewireRuntime.cjs +10 -8
  629. package/dist/runtime/useAthenaStatewireRuntime.cjs.map +1 -1
  630. package/dist/runtime/useAthenaStatewireRuntime.d.ts +2 -0
  631. package/dist/runtime/useAthenaStatewireRuntime.js +2 -0
  632. package/dist/runtime/useAthenaStatewireRuntime.js.map +1 -1
  633. package/dist/styles.css +1 -1
  634. package/dist/threads/Inbox.cjs +8 -8
  635. package/dist/threads/Inbox.cjs.map +1 -1
  636. package/dist/threads/SessionList.cjs +9 -9
  637. package/dist/threads/SessionList.cjs.map +1 -1
  638. package/dist/threads/SessionsPage.cjs +11 -11
  639. package/dist/threads/SessionsPage.cjs.map +1 -1
  640. package/dist/threads/api.cjs.map +1 -1
  641. package/dist/threads/api.d.ts +15 -0
  642. package/dist/threads/api.js.map +1 -1
  643. package/dist/threads/conversation-list-fetcher.cjs +13 -5
  644. package/dist/threads/conversation-list-fetcher.cjs.map +1 -1
  645. package/dist/threads/conversation-list-fetcher.d.ts +4 -1
  646. package/dist/threads/conversation-list-fetcher.js +13 -5
  647. package/dist/threads/conversation-list-fetcher.js.map +1 -1
  648. package/dist/threads/index-triggered-refresh.cjs +10 -10
  649. package/dist/threads/index-triggered-refresh.cjs.map +1 -1
  650. package/dist/threads/mark-viewed-thread-read.cjs +12 -12
  651. package/dist/threads/mark-viewed-thread-read.cjs.map +1 -1
  652. package/dist/threads/offline-session-list.cjs +3 -3
  653. package/dist/threads/offline-session-list.cjs.map +1 -1
  654. package/dist/threads/session-list-tab-share.cjs +5 -5
  655. package/dist/threads/session-list-tab-share.cjs.map +1 -1
  656. package/dist/threads/statewire-thread-list.cjs +79 -57
  657. package/dist/threads/statewire-thread-list.cjs.map +1 -1
  658. package/dist/threads/statewire-thread-list.d.ts +20 -8
  659. package/dist/threads/statewire-thread-list.js +28 -6
  660. package/dist/threads/statewire-thread-list.js.map +1 -1
  661. package/dist/threads/thread-id-context.cjs +5 -5
  662. package/dist/threads/thread-id-context.cjs.map +1 -1
  663. package/dist/threads/use-athena-session-attention.cjs +2 -2
  664. package/dist/threads/use-athena-session-attention.cjs.map +1 -1
  665. package/dist/threads/use-athena-sessions.cjs +37 -15
  666. package/dist/threads/use-athena-sessions.cjs.map +1 -1
  667. package/dist/threads/use-athena-sessions.d.ts +10 -5
  668. package/dist/threads/use-athena-sessions.js +28 -6
  669. package/dist/threads/use-athena-sessions.js.map +1 -1
  670. package/dist/threads/use-athena-thread-model.cjs +3 -3
  671. package/dist/threads/use-athena-thread-model.cjs.map +1 -1
  672. package/dist/threads/use-rest-conversation-history.cjs +3 -3
  673. package/dist/threads/use-rest-conversation-history.cjs.map +1 -1
  674. package/dist/threads/use-rest-conversation-history.d.ts +1 -0
  675. package/dist/threads/use-statewire-conversation-history.cjs +8 -8
  676. package/dist/threads/use-statewire-conversation-history.cjs.map +1 -1
  677. package/dist/threads/use-thread-archive.cjs +9 -9
  678. package/dist/threads/use-thread-archive.cjs.map +1 -1
  679. package/dist/threads/use-thread-favorite.cjs +2 -2
  680. package/dist/threads/use-thread-favorite.cjs.map +1 -1
  681. package/dist/threads/use-thread-field-override.cjs +20 -20
  682. package/dist/threads/use-thread-field-override.cjs.map +1 -1
  683. package/dist/threads/use-thread-read-state.cjs +4 -4
  684. package/dist/threads/use-thread-read-state.cjs.map +1 -1
  685. package/dist/threads/use-thread-rename.cjs +2 -2
  686. package/dist/threads/use-thread-rename.cjs.map +1 -1
  687. package/dist/threads/useAthenaThreadManager.cjs +2 -2
  688. package/dist/threads/useAthenaThreadManager.cjs.map +1 -1
  689. package/dist/tools/NestedPtcMessages.cjs +6 -6
  690. package/dist/tools/NestedPtcMessages.cjs.map +1 -1
  691. package/dist/tools/append-document-tool-ui.cjs +7 -7
  692. package/dist/tools/append-document-tool-ui.cjs.map +1 -1
  693. package/dist/tools/file-tool-uis.cjs +2 -2
  694. package/dist/tools/file-tool-uis.cjs.map +1 -1
  695. package/dist/tools/misc-tool-uis.cjs +2 -2
  696. package/dist/tools/misc-tool-uis.cjs.map +1 -1
  697. package/dist/tools/primitives.cjs +6 -6
  698. package/dist/tools/primitives.cjs.map +1 -1
  699. package/dist/tools/read-asset-tool-ui.cjs +6 -6
  700. package/dist/tools/read-asset-tool-ui.cjs.map +1 -1
  701. package/dist/tools/subagent-task-tool-ui.cjs +21 -21
  702. package/dist/tools/subagent-task-tool-ui.cjs.map +1 -1
  703. package/dist/tools/test-recording-tool-uis.cjs +16 -16
  704. package/dist/tools/test-recording-tool-uis.cjs.map +1 -1
  705. package/dist/tools/todo-plan-store.cjs +4 -4
  706. package/dist/tools/todo-plan-store.cjs.map +1 -1
  707. package/dist/tools/tool-appearance.cjs +3 -3
  708. package/dist/tools/tool-appearance.cjs.map +1 -1
  709. package/dist/tools/tool-fallback.cjs +14 -14
  710. package/dist/tools/tool-fallback.cjs.map +1 -1
  711. package/dist/tools/tool-uis.cjs +74 -74
  712. package/dist/tools/tool-uis.cjs.map +1 -1
  713. package/dist/tools/use-elapsed-seconds.cjs +3 -3
  714. package/dist/tools/use-elapsed-seconds.cjs.map +1 -1
  715. package/dist/tools/write-todos-tool-ui.cjs +9 -9
  716. package/dist/tools/write-todos-tool-ui.cjs.map +1 -1
  717. package/dist/ui/image-viewer.cjs +382 -0
  718. package/dist/ui/image-viewer.cjs.map +1 -0
  719. package/dist/ui/image-viewer.d.ts +50 -0
  720. package/dist/ui/image-viewer.js +382 -0
  721. package/dist/ui/image-viewer.js.map +1 -0
  722. package/dist/voice/chat.cjs +6 -0
  723. package/dist/voice/chat.cjs.map +1 -1
  724. package/dist/voice/chat.d.ts +1 -1
  725. package/dist/voice/chat.js +8 -2
  726. package/dist/voice/livekit-join.cjs +52 -101
  727. package/dist/voice/livekit-join.cjs.map +1 -1
  728. package/dist/voice/livekit-join.d.ts +1 -6
  729. package/dist/voice/livekit-join.js +52 -101
  730. package/dist/voice/livekit-join.js.map +1 -1
  731. package/dist/voice/livekit.cjs.map +1 -1
  732. package/dist/voice/livekit.d.ts +11 -1
  733. package/dist/voice/livekit.js.map +1 -1
  734. package/dist/voice/use-athena-voice-session.cjs +34 -34
  735. package/dist/voice/use-athena-voice-session.cjs.map +1 -1
  736. package/dist/workbench/ComputerLiveDesktop.cjs +13 -13
  737. package/dist/workbench/ComputerLiveDesktop.cjs.map +1 -1
  738. package/dist/workbench/SessionWorkbench.cjs +22 -22
  739. package/dist/workbench/SessionWorkbench.cjs.map +1 -1
  740. package/dist/workbench/session-workbench-context.cjs +3 -3
  741. package/dist/workbench/session-workbench-context.cjs.map +1 -1
  742. package/dist/workbench/session-workbench-panes.cjs +8 -8
  743. package/dist/workbench/session-workbench-panes.cjs.map +1 -1
  744. package/dist/workbench/workbench-layout-context.cjs +3 -3
  745. package/dist/workbench/workbench-layout-context.cjs.map +1 -1
  746. package/package.json +2 -1
@@ -0,0 +1,207 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
+ const MAX_DECISIONS_PER_CHECK = 25;
4
+ const DecisionCheckKind = {
5
+ CHAT_APPROVAL_ANSWER: "chat_approval_answer"
6
+ };
7
+ const CHECKPOINT_NAMESPACE = "athena-deep-agent:";
8
+ function bareDecisionThreadId(threadId) {
9
+ return threadId.startsWith(CHECKPOINT_NAMESPACE) ? threadId.slice(CHECKPOINT_NAMESPACE.length) : threadId;
10
+ }
11
+ function statewireAnswerDescriptors({
12
+ threadId,
13
+ answer
14
+ }) {
15
+ const thread = bareDecisionThreadId(threadId);
16
+ if (answer.kind === "input") {
17
+ return [
18
+ {
19
+ kind: DecisionCheckKind.CHAT_APPROVAL_ANSWER,
20
+ targetIds: [`${thread}:${answer.requestId}`],
21
+ option: "resume",
22
+ editedPayload: answer.value
23
+ }
24
+ ];
25
+ }
26
+ return Object.entries(answer.laneDecisions).map(([interruptId, decision]) => ({
27
+ kind: DecisionCheckKind.CHAT_APPROVAL_ANSWER,
28
+ targetIds: [`${thread}:${interruptId}`],
29
+ option: "resume",
30
+ editedPayload: decision
31
+ }));
32
+ }
33
+ const REQUESTS_PATH = "/api/passkeys/decision-checks/requests";
34
+ const DEFAULT_INTERVAL_MS = 2e3;
35
+ const MIN_INTERVAL_MS = 1e3;
36
+ const MAX_COLLECT_FAILURES = 5;
37
+ function isRecord(value) {
38
+ return typeof value === "object" && value !== null && !Array.isArray(value);
39
+ }
40
+ async function readJson(response) {
41
+ try {
42
+ const body = await response.json();
43
+ return isRecord(body) ? body : null;
44
+ } catch {
45
+ return null;
46
+ }
47
+ }
48
+ function defaultSleep(ms, signal) {
49
+ return new Promise((resolve) => {
50
+ if (signal == null ? void 0 : signal.aborted) {
51
+ resolve();
52
+ return;
53
+ }
54
+ const timer = setTimeout(() => {
55
+ signal == null ? void 0 : signal.removeEventListener("abort", onAbort);
56
+ resolve();
57
+ }, ms);
58
+ const onAbort = () => {
59
+ clearTimeout(timer);
60
+ resolve();
61
+ };
62
+ signal == null ? void 0 : signal.addEventListener("abort", onAbort, { once: true });
63
+ });
64
+ }
65
+ function messageOf(error) {
66
+ return error instanceof Error ? error.message : String(error);
67
+ }
68
+ function notifyPending(options, pending) {
69
+ var _a;
70
+ try {
71
+ (_a = options.onPending) == null ? void 0 : _a.call(options, pending);
72
+ } catch (error) {
73
+ console.warn("[decision-check] the pending notice failed:", messageOf(error));
74
+ }
75
+ }
76
+ function openedCheck(body) {
77
+ if (body === null) return null;
78
+ const { request_id, poll_secret, user_code, verification_url, expires_at, interval_seconds } = body;
79
+ if (typeof request_id !== "string" || typeof poll_secret !== "string" || typeof user_code !== "string" || typeof verification_url !== "string" || typeof expires_at !== "string") {
80
+ return null;
81
+ }
82
+ const expiresAt = new Date(expires_at);
83
+ if (Number.isNaN(expiresAt.getTime())) return null;
84
+ const seconds = typeof interval_seconds === "number" ? interval_seconds : 0;
85
+ return {
86
+ requestId: request_id,
87
+ pollSecret: poll_secret,
88
+ userCode: user_code,
89
+ verificationUrl: verification_url,
90
+ expiresAt,
91
+ intervalMs: seconds > 0 ? Math.max(MIN_INTERVAL_MS, seconds * 1e3) : DEFAULT_INTERVAL_MS
92
+ };
93
+ }
94
+ async function openRequest(options) {
95
+ var _a;
96
+ let response;
97
+ try {
98
+ response = await options.agoraFetch(REQUESTS_PATH, {
99
+ method: "POST",
100
+ headers: { "Content-Type": "application/json" },
101
+ body: JSON.stringify({
102
+ decisions: options.decisions,
103
+ client: options.client,
104
+ ...options.returnUrl ? { return_url: options.returnUrl } : {}
105
+ }),
106
+ signal: options.signal
107
+ });
108
+ } catch (error) {
109
+ if ((_a = options.signal) == null ? void 0 : _a.aborted) return { status: "cancelled" };
110
+ return { status: "failed", message: messageOf(error) };
111
+ }
112
+ if (response.status === 404 || response.status === 503) return { status: "unavailable" };
113
+ if (!response.ok) {
114
+ return { status: "failed", message: `The check could not start (${response.status}).` };
115
+ }
116
+ return openedCheck(await readJson(response)) ?? {
117
+ status: "failed",
118
+ message: "The check could not start."
119
+ };
120
+ }
121
+ function settledOutcome(body) {
122
+ if (body === null) return null;
123
+ if (body.status === "confirmed" && typeof body.check_token === "string" && body.check_token) {
124
+ return { status: "confirmed", token: body.check_token };
125
+ }
126
+ if (body.status === "declined") {
127
+ switch (body.reason) {
128
+ case "no_passkey":
129
+ return { status: "no_passkey" };
130
+ case "unsupported":
131
+ return { status: "unsupported" };
132
+ case "failed":
133
+ return { status: "failed", message: "The passkey check failed in the browser." };
134
+ default:
135
+ return { status: "cancelled" };
136
+ }
137
+ }
138
+ return null;
139
+ }
140
+ async function runBrowserDecisionCheck(options) {
141
+ var _a, _b;
142
+ if (options.decisions.length === 0) return { status: "failed", message: "Nothing to confirm." };
143
+ if (options.decisions.length > MAX_DECISIONS_PER_CHECK) {
144
+ return {
145
+ status: "failed",
146
+ message: `One check confirms up to ${MAX_DECISIONS_PER_CHECK} decisions.`
147
+ };
148
+ }
149
+ const sleep = options.sleep ?? defaultSleep;
150
+ const now = options.now ?? Date.now;
151
+ const opened = await openRequest(options);
152
+ if ("status" in opened) return opened;
153
+ notifyPending(options, {
154
+ userCode: opened.userCode,
155
+ verificationUrl: opened.verificationUrl,
156
+ expiresAt: opened.expiresAt
157
+ });
158
+ try {
159
+ try {
160
+ await options.openUrl(opened.verificationUrl);
161
+ } catch (error) {
162
+ console.warn("[decision-check] could not open the browser:", messageOf(error));
163
+ }
164
+ let failures = 0;
165
+ while (now() < opened.expiresAt.getTime()) {
166
+ await sleep(opened.intervalMs, options.signal);
167
+ if ((_a = options.signal) == null ? void 0 : _a.aborted) return { status: "cancelled" };
168
+ let response;
169
+ try {
170
+ response = await options.agoraFetch(
171
+ `${REQUESTS_PATH}/${encodeURIComponent(opened.requestId)}/collect`,
172
+ {
173
+ method: "POST",
174
+ headers: { "Content-Type": "application/json" },
175
+ body: JSON.stringify({ poll_secret: opened.pollSecret }),
176
+ signal: options.signal
177
+ }
178
+ );
179
+ } catch (error) {
180
+ if ((_b = options.signal) == null ? void 0 : _b.aborted) return { status: "cancelled" };
181
+ failures += 1;
182
+ if (failures >= MAX_COLLECT_FAILURES) return { status: "failed", message: messageOf(error) };
183
+ continue;
184
+ }
185
+ if (response.status === 404) return { status: "expired" };
186
+ if (!response.ok) {
187
+ failures += 1;
188
+ if (failures >= MAX_COLLECT_FAILURES) {
189
+ return { status: "failed", message: `The check could not finish (${response.status}).` };
190
+ }
191
+ continue;
192
+ }
193
+ failures = 0;
194
+ const settled = settledOutcome(await readJson(response));
195
+ if (settled !== null) return settled;
196
+ }
197
+ return { status: "expired" };
198
+ } finally {
199
+ notifyPending(options, null);
200
+ }
201
+ }
202
+ exports.DecisionCheckKind = DecisionCheckKind;
203
+ exports.MAX_DECISIONS_PER_CHECK = MAX_DECISIONS_PER_CHECK;
204
+ exports.bareDecisionThreadId = bareDecisionThreadId;
205
+ exports.runBrowserDecisionCheck = runBrowserDecisionCheck;
206
+ exports.statewireAnswerDescriptors = statewireAnswerDescriptors;
207
+ //# sourceMappingURL=decision-checks.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"decision-checks.cjs","sources":["../../../../agent-runtime/src/decision-checks.ts"],"sourcesContent":["/**\n * \"Confirm with your passkey\" for surfaces that can't run the passkey prompt\n * themselves (identity row 0b.9, PR C): the phone, Midas, the Chrome\n * extension, the Office add-ins and SDK apps on another origin.\n *\n * A passkey belongs to the deployment's web host, so the check runs there, in\n * the system browser. The surface asks agora for a check over the decisions\n * on its screen (`POST /api/passkeys/decision-checks/requests`), opens the\n * verification URL it gets back, and collects the token once the person\n * confirmed on the web app's check page. It then sends its decision with that\n * token, as the web app does: `X-Athena-Decision-Check` on REST and GraphQL,\n * `decisionCheck` on statewire's `run/input` and `run/lane-input`.\n *\n * Framework-free: React hosts wrap {@link runBrowserDecisionCheck} in a\n * TanStack mutation; the CLI and the phone call it as they are.\n *\n * Every outcome is a value, never a rejection. While checks are report-only\n * (PR D enforces them) the decision goes ahead whatever this resolves, with\n * the token only when the person confirmed.\n */\n\n/** The header a REST or GraphQL decide call carries its check token in. */\nexport const DECISION_CHECK_HEADER = 'X-Athena-Decision-Check';\n\n/** The most decisions one check covers: a screen's worth. */\nexport const MAX_DECISIONS_PER_CHECK = 25;\n\n/** What kind of decision a descriptor describes (agora's `DecisionKind`). */\nexport const DecisionCheckKind = {\n APPROVAL_DECIDE: 'approval_decide',\n AUTOMATION_APPROVAL_DECIDE: 'automation_approval_decide',\n CHAT_APPROVAL_ANSWER: 'chat_approval_answer',\n} as const;\n\nexport type DecisionCheckKind = (typeof DecisionCheckKind)[keyof typeof DecisionCheckKind];\n\n/**\n * One decision a check covers, exactly as its decide call sends it: agora\n * builds the same item from the decide call and asks whether the token covers\n * it. `editedPayload` is the JSON value itself, never a hash of it.\n */\nexport interface DecisionCheckDescriptor {\n readonly kind: string;\n readonly targetIds: readonly string[];\n readonly option: string;\n readonly editedPayload?: unknown;\n readonly standingDuration?: string;\n}\n\n/** Which surface asks, as the check page shows it. */\nexport type DecisionCheckClientKind =\n | 'cli'\n | 'desktop'\n | 'mobile'\n | 'chrome_extension'\n | 'office_addin'\n | 'sdk';\n\nexport interface DecisionCheckClient {\n readonly kind: DecisionCheckClientKind;\n /** A short name for this device or app (\"Pat's MacBook\"), shown on the page. */\n readonly label?: string;\n}\n\nconst CHECKPOINT_NAMESPACE = 'athena-deep-agent:';\n\n/** A thread id the way agora names chat answers: without the checkpoint namespace. */\nexport function bareDecisionThreadId(threadId: string): string {\n return threadId.startsWith(CHECKPOINT_NAMESPACE)\n ? threadId.slice(CHECKPOINT_NAMESPACE.length)\n : threadId;\n}\n\n/**\n * A chat answer as statewire carries it: a `run/input` resume of one parked\n * request, or the lane decisions of a `run/lane-input`.\n */\nexport type StatewireAnswerForCheck =\n | { readonly kind: 'input'; readonly requestId: string; readonly value: unknown }\n | { readonly kind: 'lanes'; readonly laneDecisions: Readonly<Record<string, unknown>> };\n\n/**\n * The decisions one statewire answer makes: `chat_approval_answer` on\n * `<thread>:<requestId>` with the resume value as its payload, or one per lane\n * on `<thread>:<lane interrupt id>` with that lane's decision as its payload.\n */\nexport function statewireAnswerDescriptors({\n threadId,\n answer,\n}: {\n threadId: string;\n answer: StatewireAnswerForCheck;\n}): DecisionCheckDescriptor[] {\n const thread = bareDecisionThreadId(threadId);\n if (answer.kind === 'input') {\n return [\n {\n kind: DecisionCheckKind.CHAT_APPROVAL_ANSWER,\n targetIds: [`${thread}:${answer.requestId}`],\n option: 'resume',\n editedPayload: answer.value,\n },\n ];\n }\n return Object.entries(answer.laneDecisions).map(([interruptId, decision]) => ({\n kind: DecisionCheckKind.CHAT_APPROVAL_ANSWER,\n targetIds: [`${thread}:${interruptId}`],\n option: 'resume',\n editedPayload: decision,\n }));\n}\n\n/**\n * The phone's respond route (`POST /mobile/approvals/{thread}/respond`, also\n * the comment thread's inline approval): a `decisions` map is option\n * `decisions` with the map as its payload; otherwise the option is the action\n * and the payload its edited `tool_args`.\n */\nexport function respondDecisionDescriptor({\n threadId,\n toolCallId,\n action,\n toolArgs,\n decisions,\n}: {\n threadId: string;\n toolCallId: string;\n action?: string;\n toolArgs?: unknown;\n decisions?: Readonly<Record<string, unknown>>;\n}): DecisionCheckDescriptor {\n const target = `${bareDecisionThreadId(threadId)}:${toolCallId}`;\n if (decisions !== undefined && Object.keys(decisions).length > 0) {\n return {\n kind: DecisionCheckKind.CHAT_APPROVAL_ANSWER,\n targetIds: [target],\n option: 'decisions',\n editedPayload: decisions,\n };\n }\n return {\n kind: DecisionCheckKind.CHAT_APPROVAL_ANSWER,\n targetIds: [target],\n option: action ?? 'decisions',\n ...(toolArgs !== undefined && toolArgs !== null ? { editedPayload: toolArgs } : {}),\n };\n}\n\n/**\n * How a browser check went. Every outcome but `confirmed` sends the decision\n * without a token while checks are report-only; the surface decides what to\n * tell the person (a nudge to set up a passkey for `no_passkey`).\n */\nexport type BrowserDecisionCheckOutcome =\n | { readonly status: 'confirmed'; readonly token: string }\n | { readonly status: 'no_passkey' }\n | { readonly status: 'cancelled' }\n | { readonly status: 'unsupported' }\n | { readonly status: 'unavailable' }\n | { readonly status: 'expired' }\n | { readonly status: 'failed'; readonly message: string };\n\n/** What the surface shows while the person finishes in the browser. */\nexport interface PendingBrowserDecisionCheck {\n readonly userCode: string;\n readonly verificationUrl: string;\n readonly expiresAt: Date;\n}\n\n/**\n * The surface's authenticated request to agora: `path` is absolute from the\n * API root (`/api/passkeys/...`). The host adds its base URL and credential\n * (the person's sign-in, or the device key) and returns the raw response.\n */\nexport type AgoraFetch = (path: string, init: RequestInit) => Promise<Response>;\n\nexport interface RunBrowserDecisionCheckOptions {\n readonly decisions: readonly DecisionCheckDescriptor[];\n readonly client: DecisionCheckClient;\n readonly agoraFetch: AgoraFetch;\n /** Open the check page in the system browser or a new tab. */\n readonly openUrl: (url: string) => void | Promise<void>;\n /** An app link the page sends the person back to once they answered. */\n readonly returnUrl?: string;\n /** Told when the browser is open (with the code to show), and `null` once it settled. */\n readonly onPending?: (pending: PendingBrowserDecisionCheck | null) => void;\n /** Aborting gives up waiting: the decision goes without a token (`cancelled`). */\n readonly signal?: AbortSignal;\n /** Injectable for tests. */\n readonly sleep?: (ms: number, signal?: AbortSignal) => Promise<void>;\n readonly now?: () => number;\n}\n\nconst REQUESTS_PATH = '/api/passkeys/decision-checks/requests';\nconst DEFAULT_INTERVAL_MS = 2_000;\nconst MIN_INTERVAL_MS = 1_000;\n/** A transient collect failure is retried; this many in a row gives up. */\nconst MAX_COLLECT_FAILURES = 5;\n\nfunction isRecord(value: unknown): value is Record<string, unknown> {\n return typeof value === 'object' && value !== null && !Array.isArray(value);\n}\n\nasync function readJson(response: Response): Promise<Record<string, unknown> | null> {\n try {\n const body: unknown = await response.json();\n return isRecord(body) ? body : null;\n } catch {\n return null;\n }\n}\n\nfunction defaultSleep(ms: number, signal?: AbortSignal): Promise<void> {\n return new Promise((resolve) => {\n if (signal?.aborted) {\n resolve();\n return;\n }\n const timer = setTimeout(() => {\n signal?.removeEventListener('abort', onAbort);\n resolve();\n }, ms);\n const onAbort = () => {\n clearTimeout(timer);\n resolve();\n };\n signal?.addEventListener('abort', onAbort, { once: true });\n });\n}\n\nfunction messageOf(error: unknown): string {\n return error instanceof Error ? error.message : String(error);\n}\n\n/** Tell the host about the open check; a host callback that throws changes nothing here. */\nfunction notifyPending(\n options: RunBrowserDecisionCheckOptions,\n pending: PendingBrowserDecisionCheck | null,\n): void {\n try {\n options.onPending?.(pending);\n } catch (error) {\n console.warn('[decision-check] the pending notice failed:', messageOf(error));\n }\n}\n\ninterface OpenedCheck {\n readonly requestId: string;\n readonly pollSecret: string;\n readonly userCode: string;\n readonly verificationUrl: string;\n readonly expiresAt: Date;\n readonly intervalMs: number;\n}\n\nfunction openedCheck(body: Record<string, unknown> | null): OpenedCheck | null {\n if (body === null) return null;\n const { request_id, poll_secret, user_code, verification_url, expires_at, interval_seconds } =\n body;\n if (\n typeof request_id !== 'string' ||\n typeof poll_secret !== 'string' ||\n typeof user_code !== 'string' ||\n typeof verification_url !== 'string' ||\n typeof expires_at !== 'string'\n ) {\n return null;\n }\n const expiresAt = new Date(expires_at);\n if (Number.isNaN(expiresAt.getTime())) return null;\n const seconds = typeof interval_seconds === 'number' ? interval_seconds : 0;\n return {\n requestId: request_id,\n pollSecret: poll_secret,\n userCode: user_code,\n verificationUrl: verification_url,\n expiresAt,\n intervalMs: seconds > 0 ? Math.max(MIN_INTERVAL_MS, seconds * 1_000) : DEFAULT_INTERVAL_MS,\n };\n}\n\nasync function openRequest(\n options: RunBrowserDecisionCheckOptions,\n): Promise<OpenedCheck | BrowserDecisionCheckOutcome> {\n let response: Response;\n try {\n response = await options.agoraFetch(REQUESTS_PATH, {\n method: 'POST',\n headers: { 'Content-Type': 'application/json' },\n body: JSON.stringify({\n decisions: options.decisions,\n client: options.client,\n ...(options.returnUrl ? { return_url: options.returnUrl } : {}),\n }),\n signal: options.signal,\n });\n } catch (error) {\n if (options.signal?.aborted) return { status: 'cancelled' };\n return { status: 'failed', message: messageOf(error) };\n }\n // 404: an agora before browser checks; 503: none can be minted here.\n if (response.status === 404 || response.status === 503) return { status: 'unavailable' };\n if (!response.ok) {\n return { status: 'failed', message: `The check could not start (${response.status}).` };\n }\n return openedCheck(await readJson(response)) ?? {\n status: 'failed',\n message: 'The check could not start.',\n };\n}\n\nfunction settledOutcome(body: Record<string, unknown> | null): BrowserDecisionCheckOutcome | null {\n if (body === null) return null;\n if (body.status === 'confirmed' && typeof body.check_token === 'string' && body.check_token) {\n return { status: 'confirmed', token: body.check_token };\n }\n if (body.status === 'declined') {\n switch (body.reason) {\n case 'no_passkey':\n return { status: 'no_passkey' };\n case 'unsupported':\n return { status: 'unsupported' };\n case 'failed':\n return { status: 'failed', message: 'The passkey check failed in the browser.' };\n default:\n return { status: 'cancelled' };\n }\n }\n return null;\n}\n\n/**\n * Ask the person to confirm `decisions` with their passkey in the system\n * browser, and wait for the answer: the token when they confirmed, or why\n * there is none. Never rejects.\n */\nexport async function runBrowserDecisionCheck(\n options: RunBrowserDecisionCheckOptions,\n): Promise<BrowserDecisionCheckOutcome> {\n if (options.decisions.length === 0) return { status: 'failed', message: 'Nothing to confirm.' };\n if (options.decisions.length > MAX_DECISIONS_PER_CHECK) {\n return {\n status: 'failed',\n message: `One check confirms up to ${MAX_DECISIONS_PER_CHECK} decisions.`,\n };\n }\n const sleep = options.sleep ?? defaultSleep;\n const now = options.now ?? Date.now;\n const opened = await openRequest(options);\n if ('status' in opened) return opened;\n\n notifyPending(options, {\n userCode: opened.userCode,\n verificationUrl: opened.verificationUrl,\n expiresAt: opened.expiresAt,\n });\n try {\n try {\n await options.openUrl(opened.verificationUrl);\n } catch (error) {\n // The page can still be opened by hand from the link the surface shows.\n console.warn('[decision-check] could not open the browser:', messageOf(error));\n }\n let failures = 0;\n while (now() < opened.expiresAt.getTime()) {\n await sleep(opened.intervalMs, options.signal);\n if (options.signal?.aborted) return { status: 'cancelled' };\n let response: Response;\n try {\n response = await options.agoraFetch(\n `${REQUESTS_PATH}/${encodeURIComponent(opened.requestId)}/collect`,\n {\n method: 'POST',\n headers: { 'Content-Type': 'application/json' },\n body: JSON.stringify({ poll_secret: opened.pollSecret }),\n signal: options.signal,\n },\n );\n } catch (error) {\n if (options.signal?.aborted) return { status: 'cancelled' };\n failures += 1;\n if (failures >= MAX_COLLECT_FAILURES) return { status: 'failed', message: messageOf(error) };\n continue;\n }\n // Unknown, expired or already collected: nothing more will come.\n if (response.status === 404) return { status: 'expired' };\n if (!response.ok) {\n failures += 1;\n if (failures >= MAX_COLLECT_FAILURES) {\n return { status: 'failed', message: `The check could not finish (${response.status}).` };\n }\n continue;\n }\n failures = 0;\n const settled = settledOutcome(await readJson(response));\n if (settled !== null) return settled;\n }\n return { status: 'expired' };\n } finally {\n notifyPending(options, null);\n }\n}\n"],"names":[],"mappings":";;AAyBO,MAAM,0BAA0B;AAGhC,MAAM,oBAAoB;AAAA,EAG/B,sBAAsB;AACxB;AAgCA,MAAM,uBAAuB;AAGtB,SAAS,qBAAqB,UAA0B;AAC7D,SAAO,SAAS,WAAW,oBAAoB,IAC3C,SAAS,MAAM,qBAAqB,MAAM,IAC1C;AACN;AAeO,SAAS,2BAA2B;AAAA,EACzC;AAAA,EACA;AACF,GAG8B;AAC5B,QAAM,SAAS,qBAAqB,QAAQ;AAC5C,MAAI,OAAO,SAAS,SAAS;AAC3B,WAAO;AAAA,MACL;AAAA,QACE,MAAM,kBAAkB;AAAA,QACxB,WAAW,CAAC,GAAG,MAAM,IAAI,OAAO,SAAS,EAAE;AAAA,QAC3C,QAAQ;AAAA,QACR,eAAe,OAAO;AAAA,MAAA;AAAA,IACxB;AAAA,EAEJ;AACA,SAAO,OAAO,QAAQ,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,aAAQ,WAAR,mBAAgB,QAAS,QAAO,EAAE,QAAQ,YAAA;AAC9C,UAAI;AACJ,UAAI;AACF,mBAAW,MAAM,QAAQ;AAAA,UACvB,GAAG,aAAa,IAAI,mBAAmB,OAAO,SAAS,CAAC;AAAA,UACxD;AAAA,YACE,QAAQ;AAAA,YACR,SAAS,EAAE,gBAAgB,mBAAA;AAAA,YAC3B,MAAM,KAAK,UAAU,EAAE,aAAa,OAAO,YAAY;AAAA,YACvD,QAAQ,QAAQ;AAAA,UAAA;AAAA,QAClB;AAAA,MAEJ,SAAS,OAAO;AACd,aAAI,aAAQ,WAAR,mBAAgB,QAAS,QAAO,EAAE,QAAQ,YAAA;AAC9C,oBAAY;AACZ,YAAI,YAAY,qBAAsB,QAAO,EAAE,QAAQ,UAAU,SAAS,UAAU,KAAK,EAAA;AACzF;AAAA,MACF;AAEA,UAAI,SAAS,WAAW,IAAK,QAAO,EAAE,QAAQ,UAAA;AAC9C,UAAI,CAAC,SAAS,IAAI;AAChB,oBAAY;AACZ,YAAI,YAAY,sBAAsB;AACpC,iBAAO,EAAE,QAAQ,UAAU,SAAS,+BAA+B,SAAS,MAAM,KAAA;AAAA,QACpF;AACA;AAAA,MACF;AACA,iBAAW;AACX,YAAM,UAAU,eAAe,MAAM,SAAS,QAAQ,CAAC;AACvD,UAAI,YAAY,KAAM,QAAO;AAAA,IAC/B;AACA,WAAO,EAAE,QAAQ,UAAA;AAAA,EACnB,UAAA;AACE,kBAAc,SAAS,IAAI;AAAA,EAC7B;AACF;;;;;;"}
@@ -0,0 +1,142 @@
1
+ /**
2
+ * "Confirm with your passkey" for surfaces that can't run the passkey prompt
3
+ * themselves (identity row 0b.9, PR C): the phone, Midas, the Chrome
4
+ * extension, the Office add-ins and SDK apps on another origin.
5
+ *
6
+ * A passkey belongs to the deployment's web host, so the check runs there, in
7
+ * the system browser. The surface asks agora for a check over the decisions
8
+ * on its screen (`POST /api/passkeys/decision-checks/requests`), opens the
9
+ * verification URL it gets back, and collects the token once the person
10
+ * confirmed on the web app's check page. It then sends its decision with that
11
+ * token, as the web app does: `X-Athena-Decision-Check` on REST and GraphQL,
12
+ * `decisionCheck` on statewire's `run/input` and `run/lane-input`.
13
+ *
14
+ * Framework-free: React hosts wrap {@link runBrowserDecisionCheck} in a
15
+ * TanStack mutation; the CLI and the phone call it as they are.
16
+ *
17
+ * Every outcome is a value, never a rejection. While checks are report-only
18
+ * (PR D enforces them) the decision goes ahead whatever this resolves, with
19
+ * the token only when the person confirmed.
20
+ */
21
+ /** The header a REST or GraphQL decide call carries its check token in. */
22
+ export declare const DECISION_CHECK_HEADER = "X-Athena-Decision-Check";
23
+ /** The most decisions one check covers: a screen's worth. */
24
+ export declare const MAX_DECISIONS_PER_CHECK = 25;
25
+ /** What kind of decision a descriptor describes (agora's `DecisionKind`). */
26
+ export declare const DecisionCheckKind: {
27
+ readonly APPROVAL_DECIDE: 'approval_decide';
28
+ readonly AUTOMATION_APPROVAL_DECIDE: 'automation_approval_decide';
29
+ readonly CHAT_APPROVAL_ANSWER: 'chat_approval_answer';
30
+ };
31
+ export type DecisionCheckKind = (typeof DecisionCheckKind)[keyof typeof DecisionCheckKind];
32
+ /**
33
+ * One decision a check covers, exactly as its decide call sends it: agora
34
+ * builds the same item from the decide call and asks whether the token covers
35
+ * it. `editedPayload` is the JSON value itself, never a hash of it.
36
+ */
37
+ export interface DecisionCheckDescriptor {
38
+ readonly kind: string;
39
+ readonly targetIds: readonly string[];
40
+ readonly option: string;
41
+ readonly editedPayload?: unknown;
42
+ readonly standingDuration?: string;
43
+ }
44
+ /** Which surface asks, as the check page shows it. */
45
+ export type DecisionCheckClientKind = 'cli' | 'desktop' | 'mobile' | 'chrome_extension' | 'office_addin' | 'sdk';
46
+ export interface DecisionCheckClient {
47
+ readonly kind: DecisionCheckClientKind;
48
+ /** A short name for this device or app ("Pat's MacBook"), shown on the page. */
49
+ readonly label?: string;
50
+ }
51
+ /** A thread id the way agora names chat answers: without the checkpoint namespace. */
52
+ export declare function bareDecisionThreadId(threadId: string): string;
53
+ /**
54
+ * A chat answer as statewire carries it: a `run/input` resume of one parked
55
+ * request, or the lane decisions of a `run/lane-input`.
56
+ */
57
+ export type StatewireAnswerForCheck = {
58
+ readonly kind: 'input';
59
+ readonly requestId: string;
60
+ readonly value: unknown;
61
+ } | {
62
+ readonly kind: 'lanes';
63
+ readonly laneDecisions: Readonly<Record<string, unknown>>;
64
+ };
65
+ /**
66
+ * The decisions one statewire answer makes: `chat_approval_answer` on
67
+ * `<thread>:<requestId>` with the resume value as its payload, or one per lane
68
+ * on `<thread>:<lane interrupt id>` with that lane's decision as its payload.
69
+ */
70
+ export declare function statewireAnswerDescriptors({ threadId, answer, }: {
71
+ threadId: string;
72
+ answer: StatewireAnswerForCheck;
73
+ }): DecisionCheckDescriptor[];
74
+ /**
75
+ * The phone's respond route (`POST /mobile/approvals/{thread}/respond`, also
76
+ * the comment thread's inline approval): a `decisions` map is option
77
+ * `decisions` with the map as its payload; otherwise the option is the action
78
+ * and the payload its edited `tool_args`.
79
+ */
80
+ export declare function respondDecisionDescriptor({ threadId, toolCallId, action, toolArgs, decisions, }: {
81
+ threadId: string;
82
+ toolCallId: string;
83
+ action?: string;
84
+ toolArgs?: unknown;
85
+ decisions?: Readonly<Record<string, unknown>>;
86
+ }): DecisionCheckDescriptor;
87
+ /**
88
+ * How a browser check went. Every outcome but `confirmed` sends the decision
89
+ * without a token while checks are report-only; the surface decides what to
90
+ * tell the person (a nudge to set up a passkey for `no_passkey`).
91
+ */
92
+ export type BrowserDecisionCheckOutcome = {
93
+ readonly status: 'confirmed';
94
+ readonly token: string;
95
+ } | {
96
+ readonly status: 'no_passkey';
97
+ } | {
98
+ readonly status: 'cancelled';
99
+ } | {
100
+ readonly status: 'unsupported';
101
+ } | {
102
+ readonly status: 'unavailable';
103
+ } | {
104
+ readonly status: 'expired';
105
+ } | {
106
+ readonly status: 'failed';
107
+ readonly message: string;
108
+ };
109
+ /** What the surface shows while the person finishes in the browser. */
110
+ export interface PendingBrowserDecisionCheck {
111
+ readonly userCode: string;
112
+ readonly verificationUrl: string;
113
+ readonly expiresAt: Date;
114
+ }
115
+ /**
116
+ * The surface's authenticated request to agora: `path` is absolute from the
117
+ * API root (`/api/passkeys/...`). The host adds its base URL and credential
118
+ * (the person's sign-in, or the device key) and returns the raw response.
119
+ */
120
+ export type AgoraFetch = (path: string, init: RequestInit) => Promise<Response>;
121
+ export interface RunBrowserDecisionCheckOptions {
122
+ readonly decisions: readonly DecisionCheckDescriptor[];
123
+ readonly client: DecisionCheckClient;
124
+ readonly agoraFetch: AgoraFetch;
125
+ /** Open the check page in the system browser or a new tab. */
126
+ readonly openUrl: (url: string) => void | Promise<void>;
127
+ /** An app link the page sends the person back to once they answered. */
128
+ readonly returnUrl?: string;
129
+ /** Told when the browser is open (with the code to show), and `null` once it settled. */
130
+ readonly onPending?: (pending: PendingBrowserDecisionCheck | null) => void;
131
+ /** Aborting gives up waiting: the decision goes without a token (`cancelled`). */
132
+ readonly signal?: AbortSignal;
133
+ /** Injectable for tests. */
134
+ readonly sleep?: (ms: number, signal?: AbortSignal) => Promise<void>;
135
+ readonly now?: () => number;
136
+ }
137
+ /**
138
+ * Ask the person to confirm `decisions` with their passkey in the system
139
+ * browser, and wait for the answer: the token when they confirmed, or why
140
+ * there is none. Never rejects.
141
+ */
142
+ export declare function runBrowserDecisionCheck(options: RunBrowserDecisionCheckOptions): Promise<BrowserDecisionCheckOutcome>;
@@ -0,0 +1,207 @@
1
+ const MAX_DECISIONS_PER_CHECK = 25;
2
+ const DecisionCheckKind = {
3
+ CHAT_APPROVAL_ANSWER: "chat_approval_answer"
4
+ };
5
+ const CHECKPOINT_NAMESPACE = "athena-deep-agent:";
6
+ function bareDecisionThreadId(threadId) {
7
+ return threadId.startsWith(CHECKPOINT_NAMESPACE) ? threadId.slice(CHECKPOINT_NAMESPACE.length) : threadId;
8
+ }
9
+ function statewireAnswerDescriptors({
10
+ threadId,
11
+ answer
12
+ }) {
13
+ const thread = bareDecisionThreadId(threadId);
14
+ if (answer.kind === "input") {
15
+ return [
16
+ {
17
+ kind: DecisionCheckKind.CHAT_APPROVAL_ANSWER,
18
+ targetIds: [`${thread}:${answer.requestId}`],
19
+ option: "resume",
20
+ editedPayload: answer.value
21
+ }
22
+ ];
23
+ }
24
+ return Object.entries(answer.laneDecisions).map(([interruptId, decision]) => ({
25
+ kind: DecisionCheckKind.CHAT_APPROVAL_ANSWER,
26
+ targetIds: [`${thread}:${interruptId}`],
27
+ option: "resume",
28
+ editedPayload: decision
29
+ }));
30
+ }
31
+ const REQUESTS_PATH = "/api/passkeys/decision-checks/requests";
32
+ const DEFAULT_INTERVAL_MS = 2e3;
33
+ const MIN_INTERVAL_MS = 1e3;
34
+ const MAX_COLLECT_FAILURES = 5;
35
+ function isRecord(value) {
36
+ return typeof value === "object" && value !== null && !Array.isArray(value);
37
+ }
38
+ async function readJson(response) {
39
+ try {
40
+ const body = await response.json();
41
+ return isRecord(body) ? body : null;
42
+ } catch {
43
+ return null;
44
+ }
45
+ }
46
+ function defaultSleep(ms, signal) {
47
+ return new Promise((resolve) => {
48
+ if (signal == null ? void 0 : signal.aborted) {
49
+ resolve();
50
+ return;
51
+ }
52
+ const timer = setTimeout(() => {
53
+ signal == null ? void 0 : signal.removeEventListener("abort", onAbort);
54
+ resolve();
55
+ }, ms);
56
+ const onAbort = () => {
57
+ clearTimeout(timer);
58
+ resolve();
59
+ };
60
+ signal == null ? void 0 : signal.addEventListener("abort", onAbort, { once: true });
61
+ });
62
+ }
63
+ function messageOf(error) {
64
+ return error instanceof Error ? error.message : String(error);
65
+ }
66
+ function notifyPending(options, pending) {
67
+ var _a;
68
+ try {
69
+ (_a = options.onPending) == null ? void 0 : _a.call(options, pending);
70
+ } catch (error) {
71
+ console.warn("[decision-check] the pending notice failed:", messageOf(error));
72
+ }
73
+ }
74
+ function openedCheck(body) {
75
+ if (body === null) return null;
76
+ const { request_id, poll_secret, user_code, verification_url, expires_at, interval_seconds } = body;
77
+ if (typeof request_id !== "string" || typeof poll_secret !== "string" || typeof user_code !== "string" || typeof verification_url !== "string" || typeof expires_at !== "string") {
78
+ return null;
79
+ }
80
+ const expiresAt = new Date(expires_at);
81
+ if (Number.isNaN(expiresAt.getTime())) return null;
82
+ const seconds = typeof interval_seconds === "number" ? interval_seconds : 0;
83
+ return {
84
+ requestId: request_id,
85
+ pollSecret: poll_secret,
86
+ userCode: user_code,
87
+ verificationUrl: verification_url,
88
+ expiresAt,
89
+ intervalMs: seconds > 0 ? Math.max(MIN_INTERVAL_MS, seconds * 1e3) : DEFAULT_INTERVAL_MS
90
+ };
91
+ }
92
+ async function openRequest(options) {
93
+ var _a;
94
+ let response;
95
+ try {
96
+ response = await options.agoraFetch(REQUESTS_PATH, {
97
+ method: "POST",
98
+ headers: { "Content-Type": "application/json" },
99
+ body: JSON.stringify({
100
+ decisions: options.decisions,
101
+ client: options.client,
102
+ ...options.returnUrl ? { return_url: options.returnUrl } : {}
103
+ }),
104
+ signal: options.signal
105
+ });
106
+ } catch (error) {
107
+ if ((_a = options.signal) == null ? void 0 : _a.aborted) return { status: "cancelled" };
108
+ return { status: "failed", message: messageOf(error) };
109
+ }
110
+ if (response.status === 404 || response.status === 503) return { status: "unavailable" };
111
+ if (!response.ok) {
112
+ return { status: "failed", message: `The check could not start (${response.status}).` };
113
+ }
114
+ return openedCheck(await readJson(response)) ?? {
115
+ status: "failed",
116
+ message: "The check could not start."
117
+ };
118
+ }
119
+ function settledOutcome(body) {
120
+ if (body === null) return null;
121
+ if (body.status === "confirmed" && typeof body.check_token === "string" && body.check_token) {
122
+ return { status: "confirmed", token: body.check_token };
123
+ }
124
+ if (body.status === "declined") {
125
+ switch (body.reason) {
126
+ case "no_passkey":
127
+ return { status: "no_passkey" };
128
+ case "unsupported":
129
+ return { status: "unsupported" };
130
+ case "failed":
131
+ return { status: "failed", message: "The passkey check failed in the browser." };
132
+ default:
133
+ return { status: "cancelled" };
134
+ }
135
+ }
136
+ return null;
137
+ }
138
+ async function runBrowserDecisionCheck(options) {
139
+ var _a, _b;
140
+ if (options.decisions.length === 0) return { status: "failed", message: "Nothing to confirm." };
141
+ if (options.decisions.length > MAX_DECISIONS_PER_CHECK) {
142
+ return {
143
+ status: "failed",
144
+ message: `One check confirms up to ${MAX_DECISIONS_PER_CHECK} decisions.`
145
+ };
146
+ }
147
+ const sleep = options.sleep ?? defaultSleep;
148
+ const now = options.now ?? Date.now;
149
+ const opened = await openRequest(options);
150
+ if ("status" in opened) return opened;
151
+ notifyPending(options, {
152
+ userCode: opened.userCode,
153
+ verificationUrl: opened.verificationUrl,
154
+ expiresAt: opened.expiresAt
155
+ });
156
+ try {
157
+ try {
158
+ await options.openUrl(opened.verificationUrl);
159
+ } catch (error) {
160
+ console.warn("[decision-check] could not open the browser:", messageOf(error));
161
+ }
162
+ let failures = 0;
163
+ while (now() < opened.expiresAt.getTime()) {
164
+ await sleep(opened.intervalMs, options.signal);
165
+ if ((_a = options.signal) == null ? void 0 : _a.aborted) return { status: "cancelled" };
166
+ let response;
167
+ try {
168
+ response = await options.agoraFetch(
169
+ `${REQUESTS_PATH}/${encodeURIComponent(opened.requestId)}/collect`,
170
+ {
171
+ method: "POST",
172
+ headers: { "Content-Type": "application/json" },
173
+ body: JSON.stringify({ poll_secret: opened.pollSecret }),
174
+ signal: options.signal
175
+ }
176
+ );
177
+ } catch (error) {
178
+ if ((_b = options.signal) == null ? void 0 : _b.aborted) return { status: "cancelled" };
179
+ failures += 1;
180
+ if (failures >= MAX_COLLECT_FAILURES) return { status: "failed", message: messageOf(error) };
181
+ continue;
182
+ }
183
+ if (response.status === 404) return { status: "expired" };
184
+ if (!response.ok) {
185
+ failures += 1;
186
+ if (failures >= MAX_COLLECT_FAILURES) {
187
+ return { status: "failed", message: `The check could not finish (${response.status}).` };
188
+ }
189
+ continue;
190
+ }
191
+ failures = 0;
192
+ const settled = settledOutcome(await readJson(response));
193
+ if (settled !== null) return settled;
194
+ }
195
+ return { status: "expired" };
196
+ } finally {
197
+ notifyPending(options, null);
198
+ }
199
+ }
200
+ export {
201
+ DecisionCheckKind,
202
+ MAX_DECISIONS_PER_CHECK,
203
+ bareDecisionThreadId,
204
+ runBrowserDecisionCheck,
205
+ statewireAnswerDescriptors
206
+ };
207
+ //# sourceMappingURL=decision-checks.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"decision-checks.js","sources":["../../../../agent-runtime/src/decision-checks.ts"],"sourcesContent":["/**\n * \"Confirm with your passkey\" for surfaces that can't run the passkey prompt\n * themselves (identity row 0b.9, PR C): the phone, Midas, the Chrome\n * extension, the Office add-ins and SDK apps on another origin.\n *\n * A passkey belongs to the deployment's web host, so the check runs there, in\n * the system browser. The surface asks agora for a check over the decisions\n * on its screen (`POST /api/passkeys/decision-checks/requests`), opens the\n * verification URL it gets back, and collects the token once the person\n * confirmed on the web app's check page. It then sends its decision with that\n * token, as the web app does: `X-Athena-Decision-Check` on REST and GraphQL,\n * `decisionCheck` on statewire's `run/input` and `run/lane-input`.\n *\n * Framework-free: React hosts wrap {@link runBrowserDecisionCheck} in a\n * TanStack mutation; the CLI and the phone call it as they are.\n *\n * Every outcome is a value, never a rejection. While checks are report-only\n * (PR D enforces them) the decision goes ahead whatever this resolves, with\n * the token only when the person confirmed.\n */\n\n/** The header a REST or GraphQL decide call carries its check token in. */\nexport const DECISION_CHECK_HEADER = 'X-Athena-Decision-Check';\n\n/** The most decisions one check covers: a screen's worth. */\nexport const MAX_DECISIONS_PER_CHECK = 25;\n\n/** What kind of decision a descriptor describes (agora's `DecisionKind`). */\nexport const DecisionCheckKind = {\n APPROVAL_DECIDE: 'approval_decide',\n AUTOMATION_APPROVAL_DECIDE: 'automation_approval_decide',\n CHAT_APPROVAL_ANSWER: 'chat_approval_answer',\n} as const;\n\nexport type DecisionCheckKind = (typeof DecisionCheckKind)[keyof typeof DecisionCheckKind];\n\n/**\n * One decision a check covers, exactly as its decide call sends it: agora\n * builds the same item from the decide call and asks whether the token covers\n * it. `editedPayload` is the JSON value itself, never a hash of it.\n */\nexport interface DecisionCheckDescriptor {\n readonly kind: string;\n readonly targetIds: readonly string[];\n readonly option: string;\n readonly editedPayload?: unknown;\n readonly standingDuration?: string;\n}\n\n/** Which surface asks, as the check page shows it. */\nexport type DecisionCheckClientKind =\n | 'cli'\n | 'desktop'\n | 'mobile'\n | 'chrome_extension'\n | 'office_addin'\n | 'sdk';\n\nexport interface DecisionCheckClient {\n readonly kind: DecisionCheckClientKind;\n /** A short name for this device or app (\"Pat's MacBook\"), shown on the page. */\n readonly label?: string;\n}\n\nconst CHECKPOINT_NAMESPACE = 'athena-deep-agent:';\n\n/** A thread id the way agora names chat answers: without the checkpoint namespace. */\nexport function bareDecisionThreadId(threadId: string): string {\n return threadId.startsWith(CHECKPOINT_NAMESPACE)\n ? threadId.slice(CHECKPOINT_NAMESPACE.length)\n : threadId;\n}\n\n/**\n * A chat answer as statewire carries it: a `run/input` resume of one parked\n * request, or the lane decisions of a `run/lane-input`.\n */\nexport type StatewireAnswerForCheck =\n | { readonly kind: 'input'; readonly requestId: string; readonly value: unknown }\n | { readonly kind: 'lanes'; readonly laneDecisions: Readonly<Record<string, unknown>> };\n\n/**\n * The decisions one statewire answer makes: `chat_approval_answer` on\n * `<thread>:<requestId>` with the resume value as its payload, or one per lane\n * on `<thread>:<lane interrupt id>` with that lane's decision as its payload.\n */\nexport function statewireAnswerDescriptors({\n threadId,\n answer,\n}: {\n threadId: string;\n answer: StatewireAnswerForCheck;\n}): DecisionCheckDescriptor[] {\n const thread = bareDecisionThreadId(threadId);\n if (answer.kind === 'input') {\n return [\n {\n kind: DecisionCheckKind.CHAT_APPROVAL_ANSWER,\n targetIds: [`${thread}:${answer.requestId}`],\n option: 'resume',\n editedPayload: answer.value,\n },\n ];\n }\n return Object.entries(answer.laneDecisions).map(([interruptId, decision]) => ({\n kind: DecisionCheckKind.CHAT_APPROVAL_ANSWER,\n targetIds: [`${thread}:${interruptId}`],\n option: 'resume',\n editedPayload: decision,\n }));\n}\n\n/**\n * The phone's respond route (`POST /mobile/approvals/{thread}/respond`, also\n * the comment thread's inline approval): a `decisions` map is option\n * `decisions` with the map as its payload; otherwise the option is the action\n * and the payload its edited `tool_args`.\n */\nexport function respondDecisionDescriptor({\n threadId,\n toolCallId,\n action,\n toolArgs,\n decisions,\n}: {\n threadId: string;\n toolCallId: string;\n action?: string;\n toolArgs?: unknown;\n decisions?: Readonly<Record<string, unknown>>;\n}): DecisionCheckDescriptor {\n const target = `${bareDecisionThreadId(threadId)}:${toolCallId}`;\n if (decisions !== undefined && Object.keys(decisions).length > 0) {\n return {\n kind: DecisionCheckKind.CHAT_APPROVAL_ANSWER,\n targetIds: [target],\n option: 'decisions',\n editedPayload: decisions,\n };\n }\n return {\n kind: DecisionCheckKind.CHAT_APPROVAL_ANSWER,\n targetIds: [target],\n option: action ?? 'decisions',\n ...(toolArgs !== undefined && toolArgs !== null ? { editedPayload: toolArgs } : {}),\n };\n}\n\n/**\n * How a browser check went. Every outcome but `confirmed` sends the decision\n * without a token while checks are report-only; the surface decides what to\n * tell the person (a nudge to set up a passkey for `no_passkey`).\n */\nexport type BrowserDecisionCheckOutcome =\n | { readonly status: 'confirmed'; readonly token: string }\n | { readonly status: 'no_passkey' }\n | { readonly status: 'cancelled' }\n | { readonly status: 'unsupported' }\n | { readonly status: 'unavailable' }\n | { readonly status: 'expired' }\n | { readonly status: 'failed'; readonly message: string };\n\n/** What the surface shows while the person finishes in the browser. */\nexport interface PendingBrowserDecisionCheck {\n readonly userCode: string;\n readonly verificationUrl: string;\n readonly expiresAt: Date;\n}\n\n/**\n * The surface's authenticated request to agora: `path` is absolute from the\n * API root (`/api/passkeys/...`). The host adds its base URL and credential\n * (the person's sign-in, or the device key) and returns the raw response.\n */\nexport type AgoraFetch = (path: string, init: RequestInit) => Promise<Response>;\n\nexport interface RunBrowserDecisionCheckOptions {\n readonly decisions: readonly DecisionCheckDescriptor[];\n readonly client: DecisionCheckClient;\n readonly agoraFetch: AgoraFetch;\n /** Open the check page in the system browser or a new tab. */\n readonly openUrl: (url: string) => void | Promise<void>;\n /** An app link the page sends the person back to once they answered. */\n readonly returnUrl?: string;\n /** Told when the browser is open (with the code to show), and `null` once it settled. */\n readonly onPending?: (pending: PendingBrowserDecisionCheck | null) => void;\n /** Aborting gives up waiting: the decision goes without a token (`cancelled`). */\n readonly signal?: AbortSignal;\n /** Injectable for tests. */\n readonly sleep?: (ms: number, signal?: AbortSignal) => Promise<void>;\n readonly now?: () => number;\n}\n\nconst REQUESTS_PATH = '/api/passkeys/decision-checks/requests';\nconst DEFAULT_INTERVAL_MS = 2_000;\nconst MIN_INTERVAL_MS = 1_000;\n/** A transient collect failure is retried; this many in a row gives up. */\nconst MAX_COLLECT_FAILURES = 5;\n\nfunction isRecord(value: unknown): value is Record<string, unknown> {\n return typeof value === 'object' && value !== null && !Array.isArray(value);\n}\n\nasync function readJson(response: Response): Promise<Record<string, unknown> | null> {\n try {\n const body: unknown = await response.json();\n return isRecord(body) ? body : null;\n } catch {\n return null;\n }\n}\n\nfunction defaultSleep(ms: number, signal?: AbortSignal): Promise<void> {\n return new Promise((resolve) => {\n if (signal?.aborted) {\n resolve();\n return;\n }\n const timer = setTimeout(() => {\n signal?.removeEventListener('abort', onAbort);\n resolve();\n }, ms);\n const onAbort = () => {\n clearTimeout(timer);\n resolve();\n };\n signal?.addEventListener('abort', onAbort, { once: true });\n });\n}\n\nfunction messageOf(error: unknown): string {\n return error instanceof Error ? error.message : String(error);\n}\n\n/** Tell the host about the open check; a host callback that throws changes nothing here. */\nfunction notifyPending(\n options: RunBrowserDecisionCheckOptions,\n pending: PendingBrowserDecisionCheck | null,\n): void {\n try {\n options.onPending?.(pending);\n } catch (error) {\n console.warn('[decision-check] the pending notice failed:', messageOf(error));\n }\n}\n\ninterface OpenedCheck {\n readonly requestId: string;\n readonly pollSecret: string;\n readonly userCode: string;\n readonly verificationUrl: string;\n readonly expiresAt: Date;\n readonly intervalMs: number;\n}\n\nfunction openedCheck(body: Record<string, unknown> | null): OpenedCheck | null {\n if (body === null) return null;\n const { request_id, poll_secret, user_code, verification_url, expires_at, interval_seconds } =\n body;\n if (\n typeof request_id !== 'string' ||\n typeof poll_secret !== 'string' ||\n typeof user_code !== 'string' ||\n typeof verification_url !== 'string' ||\n typeof expires_at !== 'string'\n ) {\n return null;\n }\n const expiresAt = new Date(expires_at);\n if (Number.isNaN(expiresAt.getTime())) return null;\n const seconds = typeof interval_seconds === 'number' ? interval_seconds : 0;\n return {\n requestId: request_id,\n pollSecret: poll_secret,\n userCode: user_code,\n verificationUrl: verification_url,\n expiresAt,\n intervalMs: seconds > 0 ? Math.max(MIN_INTERVAL_MS, seconds * 1_000) : DEFAULT_INTERVAL_MS,\n };\n}\n\nasync function openRequest(\n options: RunBrowserDecisionCheckOptions,\n): Promise<OpenedCheck | BrowserDecisionCheckOutcome> {\n let response: Response;\n try {\n response = await options.agoraFetch(REQUESTS_PATH, {\n method: 'POST',\n headers: { 'Content-Type': 'application/json' },\n body: JSON.stringify({\n decisions: options.decisions,\n client: options.client,\n ...(options.returnUrl ? { return_url: options.returnUrl } : {}),\n }),\n signal: options.signal,\n });\n } catch (error) {\n if (options.signal?.aborted) return { status: 'cancelled' };\n return { status: 'failed', message: messageOf(error) };\n }\n // 404: an agora before browser checks; 503: none can be minted here.\n if (response.status === 404 || response.status === 503) return { status: 'unavailable' };\n if (!response.ok) {\n return { status: 'failed', message: `The check could not start (${response.status}).` };\n }\n return openedCheck(await readJson(response)) ?? {\n status: 'failed',\n message: 'The check could not start.',\n };\n}\n\nfunction settledOutcome(body: Record<string, unknown> | null): BrowserDecisionCheckOutcome | null {\n if (body === null) return null;\n if (body.status === 'confirmed' && typeof body.check_token === 'string' && body.check_token) {\n return { status: 'confirmed', token: body.check_token };\n }\n if (body.status === 'declined') {\n switch (body.reason) {\n case 'no_passkey':\n return { status: 'no_passkey' };\n case 'unsupported':\n return { status: 'unsupported' };\n case 'failed':\n return { status: 'failed', message: 'The passkey check failed in the browser.' };\n default:\n return { status: 'cancelled' };\n }\n }\n return null;\n}\n\n/**\n * Ask the person to confirm `decisions` with their passkey in the system\n * browser, and wait for the answer: the token when they confirmed, or why\n * there is none. Never rejects.\n */\nexport async function runBrowserDecisionCheck(\n options: RunBrowserDecisionCheckOptions,\n): Promise<BrowserDecisionCheckOutcome> {\n if (options.decisions.length === 0) return { status: 'failed', message: 'Nothing to confirm.' };\n if (options.decisions.length > MAX_DECISIONS_PER_CHECK) {\n return {\n status: 'failed',\n message: `One check confirms up to ${MAX_DECISIONS_PER_CHECK} decisions.`,\n };\n }\n const sleep = options.sleep ?? defaultSleep;\n const now = options.now ?? Date.now;\n const opened = await openRequest(options);\n if ('status' in opened) return opened;\n\n notifyPending(options, {\n userCode: opened.userCode,\n verificationUrl: opened.verificationUrl,\n expiresAt: opened.expiresAt,\n });\n try {\n try {\n await options.openUrl(opened.verificationUrl);\n } catch (error) {\n // The page can still be opened by hand from the link the surface shows.\n console.warn('[decision-check] could not open the browser:', messageOf(error));\n }\n let failures = 0;\n while (now() < opened.expiresAt.getTime()) {\n await sleep(opened.intervalMs, options.signal);\n if (options.signal?.aborted) return { status: 'cancelled' };\n let response: Response;\n try {\n response = await options.agoraFetch(\n `${REQUESTS_PATH}/${encodeURIComponent(opened.requestId)}/collect`,\n {\n method: 'POST',\n headers: { 'Content-Type': 'application/json' },\n body: JSON.stringify({ poll_secret: opened.pollSecret }),\n signal: options.signal,\n },\n );\n } catch (error) {\n if (options.signal?.aborted) return { status: 'cancelled' };\n failures += 1;\n if (failures >= MAX_COLLECT_FAILURES) return { status: 'failed', message: messageOf(error) };\n continue;\n }\n // Unknown, expired or already collected: nothing more will come.\n if (response.status === 404) return { status: 'expired' };\n if (!response.ok) {\n failures += 1;\n if (failures >= MAX_COLLECT_FAILURES) {\n return { status: 'failed', message: `The check could not finish (${response.status}).` };\n }\n continue;\n }\n failures = 0;\n const settled = settledOutcome(await readJson(response));\n if (settled !== null) return settled;\n }\n return { status: 'expired' };\n } finally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;AACZ,YAAI,YAAY,sBAAsB;AACpC,iBAAO,EAAE,QAAQ,UAAU,SAAS,+BAA+B,SAAS,MAAM,KAAA;AAAA,QACpF;AACA;AAAA,MACF;AACA,iBAAW;AACX,YAAM,UAAU,eAAe,MAAM,SAAS,QAAQ,CAAC;AACvD,UAAI,YAAY,KAAM,QAAO;AAAA,IAC/B;AACA,WAAO,EAAE,QAAQ,UAAA;AAAA,EACnB,UAAA;AACE,kBAAc,SAAS,IAAI;AAAA,EAC7B;AACF;"}
@@ -64,6 +64,12 @@ export declare const desktopHandoffViewSchema: z.ZodObject<{
64
64
  reason: z.ZodOptional<z.ZodNullable<z.ZodString>>;
65
65
  }, z.core.$strip>>;
66
66
  }, z.core.$strip>>;
67
+ origin: z.ZodOptional<z.ZodString>;
68
+ mode: z.ZodOptional<z.ZodEnum<{
69
+ text: "text";
70
+ voice: "voice";
71
+ }>>;
72
+ draft: z.ZodOptional<z.ZodNullable<z.ZodString>>;
67
73
  }, z.core.$strip>;
68
74
  export type DesktopHandoffView = z.infer<typeof desktopHandoffViewSchema>;
69
75
  export declare const desktopHandoffLaunchSchema: z.ZodObject<{
@@ -117,6 +123,12 @@ export declare const createDesktopHandoffResponseSchema: z.ZodObject<{
117
123
  reason: z.ZodOptional<z.ZodNullable<z.ZodString>>;
118
124
  }, z.core.$strip>>;
119
125
  }, z.core.$strip>>;
126
+ origin: z.ZodOptional<z.ZodString>;
127
+ mode: z.ZodOptional<z.ZodEnum<{
128
+ text: "text";
129
+ voice: "voice";
130
+ }>>;
131
+ draft: z.ZodOptional<z.ZodNullable<z.ZodString>>;
120
132
  }, z.core.$strip>;
121
133
  launch: z.ZodObject<{
122
134
  kind: z.ZodLiteral<"desktop">;