@athenaintel/react 0.41.3 → 0.42.1

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 (439) hide show
  1. package/README.md +102 -9
  2. package/dist/agent-runtime/src/asset-attachment.d.ts +98 -0
  3. package/dist/agent-runtime/src/athena-asset-drag.d.ts +32 -0
  4. package/dist/agent-runtime/src/auth-denial.d.ts +29 -0
  5. package/dist/agent-runtime/src/chat-outbox-attachments.cjs +41 -0
  6. package/dist/agent-runtime/src/chat-outbox-attachments.cjs.map +1 -0
  7. package/dist/agent-runtime/src/chat-outbox-attachments.d.ts +38 -0
  8. package/dist/agent-runtime/src/chat-outbox-attachments.js +41 -0
  9. package/dist/agent-runtime/src/chat-outbox-attachments.js.map +1 -0
  10. package/dist/agent-runtime/src/chat-outbox-signals.cjs +63 -0
  11. package/dist/agent-runtime/src/chat-outbox-signals.cjs.map +1 -0
  12. package/dist/agent-runtime/src/chat-outbox-signals.d.ts +12 -0
  13. package/dist/agent-runtime/src/chat-outbox-signals.js +63 -0
  14. package/dist/agent-runtime/src/chat-outbox-signals.js.map +1 -0
  15. package/dist/agent-runtime/src/chat-outbox-store.cjs +509 -0
  16. package/dist/agent-runtime/src/chat-outbox-store.cjs.map +1 -0
  17. package/dist/agent-runtime/src/chat-outbox-store.d.ts +203 -0
  18. package/dist/agent-runtime/src/chat-outbox-store.js +509 -0
  19. package/dist/agent-runtime/src/chat-outbox-store.js.map +1 -0
  20. package/dist/agent-runtime/src/chat-outbox-thread.cjs +136 -0
  21. package/dist/agent-runtime/src/chat-outbox-thread.cjs.map +1 -0
  22. package/dist/agent-runtime/src/chat-outbox-thread.d.ts +118 -0
  23. package/dist/agent-runtime/src/chat-outbox-thread.js +136 -0
  24. package/dist/agent-runtime/src/chat-outbox-thread.js.map +1 -0
  25. package/dist/agent-runtime/src/chat-outbox.cjs +696 -0
  26. package/dist/agent-runtime/src/chat-outbox.cjs.map +1 -0
  27. package/dist/agent-runtime/src/chat-outbox.d.ts +285 -0
  28. package/dist/agent-runtime/src/chat-outbox.js +696 -0
  29. package/dist/agent-runtime/src/chat-outbox.js.map +1 -0
  30. package/dist/agent-runtime/src/chat-socket-reachability.d.ts +45 -0
  31. package/dist/agent-runtime/src/client-tool-bridge.d.ts +152 -0
  32. package/dist/agent-runtime/src/client-tools.d.ts +133 -0
  33. package/dist/agent-runtime/src/composer-markdown.cjs +10 -0
  34. package/dist/agent-runtime/src/composer-markdown.cjs.map +1 -1
  35. package/dist/agent-runtime/src/composer-markdown.d.ts +108 -0
  36. package/dist/agent-runtime/src/composer-markdown.js +10 -0
  37. package/dist/agent-runtime/src/composer-markdown.js.map +1 -1
  38. package/dist/agent-runtime/src/config-mutations.d.ts +51 -0
  39. package/dist/agent-runtime/src/conversation-index.d.ts +110 -0
  40. package/dist/agent-runtime/src/conversation-list.d.ts +343 -0
  41. package/dist/agent-runtime/src/deep-agent-transport-recipe.cjs +3 -2
  42. package/dist/agent-runtime/src/deep-agent-transport-recipe.cjs.map +1 -1
  43. package/dist/agent-runtime/src/deep-agent-transport-recipe.d.ts +166 -0
  44. package/dist/agent-runtime/src/deep-agent-transport-recipe.js +3 -2
  45. package/dist/agent-runtime/src/deep-agent-transport-recipe.js.map +1 -1
  46. package/dist/agent-runtime/src/desktop-handoff.d.ts +139 -0
  47. package/dist/agent-runtime/src/durable-thread-snapshot-cache.d.ts +60 -0
  48. package/dist/agent-runtime/src/edit-command.d.ts +156 -0
  49. package/dist/agent-runtime/src/errors.d.ts +174 -0
  50. package/dist/agent-runtime/src/execute-output.d.ts +31 -0
  51. package/dist/agent-runtime/src/generated/runconfig-contract.cjs +16 -2
  52. package/dist/agent-runtime/src/generated/runconfig-contract.cjs.map +1 -1
  53. package/dist/agent-runtime/src/generated/runconfig-contract.d.ts +202 -0
  54. package/dist/agent-runtime/src/generated/runconfig-contract.js +16 -2
  55. package/dist/agent-runtime/src/generated/runconfig-contract.js.map +1 -1
  56. package/dist/agent-runtime/src/github-wake-event.d.ts +77 -0
  57. package/dist/agent-runtime/src/index.d.ts +74 -0
  58. package/dist/agent-runtime/src/interrupts.cjs +17 -0
  59. package/dist/agent-runtime/src/interrupts.cjs.map +1 -1
  60. package/dist/agent-runtime/src/interrupts.d.ts +348 -0
  61. package/dist/agent-runtime/src/interrupts.js +17 -0
  62. package/dist/agent-runtime/src/interrupts.js.map +1 -1
  63. package/dist/agent-runtime/src/lane-follow.d.ts +121 -0
  64. package/dist/agent-runtime/src/lane-history.cjs +209 -0
  65. package/dist/agent-runtime/src/lane-history.cjs.map +1 -0
  66. package/dist/agent-runtime/src/lane-history.d.ts +175 -0
  67. package/dist/agent-runtime/src/lane-history.js +209 -0
  68. package/dist/agent-runtime/src/lane-history.js.map +1 -0
  69. package/dist/agent-runtime/src/lane-images.d.ts +184 -0
  70. package/dist/agent-runtime/src/message-author.d.ts +43 -0
  71. package/dist/agent-runtime/src/message-text.cjs +15 -0
  72. package/dist/agent-runtime/src/message-text.cjs.map +1 -0
  73. package/dist/agent-runtime/src/message-text.d.ts +47 -0
  74. package/dist/agent-runtime/src/message-text.js +15 -0
  75. package/dist/agent-runtime/src/message-text.js.map +1 -0
  76. package/dist/agent-runtime/src/message-window.cjs +15 -1
  77. package/dist/agent-runtime/src/message-window.cjs.map +1 -1
  78. package/dist/agent-runtime/src/message-window.d.ts +159 -0
  79. package/dist/agent-runtime/src/message-window.js +16 -2
  80. package/dist/agent-runtime/src/message-window.js.map +1 -1
  81. package/dist/agent-runtime/src/messages.cjs +88 -4
  82. package/dist/agent-runtime/src/messages.cjs.map +1 -1
  83. package/dist/agent-runtime/src/messages.d.ts +603 -0
  84. package/dist/agent-runtime/src/messages.js +88 -4
  85. package/dist/agent-runtime/src/messages.js.map +1 -1
  86. package/dist/agent-runtime/src/model-context.d.ts +22 -0
  87. package/dist/agent-runtime/src/offline-status.d.ts +157 -0
  88. package/dist/agent-runtime/src/optimistic-content.d.ts +21 -0
  89. package/dist/agent-runtime/src/protocol.cjs +12 -4
  90. package/dist/agent-runtime/src/protocol.cjs.map +1 -1
  91. package/dist/agent-runtime/src/protocol.d.ts +119 -0
  92. package/dist/agent-runtime/src/protocol.js +13 -5
  93. package/dist/agent-runtime/src/protocol.js.map +1 -1
  94. package/dist/agent-runtime/src/ptc-subcalls.d.ts +51 -0
  95. package/dist/agent-runtime/src/queue.d.ts +138 -0
  96. package/dist/agent-runtime/src/quota-safe-local-storage-session.d.ts +154 -0
  97. package/dist/agent-runtime/src/running-tool-placeholder.cjs +11 -0
  98. package/dist/agent-runtime/src/running-tool-placeholder.cjs.map +1 -0
  99. package/dist/agent-runtime/src/running-tool-placeholder.d.ts +25 -0
  100. package/dist/agent-runtime/src/running-tool-placeholder.js +11 -0
  101. package/dist/agent-runtime/src/running-tool-placeholder.js.map +1 -0
  102. package/dist/agent-runtime/src/runtime-messages.d.ts +104 -0
  103. package/dist/agent-runtime/src/screen-point.d.ts +151 -0
  104. package/dist/agent-runtime/src/sealed-idb.cjs +112 -0
  105. package/dist/agent-runtime/src/sealed-idb.cjs.map +1 -0
  106. package/dist/agent-runtime/src/sealed-idb.d.ts +106 -0
  107. package/dist/agent-runtime/src/sealed-idb.js +112 -0
  108. package/dist/agent-runtime/src/sealed-idb.js.map +1 -0
  109. package/dist/agent-runtime/src/send-recovery.d.ts +40 -0
  110. package/dist/agent-runtime/src/statewire-attach-observer.d.ts +194 -0
  111. package/dist/agent-runtime/src/statewire-diagnostics.d.ts +74 -0
  112. package/dist/agent-runtime/src/statewire-state.d.ts +29 -0
  113. package/dist/agent-runtime/src/statewire-suspended.cjs.map +1 -1
  114. package/dist/agent-runtime/src/statewire-suspended.d.ts +27 -0
  115. package/dist/agent-runtime/src/statewire-suspended.js.map +1 -1
  116. package/dist/agent-runtime/src/statewire-transport.d.ts +40 -0
  117. package/dist/agent-runtime/src/streaming-markdown.d.ts +46 -0
  118. package/dist/agent-runtime/src/subagent-transcripts.cjs +209 -0
  119. package/dist/agent-runtime/src/subagent-transcripts.cjs.map +1 -0
  120. package/dist/agent-runtime/src/subagent-transcripts.d.ts +71 -0
  121. package/dist/agent-runtime/src/subagent-transcripts.js +209 -0
  122. package/dist/agent-runtime/src/subagent-transcripts.js.map +1 -0
  123. package/dist/agent-runtime/src/subagents.cjs +253 -0
  124. package/dist/agent-runtime/src/subagents.cjs.map +1 -0
  125. package/dist/agent-runtime/src/subagents.d.ts +311 -0
  126. package/dist/agent-runtime/src/subagents.js +253 -0
  127. package/dist/agent-runtime/src/subagents.js.map +1 -0
  128. package/dist/agent-runtime/src/subscription-wake-event.d.ts +111 -0
  129. package/dist/agent-runtime/src/thread-extras.d.ts +43 -0
  130. package/dist/agent-runtime/src/thread-handoff.d.ts +364 -0
  131. package/dist/agent-runtime/src/thread-prewarm-controller.d.ts +76 -0
  132. package/dist/agent-runtime/src/thread-prewarm.d.ts +118 -0
  133. package/dist/agent-runtime/src/thread-snapshot-cache.d.ts +99 -0
  134. package/dist/agent-runtime/src/thread-snapshot-mirror.cjs +46 -117
  135. package/dist/agent-runtime/src/thread-snapshot-mirror.cjs.map +1 -1
  136. package/dist/agent-runtime/src/thread-snapshot-mirror.d.ts +101 -0
  137. package/dist/agent-runtime/src/thread-snapshot-mirror.js +17 -88
  138. package/dist/agent-runtime/src/thread-snapshot-mirror.js.map +1 -1
  139. package/dist/agent-runtime/src/thread-status.d.ts +53 -0
  140. package/dist/agent-runtime/src/tool-metadata.d.ts +146 -0
  141. package/dist/agent-runtime/src/tool-names.cjs +67 -0
  142. package/dist/agent-runtime/src/tool-names.cjs.map +1 -1
  143. package/dist/agent-runtime/src/tool-names.d.ts +60 -0
  144. package/dist/agent-runtime/src/tool-names.js +68 -1
  145. package/dist/agent-runtime/src/tool-names.js.map +1 -1
  146. package/dist/agent-runtime/src/tool-outputs.d.ts +35 -0
  147. package/dist/agent-runtime/src/tool-result.cjs +1 -0
  148. package/dist/agent-runtime/src/tool-result.cjs.map +1 -1
  149. package/dist/agent-runtime/src/tool-result.d.ts +126 -0
  150. package/dist/agent-runtime/src/tool-result.js +1 -0
  151. package/dist/agent-runtime/src/tool-result.js.map +1 -1
  152. package/dist/agent-runtime/src/types.d.ts +159 -0
  153. package/dist/agent-runtime/src/use-conversation-list.d.ts +76 -0
  154. package/dist/agent-runtime/src/use-deep-agent-chat-outbox.cjs +136 -0
  155. package/dist/agent-runtime/src/use-deep-agent-chat-outbox.cjs.map +1 -0
  156. package/dist/agent-runtime/src/use-deep-agent-chat-outbox.d.ts +64 -0
  157. package/dist/agent-runtime/src/use-deep-agent-chat-outbox.js +136 -0
  158. package/dist/agent-runtime/src/use-deep-agent-chat-outbox.js.map +1 -0
  159. package/dist/agent-runtime/src/use-deep-agent-config.d.ts +169 -0
  160. package/dist/agent-runtime/src/use-deep-agent-edit-submit.cjs +13 -0
  161. package/dist/agent-runtime/src/use-deep-agent-edit-submit.cjs.map +1 -1
  162. package/dist/agent-runtime/src/use-deep-agent-edit-submit.d.ts +22 -0
  163. package/dist/agent-runtime/src/use-deep-agent-edit-submit.js +13 -0
  164. package/dist/agent-runtime/src/use-deep-agent-edit-submit.js.map +1 -1
  165. package/dist/agent-runtime/src/use-deep-agent-runtime.cjs +20 -2
  166. package/dist/agent-runtime/src/use-deep-agent-runtime.cjs.map +1 -1
  167. package/dist/agent-runtime/src/use-deep-agent-runtime.d.ts +168 -0
  168. package/dist/agent-runtime/src/use-deep-agent-runtime.js +20 -2
  169. package/dist/agent-runtime/src/use-deep-agent-runtime.js.map +1 -1
  170. package/dist/agent-runtime/src/use-deep-agent-thread.cjs +12 -4
  171. package/dist/agent-runtime/src/use-deep-agent-thread.cjs.map +1 -1
  172. package/dist/agent-runtime/src/use-deep-agent-thread.d.ts +320 -0
  173. package/dist/agent-runtime/src/use-deep-agent-thread.js +12 -4
  174. package/dist/agent-runtime/src/use-deep-agent-thread.js.map +1 -1
  175. package/dist/agent-runtime/src/use-deep-agent-voice.cjs +999 -0
  176. package/dist/agent-runtime/src/use-deep-agent-voice.cjs.map +1 -0
  177. package/dist/agent-runtime/src/use-deep-agent-voice.d.ts +409 -0
  178. package/dist/agent-runtime/src/use-deep-agent-voice.js +999 -0
  179. package/dist/agent-runtime/src/use-deep-agent-voice.js.map +1 -0
  180. package/dist/agent-runtime/src/use-deep-agent-window-sync.d.ts +102 -0
  181. package/dist/agent-runtime/src/use-historical-edit-attachments.d.ts +2 -0
  182. package/dist/agent-runtime/src/use-thread-handoff-flow.d.ts +84 -0
  183. package/dist/agent-runtime/src/voice-presentation.d.ts +80 -0
  184. package/dist/agent-runtime/src/voice-turn-grouping.d.ts +28 -0
  185. package/dist/agent-runtime/src/voice-wire-types.d.ts +15 -0
  186. package/dist/agent-runtime/src/withdrawn-turns.d.ts +97 -0
  187. package/dist/chat/AthenaChat.cjs +72 -5
  188. package/dist/chat/AthenaChat.cjs.map +1 -1
  189. package/dist/chat/AthenaChat.js +73 -6
  190. package/dist/chat/AthenaChat.js.map +1 -1
  191. package/dist/chat/StatewireApprovalCard.d.ts +1 -1
  192. package/dist/chat/StatewireClientToolBridge.d.ts +1 -1
  193. package/dist/chat/StatewireQueuedMessages.cjs +11 -4
  194. package/dist/chat/StatewireQueuedMessages.cjs.map +1 -1
  195. package/dist/chat/StatewireQueuedMessages.d.ts +1 -1
  196. package/dist/chat/StatewireQueuedMessages.js +11 -4
  197. package/dist/chat/StatewireQueuedMessages.js.map +1 -1
  198. package/dist/chat/chat-outbox-rows.cjs +223 -0
  199. package/dist/chat/chat-outbox-rows.cjs.map +1 -0
  200. package/dist/chat/chat-outbox-rows.d.ts +29 -0
  201. package/dist/chat/chat-outbox-rows.js +223 -0
  202. package/dist/chat/chat-outbox-rows.js.map +1 -0
  203. package/dist/chat/statewire-approval.d.ts +1 -1
  204. package/dist/chat/statewire-client-tools.d.ts +1 -1
  205. package/dist/chat/super-grouping/SuperGroupingCard.cjs +3 -1
  206. package/dist/chat/super-grouping/SuperGroupingCard.cjs.map +1 -1
  207. package/dist/chat/super-grouping/SuperGroupingCard.d.ts +7 -1
  208. package/dist/chat/super-grouping/SuperGroupingCard.js +3 -1
  209. package/dist/chat/super-grouping/SuperGroupingCard.js.map +1 -1
  210. package/dist/chat/super-grouping/SuperGroupingTranscript.cjs +7 -2
  211. package/dist/chat/super-grouping/SuperGroupingTranscript.cjs.map +1 -1
  212. package/dist/chat/super-grouping/SuperGroupingTranscript.d.ts +2 -2
  213. package/dist/chat/super-grouping/SuperGroupingTranscript.js +7 -2
  214. package/dist/chat/super-grouping/SuperGroupingTranscript.js.map +1 -1
  215. package/dist/chat/super-grouping/activity-timeline.cjs +15 -8
  216. package/dist/chat/super-grouping/activity-timeline.cjs.map +1 -1
  217. package/dist/chat/super-grouping/activity-timeline.d.ts +18 -8
  218. package/dist/chat/super-grouping/activity-timeline.js +15 -8
  219. package/dist/chat/super-grouping/activity-timeline.js.map +1 -1
  220. package/dist/chat/use-statewire-approval-request.cjs +36 -0
  221. package/dist/chat/use-statewire-approval-request.cjs.map +1 -1
  222. package/dist/chat/use-statewire-approval-request.d.ts +49 -1
  223. package/dist/chat/use-statewire-approval-request.js +39 -3
  224. package/dist/chat/use-statewire-approval-request.js.map +1 -1
  225. package/dist/chat-ui/composer/tiptap-composer.cjs +102 -3
  226. package/dist/chat-ui/composer/tiptap-composer.cjs.map +1 -1
  227. package/dist/chat-ui/composer/tiptap-composer.d.ts +32 -1
  228. package/dist/chat-ui/composer/tiptap-composer.js +103 -4
  229. package/dist/chat-ui/composer/tiptap-composer.js.map +1 -1
  230. package/dist/chat-ui/header/conversation-history-panel.d.ts +1 -1
  231. package/dist/chat-ui/index.d.ts +1 -1
  232. package/dist/chat-ui/messages/message-components.cjs +15 -0
  233. package/dist/chat-ui/messages/message-components.cjs.map +1 -1
  234. package/dist/chat-ui/messages/message-components.js +15 -0
  235. package/dist/chat-ui/messages/message-components.js.map +1 -1
  236. package/dist/chat-ui/messages/runtime-message.d.ts +1 -1
  237. package/dist/chat-ui/messages/statewire-continue-run.d.ts +1 -1
  238. package/dist/chat-ui/messages/user-edit-composer.cjs +15 -2
  239. package/dist/chat-ui/messages/user-edit-composer.cjs.map +1 -1
  240. package/dist/chat-ui/messages/user-edit-composer.d.ts +4 -2
  241. package/dist/chat-ui/messages/user-edit-composer.js +15 -2
  242. package/dist/chat-ui/messages/user-edit-composer.js.map +1 -1
  243. package/dist/chat-ui/messages/wake-marker.d.ts +1 -1
  244. package/dist/chat-ui/rich-text/chat-text-schema.cjs +1 -0
  245. package/dist/chat-ui/rich-text/chat-text-schema.cjs.map +1 -1
  246. package/dist/chat-ui/rich-text/chat-text-schema.d.ts +3 -0
  247. package/dist/chat-ui/rich-text/chat-text-schema.js +1 -0
  248. package/dist/chat-ui/rich-text/chat-text-schema.js.map +1 -1
  249. package/dist/chat-ui/statewire.cjs +1 -0
  250. package/dist/chat-ui/statewire.cjs.map +1 -1
  251. package/dist/chat-ui/statewire.d.ts +2 -2
  252. package/dist/chat-ui/statewire.js +2 -1
  253. package/dist/chat-ui/thread/statewire-history-edge.d.ts +1 -1
  254. package/dist/composer/AttachmentContext.cjs +8 -4
  255. package/dist/composer/AttachmentContext.cjs.map +1 -1
  256. package/dist/composer/AttachmentContext.d.ts +7 -0
  257. package/dist/composer/AttachmentContext.js +8 -4
  258. package/dist/composer/AttachmentContext.js.map +1 -1
  259. package/dist/composer/build-composed-message.cjs +34 -0
  260. package/dist/composer/build-composed-message.cjs.map +1 -1
  261. package/dist/composer/build-composed-message.d.ts +20 -0
  262. package/dist/composer/build-composed-message.js +35 -1
  263. package/dist/composer/build-composed-message.js.map +1 -1
  264. package/dist/composer/composer-handoff.cjs +39 -2
  265. package/dist/composer/composer-handoff.cjs.map +1 -1
  266. package/dist/composer/composer-handoff.d.ts +28 -3
  267. package/dist/composer/composer-handoff.js +39 -2
  268. package/dist/composer/composer-handoff.js.map +1 -1
  269. package/dist/composer/useAttachFiles.cjs +15 -2
  270. package/dist/composer/useAttachFiles.cjs.map +1 -1
  271. package/dist/composer/useAttachFiles.d.ts +11 -0
  272. package/dist/composer/useAttachFiles.js +15 -2
  273. package/dist/composer/useAttachFiles.js.map +1 -1
  274. package/dist/composer/useSendMessage.cjs.map +1 -1
  275. package/dist/composer/useSendMessage.d.ts +4 -3
  276. package/dist/composer/useSendMessage.js.map +1 -1
  277. package/dist/diagnostics/athena-diagnostics.cjs.map +1 -1
  278. package/dist/diagnostics/athena-diagnostics.d.ts +3 -1
  279. package/dist/diagnostics/athena-diagnostics.js.map +1 -1
  280. package/dist/index.cjs +13 -0
  281. package/dist/index.cjs.map +1 -1
  282. package/dist/index.d.ts +13 -6
  283. package/dist/index.js +14 -1
  284. package/dist/index.js.map +1 -1
  285. package/dist/offline/chat-outbox.cjs +57 -0
  286. package/dist/offline/chat-outbox.cjs.map +1 -0
  287. package/dist/offline/chat-outbox.d.ts +80 -0
  288. package/dist/offline/chat-outbox.js +57 -0
  289. package/dist/offline/chat-outbox.js.map +1 -0
  290. package/dist/offline/offline-history.d.ts +1 -1
  291. package/dist/provider/AthenaProvider.cjs +162 -8
  292. package/dist/provider/AthenaProvider.cjs.map +1 -1
  293. package/dist/provider/AthenaProvider.d.ts +15 -1
  294. package/dist/provider/AthenaProvider.js +163 -9
  295. package/dist/provider/AthenaProvider.js.map +1 -1
  296. package/dist/provider/statewire-window-context.d.ts +1 -1
  297. package/dist/react/package.json.cjs +1 -1
  298. package/dist/react/package.json.js +1 -1
  299. package/dist/references/src/anchors/file-line-range.d.ts +58 -0
  300. package/dist/references/src/anchors/format.d.ts +21 -0
  301. package/dist/references/src/anchors/message-anchors.d.ts +71 -0
  302. package/dist/references/src/anchors/parse.d.ts +8 -0
  303. package/dist/references/src/anchors/registry-contract.d.ts +24 -0
  304. package/dist/references/src/anchors/registry.d.ts +19 -0
  305. package/dist/references/src/anchors/schemas.d.ts +194 -0
  306. package/dist/references/src/anchors/serialize.d.ts +8 -0
  307. package/dist/references/src/anchors/time.d.ts +78 -0
  308. package/dist/references/src/anchors/types.d.ts +474 -0
  309. package/dist/references/src/asset-bounds.d.ts +27 -0
  310. package/dist/references/src/asset-links.d.ts +23 -0
  311. package/dist/references/src/asset-reference.d.ts +16 -0
  312. package/dist/references/src/formats/format-catalog.d.ts +79 -0
  313. package/dist/references/src/formats/markdown/parse-reference-markdown.d.ts +28 -0
  314. package/dist/references/src/formats/markdown/reference-display-name.d.ts +6 -0
  315. package/dist/references/src/formats/object/asset-object.d.ts +9 -0
  316. package/dist/references/src/formats/object/callable-object.d.ts +6 -0
  317. package/dist/references/src/formats/object/decode-reference-object-payload.d.ts +3 -0
  318. package/dist/references/src/formats/object/external-url-object.d.ts +9 -0
  319. package/dist/references/src/formats/object/group-object.d.ts +9 -0
  320. package/dist/references/src/formats/object/navigation-object.d.ts +9 -0
  321. package/dist/references/src/formats/object/parse-reference-object.d.ts +11 -0
  322. package/dist/references/src/formats/object/person-object.d.ts +9 -0
  323. package/dist/references/src/formats/uri/asset-mention-uri.d.ts +9 -0
  324. package/dist/references/src/formats/uri/asset-spaces-url.d.ts +9 -0
  325. package/dist/references/src/formats/uri/callable-mention-uris.d.ts +9 -0
  326. package/dist/references/src/formats/uri/detect-uri-wire.d.ts +9 -0
  327. package/dist/references/src/formats/uri/group-mention-uri.d.ts +12 -0
  328. package/dist/references/src/formats/uri/navigation-spaces-url.d.ts +14 -0
  329. package/dist/references/src/formats/uri/parse-reference-uri.d.ts +20 -0
  330. package/dist/references/src/formats/uri/person-mention-uri.d.ts +9 -0
  331. package/dist/references/src/formats/uri/template-placeholder.d.ts +12 -0
  332. package/dist/references/src/index.d.ts +47 -0
  333. package/dist/references/src/legacy/index.d.ts +14 -0
  334. package/dist/references/src/legacy/pre-reference-asset-url.d.ts +57 -0
  335. package/dist/references/src/legacy/pre-reference-citation-bridge.d.ts +22 -0
  336. package/dist/references/src/legacy/pre-reference-citation.d.ts +138 -0
  337. package/dist/references/src/legacy/pre-reference-external-url.d.ts +31 -0
  338. package/dist/references/src/legacy/pre-reference-format.d.ts +8 -0
  339. package/dist/references/src/legacy/pre-reference-mention.d.ts +27 -0
  340. package/dist/references/src/legacy/pre-reference-object.d.ts +8 -0
  341. package/dist/references/src/legacy/pre-reference-uri.d.ts +12 -0
  342. package/dist/references/src/legacy.d.ts +2 -0
  343. package/dist/references/src/mention-href-patterns.d.ts +19 -0
  344. package/dist/references/src/mention-node/index.d.ts +5 -0
  345. package/dist/references/src/mention-node/mention-node.d.ts +31 -0
  346. package/dist/references/src/mention-node/resolve-node-attrs.d.ts +27 -0
  347. package/dist/references/src/parse-reference.d.ts +23 -0
  348. package/dist/references/src/schemas.d.ts +463 -0
  349. package/dist/references/src/serialize-reference.d.ts +50 -0
  350. package/dist/references/src/sheet-name.d.ts +10 -0
  351. package/dist/references/src/tool-option-schemas.d.ts +597 -0
  352. package/dist/references/src/types.d.ts +125 -0
  353. package/dist/references/src/version-ref.d.ts +30 -0
  354. package/dist/runtime/statewire-lifecycle.d.ts +1 -1
  355. package/dist/runtime/statewire-model-lane.d.ts +1 -1
  356. package/dist/runtime/statewire-server-lane-context.d.ts +1 -1
  357. package/dist/runtime/statewire-session-key.cjs +7 -0
  358. package/dist/runtime/statewire-session-key.cjs.map +1 -1
  359. package/dist/runtime/statewire-session-key.d.ts +16 -0
  360. package/dist/runtime/statewire-session-key.js +8 -1
  361. package/dist/runtime/statewire-session-key.js.map +1 -1
  362. package/dist/runtime/statewire-session-lane.cjs +48 -0
  363. package/dist/runtime/statewire-session-lane.cjs.map +1 -0
  364. package/dist/runtime/statewire-session-lane.d.ts +29 -0
  365. package/dist/runtime/statewire-session-lane.js +48 -0
  366. package/dist/runtime/statewire-session-lane.js.map +1 -0
  367. package/dist/runtime/statewire-thread-config-lane.d.ts +1 -1
  368. package/dist/runtime/useAthenaStatewireRuntime.cjs +16 -5
  369. package/dist/runtime/useAthenaStatewireRuntime.cjs.map +1 -1
  370. package/dist/runtime/useAthenaStatewireRuntime.d.ts +15 -1
  371. package/dist/runtime/useAthenaStatewireRuntime.js +17 -6
  372. package/dist/runtime/useAthenaStatewireRuntime.js.map +1 -1
  373. package/dist/styles.css +1 -1
  374. package/dist/threads/api.d.ts +1 -1
  375. package/dist/threads/conversation-list-fetcher.d.ts +1 -1
  376. package/dist/threads/index-triggered-refresh.cjs +164 -0
  377. package/dist/threads/index-triggered-refresh.cjs.map +1 -0
  378. package/dist/threads/index-triggered-refresh.d.ts +70 -0
  379. package/dist/threads/index-triggered-refresh.js +164 -0
  380. package/dist/threads/index-triggered-refresh.js.map +1 -0
  381. package/dist/threads/offline-session-list.d.ts +1 -1
  382. package/dist/threads/pull-request-display.d.ts +1 -1
  383. package/dist/threads/session-list-model.d.ts +1 -1
  384. package/dist/threads/session-list-tab-share.cjs +150 -0
  385. package/dist/threads/session-list-tab-share.cjs.map +1 -0
  386. package/dist/threads/session-list-tab-share.d.ts +73 -0
  387. package/dist/threads/session-list-tab-share.js +150 -0
  388. package/dist/threads/session-list-tab-share.js.map +1 -0
  389. package/dist/threads/session-row-parts.d.ts +1 -1
  390. package/dist/threads/sessions-query.d.ts +1 -1
  391. package/dist/threads/statewire-thread-list.cjs +42 -16
  392. package/dist/threads/statewire-thread-list.cjs.map +1 -1
  393. package/dist/threads/statewire-thread-list.d.ts +11 -2
  394. package/dist/threads/statewire-thread-list.js +43 -17
  395. package/dist/threads/statewire-thread-list.js.map +1 -1
  396. package/dist/threads/thread-prefetcher.d.ts +1 -1
  397. package/dist/threads/use-athena-session-attention.d.ts +1 -1
  398. package/dist/threads/use-athena-sessions.cjs +32 -22
  399. package/dist/threads/use-athena-sessions.cjs.map +1 -1
  400. package/dist/threads/use-athena-sessions.js +33 -23
  401. package/dist/threads/use-athena-sessions.js.map +1 -1
  402. package/dist/threads/use-rest-conversation-history.d.ts +1 -1
  403. package/dist/threads/use-statewire-conversation-history.d.ts +5 -5
  404. package/dist/tiptap-markdown-table/src/markdown-table-serializer.d.ts +56 -0
  405. package/dist/tools/NestedPtcMessages.cjs +14 -9
  406. package/dist/tools/NestedPtcMessages.cjs.map +1 -1
  407. package/dist/tools/NestedPtcMessages.d.ts +9 -0
  408. package/dist/tools/NestedPtcMessages.js +6 -1
  409. package/dist/tools/NestedPtcMessages.js.map +1 -1
  410. package/dist/tools/index.d.ts +1 -1
  411. package/dist/tools/primitives.d.ts +1 -1
  412. package/dist/tools/subagent-task-tool-ui.cjs +494 -0
  413. package/dist/tools/subagent-task-tool-ui.cjs.map +1 -0
  414. package/dist/tools/subagent-task-tool-ui.d.ts +109 -0
  415. package/dist/tools/subagent-task-tool-ui.js +494 -0
  416. package/dist/tools/subagent-task-tool-ui.js.map +1 -0
  417. package/dist/tools/tool-fallback.d.ts +1 -1
  418. package/dist/tools/tool-icons.d.ts +1 -1
  419. package/dist/tools/tool-summary.d.ts +1 -1
  420. package/dist/tools/tool-uis.cjs +4 -0
  421. package/dist/tools/tool-uis.cjs.map +1 -1
  422. package/dist/tools/tool-uis.js +4 -0
  423. package/dist/tools/tool-uis.js.map +1 -1
  424. package/dist/voice/chat.cjs +6 -0
  425. package/dist/voice/chat.cjs.map +1 -0
  426. package/dist/voice/chat.d.ts +2 -0
  427. package/dist/voice/chat.js +6 -0
  428. package/dist/voice/chat.js.map +1 -0
  429. package/dist/voice/livekit-join.cjs +119 -0
  430. package/dist/voice/livekit-join.cjs.map +1 -0
  431. package/dist/voice/livekit-join.d.ts +8 -0
  432. package/dist/voice/livekit-join.js +119 -0
  433. package/dist/voice/livekit-join.js.map +1 -0
  434. package/dist/voice/livekit.cjs +32 -0
  435. package/dist/voice/livekit.cjs.map +1 -0
  436. package/dist/voice/livekit.d.ts +80 -0
  437. package/dist/voice/livekit.js +32 -0
  438. package/dist/voice/livekit.js.map +1 -0
  439. package/package.json +20 -10
package/dist/index.cjs CHANGED
@@ -39,10 +39,12 @@ const statewireThreadList = require("./threads/statewire-thread-list.cjs");
39
39
  const WaitingOnYouBanner = require("./chat/WaitingOnYouBanner.cjs");
40
40
  const wakeMarker = require("./chat-ui/messages/wake-marker.cjs");
41
41
  const offlineHistory = require("./offline/offline-history.cjs");
42
+ const chatOutbox = require("./offline/chat-outbox.cjs");
42
43
  const tiptapText = require("./chat/tiptap-text.cjs");
43
44
  const athenaCitationLinks = require("./chat/athena-citation-links.cjs");
44
45
  const tooltipIconButton = require("./chat/tooltip-icon-button.cjs");
45
46
  const toolUis = require("./tools/tool-uis.cjs");
47
+ const subagentTaskToolUi = require("./tools/subagent-task-tool-ui.cjs");
46
48
  const primitives = require("./tools/primitives.cjs");
47
49
  const miscToolUis = require("./tools/misc-tool-uis.cjs");
48
50
  const toolIcons = require("./tools/tool-icons.cjs");
@@ -134,6 +136,8 @@ const toolMetadata = require("./agent-runtime/src/tool-metadata.cjs");
134
136
  const githubWakeEvent = require("./agent-runtime/src/github-wake-event.cjs");
135
137
  const threadExtras = require("./agent-runtime/src/thread-extras.cjs");
136
138
  const toolAppearance = require("./tools/tool-appearance.cjs");
139
+ const subagents = require("./agent-runtime/src/subagents.cjs");
140
+ const chatOutboxSignals = require("./agent-runtime/src/chat-outbox-signals.cjs");
137
141
  exports.ATHENA_REACT_SDK_VERSION = version.ATHENA_REACT_SDK_VERSION;
138
142
  exports.athenaDiagnostics = athenaDiagnostics.athenaDiagnostics;
139
143
  exports.installAthenaDiagnosticsGlobal = athenaDiagnostics.installAthenaDiagnosticsGlobal;
@@ -197,6 +201,7 @@ exports.workedDurationMs = turnTiming.workedDurationMs;
197
201
  exports.defaultGetToolGroupKey = toolkitMap.defaultGetToolGroupKey;
198
202
  exports.StatewireApprovalCard = StatewireApprovalCard.StatewireApprovalCard;
199
203
  exports.useStatewireApprovalRequest = useStatewireApprovalRequest.useStatewireApprovalRequest;
204
+ exports.useStatewireApprovalWait = useStatewireApprovalRequest.useStatewireApprovalWait;
200
205
  exports.useAthenaRunLive = useAthenaRunLive.useAthenaRunLive;
201
206
  exports.StatewireHistoryEdge = statewireHistoryEdge.StatewireHistoryEdge;
202
207
  exports.ThreadLoadingOverlay = threadLoadingOverlay.ThreadLoadingOverlay;
@@ -224,6 +229,11 @@ exports.OFFLINE_SNAPSHOT_READ_WAIT_MS = offlineHistory.OFFLINE_SNAPSHOT_READ_WAI
224
229
  exports.OfflineSnapshotBanner = offlineHistory.OfflineSnapshotBanner;
225
230
  exports.formatOfflineSnapshotTime = offlineHistory.formatOfflineSnapshotTime;
226
231
  exports.useAthenaOfflineSnapshotAt = offlineHistory.useAthenaOfflineSnapshotAt;
232
+ exports.clearChatOutbox = chatOutbox.clearChatOutbox;
233
+ exports.clearUnopenableChatOutbox = chatOutbox.clearUnopenableChatOutbox;
234
+ exports.countChatOutboxMessages = chatOutbox.countChatOutboxMessages;
235
+ exports.listChatOutboxMessages = chatOutbox.listChatOutboxMessages;
236
+ exports.subscribeChatOutbox = chatOutbox.subscribeChatOutbox;
227
237
  exports.TiptapText = tiptapText.TiptapText;
228
238
  exports.isAthenaCitationUrl = athenaCitationLinks.isAthenaCitationUrl;
229
239
  exports.parseAthenaCitationLink = athenaCitationLinks.parseAthenaCitationLink;
@@ -249,6 +259,7 @@ exports.UpdateSheetRangeToolUI = toolUis.UpdateSheetRangeToolUI;
249
259
  exports.WebSearchToolUI = toolUis.WebSearchToolUI;
250
260
  exports.createAssetToolUI = toolUis.createAssetToolUI;
251
261
  exports.resetAssetAutoOpen = toolUis.resetAssetAutoOpen;
262
+ exports.SubagentTaskToolUI = subagentTaskToolUi.SubagentTaskToolUI;
252
263
  exports.CopyToolSpecButton = primitives.CopyToolSpecButton;
253
264
  exports.ExpandableSection = primitives.ExpandableSection;
254
265
  exports.ToolCard = primitives.ToolCard;
@@ -539,4 +550,6 @@ exports.isGithubWakeMessage = githubWakeEvent.isGithubWakeMessage;
539
550
  exports.readGithubWakeEvent = githubWakeEvent.readGithubWakeEvent;
540
551
  exports.hasStatewireThreadExtras = threadExtras.hasStatewireThreadExtras;
541
552
  exports.useToolAppearance = toolAppearance.useToolAppearance;
553
+ exports.useTurnToolCallsAwaitingApproval = subagents.useTurnToolCallsAwaitingApproval;
554
+ exports.windowInFrontSignal = chatOutboxSignals.windowInFrontSignal;
542
555
  //# sourceMappingURL=index.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.cjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"index.cjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
package/dist/index.d.ts CHANGED
@@ -25,6 +25,9 @@ export { StatewireApprovalCard } from './chat/StatewireApprovalCard';
25
25
  export type { StatewireApprovalCardProps, StatewireApprovalEditorContext, StatewireApprovalRequestContext, } from './chat/StatewireApprovalCard';
26
26
  export { useStatewireApprovalRequest } from './chat/use-statewire-approval-request';
27
27
  export type { StatewireApprovalRequest, StatewireInterruptPredicate, UseStatewireApprovalRequestOptions, } from './chat/use-statewire-approval-request';
28
+ export { useStatewireApprovalWait } from './chat/use-statewire-approval-request';
29
+ export type { StatewireApprovalWait } from './chat/use-statewire-approval-request';
30
+ export { useTurnToolCallsAwaitingApproval } from './agent-runtime/src/index';
28
31
  export { useAthenaRunLive } from './chat/use-athena-run-live';
29
32
  export { StatewireHistoryEdge } from './chat-ui/thread/statewire-history-edge';
30
33
  export type { StatewireHistoryEdgeProps } from './chat-ui/thread/statewire-history-edge';
@@ -37,8 +40,8 @@ export { StatewireConnectionBanner, StatewireErrorBanner, } from './chat/statewi
37
40
  export type { StatewireErrorBannerProps } from './chat/statewire-banners';
38
41
  export { RUN_START_REFUSAL_FALLBACK_MESSAGE, StatewireRunRefusalNotice, } from './chat/StatewireRunRefusalNotice';
39
42
  export type { StatewireRunRefusalNoticeProps } from './chat/StatewireRunRefusalNotice';
40
- export { COLLAB_AGENT_CHANNEL_SESSION_MISMATCH, readRunStartRefusal, } from '@athenaintel/agent-runtime';
41
- export type { RunStartRefusal } from '@athenaintel/agent-runtime';
43
+ export { COLLAB_AGENT_CHANNEL_SESSION_MISMATCH, readRunStartRefusal, } from './agent-runtime/src/index';
44
+ export type { RunStartRefusal } from './agent-runtime/src/index';
42
45
  export { StatewireClientToolBridge } from './chat/StatewireClientToolBridge';
43
46
  export { collectStatewireClientTools, statewireClientToolWireEntries, } from './chat/statewire-client-tools';
44
47
  export type { StatewireClientTool } from './chat/statewire-client-tools';
@@ -53,6 +56,9 @@ export { WakeMarkerCard, WakeMarkerMessage } from './chat-ui/messages/wake-marke
53
56
  export type { WakeMarkerCardProps } from './chat-ui/messages/wake-marker';
54
57
  export { formatOfflineSnapshotTime, OFFLINE_SNAPSHOT_READ_WAIT_MS, OfflineSnapshotBanner, useAthenaOfflineSnapshotAt, } from './offline/offline-history';
55
58
  export type { AthenaOfflineHistory, OfflineSnapshotBannerProps, } from './offline/offline-history';
59
+ export { type AthenaChatOutbox, clearChatOutbox, clearUnopenableChatOutbox, type ChatOutboxMessageSummary, countChatOutboxMessages, listChatOutboxMessages, subscribeChatOutbox, } from './offline/chat-outbox';
60
+ /** For an `AthenaChatOutbox` host: the key purposes, and the desktop's "window in front" signal. */
61
+ export { type ChatOutboxKeyPurpose, windowInFrontSignal } from './agent-runtime/src/index';
56
62
  export { asHitlApproval, hasStatewireThreadExtras, HITL_PENDING_RESUME_GRACE_MS, isPendingInterrupt, readInterruptMessage, } from './chat/statewire-approval';
57
63
  export type { HitlApprovalPayload } from './chat/statewire-approval';
58
64
  export { TiptapText } from './chat/tiptap-text';
@@ -62,12 +68,13 @@ export { TooltipIconButton } from './chat/tooltip-icon-button';
62
68
  export type { TooltipIconButtonProps } from './chat/tooltip-icon-button';
63
69
  export { TOOL_UI_REGISTRY } from './tools/tool-uis';
64
70
  export { WebSearchToolUI, BrowseToolUI, OpenBrowserToolUI, EmailSearchToolUI, CreateDocumentToolUI, CreateSheetToolUI, CreatePresentationToolUI, CreateNotebookToolUI, RunPythonCodeToolUI, OpenAssetToolUI, CreateEmailDraftToolUI, UpdateSheetRangeToolUI, DescribeDatabaseToolUI, ListDatabaseTablesToolUI, GetDatabaseTableSchemaToolUI, RunSqlToolUI, createAssetToolUI, resetAssetAutoOpen, } from './tools/tool-uis';
71
+ export { SubagentTaskToolUI } from './tools/subagent-task-tool-ui';
65
72
  export { CopyToolSpecButton, ExpandableSection, formatToolName, normalizeResult, ToolCard, truncate, } from './tools/primitives';
66
73
  export type { ToolStatus } from './tools/primitives';
67
74
  export { InstallPackageToolUI } from './tools/misc-tool-uis';
68
75
  export { TOOL_ICONS, toolIcon } from './tools/tool-icons';
69
- export { classifyToolResult, describeToolArgs, getToolDisplayMeta, isToolResultSuccess, resultMessage, toolActiveLabel, toolCompletedLabel, } from '@athenaintel/agent-runtime';
70
- export type { ToolDisplayMeta, ToolIconKey, ToolResultClassification, } from '@athenaintel/agent-runtime';
76
+ export { classifyToolResult, describeToolArgs, getToolDisplayMeta, isToolResultSuccess, resultMessage, toolActiveLabel, toolCompletedLabel, } from './agent-runtime/src/index';
77
+ export type { ToolDisplayMeta, ToolIconKey, ToolResultClassification, } from './agent-runtime/src/index';
71
78
  export { HiddenWriteTodosToolUI, PlanStepMarker, WriteTodosToolUI, parseTodoPlan, } from './tools/write-todos-tool-ui';
72
79
  export { useLatestTodoPlan } from './tools/todo-plan-store';
73
80
  export type { LatestTodoPlan } from './tools/todo-plan-store';
@@ -145,8 +152,8 @@ export type { SessionStatusChip, SessionStatusTone, SessionsColumn, SessionsColu
145
152
  export type { ThreadReadStateTarget } from './threads/use-thread-read-state';
146
153
  export { groupSessions, orderedPullRequests, pullRequestChip, pullRequestChipState, sessionIndicator, sessionListGroupOf, sessionOriginBadge, sessionOriginLabel, sessionSecondaryLine, WEB_APP_ORIGIN_LABEL, } from './threads/session-list-model';
147
154
  export type { PullRequestChip, PullRequestChipState, SessionIndicator, SessionLineTone, SessionListGroup, SessionListSection, SessionOriginBadges, SessionSecondaryLine, } from './threads/session-list-model';
148
- export { deriveConversationAttention, githubWakeEventLabel, githubWakeMarkerText, isGithubWakeMessage, readGithubWakeEvent, } from '@athenaintel/agent-runtime';
149
- export type { ConversationAttention, ConversationAttentionSource, ConversationPullRequest, ConversationSummary, ConversationWake, GithubWakeEvent, } from '@athenaintel/agent-runtime';
155
+ export { deriveConversationAttention, githubWakeEventLabel, githubWakeMarkerText, isGithubWakeMessage, readGithubWakeEvent, } from './agent-runtime/src/index';
156
+ export type { ConversationAttention, ConversationAttentionSource, ConversationPullRequest, ConversationSummary, ConversationWake, GithubWakeEvent, } from './agent-runtime/src/index';
150
157
  export type { ThreadFavoriteResponse, ThreadInboxDismissResponse, ThreadListFilterBody, ThreadListResponse, ThreadPullRequest, ThreadRenameResponse, ThreadSummary, ThreadWake, } from './threads/api';
151
158
  export { useRefreshThreadList } from './threads/statewire-thread-list';
152
159
  export { useAthenaThreadId, AthenaThreadIdContext, useAthenaStatewireThreadId, } from './threads/thread-id-context';
package/dist/index.js CHANGED
@@ -20,7 +20,7 @@ import { splitTurnSegments } from "./chat/super-grouping/turn-segments.js";
20
20
  import { formatWorkDuration, readTurnTiming, workedDurationMs } from "./chat/super-grouping/turn-timing.js";
21
21
  import { defaultGetToolGroupKey } from "./chat/super-grouping/toolkit-map.js";
22
22
  import { StatewireApprovalCard } from "./chat/StatewireApprovalCard.js";
23
- import { useStatewireApprovalRequest } from "./chat/use-statewire-approval-request.js";
23
+ import { useStatewireApprovalRequest, useStatewireApprovalWait } from "./chat/use-statewire-approval-request.js";
24
24
  import { useAthenaRunLive } from "./chat/use-athena-run-live.js";
25
25
  import { StatewireHistoryEdge } from "./chat-ui/thread/statewire-history-edge.js";
26
26
  import { ThreadLoadingOverlay } from "./chat-ui/thread/thread-loading-overlay.js";
@@ -37,10 +37,12 @@ import { threadSummaryFromConversation, useAthenaStatewireThreadList, useRefresh
37
37
  import { WaitingOnYouBanner, WaitingOnYouBannerView } from "./chat/WaitingOnYouBanner.js";
38
38
  import { WakeMarkerCard, WakeMarkerMessage } from "./chat-ui/messages/wake-marker.js";
39
39
  import { OFFLINE_SNAPSHOT_READ_WAIT_MS, OfflineSnapshotBanner, formatOfflineSnapshotTime, useAthenaOfflineSnapshotAt } from "./offline/offline-history.js";
40
+ import { clearChatOutbox, clearUnopenableChatOutbox, countChatOutboxMessages, listChatOutboxMessages, subscribeChatOutbox } from "./offline/chat-outbox.js";
40
41
  import { TiptapText } from "./chat/tiptap-text.js";
41
42
  import { isAthenaCitationUrl, parseAthenaCitationLink, useAthenaCitationLinkHandler, useAthenaLinkClickHandler } from "./chat/athena-citation-links.js";
42
43
  import { TooltipIconButton } from "./chat/tooltip-icon-button.js";
43
44
  import { BrowseToolUI, CreateDocumentToolUI, CreateEmailDraftToolUI, CreateNotebookToolUI, CreatePresentationToolUI, CreateSheetToolUI, DescribeDatabaseToolUI, EmailSearchToolUI, GetDatabaseTableSchemaToolUI, ListDatabaseTablesToolUI, OpenAssetToolUI, OpenBrowserToolUI, RunPythonCodeToolUI, RunSqlToolUI, TOOL_UI_REGISTRY, UpdateSheetRangeToolUI, WebSearchToolUI, createAssetToolUI, resetAssetAutoOpen } from "./tools/tool-uis.js";
45
+ import { SubagentTaskToolUI } from "./tools/subagent-task-tool-ui.js";
44
46
  import { CopyToolSpecButton, ExpandableSection, ToolCard, normalizeResult, truncate } from "./tools/primitives.js";
45
47
  import { InstallPackageToolUI } from "./tools/misc-tool-uis.js";
46
48
  import { TOOL_ICONS, toolIcon } from "./tools/tool-icons.js";
@@ -132,6 +134,8 @@ import { describeToolArgs, formatToolName, getToolDisplayMeta, toolActiveLabel,
132
134
  import { githubWakeEventLabel, githubWakeMarkerText, isGithubWakeMessage, readGithubWakeEvent } from "./agent-runtime/src/github-wake-event.js";
133
135
  import { hasStatewireThreadExtras } from "./agent-runtime/src/thread-extras.js";
134
136
  import { useToolAppearance } from "./tools/tool-appearance.js";
137
+ import { useTurnToolCallsAwaitingApproval } from "./agent-runtime/src/subagents.js";
138
+ import { windowInFrontSignal } from "./agent-runtime/src/chat-outbox-signals.js";
135
139
  export {
136
140
  ATHENA_REACT_SDK_VERSION,
137
141
  ATHENA_REPO_SEARCH_PATH,
@@ -252,6 +256,7 @@ export {
252
256
  StatewireHistoryEdge,
253
257
  StatewireQueuedMessages,
254
258
  StatewireRunRefusalNotice,
259
+ SubagentTaskToolUI,
255
260
  SuperGroupingCard,
256
261
  SuperGroupingFinalText,
257
262
  SuperGroupingProvider,
@@ -322,6 +327,8 @@ export {
322
327
  channelLabel,
323
328
  classifyToolResult,
324
329
  clearAutoOpenedAssets,
330
+ clearChatOutbox,
331
+ clearUnopenableChatOutbox,
325
332
  cn,
326
333
  collectAssetTitles,
327
334
  collectStatewireClientTools,
@@ -335,6 +342,7 @@ export {
335
342
  conversationDisplayTitle,
336
343
  conversationSummaryFromIndexEntry,
337
344
  countActivityTools,
345
+ countChatOutboxMessages,
338
346
  createAssetToolUI,
339
347
  createAthenaSpacesUrl,
340
348
  createAttachmentStore,
@@ -405,6 +413,7 @@ export {
405
413
  isThreadFavoriteUnavailableError,
406
414
  isThreadRenameUnavailableError,
407
415
  isToolResultSuccess,
416
+ listChatOutboxMessages,
408
417
  listThreads,
409
418
  liveDesktopViewerUrl,
410
419
  matchesSessionsQuery,
@@ -462,6 +471,7 @@ export {
462
471
  splitSheetPrefix,
463
472
  splitTurnSegments,
464
473
  statewireClientToolWireEntries,
474
+ subscribeChatOutbox,
465
475
  summarizeToolCall,
466
476
  taskProgress,
467
477
  themeToStyleVars,
@@ -527,10 +537,13 @@ export {
527
537
  useSessionWorkbench,
528
538
  useSessionWorkbenchWorkspace,
529
539
  useStatewireApprovalRequest,
540
+ useStatewireApprovalWait,
530
541
  useStatewireConversationHistory,
531
542
  useStatewireHistory,
532
543
  useStatewireToolOutputs,
533
544
  useToolAppearance,
545
+ useTurnToolCallsAwaitingApproval,
546
+ windowInFrontSignal,
534
547
  withCaptureGateBypass,
535
548
  workedDurationMs,
536
549
  workspaceComputers,
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -0,0 +1,57 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
+ const chatOutboxStore = require("../agent-runtime/src/chat-outbox-store.cjs");
4
+ const chatOutbox = require("../agent-runtime/src/chat-outbox.cjs");
5
+ const ownerStores = /* @__PURE__ */ new Map();
6
+ function keylessHost(ownerId) {
7
+ return { ownerId, getKey: async () => null };
8
+ }
9
+ function ownerStore(ownerId, host) {
10
+ let owner = ownerStores.get(ownerId);
11
+ if (!owner) {
12
+ const current = { current: host ?? keylessHost(ownerId) };
13
+ owner = {
14
+ host: current,
15
+ store: chatOutboxStore.createIndexedDbChatOutboxStore({
16
+ ownerId,
17
+ getKey: (_ownerId, purpose) => current.current.getKey(purpose)
18
+ })
19
+ };
20
+ ownerStores.set(ownerId, owner);
21
+ }
22
+ if (host) owner.host.current = host;
23
+ return owner.store;
24
+ }
25
+ function chatOutboxStoreFor(host) {
26
+ return ownerStore(host.ownerId, host);
27
+ }
28
+ function countChatOutboxMessages(ownerId) {
29
+ return ownerStore(ownerId).count();
30
+ }
31
+ function subscribeChatOutbox(ownerId, listener) {
32
+ return ownerStore(ownerId).subscribe(listener);
33
+ }
34
+ async function listChatOutboxMessages(ownerId, now = Date.now()) {
35
+ const records = await ownerStore(ownerId).listAll();
36
+ return records.map(({ entry, claim, failure, memoryOnly }) => ({
37
+ id: entry.id,
38
+ threadId: entry.threadId,
39
+ text: entry.text,
40
+ newChat: entry.newChat,
41
+ status: failure ? "failed" : claim && now - claim.at < chatOutbox.CHAT_OUTBOX_CLAIM_LEASE_MS ? "sending" : now - entry.queuedAt > chatOutbox.CHAT_OUTBOX_ASK_AFTER_MS ? "ask" : "waiting",
42
+ inMemory: memoryOnly === true
43
+ }));
44
+ }
45
+ function clearChatOutbox(ownerId) {
46
+ return ownerStore(ownerId).clear();
47
+ }
48
+ function clearUnopenableChatOutbox(ownerId) {
49
+ return chatOutboxStore.createIndexedDbChatOutboxStore({ ownerId, getKey: async () => null }).clear();
50
+ }
51
+ exports.chatOutboxStoreFor = chatOutboxStoreFor;
52
+ exports.clearChatOutbox = clearChatOutbox;
53
+ exports.clearUnopenableChatOutbox = clearUnopenableChatOutbox;
54
+ exports.countChatOutboxMessages = countChatOutboxMessages;
55
+ exports.listChatOutboxMessages = listChatOutboxMessages;
56
+ exports.subscribeChatOutbox = subscribeChatOutbox;
57
+ //# sourceMappingURL=chat-outbox.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"chat-outbox.cjs","sources":["../../src/offline/chat-outbox.ts"],"sourcesContent":["import {\n CHAT_OUTBOX_ASK_AFTER_MS,\n CHAT_OUTBOX_CLAIM_LEASE_MS,\n type ChatOutboxKeyPurpose,\n type ChatOutboxSignal,\n type ChatOutboxStore,\n createIndexedDbChatOutboxStore,\n} from '@athenaintel/agent-runtime';\n\n/**\n * Opt-in: messages typed while Athena can't be reached wait on this device, sealed with the host's\n * key, and are sent once Athena is back while the app is in front, after a countdown the person\n * can cancel (`@athenaintel/agent-runtime`'s chat outbox, shown at the top of the queue tray).\n * Without it a send goes to the transport as before.\n *\n * - `ownerId` names whose they are (the signed-in person, with the environment). Another owner's\n * messages are never shown or sent: each owner's are sealed under their own key.\n * - `getKey(purpose)` returns the AES-GCM key: `read` opens what is kept (the key if one exists,\n * never made for this), `write` keeps a new message (only while the deployment lets devices keep\n * copies). `null` keeps a new message in memory only, for as long as the page stays open. Unlike\n * the chat history's, this key guards the only copy of what someone wrote: a host must never\n * replace or drop it except at a sign-out the person chose.\n * - `reachability` says Athena can be reached: the host's own model (the device online AND agora\n * answering a health read, as Midas's main process decides it), by default the browser being\n * online. Either way a conversation whose own channel keeps failing to connect counts as out of\n * reach too.\n * - `foreground` says the app is in front; by default a visible document. A desktop host passes\n * `windowInFrontSignal()` (visible and focused).\n * - `openThread` opens another of the person's conversations the tray lists as holding waiting\n * messages (`newChat`: one that never started). Without it, a provider with a thread list\n * switches to it; otherwise the tray names it without Open.\n */\nexport interface AthenaChatOutbox {\n ownerId: string;\n getKey: (purpose: ChatOutboxKeyPurpose) => Promise<CryptoKey | null>;\n reachability?: ChatOutboxSignal;\n foreground?: ChatOutboxSignal;\n openThread?: (target: { threadId: string; newChat: boolean }) => void;\n}\n\ninterface OwnerStore {\n store: ChatOutboxStore;\n /** The latest host for this owner: the store asks it for the key. */\n host: { current: AthenaChatOutbox };\n}\n\n// process-local: one store per owner in this page, so every provider of the person (a chat in a\n// tab, another in a pane) shares one change bus and one memory of the messages this device could\n// not keep: a thread switch or a closed tab never loses them, and a sign-out counts them.\nconst ownerStores = new Map<string, OwnerStore>();\n\n/** A host that has no key to give (counting and deleting never need one). */\nfunction keylessHost(ownerId: string): AthenaChatOutbox {\n return { ownerId, getKey: async () => null };\n}\n\nfunction ownerStore(ownerId: string, host?: AthenaChatOutbox): ChatOutboxStore {\n let owner = ownerStores.get(ownerId);\n if (!owner) {\n const current = { current: host ?? keylessHost(ownerId) };\n owner = {\n host: current,\n store: createIndexedDbChatOutboxStore({\n ownerId,\n getKey: (_ownerId, purpose) => current.current.getKey(purpose),\n }),\n };\n ownerStores.set(ownerId, owner);\n }\n if (host) owner.host.current = host;\n return owner.store;\n}\n\n/** The page's chat outbox store for `host`'s owner, made on first use. */\nexport function chatOutboxStoreFor(host: AthenaChatOutbox): ChatOutboxStore {\n return ownerStore(host.ownerId, host);\n}\n\n/**\n * How many messages wait for `ownerId` (kept on the device, including records this build cannot\n * open, and waiting in this page's memory), counted without opening them. Rejects when the\n * device's records cannot be counted at all.\n */\nexport function countChatOutboxMessages(ownerId: string): Promise<number> {\n return ownerStore(ownerId).count();\n}\n\n/**\n * Calls `listener` after any change to `ownerId`'s waiting messages, this window's or another's\n * (one kept, handed to its conversation, cancelled, failed or retried), so a host can show how many\n * wait (`countChatOutboxMessages`) without asking on a timer. Returns what stops it.\n */\nexport function subscribeChatOutbox(ownerId: string, listener: () => void): () => void {\n return ownerStore(ownerId).subscribe(listener);\n}\n\n/** A message waiting in an owner's outbox, as a host lists it (its \"Waiting to sync\" list). */\nexport interface ChatOutboxMessageSummary {\n id: string;\n threadId: string;\n /** The text as it will be sent. */\n text: string;\n /** Typed into a chat that had never started. */\n newChat: boolean;\n /**\n * Where it stands, as the queue tray shows it: waiting to be sent, being handed to its\n * conversation now (a window's claim on it still holds), waiting for the person (it waited more\n * than a day: Send, Edit or Discard), or failed (Retry or Discard; never retried on its own).\n */\n status: 'waiting' | 'sending' | 'ask' | 'failed';\n /** Kept only in this page's memory: this device could not keep it. */\n inMemory: boolean;\n}\n\n/**\n * The messages waiting for `ownerId` that this page can open (oldest first), each with where it\n * stands, for a host's list of what waits to sync; the tray in the conversation acts on them.\n * Records this page cannot open (no key here, a newer build's) are left out, so a host counts with\n * `countChatOutboxMessages`.\n */\nexport async function listChatOutboxMessages(\n ownerId: string,\n now: number = Date.now(),\n): Promise<ChatOutboxMessageSummary[]> {\n const records = await ownerStore(ownerId).listAll();\n return records.map(({ entry, claim, failure, memoryOnly }) => ({\n id: entry.id,\n threadId: entry.threadId,\n text: entry.text,\n newChat: entry.newChat,\n status: failure\n ? 'failed'\n : claim && now - claim.at < CHAT_OUTBOX_CLAIM_LEASE_MS\n ? 'sending'\n : now - entry.queuedAt > CHAT_OUTBOX_ASK_AFTER_MS\n ? 'ask'\n : 'waiting',\n inMemory: memoryOnly === true,\n }));\n}\n\n/** A sign-out the person chose: every message waiting for `ownerId` goes, on the device and in memory. */\nexport function clearChatOutbox(ownerId: string): Promise<void> {\n return ownerStore(ownerId).clear();\n}\n\n/**\n * Deletes the records kept on this device for `ownerId`, never the messages waiting in this page's\n * memory: for a host whose key for them no longer exists (a chosen sign-out deleted it before the\n * page could delete the records), so nothing can ever open them and they must not be counted.\n */\nexport function clearUnopenableChatOutbox(ownerId: string): Promise<void> {\n return createIndexedDbChatOutboxStore({ ownerId, getKey: async () => null }).clear();\n}\n"],"names":["createIndexedDbChatOutboxStore","CHAT_OUTBOX_CLAIM_LEASE_MS","CHAT_OUTBOX_ASK_AFTER_MS"],"mappings":";;;;AAiDA,MAAM,kCAAkB,IAAA;AAGxB,SAAS,YAAY,SAAmC;AACtD,SAAO,EAAE,SAAS,QAAQ,YAAY,KAAA;AACxC;AAEA,SAAS,WAAW,SAAiB,MAA0C;AAC7E,MAAI,QAAQ,YAAY,IAAI,OAAO;AACnC,MAAI,CAAC,OAAO;AACV,UAAM,UAAU,EAAE,SAAS,QAAQ,YAAY,OAAO,EAAA;AACtD,YAAQ;AAAA,MACN,MAAM;AAAA,MACN,OAAOA,gBAAAA,+BAA+B;AAAA,QACpC;AAAA,QACA,QAAQ,CAAC,UAAU,YAAY,QAAQ,QAAQ,OAAO,OAAO;AAAA,MAAA,CAC9D;AAAA,IAAA;AAEH,gBAAY,IAAI,SAAS,KAAK;AAAA,EAChC;AACA,MAAI,KAAM,OAAM,KAAK,UAAU;AAC/B,SAAO,MAAM;AACf;AAGO,SAAS,mBAAmB,MAAyC;AAC1E,SAAO,WAAW,KAAK,SAAS,IAAI;AACtC;AAOO,SAAS,wBAAwB,SAAkC;AACxE,SAAO,WAAW,OAAO,EAAE,MAAA;AAC7B;AAOO,SAAS,oBAAoB,SAAiB,UAAkC;AACrF,SAAO,WAAW,OAAO,EAAE,UAAU,QAAQ;AAC/C;AA0BA,eAAsB,uBACpB,SACA,MAAc,KAAK,OACkB;AACrC,QAAM,UAAU,MAAM,WAAW,OAAO,EAAE,QAAA;AAC1C,SAAO,QAAQ,IAAI,CAAC,EAAE,OAAO,OAAO,SAAS,kBAAkB;AAAA,IAC7D,IAAI,MAAM;AAAA,IACV,UAAU,MAAM;AAAA,IAChB,MAAM,MAAM;AAAA,IACZ,SAAS,MAAM;AAAA,IACf,QAAQ,UACJ,WACA,SAAS,MAAM,MAAM,KAAKC,WAAAA,6BACxB,YACA,MAAM,MAAM,WAAWC,WAAAA,2BACrB,QACA;AAAA,IACR,UAAU,eAAe;AAAA,EAAA,EACzB;AACJ;AAGO,SAAS,gBAAgB,SAAgC;AAC9D,SAAO,WAAW,OAAO,EAAE,MAAA;AAC7B;AAOO,SAAS,0BAA0B,SAAgC;AACxE,SAAOF,gBAAAA,+BAA+B,EAAE,SAAS,QAAQ,YAAY,KAAA,CAAM,EAAE,MAAA;AAC/E;;;;;;;"}
@@ -0,0 +1,80 @@
1
+ import { type ChatOutboxKeyPurpose, type ChatOutboxSignal, type ChatOutboxStore } from '../agent-runtime/src/index';
2
+ /**
3
+ * Opt-in: messages typed while Athena can't be reached wait on this device, sealed with the host's
4
+ * key, and are sent once Athena is back while the app is in front, after a countdown the person
5
+ * can cancel (`@athenaintel/agent-runtime`'s chat outbox, shown at the top of the queue tray).
6
+ * Without it a send goes to the transport as before.
7
+ *
8
+ * - `ownerId` names whose they are (the signed-in person, with the environment). Another owner's
9
+ * messages are never shown or sent: each owner's are sealed under their own key.
10
+ * - `getKey(purpose)` returns the AES-GCM key: `read` opens what is kept (the key if one exists,
11
+ * never made for this), `write` keeps a new message (only while the deployment lets devices keep
12
+ * copies). `null` keeps a new message in memory only, for as long as the page stays open. Unlike
13
+ * the chat history's, this key guards the only copy of what someone wrote: a host must never
14
+ * replace or drop it except at a sign-out the person chose.
15
+ * - `reachability` says Athena can be reached: the host's own model (the device online AND agora
16
+ * answering a health read, as Midas's main process decides it), by default the browser being
17
+ * online. Either way a conversation whose own channel keeps failing to connect counts as out of
18
+ * reach too.
19
+ * - `foreground` says the app is in front; by default a visible document. A desktop host passes
20
+ * `windowInFrontSignal()` (visible and focused).
21
+ * - `openThread` opens another of the person's conversations the tray lists as holding waiting
22
+ * messages (`newChat`: one that never started). Without it, a provider with a thread list
23
+ * switches to it; otherwise the tray names it without Open.
24
+ */
25
+ export interface AthenaChatOutbox {
26
+ ownerId: string;
27
+ getKey: (purpose: ChatOutboxKeyPurpose) => Promise<CryptoKey | null>;
28
+ reachability?: ChatOutboxSignal;
29
+ foreground?: ChatOutboxSignal;
30
+ openThread?: (target: {
31
+ threadId: string;
32
+ newChat: boolean;
33
+ }) => void;
34
+ }
35
+ /** The page's chat outbox store for `host`'s owner, made on first use. */
36
+ export declare function chatOutboxStoreFor(host: AthenaChatOutbox): ChatOutboxStore;
37
+ /**
38
+ * How many messages wait for `ownerId` (kept on the device, including records this build cannot
39
+ * open, and waiting in this page's memory), counted without opening them. Rejects when the
40
+ * device's records cannot be counted at all.
41
+ */
42
+ export declare function countChatOutboxMessages(ownerId: string): Promise<number>;
43
+ /**
44
+ * Calls `listener` after any change to `ownerId`'s waiting messages, this window's or another's
45
+ * (one kept, handed to its conversation, cancelled, failed or retried), so a host can show how many
46
+ * wait (`countChatOutboxMessages`) without asking on a timer. Returns what stops it.
47
+ */
48
+ export declare function subscribeChatOutbox(ownerId: string, listener: () => void): () => void;
49
+ /** A message waiting in an owner's outbox, as a host lists it (its "Waiting to sync" list). */
50
+ export interface ChatOutboxMessageSummary {
51
+ id: string;
52
+ threadId: string;
53
+ /** The text as it will be sent. */
54
+ text: string;
55
+ /** Typed into a chat that had never started. */
56
+ newChat: boolean;
57
+ /**
58
+ * Where it stands, as the queue tray shows it: waiting to be sent, being handed to its
59
+ * conversation now (a window's claim on it still holds), waiting for the person (it waited more
60
+ * than a day: Send, Edit or Discard), or failed (Retry or Discard; never retried on its own).
61
+ */
62
+ status: 'waiting' | 'sending' | 'ask' | 'failed';
63
+ /** Kept only in this page's memory: this device could not keep it. */
64
+ inMemory: boolean;
65
+ }
66
+ /**
67
+ * The messages waiting for `ownerId` that this page can open (oldest first), each with where it
68
+ * stands, for a host's list of what waits to sync; the tray in the conversation acts on them.
69
+ * Records this page cannot open (no key here, a newer build's) are left out, so a host counts with
70
+ * `countChatOutboxMessages`.
71
+ */
72
+ export declare function listChatOutboxMessages(ownerId: string, now?: number): Promise<ChatOutboxMessageSummary[]>;
73
+ /** A sign-out the person chose: every message waiting for `ownerId` goes, on the device and in memory. */
74
+ export declare function clearChatOutbox(ownerId: string): Promise<void>;
75
+ /**
76
+ * Deletes the records kept on this device for `ownerId`, never the messages waiting in this page's
77
+ * memory: for a host whose key for them no longer exists (a chosen sign-out deleted it before the
78
+ * page could delete the records), so nothing can ever open them and they must not be counted.
79
+ */
80
+ export declare function clearUnopenableChatOutbox(ownerId: string): Promise<void>;
@@ -0,0 +1,57 @@
1
+ import { createIndexedDbChatOutboxStore } from "../agent-runtime/src/chat-outbox-store.js";
2
+ import { CHAT_OUTBOX_CLAIM_LEASE_MS, CHAT_OUTBOX_ASK_AFTER_MS } from "../agent-runtime/src/chat-outbox.js";
3
+ const ownerStores = /* @__PURE__ */ new Map();
4
+ function keylessHost(ownerId) {
5
+ return { ownerId, getKey: async () => null };
6
+ }
7
+ function ownerStore(ownerId, host) {
8
+ let owner = ownerStores.get(ownerId);
9
+ if (!owner) {
10
+ const current = { current: host ?? keylessHost(ownerId) };
11
+ owner = {
12
+ host: current,
13
+ store: createIndexedDbChatOutboxStore({
14
+ ownerId,
15
+ getKey: (_ownerId, purpose) => current.current.getKey(purpose)
16
+ })
17
+ };
18
+ ownerStores.set(ownerId, owner);
19
+ }
20
+ if (host) owner.host.current = host;
21
+ return owner.store;
22
+ }
23
+ function chatOutboxStoreFor(host) {
24
+ return ownerStore(host.ownerId, host);
25
+ }
26
+ function countChatOutboxMessages(ownerId) {
27
+ return ownerStore(ownerId).count();
28
+ }
29
+ function subscribeChatOutbox(ownerId, listener) {
30
+ return ownerStore(ownerId).subscribe(listener);
31
+ }
32
+ async function listChatOutboxMessages(ownerId, now = Date.now()) {
33
+ const records = await ownerStore(ownerId).listAll();
34
+ return records.map(({ entry, claim, failure, memoryOnly }) => ({
35
+ id: entry.id,
36
+ threadId: entry.threadId,
37
+ text: entry.text,
38
+ newChat: entry.newChat,
39
+ status: failure ? "failed" : claim && now - claim.at < CHAT_OUTBOX_CLAIM_LEASE_MS ? "sending" : now - entry.queuedAt > CHAT_OUTBOX_ASK_AFTER_MS ? "ask" : "waiting",
40
+ inMemory: memoryOnly === true
41
+ }));
42
+ }
43
+ function clearChatOutbox(ownerId) {
44
+ return ownerStore(ownerId).clear();
45
+ }
46
+ function clearUnopenableChatOutbox(ownerId) {
47
+ return createIndexedDbChatOutboxStore({ ownerId, getKey: async () => null }).clear();
48
+ }
49
+ export {
50
+ chatOutboxStoreFor,
51
+ clearChatOutbox,
52
+ clearUnopenableChatOutbox,
53
+ countChatOutboxMessages,
54
+ listChatOutboxMessages,
55
+ subscribeChatOutbox
56
+ };
57
+ //# sourceMappingURL=chat-outbox.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"chat-outbox.js","sources":["../../src/offline/chat-outbox.ts"],"sourcesContent":["import {\n CHAT_OUTBOX_ASK_AFTER_MS,\n CHAT_OUTBOX_CLAIM_LEASE_MS,\n type ChatOutboxKeyPurpose,\n type ChatOutboxSignal,\n type ChatOutboxStore,\n createIndexedDbChatOutboxStore,\n} from '@athenaintel/agent-runtime';\n\n/**\n * Opt-in: messages typed while Athena can't be reached wait on this device, sealed with the host's\n * key, and are sent once Athena is back while the app is in front, after a countdown the person\n * can cancel (`@athenaintel/agent-runtime`'s chat outbox, shown at the top of the queue tray).\n * Without it a send goes to the transport as before.\n *\n * - `ownerId` names whose they are (the signed-in person, with the environment). Another owner's\n * messages are never shown or sent: each owner's are sealed under their own key.\n * - `getKey(purpose)` returns the AES-GCM key: `read` opens what is kept (the key if one exists,\n * never made for this), `write` keeps a new message (only while the deployment lets devices keep\n * copies). `null` keeps a new message in memory only, for as long as the page stays open. Unlike\n * the chat history's, this key guards the only copy of what someone wrote: a host must never\n * replace or drop it except at a sign-out the person chose.\n * - `reachability` says Athena can be reached: the host's own model (the device online AND agora\n * answering a health read, as Midas's main process decides it), by default the browser being\n * online. Either way a conversation whose own channel keeps failing to connect counts as out of\n * reach too.\n * - `foreground` says the app is in front; by default a visible document. A desktop host passes\n * `windowInFrontSignal()` (visible and focused).\n * - `openThread` opens another of the person's conversations the tray lists as holding waiting\n * messages (`newChat`: one that never started). Without it, a provider with a thread list\n * switches to it; otherwise the tray names it without Open.\n */\nexport interface AthenaChatOutbox {\n ownerId: string;\n getKey: (purpose: ChatOutboxKeyPurpose) => Promise<CryptoKey | null>;\n reachability?: ChatOutboxSignal;\n foreground?: ChatOutboxSignal;\n openThread?: (target: { threadId: string; newChat: boolean }) => void;\n}\n\ninterface OwnerStore {\n store: ChatOutboxStore;\n /** The latest host for this owner: the store asks it for the key. */\n host: { current: AthenaChatOutbox };\n}\n\n// process-local: one store per owner in this page, so every provider of the person (a chat in a\n// tab, another in a pane) shares one change bus and one memory of the messages this device could\n// not keep: a thread switch or a closed tab never loses them, and a sign-out counts them.\nconst ownerStores = new Map<string, OwnerStore>();\n\n/** A host that has no key to give (counting and deleting never need one). */\nfunction keylessHost(ownerId: string): AthenaChatOutbox {\n return { ownerId, getKey: async () => null };\n}\n\nfunction ownerStore(ownerId: string, host?: AthenaChatOutbox): ChatOutboxStore {\n let owner = ownerStores.get(ownerId);\n if (!owner) {\n const current = { current: host ?? keylessHost(ownerId) };\n owner = {\n host: current,\n store: createIndexedDbChatOutboxStore({\n ownerId,\n getKey: (_ownerId, purpose) => current.current.getKey(purpose),\n }),\n };\n ownerStores.set(ownerId, owner);\n }\n if (host) owner.host.current = host;\n return owner.store;\n}\n\n/** The page's chat outbox store for `host`'s owner, made on first use. */\nexport function chatOutboxStoreFor(host: AthenaChatOutbox): ChatOutboxStore {\n return ownerStore(host.ownerId, host);\n}\n\n/**\n * How many messages wait for `ownerId` (kept on the device, including records this build cannot\n * open, and waiting in this page's memory), counted without opening them. Rejects when the\n * device's records cannot be counted at all.\n */\nexport function countChatOutboxMessages(ownerId: string): Promise<number> {\n return ownerStore(ownerId).count();\n}\n\n/**\n * Calls `listener` after any change to `ownerId`'s waiting messages, this window's or another's\n * (one kept, handed to its conversation, cancelled, failed or retried), so a host can show how many\n * wait (`countChatOutboxMessages`) without asking on a timer. Returns what stops it.\n */\nexport function subscribeChatOutbox(ownerId: string, listener: () => void): () => void {\n return ownerStore(ownerId).subscribe(listener);\n}\n\n/** A message waiting in an owner's outbox, as a host lists it (its \"Waiting to sync\" list). */\nexport interface ChatOutboxMessageSummary {\n id: string;\n threadId: string;\n /** The text as it will be sent. */\n text: string;\n /** Typed into a chat that had never started. */\n newChat: boolean;\n /**\n * Where it stands, as the queue tray shows it: waiting to be sent, being handed to its\n * conversation now (a window's claim on it still holds), waiting for the person (it waited more\n * than a day: Send, Edit or Discard), or failed (Retry or Discard; never retried on its own).\n */\n status: 'waiting' | 'sending' | 'ask' | 'failed';\n /** Kept only in this page's memory: this device could not keep it. */\n inMemory: boolean;\n}\n\n/**\n * The messages waiting for `ownerId` that this page can open (oldest first), each with where it\n * stands, for a host's list of what waits to sync; the tray in the conversation acts on them.\n * Records this page cannot open (no key here, a newer build's) are left out, so a host counts with\n * `countChatOutboxMessages`.\n */\nexport async function listChatOutboxMessages(\n ownerId: string,\n now: number = Date.now(),\n): Promise<ChatOutboxMessageSummary[]> {\n const records = await ownerStore(ownerId).listAll();\n return records.map(({ entry, claim, failure, memoryOnly }) => ({\n id: entry.id,\n threadId: entry.threadId,\n text: entry.text,\n newChat: entry.newChat,\n status: failure\n ? 'failed'\n : claim && now - claim.at < CHAT_OUTBOX_CLAIM_LEASE_MS\n ? 'sending'\n : now - entry.queuedAt > CHAT_OUTBOX_ASK_AFTER_MS\n ? 'ask'\n : 'waiting',\n inMemory: memoryOnly === true,\n }));\n}\n\n/** A sign-out the person chose: every message waiting for `ownerId` goes, on the device and in memory. */\nexport function clearChatOutbox(ownerId: string): Promise<void> {\n return ownerStore(ownerId).clear();\n}\n\n/**\n * Deletes the records kept on this device for `ownerId`, never the messages waiting in this page's\n * memory: for a host whose key for them no longer exists (a chosen sign-out deleted it before the\n * page could delete the records), so nothing can ever open them and they must not be counted.\n */\nexport function clearUnopenableChatOutbox(ownerId: string): Promise<void> {\n return createIndexedDbChatOutboxStore({ ownerId, getKey: async () => null }).clear();\n}\n"],"names":[],"mappings":";;AAiDA,MAAM,kCAAkB,IAAA;AAGxB,SAAS,YAAY,SAAmC;AACtD,SAAO,EAAE,SAAS,QAAQ,YAAY,KAAA;AACxC;AAEA,SAAS,WAAW,SAAiB,MAA0C;AAC7E,MAAI,QAAQ,YAAY,IAAI,OAAO;AACnC,MAAI,CAAC,OAAO;AACV,UAAM,UAAU,EAAE,SAAS,QAAQ,YAAY,OAAO,EAAA;AACtD,YAAQ;AAAA,MACN,MAAM;AAAA,MACN,OAAO,+BAA+B;AAAA,QACpC;AAAA,QACA,QAAQ,CAAC,UAAU,YAAY,QAAQ,QAAQ,OAAO,OAAO;AAAA,MAAA,CAC9D;AAAA,IAAA;AAEH,gBAAY,IAAI,SAAS,KAAK;AAAA,EAChC;AACA,MAAI,KAAM,OAAM,KAAK,UAAU;AAC/B,SAAO,MAAM;AACf;AAGO,SAAS,mBAAmB,MAAyC;AAC1E,SAAO,WAAW,KAAK,SAAS,IAAI;AACtC;AAOO,SAAS,wBAAwB,SAAkC;AACxE,SAAO,WAAW,OAAO,EAAE,MAAA;AAC7B;AAOO,SAAS,oBAAoB,SAAiB,UAAkC;AACrF,SAAO,WAAW,OAAO,EAAE,UAAU,QAAQ;AAC/C;AA0BA,eAAsB,uBACpB,SACA,MAAc,KAAK,OACkB;AACrC,QAAM,UAAU,MAAM,WAAW,OAAO,EAAE,QAAA;AAC1C,SAAO,QAAQ,IAAI,CAAC,EAAE,OAAO,OAAO,SAAS,kBAAkB;AAAA,IAC7D,IAAI,MAAM;AAAA,IACV,UAAU,MAAM;AAAA,IAChB,MAAM,MAAM;AAAA,IACZ,SAAS,MAAM;AAAA,IACf,QAAQ,UACJ,WACA,SAAS,MAAM,MAAM,KAAK,6BACxB,YACA,MAAM,MAAM,WAAW,2BACrB,QACA;AAAA,IACR,UAAU,eAAe;AAAA,EAAA,EACzB;AACJ;AAGO,SAAS,gBAAgB,SAAgC;AAC9D,SAAO,WAAW,OAAO,EAAE,MAAA;AAC7B;AAOO,SAAS,0BAA0B,SAAgC;AACxE,SAAO,+BAA+B,EAAE,SAAS,QAAQ,YAAY,KAAA,CAAM,EAAE,MAAA;AAC/E;"}
@@ -1,4 +1,4 @@
1
- import type { DurableThreadSnapshotCache } from '@athenaintel/agent-runtime';
1
+ import type { DurableThreadSnapshotCache } from '../agent-runtime/src/index';
2
2
  import { type FC } from 'react';
3
3
  /**
4
4
  * Opt-in: keep the chat's recent conversations, and the session list, on this device, sealed with