@athenaintel/react 0.57.1 → 0.59.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 (811) hide show
  1. package/README.md +778 -9
  2. package/dist/agent-runtime/src/addressed-agents.cjs +16 -0
  3. package/dist/agent-runtime/src/addressed-agents.cjs.map +1 -0
  4. package/dist/agent-runtime/src/addressed-agents.d.ts +30 -0
  5. package/dist/agent-runtime/src/addressed-agents.js +16 -0
  6. package/dist/agent-runtime/src/addressed-agents.js.map +1 -0
  7. package/dist/agent-runtime/src/answer-label.cjs +4 -3
  8. package/dist/agent-runtime/src/answer-label.cjs.map +1 -1
  9. package/dist/agent-runtime/src/answer-label.d.ts +13 -6
  10. package/dist/agent-runtime/src/answer-label.js +4 -3
  11. package/dist/agent-runtime/src/answer-label.js.map +1 -1
  12. package/dist/agent-runtime/src/chat-outbox-attachments.cjs.map +1 -1
  13. package/dist/agent-runtime/src/chat-outbox-attachments.d.ts +1 -1
  14. package/dist/agent-runtime/src/chat-outbox-attachments.js.map +1 -1
  15. package/dist/agent-runtime/src/chat-outbox-entry.cjs +101 -0
  16. package/dist/agent-runtime/src/chat-outbox-entry.cjs.map +1 -0
  17. package/dist/agent-runtime/src/chat-outbox-entry.d.ts +99 -0
  18. package/dist/agent-runtime/src/chat-outbox-entry.js +101 -0
  19. package/dist/agent-runtime/src/chat-outbox-entry.js.map +1 -0
  20. package/dist/agent-runtime/src/chat-outbox-legacy.cjs +252 -0
  21. package/dist/agent-runtime/src/chat-outbox-legacy.cjs.map +1 -0
  22. package/dist/agent-runtime/src/chat-outbox-legacy.d.ts +96 -0
  23. package/dist/agent-runtime/src/chat-outbox-legacy.js +252 -0
  24. package/dist/agent-runtime/src/chat-outbox-legacy.js.map +1 -0
  25. package/dist/agent-runtime/src/chat-outbox-policy.cjs +30 -0
  26. package/dist/agent-runtime/src/chat-outbox-policy.cjs.map +1 -0
  27. package/dist/agent-runtime/src/chat-outbox-policy.d.ts +42 -0
  28. package/dist/agent-runtime/src/chat-outbox-policy.js +30 -0
  29. package/dist/agent-runtime/src/chat-outbox-policy.js.map +1 -0
  30. package/dist/agent-runtime/src/chat-outbox-storage.cjs +306 -0
  31. package/dist/agent-runtime/src/chat-outbox-storage.cjs.map +1 -0
  32. package/dist/agent-runtime/src/chat-outbox-storage.d.ts +194 -0
  33. package/dist/agent-runtime/src/chat-outbox-storage.js +306 -0
  34. package/dist/agent-runtime/src/chat-outbox-storage.js.map +1 -0
  35. package/dist/agent-runtime/src/chat-outbox-thread.cjs +21 -94
  36. package/dist/agent-runtime/src/chat-outbox-thread.cjs.map +1 -1
  37. package/dist/agent-runtime/src/chat-outbox-thread.d.ts +22 -18
  38. package/dist/agent-runtime/src/chat-outbox-thread.js +21 -94
  39. package/dist/agent-runtime/src/chat-outbox-thread.js.map +1 -1
  40. package/dist/agent-runtime/src/chat-outbox.cjs +492 -547
  41. package/dist/agent-runtime/src/chat-outbox.cjs.map +1 -1
  42. package/dist/agent-runtime/src/chat-outbox.d.ts +110 -142
  43. package/dist/agent-runtime/src/chat-outbox.js +492 -547
  44. package/dist/agent-runtime/src/chat-outbox.js.map +1 -1
  45. package/dist/agent-runtime/src/composer-markdown.cjs.map +1 -1
  46. package/dist/agent-runtime/src/composer-markdown.d.ts +1 -1
  47. package/dist/agent-runtime/src/composer-markdown.js.map +1 -1
  48. package/dist/agent-runtime/src/deep-agent-transport-recipe.cjs +3 -1
  49. package/dist/agent-runtime/src/deep-agent-transport-recipe.cjs.map +1 -1
  50. package/dist/agent-runtime/src/deep-agent-transport-recipe.d.ts +8 -1
  51. package/dist/agent-runtime/src/deep-agent-transport-recipe.js +3 -1
  52. package/dist/agent-runtime/src/deep-agent-transport-recipe.js.map +1 -1
  53. package/dist/agent-runtime/src/dictation-preferences.d.ts +356 -0
  54. package/dist/agent-runtime/src/dictation-record.d.ts +279 -0
  55. package/dist/agent-runtime/src/dictation-session.d.ts +106 -7
  56. package/dist/agent-runtime/src/dictation-snippets.d.ts +9 -0
  57. package/dist/agent-runtime/src/dictation-transfer.d.ts +142 -0
  58. package/dist/agent-runtime/src/edit-command.cjs.map +1 -1
  59. package/dist/agent-runtime/src/edit-command.d.ts +1 -1
  60. package/dist/agent-runtime/src/edit-command.js.map +1 -1
  61. package/dist/agent-runtime/src/errors.cjs +1 -0
  62. package/dist/agent-runtime/src/errors.cjs.map +1 -1
  63. package/dist/agent-runtime/src/errors.js +1 -0
  64. package/dist/agent-runtime/src/errors.js.map +1 -1
  65. package/dist/agent-runtime/src/generated/runconfig-contract.cjs +24 -0
  66. package/dist/agent-runtime/src/generated/runconfig-contract.cjs.map +1 -1
  67. package/dist/agent-runtime/src/generated/runconfig-contract.d.ts +3 -3
  68. package/dist/agent-runtime/src/generated/runconfig-contract.js +24 -0
  69. package/dist/agent-runtime/src/generated/runconfig-contract.js.map +1 -1
  70. package/dist/agent-runtime/src/index.d.ts +14 -8
  71. package/dist/agent-runtime/src/lane-follow.cjs +289 -0
  72. package/dist/agent-runtime/src/lane-follow.cjs.map +1 -0
  73. package/dist/agent-runtime/src/lane-follow.js +289 -0
  74. package/dist/agent-runtime/src/lane-follow.js.map +1 -0
  75. package/dist/agent-runtime/src/lane-images.cjs +387 -0
  76. package/dist/agent-runtime/src/lane-images.cjs.map +1 -0
  77. package/dist/agent-runtime/src/lane-images.js +387 -0
  78. package/dist/agent-runtime/src/lane-images.js.map +1 -0
  79. package/dist/agent-runtime/src/message-window.js +1 -1
  80. package/dist/agent-runtime/src/messages.cjs +19 -1
  81. package/dist/agent-runtime/src/messages.cjs.map +1 -1
  82. package/dist/agent-runtime/src/messages.d.ts +8 -0
  83. package/dist/agent-runtime/src/messages.js +21 -3
  84. package/dist/agent-runtime/src/messages.js.map +1 -1
  85. package/dist/agent-runtime/src/named-agents.cjs +301 -0
  86. package/dist/agent-runtime/src/named-agents.cjs.map +1 -0
  87. package/dist/agent-runtime/src/named-agents.d.ts +246 -0
  88. package/dist/agent-runtime/src/named-agents.js +301 -0
  89. package/dist/agent-runtime/src/named-agents.js.map +1 -0
  90. package/dist/agent-runtime/src/offline-status.cjs.map +1 -1
  91. package/dist/agent-runtime/src/offline-status.d.ts +66 -2
  92. package/dist/agent-runtime/src/offline-status.js.map +1 -1
  93. package/dist/agent-runtime/src/ptc-subcalls.cjs +41 -0
  94. package/dist/agent-runtime/src/ptc-subcalls.cjs.map +1 -0
  95. package/dist/agent-runtime/src/ptc-subcalls.js +41 -0
  96. package/dist/agent-runtime/src/ptc-subcalls.js.map +1 -0
  97. package/dist/agent-runtime/src/queue.cjs +2 -2
  98. package/dist/agent-runtime/src/queue.cjs.map +1 -1
  99. package/dist/agent-runtime/src/queue.d.ts +20 -25
  100. package/dist/agent-runtime/src/queue.js +2 -2
  101. package/dist/agent-runtime/src/queue.js.map +1 -1
  102. package/dist/agent-runtime/src/quota-safe-local-storage-session.cjs +314 -84
  103. package/dist/agent-runtime/src/quota-safe-local-storage-session.cjs.map +1 -1
  104. package/dist/agent-runtime/src/quota-safe-local-storage-session.d.ts +137 -40
  105. package/dist/agent-runtime/src/quota-safe-local-storage-session.js +318 -88
  106. package/dist/agent-runtime/src/quota-safe-local-storage-session.js.map +1 -1
  107. package/dist/agent-runtime/src/run-send.cjs +54 -0
  108. package/dist/agent-runtime/src/run-send.cjs.map +1 -0
  109. package/dist/agent-runtime/src/run-send.d.ts +51 -0
  110. package/dist/agent-runtime/src/run-send.js +54 -0
  111. package/dist/agent-runtime/src/run-send.js.map +1 -0
  112. package/dist/agent-runtime/src/running-tool-placeholder.cjs +6 -0
  113. package/dist/agent-runtime/src/running-tool-placeholder.cjs.map +1 -1
  114. package/dist/agent-runtime/src/running-tool-placeholder.js +6 -0
  115. package/dist/agent-runtime/src/running-tool-placeholder.js.map +1 -1
  116. package/dist/agent-runtime/src/runtime.d.ts +9 -5
  117. package/dist/agent-runtime/src/sealed-idb.cjs +64 -0
  118. package/dist/agent-runtime/src/sealed-idb.cjs.map +1 -1
  119. package/dist/agent-runtime/src/sealed-idb.d.ts +16 -0
  120. package/dist/agent-runtime/src/sealed-idb.js +64 -0
  121. package/dist/agent-runtime/src/sealed-idb.js.map +1 -1
  122. package/dist/agent-runtime/src/send-recovery.cjs +90 -118
  123. package/dist/agent-runtime/src/send-recovery.cjs.map +1 -1
  124. package/dist/agent-runtime/src/send-recovery.d.ts +25 -29
  125. package/dist/agent-runtime/src/send-recovery.js +90 -118
  126. package/dist/agent-runtime/src/send-recovery.js.map +1 -1
  127. package/dist/agent-runtime/src/statewire-diagnostics.d.ts +4 -1
  128. package/dist/agent-runtime/src/statewire-held-sends.cjs +191 -0
  129. package/dist/agent-runtime/src/statewire-held-sends.cjs.map +1 -0
  130. package/dist/agent-runtime/src/statewire-held-sends.d.ts +119 -0
  131. package/dist/agent-runtime/src/statewire-held-sends.js +191 -0
  132. package/dist/agent-runtime/src/statewire-held-sends.js.map +1 -0
  133. package/dist/agent-runtime/src/statewire-state.cjs +4 -0
  134. package/dist/agent-runtime/src/statewire-state.cjs.map +1 -1
  135. package/dist/agent-runtime/src/statewire-state.js +4 -0
  136. package/dist/agent-runtime/src/statewire-state.js.map +1 -1
  137. package/dist/agent-runtime/src/statewire-transport.cjs +8 -2
  138. package/dist/agent-runtime/src/statewire-transport.cjs.map +1 -1
  139. package/dist/agent-runtime/src/statewire-transport.d.ts +14 -5
  140. package/dist/agent-runtime/src/statewire-transport.js +8 -2
  141. package/dist/agent-runtime/src/statewire-transport.js.map +1 -1
  142. package/dist/agent-runtime/src/subagent-transcripts.cjs +1 -23
  143. package/dist/agent-runtime/src/subagent-transcripts.cjs.map +1 -1
  144. package/dist/agent-runtime/src/subagent-transcripts.js +3 -25
  145. package/dist/agent-runtime/src/subagent-transcripts.js.map +1 -1
  146. package/dist/agent-runtime/src/subagents.cjs +22 -29
  147. package/dist/agent-runtime/src/subagents.cjs.map +1 -1
  148. package/dist/agent-runtime/src/subagents.js +23 -30
  149. package/dist/agent-runtime/src/subagents.js.map +1 -1
  150. package/dist/agent-runtime/src/thread-extras.cjs +27 -19
  151. package/dist/agent-runtime/src/thread-extras.cjs.map +1 -1
  152. package/dist/agent-runtime/src/thread-extras.d.ts +19 -6
  153. package/dist/agent-runtime/src/thread-extras.js +27 -19
  154. package/dist/agent-runtime/src/thread-extras.js.map +1 -1
  155. package/dist/agent-runtime/src/thread-handoff-flow-machine.d.ts +8 -8
  156. package/dist/agent-runtime/src/tool-metadata.cjs +12 -0
  157. package/dist/agent-runtime/src/tool-metadata.cjs.map +1 -1
  158. package/dist/agent-runtime/src/tool-metadata.js +12 -0
  159. package/dist/agent-runtime/src/tool-metadata.js.map +1 -1
  160. package/dist/agent-runtime/src/tool-names.cjs +21 -0
  161. package/dist/agent-runtime/src/tool-names.cjs.map +1 -1
  162. package/dist/agent-runtime/src/tool-names.d.ts +8 -0
  163. package/dist/agent-runtime/src/tool-names.js +21 -0
  164. package/dist/agent-runtime/src/tool-names.js.map +1 -1
  165. package/dist/agent-runtime/src/typed-interrupt-kinds.cjs +247 -0
  166. package/dist/agent-runtime/src/typed-interrupt-kinds.cjs.map +1 -0
  167. package/dist/agent-runtime/src/typed-interrupt-kinds.d.ts +173 -0
  168. package/dist/agent-runtime/src/typed-interrupt-kinds.js +247 -0
  169. package/dist/agent-runtime/src/typed-interrupt-kinds.js.map +1 -0
  170. package/dist/agent-runtime/src/typed-interrupts.cjs +48 -0
  171. package/dist/agent-runtime/src/typed-interrupts.cjs.map +1 -0
  172. package/dist/agent-runtime/src/typed-interrupts.d.ts +75 -0
  173. package/dist/agent-runtime/src/typed-interrupts.js +48 -0
  174. package/dist/agent-runtime/src/typed-interrupts.js.map +1 -0
  175. package/dist/agent-runtime/src/types.d.ts +1 -1
  176. package/dist/agent-runtime/src/use-conversation-list.cjs +1 -0
  177. package/dist/agent-runtime/src/use-conversation-list.cjs.map +1 -1
  178. package/dist/agent-runtime/src/use-conversation-list.d.ts +7 -0
  179. package/dist/agent-runtime/src/use-conversation-list.js +1 -0
  180. package/dist/agent-runtime/src/use-conversation-list.js.map +1 -1
  181. package/dist/agent-runtime/src/use-deep-agent-chat-outbox.cjs +46 -29
  182. package/dist/agent-runtime/src/use-deep-agent-chat-outbox.cjs.map +1 -1
  183. package/dist/agent-runtime/src/use-deep-agent-chat-outbox.d.ts +14 -22
  184. package/dist/agent-runtime/src/use-deep-agent-chat-outbox.js +46 -29
  185. package/dist/agent-runtime/src/use-deep-agent-chat-outbox.js.map +1 -1
  186. package/dist/agent-runtime/src/use-deep-agent-runtime.cjs +78 -14
  187. package/dist/agent-runtime/src/use-deep-agent-runtime.cjs.map +1 -1
  188. package/dist/agent-runtime/src/use-deep-agent-runtime.d.ts +34 -7
  189. package/dist/agent-runtime/src/use-deep-agent-runtime.js +79 -15
  190. package/dist/agent-runtime/src/use-deep-agent-runtime.js.map +1 -1
  191. package/dist/agent-runtime/src/use-deep-agent-thread.cjs +16 -1
  192. package/dist/agent-runtime/src/use-deep-agent-thread.cjs.map +1 -1
  193. package/dist/agent-runtime/src/use-deep-agent-thread.d.ts +7 -2
  194. package/dist/agent-runtime/src/use-deep-agent-thread.js +16 -1
  195. package/dist/agent-runtime/src/use-deep-agent-thread.js.map +1 -1
  196. package/dist/agent-runtime/src/use-deep-agent-voice.cjs +30 -4
  197. package/dist/agent-runtime/src/use-deep-agent-voice.cjs.map +1 -1
  198. package/dist/agent-runtime/src/use-deep-agent-voice.d.ts +22 -4
  199. package/dist/agent-runtime/src/use-deep-agent-voice.js +30 -4
  200. package/dist/agent-runtime/src/use-deep-agent-voice.js.map +1 -1
  201. package/dist/agent-runtime/src/withdrawn-turns.d.ts +5 -4
  202. package/dist/agent-runtime/src/word-device-fit.d.ts +174 -0
  203. package/dist/agent-runtime/src/work-in.d.ts +127 -0
  204. package/dist/assets/AthenaAssetEmbed.cjs.map +1 -1
  205. package/dist/assets/AthenaAssetEmbed.d.ts +6 -1
  206. package/dist/assets/AthenaAssetEmbed.js.map +1 -1
  207. package/dist/assets/asset-panel-store.cjs +13 -5
  208. package/dist/assets/asset-panel-store.cjs.map +1 -1
  209. package/dist/assets/asset-panel-store.d.ts +33 -2
  210. package/dist/assets/asset-panel-store.js +13 -5
  211. package/dist/assets/asset-panel-store.js.map +1 -1
  212. package/dist/auth/AthenaCredentialSourceContext.cjs +11 -0
  213. package/dist/auth/AthenaCredentialSourceContext.cjs.map +1 -1
  214. package/dist/auth/AthenaCredentialSourceContext.d.ts +6 -0
  215. package/dist/auth/AthenaCredentialSourceContext.js +11 -0
  216. package/dist/auth/AthenaCredentialSourceContext.js.map +1 -1
  217. package/dist/auth/account-identity.cjs +13 -2
  218. package/dist/auth/account-identity.cjs.map +1 -1
  219. package/dist/auth/account-identity.d.ts +9 -0
  220. package/dist/auth/account-identity.js +13 -2
  221. package/dist/auth/account-identity.js.map +1 -1
  222. package/dist/auth/credential-source.cjs +20 -4
  223. package/dist/auth/credential-source.cjs.map +1 -1
  224. package/dist/auth/credential-source.d.ts +9 -0
  225. package/dist/auth/credential-source.js +20 -4
  226. package/dist/auth/credential-source.js.map +1 -1
  227. package/dist/catalog/chat-pickers.cjs +31 -0
  228. package/dist/catalog/chat-pickers.cjs.map +1 -1
  229. package/dist/catalog/chat-pickers.d.ts +17 -0
  230. package/dist/catalog/chat-pickers.js +33 -2
  231. package/dist/catalog/chat-pickers.js.map +1 -1
  232. package/dist/catalog/runtime-catalog.cjs +63 -3
  233. package/dist/catalog/runtime-catalog.cjs.map +1 -1
  234. package/dist/catalog/runtime-catalog.d.ts +63 -3
  235. package/dist/catalog/runtime-catalog.js +64 -4
  236. package/dist/catalog/runtime-catalog.js.map +1 -1
  237. package/dist/chat/AthenaChat.cjs +337 -99
  238. package/dist/chat/AthenaChat.cjs.map +1 -1
  239. package/dist/chat/AthenaChat.d.ts +80 -4
  240. package/dist/chat/AthenaChat.js +337 -99
  241. package/dist/chat/AthenaChat.js.map +1 -1
  242. package/dist/chat/StatewireApprovalCard.cjs +35 -5
  243. package/dist/chat/StatewireApprovalCard.cjs.map +1 -1
  244. package/dist/chat/StatewireApprovalCard.d.ts +55 -2
  245. package/dist/chat/StatewireApprovalCard.js +37 -7
  246. package/dist/chat/StatewireApprovalCard.js.map +1 -1
  247. package/dist/chat/StatewireQueuedMessages.cjs +17 -2
  248. package/dist/chat/StatewireQueuedMessages.cjs.map +1 -1
  249. package/dist/chat/StatewireQueuedMessages.d.ts +8 -45
  250. package/dist/chat/StatewireQueuedMessages.js +18 -3
  251. package/dist/chat/StatewireQueuedMessages.js.map +1 -1
  252. package/dist/chat/chat-agent-mentions.cjs +70 -0
  253. package/dist/chat/chat-agent-mentions.cjs.map +1 -0
  254. package/dist/chat/chat-agent-mentions.d.ts +13 -0
  255. package/dist/chat/chat-agent-mentions.js +70 -0
  256. package/dist/chat/chat-agent-mentions.js.map +1 -0
  257. package/dist/chat/composer-actions.cjs +12 -0
  258. package/dist/chat/composer-actions.cjs.map +1 -0
  259. package/dist/chat/composer-actions.d.ts +22 -0
  260. package/dist/chat/composer-actions.js +12 -0
  261. package/dist/chat/composer-actions.js.map +1 -0
  262. package/dist/chat/follow-up-suggestions.cjs +185 -0
  263. package/dist/chat/follow-up-suggestions.cjs.map +1 -0
  264. package/dist/chat/follow-up-suggestions.d.ts +64 -0
  265. package/dist/chat/follow-up-suggestions.js +185 -0
  266. package/dist/chat/follow-up-suggestions.js.map +1 -0
  267. package/dist/chat/super-grouping/ToolTimeline.cjs +4 -3
  268. package/dist/chat/super-grouping/ToolTimeline.cjs.map +1 -1
  269. package/dist/chat/super-grouping/ToolTimeline.d.ts +7 -3
  270. package/dist/chat/super-grouping/ToolTimeline.js +4 -3
  271. package/dist/chat/super-grouping/ToolTimeline.js.map +1 -1
  272. package/dist/chat/turn-changes.cjs +284 -0
  273. package/dist/chat/turn-changes.cjs.map +1 -0
  274. package/dist/chat/turn-changes.d.ts +130 -0
  275. package/dist/chat/turn-changes.js +284 -0
  276. package/dist/chat/turn-changes.js.map +1 -0
  277. package/dist/chat/typed-interrupts/StatewireTypedInterruptCard.cjs +31 -0
  278. package/dist/chat/typed-interrupts/StatewireTypedInterruptCard.cjs.map +1 -0
  279. package/dist/chat/typed-interrupts/StatewireTypedInterruptCard.d.ts +31 -0
  280. package/dist/chat/typed-interrupts/StatewireTypedInterruptCard.js +31 -0
  281. package/dist/chat/typed-interrupts/StatewireTypedInterruptCard.js.map +1 -0
  282. package/dist/chat/typed-interrupts/approval-cards.cjs +250 -0
  283. package/dist/chat/typed-interrupts/approval-cards.cjs.map +1 -0
  284. package/dist/chat/typed-interrupts/approval-cards.d.ts +22 -0
  285. package/dist/chat/typed-interrupts/approval-cards.js +250 -0
  286. package/dist/chat/typed-interrupts/approval-cards.js.map +1 -0
  287. package/dist/chat/typed-interrupts/form-cards.cjs +289 -0
  288. package/dist/chat/typed-interrupts/form-cards.cjs.map +1 -0
  289. package/dist/chat/typed-interrupts/form-cards.d.ts +6 -0
  290. package/dist/chat/typed-interrupts/form-cards.js +289 -0
  291. package/dist/chat/typed-interrupts/form-cards.js.map +1 -0
  292. package/dist/chat/typed-interrupts/interrupt-card-shell.cjs +182 -0
  293. package/dist/chat/typed-interrupts/interrupt-card-shell.cjs.map +1 -0
  294. package/dist/chat/typed-interrupts/interrupt-card-shell.d.ts +47 -0
  295. package/dist/chat/typed-interrupts/interrupt-card-shell.js +182 -0
  296. package/dist/chat/typed-interrupts/interrupt-card-shell.js.map +1 -0
  297. package/dist/chat/typed-interrupts/json-schema-form.cjs +388 -0
  298. package/dist/chat/typed-interrupts/json-schema-form.cjs.map +1 -0
  299. package/dist/chat/typed-interrupts/json-schema-form.d.ts +33 -0
  300. package/dist/chat/typed-interrupts/json-schema-form.js +388 -0
  301. package/dist/chat/typed-interrupts/json-schema-form.js.map +1 -0
  302. package/dist/chat/typed-interrupts/questionnaire-card.cjs +449 -0
  303. package/dist/chat/typed-interrupts/questionnaire-card.cjs.map +1 -0
  304. package/dist/chat/typed-interrupts/questionnaire-card.d.ts +20 -0
  305. package/dist/chat/typed-interrupts/questionnaire-card.js +449 -0
  306. package/dist/chat/typed-interrupts/questionnaire-card.js.map +1 -0
  307. package/dist/chat/typed-interrupts/request-file-card.cjs +159 -0
  308. package/dist/chat/typed-interrupts/request-file-card.cjs.map +1 -0
  309. package/dist/chat/typed-interrupts/request-file-card.d.ts +2 -0
  310. package/dist/chat/typed-interrupts/request-file-card.js +159 -0
  311. package/dist/chat/typed-interrupts/request-file-card.js.map +1 -0
  312. package/dist/chat/typed-interrupts/toolkit-selection-card.cjs +189 -0
  313. package/dist/chat/typed-interrupts/toolkit-selection-card.cjs.map +1 -0
  314. package/dist/chat/typed-interrupts/toolkit-selection-card.d.ts +23 -0
  315. package/dist/chat/typed-interrupts/toolkit-selection-card.js +189 -0
  316. package/dist/chat/typed-interrupts/toolkit-selection-card.js.map +1 -0
  317. package/dist/chat/typed-interrupts/typed-interrupt-body.cjs +26 -0
  318. package/dist/chat/typed-interrupts/typed-interrupt-body.cjs.map +1 -0
  319. package/dist/chat/typed-interrupts/typed-interrupt-body.d.ts +3 -0
  320. package/dist/chat/typed-interrupts/typed-interrupt-body.js +26 -0
  321. package/dist/chat/typed-interrupts/typed-interrupt-body.js.map +1 -0
  322. package/dist/chat/typed-interrupts/typed-interrupt-graphql.cjs +105 -0
  323. package/dist/chat/typed-interrupts/typed-interrupt-graphql.cjs.map +1 -0
  324. package/dist/chat/typed-interrupts/typed-interrupt-graphql.d.ts +29 -0
  325. package/dist/chat/typed-interrupts/typed-interrupt-graphql.js +105 -0
  326. package/dist/chat/typed-interrupts/typed-interrupt-graphql.js.map +1 -0
  327. package/dist/chat/typed-interrupts/typed-interrupt-notice.cjs +70 -0
  328. package/dist/chat/typed-interrupts/typed-interrupt-notice.cjs.map +1 -0
  329. package/dist/chat/typed-interrupts/typed-interrupt-notice.d.ts +45 -0
  330. package/dist/chat/typed-interrupts/typed-interrupt-notice.js +70 -0
  331. package/dist/chat/typed-interrupts/typed-interrupt-notice.js.map +1 -0
  332. package/dist/chat/typed-interrupts/typed-interrupt-panel.cjs +76 -0
  333. package/dist/chat/typed-interrupts/typed-interrupt-panel.cjs.map +1 -0
  334. package/dist/chat/typed-interrupts/typed-interrupt-panel.d.ts +11 -0
  335. package/dist/chat/typed-interrupts/typed-interrupt-panel.js +76 -0
  336. package/dist/chat/typed-interrupts/typed-interrupt-panel.js.map +1 -0
  337. package/dist/chat/typed-interrupts/typed-interrupt-types.d.ts +46 -0
  338. package/dist/chat/typed-interrupts/use-interrupt-draft.cjs +106 -0
  339. package/dist/chat/typed-interrupts/use-interrupt-draft.cjs.map +1 -0
  340. package/dist/chat/typed-interrupts/use-interrupt-draft.d.ts +29 -0
  341. package/dist/chat/typed-interrupts/use-interrupt-draft.js +106 -0
  342. package/dist/chat/typed-interrupts/use-interrupt-draft.js.map +1 -0
  343. package/dist/chat/typed-interrupts/use-statewire-typed-interrupt.cjs +231 -0
  344. package/dist/chat/typed-interrupts/use-statewire-typed-interrupt.cjs.map +1 -0
  345. package/dist/chat/typed-interrupts/use-statewire-typed-interrupt.d.ts +66 -0
  346. package/dist/chat/typed-interrupts/use-statewire-typed-interrupt.js +231 -0
  347. package/dist/chat/typed-interrupts/use-statewire-typed-interrupt.js.map +1 -0
  348. package/dist/chat-ui/composer/composer-named-agents.cjs +13 -0
  349. package/dist/chat-ui/composer/composer-named-agents.cjs.map +1 -0
  350. package/dist/chat-ui/composer/composer-named-agents.d.ts +20 -0
  351. package/dist/chat-ui/composer/composer-named-agents.js +13 -0
  352. package/dist/chat-ui/composer/composer-named-agents.js.map +1 -0
  353. package/dist/chat-ui/composer/slash-command-menu.cjs +143 -0
  354. package/dist/chat-ui/composer/slash-command-menu.cjs.map +1 -0
  355. package/dist/chat-ui/composer/slash-command-menu.d.ts +19 -0
  356. package/dist/chat-ui/composer/slash-command-menu.js +143 -0
  357. package/dist/chat-ui/composer/slash-command-menu.js.map +1 -0
  358. package/dist/chat-ui/composer/slash-commands-extension.cjs +51 -0
  359. package/dist/chat-ui/composer/slash-commands-extension.cjs.map +1 -0
  360. package/dist/chat-ui/composer/slash-commands-extension.d.ts +39 -0
  361. package/dist/chat-ui/composer/slash-commands-extension.js +51 -0
  362. package/dist/chat-ui/composer/slash-commands-extension.js.map +1 -0
  363. package/dist/chat-ui/composer/slash-commands.cjs +74 -0
  364. package/dist/chat-ui/composer/slash-commands.cjs.map +1 -0
  365. package/dist/chat-ui/composer/slash-commands.d.ts +82 -0
  366. package/dist/chat-ui/composer/slash-commands.js +74 -0
  367. package/dist/chat-ui/composer/slash-commands.js.map +1 -0
  368. package/dist/chat-ui/composer/tiptap-composer.cjs +135 -9
  369. package/dist/chat-ui/composer/tiptap-composer.cjs.map +1 -1
  370. package/dist/chat-ui/composer/tiptap-composer.d.ts +61 -2
  371. package/dist/chat-ui/composer/tiptap-composer.js +135 -9
  372. package/dist/chat-ui/composer/tiptap-composer.js.map +1 -1
  373. package/dist/chat-ui/index.cjs +3 -0
  374. package/dist/chat-ui/index.cjs.map +1 -1
  375. package/dist/chat-ui/index.d.ts +3 -2
  376. package/dist/chat-ui/index.js +3 -0
  377. package/dist/chat-ui/index.js.map +1 -1
  378. package/dist/chat-ui/mentions/mention-chip.cjs +1 -1
  379. package/dist/chat-ui/mentions/mention-chip.cjs.map +1 -1
  380. package/dist/chat-ui/mentions/mention-chip.js +2 -2
  381. package/dist/chat-ui/mentions/mention-chip.js.map +1 -1
  382. package/dist/chat-ui/mentions/mention-extension.cjs +8 -1
  383. package/dist/chat-ui/mentions/mention-extension.cjs.map +1 -1
  384. package/dist/chat-ui/mentions/mention-extension.js +8 -1
  385. package/dist/chat-ui/mentions/mention-extension.js.map +1 -1
  386. package/dist/chat-ui/mentions/suggestions/components/get-scope-name.cjs +1 -0
  387. package/dist/chat-ui/mentions/suggestions/components/get-scope-name.cjs.map +1 -1
  388. package/dist/chat-ui/mentions/suggestions/components/get-scope-name.js +1 -0
  389. package/dist/chat-ui/mentions/suggestions/components/get-scope-name.js.map +1 -1
  390. package/dist/chat-ui/mentions/suggestions/components/mention-icon.cjs +2 -0
  391. package/dist/chat-ui/mentions/suggestions/components/mention-icon.cjs.map +1 -1
  392. package/dist/chat-ui/mentions/suggestions/components/mention-icon.js +3 -1
  393. package/dist/chat-ui/mentions/suggestions/components/mention-icon.js.map +1 -1
  394. package/dist/chat-ui/mentions/suggestions/components/menu-item.cjs +1 -1
  395. package/dist/chat-ui/mentions/suggestions/components/menu-item.cjs.map +1 -1
  396. package/dist/chat-ui/mentions/suggestions/components/menu-item.js +1 -1
  397. package/dist/chat-ui/mentions/suggestions/components/menu-item.js.map +1 -1
  398. package/dist/chat-ui/mentions/suggestions/data/api-client.cjs +36 -0
  399. package/dist/chat-ui/mentions/suggestions/data/api-client.cjs.map +1 -1
  400. package/dist/chat-ui/mentions/suggestions/data/api-client.d.ts +42 -0
  401. package/dist/chat-ui/mentions/suggestions/data/api-client.js +36 -0
  402. package/dist/chat-ui/mentions/suggestions/data/api-client.js.map +1 -1
  403. package/dist/chat-ui/mentions/suggestions/data/sources/index.cjs +235 -19
  404. package/dist/chat-ui/mentions/suggestions/data/sources/index.cjs.map +1 -1
  405. package/dist/chat-ui/mentions/suggestions/data/sources/index.d.ts +88 -10
  406. package/dist/chat-ui/mentions/suggestions/data/sources/index.js +236 -20
  407. package/dist/chat-ui/mentions/suggestions/data/sources/index.js.map +1 -1
  408. package/dist/chat-ui/mentions/suggestions/data/types.cjs.map +1 -1
  409. package/dist/chat-ui/mentions/suggestions/data/types.d.ts +27 -1
  410. package/dist/chat-ui/mentions/suggestions/data/types.js.map +1 -1
  411. package/dist/chat-ui/mentions/suggestions/data/use-mention-suggestions.cjs +56 -5
  412. package/dist/chat-ui/mentions/suggestions/data/use-mention-suggestions.cjs.map +1 -1
  413. package/dist/chat-ui/mentions/suggestions/data/use-mention-suggestions.d.ts +26 -6
  414. package/dist/chat-ui/mentions/suggestions/data/use-mention-suggestions.js +57 -6
  415. package/dist/chat-ui/mentions/suggestions/data/use-mention-suggestions.js.map +1 -1
  416. package/dist/chat-ui/mentions/suggestions/mention-suggestions.extension.cjs +34 -17
  417. package/dist/chat-ui/mentions/suggestions/mention-suggestions.extension.cjs.map +1 -1
  418. package/dist/chat-ui/mentions/suggestions/mention-suggestions.extension.d.ts +19 -1
  419. package/dist/chat-ui/mentions/suggestions/mention-suggestions.extension.js +35 -18
  420. package/dist/chat-ui/mentions/suggestions/mention-suggestions.extension.js.map +1 -1
  421. package/dist/chat-ui/statewire.d.ts +1 -1
  422. package/dist/chat-ui/thread/statewire-history-edge.cjs +15 -0
  423. package/dist/chat-ui/thread/statewire-history-edge.cjs.map +1 -1
  424. package/dist/chat-ui/thread/statewire-history-edge.d.ts +4 -1
  425. package/dist/chat-ui/thread/statewire-history-edge.js +15 -0
  426. package/dist/chat-ui/thread/statewire-history-edge.js.map +1 -1
  427. package/dist/collab/client.cjs +17 -5
  428. package/dist/collab/client.cjs.map +1 -1
  429. package/dist/collab/client.d.ts +22 -7
  430. package/dist/collab/client.js +17 -5
  431. package/dist/collab/client.js.map +1 -1
  432. package/dist/composer/ComposerAttachedReferences.cjs +119 -0
  433. package/dist/composer/ComposerAttachedReferences.cjs.map +1 -0
  434. package/dist/composer/ComposerAttachedReferences.d.ts +26 -0
  435. package/dist/composer/ComposerAttachedReferences.js +119 -0
  436. package/dist/composer/ComposerAttachedReferences.js.map +1 -0
  437. package/dist/composer/ComposerNamedAgents.cjs +63 -0
  438. package/dist/composer/ComposerNamedAgents.cjs.map +1 -0
  439. package/dist/composer/ComposerNamedAgents.d.ts +16 -0
  440. package/dist/composer/ComposerNamedAgents.js +63 -0
  441. package/dist/composer/ComposerNamedAgents.js.map +1 -0
  442. package/dist/composer/attached-references.cjs +159 -0
  443. package/dist/composer/attached-references.cjs.map +1 -0
  444. package/dist/composer/attached-references.d.ts +86 -0
  445. package/dist/composer/attached-references.js +159 -0
  446. package/dist/composer/attached-references.js.map +1 -0
  447. package/dist/composer/build-composed-message.cjs +14 -7
  448. package/dist/composer/build-composed-message.cjs.map +1 -1
  449. package/dist/composer/build-composed-message.d.ts +6 -1
  450. package/dist/composer/build-composed-message.js +14 -7
  451. package/dist/composer/build-composed-message.js.map +1 -1
  452. package/dist/composer/composer-handoff.cjs +6 -2
  453. package/dist/composer/composer-handoff.cjs.map +1 -1
  454. package/dist/composer/composer-handoff.d.ts +7 -1
  455. package/dist/composer/composer-handoff.js +6 -2
  456. package/dist/composer/composer-handoff.js.map +1 -1
  457. package/dist/composer/folder-upload.cjs +149 -0
  458. package/dist/composer/folder-upload.cjs.map +1 -0
  459. package/dist/composer/folder-upload.d.ts +79 -0
  460. package/dist/composer/folder-upload.js +149 -0
  461. package/dist/composer/folder-upload.js.map +1 -0
  462. package/dist/composer/index.d.ts +1 -1
  463. package/dist/composer/useAttachToChat.cjs +35 -0
  464. package/dist/composer/useAttachToChat.cjs.map +1 -0
  465. package/dist/composer/useAttachToChat.d.ts +54 -0
  466. package/dist/composer/useAttachToChat.js +35 -0
  467. package/dist/composer/useAttachToChat.js.map +1 -0
  468. package/dist/composer/useAttachedReferencesComposerProps.cjs +19 -0
  469. package/dist/composer/useAttachedReferencesComposerProps.cjs.map +1 -0
  470. package/dist/composer/useAttachedReferencesComposerProps.d.ts +12 -0
  471. package/dist/composer/useAttachedReferencesComposerProps.js +19 -0
  472. package/dist/composer/useAttachedReferencesComposerProps.js.map +1 -0
  473. package/dist/composer/useFileUpload.cjs +95 -7
  474. package/dist/composer/useFileUpload.cjs.map +1 -1
  475. package/dist/composer/useFileUpload.d.ts +21 -2
  476. package/dist/composer/useFileUpload.js +95 -7
  477. package/dist/composer/useFileUpload.js.map +1 -1
  478. package/dist/data/athena-api-error.cjs +125 -0
  479. package/dist/data/athena-api-error.cjs.map +1 -0
  480. package/dist/data/athena-api-error.d.ts +96 -0
  481. package/dist/data/athena-api-error.js +125 -0
  482. package/dist/data/athena-api-error.js.map +1 -0
  483. package/dist/data/athena-data-client.cjs +106 -0
  484. package/dist/data/athena-data-client.cjs.map +1 -0
  485. package/dist/data/athena-data-client.d.ts +74 -0
  486. package/dist/data/athena-data-client.js +106 -0
  487. package/dist/data/athena-data-client.js.map +1 -0
  488. package/dist/data/athena-member.cjs +93 -0
  489. package/dist/data/athena-member.cjs.map +1 -0
  490. package/dist/data/athena-member.d.ts +125 -0
  491. package/dist/data/athena-member.js +93 -0
  492. package/dist/data/athena-member.js.map +1 -0
  493. package/dist/data/athena-request.cjs +458 -0
  494. package/dist/data/athena-request.cjs.map +1 -0
  495. package/dist/data/athena-request.d.ts +120 -0
  496. package/dist/data/athena-request.js +458 -0
  497. package/dist/data/athena-request.js.map +1 -0
  498. package/dist/data/use-athena-fetch.cjs +14 -0
  499. package/dist/data/use-athena-fetch.cjs.map +1 -0
  500. package/dist/data/use-athena-fetch.d.ts +19 -0
  501. package/dist/data/use-athena-fetch.js +14 -0
  502. package/dist/data/use-athena-fetch.js.map +1 -0
  503. package/dist/data/use-athena-graphql.cjs +66 -0
  504. package/dist/data/use-athena-graphql.cjs.map +1 -0
  505. package/dist/data/use-athena-graphql.d.ts +56 -0
  506. package/dist/data/use-athena-graphql.js +66 -0
  507. package/dist/data/use-athena-graphql.js.map +1 -0
  508. package/dist/data/use-athena-rest.cjs +33 -0
  509. package/dist/data/use-athena-rest.cjs.map +1 -0
  510. package/dist/data/use-athena-rest.d.ts +21 -0
  511. package/dist/data/use-athena-rest.js +33 -0
  512. package/dist/data/use-athena-rest.js.map +1 -0
  513. package/dist/data/use-semantic-query.cjs +44 -0
  514. package/dist/data/use-semantic-query.cjs.map +1 -0
  515. package/dist/data/use-semantic-query.d.ts +92 -0
  516. package/dist/data/use-semantic-query.js +44 -0
  517. package/dist/data/use-semantic-query.js.map +1 -0
  518. package/dist/diagnostics/athena-diagnostics.cjs.map +1 -1
  519. package/dist/diagnostics/athena-diagnostics.d.ts +5 -1
  520. package/dist/diagnostics/athena-diagnostics.js.map +1 -1
  521. package/dist/diagnostics/errors.cjs +7 -0
  522. package/dist/diagnostics/errors.cjs.map +1 -1
  523. package/dist/diagnostics/errors.d.ts +7 -0
  524. package/dist/diagnostics/errors.js +7 -0
  525. package/dist/diagnostics/errors.js.map +1 -1
  526. package/dist/index.cjs +155 -11
  527. package/dist/index.cjs.map +1 -1
  528. package/dist/index.d.ts +72 -13
  529. package/dist/index.js +148 -4
  530. package/dist/index.js.map +1 -1
  531. package/dist/keryx-http/src/initial-sync.cjs +64 -16
  532. package/dist/keryx-http/src/initial-sync.cjs.map +1 -1
  533. package/dist/keryx-http/src/initial-sync.d.ts +31 -1
  534. package/dist/keryx-http/src/initial-sync.js +64 -16
  535. package/dist/keryx-http/src/initial-sync.js.map +1 -1
  536. package/dist/keryx-http/src/own-awareness.cjs +20 -0
  537. package/dist/keryx-http/src/own-awareness.cjs.map +1 -0
  538. package/dist/keryx-http/src/own-awareness.d.ts +50 -0
  539. package/dist/keryx-http/src/own-awareness.js +20 -0
  540. package/dist/keryx-http/src/own-awareness.js.map +1 -0
  541. package/dist/keryx-http/src/update-attributions.cjs +26 -1
  542. package/dist/keryx-http/src/update-attributions.cjs.map +1 -1
  543. package/dist/keryx-http/src/update-attributions.d.ts +10 -1
  544. package/dist/keryx-http/src/update-attributions.js +26 -1
  545. package/dist/keryx-http/src/update-attributions.js.map +1 -1
  546. package/dist/offline/chat-outbox.cjs +262 -26
  547. package/dist/offline/chat-outbox.cjs.map +1 -1
  548. package/dist/offline/chat-outbox.d.ts +90 -12
  549. package/dist/offline/chat-outbox.js +263 -27
  550. package/dist/offline/chat-outbox.js.map +1 -1
  551. package/dist/provider/AthenaProvider.cjs +63 -19
  552. package/dist/provider/AthenaProvider.cjs.map +1 -1
  553. package/dist/provider/AthenaProvider.d.ts +24 -8
  554. package/dist/provider/AthenaProvider.js +66 -22
  555. package/dist/provider/AthenaProvider.js.map +1 -1
  556. package/dist/react/package.json.cjs +1 -1
  557. package/dist/react/package.json.js +1 -1
  558. package/dist/references/src/anchors/types.cjs +5 -0
  559. package/dist/references/src/anchors/types.cjs.map +1 -1
  560. package/dist/references/src/anchors/types.js +5 -0
  561. package/dist/references/src/anchors/types.js.map +1 -1
  562. package/dist/references/src/attachable.cjs +149 -0
  563. package/dist/references/src/attachable.cjs.map +1 -0
  564. package/dist/references/src/attachable.d.ts +87 -0
  565. package/dist/references/src/attachable.js +149 -0
  566. package/dist/references/src/attachable.js.map +1 -0
  567. package/dist/runtime/StatewirePlanModeLaneSync.cjs +93 -0
  568. package/dist/runtime/StatewirePlanModeLaneSync.cjs.map +1 -0
  569. package/dist/runtime/StatewirePlanModeLaneSync.d.ts +34 -0
  570. package/dist/runtime/StatewirePlanModeLaneSync.js +93 -0
  571. package/dist/runtime/StatewirePlanModeLaneSync.js.map +1 -0
  572. package/dist/runtime/StatewireThreadConfigLaneSync.cjs +2 -0
  573. package/dist/runtime/StatewireThreadConfigLaneSync.cjs.map +1 -1
  574. package/dist/runtime/StatewireThreadConfigLaneSync.d.ts +4 -0
  575. package/dist/runtime/StatewireThreadConfigLaneSync.js +2 -0
  576. package/dist/runtime/StatewireThreadConfigLaneSync.js.map +1 -1
  577. package/dist/runtime/statewire-plan-mode.cjs +71 -0
  578. package/dist/runtime/statewire-plan-mode.cjs.map +1 -0
  579. package/dist/runtime/statewire-plan-mode.d.ts +88 -0
  580. package/dist/runtime/statewire-plan-mode.js +71 -0
  581. package/dist/runtime/statewire-plan-mode.js.map +1 -0
  582. package/dist/runtime/statewire-run-config.cjs +18 -1
  583. package/dist/runtime/statewire-run-config.cjs.map +1 -1
  584. package/dist/runtime/statewire-run-config.d.ts +20 -0
  585. package/dist/runtime/statewire-run-config.js +18 -1
  586. package/dist/runtime/statewire-run-config.js.map +1 -1
  587. package/dist/runtime/statewire-session-key.cjs +11 -5
  588. package/dist/runtime/statewire-session-key.cjs.map +1 -1
  589. package/dist/runtime/statewire-session-key.d.ts +22 -10
  590. package/dist/runtime/statewire-session-key.js +11 -5
  591. package/dist/runtime/statewire-session-key.js.map +1 -1
  592. package/dist/runtime/useAthenaStatewireRuntime.cjs +65 -8
  593. package/dist/runtime/useAthenaStatewireRuntime.cjs.map +1 -1
  594. package/dist/runtime/useAthenaStatewireRuntime.d.ts +26 -10
  595. package/dist/runtime/useAthenaStatewireRuntime.js +67 -10
  596. package/dist/runtime/useAthenaStatewireRuntime.js.map +1 -1
  597. package/dist/search/useAthenaAssets.cjs +394 -0
  598. package/dist/search/useAthenaAssets.cjs.map +1 -0
  599. package/dist/search/useAthenaAssets.d.ts +186 -0
  600. package/dist/search/useAthenaAssets.js +394 -0
  601. package/dist/search/useAthenaAssets.js.map +1 -0
  602. package/dist/sheet-range/index.cjs +4 -0
  603. package/dist/sheet-range/index.cjs.map +1 -1
  604. package/dist/sheet-range/index.d.ts +4 -2
  605. package/dist/sheet-range/index.js +4 -0
  606. package/dist/sheet-range/index.js.map +1 -1
  607. package/dist/sheet-range/query-range.cjs +102 -0
  608. package/dist/sheet-range/query-range.cjs.map +1 -0
  609. package/dist/sheet-range/query-range.d.ts +46 -0
  610. package/dist/sheet-range/query-range.js +102 -0
  611. package/dist/sheet-range/query-range.js.map +1 -0
  612. package/dist/styles.css +1 -1
  613. package/dist/subagents/index.cjs +49 -0
  614. package/dist/subagents/index.cjs.map +1 -0
  615. package/dist/subagents/index.d.ts +16 -0
  616. package/dist/subagents/index.js +49 -0
  617. package/dist/subagents/index.js.map +1 -0
  618. package/dist/subagents/lane-follow.cjs +19 -0
  619. package/dist/subagents/lane-follow.cjs.map +1 -0
  620. package/dist/subagents/lane-follow.d.ts +9 -0
  621. package/dist/subagents/lane-follow.js +19 -0
  622. package/dist/subagents/lane-follow.js.map +1 -0
  623. package/dist/subagents/lane-model.cjs +178 -0
  624. package/dist/subagents/lane-model.cjs.map +1 -0
  625. package/dist/subagents/lane-model.d.ts +140 -0
  626. package/dist/subagents/lane-model.js +178 -0
  627. package/dist/subagents/lane-model.js.map +1 -0
  628. package/dist/subagents/lane-parts.cjs +517 -0
  629. package/dist/subagents/lane-parts.cjs.map +1 -0
  630. package/dist/subagents/lane-parts.d.ts +130 -0
  631. package/dist/subagents/lane-parts.js +517 -0
  632. package/dist/subagents/lane-parts.js.map +1 -0
  633. package/dist/subagents/subagent-lane-group.cjs +215 -0
  634. package/dist/subagents/subagent-lane-group.cjs.map +1 -0
  635. package/dist/subagents/subagent-lane-group.d.ts +67 -0
  636. package/dist/subagents/subagent-lane-group.js +215 -0
  637. package/dist/subagents/subagent-lane-group.js.map +1 -0
  638. package/dist/subagents/subagent-transcript-drawer.cjs +431 -0
  639. package/dist/subagents/subagent-transcript-drawer.cjs.map +1 -0
  640. package/dist/subagents/subagent-transcript-drawer.d.ts +78 -0
  641. package/dist/subagents/subagent-transcript-drawer.js +431 -0
  642. package/dist/subagents/subagent-transcript-drawer.js.map +1 -0
  643. package/dist/subagents/task-subagent-group.cjs +115 -0
  644. package/dist/subagents/task-subagent-group.cjs.map +1 -0
  645. package/dist/subagents/task-subagent-group.d.ts +36 -0
  646. package/dist/subagents/task-subagent-group.js +115 -0
  647. package/dist/subagents/task-subagent-group.js.map +1 -0
  648. package/dist/subagents/use-omitted-images-in-view.cjs +68 -0
  649. package/dist/subagents/use-omitted-images-in-view.cjs.map +1 -0
  650. package/dist/subagents/use-omitted-images-in-view.d.ts +21 -0
  651. package/dist/subagents/use-omitted-images-in-view.js +68 -0
  652. package/dist/subagents/use-omitted-images-in-view.js.map +1 -0
  653. package/dist/threads/Inbox.cjs +2 -2
  654. package/dist/threads/Inbox.cjs.map +1 -1
  655. package/dist/threads/SessionList.cjs +27 -24
  656. package/dist/threads/SessionList.cjs.map +1 -1
  657. package/dist/threads/SessionList.js +22 -19
  658. package/dist/threads/SessionList.js.map +1 -1
  659. package/dist/threads/SessionsPage.cjs +13 -7
  660. package/dist/threads/SessionsPage.cjs.map +1 -1
  661. package/dist/threads/SessionsPage.d.ts +10 -1
  662. package/dist/threads/SessionsPage.js +9 -3
  663. package/dist/threads/SessionsPage.js.map +1 -1
  664. package/dist/threads/live-session-rows.cjs +207 -0
  665. package/dist/threads/live-session-rows.cjs.map +1 -0
  666. package/dist/threads/live-session-rows.d.ts +175 -0
  667. package/dist/threads/live-session-rows.js +207 -0
  668. package/dist/threads/live-session-rows.js.map +1 -0
  669. package/dist/threads/session-list-model.cjs.map +1 -1
  670. package/dist/threads/session-list-model.d.ts +2 -1
  671. package/dist/threads/session-list-model.js.map +1 -1
  672. package/dist/threads/session-row-parts.cjs +3 -3
  673. package/dist/threads/session-row-parts.cjs.map +1 -1
  674. package/dist/threads/sessions-page-model.cjs +13 -5
  675. package/dist/threads/sessions-page-model.cjs.map +1 -1
  676. package/dist/threads/sessions-page-model.d.ts +7 -0
  677. package/dist/threads/sessions-page-model.js +11 -3
  678. package/dist/threads/sessions-page-model.js.map +1 -1
  679. package/dist/threads/sessions-page-storage.cjs +8 -8
  680. package/dist/threads/sessions-page-storage.cjs.map +1 -1
  681. package/dist/threads/sessions-page-storage.d.ts +5 -1
  682. package/dist/threads/sessions-page-storage.js +8 -8
  683. package/dist/threads/sessions-page-storage.js.map +1 -1
  684. package/dist/threads/statewire-thread-list.cjs +173 -20
  685. package/dist/threads/statewire-thread-list.cjs.map +1 -1
  686. package/dist/threads/statewire-thread-list.d.ts +44 -1
  687. package/dist/threads/statewire-thread-list.js +174 -21
  688. package/dist/threads/statewire-thread-list.js.map +1 -1
  689. package/dist/threads/use-athena-sessions.cjs +1 -0
  690. package/dist/threads/use-athena-sessions.cjs.map +1 -1
  691. package/dist/threads/use-athena-sessions.d.ts +7 -0
  692. package/dist/threads/use-athena-sessions.js +1 -0
  693. package/dist/threads/use-athena-sessions.js.map +1 -1
  694. package/dist/threads/use-athena-thread-agent.cjs +31 -0
  695. package/dist/threads/use-athena-thread-agent.cjs.map +1 -0
  696. package/dist/threads/use-athena-thread-agent.d.ts +38 -0
  697. package/dist/threads/use-athena-thread-agent.js +31 -0
  698. package/dist/threads/use-athena-thread-agent.js.map +1 -0
  699. package/dist/threads/use-athena-thread-plan-mode.cjs +18 -0
  700. package/dist/threads/use-athena-thread-plan-mode.cjs.map +1 -0
  701. package/dist/threads/use-athena-thread-plan-mode.d.ts +18 -0
  702. package/dist/threads/use-athena-thread-plan-mode.js +18 -0
  703. package/dist/threads/use-athena-thread-plan-mode.js.map +1 -0
  704. package/dist/threads/use-rest-conversation-history.d.ts +1 -0
  705. package/dist/tools/agent-creations.cjs +97 -0
  706. package/dist/tools/agent-creations.cjs.map +1 -0
  707. package/dist/tools/agent-creations.d.ts +38 -0
  708. package/dist/tools/agent-creations.js +97 -0
  709. package/dist/tools/agent-creations.js.map +1 -0
  710. package/dist/tools/agent-highlights.cjs +100 -0
  711. package/dist/tools/agent-highlights.cjs.map +1 -0
  712. package/dist/tools/agent-highlights.d.ts +57 -0
  713. package/dist/tools/agent-highlights.js +100 -0
  714. package/dist/tools/agent-highlights.js.map +1 -0
  715. package/dist/tools/append-document-tool-ui.cjs +1 -0
  716. package/dist/tools/append-document-tool-ui.cjs.map +1 -1
  717. package/dist/tools/append-document-tool-ui.d.ts +7 -0
  718. package/dist/tools/append-document-tool-ui.js +2 -1
  719. package/dist/tools/append-document-tool-ui.js.map +1 -1
  720. package/dist/tools/auto-open-tools.cjs +144 -71
  721. package/dist/tools/auto-open-tools.cjs.map +1 -1
  722. package/dist/tools/auto-open-tools.d.ts +131 -1
  723. package/dist/tools/auto-open-tools.js +145 -72
  724. package/dist/tools/auto-open-tools.js.map +1 -1
  725. package/dist/tools/browser-tool-uis.cjs +594 -0
  726. package/dist/tools/browser-tool-uis.cjs.map +1 -0
  727. package/dist/tools/browser-tool-uis.d.ts +8 -0
  728. package/dist/tools/browser-tool-uis.js +594 -0
  729. package/dist/tools/browser-tool-uis.js.map +1 -0
  730. package/dist/tools/computer-asset-tool-uis.cjs +313 -0
  731. package/dist/tools/computer-asset-tool-uis.cjs.map +1 -0
  732. package/dist/tools/computer-asset-tool-uis.d.ts +5 -0
  733. package/dist/tools/computer-asset-tool-uis.js +313 -0
  734. package/dist/tools/computer-asset-tool-uis.js.map +1 -0
  735. package/dist/tools/document-edit-tool-uis.cjs +218 -0
  736. package/dist/tools/document-edit-tool-uis.cjs.map +1 -0
  737. package/dist/tools/document-edit-tool-uis.d.ts +40 -0
  738. package/dist/tools/document-edit-tool-uis.js +218 -0
  739. package/dist/tools/document-edit-tool-uis.js.map +1 -0
  740. package/dist/tools/drive-tool-uis.cjs +425 -0
  741. package/dist/tools/drive-tool-uis.cjs.map +1 -0
  742. package/dist/tools/drive-tool-uis.d.ts +120 -0
  743. package/dist/tools/drive-tool-uis.js +425 -0
  744. package/dist/tools/drive-tool-uis.js.map +1 -0
  745. package/dist/tools/email-calendar-tool-uis.cjs +789 -0
  746. package/dist/tools/email-calendar-tool-uis.cjs.map +1 -0
  747. package/dist/tools/email-calendar-tool-uis.d.ts +129 -0
  748. package/dist/tools/email-calendar-tool-uis.js +789 -0
  749. package/dist/tools/email-calendar-tool-uis.js.map +1 -0
  750. package/dist/tools/ontology-tool-uis.cjs +83 -0
  751. package/dist/tools/ontology-tool-uis.cjs.map +1 -0
  752. package/dist/tools/ontology-tool-uis.d.ts +9 -0
  753. package/dist/tools/ontology-tool-uis.js +83 -0
  754. package/dist/tools/ontology-tool-uis.js.map +1 -0
  755. package/dist/tools/orchestration-tool-uis.cjs +586 -0
  756. package/dist/tools/orchestration-tool-uis.cjs.map +1 -0
  757. package/dist/tools/orchestration-tool-uis.d.ts +141 -0
  758. package/dist/tools/orchestration-tool-uis.js +586 -0
  759. package/dist/tools/orchestration-tool-uis.js.map +1 -0
  760. package/dist/tools/presentation-edit-tool-uis.cjs +516 -0
  761. package/dist/tools/presentation-edit-tool-uis.cjs.map +1 -0
  762. package/dist/tools/presentation-edit-tool-uis.d.ts +73 -0
  763. package/dist/tools/presentation-edit-tool-uis.js +516 -0
  764. package/dist/tools/presentation-edit-tool-uis.js.map +1 -0
  765. package/dist/tools/project-tool-uis.cjs +213 -0
  766. package/dist/tools/project-tool-uis.cjs.map +1 -0
  767. package/dist/tools/project-tool-uis.d.ts +14 -0
  768. package/dist/tools/project-tool-uis.js +213 -0
  769. package/dist/tools/project-tool-uis.js.map +1 -0
  770. package/dist/tools/sandbox-tool-uis.cjs +491 -0
  771. package/dist/tools/sandbox-tool-uis.cjs.map +1 -0
  772. package/dist/tools/sandbox-tool-uis.d.ts +116 -0
  773. package/dist/tools/sandbox-tool-uis.js +491 -0
  774. package/dist/tools/sandbox-tool-uis.js.map +1 -0
  775. package/dist/tools/sheet-query-tool-ui.cjs +138 -0
  776. package/dist/tools/sheet-query-tool-ui.cjs.map +1 -0
  777. package/dist/tools/sheet-query-tool-ui.d.ts +15 -0
  778. package/dist/tools/sheet-query-tool-ui.js +138 -0
  779. package/dist/tools/sheet-query-tool-ui.js.map +1 -0
  780. package/dist/tools/studio-screenshot-tool-uis.cjs +262 -0
  781. package/dist/tools/studio-screenshot-tool-uis.cjs.map +1 -0
  782. package/dist/tools/studio-screenshot-tool-uis.d.ts +52 -0
  783. package/dist/tools/studio-screenshot-tool-uis.js +262 -0
  784. package/dist/tools/studio-screenshot-tool-uis.js.map +1 -0
  785. package/dist/tools/subagent-task-tool-ui.cjs +24 -475
  786. package/dist/tools/subagent-task-tool-ui.cjs.map +1 -1
  787. package/dist/tools/subagent-task-tool-ui.d.ts +19 -103
  788. package/dist/tools/subagent-task-tool-ui.js +28 -479
  789. package/dist/tools/subagent-task-tool-ui.js.map +1 -1
  790. package/dist/tools/tool-summary.cjs +36 -0
  791. package/dist/tools/tool-summary.cjs.map +1 -1
  792. package/dist/tools/tool-summary.js +36 -0
  793. package/dist/tools/tool-summary.js.map +1 -1
  794. package/dist/tools/tool-uis.cjs +181 -53
  795. package/dist/tools/tool-uis.cjs.map +1 -1
  796. package/dist/tools/tool-uis.d.ts +40 -0
  797. package/dist/tools/tool-uis.js +183 -55
  798. package/dist/tools/tool-uis.js.map +1 -1
  799. package/dist/typed-interrupts/index.cjs +15 -0
  800. package/dist/typed-interrupts/index.cjs.map +1 -0
  801. package/dist/typed-interrupts/index.d.ts +20 -0
  802. package/dist/typed-interrupts/index.js +15 -0
  803. package/dist/typed-interrupts/index.js.map +1 -0
  804. package/dist/workbench/session-workbench-panes.cjs +6 -6
  805. package/dist/workbench/session-workbench-panes.cjs.map +1 -1
  806. package/package.json +28 -6
  807. package/dist/agent-runtime/src/chat-outbox-store.cjs +0 -510
  808. package/dist/agent-runtime/src/chat-outbox-store.cjs.map +0 -1
  809. package/dist/agent-runtime/src/chat-outbox-store.d.ts +0 -210
  810. package/dist/agent-runtime/src/chat-outbox-store.js +0 -510
  811. package/dist/agent-runtime/src/chat-outbox-store.js.map +0 -1
@@ -8,8 +8,8 @@ const require$$0 = require("react");
8
8
  const button = require("../ui/button.cjs");
9
9
  const useStatewireApprovalRequest = require("./use-statewire-approval-request.cjs");
10
10
  const threadExtras = require("../agent-runtime/src/thread-extras.cjs");
11
- const errors = require("../agent-runtime/src/errors.cjs");
12
11
  const interrupts = require("../agent-runtime/src/interrupts.cjs");
12
+ const errors = require("../agent-runtime/src/errors.cjs");
13
13
  const cnfast = require("cnfast");
14
14
  function answerApproves(answer) {
15
15
  if (answer.kind === "input") return interrupts.resumeValueApproves(answer.value);
@@ -20,7 +20,29 @@ const NO_HOST_QUEUED_LANE_DECISIONS = Object.freeze({});
20
20
  const StatewireApprovalCard = (props) => {
21
21
  const extras = react.useAuiState((s) => s.thread.extras);
22
22
  if (!threadExtras.hasStatewireThreadExtras(extras)) return null;
23
- return /* @__PURE__ */ jsxRuntime.jsx(StatewireApprovalCardInner, { ...props });
23
+ const { typedInterrupts } = props;
24
+ if (!typedInterrupts) return /* @__PURE__ */ jsxRuntime.jsx(StatewireApprovalCardInner, { ...props });
25
+ const {
26
+ classNames,
27
+ readOnly,
28
+ readOnlyNotice,
29
+ isHandledElsewhere,
30
+ confirmDecision,
31
+ onResumeRejected,
32
+ pendingResumeGraceMs
33
+ } = props;
34
+ return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
35
+ /* @__PURE__ */ jsxRuntime.jsx(StatewireApprovalCardInner, { ...props }),
36
+ typedInterrupts.render({
37
+ ...(classNames == null ? void 0 : classNames.root) ? { classNames: { root: classNames.root } } : {},
38
+ readOnly,
39
+ readOnlyNotice,
40
+ isHandledElsewhere,
41
+ confirmDecision,
42
+ onResumeRejected,
43
+ pendingResumeGraceMs
44
+ })
45
+ ] });
24
46
  };
25
47
  const StatewireApprovalCardInner = ({
26
48
  classNames,
@@ -35,9 +57,15 @@ const StatewireApprovalCardInner = ({
35
57
  readOnlyNotice = "Waiting for someone with edit access to respond.",
36
58
  nonHitlNotice = "This request needs an answer this surface cannot collect.",
37
59
  onResumeRejected,
38
- confirmDecision
60
+ confirmDecision,
61
+ typedInterrupts
39
62
  }) => {
40
63
  var _a, _b, _c;
64
+ const isTypedRequest = typedInterrupts == null ? void 0 : typedInterrupts.isTypedRequest;
65
+ const selectRequest = require$$0.useMemo(() => {
66
+ if (interruptPredicate || !isTypedRequest) return interruptPredicate;
67
+ return (request2) => interrupts.isApprovalCardInterrupt(request2) && !isTypedRequest(request2);
68
+ }, [interruptPredicate, isTypedRequest]);
41
69
  const approvalEpochRef = require$$0.useRef(0);
42
70
  const [decisionFailure, setDecisionFailure] = require$$0.useState();
43
71
  const reportResumeRejected = require$$0.useCallback(
@@ -65,7 +93,7 @@ const StatewireApprovalCardInner = ({
65
93
  sendLaneDecisions,
66
94
  replayQueuedLanes
67
95
  } = useStatewireApprovalRequest.useStatewireApprovalRequest({
68
- interruptPredicate,
96
+ interruptPredicate: selectRequest,
69
97
  pendingResumeGraceMs,
70
98
  onResumeRejected: reportResumeRejected
71
99
  });
@@ -73,6 +101,8 @@ const StatewireApprovalCardInner = ({
73
101
  (state) => interrupts.asHitlApproval(interrupts.interruptMirrorPayload(interrupts.readInterruptMirror(state))) !== null
74
102
  );
75
103
  const approvalPresent = requestId !== void 0 || mirroredApproval;
104
+ const inputRequests = reactStatewire.useStatewireRuns().inputRequests;
105
+ const typedParkPending = isTypedRequest !== void 0 && ((inputRequests == null ? void 0 : inputRequests.some((pendingRequest) => isTypedRequest(pendingRequest))) ?? false);
76
106
  const previousApprovalPresentRef = require$$0.useRef(approvalPresent);
77
107
  if (previousApprovalPresentRef.current && !approvalPresent) approvalEpochRef.current += 1;
78
108
  previousApprovalPresentRef.current = approvalPresent;
@@ -253,7 +283,7 @@ const StatewireApprovalCardInner = ({
253
283
  };
254
284
  }, [actionRequests, positional, requestId, resume, withDecisionCheck]);
255
285
  if (!request && !isLive) {
256
- if (!abandonedInterrupt || abandonedInterrupt.id === dismissedId) return null;
286
+ if (!abandonedInterrupt || abandonedInterrupt.id === dismissedId || typedParkPending) return null;
257
287
  return /* @__PURE__ */ jsxRuntime.jsxs(
258
288
  "div",
259
289
  {
@@ -1 +1 @@
1
- {"version":3,"file":"StatewireApprovalCard.cjs","sources":["../../src/chat/StatewireApprovalCard.tsx"],"sourcesContent":["import { useAuiState } from '@assistant-ui/react';\nimport { type StatewireThread, useStatewireState } from '@assistant-ui/react-statewire';\nimport {\n actionRequestToolCallIds,\n asHitlApproval,\n fanLaneDecision,\n HITL_PENDING_RESUME_GRACE_MS,\n type HitlActionDecision,\n type HitlApprovalPayload,\n hasStatewireThreadExtras,\n hitlResumeActionDecisions,\n hitlResumeApprove,\n hitlResumeApproveForSession,\n hitlResumeReject,\n interruptResumeDecline,\n interruptMirrorPayload,\n laneInterruptIds,\n type PendingActionRequest,\n type PendingApprovalContext,\n type PendingApprovalTitle,\n pendingApprovalTitle,\n readInterruptMessage,\n readInterruptMirror,\n type ResumeExtras,\n resumeValueApproves,\n sessionApprovalLabel,\n sessionApprovalOffer,\n statewireRejectionDetailMessage,\n} from '@athenaintel/agent-runtime';\nimport {\n CheckCheckIcon,\n CheckIcon,\n ChevronDownIcon,\n ShieldAlertIcon,\n XIcon,\n} from 'lucide-react';\nimport {\n type FC,\n type ReactNode,\n useCallback,\n useEffect,\n useMemo,\n useRef,\n useState,\n} from 'react';\nimport { cn } from '../lib/utils';\nimport { Button } from '../ui/button';\nimport {\n type StatewireInterruptPredicate,\n useStatewireApprovalRequest,\n} from './use-statewire-approval-request';\n\n/**\n * Human-in-the-loop approval card for the statewire transport — the one\n * approval UI every Athena chat surface mounts (the SDK's `AthenaChat`, the\n * Chrome side panel, the Office task pane, Olympus).\n *\n * When the deep-agent runtime hits an approval-gated tool call, the backend\n * parks the run on an `interrupt` input request. This card reads that request\n * through `useStatewireApprovalRequest` and answers it with\n * `{ type: 'run/input', requestId, response: { type: 'resume', value } }` —\n * the exact command the backend's resume path consumes. Without an answer the\n * run stays parked forever, so this card must be mounted on every statewire\n * chat surface. On legacy (non-statewire) threads it renders nothing.\n *\n * A gated call raised inside a delegated subagent parks only its lane: the\n * host mirrors that interrupt while the sibling lanes keep streaming, before\n * any input request exists. The card renders the mirrored payload the same\n * way and answers it with `run/lane-input` keyed by the lane's langgraph\n * interrupt id (`laneInterruptIds`); the host queues the decision and applies\n * it the moment the run parks, so the approver never waits on the siblings.\n * Once parked, a payload whose calls all carry interrupt ids resumes as a\n * `lane_decisions` map too — one positional `run/input` can only answer the\n * first of several parked lanes.\n *\n * Recovery of a queued decision the host never applies is ordered host\n * first: the host's answerer resumes the park or drops (and flushes) the\n * queue within `QUEUED_LANE_ANSWER_BUDGET_SECONDS` of the park, and this\n * card's grace (`HITL_PENDING_RESUME_GRACE_MS`, longer than that budget)\n * fires only when the host stayed silent. When it fires, the card that sent\n * the queued decision asks the host to replay it (`run/lane-replay` — the\n * host resumes as the approver, under the meta it recorded, and refuses any\n * other caller); every other card, and a replay the host refuses, hands the\n * decision back to a person by unlocking the actions. A queued decision is\n * never re-sent as a `run/input` of the viewing client's own: that would run\n * the approver's decision under the viewer's identity and configuration.\n *\n * A lone gated call whose resolved envelope (`approval_context`) carries a\n * headline is titled by it in the card's own review: the headline replaces\n * \"`tool` requires approval before it runs\", the summary sits under it, and\n * the default details name the tool instead. A batch keeps the generic copy,\n * since one decision answers every call. So does a host review\n * (`renderDetails`, or an editor from `renderEditor`): it shows the envelope\n * itself, headline included, so the header must not say it again. Display-only:\n * the decision row and what it sends do not change.\n *\n * Host-specific review UIs (subagent cards, email summaries) slot in through\n * `renderDetails`; a host composer that must also OWN the decision (an\n * editable email whose edits have to reach the backend) takes over the\n * details and the decision row through `renderEditor`; requests another\n * surface answers (typed interrupt families, per-lane subagent approvals)\n * stand down through `isHandledElsewhere`; viewers without edit rights see\n * `readOnlyNotice`.\n */\n\n/**\n * The answer a passkey decision check confirms before the card sends it\n * (identity 0b.9): a `run/input` resume of the parked request, or the lane\n * decisions of a `run/lane-input` sent while sibling lanes still stream.\n */\nexport type StatewireDecisionAnswer =\n | {\n readonly kind: 'input';\n readonly requestId: string;\n readonly value: StatewireThread.InputResponse;\n }\n | {\n readonly kind: 'lanes';\n readonly laneDecisions: Readonly<Record<string, StatewireThread.InputResponse>>;\n };\n\n/**\n * Runs the host's passkey check for an approving answer and resolves its\n * token, or `undefined` to send the answer without one. While checks are\n * report-only, an answer goes ahead without a check (no passkey yet, a\n * cancelled prompt); the host decides what to tell the person. Never called\n * for an answer that only rejects.\n */\nexport type StatewireDecisionConfirmer = (\n answer: StatewireDecisionAnswer,\n) => Promise<string | undefined>;\n\nfunction answerApproves(answer: StatewireDecisionAnswer): boolean {\n if (answer.kind === 'input') return resumeValueApproves(answer.value);\n const lanes = Object.values(answer.laneDecisions);\n return lanes.length === 0 || lanes.some(resumeValueApproves);\n}\n\n/** What the card reads in place of the host's queued lanes once it has given up on them. */\nconst NO_HOST_QUEUED_LANE_DECISIONS: Readonly<Record<string, unknown>> = Object.freeze({});\n\n/** The pending request a host slot renders or judges. */\nexport interface StatewireApprovalRequestContext {\n /** The parked input request — `undefined` while the run still streams (a live lane approval). */\n request: StatewireThread.CustomInputRequest | undefined;\n /** The payload narrowed to the Athena HITL approval shape, or `null` for a generic park. */\n hitl: HitlApprovalPayload | null;\n /** Every gated call the approval covers, in decision order (empty for non-HITL parks). */\n actionRequests: PendingActionRequest[];\n /**\n * The approval's title (`pendingApprovalTitle`): a lone call's envelope\n * headline and summary. Absent for a batch, a non-HITL park and a call\n * without one. The default header shows it only above the card's own\n * details; under a host review the host shows the envelope, and may lead\n * with this.\n */\n title?: PendingApprovalTitle;\n}\n\n/** The request a host editor renders, plus the decisions it may send for it. */\nexport interface StatewireApprovalEditorContext extends StatewireApprovalRequestContext {\n /** A decision is in flight (or a live lane already answered); the editor must not send another. */\n locked: boolean;\n /** Whether a session-wide approval may be offered for this batch. */\n sessionApprovalOffered: boolean;\n /**\n * What the session option's button says, naming exactly what the answer\n * covers (`sessionApprovalLabel`): \"Approve all for this session\" for\n * tools, or \"Approve for this session: only kyle@… and sam@…\" for sends\n * scoped to their recipients. Meaningful only when `sessionApprovalOffered`.\n */\n sessionApprovalLabel: string;\n approve: () => void;\n approveForSession: () => void;\n reject: (reason?: string) => void;\n /**\n * Answer each gated call on its own — the only way an EDITED call reaches\n * the backend. `decision` is asked once per call, in order, so the answer\n * always names exactly the parked calls (a partial map is refused\n * server-side and nothing runs). `null` when the batch cannot take\n * per-action answers: a call without a `tool_call_id`, or a live / multi-\n * lane approval, which resumes per lane and carries no edit.\n */\n decideEach: ((decision: (request: PendingActionRequest) => HitlActionDecision) => void) | null;\n}\n\nexport interface StatewireApprovalCardProps {\n /** Surface-styling overrides merged onto the default classes. */\n classNames?: {\n /** The approval card container. */\n root?: string;\n /** The \"approval was cancelled\" notice container. */\n abandoned?: string;\n /** The disclosed details block. */\n details?: string;\n /** The decision row. */\n actions?: string;\n };\n /** Copy shown when an interrupt payload carries no message. */\n fallbackMessage?: string;\n /**\n * Which pending interrupt this card answers. Defaults to\n * `isApprovalCardInterrupt` (client-tool parks excluded — keep it that way\n * unless the surface handles those itself).\n */\n interruptPredicate?: StatewireInterruptPredicate;\n /**\n * How long a clicked decision keeps the buttons locked when no resume run\n * ever starts (a `run/input` the host rejected before any run began).\n * Defaults to `HITL_PENDING_RESUME_GRACE_MS`.\n */\n pendingResumeGraceMs?: number;\n /**\n * Return true when another surface answers this request (a typed Athena\n * interrupt family, per-lane subagent approval cards). The card renders\n * nothing for it — two surfaces must never answer the same input request.\n */\n isHandledElsewhere?: (context: StatewireApprovalRequestContext) => boolean;\n /**\n * Replace the default argument disclosure (one JSON block per gated call)\n * with a host-specific review UI. Rendered inside the collapsible details\n * region; the decision buttons stay with the card.\n */\n renderDetails?: (context: StatewireApprovalRequestContext) => ReactNode;\n /** Replace the default approval icon and heading. Return null to keep it. */\n renderHeader?: (context: StatewireApprovalRequestContext) => ReactNode;\n /**\n * Replace BOTH the details region and the decision row with a host\n * composer that decides the request itself through the context's\n * callbacks (an editable email whose edits must be what runs). Return\n * `null`/`undefined` to keep the default card for this request. Not\n * consulted for read-only viewers or non-HITL parks.\n */\n renderEditor?: (context: StatewireApprovalEditorContext) => ReactNode;\n /**\n * The viewer may see the request (it explains why the run is parked) but\n * cannot decide it — answering steers the shared run. Renders\n * `readOnlyNotice` in place of the buttons.\n */\n readOnly?: boolean;\n readOnlyNotice?: ReactNode;\n /**\n * Copy for a park that is not a HITL approval — a typed Athena interrupt\n * this surface has no card for. The only honest action is to decline it\n * (`{ action: 'reject' }`, which every typed raiser treats as a clean user\n * decline); a generic \"Continue\" would be rejected by the raiser's resume\n * schema and surface as a tool error.\n */\n nonHitlNotice?: ReactNode;\n /**\n * The host refused a decision (or the transport lost it). The optimistic\n * fold has rolled back and the request is on screen again with its actions\n * re-enabled; this is where a host tells the user why (a toast, a log line).\n */\n onResumeRejected?: (error: unknown, requestId: string) => void;\n /**\n * The host's passkey decision check (identity 0b.9). An answer that lets\n * anything run is handed to it first and sent with the token it resolves\n * as `decisionCheck`; the decision buttons stay locked while it runs. An\n * answer that only rejects never is. Omit it and every answer is sent as\n * before, with no check.\n */\n confirmDecision?: StatewireDecisionConfirmer;\n}\n\nexport const StatewireApprovalCard: FC<StatewireApprovalCardProps> = (props) => {\n const extras = useAuiState((s) => s.thread.extras);\n if (!hasStatewireThreadExtras(extras)) return null;\n return <StatewireApprovalCardInner {...props} />;\n};\n\nconst StatewireApprovalCardInner: FC<StatewireApprovalCardProps> = ({\n classNames,\n fallbackMessage,\n interruptPredicate,\n pendingResumeGraceMs,\n isHandledElsewhere,\n renderDetails,\n renderHeader,\n renderEditor,\n readOnly = false,\n readOnlyNotice = 'Waiting for someone with edit access to respond.',\n nonHitlNotice = 'This request needs an answer this surface cannot collect.',\n onResumeRejected,\n confirmDecision,\n}) => {\n const approvalEpochRef = useRef(0);\n const [decisionFailure, setDecisionFailure] = useState<{\n requestId: string;\n message: string;\n epoch: number;\n }>();\n const reportResumeRejected = useCallback(\n (error: unknown, failedRequestId: string) => {\n setDecisionFailure({\n requestId: failedRequestId,\n message: statewireRejectionDetailMessage(error) ?? 'Your decision could not be sent. Try again.',\n epoch: approvalEpochRef.current,\n });\n onResumeRejected?.(error, failedRequestId);\n },\n [onResumeRejected],\n );\n const {\n request,\n requestId,\n hitl: parkedHitl,\n actionRequests: parkedActionRequests,\n liveHitl,\n liveActionRequests,\n queuedLaneDecisions,\n abandonedInterrupt,\n pending,\n resume,\n sendLaneDecisions,\n replayQueuedLanes,\n } = useStatewireApprovalRequest<StatewireThread.InputResponse>({\n interruptPredicate,\n pendingResumeGraceMs,\n onResumeRejected: reportResumeRejected,\n });\n // Read the host mirror: the optimistic resume fold can temporarily hide\n // `liveHitl` and the parked request without ending this approval.\n const mirroredApproval = useStatewireState(\n (state) => asHitlApproval(interruptMirrorPayload(readInterruptMirror(state))) !== null,\n );\n const approvalPresent = requestId !== undefined || mirroredApproval;\n const previousApprovalPresentRef = useRef(approvalPresent);\n if (previousApprovalPresentRef.current && !approvalPresent) approvalEpochRef.current += 1;\n previousApprovalPresentRef.current = approvalPresent;\n const [dismissedId, setDismissedId] = useState<string>();\n // The card shares the chat column with the thread. A lone gated call is\n // small enough to show inline, but a fan-out of a dozen calls would swallow\n // the conversation, so a batch starts collapsed until someone opens it.\n const [detailsOverride, setDetailsOverride] = useState<boolean>();\n // The live lanes a decision was sent for (joined ids); the buttons stay\n // locked until the host echoes them in `queuedLaneDecisions` or refuses.\n const [liveSentKey, setLiveSentKey] = useState<string>();\n // The parked request whose host-queued lanes outlived the grace window\n // (see `queuedLanesAwaitingHost` below): its queue is read as stale.\n const [staleQueuedRequestId, setStaleQueuedRequestId] = useState<string>();\n // The parked request whose queued lanes this card has asked the host to\n // replay (`run/lane-replay` in flight): locked until the host answers.\n const [replayingRequestId, setReplayingRequestId] = useState<string>();\n // The lanes THIS card decided live (its own `run/lane-input` the host\n // accepted). Only a queue this card recorded is replayed from here — the\n // host refuses any other caller, and a second editor's card must not even\n // ask. Pruned to the lanes on screen whenever a different view arrives, so\n // the record survives the live → parked transition of the same lanes (and\n // a fold that briefly shows nothing) and dies with a new request.\n const sentLaneIdsRef = useRef<Set<string>>(new Set());\n // The parked request already replayed once from here: a request is\n // replayed at most once, then the grace hands the decision back.\n const replayedRequestIdRef = useRef<string>(undefined);\n // A passkey check is running for the answer clicked here; the buttons stay\n // locked until it settles.\n const [confirming, setConfirming] = useState(false);\n // The parked request on screen now, read after a check settles: an answer\n // confirmed for a request that is no longer parked is never sent.\n const currentRequestIdRef = useRef(requestId);\n currentRequestIdRef.current = requestId;\n const confirmDecisionRef = useRef(confirmDecision);\n confirmDecisionRef.current = confirmDecision;\n\n const isLive = request === undefined && liveHitl !== null;\n const hitl = isLive ? liveHitl : parkedHitl;\n const actionRequests = isLive ? liveActionRequests : parkedActionRequests;\n const laneIds = laneInterruptIds(actionRequests);\n // The host answers the lanes it queued from its own settle path, within its\n // published budget of the park (`QUEUED_LANE_ANSWER_BUDGET_SECONDS`). A\n // parked request whose queued lanes are still unanswered past the grace\n // window has a silent answerer, and either this card asked the host to\n // replay them and was refused, or the queue is not this card's to replay —\n // so the queue no longer counts as a decision here: the actions re-enable\n // and the next click answers the parked request itself (a resume the host\n // accepts, and whose dispatch drops the stale queue).\n const hostQueuedLaneDecisions =\n requestId !== undefined && staleQueuedRequestId === requestId\n ? NO_HOST_QUEUED_LANE_DECISIONS\n : queuedLaneDecisions;\n const undecidedLaneIds =\n laneIds?.filter((id) => !(id in hostQueuedLaneDecisions)) ?? null;\n // A lone parked lane (or an unstamped batch) answers with one positional\n // `run/input`; that is the only resume the backend binds per-action answers\n // to, so it is the only place an edited call can go.\n const positional = laneIds === null || (!isLive && laneIds.length <= 1);\n const liveKey = isLive ? (laneIds?.join('|') ?? null) : null;\n const viewKey = requestId ?? liveKey ?? undefined;\n\n // A fresh approval gets the default for ITS batch size, not the disclosure\n // the previous one was left in. Reset during render via React's \"previous\n // value\" pattern.\n const prevViewKeyRef = useRef(viewKey);\n if (prevViewKeyRef.current !== viewKey) {\n prevViewKeyRef.current = viewKey;\n if (detailsOverride !== undefined) setDetailsOverride(undefined);\n if (liveSentKey !== undefined) setLiveSentKey(undefined);\n if (laneIds !== null) {\n for (const id of sentLaneIdsRef.current) {\n if (!laneIds.includes(id)) sentLaneIdsRef.current.delete(id);\n }\n }\n }\n // The per-request marks (stale queue, replayed once, replay in flight)\n // outlive the optimistic fold of a click's own `run/input`: the request\n // leaves and comes back under the SAME id when the host refuses it, and a\n // card that forgot its stale mark then would relock over the standing\n // queue for another grace, and could replay it a second time. They are\n // forgotten only for a genuinely different parked request.\n if (\n requestId !== undefined &&\n staleQueuedRequestId !== undefined &&\n requestId !== staleQueuedRequestId\n ) {\n setStaleQueuedRequestId(undefined);\n }\n if (\n requestId !== undefined &&\n replayingRequestId !== undefined &&\n requestId !== replayingRequestId\n ) {\n setReplayingRequestId(undefined);\n }\n if (\n requestId !== undefined &&\n replayedRequestIdRef.current !== undefined &&\n requestId !== replayedRequestIdRef.current\n ) {\n replayedRequestIdRef.current = undefined;\n }\n\n const title = pendingApprovalTitle({ hitl, actionRequests });\n const context: StatewireApprovalRequestContext = {\n request,\n hitl,\n actionRequests,\n ...(title ? { title } : {}),\n };\n const handledElsewhere = isHandledElsewhere?.(context) ?? false;\n const replaying = replayingRequestId !== undefined && replayingRequestId === requestId;\n\n // Parked, every lane the request covers already queued on the host, no\n // resume of our own in flight, and this card is the one that would decide\n // (not a viewer, not a request another surface owns): the host's answerer\n // is expected to resume the run within its budget. Start the clock on it,\n // longer than that budget. When it runs out the host has stayed silent: if\n // this card queued those lanes itself, it asks the host to replay them as\n // their approver (`run/lane-replay`); otherwise — and when the host refuses\n // the replay — the queue no longer counts as a decision here and the actions\n // re-enable, so a person decides. Never a `run/input` of this client's own\n // carrying someone else's recorded decision.\n const queuedLanesAwaitingHost =\n !isLive &&\n !readOnly &&\n !handledElsewhere &&\n requestId !== undefined &&\n undecidedLaneIds !== null &&\n undecidedLaneIds.length === 0 &&\n !pending &&\n !replaying;\n const queuedLaneGraceMs = pendingResumeGraceMs ?? HITL_PENDING_RESUME_GRACE_MS;\n const laneKey = laneIds?.join('|');\n const onResumeRejectedRef = useRef(reportResumeRejected);\n onResumeRejectedRef.current = reportResumeRejected;\n useEffect(() => {\n if (!queuedLanesAwaitingHost || requestId === undefined || laneKey === undefined) {\n return undefined;\n }\n const timer = setTimeout(() => {\n const ownQueue =\n laneKey.split('|').every((id) => sentLaneIdsRef.current.has(id)) &&\n replayedRequestIdRef.current !== requestId;\n if (!ownQueue) {\n setStaleQueuedRequestId(requestId);\n return;\n }\n replayedRequestIdRef.current = requestId;\n setReplayingRequestId(requestId);\n replayQueuedLanes(requestId).then(\n () => {\n setReplayingRequestId((current) => (current === requestId ? undefined : current));\n },\n (error: unknown) => {\n setReplayingRequestId((current) => (current === requestId ? undefined : current));\n setStaleQueuedRequestId(requestId);\n onResumeRejectedRef.current?.(error, requestId);\n },\n );\n }, queuedLaneGraceMs);\n return () => clearTimeout(timer);\n }, [queuedLanesAwaitingHost, requestId, laneKey, queuedLaneGraceMs, replayQueuedLanes]);\n\n /**\n * Send `answer` through `deliver`, with a passkey check first when it\n * approves and the host runs one. The check is the person's own act on\n * their device; while it is open the card is locked, and if the parked\n * request changed meanwhile the confirmed answer is dropped, never sent to\n * whatever parked next.\n */\n const withDecisionCheck = useCallback(\n (answer: StatewireDecisionAnswer, deliver: (extras?: ResumeExtras) => void) => {\n const confirmer = confirmDecisionRef.current;\n if (confirmer === undefined || !answerApproves(answer)) {\n deliver();\n return;\n }\n setConfirming(true);\n confirmer(answer)\n .catch(() => undefined)\n .then((token) => {\n setConfirming(false);\n if (answer.kind === 'input' && currentRequestIdRef.current !== answer.requestId) {\n return;\n }\n deliver(token ? { decisionCheck: token } : undefined);\n });\n },\n [],\n );\n\n // A live lane decision: the host queues it until the run parks, and holds\n // it for this card's caller, the only queue this card may ask it to replay.\n const sendLiveLanes = useCallback(\n ({\n key,\n lanes,\n epoch,\n extras,\n }: {\n key: string;\n lanes: Readonly<Record<string, StatewireThread.InputResponse>>;\n epoch: number;\n extras?: ResumeExtras;\n }) => {\n const sentLaneIds = key.split('|');\n setLiveSentKey(key);\n Promise.resolve(sendLaneDecisions(lanes, extras)).then(\n () => {\n if (epoch !== approvalEpochRef.current) return;\n for (const id of sentLaneIds) sentLaneIdsRef.current.add(id);\n },\n (error: unknown) => {\n if (epoch !== approvalEpochRef.current) return;\n setLiveSentKey((current) => (current === key ? undefined : current));\n reportResumeRejected(error, sentLaneIds[0] ?? '');\n },\n );\n },\n [sendLaneDecisions, reportResumeRejected],\n );\n\n const decide = useCallback(\n (value: Record<string, string>) => {\n setDecisionFailure(undefined);\n const epoch = approvalEpochRef.current;\n // Several parked lanes (or a live one) answer by interrupt id: a\n // positional `run/input` would resume only the first and re-park the\n // rest. A lone parked lane keeps the positional resume every host\n // already speaks.\n if (positional || undecidedLaneIds === null) {\n if (requestId === undefined) return;\n withDecisionCheck({ kind: 'input', requestId, value }, (extras) => {\n resume(value, extras);\n });\n return;\n }\n const lanes = fanLaneDecision({ interruptIds: undecidedLaneIds, decision: value });\n if (!isLive) {\n if (requestId === undefined) return;\n withDecisionCheck(\n { kind: 'input', requestId, value: { lane_decisions: lanes } },\n (extras) => {\n sendLaneDecisions(lanes, extras);\n },\n );\n return;\n }\n const key = undecidedLaneIds.join('|');\n withDecisionCheck({ kind: 'lanes', laneDecisions: lanes }, (extras) =>\n sendLiveLanes({ key, lanes, epoch, extras }),\n );\n },\n [\n positional,\n undecidedLaneIds,\n isLive,\n requestId,\n resume,\n sendLaneDecisions,\n sendLiveLanes,\n withDecisionCheck,\n ],\n );\n\n const decideEach = useMemo<StatewireApprovalEditorContext['decideEach']>(() => {\n if (actionRequestToolCallIds(actionRequests) === null || !positional) return null;\n return (decision) => {\n setDecisionFailure(undefined);\n const decisions: Record<string, HitlActionDecision> = {};\n for (const request of actionRequests) {\n if (request.toolCallId !== undefined) decisions[request.toolCallId] = decision(request);\n }\n // The edited argument set comes from the wire as JSON; the resume value\n // is that JSON going back.\n const value = hitlResumeActionDecisions(decisions) as StatewireThread.InputResponse;\n if (requestId === undefined) return;\n withDecisionCheck({ kind: 'input', requestId, value }, (extras) => {\n resume(value, extras);\n });\n };\n }, [actionRequests, positional, requestId, resume, withDecisionCheck]);\n\n if (!request && !isLive) {\n if (!abandonedInterrupt || abandonedInterrupt.id === dismissedId) return null;\n return (\n <div\n className={cn(\n 'aui-approval-abandoned flex w-full items-center justify-between gap-3 rounded-xl border border-border bg-muted/40 px-3 py-2 text-muted-foreground text-xs',\n classNames?.abandoned,\n )}\n >\n <p>Approval was cancelled — the run moved on.</p>\n <button\n type=\"button\"\n aria-label=\"Dismiss cancelled approval\"\n onClick={() => setDismissedId(abandonedInterrupt.id)}\n className=\"shrink-0 rounded-md p-1 transition-colors hover:bg-muted hover:text-foreground\"\n >\n <XIcon className=\"size-3.5\" />\n </button>\n </div>\n );\n }\n\n if (handledElsewhere) return null;\n // A live mirror without lane stamps cannot be answered before the run\n // parks; the parked request renders it then.\n if (isLive && laneIds === null) return null;\n\n const message = readInterruptMessage(request ? request.payload : liveHitl, fallbackMessage);\n const toolName = hitl?.context?.tool_name ?? hitl?.context?.tool_id;\n const pendingCount = hitl?.context?.pending_action_count ?? 1;\n const hasDetails = hitl !== null && actionRequests.length > 0;\n const showDetails = hasDetails && (detailsOverride ?? actionRequests.length <= 1);\n const sessionOffer = hitl !== null ? sessionApprovalOffer(actionRequests) : undefined;\n const sessionApprovalOffered = sessionOffer !== undefined;\n const sessionLabel = sessionOffer ? sessionApprovalLabel(sessionOffer) : '';\n const laneDecided =\n undecidedLaneIds !== null &&\n laneIds !== null &&\n (undecidedLaneIds.length === 0 || liveSentKey === undecidedLaneIds.join('|'));\n const locked = pending || laneDecided || replaying || confirming;\n\n const editor =\n !readOnly && hitl !== null && renderEditor\n ? renderEditor({\n ...context,\n locked,\n sessionApprovalOffered,\n sessionApprovalLabel: sessionLabel,\n approve: () => decide(hitlResumeApprove()),\n approveForSession: () => decide(hitlResumeApproveForSession()),\n reject: (reason) => decide(hitlResumeReject(reason)),\n decideEach,\n })\n : undefined;\n const customHeader = renderHeader?.(context);\n // Only the card's own review leads with the title: a host's details or\n // editor show the envelope themselves, headline included.\n const headerTitle = renderDetails === undefined && editor == null ? title : undefined;\n\n return (\n <section\n aria-label={hitl ? 'Approval required' : 'Input required'}\n className={cn(\n 'aui-approval-card w-full rounded-2xl border border-border bg-card px-4 py-3 text-foreground shadow-xs',\n classNames?.root,\n )}\n >\n <div className=\"flex items-start gap-3\">\n {customHeader != null ? (\n <div className=\"min-w-0 flex-1\">{customHeader}</div>\n ) : (\n <>\n <ShieldAlertIcon className=\"mt-0.5 size-4 shrink-0 text-muted-foreground\" />\n <div className=\"min-w-0 flex-1\">\n <p className=\"flex items-center gap-2 font-semibold text-sm\">\n <span>{hitl ? 'Approval required' : 'Waiting for input'}</span>\n {hitl && pendingCount > 1 ? (\n <span className=\"shrink-0 rounded-full border border-border bg-muted px-1.5 py-px font-normal text-[11px] text-muted-foreground\">\n {pendingCount} tool calls\n </span>\n ) : null}\n </p>\n {headerTitle ? (\n <>\n <p\n className=\"break-words pt-1 font-medium text-foreground text-sm leading-snug\"\n data-testid=\"statewire-approval-headline\"\n >\n {headerTitle.headline}\n </p>\n {headerTitle.summary ? (\n <p\n className=\"break-words pt-1 text-muted-foreground text-sm leading-snug\"\n data-testid=\"statewire-approval-summary\"\n >\n {headerTitle.summary}\n </p>\n ) : null}\n </>\n ) : (\n <p className=\"pt-1 text-muted-foreground text-sm leading-snug\">\n {hitl && pendingCount === 1 && toolName ? (\n <>\n <span className=\"font-mono text-foreground\">{toolName}</span> requires approval before it runs.\n </>\n ) : (\n message\n )}\n </p>\n )}\n </div>\n </>\n )}\n </div>\n {decisionFailure && decisionFailure.epoch === approvalEpochRef.current &&\n (decisionFailure.requestId === requestId || laneIds?.includes(decisionFailure.requestId)) ? (\n <p role=\"alert\" data-testid=\"statewire-approval-error\">{decisionFailure.message}</p>\n ) : null}\n {isLive ? (\n <p className=\"pt-1 text-muted-foreground text-xs\" data-testid=\"statewire-approval-live\">\n {laneDecided\n ? 'Decision sent — it applies as soon as this step pauses.'\n : 'Other work keeps running while you decide.'}\n </p>\n ) : null}\n {hasDetails && editor == null ? (\n <button\n type=\"button\"\n onClick={() => setDetailsOverride(!showDetails)}\n aria-expanded={showDetails}\n className=\"mt-2 flex items-center gap-1 rounded px-1 py-0.5 text-muted-foreground text-xs transition-colors hover:text-foreground\"\n >\n <ChevronDownIcon\n className={cn('size-3 transition-transform', showDetails && 'rotate-180')}\n />\n {showDetails ? 'Hide details' : 'Review details'}\n </button>\n ) : null}\n {/* EVERY pending gated call renders, in order — one decision\n authorizes the whole batch, so nothing may hide behind a host's\n richer cards. All read-only: this runtime resumes through\n `hitl_response_to_decisions`, which has no `tool_args` channel —\n an editable composer would let someone rewrite an email and then\n watch the original go out — unless the host takes over the\n decision too (`renderEditor`), which sends the edit per call. */}\n {editor != null ? (\n <div className={cn('mt-3 flex flex-col gap-2', classNames?.details)}>{editor}</div>\n ) : showDetails ? (\n <div className={cn('mt-2 flex flex-col gap-2', classNames?.details)}>\n {renderDetails ? (\n renderDetails(context)\n ) : (\n // A titled card no longer names its tool in the header, so its\n // details do, as a batch's do.\n <DefaultApprovalDetails\n actionRequests={actionRequests}\n showNames={actionRequests.length > 1 || headerTitle !== undefined}\n />\n )}\n </div>\n ) : null}\n {editor != null ? null : (\n <div className={cn('flex flex-wrap items-center gap-2 pt-3', classNames?.actions)}>\n {readOnly ? (\n <p className=\"text-muted-foreground text-sm\" data-testid=\"statewire-approval-read-only\">\n {readOnlyNotice}\n </p>\n ) : hitl ? (\n <>\n <Button\n size=\"sm\"\n disabled={locked}\n onClick={() => decide(hitlResumeApprove())}\n >\n <CheckIcon />\n Approve\n </Button>\n {sessionApprovalOffered ? (\n <Button\n size=\"sm\"\n variant=\"outline\"\n disabled={locked}\n onClick={() => decide(hitlResumeApproveForSession())}\n data-testid=\"statewire-approval-approve-session\"\n className=\"h-auto min-h-8 whitespace-normal py-1.5 text-left\"\n >\n <CheckCheckIcon />\n <span className=\"min-w-0 break-words\">{sessionLabel}</span>\n </Button>\n ) : null}\n <Button\n size=\"sm\"\n variant=\"outline\"\n disabled={locked}\n onClick={() => decide(hitlResumeReject())}\n >\n <XIcon />\n Reject\n </Button>\n </>\n ) : (\n <>\n <p className=\"text-muted-foreground text-sm\" data-testid=\"statewire-approval-non-hitl\">\n {nonHitlNotice}\n </p>\n <Button\n size=\"sm\"\n variant=\"outline\"\n disabled={pending}\n onClick={() => resume(interruptResumeDecline())}\n >\n <XIcon />\n Decline\n </Button>\n </>\n )}\n </div>\n )}\n </section>\n );\n};\n\n/**\n * What the backend resolved about a call before asking (where a Slack write\n * goes and as whom, Slack Connect warnings), above its raw arguments. Its\n * headline and summary title the card instead; with nothing else, nothing\n * renders here.\n */\nconst ApprovalContextFacts: FC<{ context: PendingApprovalContext }> = ({ context }) =>\n context.facts.length === 0 && context.warnings.length === 0 ? null : (\n <div className=\"mt-1 space-y-0.5\" data-testid=\"statewire-approval-context\">\n {context.facts.map((fact) => (\n <p key={fact.label}>\n <span className=\"font-semibold\">{fact.label}:</span> {fact.value}\n </p>\n ))}\n {context.warnings.map((warning) => (\n <p\n key={warning.message}\n className={warning.severity === 'info' ? undefined : 'font-semibold'}\n >\n {warning.message}\n </p>\n ))}\n </div>\n );\n\n/**\n * One block per gated call: its name (a batch's, or a titled call's), its\n * resolved facts, and its arguments as JSON.\n */\nconst DefaultApprovalDetails: FC<{ actionRequests: PendingActionRequest[]; showNames: boolean }> = ({\n actionRequests,\n showNames,\n}) => (\n <>\n {actionRequests.map((action, index) => (\n <div\n key={`${action.name}-${index}`}\n className=\"rounded-lg border border-border/60 bg-muted/40 p-2 text-foreground text-xs leading-relaxed\"\n >\n {showNames ? <p className=\"font-mono font-semibold\">{action.name}</p> : null}\n {action.approvalContext ? <ApprovalContextFacts context={action.approvalContext} /> : null}\n {Object.keys(action.args).length > 0 ? (\n <pre className=\"mt-1 max-h-32 overflow-auto whitespace-pre-wrap break-words rounded bg-background p-1.5 font-mono text-[11px]\">\n {JSON.stringify(action.args, null, 2)}\n </pre>\n ) : (\n <p className=\"text-muted-foreground\">No arguments.</p>\n )}\n </div>\n ))}\n </>\n);\n"],"names":["resumeValueApproves","useAuiState","hasStatewireThreadExtras","jsx","useRef","useState","useCallback","statewireRejectionDetailMessage","useStatewireApprovalRequest","useStatewireState","asHitlApproval","interruptMirrorPayload","readInterruptMirror","laneInterruptIds","pendingApprovalTitle","HITL_PENDING_RESUME_GRACE_MS","useEffect","_a","fanLaneDecision","useMemo","actionRequestToolCallIds","request","hitlResumeActionDecisions","jsxs","cn","XIcon","readInterruptMessage","sessionApprovalOffer","sessionApprovalLabel","hitlResumeApprove","hitlResumeApproveForSession","hitlResumeReject","Fragment","ShieldAlertIcon","ChevronDownIcon","Button","CheckIcon","CheckCheckIcon","interruptResumeDecline"],"mappings":";;;;;;;;;;;;;AAoIA,SAAS,eAAe,QAA0C;AAChE,MAAI,OAAO,SAAS,QAAS,QAAOA,WAAAA,oBAAoB,OAAO,KAAK;AACpE,QAAM,QAAQ,OAAO,OAAO,OAAO,aAAa;AAChD,SAAO,MAAM,WAAW,KAAK,MAAM,KAAKA,WAAAA,mBAAmB;AAC7D;AAGA,MAAM,gCAAmE,OAAO,OAAO,EAAE;AA8HlF,MAAM,wBAAwD,CAAC,UAAU;AAC9E,QAAM,SAASC,MAAAA,YAAY,CAAC,MAAM,EAAE,OAAO,MAAM;AACjD,MAAI,CAACC,aAAAA,yBAAyB,MAAM,E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AAK,KAEb,CACD;AAAA,EACA,QAAQ,SAAS,IAAI,CAAC,YACrBpB,2BAAAA;AAAAA,IAAC;AAAA,IAAA;AAAA,MAEC,WAAW,QAAQ,aAAa,SAAS,SAAY;AAAA,MAEpD,UAAA,QAAQ;AAAA,IAAA;AAAA,IAHJ,QAAQ;AAAA,EAAA,CAKhB;AAAA,GACH;AAOJ,MAAM,yBAA6F,CAAC;AAAA,EAClG;AAAA,EACA;AACF,MACEA,2BAAAA,IAAA6B,WAAAA,UAAA,EACG,UAAA,eAAe,IAAI,CAAC,QAAQ,UAC3BT,2BAAAA;AAAAA,EAAC;AAAA,EAAA;AAAA,IAEC,WAAU;AAAA,IAET,UAAA;AAAA,MAAA,2CAAa,KAAA,EAAE,WAAU,2BAA2B,UAAA,OAAO,MAAK,IAAO;AAAA,MACvE,OAAO,kBAAkBpB,2BAAAA,IAAC,wBAAqB,SAAS,OAAO,iBAAiB,IAAK;AAAA,MACrF,OAAO,KAAK,OAAO,IAAI,EAAE,SAAS,IACjCA,2BAAAA,IAAC,OAAA,EAAI,WAAU,iHACZ,eAAK,UAAU,OAAO,MAAM,MAAM,CAAC,EAAA,CACtC,IAEAA,+BAAC,KAAA,EAAE,WAAU,yBAAwB,UAAA,gBAAA,CAAa;AAAA,IAAA;AAAA,EAAA;AAAA,EAV/C,GAAG,OAAO,IAAI,IAAI,KAAK;AAY9B,CACD,GACH;;"}
1
+ {"version":3,"file":"StatewireApprovalCard.cjs","sources":["../../src/chat/StatewireApprovalCard.tsx"],"sourcesContent":["import { useAuiState } from '@assistant-ui/react';\nimport {\n type StatewireThread,\n useStatewireRuns,\n useStatewireState,\n} from '@assistant-ui/react-statewire';\nimport {\n actionRequestToolCallIds,\n asHitlApproval,\n fanLaneDecision,\n HITL_PENDING_RESUME_GRACE_MS,\n type HitlActionDecision,\n type HitlApprovalPayload,\n hasStatewireThreadExtras,\n hitlResumeActionDecisions,\n hitlResumeApprove,\n hitlResumeApproveForSession,\n hitlResumeReject,\n interruptResumeDecline,\n interruptMirrorPayload,\n isApprovalCardInterrupt,\n laneInterruptIds,\n type PendingActionRequest,\n type PendingApprovalContext,\n type PendingApprovalTitle,\n pendingApprovalTitle,\n readInterruptMessage,\n readInterruptMirror,\n type ResumeExtras,\n resumeValueApproves,\n sessionApprovalLabel,\n sessionApprovalOffer,\n statewireRejectionDetailMessage,\n} from '@athenaintel/agent-runtime';\nimport {\n CheckCheckIcon,\n CheckIcon,\n ChevronDownIcon,\n ShieldAlertIcon,\n XIcon,\n} from 'lucide-react';\nimport {\n type FC,\n type ReactNode,\n useCallback,\n useEffect,\n useMemo,\n useRef,\n useState,\n} from 'react';\nimport { cn } from '../lib/utils';\nimport { Button } from '../ui/button';\nimport {\n type StatewireInterruptPredicate,\n useStatewireApprovalRequest,\n} from './use-statewire-approval-request';\n\n/**\n * Human-in-the-loop approval card for the statewire transport — the one\n * approval UI every Athena chat surface mounts (the SDK's `AthenaChat`, the\n * Chrome side panel, the Office task pane, Olympus).\n *\n * When the deep-agent runtime hits an approval-gated tool call, the backend\n * parks the run on an `interrupt` input request. This card reads that request\n * through `useStatewireApprovalRequest` and answers it with\n * `{ type: 'run/input', requestId, response: { type: 'resume', value } }` —\n * the exact command the backend's resume path consumes. Without an answer the\n * run stays parked forever, so this card must be mounted on every statewire\n * chat surface. On legacy (non-statewire) threads it renders nothing.\n *\n * A gated call raised inside a delegated subagent parks only its lane: the\n * host mirrors that interrupt while the sibling lanes keep streaming, before\n * any input request exists. The card renders the mirrored payload the same\n * way and answers it with `run/lane-input` keyed by the lane's langgraph\n * interrupt id (`laneInterruptIds`); the host queues the decision and applies\n * it the moment the run parks, so the approver never waits on the siblings.\n * Once parked, a payload whose calls all carry interrupt ids resumes as a\n * `lane_decisions` map too — one positional `run/input` can only answer the\n * first of several parked lanes.\n *\n * Recovery of a queued decision the host never applies is ordered host\n * first: the host's answerer resumes the park or drops (and flushes) the\n * queue within `QUEUED_LANE_ANSWER_BUDGET_SECONDS` of the park, and this\n * card's grace (`HITL_PENDING_RESUME_GRACE_MS`, longer than that budget)\n * fires only when the host stayed silent. When it fires, the card that sent\n * the queued decision asks the host to replay it (`run/lane-replay` — the\n * host resumes as the approver, under the meta it recorded, and refuses any\n * other caller); every other card, and a replay the host refuses, hands the\n * decision back to a person by unlocking the actions. A queued decision is\n * never re-sent as a `run/input` of the viewing client's own: that would run\n * the approver's decision under the viewer's identity and configuration.\n *\n * A lone gated call whose resolved envelope (`approval_context`) carries a\n * headline is titled by it in the card's own review: the headline replaces\n * \"`tool` requires approval before it runs\", the summary sits under it, and\n * the default details name the tool instead. A batch keeps the generic copy,\n * since one decision answers every call. So does a host review\n * (`renderDetails`, or an editor from `renderEditor`): it shows the envelope\n * itself, headline included, so the header must not say it again. Display-only:\n * the decision row and what it sends do not change.\n *\n * Host-specific review UIs (subagent cards, email summaries) slot in through\n * `renderDetails`; a host composer that must also OWN the decision (an\n * editable email whose edits have to reach the backend) takes over the\n * details and the decision row through `renderEditor`; requests another\n * surface answers (typed interrupt families, per-lane subagent approvals)\n * stand down through `isHandledElsewhere`; viewers without edit rights see\n * `readOnlyNotice`.\n *\n * A run parked on a typed Athena interrupt (the `ask` tool's questions, a\n * file request, a form, toolkits to turn on, a saved login, a schedule, a\n * wait, a tool-raised approval) gets that kind's own card when the host hands\n * one in as `typedInterrupts` (`statewireTypedInterrupts` from\n * `@athenaintel/react/typed-interrupts`, which `AthenaChat` passes): the card\n * answers with the resume shape the raiser validates, under the same props\n * (`isHandledElsewhere` and `readOnly` apply to it, an approve goes through\n * `confirmDecision`, a refusal reaches `onResumeRejected`). Without it, as on\n * a host whose own cards answer typed parks (Olympus), a typed park is\n * answered only with `nonHitlNotice`'s decline, as is any park that is\n * neither.\n */\n\n/**\n * The answer a passkey decision check confirms before the card sends it\n * (identity 0b.9): a `run/input` resume of the parked request, or the lane\n * decisions of a `run/lane-input` sent while sibling lanes still stream.\n */\nexport type StatewireDecisionAnswer =\n | {\n readonly kind: 'input';\n readonly requestId: string;\n readonly value: StatewireThread.InputResponse;\n }\n | {\n readonly kind: 'lanes';\n readonly laneDecisions: Readonly<Record<string, StatewireThread.InputResponse>>;\n };\n\n/**\n * Runs the host's passkey check for an approving answer and resolves its\n * token, or `undefined` to send the answer without one. While checks are\n * report-only, an answer goes ahead without a check (no passkey yet, a\n * cancelled prompt); the host decides what to tell the person. Never called\n * for an answer that only rejects.\n */\nexport type StatewireDecisionConfirmer = (\n answer: StatewireDecisionAnswer,\n) => Promise<string | undefined>;\n\nfunction answerApproves(answer: StatewireDecisionAnswer): boolean {\n if (answer.kind === 'input') return resumeValueApproves(answer.value);\n const lanes = Object.values(answer.laneDecisions);\n return lanes.length === 0 || lanes.some(resumeValueApproves);\n}\n\n/** What the card reads in place of the host's queued lanes once it has given up on them. */\nconst NO_HOST_QUEUED_LANE_DECISIONS: Readonly<Record<string, unknown>> = Object.freeze({});\n\n/** The pending request a host slot renders or judges. */\nexport interface StatewireApprovalRequestContext {\n /** The parked input request — `undefined` while the run still streams (a live lane approval). */\n request: StatewireThread.CustomInputRequest | undefined;\n /** The payload narrowed to the Athena HITL approval shape, or `null` for a generic park. */\n hitl: HitlApprovalPayload | null;\n /** Every gated call the approval covers, in decision order (empty for non-HITL parks). */\n actionRequests: PendingActionRequest[];\n /**\n * The approval's title (`pendingApprovalTitle`): a lone call's envelope\n * headline and summary. Absent for a batch, a non-HITL park and a call\n * without one. The default header shows it only above the card's own\n * details; under a host review the host shows the envelope, and may lead\n * with this.\n */\n title?: PendingApprovalTitle;\n}\n\n/** The request a host editor renders, plus the decisions it may send for it. */\nexport interface StatewireApprovalEditorContext extends StatewireApprovalRequestContext {\n /** A decision is in flight (or a live lane already answered); the editor must not send another. */\n locked: boolean;\n /** Whether a session-wide approval may be offered for this batch. */\n sessionApprovalOffered: boolean;\n /**\n * What the session option's button says, naming exactly what the answer\n * covers (`sessionApprovalLabel`): \"Approve all for this session\" for\n * tools, or \"Approve for this session: only kyle@… and sam@…\" for sends\n * scoped to their recipients. Meaningful only when `sessionApprovalOffered`.\n */\n sessionApprovalLabel: string;\n approve: () => void;\n approveForSession: () => void;\n reject: (reason?: string) => void;\n /**\n * Answer each gated call on its own — the only way an EDITED call reaches\n * the backend. `decision` is asked once per call, in order, so the answer\n * always names exactly the parked calls (a partial map is refused\n * server-side and nothing runs). `null` when the batch cannot take\n * per-action answers: a call without a `tool_call_id`, or a live / multi-\n * lane approval, which resumes per lane and carries no edit.\n */\n decideEach: ((decision: (request: PendingActionRequest) => HitlActionDecision) => void) | null;\n}\n\n/** The approval card's own props it hands the typed card (`StatewireTypedInterruptSeam.render`). */\nexport interface StatewireTypedInterruptCardProps {\n /** Surface-styling override for the card's container. */\n classNames?: { root?: string };\n /** A viewer without edit rights: the park's message and `readOnlyNotice`, no controls. */\n readOnly?: boolean;\n readOnlyNotice?: ReactNode;\n /**\n * Return true when another surface answers this request: the card renders\n * nothing for it, since two surfaces must never answer one request.\n */\n isHandledElsewhere?: (context: StatewireApprovalRequestContext) => boolean;\n /** The host's passkey decision check, for an answer that approves a typed approval. */\n confirmDecision?: StatewireDecisionConfirmer;\n /** The host refused an answer; the card is back with its controls and says why. */\n onResumeRejected?: (error: unknown, requestId: string) => void;\n pendingResumeGraceMs?: number;\n}\n\n/**\n * A card for typed Athena interrupts, handed to `StatewireApprovalCard` as\n * `typedInterrupts`: which parks it answers, and the card. The SDK's is\n * `statewireTypedInterrupts` from `@athenaintel/react/typed-interrupts`.\n */\nexport interface StatewireTypedInterruptSeam {\n /** The parks the typed card answers; the approval card leaves them to it. */\n isTypedRequest: StatewireInterruptPredicate;\n /** The typed card, given the approval card's own props. */\n render: (props: StatewireTypedInterruptCardProps) => ReactNode;\n}\n\nexport interface StatewireApprovalCardProps {\n /** Surface-styling overrides merged onto the default classes. */\n classNames?: {\n /** The approval card container. */\n root?: string;\n /** The \"approval was cancelled\" notice container. */\n abandoned?: string;\n /** The disclosed details block. */\n details?: string;\n /** The decision row. */\n actions?: string;\n };\n /** Copy shown when an interrupt payload carries no message. */\n fallbackMessage?: string;\n /**\n * Which pending interrupt this card answers. Defaults to\n * `isApprovalCardInterrupt` (client-tool parks excluded — keep it that way\n * unless the surface handles those itself).\n */\n interruptPredicate?: StatewireInterruptPredicate;\n /**\n * How long a clicked decision keeps the buttons locked when no resume run\n * ever starts (a `run/input` the host rejected before any run began).\n * Defaults to `HITL_PENDING_RESUME_GRACE_MS`.\n */\n pendingResumeGraceMs?: number;\n /**\n * Return true when another surface answers this request (a typed Athena\n * interrupt family, per-lane subagent approval cards). The card renders\n * nothing for it — two surfaces must never answer the same input request.\n */\n isHandledElsewhere?: (context: StatewireApprovalRequestContext) => boolean;\n /**\n * Replace the default argument disclosure (one JSON block per gated call)\n * with a host-specific review UI. Rendered inside the collapsible details\n * region; the decision buttons stay with the card.\n */\n renderDetails?: (context: StatewireApprovalRequestContext) => ReactNode;\n /** Replace the default approval icon and heading. Return null to keep it. */\n renderHeader?: (context: StatewireApprovalRequestContext) => ReactNode;\n /**\n * Replace BOTH the details region and the decision row with a host\n * composer that decides the request itself through the context's\n * callbacks (an editable email whose edits must be what runs). Return\n * `null`/`undefined` to keep the default card for this request. Not\n * consulted for read-only viewers or non-HITL parks.\n */\n renderEditor?: (context: StatewireApprovalEditorContext) => ReactNode;\n /**\n * The viewer may see the request (it explains why the run is parked) but\n * cannot decide it — answering steers the shared run. Renders\n * `readOnlyNotice` in place of the buttons.\n */\n readOnly?: boolean;\n readOnlyNotice?: ReactNode;\n /**\n * Copy for a park that is not a HITL approval and that no typed card\n * (`typedInterrupts`) answers. The only honest action is to decline it\n * (`{ action: 'reject' }`, which every typed raiser treats as a clean user\n * decline); a generic \"Continue\" would be rejected by the raiser's resume\n * schema and surface as a tool error.\n */\n nonHitlNotice?: ReactNode;\n /**\n * The host refused a decision (or the transport lost it). The optimistic\n * fold has rolled back and the request is on screen again with its actions\n * re-enabled; this is where a host tells the user why (a toast, a log line).\n */\n onResumeRejected?: (error: unknown, requestId: string) => void;\n /**\n * The host's passkey decision check (identity 0b.9). An answer that lets\n * anything run is handed to it first and sent with the token it resolves\n * as `decisionCheck`; the decision buttons stay locked while it runs. An\n * answer that only rejects never is. Omit it and every answer is sent as\n * before, with no check.\n */\n confirmDecision?: StatewireDecisionConfirmer;\n /**\n * The card for typed Athena interrupts and the parks it answers:\n * `statewireTypedInterrupts` from `@athenaintel/react/typed-interrupts`, as\n * `AthenaChat` passes it. With it, this card leaves typed parks to that one\n * and hands it its own props; without it, a typed park gets\n * `nonHitlNotice` and a decline. A seam rather than a built-in, so a host\n * whose own cards answer typed parks (Olympus) bundles neither the SDK's\n * cards nor its selector.\n */\n typedInterrupts?: StatewireTypedInterruptSeam;\n}\n\nexport const StatewireApprovalCard: FC<StatewireApprovalCardProps> = (props) => {\n const extras = useAuiState((s) => s.thread.extras);\n if (!hasStatewireThreadExtras(extras)) return null;\n const { typedInterrupts } = props;\n if (!typedInterrupts) return <StatewireApprovalCardInner {...props} />;\n const {\n classNames,\n readOnly,\n readOnlyNotice,\n isHandledElsewhere,\n confirmDecision,\n onResumeRejected,\n pendingResumeGraceMs,\n } = props;\n return (\n <>\n <StatewireApprovalCardInner {...props} />\n {typedInterrupts.render({\n ...(classNames?.root ? { classNames: { root: classNames.root } } : {}),\n readOnly,\n readOnlyNotice,\n isHandledElsewhere,\n confirmDecision,\n onResumeRejected,\n pendingResumeGraceMs,\n })}\n </>\n );\n};\n\nconst StatewireApprovalCardInner: FC<StatewireApprovalCardProps> = ({\n classNames,\n fallbackMessage,\n interruptPredicate,\n pendingResumeGraceMs,\n isHandledElsewhere,\n renderDetails,\n renderHeader,\n renderEditor,\n readOnly = false,\n readOnlyNotice = 'Waiting for someone with edit access to respond.',\n nonHitlNotice = 'This request needs an answer this surface cannot collect.',\n onResumeRejected,\n confirmDecision,\n typedInterrupts,\n}) => {\n const isTypedRequest = typedInterrupts?.isTypedRequest;\n // With a typed card beside it, this card's own selection is every pending\n // approval-card interrupt but a typed one.\n const selectRequest = useMemo<StatewireInterruptPredicate | undefined>(() => {\n if (interruptPredicate || !isTypedRequest) return interruptPredicate;\n return (request): request is StatewireThread.CustomInputRequest =>\n isApprovalCardInterrupt(request) && !isTypedRequest(request);\n }, [interruptPredicate, isTypedRequest]);\n const approvalEpochRef = useRef(0);\n const [decisionFailure, setDecisionFailure] = useState<{\n requestId: string;\n message: string;\n epoch: number;\n }>();\n const reportResumeRejected = useCallback(\n (error: unknown, failedRequestId: string) => {\n setDecisionFailure({\n requestId: failedRequestId,\n message: statewireRejectionDetailMessage(error) ?? 'Your decision could not be sent. Try again.',\n epoch: approvalEpochRef.current,\n });\n onResumeRejected?.(error, failedRequestId);\n },\n [onResumeRejected],\n );\n const {\n request,\n requestId,\n hitl: parkedHitl,\n actionRequests: parkedActionRequests,\n liveHitl,\n liveActionRequests,\n queuedLaneDecisions,\n abandonedInterrupt,\n pending,\n resume,\n sendLaneDecisions,\n replayQueuedLanes,\n } = useStatewireApprovalRequest<StatewireThread.InputResponse>({\n interruptPredicate: selectRequest,\n pendingResumeGraceMs,\n onResumeRejected: reportResumeRejected,\n });\n // Read the host mirror: the optimistic resume fold can temporarily hide\n // `liveHitl` and the parked request without ending this approval.\n const mirroredApproval = useStatewireState(\n (state) => asHitlApproval(interruptMirrorPayload(readInterruptMirror(state))) !== null,\n );\n const approvalPresent = requestId !== undefined || mirroredApproval;\n // A typed park the typed card answers beside this one: an older cancelled\n // approval's notice waits until nothing is parked, as it did before.\n const inputRequests = useStatewireRuns().inputRequests;\n const typedParkPending =\n isTypedRequest !== undefined && (inputRequests?.some((pendingRequest) => isTypedRequest(pendingRequest)) ?? false);\n const previousApprovalPresentRef = useRef(approvalPresent);\n if (previousApprovalPresentRef.current && !approvalPresent) approvalEpochRef.current += 1;\n previousApprovalPresentRef.current = approvalPresent;\n const [dismissedId, setDismissedId] = useState<string>();\n // The card shares the chat column with the thread. A lone gated call is\n // small enough to show inline, but a fan-out of a dozen calls would swallow\n // the conversation, so a batch starts collapsed until someone opens it.\n const [detailsOverride, setDetailsOverride] = useState<boolean>();\n // The live lanes a decision was sent for (joined ids); the buttons stay\n // locked until the host echoes them in `queuedLaneDecisions` or refuses.\n const [liveSentKey, setLiveSentKey] = useState<string>();\n // The parked request whose host-queued lanes outlived the grace window\n // (see `queuedLanesAwaitingHost` below): its queue is read as stale.\n const [staleQueuedRequestId, setStaleQueuedRequestId] = useState<string>();\n // The parked request whose queued lanes this card has asked the host to\n // replay (`run/lane-replay` in flight): locked until the host answers.\n const [replayingRequestId, setReplayingRequestId] = useState<string>();\n // The lanes THIS card decided live (its own `run/lane-input` the host\n // accepted). Only a queue this card recorded is replayed from here — the\n // host refuses any other caller, and a second editor's card must not even\n // ask. Pruned to the lanes on screen whenever a different view arrives, so\n // the record survives the live → parked transition of the same lanes (and\n // a fold that briefly shows nothing) and dies with a new request.\n const sentLaneIdsRef = useRef<Set<string>>(new Set());\n // The parked request already replayed once from here: a request is\n // replayed at most once, then the grace hands the decision back.\n const replayedRequestIdRef = useRef<string>(undefined);\n // A passkey check is running for the answer clicked here; the buttons stay\n // locked until it settles.\n const [confirming, setConfirming] = useState(false);\n // The parked request on screen now, read after a check settles: an answer\n // confirmed for a request that is no longer parked is never sent.\n const currentRequestIdRef = useRef(requestId);\n currentRequestIdRef.current = requestId;\n const confirmDecisionRef = useRef(confirmDecision);\n confirmDecisionRef.current = confirmDecision;\n\n const isLive = request === undefined && liveHitl !== null;\n const hitl = isLive ? liveHitl : parkedHitl;\n const actionRequests = isLive ? liveActionRequests : parkedActionRequests;\n const laneIds = laneInterruptIds(actionRequests);\n // The host answers the lanes it queued from its own settle path, within its\n // published budget of the park (`QUEUED_LANE_ANSWER_BUDGET_SECONDS`). A\n // parked request whose queued lanes are still unanswered past the grace\n // window has a silent answerer, and either this card asked the host to\n // replay them and was refused, or the queue is not this card's to replay —\n // so the queue no longer counts as a decision here: the actions re-enable\n // and the next click answers the parked request itself (a resume the host\n // accepts, and whose dispatch drops the stale queue).\n const hostQueuedLaneDecisions =\n requestId !== undefined && staleQueuedRequestId === requestId\n ? NO_HOST_QUEUED_LANE_DECISIONS\n : queuedLaneDecisions;\n const undecidedLaneIds =\n laneIds?.filter((id) => !(id in hostQueuedLaneDecisions)) ?? null;\n // A lone parked lane (or an unstamped batch) answers with one positional\n // `run/input`; that is the only resume the backend binds per-action answers\n // to, so it is the only place an edited call can go.\n const positional = laneIds === null || (!isLive && laneIds.length <= 1);\n const liveKey = isLive ? (laneIds?.join('|') ?? null) : null;\n const viewKey = requestId ?? liveKey ?? undefined;\n\n // A fresh approval gets the default for ITS batch size, not the disclosure\n // the previous one was left in. Reset during render via React's \"previous\n // value\" pattern.\n const prevViewKeyRef = useRef(viewKey);\n if (prevViewKeyRef.current !== viewKey) {\n prevViewKeyRef.current = viewKey;\n if (detailsOverride !== undefined) setDetailsOverride(undefined);\n if (liveSentKey !== undefined) setLiveSentKey(undefined);\n if (laneIds !== null) {\n for (const id of sentLaneIdsRef.current) {\n if (!laneIds.includes(id)) sentLaneIdsRef.current.delete(id);\n }\n }\n }\n // The per-request marks (stale queue, replayed once, replay in flight)\n // outlive the optimistic fold of a click's own `run/input`: the request\n // leaves and comes back under the SAME id when the host refuses it, and a\n // card that forgot its stale mark then would relock over the standing\n // queue for another grace, and could replay it a second time. They are\n // forgotten only for a genuinely different parked request.\n if (\n requestId !== undefined &&\n staleQueuedRequestId !== undefined &&\n requestId !== staleQueuedRequestId\n ) {\n setStaleQueuedRequestId(undefined);\n }\n if (\n requestId !== undefined &&\n replayingRequestId !== undefined &&\n requestId !== replayingRequestId\n ) {\n setReplayingRequestId(undefined);\n }\n if (\n requestId !== undefined &&\n replayedRequestIdRef.current !== undefined &&\n requestId !== replayedRequestIdRef.current\n ) {\n replayedRequestIdRef.current = undefined;\n }\n\n const title = pendingApprovalTitle({ hitl, actionRequests });\n const context: StatewireApprovalRequestContext = {\n request,\n hitl,\n actionRequests,\n ...(title ? { title } : {}),\n };\n const handledElsewhere = isHandledElsewhere?.(context) ?? false;\n const replaying = replayingRequestId !== undefined && replayingRequestId === requestId;\n\n // Parked, every lane the request covers already queued on the host, no\n // resume of our own in flight, and this card is the one that would decide\n // (not a viewer, not a request another surface owns): the host's answerer\n // is expected to resume the run within its budget. Start the clock on it,\n // longer than that budget. When it runs out the host has stayed silent: if\n // this card queued those lanes itself, it asks the host to replay them as\n // their approver (`run/lane-replay`); otherwise — and when the host refuses\n // the replay — the queue no longer counts as a decision here and the actions\n // re-enable, so a person decides. Never a `run/input` of this client's own\n // carrying someone else's recorded decision.\n const queuedLanesAwaitingHost =\n !isLive &&\n !readOnly &&\n !handledElsewhere &&\n requestId !== undefined &&\n undecidedLaneIds !== null &&\n undecidedLaneIds.length === 0 &&\n !pending &&\n !replaying;\n const queuedLaneGraceMs = pendingResumeGraceMs ?? HITL_PENDING_RESUME_GRACE_MS;\n const laneKey = laneIds?.join('|');\n const onResumeRejectedRef = useRef(reportResumeRejected);\n onResumeRejectedRef.current = reportResumeRejected;\n useEffect(() => {\n if (!queuedLanesAwaitingHost || requestId === undefined || laneKey === undefined) {\n return undefined;\n }\n const timer = setTimeout(() => {\n const ownQueue =\n laneKey.split('|').every((id) => sentLaneIdsRef.current.has(id)) &&\n replayedRequestIdRef.current !== requestId;\n if (!ownQueue) {\n setStaleQueuedRequestId(requestId);\n return;\n }\n replayedRequestIdRef.current = requestId;\n setReplayingRequestId(requestId);\n replayQueuedLanes(requestId).then(\n () => {\n setReplayingRequestId((current) => (current === requestId ? undefined : current));\n },\n (error: unknown) => {\n setReplayingRequestId((current) => (current === requestId ? undefined : current));\n setStaleQueuedRequestId(requestId);\n onResumeRejectedRef.current?.(error, requestId);\n },\n );\n }, queuedLaneGraceMs);\n return () => clearTimeout(timer);\n }, [queuedLanesAwaitingHost, requestId, laneKey, queuedLaneGraceMs, replayQueuedLanes]);\n\n /**\n * Send `answer` through `deliver`, with a passkey check first when it\n * approves and the host runs one. The check is the person's own act on\n * their device; while it is open the card is locked, and if the parked\n * request changed meanwhile the confirmed answer is dropped, never sent to\n * whatever parked next.\n */\n const withDecisionCheck = useCallback(\n (answer: StatewireDecisionAnswer, deliver: (extras?: ResumeExtras) => void) => {\n const confirmer = confirmDecisionRef.current;\n if (confirmer === undefined || !answerApproves(answer)) {\n deliver();\n return;\n }\n setConfirming(true);\n confirmer(answer)\n .catch(() => undefined)\n .then((token) => {\n setConfirming(false);\n if (answer.kind === 'input' && currentRequestIdRef.current !== answer.requestId) {\n return;\n }\n deliver(token ? { decisionCheck: token } : undefined);\n });\n },\n [],\n );\n\n // A live lane decision: the host queues it until the run parks, and holds\n // it for this card's caller, the only queue this card may ask it to replay.\n const sendLiveLanes = useCallback(\n ({\n key,\n lanes,\n epoch,\n extras,\n }: {\n key: string;\n lanes: Readonly<Record<string, StatewireThread.InputResponse>>;\n epoch: number;\n extras?: ResumeExtras;\n }) => {\n const sentLaneIds = key.split('|');\n setLiveSentKey(key);\n Promise.resolve(sendLaneDecisions(lanes, extras)).then(\n () => {\n if (epoch !== approvalEpochRef.current) return;\n for (const id of sentLaneIds) sentLaneIdsRef.current.add(id);\n },\n (error: unknown) => {\n if (epoch !== approvalEpochRef.current) return;\n setLiveSentKey((current) => (current === key ? undefined : current));\n reportResumeRejected(error, sentLaneIds[0] ?? '');\n },\n );\n },\n [sendLaneDecisions, reportResumeRejected],\n );\n\n const decide = useCallback(\n (value: Record<string, string>) => {\n setDecisionFailure(undefined);\n const epoch = approvalEpochRef.current;\n // Several parked lanes (or a live one) answer by interrupt id: a\n // positional `run/input` would resume only the first and re-park the\n // rest. A lone parked lane keeps the positional resume every host\n // already speaks.\n if (positional || undecidedLaneIds === null) {\n if (requestId === undefined) return;\n withDecisionCheck({ kind: 'input', requestId, value }, (extras) => {\n resume(value, extras);\n });\n return;\n }\n const lanes = fanLaneDecision({ interruptIds: undecidedLaneIds, decision: value });\n if (!isLive) {\n if (requestId === undefined) return;\n withDecisionCheck(\n { kind: 'input', requestId, value: { lane_decisions: lanes } },\n (extras) => {\n sendLaneDecisions(lanes, extras);\n },\n );\n return;\n }\n const key = undecidedLaneIds.join('|');\n withDecisionCheck({ kind: 'lanes', laneDecisions: lanes }, (extras) =>\n sendLiveLanes({ key, lanes, epoch, extras }),\n );\n },\n [\n positional,\n undecidedLaneIds,\n isLive,\n requestId,\n resume,\n sendLaneDecisions,\n sendLiveLanes,\n withDecisionCheck,\n ],\n );\n\n const decideEach = useMemo<StatewireApprovalEditorContext['decideEach']>(() => {\n if (actionRequestToolCallIds(actionRequests) === null || !positional) return null;\n return (decision) => {\n setDecisionFailure(undefined);\n const decisions: Record<string, HitlActionDecision> = {};\n for (const request of actionRequests) {\n if (request.toolCallId !== undefined) decisions[request.toolCallId] = decision(request);\n }\n // The edited argument set comes from the wire as JSON; the resume value\n // is that JSON going back.\n const value = hitlResumeActionDecisions(decisions) as StatewireThread.InputResponse;\n if (requestId === undefined) return;\n withDecisionCheck({ kind: 'input', requestId, value }, (extras) => {\n resume(value, extras);\n });\n };\n }, [actionRequests, positional, requestId, resume, withDecisionCheck]);\n\n if (!request && !isLive) {\n if (!abandonedInterrupt || abandonedInterrupt.id === dismissedId || typedParkPending) return null;\n return (\n <div\n className={cn(\n 'aui-approval-abandoned flex w-full items-center justify-between gap-3 rounded-xl border border-border bg-muted/40 px-3 py-2 text-muted-foreground text-xs',\n classNames?.abandoned,\n )}\n >\n <p>Approval was cancelled — the run moved on.</p>\n <button\n type=\"button\"\n aria-label=\"Dismiss cancelled approval\"\n onClick={() => setDismissedId(abandonedInterrupt.id)}\n className=\"shrink-0 rounded-md p-1 transition-colors hover:bg-muted hover:text-foreground\"\n >\n <XIcon className=\"size-3.5\" />\n </button>\n </div>\n );\n }\n\n if (handledElsewhere) return null;\n // A live mirror without lane stamps cannot be answered before the run\n // parks; the parked request renders it then.\n if (isLive && laneIds === null) return null;\n\n const message = readInterruptMessage(request ? request.payload : liveHitl, fallbackMessage);\n const toolName = hitl?.context?.tool_name ?? hitl?.context?.tool_id;\n const pendingCount = hitl?.context?.pending_action_count ?? 1;\n const hasDetails = hitl !== null && actionRequests.length > 0;\n const showDetails = hasDetails && (detailsOverride ?? actionRequests.length <= 1);\n const sessionOffer = hitl !== null ? sessionApprovalOffer(actionRequests) : undefined;\n const sessionApprovalOffered = sessionOffer !== undefined;\n const sessionLabel = sessionOffer ? sessionApprovalLabel(sessionOffer) : '';\n const laneDecided =\n undecidedLaneIds !== null &&\n laneIds !== null &&\n (undecidedLaneIds.length === 0 || liveSentKey === undecidedLaneIds.join('|'));\n const locked = pending || laneDecided || replaying || confirming;\n\n const editor =\n !readOnly && hitl !== null && renderEditor\n ? renderEditor({\n ...context,\n locked,\n sessionApprovalOffered,\n sessionApprovalLabel: sessionLabel,\n approve: () => decide(hitlResumeApprove()),\n approveForSession: () => decide(hitlResumeApproveForSession()),\n reject: (reason) => decide(hitlResumeReject(reason)),\n decideEach,\n })\n : undefined;\n const customHeader = renderHeader?.(context);\n // Only the card's own review leads with the title: a host's details or\n // editor show the envelope themselves, headline included.\n const headerTitle = renderDetails === undefined && editor == null ? title : undefined;\n\n return (\n <section\n aria-label={hitl ? 'Approval required' : 'Input required'}\n className={cn(\n 'aui-approval-card w-full rounded-2xl border border-border bg-card px-4 py-3 text-foreground shadow-xs',\n classNames?.root,\n )}\n >\n <div className=\"flex items-start gap-3\">\n {customHeader != null ? (\n <div className=\"min-w-0 flex-1\">{customHeader}</div>\n ) : (\n <>\n <ShieldAlertIcon className=\"mt-0.5 size-4 shrink-0 text-muted-foreground\" />\n <div className=\"min-w-0 flex-1\">\n <p className=\"flex items-center gap-2 font-semibold text-sm\">\n <span>{hitl ? 'Approval required' : 'Waiting for input'}</span>\n {hitl && pendingCount > 1 ? (\n <span className=\"shrink-0 rounded-full border border-border bg-muted px-1.5 py-px font-normal text-[11px] text-muted-foreground\">\n {pendingCount} tool calls\n </span>\n ) : null}\n </p>\n {headerTitle ? (\n <>\n <p\n className=\"break-words pt-1 font-medium text-foreground text-sm leading-snug\"\n data-testid=\"statewire-approval-headline\"\n >\n {headerTitle.headline}\n </p>\n {headerTitle.summary ? (\n <p\n className=\"break-words pt-1 text-muted-foreground text-sm leading-snug\"\n data-testid=\"statewire-approval-summary\"\n >\n {headerTitle.summary}\n </p>\n ) : null}\n </>\n ) : (\n <p className=\"pt-1 text-muted-foreground text-sm leading-snug\">\n {hitl && pendingCount === 1 && toolName ? (\n <>\n <span className=\"font-mono text-foreground\">{toolName}</span> requires approval before it runs.\n </>\n ) : (\n message\n )}\n </p>\n )}\n </div>\n </>\n )}\n </div>\n {decisionFailure && decisionFailure.epoch === approvalEpochRef.current &&\n (decisionFailure.requestId === requestId || laneIds?.includes(decisionFailure.requestId)) ? (\n <p role=\"alert\" data-testid=\"statewire-approval-error\">{decisionFailure.message}</p>\n ) : null}\n {isLive ? (\n <p className=\"pt-1 text-muted-foreground text-xs\" data-testid=\"statewire-approval-live\">\n {laneDecided\n ? 'Decision sent — it applies as soon as this step pauses.'\n : 'Other work keeps running while you decide.'}\n </p>\n ) : null}\n {hasDetails && editor == null ? (\n <button\n type=\"button\"\n onClick={() => setDetailsOverride(!showDetails)}\n aria-expanded={showDetails}\n className=\"mt-2 flex items-center gap-1 rounded px-1 py-0.5 text-muted-foreground text-xs transition-colors hover:text-foreground\"\n >\n <ChevronDownIcon\n className={cn('size-3 transition-transform', showDetails && 'rotate-180')}\n />\n {showDetails ? 'Hide details' : 'Review details'}\n </button>\n ) : null}\n {/* EVERY pending gated call renders, in order — one decision\n authorizes the whole batch, so nothing may hide behind a host's\n richer cards. All read-only: this runtime resumes through\n `hitl_response_to_decisions`, which has no `tool_args` channel —\n an editable composer would let someone rewrite an email and then\n watch the original go out — unless the host takes over the\n decision too (`renderEditor`), which sends the edit per call. */}\n {editor != null ? (\n <div className={cn('mt-3 flex flex-col gap-2', classNames?.details)}>{editor}</div>\n ) : showDetails ? (\n <div className={cn('mt-2 flex flex-col gap-2', classNames?.details)}>\n {renderDetails ? (\n renderDetails(context)\n ) : (\n // A titled card no longer names its tool in the header, so its\n // details do, as a batch's do.\n <DefaultApprovalDetails\n actionRequests={actionRequests}\n showNames={actionRequests.length > 1 || headerTitle !== undefined}\n />\n )}\n </div>\n ) : null}\n {editor != null ? null : (\n <div className={cn('flex flex-wrap items-center gap-2 pt-3', classNames?.actions)}>\n {readOnly ? (\n <p className=\"text-muted-foreground text-sm\" data-testid=\"statewire-approval-read-only\">\n {readOnlyNotice}\n </p>\n ) : hitl ? (\n <>\n <Button\n size=\"sm\"\n disabled={locked}\n onClick={() => decide(hitlResumeApprove())}\n >\n <CheckIcon />\n Approve\n </Button>\n {sessionApprovalOffered ? (\n <Button\n size=\"sm\"\n variant=\"outline\"\n disabled={locked}\n onClick={() => decide(hitlResumeApproveForSession())}\n data-testid=\"statewire-approval-approve-session\"\n className=\"h-auto min-h-8 whitespace-normal py-1.5 text-left\"\n >\n <CheckCheckIcon />\n <span className=\"min-w-0 break-words\">{sessionLabel}</span>\n </Button>\n ) : null}\n <Button\n size=\"sm\"\n variant=\"outline\"\n disabled={locked}\n onClick={() => decide(hitlResumeReject())}\n >\n <XIcon />\n Reject\n </Button>\n </>\n ) : (\n <>\n <p className=\"text-muted-foreground text-sm\" data-testid=\"statewire-approval-non-hitl\">\n {nonHitlNotice}\n </p>\n <Button\n size=\"sm\"\n variant=\"outline\"\n disabled={pending}\n onClick={() => resume(interruptResumeDecline())}\n >\n <XIcon />\n Decline\n </Button>\n </>\n )}\n </div>\n )}\n </section>\n );\n};\n\n/**\n * What the backend resolved about a call before asking (where a Slack write\n * goes and as whom, Slack Connect warnings), above its raw arguments. Its\n * headline and summary title the card instead; with nothing else, nothing\n * renders here.\n */\nconst ApprovalContextFacts: FC<{ context: PendingApprovalContext }> = ({ context }) =>\n context.facts.length === 0 && context.warnings.length === 0 ? null : (\n <div className=\"mt-1 space-y-0.5\" data-testid=\"statewire-approval-context\">\n {context.facts.map((fact) => (\n <p key={fact.label}>\n <span className=\"font-semibold\">{fact.label}:</span> {fact.value}\n </p>\n ))}\n {context.warnings.map((warning) => (\n <p\n key={warning.message}\n className={warning.severity === 'info' ? undefined : 'font-semibold'}\n >\n {warning.message}\n </p>\n ))}\n </div>\n );\n\n/**\n * One block per gated call: its name (a batch's, or a titled call's), its\n * resolved facts, and its arguments as JSON.\n */\nconst DefaultApprovalDetails: FC<{ actionRequests: PendingActionRequest[]; showNames: boolean }> = ({\n actionRequests,\n showNames,\n}) => (\n <>\n {actionRequests.map((action, index) => (\n <div\n key={`${action.name}-${index}`}\n className=\"rounded-lg border border-border/60 bg-muted/40 p-2 text-foreground text-xs leading-relaxed\"\n >\n {showNames ? <p className=\"font-mono font-semibold\">{action.name}</p> : null}\n {action.approvalContext ? <ApprovalContextFacts context={action.approvalContext} /> : null}\n {Object.keys(action.args).length > 0 ? (\n <pre className=\"mt-1 max-h-32 overflow-auto whitespace-pre-wrap break-words rounded bg-background p-1.5 font-mono text-[11px]\">\n {JSON.stringify(action.args, null, 2)}\n </pre>\n ) : (\n <p className=\"text-muted-foreground\">No arguments.</p>\n )}\n </div>\n ))}\n </>\n);\n"],"names":["resumeValueApproves","useAuiState","hasStatewireThreadExtras","jsx","jsxs","Fragment","useMemo","request","isApprovalCardInterrupt","useRef","useState","useCallback","statewireRejectionDetailMessage","useStatewireApprovalRequest","useStatewireState","asHitlApproval","interruptMirrorPayload","readInterruptMirror","useStatewireRuns","laneInterruptIds","pendingApprovalTitle","HITL_PENDING_RESUME_GRACE_MS","useEffect","_a","fanLaneDecision","actionRequestToolCallIds","hitlResumeActionDecisions","cn","XIcon","readInterruptMessage","sessionApprovalOffer","sessionApprovalLabel","hitlResumeApprove","hitlResumeApproveForSession","hitlResumeReject","ShieldAlertIcon","ChevronDownIcon","Button","CheckIcon","CheckCheckIcon","interruptResumeDecline"],"mappings":";;;;;;;;;;;;;AAqJA,SAAS,eAAe,QAA0C;AAChE,MAAI,OAAO,SAAS,QAAS,QAAOA,WAAAA,oBAAoB,OAAO,KAAK;AACpE,QAAM,QAAQ,OAAO,OAAO,OAAO,aAAa;AAChD,SAAO,MAAM,WAAW,KAAK,MAAM,KAA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;AAAA,IAHJ,QAAQ;AAAA,EAAA,CAKhB;AAAA,GACH;AAOJ,MAAM,yBAA6F,CAAC;AAAA,EAClG;AAAA,EACA;AACF,MACEA,2BAAAA,IAAAE,WAAAA,UAAA,EACG,UAAA,eAAe,IAAI,CAAC,QAAQ,UAC3BD,2BAAAA;AAAAA,EAAC;AAAA,EAAA;AAAA,IAEC,WAAU;AAAA,IAET,UAAA;AAAA,MAAA,2CAAa,KAAA,EAAE,WAAU,2BAA2B,UAAA,OAAO,MAAK,IAAO;AAAA,MACvE,OAAO,kBAAkBD,2BAAAA,IAAC,wBAAqB,SAAS,OAAO,iBAAiB,IAAK;AAAA,MACrF,OAAO,KAAK,OAAO,IAAI,EAAE,SAAS,IACjCA,2BAAAA,IAAC,OAAA,EAAI,WAAU,iHACZ,eAAK,UAAU,OAAO,MAAM,MAAM,CAAC,EAAA,CACtC,IAEAA,+BAAC,KAAA,EAAE,WAAU,yBAAwB,UAAA,gBAAA,CAAa;AAAA,IAAA;AAAA,EAAA;AAAA,EAV/C,GAAG,OAAO,IAAI,IAAI,KAAK;AAY9B,CACD,GACH;;"}
@@ -53,6 +53,18 @@ import { type StatewireInterruptPredicate } from './use-statewire-approval-reque
53
53
  * surface answers (typed interrupt families, per-lane subagent approvals)
54
54
  * stand down through `isHandledElsewhere`; viewers without edit rights see
55
55
  * `readOnlyNotice`.
56
+ *
57
+ * A run parked on a typed Athena interrupt (the `ask` tool's questions, a
58
+ * file request, a form, toolkits to turn on, a saved login, a schedule, a
59
+ * wait, a tool-raised approval) gets that kind's own card when the host hands
60
+ * one in as `typedInterrupts` (`statewireTypedInterrupts` from
61
+ * `@athenaintel/react/typed-interrupts`, which `AthenaChat` passes): the card
62
+ * answers with the resume shape the raiser validates, under the same props
63
+ * (`isHandledElsewhere` and `readOnly` apply to it, an approve goes through
64
+ * `confirmDecision`, a refusal reaches `onResumeRejected`). Without it, as on
65
+ * a host whose own cards answer typed parks (Olympus), a typed park is
66
+ * answered only with `nonHitlNotice`'s decline, as is any park that is
67
+ * neither.
56
68
  */
57
69
  /**
58
70
  * The answer a passkey decision check confirms before the card sends it
@@ -118,6 +130,37 @@ export interface StatewireApprovalEditorContext extends StatewireApprovalRequest
118
130
  */
119
131
  decideEach: ((decision: (request: PendingActionRequest) => HitlActionDecision) => void) | null;
120
132
  }
133
+ /** The approval card's own props it hands the typed card (`StatewireTypedInterruptSeam.render`). */
134
+ export interface StatewireTypedInterruptCardProps {
135
+ /** Surface-styling override for the card's container. */
136
+ classNames?: {
137
+ root?: string;
138
+ };
139
+ /** A viewer without edit rights: the park's message and `readOnlyNotice`, no controls. */
140
+ readOnly?: boolean;
141
+ readOnlyNotice?: ReactNode;
142
+ /**
143
+ * Return true when another surface answers this request: the card renders
144
+ * nothing for it, since two surfaces must never answer one request.
145
+ */
146
+ isHandledElsewhere?: (context: StatewireApprovalRequestContext) => boolean;
147
+ /** The host's passkey decision check, for an answer that approves a typed approval. */
148
+ confirmDecision?: StatewireDecisionConfirmer;
149
+ /** The host refused an answer; the card is back with its controls and says why. */
150
+ onResumeRejected?: (error: unknown, requestId: string) => void;
151
+ pendingResumeGraceMs?: number;
152
+ }
153
+ /**
154
+ * A card for typed Athena interrupts, handed to `StatewireApprovalCard` as
155
+ * `typedInterrupts`: which parks it answers, and the card. The SDK's is
156
+ * `statewireTypedInterrupts` from `@athenaintel/react/typed-interrupts`.
157
+ */
158
+ export interface StatewireTypedInterruptSeam {
159
+ /** The parks the typed card answers; the approval card leaves them to it. */
160
+ isTypedRequest: StatewireInterruptPredicate;
161
+ /** The typed card, given the approval card's own props. */
162
+ render: (props: StatewireTypedInterruptCardProps) => ReactNode;
163
+ }
121
164
  export interface StatewireApprovalCardProps {
122
165
  /** Surface-styling overrides merged onto the default classes. */
123
166
  classNames?: {
@@ -174,8 +217,8 @@ export interface StatewireApprovalCardProps {
174
217
  readOnly?: boolean;
175
218
  readOnlyNotice?: ReactNode;
176
219
  /**
177
- * Copy for a park that is not a HITL approval — a typed Athena interrupt
178
- * this surface has no card for. The only honest action is to decline it
220
+ * Copy for a park that is not a HITL approval and that no typed card
221
+ * (`typedInterrupts`) answers. The only honest action is to decline it
179
222
  * (`{ action: 'reject' }`, which every typed raiser treats as a clean user
180
223
  * decline); a generic "Continue" would be rejected by the raiser's resume
181
224
  * schema and surface as a tool error.
@@ -195,5 +238,15 @@ export interface StatewireApprovalCardProps {
195
238
  * before, with no check.
196
239
  */
197
240
  confirmDecision?: StatewireDecisionConfirmer;
241
+ /**
242
+ * The card for typed Athena interrupts and the parks it answers:
243
+ * `statewireTypedInterrupts` from `@athenaintel/react/typed-interrupts`, as
244
+ * `AthenaChat` passes it. With it, this card leaves typed parks to that one
245
+ * and hands it its own props; without it, a typed park gets
246
+ * `nonHitlNotice` and a decline. A seam rather than a built-in, so a host
247
+ * whose own cards answer typed parks (Olympus) bundles neither the SDK's
248
+ * cards nor its selector.
249
+ */
250
+ typedInterrupts?: StatewireTypedInterruptSeam;
198
251
  }
199
252
  export declare const StatewireApprovalCard: FC<StatewireApprovalCardProps>;
@@ -1,13 +1,13 @@
1
1
  import { jsx, jsxs, Fragment } from "react/jsx-runtime";
2
2
  import { useAuiState } from "@assistant-ui/react";
3
- import { useStatewireState } from "@assistant-ui/react-statewire";
3
+ import { useStatewireState, useStatewireRuns } from "@assistant-ui/react-statewire";
4
4
  import { XIcon, ShieldAlertIcon, ChevronDownIcon, CheckIcon, CheckCheckIcon } from "lucide-react";
5
- import { useRef, useState, useCallback, useEffect, useMemo } from "react";
5
+ import { useMemo, useRef, useState, useCallback, useEffect } from "react";
6
6
  import { Button } from "../ui/button.js";
7
7
  import { useStatewireApprovalRequest } from "./use-statewire-approval-request.js";
8
8
  import { hasStatewireThreadExtras } from "../agent-runtime/src/thread-extras.js";
9
+ import { isApprovalCardInterrupt, asHitlApproval, interruptMirrorPayload, readInterruptMirror, laneInterruptIds, pendingApprovalTitle, HITL_PENDING_RESUME_GRACE_MS, fanLaneDecision, actionRequestToolCallIds, hitlResumeActionDecisions, readInterruptMessage, sessionApprovalOffer, sessionApprovalLabel, hitlResumeReject, hitlResumeApproveForSession, hitlResumeApprove, interruptResumeDecline, resumeValueApproves } from "../agent-runtime/src/interrupts.js";
9
10
  import { statewireRejectionDetailMessage } from "../agent-runtime/src/errors.js";
10
- import { asHitlApproval, interruptMirrorPayload, readInterruptMirror, laneInterruptIds, pendingApprovalTitle, HITL_PENDING_RESUME_GRACE_MS, fanLaneDecision, actionRequestToolCallIds, hitlResumeActionDecisions, readInterruptMessage, sessionApprovalOffer, sessionApprovalLabel, hitlResumeReject, hitlResumeApproveForSession, hitlResumeApprove, interruptResumeDecline, resumeValueApproves } from "../agent-runtime/src/interrupts.js";
11
11
  import { cn } from "cnfast";
12
12
  function answerApproves(answer) {
13
13
  if (answer.kind === "input") return resumeValueApproves(answer.value);
@@ -18,7 +18,29 @@ const NO_HOST_QUEUED_LANE_DECISIONS = Object.freeze({});
18
18
  const StatewireApprovalCard = (props) => {
19
19
  const extras = useAuiState((s) => s.thread.extras);
20
20
  if (!hasStatewireThreadExtras(extras)) return null;
21
- return /* @__PURE__ */ jsx(StatewireApprovalCardInner, { ...props });
21
+ const { typedInterrupts } = props;
22
+ if (!typedInterrupts) return /* @__PURE__ */ jsx(StatewireApprovalCardInner, { ...props });
23
+ const {
24
+ classNames,
25
+ readOnly,
26
+ readOnlyNotice,
27
+ isHandledElsewhere,
28
+ confirmDecision,
29
+ onResumeRejected,
30
+ pendingResumeGraceMs
31
+ } = props;
32
+ return /* @__PURE__ */ jsxs(Fragment, { children: [
33
+ /* @__PURE__ */ jsx(StatewireApprovalCardInner, { ...props }),
34
+ typedInterrupts.render({
35
+ ...(classNames == null ? void 0 : classNames.root) ? { classNames: { root: classNames.root } } : {},
36
+ readOnly,
37
+ readOnlyNotice,
38
+ isHandledElsewhere,
39
+ confirmDecision,
40
+ onResumeRejected,
41
+ pendingResumeGraceMs
42
+ })
43
+ ] });
22
44
  };
23
45
  const StatewireApprovalCardInner = ({
24
46
  classNames,
@@ -33,9 +55,15 @@ const StatewireApprovalCardInner = ({
33
55
  readOnlyNotice = "Waiting for someone with edit access to respond.",
34
56
  nonHitlNotice = "This request needs an answer this surface cannot collect.",
35
57
  onResumeRejected,
36
- confirmDecision
58
+ confirmDecision,
59
+ typedInterrupts
37
60
  }) => {
38
61
  var _a, _b, _c;
62
+ const isTypedRequest = typedInterrupts == null ? void 0 : typedInterrupts.isTypedRequest;
63
+ const selectRequest = useMemo(() => {
64
+ if (interruptPredicate || !isTypedRequest) return interruptPredicate;
65
+ return (request2) => isApprovalCardInterrupt(request2) && !isTypedRequest(request2);
66
+ }, [interruptPredicate, isTypedRequest]);
39
67
  const approvalEpochRef = useRef(0);
40
68
  const [decisionFailure, setDecisionFailure] = useState();
41
69
  const reportResumeRejected = useCallback(
@@ -63,7 +91,7 @@ const StatewireApprovalCardInner = ({
63
91
  sendLaneDecisions,
64
92
  replayQueuedLanes
65
93
  } = useStatewireApprovalRequest({
66
- interruptPredicate,
94
+ interruptPredicate: selectRequest,
67
95
  pendingResumeGraceMs,
68
96
  onResumeRejected: reportResumeRejected
69
97
  });
@@ -71,6 +99,8 @@ const StatewireApprovalCardInner = ({
71
99
  (state) => asHitlApproval(interruptMirrorPayload(readInterruptMirror(state))) !== null
72
100
  );
73
101
  const approvalPresent = requestId !== void 0 || mirroredApproval;
102
+ const inputRequests = useStatewireRuns().inputRequests;
103
+ const typedParkPending = isTypedRequest !== void 0 && ((inputRequests == null ? void 0 : inputRequests.some((pendingRequest) => isTypedRequest(pendingRequest))) ?? false);
74
104
  const previousApprovalPresentRef = useRef(approvalPresent);
75
105
  if (previousApprovalPresentRef.current && !approvalPresent) approvalEpochRef.current += 1;
76
106
  previousApprovalPresentRef.current = approvalPresent;
@@ -251,7 +281,7 @@ const StatewireApprovalCardInner = ({
251
281
  };
252
282
  }, [actionRequests, positional, requestId, resume, withDecisionCheck]);
253
283
  if (!request && !isLive) {
254
- if (!abandonedInterrupt || abandonedInterrupt.id === dismissedId) return null;
284
+ if (!abandonedInterrupt || abandonedInterrupt.id === dismissedId || typedParkPending) return null;
255
285
  return /* @__PURE__ */ jsxs(
256
286
  "div",
257
287
  {