@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,603 @@
1
+ import { getExternalStoreMessages, type ThreadMessage, type ThreadStep } from '@assistant-ui/core';
2
+ import { type useExternalMessageConverter } from '@assistant-ui/core/react';
3
+ import { type LangChainMessage } from '@assistant-ui/react-langgraph';
4
+ import { type DeepAgentMessageAuthor } from './message-author';
5
+ import type { DeepAgentToolOutputStore } from './tool-outputs';
6
+ import type { DeepAgentWithdrawnTurns } from './withdrawn-turns';
7
+ import type { DeepAgentLaneProjection, DeepAgentStreamValues, LangGraphState } from './types';
8
+ /**
9
+ * A model call's token use as assistant-ui's native step usage, read off the
10
+ * LangChain message's `usage_metadata` with the session ledger's rule (agora
11
+ * `normalize_usage_metadata`, as `lane_usage.usage_counts` reads it; both are
12
+ * held to the same shapes): `inputTokens` counts the whole input, the prompt
13
+ * cache's reads and writes included, added in when the adapter left them out
14
+ * (the legacy Bedrock adapter) or the totals prove it did. `undefined` for a
15
+ * message that reports no usage.
16
+ */
17
+ export declare function nativeStepUsage(message: LangChainMessage): ThreadStep['usage'];
18
+ /**
19
+ * The shipped `convertLangChainMessages` with assistant-ui's native step and
20
+ * timing metadata filled in for an AI message: `metadata.steps` holds its model
21
+ * call with its token use ({@link nativeStepUsage}), and a turn's final message
22
+ * carries the turn's `metadata.timing` ({@link nativeTurnTiming}). assistant-ui
23
+ * joins a turn's messages by concatenating their steps (`joinExternalMessages`),
24
+ * so a converted turn lists every model call it made. Any other message converts
25
+ * as the shipped converter has it.
26
+ */
27
+ export declare const convertDeepAgentLangChainMessage: useExternalMessageConverter.Callback<LangChainMessage>;
28
+ /**
29
+ * Native message converter for the deep-agent runtime.
30
+ *
31
+ * This is the entire "conversion" layer: assistant-ui's shipped
32
+ * `convertLangChainMessages` (from `@assistant-ui/react-langgraph`) wired
33
+ * through `createMessageConverter`, with the native step and timing metadata
34
+ * the shipped converter leaves out ({@link convertDeepAgentLangChainMessage}).
35
+ * No bespoke per-message mapping — the agora `athena_deep_agent` graph streams
36
+ * standard LangChain messages via `append_langgraph_event`, and the shipped
37
+ * converter renders them.
38
+ */
39
+ export declare const messageConverter: {
40
+ useThreadMessages: ({ messages, isRunning, joinStrategy, metadata, }: {
41
+ messages: LangChainMessage[];
42
+ isRunning: boolean;
43
+ joinStrategy?: import("@assistant-ui/core/store").JoinStrategy | undefined;
44
+ metadata?: useExternalMessageConverter.Metadata;
45
+ }) => ThreadMessage[];
46
+ toThreadMessages: (messages: LangChainMessage[], isRunning?: boolean, metadata?: useExternalMessageConverter.Metadata) => ThreadMessage[];
47
+ toOriginalMessages: (input: import("@assistant-ui/core").ThreadRuntimeState | ThreadMessage | ThreadMessage["content"][number]) => unknown[];
48
+ toOriginalMessage: (input: import("@assistant-ui/core").ThreadRuntimeState | ThreadMessage | ThreadMessage["content"][number]) => {};
49
+ useOriginalMessage: () => {};
50
+ useOriginalMessages: () => unknown[];
51
+ };
52
+ /**
53
+ * `message` with every tool call whose result is still the backend's
54
+ * running-tool placeholder (see {@link isRunningToolPlaceholderArtifact})
55
+ * marked `isPreliminary`: the result is interim, and the call has not settled.
56
+ *
57
+ * The shipped converter joins a placeholder ToolMessage into its call like any
58
+ * result, which would read as a finished call on every surface: assistant-ui
59
+ * gives a part with a result the `complete` status (cards draw "done", and a
60
+ * tool's completion side effects fire with the interim payload), and a tool's
61
+ * `streamCall` reader resolves with it. A preliminary part instead takes its
62
+ * message's status (`running` while the run is) and the reader waits for the
63
+ * real result, while the card still reads the interim one (progress, a deep
64
+ * research id, a streaming description). The real ToolMessage carries no
65
+ * marker, so its part is plain again. Turns without a placeholder pass through
66
+ * by identity.
67
+ */
68
+ export declare function markPreliminaryToolResults(message: ThreadMessage): ThreadMessage;
69
+ /**
70
+ * What a thread's conversion memory does: one pass's messages in, the pass's
71
+ * rows out. {@link DeepAgentMessageConversionCache} is the shared one; a host
72
+ * can build on it (`createSubagentTranscriptConversionCache`).
73
+ */
74
+ export interface DeepAgentConversionMemory {
75
+ convert(messages: LangChainMessage[], isRunning: boolean): ThreadMessage[];
76
+ }
77
+ /**
78
+ * One thread's conversion memory: converting through it maps every source
79
+ * message that is unchanged since the previous pass to the IDENTICAL
80
+ * `ThreadMessage`, so a streamed token rebuilds only the turn it lands in
81
+ * instead of every message in the transcript (and every per-message
82
+ * subscriber, memo and tool card below it).
83
+ *
84
+ * Create one per attached thread and drop it with the attach: entries are
85
+ * keyed by source message identity (WeakMaps, so they die with the wire state
86
+ * that holds them), and a fresh cache per attach keeps one thread's converted
87
+ * messages from ever being served for another.
88
+ */
89
+ export declare class DeepAgentMessageConversionCache implements DeepAgentConversionMemory {
90
+ private readonly cache;
91
+ /**
92
+ * Every cached entry is rebuilt when the metadata object changes identity,
93
+ * so it is created once per cache and never per pass. The tool-args
94
+ * key-order memory keeps a finished tool call's `argsText` in the order its
95
+ * arguments streamed in (assistant-ui's own LangGraph runtime passes the
96
+ * same).
97
+ */
98
+ private readonly metadata;
99
+ private previous;
100
+ /** `convertExternalMessages`' own rows for the previous pass, before parts were kept. */
101
+ private previousConverted;
102
+ /**
103
+ * Convert one pass's LangChain messages. Returns the previous pass's array
104
+ * itself when every converted message is unchanged, so a packet that moved
105
+ * no message re-renders no message; a re-converted turn keeps the row key
106
+ * of the row it continues (see {@link deepAgentRowKey}) and the previous
107
+ * pass's part objects for the parts that did not change
108
+ * (see {@link keepUnchangedParts}).
109
+ */
110
+ convert(messages: LangChainMessage[], isRunning: boolean): ThreadMessage[];
111
+ }
112
+ /**
113
+ * The key a deep-agent thread message renders under in a message list: its
114
+ * id, except for a turn that grew at its head.
115
+ *
116
+ * assistant-ui joins an agent run's consecutive messages into one turn whose
117
+ * id is its first message's, so a page of older history that folds into the
118
+ * first loaded turn (a long run's earlier steps) gives that turn a new id on
119
+ * every page. The conversion cache keeps such a turn under the key of the row
120
+ * it continues, so a list keyed by it keeps the turn's row, and the row's own
121
+ * state, while the page lands. What is mounted inside the row stays mounted
122
+ * only if the parts render under keys that survive the fold too: assistant-ui
123
+ * keys a toolkit group by its first part, which the fold changes when its
124
+ * steps join that group (`GroupedMessageParts` in `@athenaintel/react` carries
125
+ * the keys over). `message.id` stays the message's id: metadata, links and
126
+ * anchors read it.
127
+ *
128
+ * Takes a converted message or the message state assistant-ui publishes for
129
+ * it, which copies the key. A message from another runtime, or one converted
130
+ * without a conversion cache, renders under its id.
131
+ */
132
+ export declare function deepAgentRowKey(message: {
133
+ readonly id: string;
134
+ }): string;
135
+ /** A conversion cache for one attached thread (see {@link DeepAgentMessageConversionCache}). */
136
+ export declare function createDeepAgentMessageConversionCache(): DeepAgentMessageConversionCache;
137
+ /**
138
+ * `metadata.custom` flag marking a bubble that is a projection of a run-lane
139
+ * entry — a message the server holds and has NOT dispatched yet.
140
+ *
141
+ * The lane is server-owned and replicated to every client on the thread, so
142
+ * an item queued on one surface projects onto all of them. Surfaces without a
143
+ * queue panel must therefore be able to tell a queued projection apart from a
144
+ * submitted turn, or a message another device queued renders as if this device
145
+ * had already sent it.
146
+ *
147
+ * `convertLangChainMessages` exposes `additional_kwargs.metadata` (and nothing
148
+ * else) as the thread message's `metadata.custom`.
149
+ */
150
+ export declare const ATHENA_QUEUED_LANE_KEY = "athena_queued_lane";
151
+ /**
152
+ * Whether a thread message's `metadata.custom` marks it as an undispatched
153
+ * lane projection. Returns a primitive, so it is safe to use directly as a
154
+ * `useAuiState` selector.
155
+ */
156
+ export declare function isQueuedLaneMessage(custom: Record<string, unknown> | undefined): boolean;
157
+ export interface DeepAgentMaterializeOptions {
158
+ /** The viewer, stamped onto this client's own not-yet-acknowledged sends. */
159
+ selfAuthor?: DeepAgentMessageAuthor | null;
160
+ }
161
+ /**
162
+ * Materialize fold for the statewire path: makes the server's dispatch record
163
+ * concrete in the LangGraph state itself, so direct state reads see dispatched
164
+ * messages and the lib's post-converter dispatch merge stays off.
165
+ */
166
+ export declare const createDeepAgentMaterialize: ({ selfAuthor }?: DeepAgentMaterializeOptions) => (draft: DeepAgentStreamValues) => void;
167
+ /** The materialize fold without a viewer identity (surfaces that pass none). */
168
+ export declare const deepAgentMaterialize: (draft: DeepAgentStreamValues) => void;
169
+ /**
170
+ * Project run lanes into human messages for the converter tail, so a queued or
171
+ * steered item stays visible below the pending-assistant placeholder until its
172
+ * dispatch. Surfaces with a queue panel project only the steer lane
173
+ * (`'steer-only'`); surfaces without one project both lanes (`'both'`).
174
+ *
175
+ * Every projected entry carries {@link ATHENA_QUEUED_LANE_KEY} so a surface
176
+ * without a queue panel can render it as queued rather than as a submitted
177
+ * turn.
178
+ */
179
+ export declare const laneTailMessages: (state: unknown, laneProjection?: DeepAgentLaneProjection, selfAuthor?: DeepAgentMessageAuthor | null) => LangChainMessage[];
180
+ /** Stable id for the derived running-assistant placeholder. */
181
+ export declare const PENDING_ASSISTANT_MESSAGE_ID = "__athena_deep_agent_pending_assistant__";
182
+ /**
183
+ * Append an empty assistant turn while a run is in flight and the visible
184
+ * history does not already end in one, so the thread shows its "Thinking…"
185
+ * status line from the moment a message is submitted.
186
+ *
187
+ * Mirrors `hasUpcomingMessage` in assistant-ui's legacy external-store runtime,
188
+ * which synthesized this placeholder itself. `StatewireThread` renders the
189
+ * converter's message list verbatim, so the placeholder has to come from here —
190
+ * derived from the replicated run status on every render (never written into
191
+ * transport state) so it cannot outlive the run, and carrying a stable id so
192
+ * the streaming bubble's identity does not churn when the real assistant
193
+ * message arrives.
194
+ *
195
+ * `tool` messages convert into assistant turns too, so a mid-run tool result
196
+ * must not produce a second placeholder row.
197
+ */
198
+ export declare function withPendingAssistantMessage(messages: LangChainMessage[], isRunning: boolean): LangChainMessage[];
199
+ /**
200
+ * Surface a run failure the base-correct way: stamp `status: { type:'incomplete',
201
+ * reason:'error', error }` onto the assistant turn so `<Thread/>` renders it via
202
+ * `ErrorPrimitive`. This is the core runtime's model (see `useLanggraphRuntime`
203
+ * `onError`) — NOT a fabricated `⚠️ The run failed` assistant text message, and
204
+ * NOT a magic-string contract shared with the agora backend.
205
+ *
206
+ * Stamps a trailing assistant message; if the visible history does not already
207
+ * end with an assistant turn, appends a synthetic empty assistant turn with a
208
+ * STABLE id so it never churns across renders. A `null` error is a no-op. The
209
+ * shipped `convertLangChainMessages` converter passes `message.status` through.
210
+ */
211
+ export declare function applyRunErrorStatus(messages: LangChainMessage[], errorMessage: string | null): LangChainMessage[];
212
+ /**
213
+ * `additional_kwargs` flag the backend stamps on run-lifecycle marker messages
214
+ * (agora `athena_deep_agent/run_markers.py`) — e.g. the "⏹️ Run stopped by
215
+ * user." message persisted when a run is cancelled.
216
+ */
217
+ export declare const ATHENA_RUN_MARKER_KEY = "athena_run_marker";
218
+ /** The {@link ATHENA_RUN_MARKER_KEY} value for a user-cancelled run. */
219
+ export declare const ATHENA_RUN_MARKER_CANCELLED = "cancelled";
220
+ /**
221
+ * `additional_kwargs` key carrying the stop source behind a cancellation
222
+ * marker (agora `stop_signals.py`: `user_stop`, `send_now`, `transport_cancel`,
223
+ * `unattributed`).
224
+ */
225
+ export declare const ATHENA_RUN_MARKER_SOURCE_KEY = "athena_run_marker_source";
226
+ /** The stop source for a "Send now" promotion pre-empting the live run. */
227
+ export declare const ATHENA_STOP_SOURCE_SEND_NOW = "send_now";
228
+ /**
229
+ * The stop source for a spoken follow-up that redirected a voice-delegated
230
+ * run through the steer lane: the user spoke, they never pressed Stop, so it
231
+ * renders as a redirect rather than as "Conversation stopped".
232
+ */
233
+ export declare const ATHENA_STOP_SOURCE_VOICE_STEER = "voice_steer";
234
+ /** The stop source for a pod-drain pause (server update), not a user stop. */
235
+ export declare const ATHENA_STOP_SOURCE_POD_DRAIN = "pod_drain";
236
+ /**
237
+ * The {@link ATHENA_RUN_MARKER_SOURCE_KEY} value for a run whose hosting
238
+ * instance closed under it (a server update that reached its eviction
239
+ * deadline mid-step, or a placement lost to a lease lapse). Same family as a
240
+ * pod drain: nobody stopped the run, the backend resumes it automatically.
241
+ */
242
+ export declare const ATHENA_STOP_SOURCE_INSTANCE_CLOSED = "instance_closed";
243
+ /**
244
+ * Whether a cancellation marker's source names the infrastructure — a pod
245
+ * drain or a closed instance — rather than a person or a client action. These
246
+ * endings read as a pause while the server resumes the run.
247
+ */
248
+ export declare function isServerUpdateStopSource(source: string | undefined): boolean;
249
+ /**
250
+ * The {@link ATHENA_RUN_MARKER_KEY} value for a failed run (graph error,
251
+ * including the `GraphRecursionError` "tool call limit was reached" case).
252
+ * The marker message's text content carries the user-facing failure copy.
253
+ */
254
+ export declare const ATHENA_RUN_MARKER_FAILED = "failed";
255
+ /**
256
+ * `additional_kwargs` key carrying the canonical reason a run ended (agora
257
+ * `athena_deep_agent/termination.py`): `user_stop`, `recursion_limit`,
258
+ * `duplicate_call_guard`, `step_budget`, `ended_after_tools`, `model_refusal`,
259
+ * `completed`, …
260
+ * Stamped on run-lifecycle markers and on handoff messages.
261
+ */
262
+ export declare const ATHENA_TERMINATION_REASON_KEY = "athena_termination_reason";
263
+ /**
264
+ * `additional_kwargs` flag on the closing message the runtime's **handoff
265
+ * turn** wrote (one tools-disabled model call made when a guard or the step
266
+ * budget ends the run). The message text is the agent's closing summary; the
267
+ * flag lets clients frame it as a runtime ending rather than a normal reply.
268
+ */
269
+ export declare const ATHENA_HANDOFF_KEY = "athena_handoff";
270
+ /**
271
+ * Read a run-lifecycle marker out of a thread message's **bound source
272
+ * messages**, bypassing the converter's metadata join entirely.
273
+ *
274
+ * Why this exists: assistant-ui chunks consecutive assistant/tool messages
275
+ * into ONE `ThreadMessage`, and the upstream join copies `metadata.custom`
276
+ * only from the FIRST assistant message of the chunk
277
+ * (`external-message-converter.ts`: the merge sits inside
278
+ * `if (assistantMessage.content.length === 0)`). A failure marker appended
279
+ * after the assistant's own turn is therefore never the first message in its
280
+ * chunk, so `message.metadata.custom.athena_run_marker` is silently dropped
281
+ * and the whole-message gate can't fire.
282
+ *
283
+ * `getExternalStoreMessages` returns the raw LangChain messages bound to the
284
+ * joined thread message, so the marker is found wherever it sits in the chunk.
285
+ * Returns the marker value plus its text content (the user-facing copy).
286
+ */
287
+ export interface RunMarkerInfo {
288
+ marker: string;
289
+ /** The stop source stamped by the backend, when the marker carries one. */
290
+ source: string | undefined;
291
+ /** The marker message's text — the user-facing copy. */
292
+ text: string | undefined;
293
+ /**
294
+ * True when the marker is the ONLY source message behind this thread message,
295
+ * i.e. it owns the whole row (a cancelled run drops its partial turn, so its
296
+ * marker stands alone).
297
+ *
298
+ * False when the chunk also holds the assistant's own work. Replacing the row
299
+ * in that case would hide completed prose and tool cards — the marker must be
300
+ * styled in place instead.
301
+ */
302
+ isSoleSourceMessage: boolean;
303
+ }
304
+ export declare function readRunMarkerFromSourceMessages(message: Parameters<typeof getExternalStoreMessages>[0] & {
305
+ metadata?: {
306
+ custom?: Record<string, unknown> | undefined;
307
+ } | undefined;
308
+ content?: unknown;
309
+ }): RunMarkerInfo | undefined;
310
+ /**
311
+ * The marker value when the marker is the SOLE source message behind a thread
312
+ * message (it owns the whole row), else `undefined`.
313
+ *
314
+ * Returns a primitive so it is safe to use directly as a `useAuiState`
315
+ * selector: `readRunMarkerFromSourceMessages` builds a fresh object on every
316
+ * call, and selector snapshots are compared with `Object.is` — returning that
317
+ * object from a selector makes `getSnapshot` unstable and loops the render.
318
+ */
319
+ export declare function readSoleRunMarker(message: Parameters<typeof readRunMarkerFromSourceMessages>[0]): string | undefined;
320
+ /**
321
+ * Whether a run marker renders nothing: a `send_now` promotion cancels the
322
+ * live run as plumbing, not as a user-visible stop, so its cancellation
323
+ * marker stays in the data for provenance but paints no divider.
324
+ */
325
+ export declare function isSilentRunMarker(found: RunMarkerInfo): boolean;
326
+ /**
327
+ * Whether a cancellation marker records a server-update pause — a cooperative
328
+ * pod drain, or the hosting instance closing under the run — rather than a
329
+ * stop the user asked for. Rendered with distinct "paused by a server update"
330
+ * copy instead of the "Conversation stopped" pill; the backend resumes the run.
331
+ */
332
+ export declare function isDrainRunMarker(found: RunMarkerInfo): boolean;
333
+ /**
334
+ * Surface the backend's top-level `additional_kwargs.athena_run_marker` flag
335
+ * where the shipped converter can see it.
336
+ *
337
+ * `convertLangChainMessages` exposes ONLY `additional_kwargs.metadata` as the
338
+ * thread message's `metadata.custom`; every other `additional_kwargs` key is
339
+ * dropped. Marker messages persisted before the backend mirrored the flag into
340
+ * `metadata` carry it top-level only, so this lift keeps those threads styling
341
+ * correctly. Non-marker messages pass through with their identity unchanged,
342
+ * and already-mirrored markers are left as-is (idempotent).
343
+ */
344
+ export declare function liftRunMarkerIntoMetadata(message: LangChainMessage): LangChainMessage;
345
+ /**
346
+ * Mirror the termination reason and handoff flag into the converter's metadata
347
+ * channel. The backend dual-writes both (top-level + `metadata`), so this lift
348
+ * is the back-compat path for messages persisted before the mirror existed and
349
+ * for any emitter that only stamps the top-level key. Idempotent; identity for
350
+ * messages without the keys.
351
+ */
352
+ export declare function liftTerminationIntoMetadata(message: LangChainMessage): LangChainMessage;
353
+ /**
354
+ * `additional_kwargs` key (and `metadata` mirror) carrying a failure marker's
355
+ * structured error records (agora `athena_deep_agent/run_markers.py`
356
+ * `failure_error_records`): `[{ error, provider?, message? }]`, where `error`
357
+ * is the client code a surface branches on — `context_length_exceeded`,
358
+ * `transient_api_error` (with `provider: 'azure_foundry' |
359
+ * 'external_model_provider'`), `content_filter`, `request_too_large`, … — the
360
+ * same shape the legacy agent node emitted.
361
+ */
362
+ export declare const ATHENA_ERRORS_KEY = "errors";
363
+ /**
364
+ * Mirror a failure marker's structured `errors` records into the converter's
365
+ * metadata channel. The backend dual-writes them (top-level + `metadata`), so
366
+ * this lift is the back-compat path for messages that carry only the top-level
367
+ * key (an emitter that never mirrored, or a record persisted before the mirror
368
+ * existed). Records already present in the metadata channel win; no-ops are
369
+ * identity.
370
+ */
371
+ export declare function liftErrorsIntoMetadata(message: LangChainMessage): LangChainMessage;
372
+ /**
373
+ * Read a failure's structured `errors` records out of a thread message's
374
+ * **bound source messages**, bypassing the converter's metadata join.
375
+ *
376
+ * Same reason as {@link readRunMarkerFromSourceMessages}: assistant-ui chunks
377
+ * consecutive assistant/tool messages into ONE `ThreadMessage` and copies
378
+ * `metadata.custom` only from the FIRST assistant message of the chunk. The
379
+ * failure marker that carries the records is appended after the assistant's
380
+ * own turn, so `message.metadata.custom.errors` is silently dropped whenever
381
+ * the run produced anything before failing. The bound sources are walked from
382
+ * the tail (the terminal failure wins); the joined metadata is the fallback
383
+ * for surfaces whose messages carry no bound sources. Returns the raw records
384
+ * (callers validate the shape) or `undefined`.
385
+ */
386
+ export declare function readMessageErrorsFromSourceMessages(message: Parameters<typeof getExternalStoreMessages>[0] & {
387
+ metadata?: {
388
+ custom?: Record<string, unknown> | undefined;
389
+ } | undefined;
390
+ }): unknown[] | undefined;
391
+ /**
392
+ * Mirror the producing model into the converter's metadata channel. Wire AI
393
+ * messages are full LangChain dumps whose `response_metadata` reports the model
394
+ * that generated them (`model_name` / `model`), but the shipped converter maps
395
+ * only `additional_kwargs.metadata` into `metadata.custom` — so without this
396
+ * lift a surface can only show the CURRENT run config's model, mislabeling
397
+ * earlier messages after a mid-thread model switch. A model already present in
398
+ * the metadata channel (backend-stamped provenance) wins; no-ops are identity.
399
+ */
400
+ export declare function liftModelIntoMetadata(message: LangChainMessage): LangChainMessage;
401
+ /**
402
+ * Mirror a per-message conversation-stats snapshot into the converter's
403
+ * metadata channel. Backends stamp the snapshot at the legacy location —
404
+ * top-level `additional_kwargs.conversation_stats` (the deep-agent stats
405
+ * middleware and the legacy agent node both write it there) — but the shipped
406
+ * converter maps only `additional_kwargs.metadata` into `metadata.custom`, so
407
+ * without this lift the model badge can never show a message's OWN context and
408
+ * falls back to thread-level live numbers. A snapshot already present in the
409
+ * metadata channel wins; no-ops are identity.
410
+ */
411
+ export declare function liftConversationStatsIntoMetadata(message: LangChainMessage): LangChainMessage;
412
+ /**
413
+ * Mirror the compaction boundary flag into the converter's metadata channel.
414
+ * A manual `/compact` persists its summary as a human message tagged with
415
+ * top-level `additional_kwargs.compaction_start` (plus `_created_at` for the
416
+ * divider timestamp) — the same location the legacy runtime used — but the
417
+ * shipped converter maps only `additional_kwargs.metadata` into
418
+ * `metadata.custom`, so without this lift the transcript's
419
+ * "Previous conversation summarized" divider can never render. A flag already
420
+ * present in the metadata channel wins; no-ops are identity.
421
+ */
422
+ export declare function liftCompactionBoundaryIntoMetadata(message: LangChainMessage): LangChainMessage;
423
+ /**
424
+ * Mirror the handoff summary flag into the converter's metadata channel.
425
+ * Handoff summaries are persisted as human messages tagged with top-level
426
+ * `additional_kwargs.handoff_summary` (plus `_created_at`) — the same location
427
+ * the backend uses for message metadata — but the shipped converter maps only
428
+ * `additional_kwargs.metadata` into `metadata.custom`, so without this lift
429
+ * the summary would render as a normal user bubble. A flag already present in
430
+ * the metadata channel wins; no-ops are identity.
431
+ */
432
+ export declare function liftHandoffSummaryIntoMetadata(message: LangChainMessage): LangChainMessage;
433
+ /**
434
+ * Mirror an AOP run's provenance into the converter's metadata channel. The
435
+ * backend stamps the kicking-off user message with top-level
436
+ * `additional_kwargs.aop_source` (agora `events/helpers.py`
437
+ * `_build_aop_source_metadata`), which the legacy converter surfaced as
438
+ * `metadata.custom.aop_source` — where the "AOP · <title>" badge reads it. The
439
+ * shipped `convertLangChainMessages` maps only `additional_kwargs.metadata`
440
+ * into `metadata.custom`, so without this lift an AOP run's conversation never
441
+ * shows which AOP asset kicked it off. Provenance already present in the
442
+ * metadata channel wins; no-ops are identity.
443
+ */
444
+ export declare function liftAopSourceIntoMetadata(message: LangChainMessage): LangChainMessage;
445
+ export declare function liftBranchIntoMetadata(message: LangChainMessage): LangChainMessage;
446
+ /**
447
+ * Mirror a ToolMessage's user-set `additional_kwargs` into
448
+ * `artifact._tool_message_metadata` — the location `useToolCallMetadata` reads
449
+ * persisted per-tool-call metadata from (`email_sent_at`, draft edits,
450
+ * `calendar_event_created_at`, …).
451
+ *
452
+ * The `setMessageMetadata` mutation persists those keys onto the ToolMessage's
453
+ * `additional_kwargs` in the checkpoint, and the legacy converter lifted them
454
+ * into the artifact. The shipped `convertLangChainMessages` forwards only
455
+ * `artifact` and drops `additional_kwargs` for tool messages, so without this
456
+ * lift the metadata survives in the checkpoint but never reaches a tool card
457
+ * after a reload. Kwargs values win over same-key artifact entries (the kwargs
458
+ * are the durable write target); messages with no user-set kwargs pass through
459
+ * by identity.
460
+ */
461
+ export declare function liftToolMessageMetadataIntoArtifact(message: LangChainMessage): LangChainMessage;
462
+ /**
463
+ * Lift a windowed wire's tool-output truncation marker into the tool-call
464
+ * part's `artifact` (`_athena_content_truncated: { chars, messageId }`).
465
+ *
466
+ * The host cuts long plain-text tool outputs on a windowed wire and stamps
467
+ * `athena_content_truncated` on the wire message; the shipped converter joins
468
+ * a ToolMessage into its assistant turn's tool-call part and keeps only
469
+ * `artifact` and the result, so without this lift no tool card could tell the
470
+ * output is cut nor which message to ask `history/tool_output` for. Messages
471
+ * without the marker pass through by identity.
472
+ */
473
+ export declare function liftTruncatedToolOutputIntoArtifact(message: LangChainMessage): LangChainMessage;
474
+ /**
475
+ * A content list's bare-string entries as typed text parts.
476
+ *
477
+ * LangChain content is `string | (string | ContentBlock)[]`, and a model with
478
+ * no tools bound streams exactly that mix: `langchain_anthropic` coerces text
479
+ * deltas to plain strings when no tools are bound, yet a thinking block still
480
+ * arrives as a list block, so the merged reply is `["", {thinking}, "text"]`
481
+ * (the side-question lane's bare model). The shipped converter maps only typed
482
+ * blocks and drops the strings, leaving the reasoning with no answer. Empty
483
+ * strings are dropped; messages with no string entries pass through by
484
+ * identity.
485
+ */
486
+ export declare function normalizeStringContentParts(message: LangChainMessage): LangChainMessage;
487
+ /**
488
+ * A cut tool message with its full output put back, when the store holds one
489
+ * fetched for this very output (`history/tool_output` answered for the same
490
+ * `chars` the wire's marker reports); the marker leaves with the cut.
491
+ * Messages that are whole, whose output has not been fetched, or whose fetched
492
+ * output belongs to a length the host has since replaced, pass through by
493
+ * identity — the loader sees the mismatch and fetches again.
494
+ */
495
+ export declare function substituteToolOutput(message: LangChainMessage, toolOutputs: DeepAgentToolOutputStore): LangChainMessage;
496
+ /**
497
+ * Internal orchestration messages are useful in a trace export but must never
498
+ * become conversation bubbles. Agora stores the flag in `additional_kwargs`;
499
+ * live converter state can expose the same value under `metadata.custom`.
500
+ */
501
+ export declare function isMessageHiddenFromFrontend(message: unknown): boolean;
502
+ /**
503
+ * Whether `convertLangChainMessages` can map this message at all.
504
+ *
505
+ * An unmappable entry converts to `undefined`, which assistant-ui's
506
+ * `convertExternalMessages` wraps as `outputs: [undefined]` and then reads
507
+ * `output.role` off — throwing `Cannot read property 'role' of undefined` and
508
+ * taking the entire thread down instead of dropping one message.
509
+ */
510
+ export declare function isConvertibleChatMessage(message: unknown): boolean;
511
+ /**
512
+ * The one message pipeline every deep-agent surface renders through:
513
+ *
514
+ * 1. drop messages the shipped converter cannot map (`RemoveMessage` etc. —
515
+ * an unmappable entry would crash the whole thread) and internal
516
+ * orchestration messages flagged hidden-from-frontend;
517
+ * 1a. turn bare-string entries of a content list into typed text parts (see
518
+ * {@link normalizeStringContentParts}) so a tool-less model's answer next
519
+ * to its thinking block is not dropped by the converter;
520
+ * 2. lift run-lifecycle markers into the converter's `metadata` channel
521
+ * (see {@link liftRunMarkerIntoMetadata}) so the cancellation row styles as
522
+ * a status divider instead of a plain assistant bubble, and the termination
523
+ * reason + handoff flag alongside them (see
524
+ * {@link liftTerminationIntoMetadata}) so every surface can render a
525
+ * runtime ending (see `runtime-messages.ts`);
526
+ * 3. lift each AI message's producing model into the same channel
527
+ * (see {@link liftModelIntoMetadata}) so model badges reflect the model that
528
+ * actually generated the message, not the currently configured one;
529
+ * 4. lift each AI message's per-message conversation-stats snapshot into the
530
+ * same channel (see {@link liftConversationStatsIntoMetadata}) so the model
531
+ * badge's hover card shows that message's own context usage;
532
+ * 5. lift the compaction boundary flag on `/compact` summary messages into the
533
+ * same channel (see {@link liftCompactionBoundaryIntoMetadata}) so the
534
+ * transcript renders its "Previous conversation summarized" divider;
535
+ * 6. lift the handoff summary flag on carried-over context messages into the
536
+ * same channel (see {@link liftHandoffSummaryIntoMetadata}) so the
537
+ * transcript keeps the summary behind its context panel;
538
+ * 7. lift an AOP run's provenance on its kicking-off user message into the
539
+ * same channel (see {@link liftAopSourceIntoMetadata}) so the message
540
+ * renders its "AOP · <title>" origin badge;
541
+ * 8. lift each ToolMessage's user-set `additional_kwargs` into
542
+ * `artifact._tool_message_metadata` (see
543
+ * {@link liftToolMessageMetadataIntoArtifact}) so persisted per-tool-call
544
+ * metadata reaches tool cards after a reload;
545
+ * 9. lift a windowed wire's tool-output truncation marker into the tool-call
546
+ * part's `artifact` (see {@link liftTruncatedToolOutputIntoArtifact}) so a
547
+ * tool card can fetch the whole output — after first putting back any
548
+ * output already fetched (see {@link substituteToolOutput});
549
+ * 10. lift the host's per-message branch stamp into the same channel
550
+ * (see {@link liftBranchIntoMetadata}) so the branch picker renders each
551
+ * message's edit fan-out.
552
+ *
553
+ * Identity-stable per source: an unchanged source message maps to the
554
+ * IDENTICAL lifted object across passes (see {@link liftedMessageCache}).
555
+ */
556
+ export declare function sanitizeLangChainMessages(messages: readonly LangChainMessage[], { toolOutputs }?: {
557
+ toolOutputs?: DeepAgentToolOutputStore;
558
+ }): LangChainMessage[];
559
+ /** Type guard for the runtime state — an object carrying a `messages` array. */
560
+ export declare function isLangGraphState(value: unknown): value is LangGraphState;
561
+ export interface ConvertDeepAgentStateOptions {
562
+ laneProjection?: DeepAgentLaneProjection;
563
+ /**
564
+ * The viewer, as the backend would stamp them: the author of this client's
565
+ * own not-yet-acknowledged lane entries (see {@link laneEntryAuthor}).
566
+ */
567
+ selfAuthor?: DeepAgentMessageAuthor | null;
568
+ /**
569
+ * Full tool outputs fetched back for a windowed wire's cut tool messages
570
+ * (see {@link substituteToolOutput}); omitted on surfaces that never
571
+ * declare a window.
572
+ */
573
+ toolOutputs?: DeepAgentToolOutputStore;
574
+ /**
575
+ * User turns this client took back ahead of the wire (see
576
+ * {@link DeepAgentWithdrawnTurns}): omitted from the transcript, together
577
+ * with the pending-assistant placeholder a withdrawn tail would earn.
578
+ */
579
+ withdrawnTurns?: DeepAgentWithdrawnTurns;
580
+ /**
581
+ * The attached thread's conversion memory (see
582
+ * {@link createDeepAgentMessageConversionCache}): unchanged messages keep
583
+ * their converted identity across passes. Without one every pass converts
584
+ * the whole transcript from scratch.
585
+ */
586
+ conversionCache?: DeepAgentConversionMemory;
587
+ }
588
+ /**
589
+ * Map server state → assistant-ui thread messages.
590
+ *
591
+ * `state.messages` is the authoritative LangChain history streamed by the
592
+ * backend. The replicated run status (`runs[0].status`) drives the
593
+ * pending-assistant placeholder and the running status. Lane entries render at
594
+ * the tail, after the placeholder, while the run is live (the run is still
595
+ * working the history above them); once the thread rests stopped/errored they
596
+ * are omitted (surfaces with a queue panel list them there instead).
597
+ * Consecutive spoken user turns collapse into one user message (see
598
+ * {@link groupSpokenUserTurns}) before conversion.
599
+ */
600
+ export declare function convertDeepAgentState(state: unknown, { laneProjection, selfAuthor, toolOutputs, withdrawnTurns, conversionCache, }?: ConvertDeepAgentStateOptions): {
601
+ messages: ThreadMessage[];
602
+ isRunning: boolean;
603
+ };