@athenaintel/react 0.41.2 → 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 (451) hide show
  1. package/README.md +108 -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.cjs +158 -0
  48. package/dist/agent-runtime/src/durable-thread-snapshot-cache.cjs.map +1 -0
  49. package/dist/agent-runtime/src/durable-thread-snapshot-cache.d.ts +60 -0
  50. package/dist/agent-runtime/src/durable-thread-snapshot-cache.js +158 -0
  51. package/dist/agent-runtime/src/durable-thread-snapshot-cache.js.map +1 -0
  52. package/dist/agent-runtime/src/edit-command.d.ts +156 -0
  53. package/dist/agent-runtime/src/errors.d.ts +174 -0
  54. package/dist/agent-runtime/src/execute-output.d.ts +31 -0
  55. package/dist/agent-runtime/src/generated/runconfig-contract.cjs +16 -2
  56. package/dist/agent-runtime/src/generated/runconfig-contract.cjs.map +1 -1
  57. package/dist/agent-runtime/src/generated/runconfig-contract.d.ts +202 -0
  58. package/dist/agent-runtime/src/generated/runconfig-contract.js +16 -2
  59. package/dist/agent-runtime/src/generated/runconfig-contract.js.map +1 -1
  60. package/dist/agent-runtime/src/github-wake-event.d.ts +77 -0
  61. package/dist/agent-runtime/src/index.d.ts +74 -0
  62. package/dist/agent-runtime/src/interrupts.cjs +17 -0
  63. package/dist/agent-runtime/src/interrupts.cjs.map +1 -1
  64. package/dist/agent-runtime/src/interrupts.d.ts +348 -0
  65. package/dist/agent-runtime/src/interrupts.js +17 -0
  66. package/dist/agent-runtime/src/interrupts.js.map +1 -1
  67. package/dist/agent-runtime/src/lane-follow.d.ts +121 -0
  68. package/dist/agent-runtime/src/lane-history.cjs +209 -0
  69. package/dist/agent-runtime/src/lane-history.cjs.map +1 -0
  70. package/dist/agent-runtime/src/lane-history.d.ts +175 -0
  71. package/dist/agent-runtime/src/lane-history.js +209 -0
  72. package/dist/agent-runtime/src/lane-history.js.map +1 -0
  73. package/dist/agent-runtime/src/lane-images.d.ts +184 -0
  74. package/dist/agent-runtime/src/message-author.d.ts +43 -0
  75. package/dist/agent-runtime/src/message-text.cjs +15 -0
  76. package/dist/agent-runtime/src/message-text.cjs.map +1 -0
  77. package/dist/agent-runtime/src/message-text.d.ts +47 -0
  78. package/dist/agent-runtime/src/message-text.js +15 -0
  79. package/dist/agent-runtime/src/message-text.js.map +1 -0
  80. package/dist/agent-runtime/src/message-window.cjs +15 -1
  81. package/dist/agent-runtime/src/message-window.cjs.map +1 -1
  82. package/dist/agent-runtime/src/message-window.d.ts +159 -0
  83. package/dist/agent-runtime/src/message-window.js +16 -2
  84. package/dist/agent-runtime/src/message-window.js.map +1 -1
  85. package/dist/agent-runtime/src/messages.cjs +88 -4
  86. package/dist/agent-runtime/src/messages.cjs.map +1 -1
  87. package/dist/agent-runtime/src/messages.d.ts +603 -0
  88. package/dist/agent-runtime/src/messages.js +88 -4
  89. package/dist/agent-runtime/src/messages.js.map +1 -1
  90. package/dist/agent-runtime/src/model-context.d.ts +22 -0
  91. package/dist/agent-runtime/src/offline-status.d.ts +157 -0
  92. package/dist/agent-runtime/src/optimistic-content.d.ts +21 -0
  93. package/dist/agent-runtime/src/protocol.cjs +12 -4
  94. package/dist/agent-runtime/src/protocol.cjs.map +1 -1
  95. package/dist/agent-runtime/src/protocol.d.ts +119 -0
  96. package/dist/agent-runtime/src/protocol.js +13 -5
  97. package/dist/agent-runtime/src/protocol.js.map +1 -1
  98. package/dist/agent-runtime/src/ptc-subcalls.d.ts +51 -0
  99. package/dist/agent-runtime/src/queue.d.ts +138 -0
  100. package/dist/agent-runtime/src/quota-safe-local-storage-session.d.ts +154 -0
  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/statewire-attach-observer.d.ts +194 -0
  115. package/dist/agent-runtime/src/statewire-diagnostics.d.ts +74 -0
  116. package/dist/agent-runtime/src/statewire-state.d.ts +29 -0
  117. package/dist/agent-runtime/src/statewire-suspended.cjs.map +1 -1
  118. package/dist/agent-runtime/src/statewire-suspended.d.ts +27 -0
  119. package/dist/agent-runtime/src/statewire-suspended.js.map +1 -1
  120. package/dist/agent-runtime/src/statewire-transport.d.ts +40 -0
  121. package/dist/agent-runtime/src/streaming-markdown.d.ts +46 -0
  122. package/dist/agent-runtime/src/subagent-transcripts.cjs +209 -0
  123. package/dist/agent-runtime/src/subagent-transcripts.cjs.map +1 -0
  124. package/dist/agent-runtime/src/subagent-transcripts.d.ts +71 -0
  125. package/dist/agent-runtime/src/subagent-transcripts.js +209 -0
  126. package/dist/agent-runtime/src/subagent-transcripts.js.map +1 -0
  127. package/dist/agent-runtime/src/subagents.cjs +253 -0
  128. package/dist/agent-runtime/src/subagents.cjs.map +1 -0
  129. package/dist/agent-runtime/src/subagents.d.ts +311 -0
  130. package/dist/agent-runtime/src/subagents.js +253 -0
  131. package/dist/agent-runtime/src/subagents.js.map +1 -0
  132. package/dist/agent-runtime/src/subscription-wake-event.d.ts +111 -0
  133. package/dist/agent-runtime/src/thread-extras.d.ts +43 -0
  134. package/dist/agent-runtime/src/thread-handoff.d.ts +364 -0
  135. package/dist/agent-runtime/src/thread-prewarm-controller.d.ts +76 -0
  136. package/dist/agent-runtime/src/thread-prewarm.d.ts +118 -0
  137. package/dist/agent-runtime/src/thread-snapshot-cache.d.ts +99 -0
  138. package/dist/agent-runtime/src/thread-snapshot-mirror.cjs +329 -0
  139. package/dist/agent-runtime/src/thread-snapshot-mirror.cjs.map +1 -0
  140. package/dist/agent-runtime/src/thread-snapshot-mirror.d.ts +101 -0
  141. package/dist/agent-runtime/src/thread-snapshot-mirror.js +329 -0
  142. package/dist/agent-runtime/src/thread-snapshot-mirror.js.map +1 -0
  143. package/dist/agent-runtime/src/thread-status.d.ts +53 -0
  144. package/dist/agent-runtime/src/tool-metadata.d.ts +146 -0
  145. package/dist/agent-runtime/src/tool-names.cjs +67 -0
  146. package/dist/agent-runtime/src/tool-names.cjs.map +1 -1
  147. package/dist/agent-runtime/src/tool-names.d.ts +60 -0
  148. package/dist/agent-runtime/src/tool-names.js +68 -1
  149. package/dist/agent-runtime/src/tool-names.js.map +1 -1
  150. package/dist/agent-runtime/src/tool-outputs.d.ts +35 -0
  151. package/dist/agent-runtime/src/tool-result.cjs +1 -0
  152. package/dist/agent-runtime/src/tool-result.cjs.map +1 -1
  153. package/dist/agent-runtime/src/tool-result.d.ts +126 -0
  154. package/dist/agent-runtime/src/tool-result.js +1 -0
  155. package/dist/agent-runtime/src/tool-result.js.map +1 -1
  156. package/dist/agent-runtime/src/types.d.ts +159 -0
  157. package/dist/agent-runtime/src/use-conversation-list.d.ts +76 -0
  158. package/dist/agent-runtime/src/use-deep-agent-chat-outbox.cjs +136 -0
  159. package/dist/agent-runtime/src/use-deep-agent-chat-outbox.cjs.map +1 -0
  160. package/dist/agent-runtime/src/use-deep-agent-chat-outbox.d.ts +64 -0
  161. package/dist/agent-runtime/src/use-deep-agent-chat-outbox.js +136 -0
  162. package/dist/agent-runtime/src/use-deep-agent-chat-outbox.js.map +1 -0
  163. package/dist/agent-runtime/src/use-deep-agent-config.d.ts +169 -0
  164. package/dist/agent-runtime/src/use-deep-agent-edit-submit.cjs +13 -0
  165. package/dist/agent-runtime/src/use-deep-agent-edit-submit.cjs.map +1 -1
  166. package/dist/agent-runtime/src/use-deep-agent-edit-submit.d.ts +22 -0
  167. package/dist/agent-runtime/src/use-deep-agent-edit-submit.js +13 -0
  168. package/dist/agent-runtime/src/use-deep-agent-edit-submit.js.map +1 -1
  169. package/dist/agent-runtime/src/use-deep-agent-runtime.cjs +20 -2
  170. package/dist/agent-runtime/src/use-deep-agent-runtime.cjs.map +1 -1
  171. package/dist/agent-runtime/src/use-deep-agent-runtime.d.ts +168 -0
  172. package/dist/agent-runtime/src/use-deep-agent-runtime.js +20 -2
  173. package/dist/agent-runtime/src/use-deep-agent-runtime.js.map +1 -1
  174. package/dist/agent-runtime/src/use-deep-agent-thread.cjs +12 -4
  175. package/dist/agent-runtime/src/use-deep-agent-thread.cjs.map +1 -1
  176. package/dist/agent-runtime/src/use-deep-agent-thread.d.ts +320 -0
  177. package/dist/agent-runtime/src/use-deep-agent-thread.js +12 -4
  178. package/dist/agent-runtime/src/use-deep-agent-thread.js.map +1 -1
  179. package/dist/agent-runtime/src/use-deep-agent-voice.cjs +999 -0
  180. package/dist/agent-runtime/src/use-deep-agent-voice.cjs.map +1 -0
  181. package/dist/agent-runtime/src/use-deep-agent-voice.d.ts +409 -0
  182. package/dist/agent-runtime/src/use-deep-agent-voice.js +999 -0
  183. package/dist/agent-runtime/src/use-deep-agent-voice.js.map +1 -0
  184. package/dist/agent-runtime/src/use-deep-agent-window-sync.d.ts +102 -0
  185. package/dist/agent-runtime/src/use-historical-edit-attachments.d.ts +2 -0
  186. package/dist/agent-runtime/src/use-thread-handoff-flow.d.ts +84 -0
  187. package/dist/agent-runtime/src/voice-presentation.d.ts +80 -0
  188. package/dist/agent-runtime/src/voice-turn-grouping.d.ts +28 -0
  189. package/dist/agent-runtime/src/voice-wire-types.d.ts +15 -0
  190. package/dist/agent-runtime/src/withdrawn-turns.d.ts +97 -0
  191. package/dist/chat/AthenaChat.cjs +77 -6
  192. package/dist/chat/AthenaChat.cjs.map +1 -1
  193. package/dist/chat/AthenaChat.js +78 -7
  194. package/dist/chat/AthenaChat.js.map +1 -1
  195. package/dist/chat/StatewireApprovalCard.d.ts +1 -1
  196. package/dist/chat/StatewireClientToolBridge.d.ts +1 -1
  197. package/dist/chat/StatewireQueuedMessages.cjs +11 -4
  198. package/dist/chat/StatewireQueuedMessages.cjs.map +1 -1
  199. package/dist/chat/StatewireQueuedMessages.d.ts +1 -1
  200. package/dist/chat/StatewireQueuedMessages.js +11 -4
  201. package/dist/chat/StatewireQueuedMessages.js.map +1 -1
  202. package/dist/chat/chat-outbox-rows.cjs +223 -0
  203. package/dist/chat/chat-outbox-rows.cjs.map +1 -0
  204. package/dist/chat/chat-outbox-rows.d.ts +29 -0
  205. package/dist/chat/chat-outbox-rows.js +223 -0
  206. package/dist/chat/chat-outbox-rows.js.map +1 -0
  207. package/dist/chat/statewire-approval.d.ts +1 -1
  208. package/dist/chat/statewire-client-tools.d.ts +1 -1
  209. package/dist/chat/super-grouping/SuperGroupingCard.cjs +3 -1
  210. package/dist/chat/super-grouping/SuperGroupingCard.cjs.map +1 -1
  211. package/dist/chat/super-grouping/SuperGroupingCard.d.ts +7 -1
  212. package/dist/chat/super-grouping/SuperGroupingCard.js +3 -1
  213. package/dist/chat/super-grouping/SuperGroupingCard.js.map +1 -1
  214. package/dist/chat/super-grouping/SuperGroupingTranscript.cjs +7 -2
  215. package/dist/chat/super-grouping/SuperGroupingTranscript.cjs.map +1 -1
  216. package/dist/chat/super-grouping/SuperGroupingTranscript.d.ts +2 -2
  217. package/dist/chat/super-grouping/SuperGroupingTranscript.js +7 -2
  218. package/dist/chat/super-grouping/SuperGroupingTranscript.js.map +1 -1
  219. package/dist/chat/super-grouping/activity-timeline.cjs +19 -11
  220. package/dist/chat/super-grouping/activity-timeline.cjs.map +1 -1
  221. package/dist/chat/super-grouping/activity-timeline.d.ts +25 -9
  222. package/dist/chat/super-grouping/activity-timeline.js +19 -11
  223. package/dist/chat/super-grouping/activity-timeline.js.map +1 -1
  224. package/dist/chat/use-statewire-approval-request.cjs +36 -0
  225. package/dist/chat/use-statewire-approval-request.cjs.map +1 -1
  226. package/dist/chat/use-statewire-approval-request.d.ts +49 -1
  227. package/dist/chat/use-statewire-approval-request.js +39 -3
  228. package/dist/chat/use-statewire-approval-request.js.map +1 -1
  229. package/dist/chat-ui/composer/tiptap-composer.cjs +102 -3
  230. package/dist/chat-ui/composer/tiptap-composer.cjs.map +1 -1
  231. package/dist/chat-ui/composer/tiptap-composer.d.ts +32 -1
  232. package/dist/chat-ui/composer/tiptap-composer.js +103 -4
  233. package/dist/chat-ui/composer/tiptap-composer.js.map +1 -1
  234. package/dist/chat-ui/header/conversation-history-panel.d.ts +1 -1
  235. package/dist/chat-ui/index.d.ts +1 -1
  236. package/dist/chat-ui/messages/message-components.cjs +15 -0
  237. package/dist/chat-ui/messages/message-components.cjs.map +1 -1
  238. package/dist/chat-ui/messages/message-components.js +15 -0
  239. package/dist/chat-ui/messages/message-components.js.map +1 -1
  240. package/dist/chat-ui/messages/runtime-message.d.ts +1 -1
  241. package/dist/chat-ui/messages/statewire-continue-run.d.ts +1 -1
  242. package/dist/chat-ui/messages/user-edit-composer.cjs +15 -2
  243. package/dist/chat-ui/messages/user-edit-composer.cjs.map +1 -1
  244. package/dist/chat-ui/messages/user-edit-composer.d.ts +4 -2
  245. package/dist/chat-ui/messages/user-edit-composer.js +15 -2
  246. package/dist/chat-ui/messages/user-edit-composer.js.map +1 -1
  247. package/dist/chat-ui/messages/wake-marker.d.ts +1 -1
  248. package/dist/chat-ui/rich-text/chat-text-schema.cjs +1 -0
  249. package/dist/chat-ui/rich-text/chat-text-schema.cjs.map +1 -1
  250. package/dist/chat-ui/rich-text/chat-text-schema.d.ts +3 -0
  251. package/dist/chat-ui/rich-text/chat-text-schema.js +1 -0
  252. package/dist/chat-ui/rich-text/chat-text-schema.js.map +1 -1
  253. package/dist/chat-ui/statewire.cjs +1 -0
  254. package/dist/chat-ui/statewire.cjs.map +1 -1
  255. package/dist/chat-ui/statewire.d.ts +2 -2
  256. package/dist/chat-ui/statewire.js +2 -1
  257. package/dist/chat-ui/thread/statewire-history-edge.d.ts +1 -1
  258. package/dist/composer/AttachmentContext.cjs +8 -4
  259. package/dist/composer/AttachmentContext.cjs.map +1 -1
  260. package/dist/composer/AttachmentContext.d.ts +7 -0
  261. package/dist/composer/AttachmentContext.js +8 -4
  262. package/dist/composer/AttachmentContext.js.map +1 -1
  263. package/dist/composer/build-composed-message.cjs +34 -0
  264. package/dist/composer/build-composed-message.cjs.map +1 -1
  265. package/dist/composer/build-composed-message.d.ts +20 -0
  266. package/dist/composer/build-composed-message.js +35 -1
  267. package/dist/composer/build-composed-message.js.map +1 -1
  268. package/dist/composer/composer-handoff.cjs +39 -2
  269. package/dist/composer/composer-handoff.cjs.map +1 -1
  270. package/dist/composer/composer-handoff.d.ts +28 -3
  271. package/dist/composer/composer-handoff.js +39 -2
  272. package/dist/composer/composer-handoff.js.map +1 -1
  273. package/dist/composer/useAttachFiles.cjs +15 -2
  274. package/dist/composer/useAttachFiles.cjs.map +1 -1
  275. package/dist/composer/useAttachFiles.d.ts +11 -0
  276. package/dist/composer/useAttachFiles.js +15 -2
  277. package/dist/composer/useAttachFiles.js.map +1 -1
  278. package/dist/composer/useSendMessage.cjs.map +1 -1
  279. package/dist/composer/useSendMessage.d.ts +4 -3
  280. package/dist/composer/useSendMessage.js.map +1 -1
  281. package/dist/diagnostics/athena-diagnostics.cjs.map +1 -1
  282. package/dist/diagnostics/athena-diagnostics.d.ts +3 -1
  283. package/dist/diagnostics/athena-diagnostics.js.map +1 -1
  284. package/dist/index.cjs +18 -0
  285. package/dist/index.cjs.map +1 -1
  286. package/dist/index.d.ts +15 -6
  287. package/dist/index.js +19 -1
  288. package/dist/index.js.map +1 -1
  289. package/dist/offline/chat-outbox.cjs +57 -0
  290. package/dist/offline/chat-outbox.cjs.map +1 -0
  291. package/dist/offline/chat-outbox.d.ts +80 -0
  292. package/dist/offline/chat-outbox.js +57 -0
  293. package/dist/offline/chat-outbox.js.map +1 -0
  294. package/dist/offline/offline-history.cjs +77 -0
  295. package/dist/offline/offline-history.cjs.map +1 -0
  296. package/dist/offline/offline-history.d.ts +60 -0
  297. package/dist/offline/offline-history.js +77 -0
  298. package/dist/offline/offline-history.js.map +1 -0
  299. package/dist/provider/AthenaProvider.cjs +206 -9
  300. package/dist/provider/AthenaProvider.cjs.map +1 -1
  301. package/dist/provider/AthenaProvider.d.ts +22 -1
  302. package/dist/provider/AthenaProvider.js +207 -10
  303. package/dist/provider/AthenaProvider.js.map +1 -1
  304. package/dist/provider/statewire-window-context.d.ts +1 -1
  305. package/dist/react/package.json.cjs +1 -1
  306. package/dist/react/package.json.js +1 -1
  307. package/dist/references/src/anchors/file-line-range.d.ts +58 -0
  308. package/dist/references/src/anchors/format.d.ts +21 -0
  309. package/dist/references/src/anchors/message-anchors.d.ts +71 -0
  310. package/dist/references/src/anchors/parse.d.ts +8 -0
  311. package/dist/references/src/anchors/registry-contract.d.ts +24 -0
  312. package/dist/references/src/anchors/registry.d.ts +19 -0
  313. package/dist/references/src/anchors/schemas.d.ts +194 -0
  314. package/dist/references/src/anchors/serialize.d.ts +8 -0
  315. package/dist/references/src/anchors/time.d.ts +78 -0
  316. package/dist/references/src/anchors/types.d.ts +474 -0
  317. package/dist/references/src/asset-bounds.d.ts +27 -0
  318. package/dist/references/src/asset-links.d.ts +23 -0
  319. package/dist/references/src/asset-reference.d.ts +16 -0
  320. package/dist/references/src/formats/format-catalog.d.ts +79 -0
  321. package/dist/references/src/formats/markdown/parse-reference-markdown.d.ts +28 -0
  322. package/dist/references/src/formats/markdown/reference-display-name.d.ts +6 -0
  323. package/dist/references/src/formats/object/asset-object.d.ts +9 -0
  324. package/dist/references/src/formats/object/callable-object.d.ts +6 -0
  325. package/dist/references/src/formats/object/decode-reference-object-payload.d.ts +3 -0
  326. package/dist/references/src/formats/object/external-url-object.d.ts +9 -0
  327. package/dist/references/src/formats/object/group-object.d.ts +9 -0
  328. package/dist/references/src/formats/object/navigation-object.d.ts +9 -0
  329. package/dist/references/src/formats/object/parse-reference-object.d.ts +11 -0
  330. package/dist/references/src/formats/object/person-object.d.ts +9 -0
  331. package/dist/references/src/formats/uri/asset-mention-uri.d.ts +9 -0
  332. package/dist/references/src/formats/uri/asset-spaces-url.d.ts +9 -0
  333. package/dist/references/src/formats/uri/callable-mention-uris.d.ts +9 -0
  334. package/dist/references/src/formats/uri/detect-uri-wire.d.ts +9 -0
  335. package/dist/references/src/formats/uri/group-mention-uri.d.ts +12 -0
  336. package/dist/references/src/formats/uri/navigation-spaces-url.d.ts +14 -0
  337. package/dist/references/src/formats/uri/parse-reference-uri.d.ts +20 -0
  338. package/dist/references/src/formats/uri/person-mention-uri.d.ts +9 -0
  339. package/dist/references/src/formats/uri/template-placeholder.d.ts +12 -0
  340. package/dist/references/src/index.d.ts +47 -0
  341. package/dist/references/src/legacy/index.d.ts +14 -0
  342. package/dist/references/src/legacy/pre-reference-asset-url.d.ts +57 -0
  343. package/dist/references/src/legacy/pre-reference-citation-bridge.d.ts +22 -0
  344. package/dist/references/src/legacy/pre-reference-citation.d.ts +138 -0
  345. package/dist/references/src/legacy/pre-reference-external-url.d.ts +31 -0
  346. package/dist/references/src/legacy/pre-reference-format.d.ts +8 -0
  347. package/dist/references/src/legacy/pre-reference-mention.d.ts +27 -0
  348. package/dist/references/src/legacy/pre-reference-object.d.ts +8 -0
  349. package/dist/references/src/legacy/pre-reference-uri.d.ts +12 -0
  350. package/dist/references/src/legacy.d.ts +2 -0
  351. package/dist/references/src/mention-href-patterns.d.ts +19 -0
  352. package/dist/references/src/mention-node/index.d.ts +5 -0
  353. package/dist/references/src/mention-node/mention-node.d.ts +31 -0
  354. package/dist/references/src/mention-node/resolve-node-attrs.d.ts +27 -0
  355. package/dist/references/src/parse-reference.d.ts +23 -0
  356. package/dist/references/src/schemas.d.ts +463 -0
  357. package/dist/references/src/serialize-reference.d.ts +50 -0
  358. package/dist/references/src/sheet-name.d.ts +10 -0
  359. package/dist/references/src/tool-option-schemas.d.ts +597 -0
  360. package/dist/references/src/types.d.ts +125 -0
  361. package/dist/references/src/version-ref.d.ts +30 -0
  362. package/dist/runtime/statewire-lifecycle.d.ts +1 -1
  363. package/dist/runtime/statewire-model-lane.d.ts +1 -1
  364. package/dist/runtime/statewire-server-lane-context.d.ts +1 -1
  365. package/dist/runtime/statewire-session-key.cjs +7 -0
  366. package/dist/runtime/statewire-session-key.cjs.map +1 -1
  367. package/dist/runtime/statewire-session-key.d.ts +16 -0
  368. package/dist/runtime/statewire-session-key.js +8 -1
  369. package/dist/runtime/statewire-session-key.js.map +1 -1
  370. package/dist/runtime/statewire-session-lane.cjs +48 -0
  371. package/dist/runtime/statewire-session-lane.cjs.map +1 -0
  372. package/dist/runtime/statewire-session-lane.d.ts +29 -0
  373. package/dist/runtime/statewire-session-lane.js +48 -0
  374. package/dist/runtime/statewire-session-lane.js.map +1 -0
  375. package/dist/runtime/statewire-thread-config-lane.d.ts +1 -1
  376. package/dist/runtime/useAthenaStatewireRuntime.cjs +16 -5
  377. package/dist/runtime/useAthenaStatewireRuntime.cjs.map +1 -1
  378. package/dist/runtime/useAthenaStatewireRuntime.d.ts +15 -1
  379. package/dist/runtime/useAthenaStatewireRuntime.js +17 -6
  380. package/dist/runtime/useAthenaStatewireRuntime.js.map +1 -1
  381. package/dist/styles.css +1 -1
  382. package/dist/threads/api.d.ts +1 -1
  383. package/dist/threads/conversation-list-fetcher.d.ts +1 -1
  384. package/dist/threads/index-triggered-refresh.cjs +164 -0
  385. package/dist/threads/index-triggered-refresh.cjs.map +1 -0
  386. package/dist/threads/index-triggered-refresh.d.ts +70 -0
  387. package/dist/threads/index-triggered-refresh.js +164 -0
  388. package/dist/threads/index-triggered-refresh.js.map +1 -0
  389. package/dist/threads/offline-session-list.cjs +75 -0
  390. package/dist/threads/offline-session-list.cjs.map +1 -0
  391. package/dist/threads/offline-session-list.d.ts +27 -0
  392. package/dist/threads/offline-session-list.js +75 -0
  393. package/dist/threads/offline-session-list.js.map +1 -0
  394. package/dist/threads/pull-request-display.d.ts +1 -1
  395. package/dist/threads/session-list-model.d.ts +1 -1
  396. package/dist/threads/session-list-tab-share.cjs +150 -0
  397. package/dist/threads/session-list-tab-share.cjs.map +1 -0
  398. package/dist/threads/session-list-tab-share.d.ts +73 -0
  399. package/dist/threads/session-list-tab-share.js +150 -0
  400. package/dist/threads/session-list-tab-share.js.map +1 -0
  401. package/dist/threads/session-row-parts.d.ts +1 -1
  402. package/dist/threads/sessions-query.d.ts +1 -1
  403. package/dist/threads/statewire-thread-list.cjs +105 -20
  404. package/dist/threads/statewire-thread-list.cjs.map +1 -1
  405. package/dist/threads/statewire-thread-list.d.ts +31 -3
  406. package/dist/threads/statewire-thread-list.js +107 -22
  407. package/dist/threads/statewire-thread-list.js.map +1 -1
  408. package/dist/threads/thread-prefetcher.d.ts +1 -1
  409. package/dist/threads/use-athena-session-attention.d.ts +1 -1
  410. package/dist/threads/use-athena-sessions.cjs +32 -22
  411. package/dist/threads/use-athena-sessions.cjs.map +1 -1
  412. package/dist/threads/use-athena-sessions.js +33 -23
  413. package/dist/threads/use-athena-sessions.js.map +1 -1
  414. package/dist/threads/use-rest-conversation-history.d.ts +1 -1
  415. package/dist/threads/use-statewire-conversation-history.d.ts +5 -5
  416. package/dist/tiptap-markdown-table/src/markdown-table-serializer.d.ts +56 -0
  417. package/dist/tools/NestedPtcMessages.cjs +14 -9
  418. package/dist/tools/NestedPtcMessages.cjs.map +1 -1
  419. package/dist/tools/NestedPtcMessages.d.ts +9 -0
  420. package/dist/tools/NestedPtcMessages.js +6 -1
  421. package/dist/tools/NestedPtcMessages.js.map +1 -1
  422. package/dist/tools/index.d.ts +1 -1
  423. package/dist/tools/primitives.d.ts +1 -1
  424. package/dist/tools/subagent-task-tool-ui.cjs +494 -0
  425. package/dist/tools/subagent-task-tool-ui.cjs.map +1 -0
  426. package/dist/tools/subagent-task-tool-ui.d.ts +109 -0
  427. package/dist/tools/subagent-task-tool-ui.js +494 -0
  428. package/dist/tools/subagent-task-tool-ui.js.map +1 -0
  429. package/dist/tools/tool-fallback.d.ts +1 -1
  430. package/dist/tools/tool-icons.d.ts +1 -1
  431. package/dist/tools/tool-summary.d.ts +1 -1
  432. package/dist/tools/tool-uis.cjs +4 -0
  433. package/dist/tools/tool-uis.cjs.map +1 -1
  434. package/dist/tools/tool-uis.js +4 -0
  435. package/dist/tools/tool-uis.js.map +1 -1
  436. package/dist/voice/chat.cjs +6 -0
  437. package/dist/voice/chat.cjs.map +1 -0
  438. package/dist/voice/chat.d.ts +2 -0
  439. package/dist/voice/chat.js +6 -0
  440. package/dist/voice/chat.js.map +1 -0
  441. package/dist/voice/livekit-join.cjs +119 -0
  442. package/dist/voice/livekit-join.cjs.map +1 -0
  443. package/dist/voice/livekit-join.d.ts +8 -0
  444. package/dist/voice/livekit-join.js +119 -0
  445. package/dist/voice/livekit-join.js.map +1 -0
  446. package/dist/voice/livekit.cjs +32 -0
  447. package/dist/voice/livekit.cjs.map +1 -0
  448. package/dist/voice/livekit.d.ts +80 -0
  449. package/dist/voice/livekit.js +32 -0
  450. package/dist/voice/livekit.js.map +1 -0
  451. package/package.json +20 -10
@@ -0,0 +1,409 @@
1
+ import type { DeepAgentVoiceWireError } from './voice-wire-types';
2
+ declare module '@assistant-ui/core' {
3
+ namespace Assistant {
4
+ interface Commands {
5
+ /**
6
+ * Opens a voice session (`DeepAgentThread.voice_start`). `offer` is the
7
+ * WebRTC SDP offer, {@link VOICE_WEBSOCKET_OFFER} to request the
8
+ * WebSocket audio transport (the answer is then a relay ticket), or
9
+ * {@link VOICE_LIVEKIT_OFFER} to request a LiveKit room (the answer is
10
+ * then the room's join credentials). `model` picks the realtime model
11
+ * (`gpt-live-1`, `gemini-3.8-live`, …); omitted → the host's default.
12
+ */
13
+ voiceStart: {
14
+ type: 'voice/start';
15
+ offer: string;
16
+ model?: string;
17
+ };
18
+ /** Ends the live voice session (`DeepAgentThread.voice_end`). */
19
+ voiceEnd: {
20
+ type: 'voice/end';
21
+ };
22
+ /**
23
+ * No-op whose INGRESS refreshes the caller's server-stored context
24
+ * (context syncs ride command sends), so runConfig changes made while a
25
+ * voice session is live reach the delegated runs.
26
+ */
27
+ voiceProfileSync: {
28
+ type: 'voice/profile-sync';
29
+ };
30
+ /**
31
+ * Mute/unmute the live session's microphone at the protocol level
32
+ * (`DeepAgentThread.voice_set_mic` → `session.input_audio.mute`/`unmute`).
33
+ */
34
+ voiceSetMic: {
35
+ type: 'voice/set-mic';
36
+ paused: boolean;
37
+ };
38
+ /**
39
+ * Route a typed message into the live conversation
40
+ * (`DeepAgentThread.voice_user_text`): commits durably as a
41
+ * `source: "text"` user turn and reaches the live model as speakable
42
+ * context, so it responds by voice exactly as it would to speech.
43
+ * `messageId` is client-minted so a durable-command redelivery after a
44
+ * host crash commits idempotently instead of duplicating the turn.
45
+ */
46
+ voiceUserText: {
47
+ type: 'voice/user-text';
48
+ text: string;
49
+ messageId: string;
50
+ };
51
+ /**
52
+ * Tell the live session what the user is looking at
53
+ * (`DeepAgentThread.voice_context`): one short description of the open
54
+ * asset or page, appended as silent commentary so the live model can
55
+ * resolve "this document" without delegating. Never spoken, never
56
+ * persisted; identical consecutive descriptions are dropped server-side.
57
+ */
58
+ voiceContext: {
59
+ type: 'voice/context';
60
+ text: string;
61
+ };
62
+ }
63
+ }
64
+ }
65
+ /** A voice-delegated frontend tool call projected by legacy hosts
66
+ * (`arguments` is a JSON string). Current hosts run frontend tools through
67
+ * the delegated run's client-tool interrupts, so this stays empty. */
68
+ export interface DeepAgentVoiceToolCall {
69
+ callId: string;
70
+ name: string;
71
+ arguments: string;
72
+ }
73
+ /** The host's `state.voice` projection while a session exists. */
74
+ export interface DeepAgentVoiceWireState {
75
+ clientId: string;
76
+ status: 'connecting' | 'live';
77
+ toolCalls: DeepAgentVoiceToolCall[];
78
+ /** The delegated voice task currently running, if any. */
79
+ activeTask?: {
80
+ taskId: string;
81
+ text: string;
82
+ } | null;
83
+ }
84
+ export type DeepAgentVoicePhase = 'idle' | 'connecting' | 'live' | 'error';
85
+ /**
86
+ * Why a voice session failed, classified where the failure happened rather
87
+ * than by parsing the message afterwards. `server_rejected` carries the
88
+ * host's structured code (`voice-active`, `voice-not-enabled`,
89
+ * `voice-unavailable`, `checkpointer_unavailable`, …); `media_lost` carries the
90
+ * transport state that ended the session. Every surface reports and words the
91
+ * same kinds, so telemetry across Olympus, Chrome, and mobile joins on them.
92
+ */
93
+ export type DeepAgentVoiceFailureKind = 'unsupported' | 'audio_session' | 'microphone_denied' | 'capture_failed' | 'offer_failed' | 'answer_timeout' | 'server_rejected' | 'command_failed' | 'no_answer' | 'answer_failed' | 'relay_failed' | 'room_failed' | 'playback_failed' | 'media_lost' | 'unknown';
94
+ /** Where in the session's lifecycle a failure happened. */
95
+ export type DeepAgentVoiceFailureStage = 'preflight' | 'audio-session' | 'capture' | 'offer' | 'negotiate' | 'answer' | 'relay' | 'room' | 'media' | 'playback';
96
+ export interface DeepAgentVoiceFailure {
97
+ kind: DeepAgentVoiceFailureKind;
98
+ stage: DeepAgentVoiceFailureStage;
99
+ /** The message surfaces render (the same value as `error`). */
100
+ message: string;
101
+ /** The host's rejection reason / structured `detail.code`, when it sent one. */
102
+ code?: string;
103
+ /** The rejection's HTTP-style status, when the host sent a structured one. */
104
+ status?: number;
105
+ /** The statewire send fate when the command settled without a verdict. */
106
+ fate?: string;
107
+ /**
108
+ * The lower-level reason: the media state that ended the session
109
+ * (`failed` / `closed` / `disconnected` / `relay-closed` / `relay-error`), or
110
+ * the channel death that settled the command (`unmount` / `stream-gone` /
111
+ * `session-lost`).
112
+ */
113
+ reason?: string;
114
+ }
115
+ /**
116
+ * Lifecycle milestones of a session attempt, for surfaces that record them
117
+ * (crash breadcrumbs, latency telemetry). `attempt` groups one start's
118
+ * events; `sinceStartMs` is measured from that attempt's `start-requested`.
119
+ */
120
+ export type DeepAgentVoiceDiagnosticEvent = 'start-requested' | 'audio-session-ready' | 'microphone-captured' | 'offer-ready' | 'ice-gathering-timeout' | 'answer-received' | 'room-joined' | 'live' | 'media-state' | 'media-loss' | 'auto-restart' | 'server-ended' | 'end' | 'error' | 'stale-attempt';
121
+ export interface DeepAgentVoiceDiagnostic {
122
+ event: DeepAgentVoiceDiagnosticEvent;
123
+ attempt: number;
124
+ /** Epoch ms. */
125
+ at: number;
126
+ sinceStartMs: number;
127
+ data?: Record<string, string | number | boolean | null>;
128
+ }
129
+ /**
130
+ * Classify a failed `voice/start` command. A host rejection keeps the host's
131
+ * reason (`payload.reason` from the voice manager, `payload.detail.code` from
132
+ * the command gate's structured envelope) and its own user-worded message; a
133
+ * command the channel settled without a verdict reports its fate.
134
+ */
135
+ export declare const classifyVoiceStartError: (error: unknown) => Pick<DeepAgentVoiceFailure, 'kind' | 'message' | 'code' | 'status' | 'fate' | 'reason'>;
136
+ /**
137
+ * Decode a `voice/start` answer on the `livekit` transport. Throws (as a
138
+ * `no_answer` failure when raised in the `answer` stage) on a missing prefix,
139
+ * malformed JSON, or a missing/non-string field — a host that answered with
140
+ * something else did not open a LiveKit room for this client.
141
+ */
142
+ export declare const parseVoiceLiveKitAnswer: (answer: string) => DeepAgentVoiceLiveKitAnswer;
143
+ /**
144
+ * User-facing copy for a failure, shared so every surface words the same
145
+ * cause alike. Host rejections keep the host's own wording (it already names
146
+ * the actionable cause); the local kinds get a sentence the user can act on.
147
+ */
148
+ export declare const describeVoiceFailure: (failure: DeepAgentVoiceFailure) => string;
149
+ /**
150
+ * How the session's audio travels. `webrtc` (the default) negotiates a peer
151
+ * connection straight to OpenAI; `websocket` captures PCM locally and streams
152
+ * it to Agora's relay endpoint, for surfaces where WebRTC is unavailable
153
+ * (Office add-in webviews, UDP-blocked networks) — web only: it needs
154
+ * `AudioContext` and `WebSocket` globals. `livekit` joins the LiveKit room the
155
+ * host mints for the session through a caller-supplied
156
+ * {@link DeepAgentVoiceLiveKitAdapter}; Agora joins the same room as the agent
157
+ * participant, so this is the only transport on which the realtime model is a
158
+ * per-session choice (`gpt-live-1`, `gemini-3.8-live`, …) — the other two are
159
+ * OpenAI-direct media legs and stay GPT Live only.
160
+ */
161
+ export type DeepAgentVoiceTransport = 'webrtc' | 'websocket' | 'livekit';
162
+ /**
163
+ * The `voice/start` offer that requests the WebSocket transport. Mirrors
164
+ * `agora.services.voice_relay.VOICE_WEBSOCKET_OFFER`.
165
+ */
166
+ export declare const VOICE_WEBSOCKET_OFFER = "athena-voice-transport:websocket/v1";
167
+ /** Prefix of a `voice/start` answer that carries a relay ticket, not an SDP answer. */
168
+ export declare const VOICE_RELAY_ANSWER_PREFIX = "athena-voice-relay:";
169
+ /** The relay's wire format: raw PCM16, mono, 24 kHz (the Live API's PCM format). */
170
+ export declare const VOICE_RELAY_SAMPLE_RATE = 24000;
171
+ /**
172
+ * The `voice/start` offer that requests the LiveKit transport. Mirrors
173
+ * `agora.graphs.athena_deep_agent.voice_media.VOICE_LIVEKIT_OFFER`.
174
+ */
175
+ export declare const VOICE_LIVEKIT_OFFER = "athena-voice-transport:livekit/v1";
176
+ /**
177
+ * Prefix of a `voice/start` answer that carries LiveKit room credentials: the
178
+ * rest is `JSON.stringify({ serverUrl, token, roomName })`. Mirrors
179
+ * `agora.graphs.athena_deep_agent.voice_media.VOICE_LIVEKIT_ANSWER_PREFIX`.
180
+ */
181
+ export declare const VOICE_LIVEKIT_ANSWER_PREFIX = "athena-voice-livekit:";
182
+ /** The room the host minted for the session, decoded from the `voice/start` answer. */
183
+ export interface DeepAgentVoiceLiveKitAnswer {
184
+ /** LiveKit signalling URL, already `wss://`. */
185
+ serverUrl: string;
186
+ /** The browser participant's join token (`room_join`, publish, subscribe). */
187
+ token: string;
188
+ roomName: string;
189
+ }
190
+ /** A joined LiveKit room, as far as the session state machine drives it. */
191
+ export interface DeepAgentVoiceLiveKitSession {
192
+ /** Publish/unpublish (or unmute/mute) the local microphone track. */
193
+ setMicrophoneEnabled(enabled: boolean): Promise<void>;
194
+ /** Leave the room and release the microphone. Idempotent. */
195
+ disconnect(): Promise<void>;
196
+ }
197
+ /**
198
+ * The LiveKit leg of the `livekit` transport, supplied by the surface so this
199
+ * package never depends on `livekit-client` (web surfaces wrap `Room`; native
200
+ * ones wrap the React Native SDK). Structural on purpose: tests inject fakes.
201
+ */
202
+ export interface DeepAgentVoiceLiveKitAdapter {
203
+ /**
204
+ * Join the room, publish the microphone (respecting `micMuted`), play remote
205
+ * audio; rejects on failure (a microphone-permission error keeps its DOM
206
+ * `name`, so it classifies as `microphone_denied`). `onDisconnected` fires
207
+ * once when the room drops AFTER a successful join — never for the session's
208
+ * own `disconnect()`. An aborted `signal` must stop pending/joined media and
209
+ * reject a pending join; the runtime also releases late results from older
210
+ * adapters that do not implement cancellation.
211
+ */
212
+ connect(answer: DeepAgentVoiceLiveKitAnswer, handlers: {
213
+ micMuted: boolean;
214
+ /** Abort a pending join and release media when this attempt ends. */
215
+ signal?: AbortSignal;
216
+ onDisconnected: (reason: string) => void;
217
+ }): Promise<DeepAgentVoiceLiveKitSession>;
218
+ }
219
+ /** One realtime model the host offers for voice sessions (`state.voiceModelOptions`). */
220
+ export interface DeepAgentVoiceModelOption {
221
+ id: string;
222
+ label: string;
223
+ provider: 'openai_live' | 'google';
224
+ /** `false` when the deployment lacks the provider's credentials. */
225
+ enabled: boolean;
226
+ description: string;
227
+ }
228
+ /**
229
+ * Validate the host's `state.voiceModelOptions`: `null` when absent or not a
230
+ * list, otherwise the well-formed entries (a malformed entry is dropped, not
231
+ * fatal — an older or newer host must never blank the whole picker).
232
+ */
233
+ export declare const parseVoiceModelOptions: (value: unknown) => DeepAgentVoiceModelOption[] | null;
234
+ interface VoiceMediaStreamTrack {
235
+ /** Standard WebRTC mute lever: a disabled track transmits silence. */
236
+ enabled: boolean;
237
+ stop(): void;
238
+ }
239
+ export interface DeepAgentVoiceRemoteStream {
240
+ getTracks(): VoiceMediaStreamTrack[];
241
+ /** React Native WebRTC owns native stream/track entries beyond track.stop(). */
242
+ release?(): void;
243
+ }
244
+ /** `m:ss` / `h:mm:ss` for the live-session timer strips (shared so the three
245
+ * surfaces cannot drift on formatting). */
246
+ export declare const formatVoiceElapsed: (sinceMs: number, nowMs?: number) => string;
247
+ /** Ticking elapsed-call string for a live session — the one timer
248
+ * implementation all surfaces share (interval lifecycle + formatting).
249
+ * Returns `null` when there is no live session. Callers isolate it in a
250
+ * leaf component so only that leaf re-renders per second. */
251
+ export declare const useVoiceElapsed: (since: number | null) => string | null;
252
+ /**
253
+ * One-line, user-facing rendering of a Live API rejection the host projected
254
+ * (`state.voiceLastError`). Shared so every surface words the notice alike.
255
+ */
256
+ export declare const describeVoiceWireError: (error: DeepAgentVoiceWireError) => string;
257
+ /** The relay endpoint for a ticket: `wss://<agora>/api/voice/relay?ticket=…`. */
258
+ export declare const voiceRelayUrl: (relayUrl: string, ticket: string) => string;
259
+ /** Float32 samples in [-1, 1] → little-endian PCM16 (the relay wire format). */
260
+ export declare const pcm16FromFloat32: (samples: Float32Array) => Int16Array;
261
+ /** PCM16 → Float32 samples in [-1, 1] for Web Audio playback. */
262
+ export declare const float32FromPcm16: (pcm: Int16Array) => Float32Array;
263
+ export interface UseDeepAgentVoiceOptions {
264
+ /**
265
+ * Remote-audio sink: called with the remote stream when the session answers
266
+ * and with `null` on teardown. Web surfaces attach it to an `<audio>`
267
+ * element; react-native-webrtc plays remote audio natively, so native
268
+ * surfaces omit it. A rejected promise fails the session. WebRTC only: the
269
+ * WebSocket transport plays through its own `AudioContext`.
270
+ */
271
+ onRemoteStream?: (stream: DeepAgentVoiceRemoteStream | null) => void | Promise<void>;
272
+ /**
273
+ * Platform audio-session ownership for the whole call: `start` runs before
274
+ * mic capture (a rejection fails the session), `stop` runs on every
275
+ * teardown path. Native surfaces pass their call-audio module (on iOS the
276
+ * non-mixable playAndRecord/voiceChat session that entitles the app to
277
+ * keep a live call running); web surfaces omit it.
278
+ */
279
+ audioSession?: {
280
+ start: () => Promise<void>;
281
+ stop: () => Promise<void>;
282
+ /** Synchronously mark an in-flight start for cleanup before a new owner starts. */
283
+ cancelStart?: () => void;
284
+ };
285
+ /** Media transport; see {@link DeepAgentVoiceTransport}. Default `webrtc`. */
286
+ transport?: DeepAgentVoiceTransport;
287
+ /**
288
+ * Agora's base URL (e.g. `https://api.athenaintel.com`) whose
289
+ * `/api/voice/relay` endpoint carries the audio on the `websocket`
290
+ * transport. Required for that transport, ignored otherwise.
291
+ */
292
+ relayUrl?: string;
293
+ /**
294
+ * The room leg for the `livekit` transport (required for it, ignored
295
+ * otherwise); see {@link DeepAgentVoiceLiveKitAdapter}. Read through a
296
+ * per-render ref, so a fresh adapter never restarts anything.
297
+ */
298
+ livekit?: DeepAgentVoiceLiveKitAdapter;
299
+ /**
300
+ * The realtime model to ask for, sent as `voice/start.model` — a value or a
301
+ * getter resolved when each attempt (user start or automatic restart)
302
+ * negotiates. `undefined`/empty omits the key and the host picks its
303
+ * default. Only the `livekit` transport can honour a non-GPT-Live model.
304
+ */
305
+ model?: string | (() => string | undefined);
306
+ /**
307
+ * Lifecycle observer for the session attempts (negotiation milestones with
308
+ * timings, media-state changes, losses, restarts, ends). Surfaces feed it to
309
+ * their crash breadcrumbs / telemetry; read through a per-render ref, so a
310
+ * fresh closure never restarts anything. Must not throw.
311
+ */
312
+ onDiagnostic?: (entry: DeepAgentVoiceDiagnostic) => void;
313
+ /** Per-surface overrides of the negotiation deadlines (ms). */
314
+ timeouts?: {
315
+ /** How long to wait for ICE gathering to complete before sending the offer with the candidates so far. */
316
+ iceGatheringMs?: number;
317
+ /** How long `voice/start` may take to answer. */
318
+ answerMs?: number;
319
+ /** How long the relay WebSocket may take to open (`websocket` transport). */
320
+ relayOpenMs?: number;
321
+ };
322
+ }
323
+ export interface UseDeepAgentVoiceReturn {
324
+ phase: DeepAgentVoicePhase;
325
+ /** The failure message while `phase === 'error'` (same as `failure.message`). */
326
+ error: string | null;
327
+ /**
328
+ * The classified failure while `phase === 'error'`; `null` otherwise. Where
329
+ * `error` is only words, this says WHICH step failed and, for a host
330
+ * rejection, the host's reason code — the key telemetry and support join on.
331
+ */
332
+ failure: DeepAgentVoiceFailure | null;
333
+ start: () => Promise<void>;
334
+ end: () => void;
335
+ /** The delegated voice task currently running server-side, if any. */
336
+ activeTask: {
337
+ taskId: string;
338
+ text: string;
339
+ } | null;
340
+ /** Epoch ms when the session went live; `null` outside a live session.
341
+ * Surfaces render an elapsed-call timer from it. */
342
+ liveSince: number | null;
343
+ /**
344
+ * Whether the local microphone is muted. Mute is distinct from `end`: the
345
+ * session (and any delegated work) stays live while the local track is
346
+ * disabled AND the server mutes protocol input (`session.input_audio.mute`
347
+ * — muted speech is discarded server-side, the model keeps speaking).
348
+ */
349
+ micMuted: boolean;
350
+ /** Mute/unmute the live session's microphone; a no-op unless live. */
351
+ setMicMuted: (muted: boolean) => void;
352
+ /**
353
+ * Bimodal input: send typed text into the live conversation as if spoken.
354
+ * Resolves `true` once the server accepted it; `false` when there is no
355
+ * live session or the command was rejected — the caller falls back to a
356
+ * normal run send so the message is never lost.
357
+ */
358
+ sendUserText: (text: string) => Promise<boolean>;
359
+ /**
360
+ * The delegated task that was still running when the last session ended.
361
+ * The run itself continues on the thread — surfaces render a "voice ended,
362
+ * still working" note from this until the run settles or a new session
363
+ * starts, at which point it clears itself.
364
+ */
365
+ handoffTask: {
366
+ taskId: string;
367
+ text: string;
368
+ } | null;
369
+ /**
370
+ * Push the client's current synced context (runConfig included) to the
371
+ * server so the NEXT delegated run uses it. Call after a runConfig change
372
+ * while the session is live; a no-op otherwise.
373
+ */
374
+ syncProfile: () => void;
375
+ /**
376
+ * Non-fatal notice for the live session: the most recent Live API
377
+ * rejection the host projected (a refused context update, a failed mute),
378
+ * worded for the user. The session stays live; `null` when there is none
379
+ * or the session is not live.
380
+ */
381
+ notice: string | null;
382
+ /**
383
+ * Tell the live session what the user is looking at (one short line, e.g.
384
+ * `spreadsheet "Q3 Budget"`). Silent context for reference resolution;
385
+ * fire-and-forget, a no-op unless live.
386
+ */
387
+ sendContext: (text: string) => void;
388
+ /**
389
+ * The realtime model the host resolved for the current/last session
390
+ * (`state.voiceModel`, stamped when a session starts), or `null` before
391
+ * any session or while the snapshot is not hydrated. Stale after an end is
392
+ * inert — surfaces gate on `phase`, like `micMuted`.
393
+ */
394
+ model: string | null;
395
+ /**
396
+ * The realtime models this host offers (`state.voiceModelOptions`,
397
+ * published at host boot), validated; `null` on an older host that does
398
+ * not publish them — surfaces fall back to their static list.
399
+ */
400
+ modelOptions: DeepAgentVoiceModelOption[] | null;
401
+ }
402
+ /**
403
+ * The experimental voice-mode session against the thread's `voice/start` /
404
+ * `voice/end` commands: mic capture and media negotiation (WebRTC by default,
405
+ * or PCM over Agora's relay WebSocket); the live turns stream into the chat
406
+ * log as `ephemeral: true` entries in `state.messages`.
407
+ */
408
+ export declare const useDeepAgentVoice: (options?: UseDeepAgentVoiceOptions) => UseDeepAgentVoiceReturn;
409
+ export {};