@athenaintel/react 0.41.3 → 0.42.2

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 (479) hide show
  1. package/README.md +132 -10
  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 +123 -8
  82. package/dist/agent-runtime/src/messages.cjs.map +1 -1
  83. package/dist/agent-runtime/src/messages.d.ts +621 -0
  84. package/dist/agent-runtime/src/messages.js +123 -8
  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.cjs +10 -0
  97. package/dist/agent-runtime/src/quota-safe-local-storage-session.cjs.map +1 -1
  98. package/dist/agent-runtime/src/quota-safe-local-storage-session.d.ts +161 -0
  99. package/dist/agent-runtime/src/quota-safe-local-storage-session.js +10 -0
  100. package/dist/agent-runtime/src/quota-safe-local-storage-session.js.map +1 -1
  101. package/dist/agent-runtime/src/running-tool-placeholder.cjs +11 -0
  102. package/dist/agent-runtime/src/running-tool-placeholder.cjs.map +1 -0
  103. package/dist/agent-runtime/src/running-tool-placeholder.d.ts +25 -0
  104. package/dist/agent-runtime/src/running-tool-placeholder.js +11 -0
  105. package/dist/agent-runtime/src/running-tool-placeholder.js.map +1 -0
  106. package/dist/agent-runtime/src/runtime-messages.d.ts +104 -0
  107. package/dist/agent-runtime/src/screen-point.d.ts +151 -0
  108. package/dist/agent-runtime/src/sealed-idb.cjs +112 -0
  109. package/dist/agent-runtime/src/sealed-idb.cjs.map +1 -0
  110. package/dist/agent-runtime/src/sealed-idb.d.ts +106 -0
  111. package/dist/agent-runtime/src/sealed-idb.js +112 -0
  112. package/dist/agent-runtime/src/sealed-idb.js.map +1 -0
  113. package/dist/agent-runtime/src/send-recovery.d.ts +40 -0
  114. package/dist/agent-runtime/src/session-lane-scope.cjs +25 -0
  115. package/dist/agent-runtime/src/session-lane-scope.cjs.map +1 -0
  116. package/dist/agent-runtime/src/session-lane-scope.d.ts +59 -0
  117. package/dist/agent-runtime/src/session-lane-scope.js +25 -0
  118. package/dist/agent-runtime/src/session-lane-scope.js.map +1 -0
  119. package/dist/agent-runtime/src/statewire-attach-observer.d.ts +194 -0
  120. package/dist/agent-runtime/src/statewire-diagnostics.d.ts +74 -0
  121. package/dist/agent-runtime/src/statewire-state.d.ts +29 -0
  122. package/dist/agent-runtime/src/statewire-suspended.cjs.map +1 -1
  123. package/dist/agent-runtime/src/statewire-suspended.d.ts +27 -0
  124. package/dist/agent-runtime/src/statewire-suspended.js.map +1 -1
  125. package/dist/agent-runtime/src/statewire-transport.d.ts +40 -0
  126. package/dist/agent-runtime/src/streaming-markdown.d.ts +46 -0
  127. package/dist/agent-runtime/src/subagent-transcripts.cjs +209 -0
  128. package/dist/agent-runtime/src/subagent-transcripts.cjs.map +1 -0
  129. package/dist/agent-runtime/src/subagent-transcripts.d.ts +71 -0
  130. package/dist/agent-runtime/src/subagent-transcripts.js +209 -0
  131. package/dist/agent-runtime/src/subagent-transcripts.js.map +1 -0
  132. package/dist/agent-runtime/src/subagents.cjs +253 -0
  133. package/dist/agent-runtime/src/subagents.cjs.map +1 -0
  134. package/dist/agent-runtime/src/subagents.d.ts +311 -0
  135. package/dist/agent-runtime/src/subagents.js +253 -0
  136. package/dist/agent-runtime/src/subagents.js.map +1 -0
  137. package/dist/agent-runtime/src/subscription-wake-event.d.ts +111 -0
  138. package/dist/agent-runtime/src/thread-extras.d.ts +43 -0
  139. package/dist/agent-runtime/src/thread-handoff.d.ts +364 -0
  140. package/dist/agent-runtime/src/thread-prewarm-controller.d.ts +76 -0
  141. package/dist/agent-runtime/src/thread-prewarm.d.ts +118 -0
  142. package/dist/agent-runtime/src/thread-snapshot-cache.d.ts +99 -0
  143. package/dist/agent-runtime/src/thread-snapshot-mirror.cjs +46 -117
  144. package/dist/agent-runtime/src/thread-snapshot-mirror.cjs.map +1 -1
  145. package/dist/agent-runtime/src/thread-snapshot-mirror.d.ts +101 -0
  146. package/dist/agent-runtime/src/thread-snapshot-mirror.js +17 -88
  147. package/dist/agent-runtime/src/thread-snapshot-mirror.js.map +1 -1
  148. package/dist/agent-runtime/src/thread-status.d.ts +53 -0
  149. package/dist/agent-runtime/src/tool-metadata.d.ts +146 -0
  150. package/dist/agent-runtime/src/tool-names.cjs +71 -0
  151. package/dist/agent-runtime/src/tool-names.cjs.map +1 -1
  152. package/dist/agent-runtime/src/tool-names.d.ts +67 -0
  153. package/dist/agent-runtime/src/tool-names.js +72 -1
  154. package/dist/agent-runtime/src/tool-names.js.map +1 -1
  155. package/dist/agent-runtime/src/tool-outputs.d.ts +35 -0
  156. package/dist/agent-runtime/src/tool-result.cjs +1 -0
  157. package/dist/agent-runtime/src/tool-result.cjs.map +1 -1
  158. package/dist/agent-runtime/src/tool-result.d.ts +126 -0
  159. package/dist/agent-runtime/src/tool-result.js +1 -0
  160. package/dist/agent-runtime/src/tool-result.js.map +1 -1
  161. package/dist/agent-runtime/src/types.d.ts +159 -0
  162. package/dist/agent-runtime/src/use-conversation-list.d.ts +76 -0
  163. package/dist/agent-runtime/src/use-deep-agent-chat-outbox.cjs +136 -0
  164. package/dist/agent-runtime/src/use-deep-agent-chat-outbox.cjs.map +1 -0
  165. package/dist/agent-runtime/src/use-deep-agent-chat-outbox.d.ts +64 -0
  166. package/dist/agent-runtime/src/use-deep-agent-chat-outbox.js +136 -0
  167. package/dist/agent-runtime/src/use-deep-agent-chat-outbox.js.map +1 -0
  168. package/dist/agent-runtime/src/use-deep-agent-config.d.ts +169 -0
  169. package/dist/agent-runtime/src/use-deep-agent-edit-submit.cjs +13 -0
  170. package/dist/agent-runtime/src/use-deep-agent-edit-submit.cjs.map +1 -1
  171. package/dist/agent-runtime/src/use-deep-agent-edit-submit.d.ts +22 -0
  172. package/dist/agent-runtime/src/use-deep-agent-edit-submit.js +13 -0
  173. package/dist/agent-runtime/src/use-deep-agent-edit-submit.js.map +1 -1
  174. package/dist/agent-runtime/src/use-deep-agent-runtime.cjs +37 -2
  175. package/dist/agent-runtime/src/use-deep-agent-runtime.cjs.map +1 -1
  176. package/dist/agent-runtime/src/use-deep-agent-runtime.d.ts +177 -0
  177. package/dist/agent-runtime/src/use-deep-agent-runtime.js +38 -3
  178. package/dist/agent-runtime/src/use-deep-agent-runtime.js.map +1 -1
  179. package/dist/agent-runtime/src/use-deep-agent-thread.cjs +39 -13
  180. package/dist/agent-runtime/src/use-deep-agent-thread.cjs.map +1 -1
  181. package/dist/agent-runtime/src/use-deep-agent-thread.d.ts +352 -0
  182. package/dist/agent-runtime/src/use-deep-agent-thread.js +39 -13
  183. package/dist/agent-runtime/src/use-deep-agent-thread.js.map +1 -1
  184. package/dist/agent-runtime/src/use-deep-agent-voice.cjs +1019 -0
  185. package/dist/agent-runtime/src/use-deep-agent-voice.cjs.map +1 -0
  186. package/dist/agent-runtime/src/use-deep-agent-voice.d.ts +409 -0
  187. package/dist/agent-runtime/src/use-deep-agent-voice.js +1019 -0
  188. package/dist/agent-runtime/src/use-deep-agent-voice.js.map +1 -0
  189. package/dist/agent-runtime/src/use-deep-agent-window-sync.d.ts +102 -0
  190. package/dist/agent-runtime/src/use-historical-edit-attachments.d.ts +2 -0
  191. package/dist/agent-runtime/src/use-thread-handoff-flow.d.ts +84 -0
  192. package/dist/agent-runtime/src/voice-presentation.cjs +2 -0
  193. package/dist/agent-runtime/src/voice-presentation.cjs.map +1 -1
  194. package/dist/agent-runtime/src/voice-presentation.d.ts +80 -0
  195. package/dist/agent-runtime/src/voice-presentation.js +2 -0
  196. package/dist/agent-runtime/src/voice-presentation.js.map +1 -1
  197. package/dist/agent-runtime/src/voice-turn-grouping.d.ts +28 -0
  198. package/dist/agent-runtime/src/voice-wire-types.d.ts +15 -0
  199. package/dist/agent-runtime/src/withdrawn-turns.d.ts +97 -0
  200. package/dist/catalog/runtime-catalog.js +1 -1
  201. package/dist/chat/AthenaChat.cjs +192 -103
  202. package/dist/chat/AthenaChat.cjs.map +1 -1
  203. package/dist/chat/AthenaChat.d.ts +9 -0
  204. package/dist/chat/AthenaChat.js +194 -105
  205. package/dist/chat/AthenaChat.js.map +1 -1
  206. package/dist/chat/StatewireApprovalCard.d.ts +1 -1
  207. package/dist/chat/StatewireClientToolBridge.d.ts +1 -1
  208. package/dist/chat/StatewireQueuedMessages.cjs +11 -4
  209. package/dist/chat/StatewireQueuedMessages.cjs.map +1 -1
  210. package/dist/chat/StatewireQueuedMessages.d.ts +1 -1
  211. package/dist/chat/StatewireQueuedMessages.js +11 -4
  212. package/dist/chat/StatewireQueuedMessages.js.map +1 -1
  213. package/dist/chat/chat-outbox-rows.cjs +223 -0
  214. package/dist/chat/chat-outbox-rows.cjs.map +1 -0
  215. package/dist/chat/chat-outbox-rows.d.ts +29 -0
  216. package/dist/chat/chat-outbox-rows.js +223 -0
  217. package/dist/chat/chat-outbox-rows.js.map +1 -0
  218. package/dist/chat/chat-voice-controls.cjs +128 -0
  219. package/dist/chat/chat-voice-controls.cjs.map +1 -0
  220. package/dist/chat/chat-voice-controls.d.ts +19 -0
  221. package/dist/chat/chat-voice-controls.js +128 -0
  222. package/dist/chat/chat-voice-controls.js.map +1 -0
  223. package/dist/chat/statewire-approval.d.ts +1 -1
  224. package/dist/chat/statewire-client-tools.d.ts +1 -1
  225. package/dist/chat/super-grouping/SuperGroupingCard.cjs +3 -1
  226. package/dist/chat/super-grouping/SuperGroupingCard.cjs.map +1 -1
  227. package/dist/chat/super-grouping/SuperGroupingCard.d.ts +7 -1
  228. package/dist/chat/super-grouping/SuperGroupingCard.js +3 -1
  229. package/dist/chat/super-grouping/SuperGroupingCard.js.map +1 -1
  230. package/dist/chat/super-grouping/SuperGroupingTranscript.cjs +7 -2
  231. package/dist/chat/super-grouping/SuperGroupingTranscript.cjs.map +1 -1
  232. package/dist/chat/super-grouping/SuperGroupingTranscript.d.ts +2 -2
  233. package/dist/chat/super-grouping/SuperGroupingTranscript.js +7 -2
  234. package/dist/chat/super-grouping/SuperGroupingTranscript.js.map +1 -1
  235. package/dist/chat/super-grouping/activity-timeline.cjs +15 -8
  236. package/dist/chat/super-grouping/activity-timeline.cjs.map +1 -1
  237. package/dist/chat/super-grouping/activity-timeline.d.ts +18 -8
  238. package/dist/chat/super-grouping/activity-timeline.js +15 -8
  239. package/dist/chat/super-grouping/activity-timeline.js.map +1 -1
  240. package/dist/chat/use-statewire-approval-request.cjs +36 -0
  241. package/dist/chat/use-statewire-approval-request.cjs.map +1 -1
  242. package/dist/chat/use-statewire-approval-request.d.ts +49 -1
  243. package/dist/chat/use-statewire-approval-request.js +39 -3
  244. package/dist/chat/use-statewire-approval-request.js.map +1 -1
  245. package/dist/chat-ui/composer/tiptap-composer.cjs +133 -14
  246. package/dist/chat-ui/composer/tiptap-composer.cjs.map +1 -1
  247. package/dist/chat-ui/composer/tiptap-composer.d.ts +33 -1
  248. package/dist/chat-ui/composer/tiptap-composer.js +135 -16
  249. package/dist/chat-ui/composer/tiptap-composer.js.map +1 -1
  250. package/dist/chat-ui/header/conversation-history-panel.d.ts +1 -1
  251. package/dist/chat-ui/index.d.ts +1 -1
  252. package/dist/chat-ui/mentions/suggestions/data/api-client.cjs +2 -1
  253. package/dist/chat-ui/mentions/suggestions/data/api-client.cjs.map +1 -1
  254. package/dist/chat-ui/mentions/suggestions/data/api-client.d.ts +3 -1
  255. package/dist/chat-ui/mentions/suggestions/data/api-client.js +2 -1
  256. package/dist/chat-ui/mentions/suggestions/data/api-client.js.map +1 -1
  257. package/dist/chat-ui/mentions/use-account-workspace-id.cjs +29 -51
  258. package/dist/chat-ui/mentions/use-account-workspace-id.cjs.map +1 -1
  259. package/dist/chat-ui/mentions/use-account-workspace-id.d.ts +2 -2
  260. package/dist/chat-ui/mentions/use-account-workspace-id.js +30 -52
  261. package/dist/chat-ui/mentions/use-account-workspace-id.js.map +1 -1
  262. package/dist/chat-ui/messages/message-components.cjs +15 -0
  263. package/dist/chat-ui/messages/message-components.cjs.map +1 -1
  264. package/dist/chat-ui/messages/message-components.js +15 -0
  265. package/dist/chat-ui/messages/message-components.js.map +1 -1
  266. package/dist/chat-ui/messages/runtime-message.d.ts +1 -1
  267. package/dist/chat-ui/messages/statewire-continue-run.d.ts +1 -1
  268. package/dist/chat-ui/messages/user-edit-composer.cjs +15 -2
  269. package/dist/chat-ui/messages/user-edit-composer.cjs.map +1 -1
  270. package/dist/chat-ui/messages/user-edit-composer.d.ts +4 -2
  271. package/dist/chat-ui/messages/user-edit-composer.js +15 -2
  272. package/dist/chat-ui/messages/user-edit-composer.js.map +1 -1
  273. package/dist/chat-ui/messages/wake-marker.d.ts +1 -1
  274. package/dist/chat-ui/rich-text/chat-text-schema.cjs +1 -0
  275. package/dist/chat-ui/rich-text/chat-text-schema.cjs.map +1 -1
  276. package/dist/chat-ui/rich-text/chat-text-schema.d.ts +3 -0
  277. package/dist/chat-ui/rich-text/chat-text-schema.js +1 -0
  278. package/dist/chat-ui/rich-text/chat-text-schema.js.map +1 -1
  279. package/dist/chat-ui/statewire.cjs +1 -0
  280. package/dist/chat-ui/statewire.cjs.map +1 -1
  281. package/dist/chat-ui/statewire.d.ts +2 -2
  282. package/dist/chat-ui/statewire.js +2 -1
  283. package/dist/chat-ui/thread/composer-send-or-stop.cjs +2 -1
  284. package/dist/chat-ui/thread/composer-send-or-stop.cjs.map +1 -1
  285. package/dist/chat-ui/thread/composer-send-or-stop.d.ts +2 -0
  286. package/dist/chat-ui/thread/composer-send-or-stop.js +2 -1
  287. package/dist/chat-ui/thread/composer-send-or-stop.js.map +1 -1
  288. package/dist/chat-ui/thread/statewire-history-edge.d.ts +1 -1
  289. package/dist/composer/AttachmentContext.cjs +8 -4
  290. package/dist/composer/AttachmentContext.cjs.map +1 -1
  291. package/dist/composer/AttachmentContext.d.ts +7 -0
  292. package/dist/composer/AttachmentContext.js +8 -4
  293. package/dist/composer/AttachmentContext.js.map +1 -1
  294. package/dist/composer/build-composed-message.cjs +34 -0
  295. package/dist/composer/build-composed-message.cjs.map +1 -1
  296. package/dist/composer/build-composed-message.d.ts +20 -0
  297. package/dist/composer/build-composed-message.js +35 -1
  298. package/dist/composer/build-composed-message.js.map +1 -1
  299. package/dist/composer/composer-handoff.cjs +39 -2
  300. package/dist/composer/composer-handoff.cjs.map +1 -1
  301. package/dist/composer/composer-handoff.d.ts +28 -3
  302. package/dist/composer/composer-handoff.js +39 -2
  303. package/dist/composer/composer-handoff.js.map +1 -1
  304. package/dist/composer/useAttachFiles.cjs +15 -2
  305. package/dist/composer/useAttachFiles.cjs.map +1 -1
  306. package/dist/composer/useAttachFiles.d.ts +11 -0
  307. package/dist/composer/useAttachFiles.js +15 -2
  308. package/dist/composer/useAttachFiles.js.map +1 -1
  309. package/dist/composer/useSendMessage.cjs.map +1 -1
  310. package/dist/composer/useSendMessage.d.ts +4 -3
  311. package/dist/composer/useSendMessage.js.map +1 -1
  312. package/dist/diagnostics/athena-diagnostics.cjs.map +1 -1
  313. package/dist/diagnostics/athena-diagnostics.d.ts +3 -1
  314. package/dist/diagnostics/athena-diagnostics.js.map +1 -1
  315. package/dist/index.cjs +13 -0
  316. package/dist/index.cjs.map +1 -1
  317. package/dist/index.d.ts +14 -7
  318. package/dist/index.js +14 -1
  319. package/dist/index.js.map +1 -1
  320. package/dist/offline/chat-outbox.cjs +57 -0
  321. package/dist/offline/chat-outbox.cjs.map +1 -0
  322. package/dist/offline/chat-outbox.d.ts +80 -0
  323. package/dist/offline/chat-outbox.js +57 -0
  324. package/dist/offline/chat-outbox.js.map +1 -0
  325. package/dist/offline/offline-history.d.ts +1 -1
  326. package/dist/provider/AthenaProvider.cjs +162 -8
  327. package/dist/provider/AthenaProvider.cjs.map +1 -1
  328. package/dist/provider/AthenaProvider.d.ts +15 -1
  329. package/dist/provider/AthenaProvider.js +163 -9
  330. package/dist/provider/AthenaProvider.js.map +1 -1
  331. package/dist/provider/statewire-window-context.d.ts +1 -1
  332. package/dist/react/package.json.cjs +1 -1
  333. package/dist/react/package.json.js +1 -1
  334. package/dist/references/src/anchors/file-line-range.d.ts +58 -0
  335. package/dist/references/src/anchors/format.d.ts +21 -0
  336. package/dist/references/src/anchors/message-anchors.d.ts +71 -0
  337. package/dist/references/src/anchors/parse.d.ts +8 -0
  338. package/dist/references/src/anchors/registry-contract.d.ts +24 -0
  339. package/dist/references/src/anchors/registry.d.ts +19 -0
  340. package/dist/references/src/anchors/schemas.d.ts +194 -0
  341. package/dist/references/src/anchors/serialize.d.ts +8 -0
  342. package/dist/references/src/anchors/time.d.ts +78 -0
  343. package/dist/references/src/anchors/types.d.ts +474 -0
  344. package/dist/references/src/asset-bounds.d.ts +27 -0
  345. package/dist/references/src/asset-links.d.ts +23 -0
  346. package/dist/references/src/asset-reference.d.ts +16 -0
  347. package/dist/references/src/formats/format-catalog.d.ts +79 -0
  348. package/dist/references/src/formats/markdown/parse-reference-markdown.d.ts +28 -0
  349. package/dist/references/src/formats/markdown/reference-display-name.d.ts +6 -0
  350. package/dist/references/src/formats/object/asset-object.d.ts +9 -0
  351. package/dist/references/src/formats/object/callable-object.d.ts +6 -0
  352. package/dist/references/src/formats/object/decode-reference-object-payload.d.ts +3 -0
  353. package/dist/references/src/formats/object/external-url-object.d.ts +9 -0
  354. package/dist/references/src/formats/object/group-object.d.ts +9 -0
  355. package/dist/references/src/formats/object/navigation-object.d.ts +9 -0
  356. package/dist/references/src/formats/object/parse-reference-object.d.ts +11 -0
  357. package/dist/references/src/formats/object/person-object.d.ts +9 -0
  358. package/dist/references/src/formats/uri/asset-mention-uri.d.ts +9 -0
  359. package/dist/references/src/formats/uri/asset-spaces-url.d.ts +9 -0
  360. package/dist/references/src/formats/uri/callable-mention-uris.d.ts +9 -0
  361. package/dist/references/src/formats/uri/detect-uri-wire.d.ts +9 -0
  362. package/dist/references/src/formats/uri/group-mention-uri.d.ts +12 -0
  363. package/dist/references/src/formats/uri/navigation-spaces-url.d.ts +14 -0
  364. package/dist/references/src/formats/uri/parse-reference-uri.d.ts +20 -0
  365. package/dist/references/src/formats/uri/person-mention-uri.d.ts +9 -0
  366. package/dist/references/src/formats/uri/template-placeholder.d.ts +12 -0
  367. package/dist/references/src/index.d.ts +47 -0
  368. package/dist/references/src/legacy/index.d.ts +14 -0
  369. package/dist/references/src/legacy/pre-reference-asset-url.d.ts +57 -0
  370. package/dist/references/src/legacy/pre-reference-citation-bridge.d.ts +22 -0
  371. package/dist/references/src/legacy/pre-reference-citation.d.ts +138 -0
  372. package/dist/references/src/legacy/pre-reference-external-url.d.ts +31 -0
  373. package/dist/references/src/legacy/pre-reference-format.d.ts +8 -0
  374. package/dist/references/src/legacy/pre-reference-mention.d.ts +27 -0
  375. package/dist/references/src/legacy/pre-reference-object.d.ts +8 -0
  376. package/dist/references/src/legacy/pre-reference-uri.d.ts +12 -0
  377. package/dist/references/src/legacy.d.ts +2 -0
  378. package/dist/references/src/mention-href-patterns.d.ts +19 -0
  379. package/dist/references/src/mention-node/index.d.ts +5 -0
  380. package/dist/references/src/mention-node/mention-node.d.ts +31 -0
  381. package/dist/references/src/mention-node/resolve-node-attrs.d.ts +27 -0
  382. package/dist/references/src/parse-reference.d.ts +23 -0
  383. package/dist/references/src/schemas.d.ts +463 -0
  384. package/dist/references/src/serialize-reference.d.ts +50 -0
  385. package/dist/references/src/sheet-name.d.ts +10 -0
  386. package/dist/references/src/tool-option-schemas.d.ts +597 -0
  387. package/dist/references/src/types.d.ts +125 -0
  388. package/dist/references/src/version-ref.d.ts +30 -0
  389. package/dist/runtime/statewire-lifecycle.d.ts +1 -1
  390. package/dist/runtime/statewire-model-lane.d.ts +1 -1
  391. package/dist/runtime/statewire-server-lane-context.d.ts +1 -1
  392. package/dist/runtime/statewire-session-key.cjs +7 -0
  393. package/dist/runtime/statewire-session-key.cjs.map +1 -1
  394. package/dist/runtime/statewire-session-key.d.ts +19 -0
  395. package/dist/runtime/statewire-session-key.js +8 -1
  396. package/dist/runtime/statewire-session-key.js.map +1 -1
  397. package/dist/runtime/statewire-session-lane.cjs +48 -0
  398. package/dist/runtime/statewire-session-lane.cjs.map +1 -0
  399. package/dist/runtime/statewire-session-lane.d.ts +29 -0
  400. package/dist/runtime/statewire-session-lane.js +48 -0
  401. package/dist/runtime/statewire-session-lane.js.map +1 -0
  402. package/dist/runtime/statewire-thread-config-lane.d.ts +1 -1
  403. package/dist/runtime/useAthenaStatewireRuntime.cjs +19 -5
  404. package/dist/runtime/useAthenaStatewireRuntime.cjs.map +1 -1
  405. package/dist/runtime/useAthenaStatewireRuntime.d.ts +15 -1
  406. package/dist/runtime/useAthenaStatewireRuntime.js +20 -6
  407. package/dist/runtime/useAthenaStatewireRuntime.js.map +1 -1
  408. package/dist/styles.css +1 -1
  409. package/dist/threads/api.d.ts +1 -1
  410. package/dist/threads/conversation-list-fetcher.d.ts +1 -1
  411. package/dist/threads/index-triggered-refresh.cjs +164 -0
  412. package/dist/threads/index-triggered-refresh.cjs.map +1 -0
  413. package/dist/threads/index-triggered-refresh.d.ts +70 -0
  414. package/dist/threads/index-triggered-refresh.js +164 -0
  415. package/dist/threads/index-triggered-refresh.js.map +1 -0
  416. package/dist/threads/offline-session-list.d.ts +1 -1
  417. package/dist/threads/pull-request-display.d.ts +1 -1
  418. package/dist/threads/session-list-model.d.ts +1 -1
  419. package/dist/threads/session-list-tab-share.cjs +150 -0
  420. package/dist/threads/session-list-tab-share.cjs.map +1 -0
  421. package/dist/threads/session-list-tab-share.d.ts +73 -0
  422. package/dist/threads/session-list-tab-share.js +150 -0
  423. package/dist/threads/session-list-tab-share.js.map +1 -0
  424. package/dist/threads/session-row-parts.d.ts +1 -1
  425. package/dist/threads/sessions-query.d.ts +1 -1
  426. package/dist/threads/statewire-thread-list.cjs +42 -16
  427. package/dist/threads/statewire-thread-list.cjs.map +1 -1
  428. package/dist/threads/statewire-thread-list.d.ts +11 -2
  429. package/dist/threads/statewire-thread-list.js +43 -17
  430. package/dist/threads/statewire-thread-list.js.map +1 -1
  431. package/dist/threads/thread-prefetcher.d.ts +1 -1
  432. package/dist/threads/use-athena-session-attention.d.ts +1 -1
  433. package/dist/threads/use-athena-sessions.cjs +32 -22
  434. package/dist/threads/use-athena-sessions.cjs.map +1 -1
  435. package/dist/threads/use-athena-sessions.js +33 -23
  436. package/dist/threads/use-athena-sessions.js.map +1 -1
  437. package/dist/threads/use-rest-conversation-history.d.ts +1 -1
  438. package/dist/threads/use-statewire-conversation-history.d.ts +5 -5
  439. package/dist/tiptap-markdown-table/src/markdown-table-serializer.d.ts +56 -0
  440. package/dist/tools/NestedPtcMessages.cjs +14 -9
  441. package/dist/tools/NestedPtcMessages.cjs.map +1 -1
  442. package/dist/tools/NestedPtcMessages.d.ts +9 -0
  443. package/dist/tools/NestedPtcMessages.js +6 -1
  444. package/dist/tools/NestedPtcMessages.js.map +1 -1
  445. package/dist/tools/index.d.ts +1 -1
  446. package/dist/tools/primitives.d.ts +1 -1
  447. package/dist/tools/subagent-task-tool-ui.cjs +494 -0
  448. package/dist/tools/subagent-task-tool-ui.cjs.map +1 -0
  449. package/dist/tools/subagent-task-tool-ui.d.ts +109 -0
  450. package/dist/tools/subagent-task-tool-ui.js +494 -0
  451. package/dist/tools/subagent-task-tool-ui.js.map +1 -0
  452. package/dist/tools/tool-fallback.d.ts +1 -1
  453. package/dist/tools/tool-icons.d.ts +1 -1
  454. package/dist/tools/tool-summary.d.ts +1 -1
  455. package/dist/tools/tool-uis.cjs +4 -0
  456. package/dist/tools/tool-uis.cjs.map +1 -1
  457. package/dist/tools/tool-uis.js +4 -0
  458. package/dist/tools/tool-uis.js.map +1 -1
  459. package/dist/voice/chat.cjs +6 -0
  460. package/dist/voice/chat.cjs.map +1 -0
  461. package/dist/voice/chat.d.ts +2 -0
  462. package/dist/voice/chat.js +6 -0
  463. package/dist/voice/chat.js.map +1 -0
  464. package/dist/voice/livekit-join.cjs +119 -0
  465. package/dist/voice/livekit-join.cjs.map +1 -0
  466. package/dist/voice/livekit-join.d.ts +8 -0
  467. package/dist/voice/livekit-join.js +119 -0
  468. package/dist/voice/livekit-join.js.map +1 -0
  469. package/dist/voice/livekit.cjs +32 -0
  470. package/dist/voice/livekit.cjs.map +1 -0
  471. package/dist/voice/livekit.d.ts +80 -0
  472. package/dist/voice/livekit.js +32 -0
  473. package/dist/voice/livekit.js.map +1 -0
  474. package/dist/voice/use-chat-voice-enabled.cjs +43 -0
  475. package/dist/voice/use-chat-voice-enabled.cjs.map +1 -0
  476. package/dist/voice/use-chat-voice-enabled.d.ts +9 -0
  477. package/dist/voice/use-chat-voice-enabled.js +43 -0
  478. package/dist/voice/use-chat-voice-enabled.js.map +1 -0
  479. package/package.json +22 -16
@@ -0,0 +1,352 @@
1
+ import { StatewireThread } from '@assistant-ui/react-statewire';
2
+ import { type DeepAgentHeadersResolver } from './deep-agent-transport-recipe';
3
+ import { type DeepAgentMessageAuthor } from './message-author';
4
+ import { type DeepAgentMessageWindowDeclaration, readDeepAgentMessageWindow } from './message-window';
5
+ import { type DeepAgentConversionMemory, type DeepAgentMessageConversionOptions } from './messages';
6
+ import { type DeepAgentProtocolStatus } from './protocol';
7
+ import type { DeepAgentAttachTimingEvent } from './statewire-attach-observer';
8
+ import type { StatewireDiagnosticsRecorder } from './statewire-diagnostics';
9
+ import { type StatewireTransportOptions } from './statewire-transport';
10
+ import type { DeepAgentThreadPrewarmPool } from './thread-prewarm';
11
+ import { type DeepAgentThreadSnapshotCache } from './thread-snapshot-cache';
12
+ import type { DeepAgentToolOutputStore } from './tool-outputs';
13
+ import type { DeepAgentWithdrawnTurns } from './withdrawn-turns';
14
+ import type { DeepAgentConnectionState, DeepAgentLaneProjection, DeepAgentStreamValues } from './types';
15
+ type ThreadOptions = StatewireThread.Options<DeepAgentStreamValues>;
16
+ export type { DeepAgentHeadersResolver } from './deep-agent-transport-recipe';
17
+ /**
18
+ * The identity of one attach of a thread: the thread, the host's `attachKey`
19
+ * and the lane epoch (`UseDeepAgentThreadOptions['laneEpoch']`). The transport
20
+ * mount and every per-attach decision (snapshot seed, pooled hello, conversion
21
+ * memory, the host's per-thread latches, send recovery) key off it, so a new
22
+ * lane epoch is a new attach exactly like a thread switch.
23
+ */
24
+ export declare function deepAgentAttachId({ threadId, attachKey, laneEpoch, }: {
25
+ threadId: string;
26
+ attachKey?: string | number | undefined;
27
+ laneEpoch?: number;
28
+ }): string;
29
+ /**
30
+ * How an attach's FIRST frame is sourced, decided once per attach at mount: the
31
+ * hello a pooled pre-dialed attach already replicated (`prewarm`), a remembered
32
+ * snapshot seed (`snapshot`), or nothing (`none` — the thread loads until its
33
+ * hello).
34
+ */
35
+ export type DeepAgentAttachSource = 'prewarm' | 'snapshot' | 'none';
36
+ export interface UseDeepAgentThreadOptions {
37
+ threadId: string;
38
+ /** Base URL of the deep-agent statewire host (the `…/v2/threads` mount). */
39
+ baseUrl: string;
40
+ /** Transport selection: SSE when true, WebSocket otherwise. */
41
+ sse?: boolean;
42
+ /**
43
+ * Auth headers for the transport. Statewire passes `{ staleAuth: true }`
44
+ * when the previous credential was refused, so resolvers that can
45
+ * force-renew should honor it.
46
+ */
47
+ headers: DeepAgentHeadersResolver;
48
+ /**
49
+ * Statewire session store for reconnect command-session recovery (e.g. the
50
+ * mobile AsyncStorage-backed store). Host-resolved; omitted, sessions are
51
+ * process-local.
52
+ */
53
+ sessionStore?: StatewireTransportOptions['sessionStore'];
54
+ /**
55
+ * Mounted storage seams for the thread: `session` holds the lane identity and
56
+ * the commands still awaiting a durable verdict, so a reload resumes the lane
57
+ * instead of minting a new client (browser hosts pass `LocalStorageSession`
58
+ * from `@assistant-ui/react-statewire/local-storage`); `composer` persists the
59
+ * draft. Mutually exclusive with `sessionStore` — statewire refuses a session
60
+ * mounted twice.
61
+ */
62
+ storage?: ThreadOptions['storage'];
63
+ /** True only for a never-started local chat; existing empty threads still load until their snapshot. */
64
+ isNewChat?: boolean;
65
+ /**
66
+ * Extra transport-key discriminator for the SAME thread. The session is keyed
67
+ * by `threadId` alone by default; hosts that must re-read the server snapshot
68
+ * without a thread switch (a run dispatched outside this client, e.g. a
69
+ * backgrounded AOP run writing the thread's first messages) bump this to
70
+ * remount the session against the same URL.
71
+ */
72
+ attachKey?: string | number;
73
+ /**
74
+ * Bumped when the durable lane this mount runs on is replaced by a lane of
75
+ * another scope (another principal signed in, or another backend) while the
76
+ * thread stays mounted; `useDeepAgentRuntime` derives it from the session
77
+ * `key`. Each epoch remounts the whole statewire thread (its session with
78
+ * the client id, lane clocks and journal it loaded, the session storage, the
79
+ * composer and the thread state) instead of moving it to the new lane, and
80
+ * is an attach identity of its own. Its first attach seeds nothing this tab
81
+ * remembered of the thread and takes no dial pooled for it: both were
82
+ * captured as the previous principal. It reads `isNewChat` afresh, so a
83
+ * thread that persisted under the previous principal attaches at once.
84
+ * Default 0.
85
+ */
86
+ laneEpoch?: number;
87
+ /**
88
+ * Host gate: park the transport instead of attaching — no socket, no retry
89
+ * loop. The thread element stays mounted so assistant-ui consumers keep
90
+ * rendering. Pass it when the host already knows every attach would be denied (e.g.
91
+ * the signed-in user has no workspace yet), so a locked-out tab does not
92
+ * hammer the attach endpoint on every backoff interval. `reason` is the
93
+ * connection message; a park with none (a `pending` session lane) reads
94
+ * like a never-started chat.
95
+ */
96
+ suspended?: {
97
+ reason?: string | undefined;
98
+ } | false;
99
+ /**
100
+ * Adapter capabilities the host UI exposes. Defaults preserve each client's
101
+ * pre-extraction surface — pass what the product mounts.
102
+ */
103
+ capabilities?: {
104
+ edit?: boolean;
105
+ continue?: boolean;
106
+ reload?: boolean;
107
+ unstable_switchBranch?: boolean;
108
+ };
109
+ /** Which run lanes project into the message tail; see {@link DeepAgentLaneProjection}. */
110
+ laneProjection?: DeepAgentLaneProjection;
111
+ /**
112
+ * Render quiet tools (`QUIET_TOOL_NAMES`, e.g. `submit_feedback`) like any
113
+ * other tool call. Off by default; pass it only for viewers allowed to see
114
+ * them (Olympus: Athena's internal admins on managed cloud).
115
+ */
116
+ showQuietTools?: boolean;
117
+ /**
118
+ * The viewer, as the backend would stamp them (`metadata.custom.author`).
119
+ * Stamped onto this client's own optimistic bubbles — a send still in flight
120
+ * has no host `meta` yet — so a just-sent turn is attributed, and the
121
+ * multi-author avatar gate flips for a second poster, without waiting for
122
+ * the acknowledgment. Replicated entries carry the host's own stamp instead.
123
+ * Compared field-wise, so callers need not memoize the object.
124
+ */
125
+ selfAuthor?: DeepAgentMessageAuthor | null;
126
+ /**
127
+ * Snapshot host context when each user message is submitted, before it is
128
+ * journaled. Includes programmatic appends, keyboard sends, queued messages,
129
+ * steering, and edits. The async getter starts immediately at submission;
130
+ * sends retain their order while it resolves. Retries, queue text edits,
131
+ * lane moves, reload, and continue preserve the original association.
132
+ * Return JSON-serializable metadata; optional capture failures can
133
+ * return an explicit null field rather than blocking the message.
134
+ *
135
+ * Declared structurally rather than as `ThreadOptions['getMessageMetadata']`:
136
+ * the option is what the monorepo patches into
137
+ * `@assistant-ui/react-statewire@0.31.0`, and the published sources must also
138
+ * compile against the unpatched upstream typings, where the library does not
139
+ * know the option and ignores it.
140
+ */
141
+ getMessageMetadata?: (() => Record<string, unknown> | undefined | Promise<Record<string, unknown> | undefined>) | undefined;
142
+ /** Host-owned adapters: attachments (upload/mention choreography), speech, feedback. */
143
+ adapters?: ThreadOptions['adapters'];
144
+ /**
145
+ * Transport lifecycle recorder (attach latency, reconnect loops, command
146
+ * settle fates, stale-auth renewals) fed from the hook's own seams. Pass one
147
+ * only when the host's diagnostics channel is enabled — the recorder is
148
+ * observed on hot paths, and an absent recorder costs a single optional call.
149
+ */
150
+ diagnostics?: StatewireDiagnosticsRecorder;
151
+ /**
152
+ * Per-tab LRU of the last wire state seen per thread. When set, every
153
+ * hydrated state the transport publishes is remembered, and a mount of a
154
+ * remembered thread seeds `initialState` from the cache (through
155
+ * {@link toThreadSnapshotSeed}) — the thread renders its last-known
156
+ * messages on the first frame instead of holding a loading treatment for
157
+ * the attach round-trip, and projects "running" when the run was live at
158
+ * capture (else "ready"). The attach snapshot then
159
+ * REPLACES the seeded state (statewire's `initialState` contract), so a
160
+ * thread that advanced elsewhere reconciles in one round-trip. New chats
161
+ * keep their preload and never read the cache.
162
+ */
163
+ snapshotCache?: DeepAgentThreadSnapshotCache;
164
+ /**
165
+ * The head window this surface wants: declared on every attach
166
+ * (`x-athena-deep-agent-window`, part of the transport recipe) so the hello
167
+ * of a client the host does not remember carries the newest `size`
168
+ * messages, and stated as `athena/interest` after the hello only when the
169
+ * hello's head is narrower — never to shrink it (the host holds what a
170
+ * viewer has loaded for the life of its connection). The resolved chain is
171
+ * joined with the mounted message documents into the converted transcript
172
+ * (see `message-window.ts`); older pages load through
173
+ * `useDeepAgentWindowSync`. Read once per attach.
174
+ */
175
+ messageWindow?: DeepAgentMessageWindowDeclaration;
176
+ /**
177
+ * Set only by a surface that pages a cut lane's earlier steps wherever it
178
+ * shows a lane's steps (`useDeepAgentLaneHistory`). Its attaches then
179
+ * declare the lane-cut contract version, and the host sends a finished
180
+ * `task` card with a deep transcript cut to its newest steps (see
181
+ * `DeepAgentProtocolDeclaration`). Omitted, every attach declares the
182
+ * default version and finished cards ride whole. Part of the transport
183
+ * recipe: a prewarm controller for this thread must be given the same
184
+ * value. Read once per attach.
185
+ */
186
+ laneHistory?: boolean;
187
+ /**
188
+ * Joins the interest window off the mounted documents; the default is
189
+ * {@link readDeepAgentMessageWindow}. Olympus passes
190
+ * `readDeepAgentFollowedWindow`, which also reads the lanes it follows onto
191
+ * their `task` cards.
192
+ */
193
+ readMessageWindow?: typeof readDeepAgentMessageWindow;
194
+ /**
195
+ * Creates each attach's conversion memory; the default is
196
+ * {@link createDeepAgentMessageConversionCache}. Olympus passes
197
+ * `createSubagentTranscriptConversionCache`, which also turns each `task`
198
+ * card's nested transcript into its tool-call part's `messages`.
199
+ */
200
+ createConversionCache?: (options: DeepAgentMessageConversionOptions) => DeepAgentConversionMemory;
201
+ /**
202
+ * Full tool outputs fetched back for the wire's cut tool messages
203
+ * (`history/tool_output`); the thread re-converts when one lands.
204
+ */
205
+ toolOutputs?: DeepAgentToolOutputStore;
206
+ /**
207
+ * User turns this client took back ahead of the wire (a user stop before
208
+ * any assistant output); the thread re-converts when one opens or closes.
209
+ */
210
+ withdrawnTurns?: DeepAgentWithdrawnTurns;
211
+ /**
212
+ * Pre-dialed attaches (see `thread-prewarm.ts`). When the pool holds a root
213
+ * for this thread at mount, the thread takes the hello it replicated as its
214
+ * seed — the transcript is the first frame — and dials its own attach
215
+ * against the instance the pool warmed; the pooled root is disposed in the
216
+ * same step, so one socket is live per thread after mount. Never seeded for
217
+ * a preloaded new chat or a suspended attach; such a root is discarded.
218
+ */
219
+ prewarmPool?: DeepAgentThreadPrewarmPool<DeepAgentStreamValues>;
220
+ /**
221
+ * Attach-path timing: socket open, hello size + handler cost, server retry
222
+ * hints — attributed to the attach's own thread, since a late event from the
223
+ * thread being left can land after the host has moved on.
224
+ */
225
+ onAttachTiming?: (info: {
226
+ threadId: string;
227
+ event: DeepAgentAttachTimingEvent;
228
+ }) => void;
229
+ /** Where this attach's first frame comes from; once per attach, at mount. */
230
+ onAttachSource?: (info: {
231
+ threadId: string;
232
+ source: DeepAgentAttachSource;
233
+ }) => void;
234
+ /** Full transport error policy (paywall, toast, telemetry) — client-owned. */
235
+ onError?: ThreadOptions['onError'];
236
+ /**
237
+ * Raw statewire state observer (first-attach latches, telemetry). The state
238
+ * argument is never `undefined`/`null`: passes where the wire has no
239
+ * snapshot yet (pre-attach, replay boundaries) deliver the typed
240
+ * `DEEP_AGENT_PRE_STREAM_STATE` default — `isDeepAgentStateHydrated`
241
+ * distinguishes them from a real (possibly empty) snapshot.
242
+ */
243
+ onStateChange?: ThreadOptions['onStateChange'];
244
+ /** Raw command-lifecycle observer (send-failure salvage, telemetry). */
245
+ onCommandChange?: ThreadOptions['onCommandChange'];
246
+ /** Raw connection observer (reconnect handles, telemetry). */
247
+ onRawConnectionChange?: ThreadOptions['onConnectionChange'];
248
+ /**
249
+ * Projected connection status changes, deduped per thread, with `null` on
250
+ * unmount so an indicator never shows a stale status.
251
+ */
252
+ onConnectionChange?: (connection: DeepAgentConnectionState | null) => void;
253
+ /** Notified when a run starts/stops so the page can reflect the running thread. */
254
+ onRunningChange?: (isRunning: boolean) => void;
255
+ /**
256
+ * Notified once per thread with the `runConfig` carried by the statewire
257
+ * snapshot (the backend's persisted panel config, seeded in `_load_history`),
258
+ * so the host can hydrate its config store from the thread. Notified with
259
+ * `null` (at most once per attach) when a server snapshot arrives WITHOUT a
260
+ * persisted config, so a host waiting on hydration can stop waiting; a
261
+ * config appearing on a later snapshot of the same attach (mirrored at run
262
+ * start) still delivers the config notification.
263
+ */
264
+ onServerRunConfig?: (config: Record<string, unknown> | null) => void;
265
+ /**
266
+ * Notified when the snapshot's `outOfBandRunActive` flag changes: the host set
267
+ * it while a run executing OUTSIDE this surface (an AOP / HTTP-route run)
268
+ * is actively writing the thread's bare-namespace history, which the host
269
+ * live-refreshes onto the wire. Lets the page show run-in-progress
270
+ * treatment instead of an empty conversation, and stand down its own
271
+ * re-attach polling. Change-notified per attach (an initial `false` before
272
+ * the snapshot stays silent), mirroring `onRunningChange`.
273
+ */
274
+ onOutOfBandRunActive?: (outOfBandRunActive: boolean) => void;
275
+ /**
276
+ * Notified with the state's session-asset lifecycle flag
277
+ * ({@link readSessionPersisted}) PAIRED with the thread it describes: `false`
278
+ * while the thread's `session` asset provably does not exist yet (a
279
+ * never-started chat's preload, a first run before the mint), `true` once
280
+ * minted, `null` when the state carries no flag (a host that predates it).
281
+ *
282
+ * Fired from the converter pass, so the pair is read from the state of the
283
+ * thread this attach was mounted for. A component reading the flag off the
284
+ * client store instead lags the mounted thread id by one render on a switch
285
+ * and can pair the new id with the previous thread's flag — releasing a
286
+ * session-scoped read for a row the backend has not minted. Change-notified
287
+ * per attach; the first pass of every attach notifies, so a host holding a
288
+ * read back until it hears from the mounted thread always does.
289
+ */
290
+ onSessionPersistedChange?: (event: {
291
+ threadId: string;
292
+ sessionPersisted: boolean | null;
293
+ }) => void;
294
+ /**
295
+ * Notified with the wire-contract status once the attach snapshot
296
+ * advertises the `protocol` lane, and again whenever it changes (a
297
+ * re-attach after a server roll can advertise a new `version`). Telemetry
298
+ * and per-version behaviour only: the host has no minimum client version,
299
+ * so nothing about the status gates a send. Never called for
300
+ * pre-declaration servers (their snapshots carry no lane) — absence of a
301
+ * call means "no advertisement", not "compatible".
302
+ */
303
+ onProtocolChange?: (status: DeepAgentProtocolStatus) => void;
304
+ }
305
+ /** One thread's replicated running state, keyed so a switch between two
306
+ * threads with the same status still re-notifies (the host page clears its
307
+ * per-thread state on selection, mirroring the connection dedupe below). */
308
+ export interface RunningSnapshot {
309
+ threadId: string;
310
+ isRunning: boolean;
311
+ }
312
+ /** Whether the thread's `session` asset exists, read off a statewire state, or
313
+ * `null` when the state does not carry the flag.
314
+ *
315
+ * Absence is not absence of the asset: a snapshot from a host that predates
316
+ * the flag has no such key, and reading that as "the asset does not exist"
317
+ * would gate a read the client is entitled to make, with nothing left to
318
+ * un-gate it. A new thread's preload seeds `false` (see `initialState`), so
319
+ * the pre-attach pass of a chat that cannot have an asset yet still gates.
320
+ *
321
+ * Hosts pass this to `useStatewireState` so the flag and the thread it belongs
322
+ * to are read in one component — a thread switch then cannot pair one thread's
323
+ * id with the other's flag. */
324
+ export declare function readSessionPersisted(state: unknown): boolean | null;
325
+ /** Whether a converter pass must notify `onRunningChange`.
326
+ *
327
+ * The mount's very first status notifies only when it is `true` (a snapshot
328
+ * carrying a live run) — an initial `false` before the snapshot must stay
329
+ * silent so it cannot clear a still-valid indicator. After that, every
330
+ * transition notifies, and so does the first status after a thread switch
331
+ * (the host page clears its per-thread state on selection, so a switch
332
+ * between two threads with the same status must still re-notify). */
333
+ export declare function shouldNotifyRunningChange(previous: RunningSnapshot | null, next: RunningSnapshot): boolean;
334
+ /**
335
+ * The shared deep-agent Statewire thread.
336
+ *
337
+ * `StatewireThread` (from `@assistant-ui/react-statewire`) attaches to the
338
+ * agora-hosted thread at `${baseUrl}/${threadId}` (WebSocket by default,
339
+ * with SSE retained only as a host-selected compatibility switch): the backend
340
+ * hosts the thread state and this client
341
+ * replicates it live, so the server snapshot is the single source of history
342
+ * (no local import, no `/status` resume probing) and run scheduling — queueing,
343
+ * steering, stop, edit rewinds — rides the built-in `run/*` commands.
344
+ *
345
+ * The thread element is keyed by `threadId`, so a thread switch remounts the
346
+ * session against the new URL instead of importing history in place.
347
+ *
348
+ * Returns the thread element for the host's own `useAui({ thread })` — web
349
+ * hosts take `useAui` from `@assistant-ui/react`, React Native hosts from
350
+ * `@assistant-ui/react-native`; this package imports neither.
351
+ */
352
+ export declare function useDeepAgentThread({ threadId, baseUrl, sse, headers, sessionStore, storage, isNewChat, attachKey, laneEpoch, suspended, capabilities, laneProjection, showQuietTools, selfAuthor, getMessageMetadata, adapters, diagnostics, snapshotCache, messageWindow, laneHistory, readMessageWindow, createConversionCache, toolOutputs, withdrawnTurns, prewarmPool, onAttachTiming, onAttachSource, onError, onStateChange, onCommandChange, onRawConnectionChange, onConnectionChange, onRunningChange, onServerRunConfig, onOutOfBandRunActive, onSessionPersistedChange, onProtocolChange, }: UseDeepAgentThreadOptions): import("@assistant-ui/tap").ResourceElement<import("@assistant-ui/store").ClientOutput<"thread">>;
@@ -13,6 +13,14 @@ import { pairDeepAgentStateWithThread, isDeepAgentStateHydrated, readDeepAgentSt
13
13
  import { StatewireSuspended } from "./statewire-suspended.js";
14
14
  import { DEEP_AGENT_STATEWIRE_PROTOCOL } from "./statewire-transport.js";
15
15
  import { toThreadSnapshotSeed } from "./thread-snapshot-cache.js";
16
+ function deepAgentAttachId({
17
+ threadId,
18
+ attachKey,
19
+ laneEpoch = 0
20
+ }) {
21
+ const attach = attachKey === void 0 ? threadId : `${threadId}:${attachKey}`;
22
+ return laneEpoch === 0 ? attach : `${attach}#lane-epoch:${laneEpoch}`;
23
+ }
16
24
  function readSessionPersisted(state) {
17
25
  const flag = state == null ? void 0 : state.sessionPersisted;
18
26
  return typeof flag === "boolean" ? flag : null;
@@ -33,15 +41,20 @@ function useDeepAgentThread({
33
41
  storage,
34
42
  isNewChat = false,
35
43
  attachKey,
44
+ laneEpoch = 0,
36
45
  suspended = false,
37
46
  capabilities,
38
47
  laneProjection = "both",
48
+ showQuietTools = false,
39
49
  selfAuthor = null,
40
50
  getMessageMetadata,
41
51
  adapters,
42
52
  diagnostics,
43
53
  snapshotCache,
44
54
  messageWindow,
55
+ laneHistory = false,
56
+ readMessageWindow = readDeepAgentMessageWindow,
57
+ createConversionCache = createDeepAgentMessageConversionCache,
45
58
  toolOutputs,
46
59
  withdrawnTurns,
47
60
  prewarmPool,
@@ -83,6 +96,8 @@ function useDeepAgentThread({
83
96
  headersRef.current = headers;
84
97
  const messageWindowRef = useRef(messageWindow);
85
98
  messageWindowRef.current = messageWindow;
99
+ const laneHistoryRef = useRef(laneHistory);
100
+ laneHistoryRef.current = laneHistory;
86
101
  const interestRef = useRef({ attachId: "", stated: false });
87
102
  const lastMessagesRef = useRef(null);
88
103
  const [toolOutputsVersion, setToolOutputsVersion] = useState(0);
@@ -109,7 +124,7 @@ function useDeepAgentThread({
109
124
  const absentStateRunConfigAttachRef = useRef(null);
110
125
  const threadIdRef = useRef(threadId);
111
126
  threadIdRef.current = threadId;
112
- const attachId = attachKey === void 0 ? threadId : `${threadId}:${attachKey}`;
127
+ const attachId = deepAgentAttachId({ threadId, attachKey, laneEpoch });
113
128
  const attachIdRef = useRef(attachId);
114
129
  attachIdRef.current = attachId;
115
130
  const [authParked, setAuthParked] = useState(null);
@@ -155,7 +170,9 @@ function useDeepAgentThread({
155
170
  (_a3 = onOutOfBandRunActiveRef.current) == null ? void 0 : _a3.call(onOutOfBandRunActiveRef, stateOutOfBandRunActive);
156
171
  });
157
172
  }
158
- const protocolStatus = projectDeepAgentProtocol(state);
173
+ const protocolStatus = projectDeepAgentProtocol(state, {
174
+ laneHistory: laneHistoryRef.current
175
+ });
159
176
  if (protocolStatus !== null) {
160
177
  const previous = ((_a2 = lastProtocolRef.current) == null ? void 0 : _a2.attachId) === attachIdRef.current ? lastProtocolRef.current.status : null;
161
178
  if (previous === null || previous.protocolVersion !== protocolStatus.protocolVersion) {
@@ -209,32 +226,38 @@ function useDeepAgentThread({
209
226
  },
210
227
  []
211
228
  );
212
- const preloadRef = useRef({ threadId, preload: isNewChat });
213
- if (preloadRef.current.threadId !== threadId)
214
- preloadRef.current = { threadId, preload: isNewChat };
229
+ const preloadRef = useRef({ threadId, laneEpoch, preload: isNewChat });
230
+ if (preloadRef.current.threadId !== threadId || preloadRef.current.laneEpoch !== laneEpoch)
231
+ preloadRef.current = { threadId, laneEpoch, preload: isNewChat };
215
232
  const snapshotCacheRef = useRef(snapshotCache);
216
233
  snapshotCacheRef.current = snapshotCache;
217
234
  const snapshotSeedRef = useRef(null);
218
235
  if (snapshotSeedRef.current === null || snapshotSeedRef.current.attachId !== attachId) {
219
236
  const preload = preloadRef.current.preload;
237
+ const laneReplaced = snapshotSeedRef.current !== null && snapshotSeedRef.current.laneEpoch !== laneEpoch;
238
+ if (laneReplaced) snapshotCache == null ? void 0 : snapshotCache.forget(threadId);
220
239
  let pooledState;
221
240
  if (prewarmPool == null ? void 0 : prewarmPool.has(threadId)) {
222
- if (preload || suspended) {
241
+ if (preload || suspended || laneReplaced) {
223
242
  prewarmPool.discard(threadId);
224
243
  } else {
225
244
  pooledState = (_a = prewarmPool.take(threadId)) == null ? void 0 : _a.state;
226
245
  }
227
246
  }
228
- const remembered = preload || suspended ? void 0 : pooledState ?? (snapshotCache == null ? void 0 : snapshotCache.take(threadId));
247
+ const remembered = preload || suspended || laneReplaced ? void 0 : pooledState ?? (snapshotCache == null ? void 0 : snapshotCache.take(threadId));
229
248
  const seed = remembered ? toThreadSnapshotSeed(remembered) : void 0;
230
- snapshotSeedRef.current = { attachId, seed };
249
+ snapshotSeedRef.current = { attachId, laneEpoch, seed };
231
250
  const source = pooledState !== void 0 ? "prewarm" : seed ? "snapshot" : "none";
232
251
  const notifySource = onAttachSourceRef.current;
233
252
  if (notifySource) queueMicrotask(() => notifySource({ threadId, source }));
234
253
  }
235
254
  const conversionCacheRef = useRef(null);
236
- if (conversionCacheRef.current === null || conversionCacheRef.current.attachId !== attachId) {
237
- conversionCacheRef.current = { attachId, cache: createDeepAgentMessageConversionCache() };
255
+ if (conversionCacheRef.current === null || conversionCacheRef.current.attachId !== attachId || conversionCacheRef.current.showQuietTools !== showQuietTools) {
256
+ conversionCacheRef.current = {
257
+ attachId,
258
+ showQuietTools,
259
+ cache: createConversionCache({ showQuietTools })
260
+ };
238
261
  }
239
262
  const conversionCache = conversionCacheRef.current.cache;
240
263
  const lastStateMessagesRef = useRef(
@@ -244,7 +267,7 @@ function useDeepAgentThread({
244
267
  (wireState, meta) => {
245
268
  var _a2, _b, _c, _d, _e, _f, _g;
246
269
  const values = readDeepAgentStreamValues(wireState);
247
- const window = readDeepAgentMessageWindow(meta.mounted);
270
+ const window = readMessageWindow(meta.mounted);
248
271
  const held = ((_a2 = lastMessagesRef.current) == null ? void 0 : _a2.attachId) === attachId ? lastMessagesRef.current.messages : null;
249
272
  const messages = (window == null ? void 0 : window.messages) ?? values.messages ?? held ?? [];
250
273
  if (window !== null || messages.length > 0) lastMessagesRef.current = { attachId, messages };
@@ -335,9 +358,9 @@ function useDeepAgentThread({
335
358
  }
336
359
  return converter(state, ((_g = (_f = state.runs) == null ? void 0 : _f[0]) == null ? void 0 : _g.status) === "running", conversionCache);
337
360
  },
338
- [attachId, conversionCache, converter, materialize, threadId]
361
+ [attachId, conversionCache, converter, materialize, readMessageWindow, threadId]
339
362
  );
340
- return StatewireThread({
363
+ const thread = StatewireThread({
341
364
  // The transport stamps this protocol on every command; the thread client
342
365
  // must declare it too or the core skips the optimistic folds and a send
343
366
  // stays invisible until the server frame lands.
@@ -386,6 +409,7 @@ function useDeepAgentThread({
386
409
  isNew: preloadRef.current.preload,
387
410
  headers: (ctx) => headersRef.current(ctx),
388
411
  messageWindow: messageWindowRef.current,
412
+ laneHistory: laneHistoryRef.current,
389
413
  sessionStore,
390
414
  onAuthResolve: (ctx) => {
391
415
  var _a2;
@@ -449,8 +473,10 @@ function useDeepAgentThread({
449
473
  })
450
474
  }
451
475
  });
476
+ return laneEpoch === 0 ? thread : withKey(`lane-epoch:${laneEpoch}`, thread);
452
477
  }
453
478
  export {
479
+ deepAgentAttachId,
454
480
  readSessionPersisted,
455
481
  shouldNotifyRunningChange,
456
482
  useDeepAgentThread