@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
@@ -0,0 +1,138 @@
1
+ /**
2
+ * Derivations for the server-owned statewire queue and steer lanes, shared by
3
+ * every queued-messages tray (Olympus, the React SDK, the Chrome extension).
4
+ *
5
+ * The queue is SERVER-owned: statewire surfaces it on the runs projection.
6
+ * "Send now" moves an item into the steer lane (`run/steer` — the host stops
7
+ * the run and dispatches it once the run settles; on a stopped/errored thread
8
+ * the same move dispatches immediately as a stop-/error-continue run) and
9
+ * remove issues `run/dequeue`. While the thread rests stopped/errored,
10
+ * stranded steer-lane entries list ahead of the queue — they dispatch first,
11
+ * as one batch, so they carry Remove but no per-row Send now.
12
+ *
13
+ * Pure helpers only: the host component reads `useStatewireRuns()` and
14
+ * `useDeepAgentThreadStatus()` itself (both mockable per surface) and passes
15
+ * the values in.
16
+ */
17
+ import type { StatewireThread } from '@assistant-ui/react-statewire';
18
+ import type { DeepAgentThreadStatus } from './thread-status';
19
+ /** The text content of a queued entry (non-text parts render as fallbacks). */
20
+ export declare function queueEntryText(parts: readonly {
21
+ type: string;
22
+ text?: string;
23
+ }[]): string;
24
+ /**
25
+ * Whether a lane entry is still awaiting its send's settle: the host stamps
26
+ * `meta` on every entry it admits (`_op_meta` — submitter and contextSync
27
+ * snapshot), so a meta-less entry is this client's own optimistic fold. The
28
+ * send is still in flight and can still be refused (billing gate, auth,
29
+ * reconnect), which the tray must not render as an accepted queue position.
30
+ */
31
+ export declare function isQueueEntryUnsettled(entry: StatewireThread.RunsQueueEntry): boolean;
32
+ /**
33
+ * The ids of queued entries the user prioritized (⚡ — `run/prioritize`), as
34
+ * the host records them in its durable `prioritizedQueueIds` state. A
35
+ * prioritized entry heads the queue lane and the live run ends at its next
36
+ * model-call boundary to deliver it, so trays render these rows lit and offer
37
+ * "Remove priority" instead of "Prioritize". Tolerates the key being absent
38
+ * (a thread that never prioritized, a pre-feature host) and ignores anything
39
+ * that is not a string id.
40
+ */
41
+ export declare function readPrioritizedQueueIds(raw: unknown): readonly string[];
42
+ export interface QueueLaneFlags {
43
+ isRunning: boolean;
44
+ /** A stopped/errored thread can continue with its queued work. */
45
+ isContinuable: boolean;
46
+ }
47
+ /** The thread-status split every queue tray keys its affordances on. */
48
+ export declare function queueLaneFlags(status: DeepAgentThreadStatus): QueueLaneFlags;
49
+ export interface StatewireQueueRow {
50
+ item: StatewireThread.RunsQueueEntry;
51
+ lane: 'queue' | 'steer';
52
+ }
53
+ /**
54
+ * The rows a queue tray renders, in dispatch order: stranded steer-lane
55
+ * entries first (only while the thread rests continuable — during a run they
56
+ * already render in the message list), then the queue lane.
57
+ */
58
+ export declare function buildStatewireQueueRows(options: {
59
+ queue: readonly StatewireThread.RunsQueueEntry[];
60
+ steerQueue: readonly StatewireThread.RunsQueueEntry[];
61
+ isContinuable: boolean;
62
+ }): StatewireQueueRow[];
63
+ /**
64
+ * Whether a row offers "Send now": queue-lane rows only (steer entries already
65
+ * dispatch first), every row while the thread rests continuable, and only the
66
+ * head row while a run is live (later rows would jump the queue order).
67
+ */
68
+ export declare function showQueueRowSendNow(options: {
69
+ lane: 'queue' | 'steer';
70
+ index: number;
71
+ isRunning: boolean;
72
+ isContinuable: boolean;
73
+ }): boolean;
74
+ /**
75
+ * Whether a row offers "Steer" (`run/steer-live`): queue-lane rows while a run
76
+ * is live. Steer folds the entry into the RUNNING turn at its next model call
77
+ * — after the in-flight tool chain, never mid-tool — and the run goes on with
78
+ * it in context (ChatGPT's and Codex's Steer, versus Queue). Nothing is
79
+ * cancelled and no second run starts, so every queued row qualifies, not just
80
+ * the head. At rest there is no turn to steer: Send now already dispatches.
81
+ */
82
+ export declare function showQueueRowSteer(options: {
83
+ lane: 'queue' | 'steer';
84
+ isRunning: boolean;
85
+ }): boolean;
86
+ export type QueueEditCommand = {
87
+ type: 'run/steer';
88
+ runId: string;
89
+ message: StatewireThread.UserMessage;
90
+ } | {
91
+ type: 'run/enqueue';
92
+ runId: string;
93
+ message: StatewireThread.UserMessage;
94
+ };
95
+ /**
96
+ * Re-send a queued entry under its own id on its own lane with edited text:
97
+ * the host replaces the queued message's content in place, leaving its queue
98
+ * position and lane untouched (a same-id send never dispatches). The built-in
99
+ * queue client has no update command, so this goes straight to the runs
100
+ * protocol. Returns `null` when there is nothing to send — blank or unchanged
101
+ * text, or no live run entry to address.
102
+ */
103
+ export declare function buildQueueEditCommand(options: {
104
+ item: StatewireThread.RunsQueueEntry;
105
+ lane: 'queue' | 'steer';
106
+ runId: string | null;
107
+ text: string;
108
+ /**
109
+ * The edited message's metadata, replacing the entry's (the host replaces
110
+ * the queued message whole). Omitted, the entry's metadata is kept, minus a
111
+ * composer markdown that described the old text.
112
+ */
113
+ metadata?: Readonly<Record<string, unknown>> | undefined;
114
+ }): QueueEditCommand | null;
115
+ /**
116
+ * Grace between observing a stranded settle and auto-promoting the queue
117
+ * head — long enough for the host's own settle bookkeeping (or a status flap
118
+ * during reconnect) to resolve first, short enough to read as "it just
119
+ * continued" rather than "it hung".
120
+ */
121
+ export declare const QUEUE_AUTO_CONTINUE_DELAY_MS = 2000;
122
+ /** Whether the last cancellation marker records a user or client stop. */
123
+ export declare function userStopBlocksQueueAutoContinue(options: {
124
+ marker: string | undefined;
125
+ source: string | undefined;
126
+ }): boolean;
127
+ /** `fate (cause)[: message]` — the detail a failed-send row carries. */
128
+ export declare function describeQueueSendFailure(failure: StatewireThread.RunsFailedEntry['sendFailure']): string;
129
+ /**
130
+ * Whether a `retryFailed` / `discardFailed` throw is the covered drop race:
131
+ * statewire drops a failed entry on its own as soon as a canonical update
132
+ * shows the message landed, and acting on a just-dropped entry throws. Both
133
+ * the session record ("unknown failed command") and the adapter's projection
134
+ * ("unknown failed entry") use this prefix. Nothing is lost in that race — the
135
+ * message already made it and the row is about to disappear — so a tray
136
+ * swallows it (keeping telemetry) instead of crashing the click handler.
137
+ */
138
+ export declare function isFailedSendEntryRace(error: unknown): boolean;
@@ -0,0 +1,154 @@
1
+ import type { StatewireClient } from "statewire";
2
+ import { KeyValueSessionStorage } from "statewire/storage";
3
+ /** A persisted session record: per-lane failed entries (a pre-lane record carried them at the root). */
4
+ type SessionRecordLike = {
5
+ failed?: unknown;
6
+ lanes?: Record<string, {
7
+ failed?: unknown;
8
+ } | null | undefined> | null;
9
+ };
10
+ export declare function readPersistedFailedSendStamps(sessionKey: string): ReadonlyMap<string, number> | null;
11
+ /**
12
+ * Send stamps (message id → epoch ms of the original send) off an already
13
+ * loaded session record's failed lane — the storage-agnostic half of
14
+ * {@link readPersistedFailedSendStamps}, for hosts whose session store is not
15
+ * localStorage (the React Native AsyncStorage-backed store reads its record
16
+ * synchronously through `SessionStorage.load()`).
17
+ *
18
+ * Returns `null` for no record (every failed entry then counts as fresh) and
19
+ * an empty map for a record without failures.
20
+ */
21
+ export declare function readFailedSendStampsFromRecord(record: SessionRecordLike | null | undefined): ReadonlyMap<string, number> | null;
22
+ /** A storage operation the session survived by degrading instead of failing. */
23
+ export type SessionStorageDegradation = {
24
+ operation: "getItem" | "setItem" | "removeItem" | "getAllKeys" | "withUnused"
25
+ /** The lock manager refused the transaction fence; it ran unfenced. */
26
+ | "lock"
27
+ /**
28
+ * The stored record is one this build cannot read (not JSON, or a newer
29
+ * storage version): served as absent, and the key is shielded from being
30
+ * overwritten so the record survives this tab.
31
+ */
32
+ | "record"
33
+ /** statewire's own storage failure (a structurally invalid stored record). */
34
+ | "session"
35
+ /**
36
+ * Queued commands persisted by an earlier statewire build no longer fit
37
+ * the current wire/protocol range: parked in the lane's failed list (the
38
+ * send-recovery sweep re-dispatches them) instead of blocking the mount.
39
+ */
40
+ | "migrate";
41
+ key: string;
42
+ error: unknown;
43
+ };
44
+ type ProducedRange = NonNullable<StatewireClient.SessionCommand["produced"]>;
45
+ /**
46
+ * The oldest wire whose stored statements the current client still replays.
47
+ * Bundled clients before #45143 offered 2026-09-13 through 2026-09-30 and
48
+ * stamped every queued statement with 2026-09-13. The durable statement grammar
49
+ * (protocol, method, params, meta, seq) is the same on 2026-09-30; only
50
+ * frame-level context differs. So those statements ride the current wire
51
+ * unchanged, while the network offer stays native 2026-09-30 only.
52
+ */
53
+ export declare const STORED_STATEMENT_WIRE_FLOOR = "2026-09-13";
54
+ /**
55
+ * statewire's `migrate` for a record whose queued commands were produced by
56
+ * an earlier build. A command whose statement the current wire still replays
57
+ * ({@link STORED_STATEMENT_WIRE_FLOOR}: an approval's `run/input` saved by a
58
+ * previous bundled client, say) stays queued, re-stamped with the current
59
+ * range, so it is delivered with its original seq. Every other incompatible
60
+ * command leaves its lane's queue and is
61
+ * retained as a `lost`/`session-lost` failed send re-stamped with the current
62
+ * range. Client identity, lane clocks, compatible commands and existing failed
63
+ * history are untouched, so the mount proceeds and the send-recovery sweep
64
+ * (or the user, via the failed-send UI) re-dispatches the parked sends under
65
+ * the negotiated format instead of the runtime throwing before it dials.
66
+ *
67
+ * Returns the record itself when nothing needed migrating, and the count of
68
+ * parked commands otherwise.
69
+ */
70
+ export declare function parkIncompatibleSessionCommands(record: StatewireClient.SessionRecord, current: ProducedRange, now?: number): {
71
+ record: StatewireClient.SessionRecord;
72
+ parked: number;
73
+ restamped: number;
74
+ };
75
+ /**
76
+ * Whether `error` is the browser refusing a write for lack of room, under
77
+ * every name the engines use — `QuotaExceededError` (Chromium, WebKit, current
78
+ * Firefox), `NS_ERROR_DOM_QUOTA_REACHED` (older Firefox), the legacy
79
+ * `DOMException` codes 22 (WebKit) and 1014 (Firefox) — or a plain error whose
80
+ * message carries one of those (storage proxies and WebViews rewrap the
81
+ * exception). Olympus's `isStorageQuotaError` recognises the same set; the two
82
+ * stay in step.
83
+ */
84
+ export declare function isStorageQuotaError(error: unknown): boolean;
85
+ type SyncBackend = {
86
+ getItem: (key: string) => string | null;
87
+ setItem: (key: string, value: string) => void;
88
+ removeItem: (key: string) => void;
89
+ getAllKeys: () => readonly string[];
90
+ withUnused: (key: string, action: () => Promise<void>) => Promise<void>;
91
+ };
92
+ /**
93
+ * Wraps a synchronous key-value backend so a failing origin degrades the
94
+ * session to memory-only persistence instead of stopping the connection.
95
+ *
96
+ * statewire's session storage latches the first unrecognised write failure
97
+ * and from then on rejects every send (`stopped/storage-error`, "session
98
+ * storage failed" on the connection chip). It only recovers a
99
+ * `QuotaExceededError` by that exact name — sweeping old session records and
100
+ * retrying the write once — and latches again when the retry fails too. Here
101
+ * the first quota failure per key is surfaced under that name so the sweep
102
+ * runs; the retry that follows it and every other storage failure are absorbed
103
+ * and reported through `onDegraded`, so chat keeps working.
104
+ *
105
+ * An absorbed write is kept in an in-memory overlay that `getItem` serves
106
+ * first: statewire re-reads the record through `load()` on every shared-mode
107
+ * transaction, so a stale persisted copy would otherwise win back its old
108
+ * `nextSeq`, `clientId` and command journal. The overlay is per tab — another
109
+ * tab sharing the thread still reads the last persisted copy, which is the
110
+ * memory-only degradation this backend exists to allow. A later successful
111
+ * write clears the overlay entry.
112
+ *
113
+ * A key whose read threw, or whose stored value this build cannot read (see
114
+ * {@link unreadableRecord}), is served as absent and shielded: writes to it
115
+ * stay in the overlay for good, so a fresh lane minted over an unreadable
116
+ * record never overwrites what another tab or a newer build persisted.
117
+ */
118
+ export declare function quotaTolerantBackend({ inner, onDegraded, }: {
119
+ inner: SyncBackend;
120
+ onDegraded: (degradation: SessionStorageDegradation) => void;
121
+ }): SyncBackend & KeyValueSessionStorage.Backend;
122
+ /**
123
+ * Removes session records last saved more than `maxAgeMs` ago, skipping the
124
+ * keys mounted in this tab and, through `withUnused`, those another tab holds.
125
+ *
126
+ * statewire's own retention sweep only retires records with nothing queued and
127
+ * nothing failed: a record still carrying an unconfirmed or failed send is
128
+ * exempt from both its age and count bounds, so every thread left with one
129
+ * kept its key forever. Past the TTL those sends are long out of send
130
+ * recovery's auto-retry window, so the record goes the same way an empty one
131
+ * does.
132
+ */
133
+ export declare function retireExpiredSessionRecords({ backend, mounted, maxAgeMs, now, }: {
134
+ backend: Pick<SyncBackend, "getItem" | "removeItem" | "getAllKeys" | "withUnused">;
135
+ mounted: ReadonlyMap<string, number>;
136
+ maxAgeMs: number;
137
+ now?: number;
138
+ }): Promise<void>;
139
+ /** Athena's browser session keys and retention policy. */
140
+ export declare const QuotaSafeLocalStorageSession: import("@assistant-ui/tap").Resource<StatewireClient.SessionStorage, [QuotaSafeLocalStorageSession.Options]>;
141
+ export declare namespace QuotaSafeLocalStorageSession {
142
+ type Options = {
143
+ threadId: string;
144
+ key?: (threadId: string) => string;
145
+ ttl?: number;
146
+ max?: number;
147
+ /**
148
+ * Called when a storage operation failed and the session carried on in
149
+ * memory. Defaults to one `console.warn` per operation and key.
150
+ */
151
+ onStorageDegraded?: (degradation: SessionStorageDegradation) => void;
152
+ };
153
+ }
154
+ export {};
@@ -0,0 +1,11 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
+ const RUNNING_PLACEHOLDER_KWARG = "streaming";
4
+ const isRecord = (value) => typeof value === "object" && value !== null && !Array.isArray(value);
5
+ function isRunningToolPlaceholderArtifact(artifact) {
6
+ if (!isRecord(artifact)) return false;
7
+ const metadata = artifact._tool_message_metadata;
8
+ return isRecord(metadata) && metadata[RUNNING_PLACEHOLDER_KWARG] === true;
9
+ }
10
+ exports.isRunningToolPlaceholderArtifact = isRunningToolPlaceholderArtifact;
11
+ //# sourceMappingURL=running-tool-placeholder.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"running-tool-placeholder.cjs","sources":["../../../../agent-runtime/src/running-tool-placeholder.ts"],"sourcesContent":["/**\n * The backend's running-tool placeholder: the ToolMessage a long-running tool's\n * card shows until the tool returns — a `task` subagent's live transcript, a\n * tool's preliminary result (Studio and Python execution progress, deep\n * research, image descriptions, drive indexing, AOP progress), or a\n * programmatic-tool-calling execution's sub-call log. Agora's\n * `running_tool_placeholder` builds all three: id `tool-running-<tool_call_id>`\n * and `additional_kwargs.streaming`. The tool's real ToolMessage replaces it by\n * `tool_call_id`, with its own id and no such flag.\n *\n * A placeholder is a `tool` message, so its mere presence gives the call a\n * defined `result`: read the flag before counting a call as done.\n *\n * Self-contained on purpose: the message converter imports it, so whatever it\n * imports ships in every surface's startup bundle (the Office pane's startup\n * budget has no room for `tool-result.ts`, which only tool cards need).\n */\n\nconst RUNNING_PLACEHOLDER_KWARG = 'streaming';\n\nconst isRecord = (value: unknown): value is Record<string, unknown> =>\n typeof value === 'object' && value !== null && !Array.isArray(value);\n\n/** Whether a raw wire message is a running tool's placeholder rather than its result. */\nexport function isRunningToolPlaceholder(message: unknown): boolean {\n if (!isRecord(message) || message.type !== 'tool') return false;\n const kwargs = message.additional_kwargs;\n return isRecord(kwargs) && kwargs[RUNNING_PLACEHOLDER_KWARG] === true;\n}\n\n/**\n * Whether a converted tool-call part's `artifact` comes from a running tool's\n * placeholder: the converter lifts a ToolMessage's `additional_kwargs` into\n * `artifact._tool_message_metadata`, the marker included.\n */\nexport function isRunningToolPlaceholderArtifact(artifact: unknown): boolean {\n if (!isRecord(artifact)) return false;\n const metadata = artifact._tool_message_metadata;\n return isRecord(metadata) && metadata[RUNNING_PLACEHOLDER_KWARG] === true;\n}\n"],"names":[],"mappings":";;AAkBA,MAAM,4BAA4B;AAElC,MAAM,WAAW,CAAC,UAChB,OAAO,UAAU,YAAY,UAAU,QAAQ,CAAC,MAAM,QAAQ,KAAK;AAc9D,SAAS,iCAAiC,UAA4B;AAC3E,MAAI,CAAC,SAAS,QAAQ,EAAG,QAAO;AAChC,QAAM,WAAW,SAAS;AAC1B,SAAO,SAAS,QAAQ,KAAK,SAAS,yBAAyB,MAAM;AACvE;;"}
@@ -0,0 +1,25 @@
1
+ /**
2
+ * The backend's running-tool placeholder: the ToolMessage a long-running tool's
3
+ * card shows until the tool returns — a `task` subagent's live transcript, a
4
+ * tool's preliminary result (Studio and Python execution progress, deep
5
+ * research, image descriptions, drive indexing, AOP progress), or a
6
+ * programmatic-tool-calling execution's sub-call log. Agora's
7
+ * `running_tool_placeholder` builds all three: id `tool-running-<tool_call_id>`
8
+ * and `additional_kwargs.streaming`. The tool's real ToolMessage replaces it by
9
+ * `tool_call_id`, with its own id and no such flag.
10
+ *
11
+ * A placeholder is a `tool` message, so its mere presence gives the call a
12
+ * defined `result`: read the flag before counting a call as done.
13
+ *
14
+ * Self-contained on purpose: the message converter imports it, so whatever it
15
+ * imports ships in every surface's startup bundle (the Office pane's startup
16
+ * budget has no room for `tool-result.ts`, which only tool cards need).
17
+ */
18
+ /** Whether a raw wire message is a running tool's placeholder rather than its result. */
19
+ export declare function isRunningToolPlaceholder(message: unknown): boolean;
20
+ /**
21
+ * Whether a converted tool-call part's `artifact` comes from a running tool's
22
+ * placeholder: the converter lifts a ToolMessage's `additional_kwargs` into
23
+ * `artifact._tool_message_metadata`, the marker included.
24
+ */
25
+ export declare function isRunningToolPlaceholderArtifact(artifact: unknown): boolean;
@@ -0,0 +1,11 @@
1
+ const RUNNING_PLACEHOLDER_KWARG = "streaming";
2
+ const isRecord = (value) => typeof value === "object" && value !== null && !Array.isArray(value);
3
+ function isRunningToolPlaceholderArtifact(artifact) {
4
+ if (!isRecord(artifact)) return false;
5
+ const metadata = artifact._tool_message_metadata;
6
+ return isRecord(metadata) && metadata[RUNNING_PLACEHOLDER_KWARG] === true;
7
+ }
8
+ export {
9
+ isRunningToolPlaceholderArtifact
10
+ };
11
+ //# sourceMappingURL=running-tool-placeholder.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"running-tool-placeholder.js","sources":["../../../../agent-runtime/src/running-tool-placeholder.ts"],"sourcesContent":["/**\n * The backend's running-tool placeholder: the ToolMessage a long-running tool's\n * card shows until the tool returns — a `task` subagent's live transcript, a\n * tool's preliminary result (Studio and Python execution progress, deep\n * research, image descriptions, drive indexing, AOP progress), or a\n * programmatic-tool-calling execution's sub-call log. Agora's\n * `running_tool_placeholder` builds all three: id `tool-running-<tool_call_id>`\n * and `additional_kwargs.streaming`. The tool's real ToolMessage replaces it by\n * `tool_call_id`, with its own id and no such flag.\n *\n * A placeholder is a `tool` message, so its mere presence gives the call a\n * defined `result`: read the flag before counting a call as done.\n *\n * Self-contained on purpose: the message converter imports it, so whatever it\n * imports ships in every surface's startup bundle (the Office pane's startup\n * budget has no room for `tool-result.ts`, which only tool cards need).\n */\n\nconst RUNNING_PLACEHOLDER_KWARG = 'streaming';\n\nconst isRecord = (value: unknown): value is Record<string, unknown> =>\n typeof value === 'object' && value !== null && !Array.isArray(value);\n\n/** Whether a raw wire message is a running tool's placeholder rather than its result. */\nexport function isRunningToolPlaceholder(message: unknown): boolean {\n if (!isRecord(message) || message.type !== 'tool') return false;\n const kwargs = message.additional_kwargs;\n return isRecord(kwargs) && kwargs[RUNNING_PLACEHOLDER_KWARG] === true;\n}\n\n/**\n * Whether a converted tool-call part's `artifact` comes from a running tool's\n * placeholder: the converter lifts a ToolMessage's `additional_kwargs` into\n * `artifact._tool_message_metadata`, the marker included.\n */\nexport function isRunningToolPlaceholderArtifact(artifact: unknown): boolean {\n if (!isRecord(artifact)) return false;\n const metadata = artifact._tool_message_metadata;\n return isRecord(metadata) && metadata[RUNNING_PLACEHOLDER_KWARG] === true;\n}\n"],"names":[],"mappings":"AAkBA,MAAM,4BAA4B;AAElC,MAAM,WAAW,CAAC,UAChB,OAAO,UAAU,YAAY,UAAU,QAAQ,CAAC,MAAM,QAAQ,KAAK;AAc9D,SAAS,iCAAiC,UAA4B;AAC3E,MAAI,CAAC,SAAS,QAAQ,EAAG,QAAO;AAChC,QAAM,WAAW,SAAS;AAC1B,SAAO,SAAS,QAAQ,KAAK,SAAS,yBAAyB,MAAM;AACvE;"}
@@ -0,0 +1,104 @@
1
+ /**
2
+ * Typed runtime messages — the one description of "the runtime ended this run"
3
+ * that every chat surface renders from.
4
+ *
5
+ * The deep-agent backend records how a run ended in two shapes that ride
6
+ * ordinary `ai` messages (a new LangChain message type would crash the shipped
7
+ * converter, whose convertible set is closed):
8
+ *
9
+ * - a **run-lifecycle marker** (`athena_run_marker`: `cancelled` / `failed`,
10
+ * plus `athena_run_marker_source`) — see {@link readRunMarkerFromSourceMessages};
11
+ * - a **handoff message** (`athena_handoff: true`) — the closing summary the
12
+ * runtime asked the model to write when a guard or the step budget ended the
13
+ * run, instead of fabricating an internal sentence.
14
+ *
15
+ * Both now carry the canonical `athena_termination_reason`
16
+ * (`agora/graphs/athena_deep_agent/termination.py`). This module reads all of
17
+ * that into one {@link AthenaRuntimeMessage} so Olympus, mobile, the Chrome
18
+ * extension, and the Office add-in agree on kind, severity, copy, and the
19
+ * sole-vs-grouped distinction — the last of which is load-bearing: a marker
20
+ * appended after the assistant's own work is chunked into that message, and
21
+ * replacing the whole row would hide completed prose and tool cards.
22
+ */
23
+ import { getExternalStoreMessages } from '@assistant-ui/core';
24
+ /** The backend's canonical reason vocabulary (`KNOWN_TERMINATION_REASONS`). */
25
+ export declare const TERMINATION_REASONS: readonly ['completed', 'user_stop', 'send_now', 'voice_steer', 'transport_cancel', 'pod_drain', 'fence_lost', 'instance_closed', 'unattributed_stop', 'recursion_limit', 'step_budget', 'duplicate_call_guard', 'synthetic_stop', 'ended_after_tools', 'error', 'model_refusal', 'abandoned'];
26
+ export type AthenaTerminationReason = (typeof TERMINATION_REASONS)[number];
27
+ /**
28
+ * How a runtime ending renders:
29
+ * - `stopped` — a cancellation the user (or a client action) asked for;
30
+ * - `paused` — a pod-drain pause; the run resumes from its checkpoint;
31
+ * - `failed` — the graph raised, hit the recursion limit, or was abandoned;
32
+ * - `handoff` — the runtime ended the run and the model wrote a closing
33
+ * summary (the message text), which renders as prose under a banner.
34
+ */
35
+ export type AthenaRuntimeMessageKind = 'stopped' | 'paused' | 'failed' | 'handoff';
36
+ export type AthenaRuntimeMessageSeverity = 'info' | 'warning' | 'error';
37
+ export interface TerminationDescription {
38
+ /** Short label for the banner / status row. */
39
+ title: string;
40
+ /** One sentence of reason-specific explanation, when it adds information. */
41
+ detail: string | undefined;
42
+ }
43
+ export interface AthenaRuntimeMessage {
44
+ kind: AthenaRuntimeMessageKind;
45
+ /** Canonical reason (may be a value newer than this client knows). */
46
+ reason: string | undefined;
47
+ severity: AthenaRuntimeMessageSeverity;
48
+ title: string;
49
+ detail: string | undefined;
50
+ /** The message's own text: a marker's backend copy, or the handoff summary. */
51
+ text: string | undefined;
52
+ /**
53
+ * A `send_now` promotion cancels the live run as plumbing, not as a
54
+ * user-visible stop: keep it in the data, paint nothing.
55
+ */
56
+ silent: boolean;
57
+ /**
58
+ * True when the runtime message is the ONLY source message behind this
59
+ * thread message (it owns the whole row). False when the chunk also holds
60
+ * the assistant's own work, which must keep rendering.
61
+ */
62
+ isSoleSourceMessage: boolean;
63
+ }
64
+ /**
65
+ * Copy for a runtime ending. Reasons this client does not know fall back to
66
+ * the kind's generic title, so a newer backend never renders as an empty row.
67
+ */
68
+ export declare function describeTerminationReason(kind: AthenaRuntimeMessageKind, reason: string | undefined): TerminationDescription;
69
+ type Kwargs = Record<string, unknown> | undefined;
70
+ /** The termination reason stamped on `additional_kwargs` (top-level or mirror). */
71
+ export declare function readTerminationReason(kwargs: Kwargs): string | undefined;
72
+ /**
73
+ * Read the runtime ending behind a thread message, from its bound source
74
+ * messages first (a marker or handoff chunked after the assistant's own turn
75
+ * is never the first source, so the joined `metadata.custom` would miss it —
76
+ * see {@link readRunMarkerFromSourceMessages}), then from joined metadata for
77
+ * surfaces without bound sources.
78
+ */
79
+ export declare function readRuntimeMessageFromSourceMessages(message: Parameters<typeof getExternalStoreMessages>[0] & {
80
+ metadata?: {
81
+ custom?: Record<string, unknown> | undefined;
82
+ } | undefined;
83
+ content?: unknown;
84
+ }): AthenaRuntimeMessage | undefined;
85
+ /**
86
+ * The backend marker copy worth showing under a runtime card, or `undefined`.
87
+ *
88
+ * A failure marker's text carries the specific error ("The run failed:
89
+ * provider returned 502"), so it is shown when no reason-specific detail
90
+ * exists. Stop/pause copy only restates the title, and a handoff's text is the
91
+ * message body itself, so neither is repeated. Marker copy leads with an emoji
92
+ * for raw-transcript readers; the card's icon plays that role, so it is
93
+ * stripped. Shared by every presenter so mobile and DOM cannot drift.
94
+ */
95
+ export declare function runtimeMessageMarkerText(message: AthenaRuntimeMessage): string | undefined;
96
+ /**
97
+ * The runtime message's kind when it owns the whole row, else `undefined`.
98
+ *
99
+ * Returns a primitive so it is safe as a `useAuiState` selector (the reader
100
+ * above builds a fresh object per call; an object snapshot would loop the
101
+ * render under `Object.is` comparison).
102
+ */
103
+ export declare function readSoleRuntimeMessageKind(message: Parameters<typeof readRuntimeMessageFromSourceMessages>[0]): AthenaRuntimeMessageKind | undefined;
104
+ export {};
@@ -0,0 +1,151 @@
1
+ /**
2
+ * Screen points: the agent's on-screen coordinates as structured, renderable
3
+ * data.
4
+ *
5
+ * Browser agents already speak in `[x, y]` pairs — the `coordinate` argument
6
+ * of `chrome_computer` / `device_computer` / `computer` is a pixel in the
7
+ * screenshot the model was shown. In prose those pairs arrive as free text
8
+ * ("Delete at ~(1038, 81)"), which no surface can render as anything but
9
+ * characters. A screen point is that same pair written as a markdown link
10
+ * whose destination carries the pair *and the dimensions of the screenshot it
11
+ * was read from*:
12
+ *
13
+ * [Delete](athena-point://screenshot?x=1038&y=81&w=1280&h=720&tab=8811)
14
+ *
15
+ * The agent keeps its native vocabulary (the coordinate it already has, the
16
+ * screenshot size it was told) and does no arithmetic; every chat surface
17
+ * that understands the scheme renders the link as a chip and, because the
18
+ * basis dimensions travel with the point, can place a marker at the right
19
+ * relative spot on any later rendition of that screenshot however the
20
+ * transcript is laid out or the user's window is resized. Surfaces that do
21
+ * not understand the scheme show the label as plain text (a link with an
22
+ * unknown protocol), which is exactly the prose we have today — the format
23
+ * degrades to the status quo, never below it.
24
+ *
25
+ * Pure string and number work, UI-library-free, shared by every chat surface
26
+ * (Olympus, the React SDK hosts, the Chrome extension side panel) so a point
27
+ * that is valid on one surface is valid on all of them.
28
+ */
29
+ /** URL scheme of a screen-point link. */
30
+ export declare const SCREEN_POINT_PROTOCOL = "athena-point:";
31
+ /** Host of a screen-point link: the coordinate space the pair lives in. */
32
+ export declare const SCREEN_POINT_HOST = "screenshot";
33
+ /** `href.startsWith(SCREEN_POINT_HREF_PREFIX)` is the cheap pre-check every renderer runs. */
34
+ export declare const SCREEN_POINT_HREF_PREFIX = "athena-point://";
35
+ /**
36
+ * The largest coordinate or dimension a point may carry. No screenshot the
37
+ * runtime delivers approaches this; anything larger is a typo or a unit mix-up.
38
+ */
39
+ export declare const SCREEN_POINT_MAX_EXTENT = 32767;
40
+ /**
41
+ * The model-facing CUA screenshot size the Chrome extension emits by default
42
+ * (`athena-in-chrome/extension/src/background.ts`, `CHROME_DEFAULT_WIDTH` /
43
+ * `CHROME_DEFAULT_HEIGHT` in `chrome_browser_tools.py`). Surfaces may offer
44
+ * it as the fallback basis for a point that omits `w`/`h`, clearly labelled
45
+ * as assumed.
46
+ */
47
+ export declare const DEFAULT_CUA_SCREENSHOT_SIZE: {
48
+ readonly width: 1280;
49
+ readonly height: 720;
50
+ };
51
+ /** Width and height of a coordinate space, in that space's pixels. */
52
+ export interface ScreenSize {
53
+ width: number;
54
+ height: number;
55
+ }
56
+ /**
57
+ * A point in screenshot space. `basis` is the size of the screenshot the pair
58
+ * was read from; `null` when the link omitted it, in which case the point can
59
+ * be shown but not placed. `tabId` is the Chrome tab the screenshot came from
60
+ * when the agent had one.
61
+ */
62
+ export interface ScreenPoint {
63
+ x: number;
64
+ y: number;
65
+ basis: ScreenSize | null;
66
+ tabId: number | null;
67
+ }
68
+ /**
69
+ * Why a link that starts with the scheme could not become a point. Rendered
70
+ * surfaces show the label as text with the reason in a tooltip, so a broken
71
+ * link never becomes an interactive marker that points nowhere.
72
+ */
73
+ export type ScreenPointParseError = "not-screen-point" | "missing-coordinate" | "non-finite-number" | "negative-number" | "degenerate-basis" | "out-of-bounds" | "extent-too-large";
74
+ export type ScreenPointParseResult = {
75
+ ok: true;
76
+ point: ScreenPoint;
77
+ } | {
78
+ ok: false;
79
+ error: ScreenPointParseError;
80
+ };
81
+ /** Whether `href` is a screen-point link at all (the cheap pre-check). */
82
+ export declare function isScreenPointHref(href: string | null | undefined): href is string;
83
+ /**
84
+ * Parse a screen-point link. Accepts the canonical form
85
+ * `athena-point://screenshot?x=…&y=…&w=…&h=…&tab=…` and tolerates what a
86
+ * model plausibly writes instead: `width`/`height` for `w`/`h`, `tab_id` for
87
+ * `tab`, decimals, a leading `~`, and an empty or different host. Rejects,
88
+ * with a reason, anything that would place a marker in the wrong spot:
89
+ * non-finite or negative numbers, a zero or negative basis, a point outside
90
+ * its basis, and absurd extents.
91
+ */
92
+ export declare function parseScreenPointHref(href: string | null | undefined): ScreenPointParseResult;
93
+ /** The canonical link for a point — what the prompt teaches the agent to write. */
94
+ export declare function serializeScreenPointHref(point: ScreenPoint): string;
95
+ /**
96
+ * Where the point sits as a fraction of its basis, `0..1` on each axis, or
97
+ * `null` when the point has no basis to be relative to. This is the only
98
+ * number a renderer needs: `left: ${fx * 100}%` places the marker on any
99
+ * rendition of the screenshot, whatever size it is drawn at.
100
+ */
101
+ export declare function screenPointFraction(point: ScreenPoint): {
102
+ fx: number;
103
+ fy: number;
104
+ } | null;
105
+ /** Whether two sizes are the same to within the few-pixel jitter a resize or scrollbar introduces. */
106
+ export declare function sameScreenSize({ a, b, tolerancePx, }: {
107
+ a: ScreenSize;
108
+ b: ScreenSize;
109
+ tolerancePx?: number;
110
+ }): boolean;
111
+ /**
112
+ * How a point's basis relates to the screenshot it is about to be drawn on.
113
+ * Mirrors the runtime's dispatch contract (`browser_coordinate_contract.json`):
114
+ * the same size or a few pixels of jitter is `identity`; a uniform ratio on
115
+ * both axes (browser zoom, a resized window at the same aspect) is
116
+ * `uniform-scale` and the fraction still lands on the same element; anything
117
+ * else is a `mismatch` — a different aspect ratio means the screenshot shows a
118
+ * different framing (chrome headroom, a rotated device, a different tab) and
119
+ * a fraction placed on it would point at the wrong thing.
120
+ */
121
+ export type ScreenBasisFit = {
122
+ kind: "identity";
123
+ } | {
124
+ kind: "uniform-scale";
125
+ scale: number;
126
+ } | {
127
+ kind: "mismatch";
128
+ aspectDelta: number;
129
+ };
130
+ export declare function fitScreenBasis({ basis, target, aspectTolerance, }: {
131
+ basis: ScreenSize;
132
+ target: ScreenSize;
133
+ aspectTolerance?: number;
134
+ }): ScreenBasisFit;
135
+ /** Human-readable point for tooltips and accessible names: `(1038, 81) in a 1280×720 screenshot`. */
136
+ export declare function formatScreenPoint(point: ScreenPoint): string;
137
+ /** The sentence a surface shows for a link that failed to parse. */
138
+ export declare function describeScreenPointError(error: ScreenPointParseError): string;
139
+ /**
140
+ * Screen points written into a text block, in order. Used by surfaces that
141
+ * work on the raw markdown (the static message body's node parser, the
142
+ * extension's plain-text composer) and by tests. Only the link form is
143
+ * recognised — a bare `(1038, 81)` in prose is text, never a point, so a
144
+ * model that was not taught the scheme changes nothing.
145
+ */
146
+ export declare function findScreenPointLinks(text: string): Array<{
147
+ start: number;
148
+ end: number;
149
+ label: string;
150
+ href: string;
151
+ }>;