@athenaintel/react 0.43.0 → 0.50.0

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 (746) hide show
  1. package/README.md +258 -8
  2. package/dist/agent-runtime/src/answer-label.cjs +137 -0
  3. package/dist/agent-runtime/src/answer-label.cjs.map +1 -0
  4. package/dist/agent-runtime/src/answer-label.d.ts +104 -0
  5. package/dist/agent-runtime/src/answer-label.js +137 -0
  6. package/dist/agent-runtime/src/answer-label.js.map +1 -0
  7. package/dist/agent-runtime/src/answer-rows.cjs +180 -0
  8. package/dist/agent-runtime/src/answer-rows.cjs.map +1 -0
  9. package/dist/agent-runtime/src/answer-rows.d.ts +86 -0
  10. package/dist/agent-runtime/src/answer-rows.js +180 -0
  11. package/dist/agent-runtime/src/answer-rows.js.map +1 -0
  12. package/dist/agent-runtime/src/call-recap.cjs +319 -0
  13. package/dist/agent-runtime/src/call-recap.cjs.map +1 -0
  14. package/dist/agent-runtime/src/call-recap.d.ts +142 -0
  15. package/dist/agent-runtime/src/call-recap.js +319 -0
  16. package/dist/agent-runtime/src/call-recap.js.map +1 -0
  17. package/dist/agent-runtime/src/chat-outbox-store.cjs +1 -0
  18. package/dist/agent-runtime/src/chat-outbox-store.cjs.map +1 -1
  19. package/dist/agent-runtime/src/chat-outbox-store.d.ts +7 -0
  20. package/dist/agent-runtime/src/chat-outbox-store.js +1 -0
  21. package/dist/agent-runtime/src/chat-outbox-store.js.map +1 -1
  22. package/dist/agent-runtime/src/chat-outbox.cjs +46 -5
  23. package/dist/agent-runtime/src/chat-outbox.cjs.map +1 -1
  24. package/dist/agent-runtime/src/chat-outbox.d.ts +29 -0
  25. package/dist/agent-runtime/src/chat-outbox.js +46 -5
  26. package/dist/agent-runtime/src/chat-outbox.js.map +1 -1
  27. package/dist/agent-runtime/src/client-tool-bridge.cjs +15 -15
  28. package/dist/agent-runtime/src/client-tool-bridge.cjs.map +1 -1
  29. package/dist/agent-runtime/src/conversation-index.cjs +8 -8
  30. package/dist/agent-runtime/src/conversation-index.cjs.map +1 -1
  31. package/dist/agent-runtime/src/conversation-index.d.ts +7 -0
  32. package/dist/agent-runtime/src/conversation-index.js.map +1 -1
  33. package/dist/agent-runtime/src/conversation-list.cjs +2 -1
  34. package/dist/agent-runtime/src/conversation-list.cjs.map +1 -1
  35. package/dist/agent-runtime/src/conversation-list.d.ts +19 -3
  36. package/dist/agent-runtime/src/conversation-list.js +2 -1
  37. package/dist/agent-runtime/src/conversation-list.js.map +1 -1
  38. package/dist/agent-runtime/src/decision-checks.cjs +207 -0
  39. package/dist/agent-runtime/src/decision-checks.cjs.map +1 -0
  40. package/dist/agent-runtime/src/decision-checks.d.ts +142 -0
  41. package/dist/agent-runtime/src/decision-checks.js +207 -0
  42. package/dist/agent-runtime/src/decision-checks.js.map +1 -0
  43. package/dist/agent-runtime/src/desktop-handoff.d.ts +12 -0
  44. package/dist/agent-runtime/src/errors.cjs +18 -0
  45. package/dist/agent-runtime/src/errors.cjs.map +1 -1
  46. package/dist/agent-runtime/src/errors.d.ts +7 -0
  47. package/dist/agent-runtime/src/errors.js +18 -0
  48. package/dist/agent-runtime/src/errors.js.map +1 -1
  49. package/dist/agent-runtime/src/generated/runconfig-contract.cjs +12 -0
  50. package/dist/agent-runtime/src/generated/runconfig-contract.cjs.map +1 -1
  51. package/dist/agent-runtime/src/generated/runconfig-contract.d.ts +6 -6
  52. package/dist/agent-runtime/src/generated/runconfig-contract.js +12 -0
  53. package/dist/agent-runtime/src/generated/runconfig-contract.js.map +1 -1
  54. package/dist/agent-runtime/src/handoff-arrival.cjs +60 -0
  55. package/dist/agent-runtime/src/handoff-arrival.cjs.map +1 -0
  56. package/dist/agent-runtime/src/handoff-arrival.d.ts +46 -0
  57. package/dist/agent-runtime/src/handoff-arrival.js +60 -0
  58. package/dist/agent-runtime/src/handoff-arrival.js.map +1 -0
  59. package/dist/agent-runtime/src/index.d.ts +16 -9
  60. package/dist/agent-runtime/src/interrupts.cjs +71 -19
  61. package/dist/agent-runtime/src/interrupts.cjs.map +1 -1
  62. package/dist/agent-runtime/src/interrupts.d.ts +40 -3
  63. package/dist/agent-runtime/src/interrupts.js +56 -4
  64. package/dist/agent-runtime/src/interrupts.js.map +1 -1
  65. package/dist/agent-runtime/src/lane-history.cjs +8 -8
  66. package/dist/agent-runtime/src/lane-history.cjs.map +1 -1
  67. package/dist/agent-runtime/src/messages.cjs +43 -8
  68. package/dist/agent-runtime/src/messages.cjs.map +1 -1
  69. package/dist/agent-runtime/src/messages.d.ts +25 -3
  70. package/dist/agent-runtime/src/messages.js +43 -8
  71. package/dist/agent-runtime/src/messages.js.map +1 -1
  72. package/dist/agent-runtime/src/model-context.cjs +3 -2
  73. package/dist/agent-runtime/src/model-context.cjs.map +1 -1
  74. package/dist/agent-runtime/src/model-context.d.ts +6 -1
  75. package/dist/agent-runtime/src/model-context.js +3 -2
  76. package/dist/agent-runtime/src/model-context.js.map +1 -1
  77. package/dist/agent-runtime/src/offline-status.cjs +36 -0
  78. package/dist/agent-runtime/src/offline-status.cjs.map +1 -0
  79. package/dist/agent-runtime/src/offline-status.d.ts +118 -3
  80. package/dist/agent-runtime/src/offline-status.js +36 -0
  81. package/dist/agent-runtime/src/offline-status.js.map +1 -0
  82. package/dist/agent-runtime/src/queue.cjs +0 -9
  83. package/dist/agent-runtime/src/queue.cjs.map +1 -1
  84. package/dist/agent-runtime/src/queue.js +0 -9
  85. package/dist/agent-runtime/src/queue.js.map +1 -1
  86. package/dist/agent-runtime/src/quota-safe-local-storage-session.cjs +9 -9
  87. package/dist/agent-runtime/src/quota-safe-local-storage-session.cjs.map +1 -1
  88. package/dist/agent-runtime/src/runtime-catalog.cjs +42 -0
  89. package/dist/agent-runtime/src/runtime-catalog.cjs.map +1 -0
  90. package/dist/agent-runtime/src/runtime-catalog.d.ts +35 -0
  91. package/dist/agent-runtime/src/runtime-catalog.js +42 -0
  92. package/dist/agent-runtime/src/runtime-catalog.js.map +1 -0
  93. package/dist/agent-runtime/src/runtime-messages.cjs.map +1 -1
  94. package/dist/agent-runtime/src/runtime-messages.d.ts +1 -1
  95. package/dist/agent-runtime/src/runtime-messages.js.map +1 -1
  96. package/dist/agent-runtime/src/runtime.d.ts +41 -0
  97. package/dist/agent-runtime/src/send-recovery.cjs +37 -3
  98. package/dist/agent-runtime/src/send-recovery.cjs.map +1 -1
  99. package/dist/agent-runtime/src/send-recovery.d.ts +19 -0
  100. package/dist/agent-runtime/src/send-recovery.js +37 -3
  101. package/dist/agent-runtime/src/send-recovery.js.map +1 -1
  102. package/dist/agent-runtime/src/statewire-suspended.cjs +3 -3
  103. package/dist/agent-runtime/src/statewire-suspended.cjs.map +1 -1
  104. package/dist/agent-runtime/src/subagents.cjs +32 -2
  105. package/dist/agent-runtime/src/subagents.cjs.map +1 -1
  106. package/dist/agent-runtime/src/subagents.d.ts +9 -0
  107. package/dist/agent-runtime/src/subagents.js +30 -0
  108. package/dist/agent-runtime/src/subagents.js.map +1 -1
  109. package/dist/agent-runtime/src/thread-driver.cjs +67 -0
  110. package/dist/agent-runtime/src/thread-driver.cjs.map +1 -0
  111. package/dist/agent-runtime/src/thread-driver.d.ts +49 -0
  112. package/dist/agent-runtime/src/thread-driver.js +67 -0
  113. package/dist/agent-runtime/src/thread-driver.js.map +1 -0
  114. package/dist/agent-runtime/src/thread-handoff-flow-machine.d.ts +172 -0
  115. package/dist/agent-runtime/src/thread-handoff-protocol.d.ts +868 -0
  116. package/dist/agent-runtime/src/thread-handoff-qr.d.ts +11 -0
  117. package/dist/agent-runtime/src/thread-handoff.d.ts +3 -364
  118. package/dist/agent-runtime/src/thread-status.cjs +3 -3
  119. package/dist/agent-runtime/src/thread-status.cjs.map +1 -1
  120. package/dist/agent-runtime/src/tool-metadata.cjs +210 -25
  121. package/dist/agent-runtime/src/tool-metadata.cjs.map +1 -1
  122. package/dist/agent-runtime/src/tool-metadata.d.ts +12 -0
  123. package/dist/agent-runtime/src/tool-metadata.js +210 -25
  124. package/dist/agent-runtime/src/tool-metadata.js.map +1 -1
  125. package/dist/agent-runtime/src/tool-names.cjs +2 -0
  126. package/dist/agent-runtime/src/tool-names.cjs.map +1 -1
  127. package/dist/agent-runtime/src/tool-names.d.ts +2 -0
  128. package/dist/agent-runtime/src/tool-names.js +2 -0
  129. package/dist/agent-runtime/src/tool-names.js.map +1 -1
  130. package/dist/agent-runtime/src/types.d.ts +10 -2
  131. package/dist/agent-runtime/src/use-conversation-list.cjs +14 -13
  132. package/dist/agent-runtime/src/use-conversation-list.cjs.map +1 -1
  133. package/dist/agent-runtime/src/use-conversation-list.d.ts +6 -0
  134. package/dist/agent-runtime/src/use-conversation-list.js +3 -2
  135. package/dist/agent-runtime/src/use-conversation-list.js.map +1 -1
  136. package/dist/agent-runtime/src/use-deep-agent-chat-outbox.cjs +45 -20
  137. package/dist/agent-runtime/src/use-deep-agent-chat-outbox.cjs.map +1 -1
  138. package/dist/agent-runtime/src/use-deep-agent-chat-outbox.d.ts +10 -3
  139. package/dist/agent-runtime/src/use-deep-agent-chat-outbox.js +27 -2
  140. package/dist/agent-runtime/src/use-deep-agent-chat-outbox.js.map +1 -1
  141. package/dist/agent-runtime/src/use-deep-agent-config.cjs +14 -14
  142. package/dist/agent-runtime/src/use-deep-agent-config.cjs.map +1 -1
  143. package/dist/agent-runtime/src/use-deep-agent-edit-submit.cjs +6 -6
  144. package/dist/agent-runtime/src/use-deep-agent-edit-submit.cjs.map +1 -1
  145. package/dist/agent-runtime/src/use-deep-agent-runtime.cjs +40 -22
  146. package/dist/agent-runtime/src/use-deep-agent-runtime.cjs.map +1 -1
  147. package/dist/agent-runtime/src/use-deep-agent-runtime.d.ts +17 -0
  148. package/dist/agent-runtime/src/use-deep-agent-runtime.js +24 -6
  149. package/dist/agent-runtime/src/use-deep-agent-runtime.js.map +1 -1
  150. package/dist/agent-runtime/src/use-deep-agent-thread.cjs +45 -45
  151. package/dist/agent-runtime/src/use-deep-agent-thread.cjs.map +1 -1
  152. package/dist/agent-runtime/src/use-deep-agent-voice.cjs +588 -130
  153. package/dist/agent-runtime/src/use-deep-agent-voice.cjs.map +1 -1
  154. package/dist/agent-runtime/src/use-deep-agent-voice.d.ts +162 -10
  155. package/dist/agent-runtime/src/use-deep-agent-voice.js +529 -71
  156. package/dist/agent-runtime/src/use-deep-agent-voice.js.map +1 -1
  157. package/dist/agent-runtime/src/use-deep-agent-window-sync.cjs +26 -26
  158. package/dist/agent-runtime/src/use-deep-agent-window-sync.cjs.map +1 -1
  159. package/dist/agent-runtime/src/use-historical-edit-attachments.cjs +4 -4
  160. package/dist/agent-runtime/src/use-historical-edit-attachments.cjs.map +1 -1
  161. package/dist/agent-runtime/src/use-thread-handoff-flow.d.ts +34 -26
  162. package/dist/agent-runtime/src/voice-earcon.cjs +139 -0
  163. package/dist/agent-runtime/src/voice-earcon.cjs.map +1 -0
  164. package/dist/agent-runtime/src/voice-earcon.d.ts +38 -0
  165. package/dist/agent-runtime/src/voice-earcon.js +139 -0
  166. package/dist/agent-runtime/src/voice-earcon.js.map +1 -0
  167. package/dist/agent-runtime/src/voice-media.cjs +117 -0
  168. package/dist/agent-runtime/src/voice-media.cjs.map +1 -0
  169. package/dist/agent-runtime/src/voice-media.d.ts +63 -0
  170. package/dist/agent-runtime/src/voice-media.js +117 -0
  171. package/dist/agent-runtime/src/voice-media.js.map +1 -0
  172. package/dist/agent-runtime/src/voice-presentation.cjs +2 -0
  173. package/dist/agent-runtime/src/voice-presentation.cjs.map +1 -1
  174. package/dist/agent-runtime/src/voice-presentation.js +2 -0
  175. package/dist/agent-runtime/src/voice-presentation.js.map +1 -1
  176. package/dist/agent-runtime/src/voice-wire-types.d.ts +32 -0
  177. package/dist/assets/AssetPanel.cjs +11 -11
  178. package/dist/assets/AssetPanel.cjs.map +1 -1
  179. package/dist/assets/AthenaAssetEmbed.cjs +11 -9
  180. package/dist/assets/AthenaAssetEmbed.cjs.map +1 -1
  181. package/dist/assets/AthenaAssetEmbed.d.ts +18 -5
  182. package/dist/assets/AthenaAssetEmbed.js +4 -2
  183. package/dist/assets/AthenaAssetEmbed.js.map +1 -1
  184. package/dist/assets/AthenaLayout.cjs +16 -16
  185. package/dist/assets/AthenaLayout.cjs.map +1 -1
  186. package/dist/assets/use-asset-content.cjs +4 -4
  187. package/dist/assets/use-asset-content.cjs.map +1 -1
  188. package/dist/assets/use-asset-embed.cjs +14 -7
  189. package/dist/assets/use-asset-embed.cjs.map +1 -1
  190. package/dist/assets/use-asset-embed.d.ts +23 -6
  191. package/dist/assets/use-asset-embed.js +10 -3
  192. package/dist/assets/use-asset-embed.js.map +1 -1
  193. package/dist/auth/AthenaAuthContext.cjs +3 -3
  194. package/dist/auth/AthenaAuthContext.cjs.map +1 -1
  195. package/dist/auth/AthenaAuthProvider.cjs +8 -8
  196. package/dist/auth/AthenaAuthProvider.cjs.map +1 -1
  197. package/dist/auth/AthenaCredentialSourceContext.cjs +5 -5
  198. package/dist/auth/AthenaCredentialSourceContext.cjs.map +1 -1
  199. package/dist/auth/AthenaSSOProvider.cjs +14 -14
  200. package/dist/auth/AthenaSSOProvider.cjs.map +1 -1
  201. package/dist/auth/credential-source.cjs +26 -13
  202. package/dist/auth/credential-source.cjs.map +1 -1
  203. package/dist/auth/credential-source.d.ts +8 -0
  204. package/dist/auth/credential-source.js +26 -13
  205. package/dist/auth/credential-source.js.map +1 -1
  206. package/dist/catalog/agent-model-options.cjs +25 -17
  207. package/dist/catalog/agent-model-options.cjs.map +1 -1
  208. package/dist/catalog/agent-model-options.d.ts +38 -5
  209. package/dist/catalog/agent-model-options.js +25 -17
  210. package/dist/catalog/agent-model-options.js.map +1 -1
  211. package/dist/catalog/channel-refusal.cjs +36 -0
  212. package/dist/catalog/channel-refusal.cjs.map +1 -0
  213. package/dist/catalog/channel-refusal.d.ts +29 -0
  214. package/dist/catalog/channel-refusal.js +36 -0
  215. package/dist/catalog/channel-refusal.js.map +1 -0
  216. package/dist/catalog/chat-pickers.cjs +60 -24
  217. package/dist/catalog/chat-pickers.cjs.map +1 -1
  218. package/dist/catalog/chat-pickers.d.ts +12 -2
  219. package/dist/catalog/chat-pickers.js +56 -20
  220. package/dist/catalog/chat-pickers.js.map +1 -1
  221. package/dist/catalog/runtime-catalog.cjs +89 -23
  222. package/dist/catalog/runtime-catalog.cjs.map +1 -1
  223. package/dist/catalog/runtime-catalog.d.ts +8 -2
  224. package/dist/catalog/runtime-catalog.js +83 -17
  225. package/dist/catalog/runtime-catalog.js.map +1 -1
  226. package/dist/catalog/use-athena-chat-mode.cjs +12 -12
  227. package/dist/catalog/use-athena-chat-mode.cjs.map +1 -1
  228. package/dist/chat/AthenaChat.cjs +155 -67
  229. package/dist/chat/AthenaChat.cjs.map +1 -1
  230. package/dist/chat/AthenaChat.d.ts +42 -2
  231. package/dist/chat/AthenaChat.js +106 -18
  232. package/dist/chat/AthenaChat.js.map +1 -1
  233. package/dist/chat/AthenaChatErrorBoundary.cjs +3 -3
  234. package/dist/chat/AthenaChatErrorBoundary.cjs.map +1 -1
  235. package/dist/chat/DrivingOnChip.cjs +23 -0
  236. package/dist/chat/DrivingOnChip.cjs.map +1 -0
  237. package/dist/chat/DrivingOnChip.d.ts +17 -0
  238. package/dist/chat/DrivingOnChip.js +23 -0
  239. package/dist/chat/DrivingOnChip.js.map +1 -0
  240. package/dist/chat/StatewireApprovalCard.cjs +166 -37
  241. package/dist/chat/StatewireApprovalCard.cjs.map +1 -1
  242. package/dist/chat/StatewireApprovalCard.d.ts +91 -2
  243. package/dist/chat/StatewireApprovalCard.js +156 -27
  244. package/dist/chat/StatewireApprovalCard.js.map +1 -1
  245. package/dist/chat/StatewireClientToolBridge.cjs +2 -2
  246. package/dist/chat/StatewireClientToolBridge.cjs.map +1 -1
  247. package/dist/chat/StatewireQueuedMessages.cjs +81 -69
  248. package/dist/chat/StatewireQueuedMessages.cjs.map +1 -1
  249. package/dist/chat/StatewireQueuedMessages.d.ts +25 -13
  250. package/dist/chat/StatewireQueuedMessages.js +73 -61
  251. package/dist/chat/StatewireQueuedMessages.js.map +1 -1
  252. package/dist/chat/WaitingOnYouBanner.cjs +9 -5
  253. package/dist/chat/WaitingOnYouBanner.cjs.map +1 -1
  254. package/dist/chat/WaitingOnYouBanner.js +7 -3
  255. package/dist/chat/WaitingOnYouBanner.js.map +1 -1
  256. package/dist/chat/athena-chat-welcome.cjs +2 -2
  257. package/dist/chat/athena-chat-welcome.cjs.map +1 -1
  258. package/dist/chat/athena-citation-links.cjs +5 -5
  259. package/dist/chat/athena-citation-links.cjs.map +1 -1
  260. package/dist/chat/athena-composer-controls.cjs +26 -16
  261. package/dist/chat/athena-composer-controls.cjs.map +1 -1
  262. package/dist/chat/athena-composer-controls.d.ts +6 -0
  263. package/dist/chat/athena-composer-controls.js +26 -16
  264. package/dist/chat/athena-composer-controls.js.map +1 -1
  265. package/dist/chat/athena-turn-end-status.cjs +42 -0
  266. package/dist/chat/athena-turn-end-status.cjs.map +1 -0
  267. package/dist/chat/athena-turn-end-status.d.ts +24 -0
  268. package/dist/chat/athena-turn-end-status.js +42 -0
  269. package/dist/chat/athena-turn-end-status.js.map +1 -0
  270. package/dist/chat/browser-decision-check.cjs +131 -0
  271. package/dist/chat/browser-decision-check.cjs.map +1 -0
  272. package/dist/chat/browser-decision-check.d.ts +61 -0
  273. package/dist/chat/browser-decision-check.js +131 -0
  274. package/dist/chat/browser-decision-check.js.map +1 -0
  275. package/dist/chat/chat-outbox-rows.cjs +3 -3
  276. package/dist/chat/chat-outbox-rows.cjs.map +1 -1
  277. package/dist/chat/chat-voice-controls.cjs +96 -29
  278. package/dist/chat/chat-voice-controls.cjs.map +1 -1
  279. package/dist/chat/chat-voice-controls.d.ts +42 -3
  280. package/dist/chat/chat-voice-controls.js +92 -25
  281. package/dist/chat/chat-voice-controls.js.map +1 -1
  282. package/dist/chat/composer-keyboard-hint.cjs +5 -5
  283. package/dist/chat/composer-keyboard-hint.cjs.map +1 -1
  284. package/dist/chat/device-operation.cjs +29 -0
  285. package/dist/chat/device-operation.cjs.map +1 -0
  286. package/dist/chat/device-operation.d.ts +34 -0
  287. package/dist/chat/device-operation.js +29 -0
  288. package/dist/chat/device-operation.js.map +1 -0
  289. package/dist/chat/super-grouping/CollapsibleGroup.cjs +14 -14
  290. package/dist/chat/super-grouping/CollapsibleGroup.cjs.map +1 -1
  291. package/dist/chat/super-grouping/GroupedMessageParts.cjs +4 -4
  292. package/dist/chat/super-grouping/GroupedMessageParts.cjs.map +1 -1
  293. package/dist/chat/super-grouping/SuperGroupingCard.cjs +52 -36
  294. package/dist/chat/super-grouping/SuperGroupingCard.cjs.map +1 -1
  295. package/dist/chat/super-grouping/SuperGroupingCard.d.ts +19 -4
  296. package/dist/chat/super-grouping/SuperGroupingCard.js +29 -13
  297. package/dist/chat/super-grouping/SuperGroupingCard.js.map +1 -1
  298. package/dist/chat/super-grouping/SuperGroupingTranscript.cjs +32 -32
  299. package/dist/chat/super-grouping/SuperGroupingTranscript.cjs.map +1 -1
  300. package/dist/chat/super-grouping/SuperGroupingTranscript.js +3 -3
  301. package/dist/chat/super-grouping/SuperGroupingTranscript.js.map +1 -1
  302. package/dist/chat/super-grouping/ToolTimeline.cjs +73 -40
  303. package/dist/chat/super-grouping/ToolTimeline.cjs.map +1 -1
  304. package/dist/chat/super-grouping/ToolTimeline.d.ts +10 -2
  305. package/dist/chat/super-grouping/ToolTimeline.js +69 -36
  306. package/dist/chat/super-grouping/ToolTimeline.js.map +1 -1
  307. package/dist/chat/super-grouping/activity-timeline.cjs +47 -12
  308. package/dist/chat/super-grouping/activity-timeline.cjs.map +1 -1
  309. package/dist/chat/super-grouping/activity-timeline.d.ts +21 -0
  310. package/dist/chat/super-grouping/activity-timeline.js +47 -12
  311. package/dist/chat/super-grouping/activity-timeline.js.map +1 -1
  312. package/dist/chat/super-grouping/grouping-function.cjs +4 -0
  313. package/dist/chat/super-grouping/grouping-function.cjs.map +1 -1
  314. package/dist/chat/super-grouping/grouping-function.d.ts +7 -0
  315. package/dist/chat/super-grouping/grouping-function.js +5 -1
  316. package/dist/chat/super-grouping/grouping-function.js.map +1 -1
  317. package/dist/chat/super-grouping/index.cjs +6 -0
  318. package/dist/chat/super-grouping/index.cjs.map +1 -1
  319. package/dist/chat/super-grouping/index.d.ts +5 -2
  320. package/dist/chat/super-grouping/index.js +7 -1
  321. package/dist/chat/super-grouping/index.js.map +1 -1
  322. package/dist/chat/super-grouping/tool-part-placement.cjs +17 -0
  323. package/dist/chat/super-grouping/tool-part-placement.cjs.map +1 -0
  324. package/dist/chat/super-grouping/tool-part-placement.d.ts +22 -0
  325. package/dist/chat/super-grouping/tool-part-placement.js +17 -0
  326. package/dist/chat/super-grouping/tool-part-placement.js.map +1 -0
  327. package/dist/chat/thread-scroll-to-bottom.cjs +2 -2
  328. package/dist/chat/thread-scroll-to-bottom.cjs.map +1 -1
  329. package/dist/chat/thread-scroll-to-bottom.d.ts +10 -7
  330. package/dist/chat/thread-scroll-to-bottom.js +2 -2
  331. package/dist/chat/thread-scroll-to-bottom.js.map +1 -1
  332. package/dist/chat/tooltip-icon-button.cjs +2 -2
  333. package/dist/chat/tooltip-icon-button.cjs.map +1 -1
  334. package/dist/chat/use-athena-voice-live.cjs +11 -0
  335. package/dist/chat/use-athena-voice-live.cjs.map +1 -0
  336. package/dist/chat/use-athena-voice-live.d.ts +11 -0
  337. package/dist/chat/use-athena-voice-live.js +11 -0
  338. package/dist/chat/use-athena-voice-live.js.map +1 -0
  339. package/dist/chat/use-statewire-approval-request.cjs +56 -24
  340. package/dist/chat/use-statewire-approval-request.cjs.map +1 -1
  341. package/dist/chat/use-statewire-approval-request.d.ts +33 -4
  342. package/dist/chat/use-statewire-approval-request.js +41 -9
  343. package/dist/chat/use-statewire-approval-request.js.map +1 -1
  344. package/dist/chat-ui/auth/sign-in-card.cjs +2 -2
  345. package/dist/chat-ui/auth/sign-in-card.cjs.map +1 -1
  346. package/dist/chat-ui/composer/tiptap-composer.cjs +138 -107
  347. package/dist/chat-ui/composer/tiptap-composer.cjs.map +1 -1
  348. package/dist/chat-ui/composer/tiptap-composer.d.ts +20 -4
  349. package/dist/chat-ui/composer/tiptap-composer.js +85 -54
  350. package/dist/chat-ui/composer/tiptap-composer.js.map +1 -1
  351. package/dist/chat-ui/header/conversation-history-panel.cjs +49 -23
  352. package/dist/chat-ui/header/conversation-history-panel.cjs.map +1 -1
  353. package/dist/chat-ui/header/conversation-history-panel.d.ts +12 -1
  354. package/dist/chat-ui/header/conversation-history-panel.js +38 -12
  355. package/dist/chat-ui/header/conversation-history-panel.js.map +1 -1
  356. package/dist/chat-ui/index.cjs +21 -0
  357. package/dist/chat-ui/index.cjs.map +1 -1
  358. package/dist/chat-ui/index.d.ts +8 -1
  359. package/dist/chat-ui/index.js +21 -0
  360. package/dist/chat-ui/index.js.map +1 -1
  361. package/dist/chat-ui/mentions/mention-chip.cjs +4 -4
  362. package/dist/chat-ui/mentions/mention-chip.cjs.map +1 -1
  363. package/dist/chat-ui/mentions/suggestions/components/mention-suggestion-list.cjs +10 -9
  364. package/dist/chat-ui/mentions/suggestions/components/mention-suggestion-list.cjs.map +1 -1
  365. package/dist/chat-ui/mentions/suggestions/components/mention-suggestion-list.js +3 -2
  366. package/dist/chat-ui/mentions/suggestions/components/mention-suggestion-list.js.map +1 -1
  367. package/dist/chat-ui/mentions/suggestions/components/mention-suggestion-popup.cjs +2 -2
  368. package/dist/chat-ui/mentions/suggestions/components/mention-suggestion-popup.cjs.map +1 -1
  369. package/dist/chat-ui/mentions/suggestions/components/menu-list.cjs +29 -6
  370. package/dist/chat-ui/mentions/suggestions/components/menu-list.cjs.map +1 -1
  371. package/dist/chat-ui/mentions/suggestions/components/menu-list.d.ts +7 -1
  372. package/dist/chat-ui/mentions/suggestions/components/menu-list.js +25 -2
  373. package/dist/chat-ui/mentions/suggestions/components/menu-list.js.map +1 -1
  374. package/dist/chat-ui/mentions/suggestions/components/use-keyboard-navigation.cjs +2 -2
  375. package/dist/chat-ui/mentions/suggestions/components/use-keyboard-navigation.cjs.map +1 -1
  376. package/dist/chat-ui/mentions/suggestions/components/use-menu-navigation.cjs +2 -2
  377. package/dist/chat-ui/mentions/suggestions/components/use-menu-navigation.cjs.map +1 -1
  378. package/dist/chat-ui/mentions/suggestions/data/api-client.cjs +3 -3
  379. package/dist/chat-ui/mentions/suggestions/data/api-client.cjs.map +1 -1
  380. package/dist/chat-ui/mentions/suggestions/data/orchestrator.cjs +56 -2
  381. package/dist/chat-ui/mentions/suggestions/data/orchestrator.cjs.map +1 -1
  382. package/dist/chat-ui/mentions/suggestions/data/orchestrator.d.ts +12 -0
  383. package/dist/chat-ui/mentions/suggestions/data/orchestrator.js +56 -2
  384. package/dist/chat-ui/mentions/suggestions/data/orchestrator.js.map +1 -1
  385. package/dist/chat-ui/mentions/suggestions/data/sources/index.cjs +24 -3
  386. package/dist/chat-ui/mentions/suggestions/data/sources/index.cjs.map +1 -1
  387. package/dist/chat-ui/mentions/suggestions/data/sources/index.d.ts +7 -0
  388. package/dist/chat-ui/mentions/suggestions/data/sources/index.js +24 -3
  389. package/dist/chat-ui/mentions/suggestions/data/sources/index.js.map +1 -1
  390. package/dist/chat-ui/mentions/suggestions/data/use-mention-suggestions.cjs +35 -13
  391. package/dist/chat-ui/mentions/suggestions/data/use-mention-suggestions.cjs.map +1 -1
  392. package/dist/chat-ui/mentions/suggestions/data/use-mention-suggestions.d.ts +15 -1
  393. package/dist/chat-ui/mentions/suggestions/data/use-mention-suggestions.js +28 -6
  394. package/dist/chat-ui/mentions/suggestions/data/use-mention-suggestions.js.map +1 -1
  395. package/dist/chat-ui/mentions/suggestions/data/use-menu-items.cjs +9 -6
  396. package/dist/chat-ui/mentions/suggestions/data/use-menu-items.cjs.map +1 -1
  397. package/dist/chat-ui/mentions/suggestions/data/use-menu-items.d.ts +3 -0
  398. package/dist/chat-ui/mentions/suggestions/data/use-menu-items.js +5 -2
  399. package/dist/chat-ui/mentions/suggestions/data/use-menu-items.js.map +1 -1
  400. package/dist/chat-ui/mentions/use-account-workspace-id.cjs +45 -10
  401. package/dist/chat-ui/mentions/use-account-workspace-id.cjs.map +1 -1
  402. package/dist/chat-ui/mentions/use-account-workspace-id.d.ts +24 -1
  403. package/dist/chat-ui/mentions/use-account-workspace-id.js +46 -11
  404. package/dist/chat-ui/mentions/use-account-workspace-id.js.map +1 -1
  405. package/dist/chat-ui/mentions/use-member-avatar.cjs +4 -4
  406. package/dist/chat-ui/mentions/use-member-avatar.cjs.map +1 -1
  407. package/dist/chat-ui/mentions/use-mention-asset.cjs +3 -3
  408. package/dist/chat-ui/mentions/use-mention-asset.cjs.map +1 -1
  409. package/dist/chat-ui/messages/answer-label.cjs +42 -0
  410. package/dist/chat-ui/messages/answer-label.cjs.map +1 -0
  411. package/dist/chat-ui/messages/answer-label.d.ts +33 -0
  412. package/dist/chat-ui/messages/answer-label.js +42 -0
  413. package/dist/chat-ui/messages/answer-label.js.map +1 -0
  414. package/dist/chat-ui/messages/arrival-animation.cjs +13 -0
  415. package/dist/chat-ui/messages/arrival-animation.cjs.map +1 -0
  416. package/dist/chat-ui/messages/arrival-animation.d.ts +14 -0
  417. package/dist/chat-ui/messages/arrival-animation.js +13 -0
  418. package/dist/chat-ui/messages/arrival-animation.js.map +1 -0
  419. package/dist/chat-ui/messages/continue-pill.cjs +5 -5
  420. package/dist/chat-ui/messages/continue-pill.cjs.map +1 -1
  421. package/dist/chat-ui/messages/from-the-call-card.cjs +124 -0
  422. package/dist/chat-ui/messages/from-the-call-card.cjs.map +1 -0
  423. package/dist/chat-ui/messages/from-the-call-card.d.ts +17 -0
  424. package/dist/chat-ui/messages/from-the-call-card.js +124 -0
  425. package/dist/chat-ui/messages/from-the-call-card.js.map +1 -0
  426. package/dist/chat-ui/messages/handoff-arrival-divider.cjs +44 -0
  427. package/dist/chat-ui/messages/handoff-arrival-divider.cjs.map +1 -0
  428. package/dist/chat-ui/messages/handoff-arrival-divider.d.ts +17 -0
  429. package/dist/chat-ui/messages/handoff-arrival-divider.js +44 -0
  430. package/dist/chat-ui/messages/handoff-arrival-divider.js.map +1 -0
  431. package/dist/chat-ui/messages/message-actions-config.cjs +3 -3
  432. package/dist/chat-ui/messages/message-actions-config.cjs.map +1 -1
  433. package/dist/chat-ui/messages/message-components.cjs +8 -4
  434. package/dist/chat-ui/messages/message-components.cjs.map +1 -1
  435. package/dist/chat-ui/messages/message-components.js +5 -1
  436. package/dist/chat-ui/messages/message-components.js.map +1 -1
  437. package/dist/chat-ui/messages/message-images.cjs +66 -0
  438. package/dist/chat-ui/messages/message-images.cjs.map +1 -0
  439. package/dist/chat-ui/messages/message-images.d.ts +16 -0
  440. package/dist/chat-ui/messages/message-images.js +66 -0
  441. package/dist/chat-ui/messages/message-images.js.map +1 -0
  442. package/dist/chat-ui/messages/user-edit-composer.cjs +2 -2
  443. package/dist/chat-ui/messages/user-edit-composer.cjs.map +1 -1
  444. package/dist/chat-ui/messages/wake-marker.cjs +3 -3
  445. package/dist/chat-ui/messages/wake-marker.cjs.map +1 -1
  446. package/dist/chat-ui/rich-text/chat-link.cjs +3 -2
  447. package/dist/chat-ui/rich-text/chat-link.cjs.map +1 -1
  448. package/dist/chat-ui/rich-text/chat-link.d.ts +4 -0
  449. package/dist/chat-ui/rich-text/chat-link.js +4 -3
  450. package/dist/chat-ui/rich-text/chat-link.js.map +1 -1
  451. package/dist/chat-ui/rich-text/chat-message-body.cjs +9 -8
  452. package/dist/chat-ui/rich-text/chat-message-body.cjs.map +1 -1
  453. package/dist/chat-ui/rich-text/chat-message-body.d.ts +12 -0
  454. package/dist/chat-ui/rich-text/chat-message-body.js +2 -1
  455. package/dist/chat-ui/rich-text/chat-message-body.js.map +1 -1
  456. package/dist/chat-ui/rich-text/chat-node-views.cjs +6 -6
  457. package/dist/chat-ui/rich-text/chat-node-views.cjs.map +1 -1
  458. package/dist/chat-ui/rich-text/dom-output-spec.cjs +2 -2
  459. package/dist/chat-ui/rich-text/dom-output-spec.cjs.map +1 -1
  460. package/dist/chat-ui/statewire.cjs +3 -0
  461. package/dist/chat-ui/statewire.cjs.map +1 -1
  462. package/dist/chat-ui/statewire.d.ts +2 -1
  463. package/dist/chat-ui/statewire.js +3 -0
  464. package/dist/chat-ui/statewire.js.map +1 -1
  465. package/dist/chat-ui/thread/chat-thread-shell.cjs +45 -14
  466. package/dist/chat-ui/thread/chat-thread-shell.cjs.map +1 -1
  467. package/dist/chat-ui/thread/chat-thread-shell.d.ts +16 -2
  468. package/dist/chat-ui/thread/chat-thread-shell.js +37 -6
  469. package/dist/chat-ui/thread/chat-thread-shell.js.map +1 -1
  470. package/dist/chat-ui/thread/composer-send-or-stop.cjs +30 -20
  471. package/dist/chat-ui/thread/composer-send-or-stop.cjs.map +1 -1
  472. package/dist/chat-ui/thread/composer-send-or-stop.d.ts +8 -0
  473. package/dist/chat-ui/thread/composer-send-or-stop.js +29 -19
  474. package/dist/chat-ui/thread/composer-send-or-stop.js.map +1 -1
  475. package/dist/chat-ui/thread/statewire-history-edge.cjs +20 -21
  476. package/dist/chat-ui/thread/statewire-history-edge.cjs.map +1 -1
  477. package/dist/chat-ui/thread/statewire-history-edge.js +3 -4
  478. package/dist/chat-ui/thread/statewire-history-edge.js.map +1 -1
  479. package/dist/chat-ui/thread/thread-loading-overlay.cjs +5 -5
  480. package/dist/chat-ui/thread/thread-loading-overlay.cjs.map +1 -1
  481. package/dist/collab/client.cjs +52 -3
  482. package/dist/collab/client.cjs.map +1 -1
  483. package/dist/collab/client.d.ts +27 -0
  484. package/dist/collab/client.js +52 -3
  485. package/dist/collab/client.js.map +1 -1
  486. package/dist/collab/document-status.cjs +150 -0
  487. package/dist/collab/document-status.cjs.map +1 -0
  488. package/dist/collab/document-status.d.ts +68 -0
  489. package/dist/collab/document-status.js +150 -0
  490. package/dist/collab/document-status.js.map +1 -0
  491. package/dist/collab/index.cjs +7 -0
  492. package/dist/collab/index.cjs.map +1 -1
  493. package/dist/collab/index.d.ts +6 -1
  494. package/dist/collab/index.js +7 -0
  495. package/dist/collab/index.js.map +1 -1
  496. package/dist/collab/presence-react.cjs +11 -11
  497. package/dist/collab/presence-react.cjs.map +1 -1
  498. package/dist/collab/react.cjs +6 -6
  499. package/dist/collab/react.cjs.map +1 -1
  500. package/dist/composer/AttachmentContext.cjs +24 -11
  501. package/dist/composer/AttachmentContext.cjs.map +1 -1
  502. package/dist/composer/AttachmentContext.js +18 -5
  503. package/dist/composer/AttachmentContext.js.map +1 -1
  504. package/dist/composer/ComposerAttachmentPreview.cjs +78 -23
  505. package/dist/composer/ComposerAttachmentPreview.cjs.map +1 -1
  506. package/dist/composer/ComposerAttachmentPreview.d.ts +5 -3
  507. package/dist/composer/ComposerAttachmentPreview.js +79 -24
  508. package/dist/composer/ComposerAttachmentPreview.js.map +1 -1
  509. package/dist/composer/ComposerDropZone.cjs +7 -7
  510. package/dist/composer/ComposerDropZone.cjs.map +1 -1
  511. package/dist/composer/FileUploadButton.cjs +37 -22
  512. package/dist/composer/FileUploadButton.cjs.map +1 -1
  513. package/dist/composer/FileUploadButton.d.ts +6 -0
  514. package/dist/composer/FileUploadButton.js +34 -19
  515. package/dist/composer/FileUploadButton.js.map +1 -1
  516. package/dist/composer/QuoteContext.cjs +8 -8
  517. package/dist/composer/QuoteContext.cjs.map +1 -1
  518. package/dist/composer/composer-handoff.cjs +4 -4
  519. package/dist/composer/composer-handoff.cjs.map +1 -1
  520. package/dist/composer/index.d.ts +1 -1
  521. package/dist/composer/useAppendToComposer.cjs +4 -4
  522. package/dist/composer/useAppendToComposer.cjs.map +1 -1
  523. package/dist/composer/useAttachFiles.cjs +23 -6
  524. package/dist/composer/useAttachFiles.cjs.map +1 -1
  525. package/dist/composer/useAttachFiles.d.ts +15 -7
  526. package/dist/composer/useAttachFiles.js +22 -5
  527. package/dist/composer/useAttachFiles.js.map +1 -1
  528. package/dist/composer/useComposerAttachment.cjs +4 -4
  529. package/dist/composer/useComposerAttachment.cjs.map +1 -1
  530. package/dist/composer/useFileUpload.cjs +21 -16
  531. package/dist/composer/useFileUpload.cjs.map +1 -1
  532. package/dist/composer/useFileUpload.d.ts +12 -0
  533. package/dist/composer/useFileUpload.js +12 -7
  534. package/dist/composer/useFileUpload.js.map +1 -1
  535. package/dist/composer/useReadComposerDraft.cjs +27 -8
  536. package/dist/composer/useReadComposerDraft.cjs.map +1 -1
  537. package/dist/composer/useReadComposerDraft.d.ts +23 -1
  538. package/dist/composer/useReadComposerDraft.js +27 -8
  539. package/dist/composer/useReadComposerDraft.js.map +1 -1
  540. package/dist/composer/useSendMessage.cjs +4 -4
  541. package/dist/composer/useSendMessage.cjs.map +1 -1
  542. package/dist/diagnostics/useAthenaDiagnostics.cjs +4 -4
  543. package/dist/diagnostics/useAthenaDiagnostics.cjs.map +1 -1
  544. package/dist/dictation/audio-level-history.cjs +3 -3
  545. package/dist/dictation/audio-level-history.cjs.map +1 -1
  546. package/dist/dictation/dictation-controls.cjs +24 -20
  547. package/dist/dictation/dictation-controls.cjs.map +1 -1
  548. package/dist/dictation/dictation-controls.d.ts +6 -1
  549. package/dist/dictation/dictation-controls.js +24 -20
  550. package/dist/dictation/dictation-controls.js.map +1 -1
  551. package/dist/dictation/use-athena-dictation-engine.cjs +3 -3
  552. package/dist/dictation/use-athena-dictation-engine.cjs.map +1 -1
  553. package/dist/dictation/use-dictation.cjs +22 -22
  554. package/dist/dictation/use-dictation.cjs.map +1 -1
  555. package/dist/index.cjs +29 -2
  556. package/dist/index.cjs.map +1 -1
  557. package/dist/index.d.ts +18 -4
  558. package/dist/index.js +30 -3
  559. package/dist/index.js.map +1 -1
  560. package/dist/keryx-http/src/receive-only-socket.cjs +40 -0
  561. package/dist/keryx-http/src/receive-only-socket.cjs.map +1 -0
  562. package/dist/keryx-http/src/receive-only-socket.d.ts +27 -0
  563. package/dist/keryx-http/src/receive-only-socket.js +40 -0
  564. package/dist/keryx-http/src/receive-only-socket.js.map +1 -0
  565. package/dist/keryx-http/src/unconfirmed-update-attributions.cjs +190 -0
  566. package/dist/keryx-http/src/unconfirmed-update-attributions.cjs.map +1 -0
  567. package/dist/keryx-http/src/unconfirmed-update-attributions.d.ts +132 -0
  568. package/dist/keryx-http/src/unconfirmed-update-attributions.js +190 -0
  569. package/dist/keryx-http/src/unconfirmed-update-attributions.js.map +1 -0
  570. package/dist/keryx-http/src/update-attributions.cjs +141 -0
  571. package/dist/keryx-http/src/update-attributions.cjs.map +1 -0
  572. package/dist/keryx-http/src/update-attributions.d.ts +107 -0
  573. package/dist/keryx-http/src/update-attributions.js +141 -0
  574. package/dist/keryx-http/src/update-attributions.js.map +1 -0
  575. package/dist/lib/owner-document.cjs +6 -6
  576. package/dist/lib/owner-document.cjs.map +1 -1
  577. package/dist/lib/use-athena-rest-query.cjs +4 -4
  578. package/dist/lib/use-athena-rest-query.cjs.map +1 -1
  579. package/dist/lib/use-document-active.cjs +4 -4
  580. package/dist/lib/use-document-active.cjs.map +1 -1
  581. package/dist/lib/use-prefers-reduced-motion.cjs +2 -2
  582. package/dist/lib/use-prefers-reduced-motion.cjs.map +1 -1
  583. package/dist/offline/offline-history.cjs +7 -7
  584. package/dist/offline/offline-history.cjs.map +1 -1
  585. package/dist/provider/AthenaContext.cjs +3 -3
  586. package/dist/provider/AthenaContext.cjs.map +1 -1
  587. package/dist/provider/AthenaProvider.cjs +120 -79
  588. package/dist/provider/AthenaProvider.cjs.map +1 -1
  589. package/dist/provider/AthenaProvider.d.ts +11 -1
  590. package/dist/provider/AthenaProvider.js +44 -3
  591. package/dist/provider/AthenaProvider.js.map +1 -1
  592. package/dist/provider/PostHogProvider.cjs +2 -2
  593. package/dist/provider/PostHogProvider.cjs.map +1 -1
  594. package/dist/provider/agent-selection-context.cjs +2 -2
  595. package/dist/provider/agent-selection-context.cjs.map +1 -1
  596. package/dist/provider/chat-mode-context.cjs +2 -2
  597. package/dist/provider/chat-mode-context.cjs.map +1 -1
  598. package/dist/provider/session-persistence-context.cjs +10 -0
  599. package/dist/provider/session-persistence-context.cjs.map +1 -0
  600. package/dist/provider/session-persistence-context.d.ts +15 -0
  601. package/dist/provider/session-persistence-context.js +10 -0
  602. package/dist/provider/session-persistence-context.js.map +1 -0
  603. package/dist/provider/statewire-history-context.cjs +4 -4
  604. package/dist/provider/statewire-history-context.cjs.map +1 -1
  605. package/dist/provider/statewire-lifecycle-context.cjs +3 -3
  606. package/dist/provider/statewire-lifecycle-context.cjs.map +1 -1
  607. package/dist/provider/statewire-window-context.cjs +3 -3
  608. package/dist/provider/statewire-window-context.cjs.map +1 -1
  609. package/dist/provider/theme-style-context.cjs +3 -3
  610. package/dist/provider/theme-style-context.cjs.map +1 -1
  611. package/dist/react/package.json.cjs +1 -1
  612. package/dist/react/package.json.js +1 -1
  613. package/dist/runtime/StatewireThreadConfigLaneSync.cjs +10 -10
  614. package/dist/runtime/StatewireThreadConfigLaneSync.cjs.map +1 -1
  615. package/dist/runtime/auth-refusal-restart.cjs +7 -7
  616. package/dist/runtime/auth-refusal-restart.cjs.map +1 -1
  617. package/dist/runtime/auth.cjs +13 -13
  618. package/dist/runtime/auth.cjs.map +1 -1
  619. package/dist/runtime/statewire-lifecycle.cjs +1 -0
  620. package/dist/runtime/statewire-lifecycle.cjs.map +1 -1
  621. package/dist/runtime/statewire-lifecycle.d.ts +3 -1
  622. package/dist/runtime/statewire-lifecycle.js +2 -1
  623. package/dist/runtime/statewire-lifecycle.js.map +1 -1
  624. package/dist/runtime/statewire-server-lane-context.cjs +2 -2
  625. package/dist/runtime/statewire-server-lane-context.cjs.map +1 -1
  626. package/dist/runtime/statewire-session-lane.cjs +4 -4
  627. package/dist/runtime/statewire-session-lane.cjs.map +1 -1
  628. package/dist/runtime/useAthenaStatewireRuntime.cjs +10 -8
  629. package/dist/runtime/useAthenaStatewireRuntime.cjs.map +1 -1
  630. package/dist/runtime/useAthenaStatewireRuntime.d.ts +2 -0
  631. package/dist/runtime/useAthenaStatewireRuntime.js +2 -0
  632. package/dist/runtime/useAthenaStatewireRuntime.js.map +1 -1
  633. package/dist/styles.css +1 -1
  634. package/dist/threads/Inbox.cjs +8 -8
  635. package/dist/threads/Inbox.cjs.map +1 -1
  636. package/dist/threads/SessionList.cjs +9 -9
  637. package/dist/threads/SessionList.cjs.map +1 -1
  638. package/dist/threads/SessionsPage.cjs +11 -11
  639. package/dist/threads/SessionsPage.cjs.map +1 -1
  640. package/dist/threads/api.cjs.map +1 -1
  641. package/dist/threads/api.d.ts +15 -0
  642. package/dist/threads/api.js.map +1 -1
  643. package/dist/threads/conversation-list-fetcher.cjs +13 -5
  644. package/dist/threads/conversation-list-fetcher.cjs.map +1 -1
  645. package/dist/threads/conversation-list-fetcher.d.ts +4 -1
  646. package/dist/threads/conversation-list-fetcher.js +13 -5
  647. package/dist/threads/conversation-list-fetcher.js.map +1 -1
  648. package/dist/threads/index-triggered-refresh.cjs +10 -10
  649. package/dist/threads/index-triggered-refresh.cjs.map +1 -1
  650. package/dist/threads/mark-viewed-thread-read.cjs +12 -12
  651. package/dist/threads/mark-viewed-thread-read.cjs.map +1 -1
  652. package/dist/threads/offline-session-list.cjs +3 -3
  653. package/dist/threads/offline-session-list.cjs.map +1 -1
  654. package/dist/threads/session-list-tab-share.cjs +5 -5
  655. package/dist/threads/session-list-tab-share.cjs.map +1 -1
  656. package/dist/threads/statewire-thread-list.cjs +79 -57
  657. package/dist/threads/statewire-thread-list.cjs.map +1 -1
  658. package/dist/threads/statewire-thread-list.d.ts +20 -8
  659. package/dist/threads/statewire-thread-list.js +28 -6
  660. package/dist/threads/statewire-thread-list.js.map +1 -1
  661. package/dist/threads/thread-id-context.cjs +5 -5
  662. package/dist/threads/thread-id-context.cjs.map +1 -1
  663. package/dist/threads/use-athena-session-attention.cjs +2 -2
  664. package/dist/threads/use-athena-session-attention.cjs.map +1 -1
  665. package/dist/threads/use-athena-sessions.cjs +37 -15
  666. package/dist/threads/use-athena-sessions.cjs.map +1 -1
  667. package/dist/threads/use-athena-sessions.d.ts +10 -5
  668. package/dist/threads/use-athena-sessions.js +28 -6
  669. package/dist/threads/use-athena-sessions.js.map +1 -1
  670. package/dist/threads/use-athena-thread-model.cjs +3 -3
  671. package/dist/threads/use-athena-thread-model.cjs.map +1 -1
  672. package/dist/threads/use-rest-conversation-history.cjs +3 -3
  673. package/dist/threads/use-rest-conversation-history.cjs.map +1 -1
  674. package/dist/threads/use-rest-conversation-history.d.ts +1 -0
  675. package/dist/threads/use-statewire-conversation-history.cjs +8 -8
  676. package/dist/threads/use-statewire-conversation-history.cjs.map +1 -1
  677. package/dist/threads/use-thread-archive.cjs +9 -9
  678. package/dist/threads/use-thread-archive.cjs.map +1 -1
  679. package/dist/threads/use-thread-favorite.cjs +2 -2
  680. package/dist/threads/use-thread-favorite.cjs.map +1 -1
  681. package/dist/threads/use-thread-field-override.cjs +20 -20
  682. package/dist/threads/use-thread-field-override.cjs.map +1 -1
  683. package/dist/threads/use-thread-read-state.cjs +4 -4
  684. package/dist/threads/use-thread-read-state.cjs.map +1 -1
  685. package/dist/threads/use-thread-rename.cjs +2 -2
  686. package/dist/threads/use-thread-rename.cjs.map +1 -1
  687. package/dist/threads/useAthenaThreadManager.cjs +2 -2
  688. package/dist/threads/useAthenaThreadManager.cjs.map +1 -1
  689. package/dist/tools/NestedPtcMessages.cjs +6 -6
  690. package/dist/tools/NestedPtcMessages.cjs.map +1 -1
  691. package/dist/tools/append-document-tool-ui.cjs +7 -7
  692. package/dist/tools/append-document-tool-ui.cjs.map +1 -1
  693. package/dist/tools/file-tool-uis.cjs +2 -2
  694. package/dist/tools/file-tool-uis.cjs.map +1 -1
  695. package/dist/tools/misc-tool-uis.cjs +2 -2
  696. package/dist/tools/misc-tool-uis.cjs.map +1 -1
  697. package/dist/tools/primitives.cjs +6 -6
  698. package/dist/tools/primitives.cjs.map +1 -1
  699. package/dist/tools/read-asset-tool-ui.cjs +6 -6
  700. package/dist/tools/read-asset-tool-ui.cjs.map +1 -1
  701. package/dist/tools/subagent-task-tool-ui.cjs +21 -21
  702. package/dist/tools/subagent-task-tool-ui.cjs.map +1 -1
  703. package/dist/tools/test-recording-tool-uis.cjs +16 -16
  704. package/dist/tools/test-recording-tool-uis.cjs.map +1 -1
  705. package/dist/tools/todo-plan-store.cjs +4 -4
  706. package/dist/tools/todo-plan-store.cjs.map +1 -1
  707. package/dist/tools/tool-appearance.cjs +3 -3
  708. package/dist/tools/tool-appearance.cjs.map +1 -1
  709. package/dist/tools/tool-fallback.cjs +14 -14
  710. package/dist/tools/tool-fallback.cjs.map +1 -1
  711. package/dist/tools/tool-uis.cjs +74 -74
  712. package/dist/tools/tool-uis.cjs.map +1 -1
  713. package/dist/tools/use-elapsed-seconds.cjs +3 -3
  714. package/dist/tools/use-elapsed-seconds.cjs.map +1 -1
  715. package/dist/tools/write-todos-tool-ui.cjs +9 -9
  716. package/dist/tools/write-todos-tool-ui.cjs.map +1 -1
  717. package/dist/ui/image-viewer.cjs +382 -0
  718. package/dist/ui/image-viewer.cjs.map +1 -0
  719. package/dist/ui/image-viewer.d.ts +50 -0
  720. package/dist/ui/image-viewer.js +382 -0
  721. package/dist/ui/image-viewer.js.map +1 -0
  722. package/dist/voice/chat.cjs +6 -0
  723. package/dist/voice/chat.cjs.map +1 -1
  724. package/dist/voice/chat.d.ts +1 -1
  725. package/dist/voice/chat.js +8 -2
  726. package/dist/voice/livekit-join.cjs +52 -101
  727. package/dist/voice/livekit-join.cjs.map +1 -1
  728. package/dist/voice/livekit-join.d.ts +1 -6
  729. package/dist/voice/livekit-join.js +52 -101
  730. package/dist/voice/livekit-join.js.map +1 -1
  731. package/dist/voice/livekit.cjs.map +1 -1
  732. package/dist/voice/livekit.d.ts +11 -1
  733. package/dist/voice/livekit.js.map +1 -1
  734. package/dist/voice/use-athena-voice-session.cjs +34 -34
  735. package/dist/voice/use-athena-voice-session.cjs.map +1 -1
  736. package/dist/workbench/ComputerLiveDesktop.cjs +13 -13
  737. package/dist/workbench/ComputerLiveDesktop.cjs.map +1 -1
  738. package/dist/workbench/SessionWorkbench.cjs +22 -22
  739. package/dist/workbench/SessionWorkbench.cjs.map +1 -1
  740. package/dist/workbench/session-workbench-context.cjs +3 -3
  741. package/dist/workbench/session-workbench-context.cjs.map +1 -1
  742. package/dist/workbench/session-workbench-panes.cjs +8 -8
  743. package/dist/workbench/session-workbench-panes.cjs.map +1 -1
  744. package/dist/workbench/workbench-layout-context.cjs +3 -3
  745. package/dist/workbench/workbench-layout-context.cjs.map +1 -1
  746. package/package.json +2 -1
@@ -38,6 +38,23 @@ function readRunStartRefusal(error) {
38
38
  status: typeof status === "number" ? status : null
39
39
  };
40
40
  }
41
+ const VOICE_REJECTION_REASONS = /* @__PURE__ */ new Set([
42
+ "no-voice",
43
+ "not-voice-owner",
44
+ "voice-active",
45
+ "voice-stale-session",
46
+ "voice-unavailable",
47
+ "voice-not-enabled",
48
+ "voice-model-transport",
49
+ "text-too-long"
50
+ ]);
51
+ function isVoiceCommandRejection(error) {
52
+ var _a;
53
+ const failure = error == null ? void 0 : error.failure;
54
+ if ((failure == null ? void 0 : failure.fate) !== "rejected") return false;
55
+ const reason = (_a = failure.payload) == null ? void 0 : _a.reason;
56
+ return typeof reason === "string" && VOICE_REJECTION_REASONS.has(reason);
57
+ }
41
58
  function statewireRejectionCode(error) {
42
59
  var _a;
43
60
  const detail = (_a = statewireRejectionPayload(error)) == null ? void 0 : _a.detail;
@@ -133,6 +150,7 @@ exports.isConversationArchivedRejection = isConversationArchivedRejection;
133
150
  exports.isLegacyThreadReadOnlyRejection = isLegacyThreadReadOnlyRejection;
134
151
  exports.isStatewireChannelTeardown = isStatewireChannelTeardown;
135
152
  exports.isStatewireExpiredVerdict = isStatewireExpiredVerdict;
153
+ exports.isVoiceCommandRejection = isVoiceCommandRejection;
136
154
  exports.projectDeepAgentConnection = projectDeepAgentConnection;
137
155
  exports.readRetryableCommandRejection = readRetryableCommandRejection;
138
156
  exports.readRetryableRunRefusal = readRetryableRunRefusal;
@@ -1 +1 @@
1
- {"version":3,"file":"errors.cjs","sources":["../../../../agent-runtime/src/errors.ts"],"sourcesContent":["import type { StatewireClient } from 'statewire';\nimport type { DeepAgentConnectionState } from './types';\n\n/** Structured payload attached to a server-rejected Statewire command. */\nexport interface StatewireRejectionPayload {\n status: number;\n detail: unknown;\n}\n\n/** Return a rejected command's structured `{ status, detail }` payload. */\nexport function statewireRejectionPayload(error: unknown): StatewireRejectionPayload | null {\n const failure = (error as { failure?: { fate?: unknown; payload?: unknown } } | null)?.failure;\n if (failure?.fate !== 'rejected') return null;\n\n const payload = failure.payload as { status?: unknown; detail?: unknown } | undefined;\n if (typeof payload?.status !== 'number') return null;\n return { status: payload.status, detail: payload.detail };\n}\n\n/**\n * The server's human-readable reason for a rejected command — `detail.message`\n * (or a plain-string `detail`) — else `null`. Hosts surface it as send\n * feedback so the user sees the actionable cause instead of the generic\n * client-side `command rejected (<status>)`.\n */\nexport function statewireRejectionDetailMessage(error: unknown): string | null {\n const detail = statewireRejectionPayload(error)?.detail;\n if (typeof detail === 'string') return detail.length > 0 ? detail : null;\n if (detail === null || typeof detail !== 'object' || Array.isArray(detail)) return null;\n const message = (detail as { message?: unknown }).message;\n return typeof message === 'string' && message.length > 0 ? message : null;\n}\n\n/**\n * A structured, retryable refusal the host recorded as the run error\n * (`runs.error`): the dispatch never started — the pod or instance was\n * closing (`pod_draining`) — and the entries stayed in their lanes for the\n * thread's next placement. Distinct from a rejected COMMAND\n * ({@link statewireRejectionPayload}): this is the shape harness-sdk writes\n * when the run executor raises the rejection, so it lives on the replicated\n * run entry, not on a command settle.\n */\nexport interface RetryableRunRefusal {\n /** The structured `detail.code` (`pod_draining`). */\n code: string;\n /** The server's human-readable reason, when it sent one. */\n message: string | null;\n}\n\n/** The `{ code, message, retryable: true }` detail of a structured refusal, or `null`. */\nfunction readRetryableDetail(detail: unknown): { code: string; message: string | null } | null {\n if (detail === null || typeof detail !== 'object' || Array.isArray(detail)) return null;\n const { code, message, retryable } = detail as {\n code?: unknown;\n message?: unknown;\n retryable?: unknown;\n };\n if (retryable !== true || typeof code !== 'string' || code.length === 0) return null;\n return { code, message: typeof message === 'string' && message.length > 0 ? message : null };\n}\n\nexport function readRetryableRunRefusal(error: unknown): RetryableRunRefusal | null {\n if (error === null || typeof error !== 'object' || Array.isArray(error)) return null;\n return readRetryableDetail((error as { detail?: unknown }).detail);\n}\n\n/**\n * The `detail.code` agora answers when a send names another channel of the\n * collab agent a session started on (`collab_agent_bridge.py`): a session\n * keeps its channel — the SDK app's Agent / Ask mode — for its lifetime, and\n * the way to the other mode is a new session. Wire-frozen.\n */\nexport const COLLAB_AGENT_CHANNEL_SESSION_MISMATCH = 'collab_agent_channel_session_mismatch';\n\n/**\n * A structured refusal the host recorded as the run error when the run could\n * not START: the run executor raised the gate's `{status, detail: {code,\n * message}}` envelope (agora's `_status_reject`) before it accepted the\n * dispatched input, so the message went back to its lane and the thread rests\n * `error` with it still queued. Unlike a retryable refusal\n * ({@link readRetryableRunRefusal}) nothing will dispatch it later: resending\n * the same input is refused the same way, so the server's message is the only\n * explanation the person gets.\n */\nexport interface RunStartRefusal {\n /** The structured `detail.code` (`collab_agent_channel_session_mismatch`, …). */\n code: string;\n /** The server's human-readable reason, when it sent one. */\n message: string | null;\n /** The HTTP-style status the gate raised with, when recorded. */\n status: number | null;\n}\n\n/**\n * The non-retryable structured refusal off a replicated run error\n * (`runs.error`), or `null` — for a run that failed while it was running (a\n * plain `{message}`), a retryable refusal, or no error at all.\n */\nexport function readRunStartRefusal(error: unknown): RunStartRefusal | null {\n if (error === null || typeof error !== 'object' || Array.isArray(error)) return null;\n const { detail, status } = error as { detail?: unknown; status?: unknown };\n if (detail === null || typeof detail !== 'object' || Array.isArray(detail)) return null;\n const { code, message, retryable } = detail as {\n code?: unknown;\n message?: unknown;\n retryable?: unknown;\n };\n if (retryable === true || typeof code !== 'string' || code.length === 0) return null;\n return {\n code,\n message: typeof message === 'string' && message.length > 0 ? message : null,\n status: typeof status === 'number' ? status : null,\n };\n}\n\n/** The structured `detail.code` of a rejected command, or `null`. */\nexport function statewireRejectionCode(error: unknown): string | null {\n const detail = statewireRejectionPayload(error)?.detail;\n if (detail === null || typeof detail !== 'object' || Array.isArray(detail)) return null;\n const code = (detail as { code?: unknown }).code;\n return typeof code === 'string' && code.length > 0 ? code : null;\n}\n\n/**\n * A structured, retryable refusal of a COMMAND, read off its rejection\n * ({@link statewireRejectionPayload}): the host's `_structured_reject(...,\n * retryable=True)` envelope — `command_auth_context_expired` when a pod\n * replacement dropped the socket-scoped auth a replayed command needed,\n * `pod_draining` when the host was closing. The command never ran, and the\n * host itself says a resend after the reconnect will; `detail.code` is the\n * wire-frozen contract clients classify on. Same shape as\n * {@link readRetryableRunRefusal}, which reads it off a replicated run entry.\n */\nexport interface RetryableCommandRejection {\n /** The structured `detail.code`. */\n code: string;\n /** The server's human-readable reason, when it sent one. */\n message: string | null;\n}\n\nexport function readRetryableCommandRejection(error: unknown): RetryableCommandRejection | null {\n const payload = statewireRejectionPayload(error);\n return payload === null ? null : readRetryableDetail(payload.detail);\n}\n\n/** The host's `detail.code` for a command replayed onto a pod that could not restore its auth context. */\nexport const STATEWIRE_COMMAND_AUTH_CONTEXT_EXPIRED = 'command_auth_context_expired';\n\n/**\n * Whether a rejected command hit the host's fail-closed auth recovery: the\n * command was replayed onto a replacement pod that could not restore the\n * attach's auth context, so it was refused unrun (503, retryable). The\n * reconnect already under way restores the context; a single resend after it\n * is the recovery, not a failure to report.\n */\nexport function isStatewireCommandAuthContextExpired(error: unknown): boolean {\n const payload = statewireRejectionPayload(error);\n return (\n payload?.status === 503 &&\n readRetryableDetail(payload.detail)?.code === STATEWIRE_COMMAND_AUTH_CONTEXT_EXPIRED\n );\n}\n\n/**\n * The `detail.code` agora answers for a write to an archived (trashed)\n * conversation (`host_rejects._conversation_archived_reject`, a 409): it\n * takes no new turns, config writes or approval answers until it is\n * restored, and stopping still works. Wire-frozen.\n */\nexport const CONVERSATION_ARCHIVED = 'conversation_archived';\n\n/** What a person is told when that refusal comes back (the server says the same). */\nexport const CONVERSATION_ARCHIVED_MESSAGE =\n 'This conversation is archived. Restore it to continue.';\n\n/**\n * Whether a rejected command was refused because the conversation is archived\n * ({@link CONVERSATION_ARCHIVED}). Not retriable: nothing changes until a\n * restore, so callers show {@link CONVERSATION_ARCHIVED_MESSAGE} rather than a\n * \"try again\".\n */\nexport function isConversationArchivedRejection(error: unknown): boolean {\n return statewireRejectionCode(error) === CONVERSATION_ARCHIVED;\n}\n\n/**\n * Whether a rejected command hit the legacy-thread dispatch fence: the\n * structured 409 the server answers when an out-of-band run is writing a\n * pre-cutover thread (or its adoption failed). A per-send failure — the\n * snapshot never carries a standing read-only flag.\n */\nexport function isLegacyThreadReadOnlyRejection(error: unknown): boolean {\n const payload = statewireRejectionPayload(error);\n if (payload?.status !== 409) return false;\n\n const detail = payload.detail as { code?: unknown } | undefined;\n return detail?.code === 'legacy_thread_read_only';\n}\n\n/**\n * Whether a rejected command was refused because its rewind anchor no longer\n * matches the host's parent for the edited message (`wrong-anchor`).\n *\n * A retry/edit resubmit is dispatched optimistically, so this rejection lands\n * after the UI already cleared its edit affordances: the turn simply never\n * re-runs. Callers use this to tell the user the resubmit was dropped instead\n * of leaving a console-only failure.\n */\nexport function isStatewireRewindAnchorRejection(error: unknown): boolean {\n const failure = (error as { failure?: { fate?: unknown; payload?: unknown } } | null | undefined)\n ?.failure;\n if (failure?.fate !== 'rejected') return false;\n return (failure.payload as { reason?: unknown } | undefined)?.reason === 'wrong-anchor';\n}\n\n/**\n * Whether a statewire send failure is the host's `expired` verdict\n * (`result-unavailable`): the command's seq was at or below the host's\n * admitted watermark and no retained result was left for it. Either the\n * command ran and settled but the client re-asked for the answer (a resend\n * after the stream came back) only after the host had let the retained result\n * go, or the seq was already admitted and the command was absorbed as a\n * duplicate without ever running — a client whose shared session record fell\n * behind the watermark stays there until a reconnect re-syncs it. The library\n * never reruns the command on replay, so for an idempotent read the answer is\n * simply gone — asking again is the correct reaction, not reporting a failure;\n * a write cannot assume it was applied.\n */\nexport function isStatewireExpiredVerdict(error: unknown): boolean {\n const failure = (error as { failure?: { fate?: unknown; cause?: unknown } | null | undefined })\n ?.failure;\n return failure?.fate === 'expired' && failure.cause === 'server';\n}\n\n/**\n * Whether a statewire send failure is a local channel death rather than a\n * command error.\n *\n * The library's contract for `SendFailure.cause`: `\"server\"` is the server's\n * own answer; every other cause is \"a channel death the client settled\n * locally\" — `unmount`, `stream-gone`, and `session-lost`. A thread switch\n * settles every in-flight command that way, so logging these at error level\n * reports two failures for an ordinary switch and buries the ones that mean\n * something.\n *\n * Channel health is already surfaced where it belongs: the connection\n * indicator renders the connection state. This\n * predicate only decides the log level.\n */\nexport function isStatewireChannelTeardown(error: unknown): boolean {\n const cause = (error as { failure?: { cause?: unknown } } | null | undefined)?.failure?.cause;\n return typeof cause === 'string' && cause !== 'server';\n}\n\n/**\n * The low-cardinality reason a statewire send settled as transport weather\n * rather than a defect, or `null` when the failure is a real error.\n *\n * Three families qualify: a channel death the client settled locally\n * ({@link isStatewireChannelTeardown} — the cause: `unmount`, `stream-gone`,\n * `session-lost`), the host's `expired` verdict\n * ({@link isStatewireExpiredVerdict} — the answer outlived the host's\n * retention before the post-reconnect resend collected it), and a retryable\n * structured rejection ({@link readRetryableCommandRejection} — its code: the\n * host asked for a resend). In every case the sender's own retry or poll is\n * the recovery and the connection indicator already shows the channel, so\n * error reporting counts the outcome instead of paging on it. Handler\n * failures, crashes, and non-retryable rejections stay `null`: those are\n * defects to page on.\n */\nexport function statewireTransportOutcome(error: unknown): string | null {\n const cause = (error as { failure?: { cause?: unknown } } | null | undefined)?.failure?.cause;\n if (typeof cause === 'string' && cause !== 'server') return cause;\n if (isStatewireExpiredVerdict(error)) return 'expired';\n return readRetryableCommandRejection(error)?.code ?? null;\n}\n\nconst sanitizeConnectionMessage = (message: string): string | undefined => {\n const printable = Array.from(message, (character) => {\n const code = character.charCodeAt(0);\n return code < 32 || code === 127 ? ' ' : character;\n })\n .join('')\n .replace(/\\s+/g, ' ')\n .trim();\n return printable ? printable.slice(0, 200) : undefined;\n};\n\n/** Preserve the Statewire lifecycle and sanitize host detail for display. */\nexport function projectDeepAgentConnection(\n connection: StatewireClient.ConnectionState\n): DeepAgentConnectionState {\n const message =\n 'message' in connection && typeof connection.message === 'string'\n ? sanitizeConnectionMessage(connection.message)\n : undefined;\n switch (connection.status) {\n case 'standby':\n return {\n status: connection.status,\n reason: connection.reason,\n degraded: connection.degraded,\n ...(message !== undefined && { message }),\n };\n case 'connecting':\n case 'connected':\n return { status: connection.status, degraded: connection.degraded };\n case 'retrying':\n return {\n status: connection.status,\n degraded: connection.degraded,\n attempt: connection.attempt,\n ...(connection.cause !== undefined && { cause: connection.cause }),\n ...(connection.code !== undefined && { code: connection.code }),\n ...(connection.nextRetryAt !== undefined && { nextRetryAt: connection.nextRetryAt }),\n ...(connection.lastError !== undefined && { lastError: connection.lastError }),\n ...(message !== undefined && { message }),\n };\n case 'stopped':\n return {\n status: connection.status,\n degraded: connection.degraded,\n reason: connection.reason,\n ...(connection.payload !== undefined && { payload: connection.payload }),\n ...(message !== undefined && { message }),\n };\n default:\n return unknownConnectionStatus(connection);\n }\n}\n\n/** Compile-time exhaustiveness: reachable only when the library grows a status this build does not project. */\nfunction unknownConnectionStatus(connection: never): never {\n throw new Error(\n `statewire: unknown connection status ${JSON.stringify(\n (connection as { status?: unknown }).status\n )}`\n );\n}\n"],"names":[],"mappings":"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"}
1
+ {"version":3,"file":"errors.cjs","sources":["../../../../agent-runtime/src/errors.ts"],"sourcesContent":["import type { StatewireClient } from 'statewire';\nimport type { DeepAgentConnectionState } from './types';\n\n/** Structured payload attached to a server-rejected Statewire command. */\nexport interface StatewireRejectionPayload {\n status: number;\n detail: unknown;\n}\n\n/** Return a rejected command's structured `{ status, detail }` payload. */\nexport function statewireRejectionPayload(error: unknown): StatewireRejectionPayload | null {\n const failure = (error as { failure?: { fate?: unknown; payload?: unknown } } | null)?.failure;\n if (failure?.fate !== 'rejected') return null;\n\n const payload = failure.payload as { status?: unknown; detail?: unknown } | undefined;\n if (typeof payload?.status !== 'number') return null;\n return { status: payload.status, detail: payload.detail };\n}\n\n/**\n * The server's human-readable reason for a rejected command — `detail.message`\n * (or a plain-string `detail`) — else `null`. Hosts surface it as send\n * feedback so the user sees the actionable cause instead of the generic\n * client-side `command rejected (<status>)`.\n */\nexport function statewireRejectionDetailMessage(error: unknown): string | null {\n const detail = statewireRejectionPayload(error)?.detail;\n if (typeof detail === 'string') return detail.length > 0 ? detail : null;\n if (detail === null || typeof detail !== 'object' || Array.isArray(detail)) return null;\n const message = (detail as { message?: unknown }).message;\n return typeof message === 'string' && message.length > 0 ? message : null;\n}\n\n/**\n * A structured, retryable refusal the host recorded as the run error\n * (`runs.error`): the dispatch never started — the pod or instance was\n * closing (`pod_draining`) — and the entries stayed in their lanes for the\n * thread's next placement. Distinct from a rejected COMMAND\n * ({@link statewireRejectionPayload}): this is the shape harness-sdk writes\n * when the run executor raises the rejection, so it lives on the replicated\n * run entry, not on a command settle.\n */\nexport interface RetryableRunRefusal {\n /** The structured `detail.code` (`pod_draining`). */\n code: string;\n /** The server's human-readable reason, when it sent one. */\n message: string | null;\n}\n\n/** The `{ code, message, retryable: true }` detail of a structured refusal, or `null`. */\nfunction readRetryableDetail(detail: unknown): { code: string; message: string | null } | null {\n if (detail === null || typeof detail !== 'object' || Array.isArray(detail)) return null;\n const { code, message, retryable } = detail as {\n code?: unknown;\n message?: unknown;\n retryable?: unknown;\n };\n if (retryable !== true || typeof code !== 'string' || code.length === 0) return null;\n return { code, message: typeof message === 'string' && message.length > 0 ? message : null };\n}\n\nexport function readRetryableRunRefusal(error: unknown): RetryableRunRefusal | null {\n if (error === null || typeof error !== 'object' || Array.isArray(error)) return null;\n return readRetryableDetail((error as { detail?: unknown }).detail);\n}\n\n/**\n * The `detail.code` agora answers when a send names another channel of the\n * collab agent a session started on (`collab_agent_bridge.py`): a session\n * keeps its channel — the SDK app's Agent / Ask mode — for its lifetime, and\n * the way to the other mode is a new session. Wire-frozen.\n */\nexport const COLLAB_AGENT_CHANNEL_SESSION_MISMATCH = 'collab_agent_channel_session_mismatch';\n\n/**\n * A structured refusal the host recorded as the run error when the run could\n * not START: the run executor raised the gate's `{status, detail: {code,\n * message}}` envelope (agora's `_status_reject`) before it accepted the\n * dispatched input, so the message went back to its lane and the thread rests\n * `error` with it still queued. Unlike a retryable refusal\n * ({@link readRetryableRunRefusal}) nothing will dispatch it later: resending\n * the same input is refused the same way, so the server's message is the only\n * explanation the person gets.\n */\nexport interface RunStartRefusal {\n /** The structured `detail.code` (`collab_agent_channel_session_mismatch`, …). */\n code: string;\n /** The server's human-readable reason, when it sent one. */\n message: string | null;\n /** The HTTP-style status the gate raised with, when recorded. */\n status: number | null;\n}\n\n/**\n * The non-retryable structured refusal off a replicated run error\n * (`runs.error`), or `null` — for a run that failed while it was running (a\n * plain `{message}`), a retryable refusal, or no error at all.\n */\nexport function readRunStartRefusal(error: unknown): RunStartRefusal | null {\n if (error === null || typeof error !== 'object' || Array.isArray(error)) return null;\n const { detail, status } = error as { detail?: unknown; status?: unknown };\n if (detail === null || typeof detail !== 'object' || Array.isArray(detail)) return null;\n const { code, message, retryable } = detail as {\n code?: unknown;\n message?: unknown;\n retryable?: unknown;\n };\n if (retryable === true || typeof code !== 'string' || code.length === 0) return null;\n return {\n code,\n message: typeof message === 'string' && message.length > 0 ? message : null,\n status: typeof status === 'number' ? status : null,\n };\n}\n\n/**\n * The `payload.reason` codes agora's voice manager rejects `voice/*` commands\n * with (harness-sdk's `_reject` and `voice_host.py`). Wire-frozen.\n */\nconst VOICE_REJECTION_REASONS: ReadonlySet<string> = new Set([\n 'no-voice',\n 'not-voice-owner',\n 'voice-active',\n 'voice-stale-session',\n 'voice-unavailable',\n 'voice-not-enabled',\n 'voice-model-transport',\n 'text-too-long',\n]);\n\n/**\n * Whether a rejected command was a `voice/*` command, by its voice manager\n * `payload.reason`. The voice controller owns those outcomes (it settles to\n * idle, falls back to a typed send, or shows its own notice), so a chat's\n * \"Message was not sent\" banner must not repeat them: no message was sent.\n */\nexport function isVoiceCommandRejection(error: unknown): boolean {\n const failure = (error as { failure?: { fate?: unknown; payload?: unknown } } | null)?.failure;\n if (failure?.fate !== 'rejected') return false;\n const reason = (failure.payload as { reason?: unknown } | null | undefined)?.reason;\n return typeof reason === 'string' && VOICE_REJECTION_REASONS.has(reason);\n}\n\n/** The structured `detail.code` of a rejected command, or `null`. */\nexport function statewireRejectionCode(error: unknown): string | null {\n const detail = statewireRejectionPayload(error)?.detail;\n if (detail === null || typeof detail !== 'object' || Array.isArray(detail)) return null;\n const code = (detail as { code?: unknown }).code;\n return typeof code === 'string' && code.length > 0 ? code : null;\n}\n\n/**\n * A structured, retryable refusal of a COMMAND, read off its rejection\n * ({@link statewireRejectionPayload}): the host's `_structured_reject(...,\n * retryable=True)` envelope — `command_auth_context_expired` when a pod\n * replacement dropped the socket-scoped auth a replayed command needed,\n * `pod_draining` when the host was closing. The command never ran, and the\n * host itself says a resend after the reconnect will; `detail.code` is the\n * wire-frozen contract clients classify on. Same shape as\n * {@link readRetryableRunRefusal}, which reads it off a replicated run entry.\n */\nexport interface RetryableCommandRejection {\n /** The structured `detail.code`. */\n code: string;\n /** The server's human-readable reason, when it sent one. */\n message: string | null;\n}\n\nexport function readRetryableCommandRejection(error: unknown): RetryableCommandRejection | null {\n const payload = statewireRejectionPayload(error);\n return payload === null ? null : readRetryableDetail(payload.detail);\n}\n\n/** The host's `detail.code` for a command replayed onto a pod that could not restore its auth context. */\nexport const STATEWIRE_COMMAND_AUTH_CONTEXT_EXPIRED = 'command_auth_context_expired';\n\n/**\n * Whether a rejected command hit the host's fail-closed auth recovery: the\n * command was replayed onto a replacement pod that could not restore the\n * attach's auth context, so it was refused unrun (503, retryable). The\n * reconnect already under way restores the context; a single resend after it\n * is the recovery, not a failure to report.\n */\nexport function isStatewireCommandAuthContextExpired(error: unknown): boolean {\n const payload = statewireRejectionPayload(error);\n return (\n payload?.status === 503 &&\n readRetryableDetail(payload.detail)?.code === STATEWIRE_COMMAND_AUTH_CONTEXT_EXPIRED\n );\n}\n\n/**\n * The `detail.code` agora answers for a write to an archived (trashed)\n * conversation (`host_rejects._conversation_archived_reject`, a 409): it\n * takes no new turns, config writes or approval answers until it is\n * restored, and stopping still works. Wire-frozen.\n */\nexport const CONVERSATION_ARCHIVED = 'conversation_archived';\n\n/** What a person is told when that refusal comes back (the server says the same). */\nexport const CONVERSATION_ARCHIVED_MESSAGE =\n 'This conversation is archived. Restore it to continue.';\n\n/**\n * Whether a rejected command was refused because the conversation is archived\n * ({@link CONVERSATION_ARCHIVED}). Not retriable: nothing changes until a\n * restore, so callers show {@link CONVERSATION_ARCHIVED_MESSAGE} rather than a\n * \"try again\".\n */\nexport function isConversationArchivedRejection(error: unknown): boolean {\n return statewireRejectionCode(error) === CONVERSATION_ARCHIVED;\n}\n\n/**\n * Whether a rejected command hit the legacy-thread dispatch fence: the\n * structured 409 the server answers when an out-of-band run is writing a\n * pre-cutover thread (or its adoption failed). A per-send failure — the\n * snapshot never carries a standing read-only flag.\n */\nexport function isLegacyThreadReadOnlyRejection(error: unknown): boolean {\n const payload = statewireRejectionPayload(error);\n if (payload?.status !== 409) return false;\n\n const detail = payload.detail as { code?: unknown } | undefined;\n return detail?.code === 'legacy_thread_read_only';\n}\n\n/**\n * Whether a rejected command was refused because its rewind anchor no longer\n * matches the host's parent for the edited message (`wrong-anchor`).\n *\n * A retry/edit resubmit is dispatched optimistically, so this rejection lands\n * after the UI already cleared its edit affordances: the turn simply never\n * re-runs. Callers use this to tell the user the resubmit was dropped instead\n * of leaving a console-only failure.\n */\nexport function isStatewireRewindAnchorRejection(error: unknown): boolean {\n const failure = (error as { failure?: { fate?: unknown; payload?: unknown } } | null | undefined)\n ?.failure;\n if (failure?.fate !== 'rejected') return false;\n return (failure.payload as { reason?: unknown } | undefined)?.reason === 'wrong-anchor';\n}\n\n/**\n * Whether a statewire send failure is the host's `expired` verdict\n * (`result-unavailable`): the command's seq was at or below the host's\n * admitted watermark and no retained result was left for it. Either the\n * command ran and settled but the client re-asked for the answer (a resend\n * after the stream came back) only after the host had let the retained result\n * go, or the seq was already admitted and the command was absorbed as a\n * duplicate without ever running — a client whose shared session record fell\n * behind the watermark stays there until a reconnect re-syncs it. The library\n * never reruns the command on replay, so for an idempotent read the answer is\n * simply gone — asking again is the correct reaction, not reporting a failure;\n * a write cannot assume it was applied.\n */\nexport function isStatewireExpiredVerdict(error: unknown): boolean {\n const failure = (error as { failure?: { fate?: unknown; cause?: unknown } | null | undefined })\n ?.failure;\n return failure?.fate === 'expired' && failure.cause === 'server';\n}\n\n/**\n * Whether a statewire send failure is a local channel death rather than a\n * command error.\n *\n * The library's contract for `SendFailure.cause`: `\"server\"` is the server's\n * own answer; every other cause is \"a channel death the client settled\n * locally\" — `unmount`, `stream-gone`, and `session-lost`. A thread switch\n * settles every in-flight command that way, so logging these at error level\n * reports two failures for an ordinary switch and buries the ones that mean\n * something.\n *\n * Channel health is already surfaced where it belongs: the connection\n * indicator renders the connection state. This\n * predicate only decides the log level.\n */\nexport function isStatewireChannelTeardown(error: unknown): boolean {\n const cause = (error as { failure?: { cause?: unknown } } | null | undefined)?.failure?.cause;\n return typeof cause === 'string' && cause !== 'server';\n}\n\n/**\n * The low-cardinality reason a statewire send settled as transport weather\n * rather than a defect, or `null` when the failure is a real error.\n *\n * Three families qualify: a channel death the client settled locally\n * ({@link isStatewireChannelTeardown} — the cause: `unmount`, `stream-gone`,\n * `session-lost`), the host's `expired` verdict\n * ({@link isStatewireExpiredVerdict} — the answer outlived the host's\n * retention before the post-reconnect resend collected it), and a retryable\n * structured rejection ({@link readRetryableCommandRejection} — its code: the\n * host asked for a resend). In every case the sender's own retry or poll is\n * the recovery and the connection indicator already shows the channel, so\n * error reporting counts the outcome instead of paging on it. Handler\n * failures, crashes, and non-retryable rejections stay `null`: those are\n * defects to page on.\n */\nexport function statewireTransportOutcome(error: unknown): string | null {\n const cause = (error as { failure?: { cause?: unknown } } | null | undefined)?.failure?.cause;\n if (typeof cause === 'string' && cause !== 'server') return cause;\n if (isStatewireExpiredVerdict(error)) return 'expired';\n return readRetryableCommandRejection(error)?.code ?? null;\n}\n\nconst sanitizeConnectionMessage = (message: string): string | undefined => {\n const printable = Array.from(message, (character) => {\n const code = character.charCodeAt(0);\n return code < 32 || code === 127 ? ' ' : character;\n })\n .join('')\n .replace(/\\s+/g, ' ')\n .trim();\n return printable ? printable.slice(0, 200) : undefined;\n};\n\n/** Preserve the Statewire lifecycle and sanitize host detail for display. */\nexport function projectDeepAgentConnection(\n connection: StatewireClient.ConnectionState\n): DeepAgentConnectionState {\n const message =\n 'message' in connection && typeof connection.message === 'string'\n ? sanitizeConnectionMessage(connection.message)\n : undefined;\n switch (connection.status) {\n case 'standby':\n return {\n status: connection.status,\n reason: connection.reason,\n degraded: connection.degraded,\n ...(message !== undefined && { message }),\n };\n case 'connecting':\n case 'connected':\n return { status: connection.status, degraded: connection.degraded };\n case 'retrying':\n return {\n status: connection.status,\n degraded: connection.degraded,\n attempt: connection.attempt,\n ...(connection.cause !== undefined && { cause: connection.cause }),\n ...(connection.code !== undefined && { code: connection.code }),\n ...(connection.nextRetryAt !== undefined && { nextRetryAt: connection.nextRetryAt }),\n ...(connection.lastError !== undefined && { lastError: connection.lastError }),\n ...(message !== undefined && { message }),\n };\n case 'stopped':\n return {\n status: connection.status,\n degraded: connection.degraded,\n reason: connection.reason,\n ...(connection.payload !== undefined && { payload: connection.payload }),\n ...(message !== undefined && { message }),\n };\n default:\n return unknownConnectionStatus(connection);\n }\n}\n\n/** Compile-time exhaustiveness: reachable only when the library grows a status this build does not project. */\nfunction unknownConnectionStatus(connection: never): never {\n throw new Error(\n `statewire: unknown connection status ${JSON.stringify(\n (connection as { status?: unknown }).status\n )}`\n );\n}\n"],"names":[],"mappings":"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"}
@@ -61,6 +61,13 @@ export interface RunStartRefusal {
61
61
  * plain `{message}`), a retryable refusal, or no error at all.
62
62
  */
63
63
  export declare function readRunStartRefusal(error: unknown): RunStartRefusal | null;
64
+ /**
65
+ * Whether a rejected command was a `voice/*` command, by its voice manager
66
+ * `payload.reason`. The voice controller owns those outcomes (it settles to
67
+ * idle, falls back to a typed send, or shows its own notice), so a chat's
68
+ * "Message was not sent" banner must not repeat them: no message was sent.
69
+ */
70
+ export declare function isVoiceCommandRejection(error: unknown): boolean;
64
71
  /** The structured `detail.code` of a rejected command, or `null`. */
65
72
  export declare function statewireRejectionCode(error: unknown): string | null;
66
73
  /**
@@ -36,6 +36,23 @@ function readRunStartRefusal(error) {
36
36
  status: typeof status === "number" ? status : null
37
37
  };
38
38
  }
39
+ const VOICE_REJECTION_REASONS = /* @__PURE__ */ new Set([
40
+ "no-voice",
41
+ "not-voice-owner",
42
+ "voice-active",
43
+ "voice-stale-session",
44
+ "voice-unavailable",
45
+ "voice-not-enabled",
46
+ "voice-model-transport",
47
+ "text-too-long"
48
+ ]);
49
+ function isVoiceCommandRejection(error) {
50
+ var _a;
51
+ const failure = error == null ? void 0 : error.failure;
52
+ if ((failure == null ? void 0 : failure.fate) !== "rejected") return false;
53
+ const reason = (_a = failure.payload) == null ? void 0 : _a.reason;
54
+ return typeof reason === "string" && VOICE_REJECTION_REASONS.has(reason);
55
+ }
39
56
  function statewireRejectionCode(error) {
40
57
  var _a;
41
58
  const detail = (_a = statewireRejectionPayload(error)) == null ? void 0 : _a.detail;
@@ -132,6 +149,7 @@ export {
132
149
  isLegacyThreadReadOnlyRejection,
133
150
  isStatewireChannelTeardown,
134
151
  isStatewireExpiredVerdict,
152
+ isVoiceCommandRejection,
135
153
  projectDeepAgentConnection,
136
154
  readRetryableCommandRejection,
137
155
  readRetryableRunRefusal,
@@ -1 +1 @@
1
- {"version":3,"file":"errors.js","sources":["../../../../agent-runtime/src/errors.ts"],"sourcesContent":["import type { StatewireClient } from 'statewire';\nimport type { DeepAgentConnectionState } from './types';\n\n/** Structured payload attached to a server-rejected Statewire command. */\nexport interface StatewireRejectionPayload {\n status: number;\n detail: unknown;\n}\n\n/** Return a rejected command's structured `{ status, detail }` payload. */\nexport function statewireRejectionPayload(error: unknown): StatewireRejectionPayload | null {\n const failure = (error as { failure?: { fate?: unknown; payload?: unknown } } | null)?.failure;\n if (failure?.fate !== 'rejected') return null;\n\n const payload = failure.payload as { status?: unknown; detail?: unknown } | undefined;\n if (typeof payload?.status !== 'number') return null;\n return { status: payload.status, detail: payload.detail };\n}\n\n/**\n * The server's human-readable reason for a rejected command — `detail.message`\n * (or a plain-string `detail`) — else `null`. Hosts surface it as send\n * feedback so the user sees the actionable cause instead of the generic\n * client-side `command rejected (<status>)`.\n */\nexport function statewireRejectionDetailMessage(error: unknown): string | null {\n const detail = statewireRejectionPayload(error)?.detail;\n if (typeof detail === 'string') return detail.length > 0 ? detail : null;\n if (detail === null || typeof detail !== 'object' || Array.isArray(detail)) return null;\n const message = (detail as { message?: unknown }).message;\n return typeof message === 'string' && message.length > 0 ? message : null;\n}\n\n/**\n * A structured, retryable refusal the host recorded as the run error\n * (`runs.error`): the dispatch never started — the pod or instance was\n * closing (`pod_draining`) — and the entries stayed in their lanes for the\n * thread's next placement. Distinct from a rejected COMMAND\n * ({@link statewireRejectionPayload}): this is the shape harness-sdk writes\n * when the run executor raises the rejection, so it lives on the replicated\n * run entry, not on a command settle.\n */\nexport interface RetryableRunRefusal {\n /** The structured `detail.code` (`pod_draining`). */\n code: string;\n /** The server's human-readable reason, when it sent one. */\n message: string | null;\n}\n\n/** The `{ code, message, retryable: true }` detail of a structured refusal, or `null`. */\nfunction readRetryableDetail(detail: unknown): { code: string; message: string | null } | null {\n if (detail === null || typeof detail !== 'object' || Array.isArray(detail)) return null;\n const { code, message, retryable } = detail as {\n code?: unknown;\n message?: unknown;\n retryable?: unknown;\n };\n if (retryable !== true || typeof code !== 'string' || code.length === 0) return null;\n return { code, message: typeof message === 'string' && message.length > 0 ? message : null };\n}\n\nexport function readRetryableRunRefusal(error: unknown): RetryableRunRefusal | null {\n if (error === null || typeof error !== 'object' || Array.isArray(error)) return null;\n return readRetryableDetail((error as { detail?: unknown }).detail);\n}\n\n/**\n * The `detail.code` agora answers when a send names another channel of the\n * collab agent a session started on (`collab_agent_bridge.py`): a session\n * keeps its channel — the SDK app's Agent / Ask mode — for its lifetime, and\n * the way to the other mode is a new session. Wire-frozen.\n */\nexport const COLLAB_AGENT_CHANNEL_SESSION_MISMATCH = 'collab_agent_channel_session_mismatch';\n\n/**\n * A structured refusal the host recorded as the run error when the run could\n * not START: the run executor raised the gate's `{status, detail: {code,\n * message}}` envelope (agora's `_status_reject`) before it accepted the\n * dispatched input, so the message went back to its lane and the thread rests\n * `error` with it still queued. Unlike a retryable refusal\n * ({@link readRetryableRunRefusal}) nothing will dispatch it later: resending\n * the same input is refused the same way, so the server's message is the only\n * explanation the person gets.\n */\nexport interface RunStartRefusal {\n /** The structured `detail.code` (`collab_agent_channel_session_mismatch`, …). */\n code: string;\n /** The server's human-readable reason, when it sent one. */\n message: string | null;\n /** The HTTP-style status the gate raised with, when recorded. */\n status: number | null;\n}\n\n/**\n * The non-retryable structured refusal off a replicated run error\n * (`runs.error`), or `null` — for a run that failed while it was running (a\n * plain `{message}`), a retryable refusal, or no error at all.\n */\nexport function readRunStartRefusal(error: unknown): RunStartRefusal | null {\n if (error === null || typeof error !== 'object' || Array.isArray(error)) return null;\n const { detail, status } = error as { detail?: unknown; status?: unknown };\n if (detail === null || typeof detail !== 'object' || Array.isArray(detail)) return null;\n const { code, message, retryable } = detail as {\n code?: unknown;\n message?: unknown;\n retryable?: unknown;\n };\n if (retryable === true || typeof code !== 'string' || code.length === 0) return null;\n return {\n code,\n message: typeof message === 'string' && message.length > 0 ? message : null,\n status: typeof status === 'number' ? status : null,\n };\n}\n\n/** The structured `detail.code` of a rejected command, or `null`. */\nexport function statewireRejectionCode(error: unknown): string | null {\n const detail = statewireRejectionPayload(error)?.detail;\n if (detail === null || typeof detail !== 'object' || Array.isArray(detail)) return null;\n const code = (detail as { code?: unknown }).code;\n return typeof code === 'string' && code.length > 0 ? code : null;\n}\n\n/**\n * A structured, retryable refusal of a COMMAND, read off its rejection\n * ({@link statewireRejectionPayload}): the host's `_structured_reject(...,\n * retryable=True)` envelope — `command_auth_context_expired` when a pod\n * replacement dropped the socket-scoped auth a replayed command needed,\n * `pod_draining` when the host was closing. The command never ran, and the\n * host itself says a resend after the reconnect will; `detail.code` is the\n * wire-frozen contract clients classify on. Same shape as\n * {@link readRetryableRunRefusal}, which reads it off a replicated run entry.\n */\nexport interface RetryableCommandRejection {\n /** The structured `detail.code`. */\n code: string;\n /** The server's human-readable reason, when it sent one. */\n message: string | null;\n}\n\nexport function readRetryableCommandRejection(error: unknown): RetryableCommandRejection | null {\n const payload = statewireRejectionPayload(error);\n return payload === null ? null : readRetryableDetail(payload.detail);\n}\n\n/** The host's `detail.code` for a command replayed onto a pod that could not restore its auth context. */\nexport const STATEWIRE_COMMAND_AUTH_CONTEXT_EXPIRED = 'command_auth_context_expired';\n\n/**\n * Whether a rejected command hit the host's fail-closed auth recovery: the\n * command was replayed onto a replacement pod that could not restore the\n * attach's auth context, so it was refused unrun (503, retryable). The\n * reconnect already under way restores the context; a single resend after it\n * is the recovery, not a failure to report.\n */\nexport function isStatewireCommandAuthContextExpired(error: unknown): boolean {\n const payload = statewireRejectionPayload(error);\n return (\n payload?.status === 503 &&\n readRetryableDetail(payload.detail)?.code === STATEWIRE_COMMAND_AUTH_CONTEXT_EXPIRED\n );\n}\n\n/**\n * The `detail.code` agora answers for a write to an archived (trashed)\n * conversation (`host_rejects._conversation_archived_reject`, a 409): it\n * takes no new turns, config writes or approval answers until it is\n * restored, and stopping still works. Wire-frozen.\n */\nexport const CONVERSATION_ARCHIVED = 'conversation_archived';\n\n/** What a person is told when that refusal comes back (the server says the same). */\nexport const CONVERSATION_ARCHIVED_MESSAGE =\n 'This conversation is archived. Restore it to continue.';\n\n/**\n * Whether a rejected command was refused because the conversation is archived\n * ({@link CONVERSATION_ARCHIVED}). Not retriable: nothing changes until a\n * restore, so callers show {@link CONVERSATION_ARCHIVED_MESSAGE} rather than a\n * \"try again\".\n */\nexport function isConversationArchivedRejection(error: unknown): boolean {\n return statewireRejectionCode(error) === CONVERSATION_ARCHIVED;\n}\n\n/**\n * Whether a rejected command hit the legacy-thread dispatch fence: the\n * structured 409 the server answers when an out-of-band run is writing a\n * pre-cutover thread (or its adoption failed). A per-send failure — the\n * snapshot never carries a standing read-only flag.\n */\nexport function isLegacyThreadReadOnlyRejection(error: unknown): boolean {\n const payload = statewireRejectionPayload(error);\n if (payload?.status !== 409) return false;\n\n const detail = payload.detail as { code?: unknown } | undefined;\n return detail?.code === 'legacy_thread_read_only';\n}\n\n/**\n * Whether a rejected command was refused because its rewind anchor no longer\n * matches the host's parent for the edited message (`wrong-anchor`).\n *\n * A retry/edit resubmit is dispatched optimistically, so this rejection lands\n * after the UI already cleared its edit affordances: the turn simply never\n * re-runs. Callers use this to tell the user the resubmit was dropped instead\n * of leaving a console-only failure.\n */\nexport function isStatewireRewindAnchorRejection(error: unknown): boolean {\n const failure = (error as { failure?: { fate?: unknown; payload?: unknown } } | null | undefined)\n ?.failure;\n if (failure?.fate !== 'rejected') return false;\n return (failure.payload as { reason?: unknown } | undefined)?.reason === 'wrong-anchor';\n}\n\n/**\n * Whether a statewire send failure is the host's `expired` verdict\n * (`result-unavailable`): the command's seq was at or below the host's\n * admitted watermark and no retained result was left for it. Either the\n * command ran and settled but the client re-asked for the answer (a resend\n * after the stream came back) only after the host had let the retained result\n * go, or the seq was already admitted and the command was absorbed as a\n * duplicate without ever running — a client whose shared session record fell\n * behind the watermark stays there until a reconnect re-syncs it. The library\n * never reruns the command on replay, so for an idempotent read the answer is\n * simply gone — asking again is the correct reaction, not reporting a failure;\n * a write cannot assume it was applied.\n */\nexport function isStatewireExpiredVerdict(error: unknown): boolean {\n const failure = (error as { failure?: { fate?: unknown; cause?: unknown } | null | undefined })\n ?.failure;\n return failure?.fate === 'expired' && failure.cause === 'server';\n}\n\n/**\n * Whether a statewire send failure is a local channel death rather than a\n * command error.\n *\n * The library's contract for `SendFailure.cause`: `\"server\"` is the server's\n * own answer; every other cause is \"a channel death the client settled\n * locally\" — `unmount`, `stream-gone`, and `session-lost`. A thread switch\n * settles every in-flight command that way, so logging these at error level\n * reports two failures for an ordinary switch and buries the ones that mean\n * something.\n *\n * Channel health is already surfaced where it belongs: the connection\n * indicator renders the connection state. This\n * predicate only decides the log level.\n */\nexport function isStatewireChannelTeardown(error: unknown): boolean {\n const cause = (error as { failure?: { cause?: unknown } } | null | undefined)?.failure?.cause;\n return typeof cause === 'string' && cause !== 'server';\n}\n\n/**\n * The low-cardinality reason a statewire send settled as transport weather\n * rather than a defect, or `null` when the failure is a real error.\n *\n * Three families qualify: a channel death the client settled locally\n * ({@link isStatewireChannelTeardown} — the cause: `unmount`, `stream-gone`,\n * `session-lost`), the host's `expired` verdict\n * ({@link isStatewireExpiredVerdict} — the answer outlived the host's\n * retention before the post-reconnect resend collected it), and a retryable\n * structured rejection ({@link readRetryableCommandRejection} — its code: the\n * host asked for a resend). In every case the sender's own retry or poll is\n * the recovery and the connection indicator already shows the channel, so\n * error reporting counts the outcome instead of paging on it. Handler\n * failures, crashes, and non-retryable rejections stay `null`: those are\n * defects to page on.\n */\nexport function statewireTransportOutcome(error: unknown): string | null {\n const cause = (error as { failure?: { cause?: unknown } } | null | undefined)?.failure?.cause;\n if (typeof cause === 'string' && cause !== 'server') return cause;\n if (isStatewireExpiredVerdict(error)) return 'expired';\n return readRetryableCommandRejection(error)?.code ?? null;\n}\n\nconst sanitizeConnectionMessage = (message: string): string | undefined => {\n const printable = Array.from(message, (character) => {\n const code = character.charCodeAt(0);\n return code < 32 || code === 127 ? ' ' : character;\n })\n .join('')\n .replace(/\\s+/g, ' ')\n .trim();\n return printable ? printable.slice(0, 200) : undefined;\n};\n\n/** Preserve the Statewire lifecycle and sanitize host detail for display. */\nexport function projectDeepAgentConnection(\n connection: StatewireClient.ConnectionState\n): DeepAgentConnectionState {\n const message =\n 'message' in connection && typeof connection.message === 'string'\n ? sanitizeConnectionMessage(connection.message)\n : undefined;\n switch (connection.status) {\n case 'standby':\n return {\n status: connection.status,\n reason: connection.reason,\n degraded: connection.degraded,\n ...(message !== undefined && { message }),\n };\n case 'connecting':\n case 'connected':\n return { status: connection.status, degraded: connection.degraded };\n case 'retrying':\n return {\n status: connection.status,\n degraded: connection.degraded,\n attempt: connection.attempt,\n ...(connection.cause !== undefined && { cause: connection.cause }),\n ...(connection.code !== undefined && { code: connection.code }),\n ...(connection.nextRetryAt !== undefined && { nextRetryAt: connection.nextRetryAt }),\n ...(connection.lastError !== undefined && { lastError: connection.lastError }),\n ...(message !== undefined && { message }),\n };\n case 'stopped':\n return {\n status: connection.status,\n degraded: connection.degraded,\n reason: connection.reason,\n ...(connection.payload !== undefined && { payload: connection.payload }),\n ...(message !== undefined && { message }),\n };\n default:\n return unknownConnectionStatus(connection);\n }\n}\n\n/** Compile-time exhaustiveness: reachable only when the library grows a status this build does not project. */\nfunction unknownConnectionStatus(connection: never): never {\n throw new Error(\n `statewire: unknown connection status ${JSON.stringify(\n (connection as { status?: unknown }).status\n )}`\n );\n}\n"],"names":[],"mappings":"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"}
1
+ {"version":3,"file":"errors.js","sources":["../../../../agent-runtime/src/errors.ts"],"sourcesContent":["import type { StatewireClient } from 'statewire';\nimport type { DeepAgentConnectionState } from './types';\n\n/** Structured payload attached to a server-rejected Statewire command. */\nexport interface StatewireRejectionPayload {\n status: number;\n detail: unknown;\n}\n\n/** Return a rejected command's structured `{ status, detail }` payload. */\nexport function statewireRejectionPayload(error: unknown): StatewireRejectionPayload | null {\n const failure = (error as { failure?: { fate?: unknown; payload?: unknown } } | null)?.failure;\n if (failure?.fate !== 'rejected') return null;\n\n const payload = failure.payload as { status?: unknown; detail?: unknown } | undefined;\n if (typeof payload?.status !== 'number') return null;\n return { status: payload.status, detail: payload.detail };\n}\n\n/**\n * The server's human-readable reason for a rejected command — `detail.message`\n * (or a plain-string `detail`) — else `null`. Hosts surface it as send\n * feedback so the user sees the actionable cause instead of the generic\n * client-side `command rejected (<status>)`.\n */\nexport function statewireRejectionDetailMessage(error: unknown): string | null {\n const detail = statewireRejectionPayload(error)?.detail;\n if (typeof detail === 'string') return detail.length > 0 ? detail : null;\n if (detail === null || typeof detail !== 'object' || Array.isArray(detail)) return null;\n const message = (detail as { message?: unknown }).message;\n return typeof message === 'string' && message.length > 0 ? message : null;\n}\n\n/**\n * A structured, retryable refusal the host recorded as the run error\n * (`runs.error`): the dispatch never started — the pod or instance was\n * closing (`pod_draining`) — and the entries stayed in their lanes for the\n * thread's next placement. Distinct from a rejected COMMAND\n * ({@link statewireRejectionPayload}): this is the shape harness-sdk writes\n * when the run executor raises the rejection, so it lives on the replicated\n * run entry, not on a command settle.\n */\nexport interface RetryableRunRefusal {\n /** The structured `detail.code` (`pod_draining`). */\n code: string;\n /** The server's human-readable reason, when it sent one. */\n message: string | null;\n}\n\n/** The `{ code, message, retryable: true }` detail of a structured refusal, or `null`. */\nfunction readRetryableDetail(detail: unknown): { code: string; message: string | null } | null {\n if (detail === null || typeof detail !== 'object' || Array.isArray(detail)) return null;\n const { code, message, retryable } = detail as {\n code?: unknown;\n message?: unknown;\n retryable?: unknown;\n };\n if (retryable !== true || typeof code !== 'string' || code.length === 0) return null;\n return { code, message: typeof message === 'string' && message.length > 0 ? message : null };\n}\n\nexport function readRetryableRunRefusal(error: unknown): RetryableRunRefusal | null {\n if (error === null || typeof error !== 'object' || Array.isArray(error)) return null;\n return readRetryableDetail((error as { detail?: unknown }).detail);\n}\n\n/**\n * The `detail.code` agora answers when a send names another channel of the\n * collab agent a session started on (`collab_agent_bridge.py`): a session\n * keeps its channel — the SDK app's Agent / Ask mode — for its lifetime, and\n * the way to the other mode is a new session. Wire-frozen.\n */\nexport const COLLAB_AGENT_CHANNEL_SESSION_MISMATCH = 'collab_agent_channel_session_mismatch';\n\n/**\n * A structured refusal the host recorded as the run error when the run could\n * not START: the run executor raised the gate's `{status, detail: {code,\n * message}}` envelope (agora's `_status_reject`) before it accepted the\n * dispatched input, so the message went back to its lane and the thread rests\n * `error` with it still queued. Unlike a retryable refusal\n * ({@link readRetryableRunRefusal}) nothing will dispatch it later: resending\n * the same input is refused the same way, so the server's message is the only\n * explanation the person gets.\n */\nexport interface RunStartRefusal {\n /** The structured `detail.code` (`collab_agent_channel_session_mismatch`, …). */\n code: string;\n /** The server's human-readable reason, when it sent one. */\n message: string | null;\n /** The HTTP-style status the gate raised with, when recorded. */\n status: number | null;\n}\n\n/**\n * The non-retryable structured refusal off a replicated run error\n * (`runs.error`), or `null` — for a run that failed while it was running (a\n * plain `{message}`), a retryable refusal, or no error at all.\n */\nexport function readRunStartRefusal(error: unknown): RunStartRefusal | null {\n if (error === null || typeof error !== 'object' || Array.isArray(error)) return null;\n const { detail, status } = error as { detail?: unknown; status?: unknown };\n if (detail === null || typeof detail !== 'object' || Array.isArray(detail)) return null;\n const { code, message, retryable } = detail as {\n code?: unknown;\n message?: unknown;\n retryable?: unknown;\n };\n if (retryable === true || typeof code !== 'string' || code.length === 0) return null;\n return {\n code,\n message: typeof message === 'string' && message.length > 0 ? message : null,\n status: typeof status === 'number' ? status : null,\n };\n}\n\n/**\n * The `payload.reason` codes agora's voice manager rejects `voice/*` commands\n * with (harness-sdk's `_reject` and `voice_host.py`). Wire-frozen.\n */\nconst VOICE_REJECTION_REASONS: ReadonlySet<string> = new Set([\n 'no-voice',\n 'not-voice-owner',\n 'voice-active',\n 'voice-stale-session',\n 'voice-unavailable',\n 'voice-not-enabled',\n 'voice-model-transport',\n 'text-too-long',\n]);\n\n/**\n * Whether a rejected command was a `voice/*` command, by its voice manager\n * `payload.reason`. The voice controller owns those outcomes (it settles to\n * idle, falls back to a typed send, or shows its own notice), so a chat's\n * \"Message was not sent\" banner must not repeat them: no message was sent.\n */\nexport function isVoiceCommandRejection(error: unknown): boolean {\n const failure = (error as { failure?: { fate?: unknown; payload?: unknown } } | null)?.failure;\n if (failure?.fate !== 'rejected') return false;\n const reason = (failure.payload as { reason?: unknown } | null | undefined)?.reason;\n return typeof reason === 'string' && VOICE_REJECTION_REASONS.has(reason);\n}\n\n/** The structured `detail.code` of a rejected command, or `null`. */\nexport function statewireRejectionCode(error: unknown): string | null {\n const detail = statewireRejectionPayload(error)?.detail;\n if (detail === null || typeof detail !== 'object' || Array.isArray(detail)) return null;\n const code = (detail as { code?: unknown }).code;\n return typeof code === 'string' && code.length > 0 ? code : null;\n}\n\n/**\n * A structured, retryable refusal of a COMMAND, read off its rejection\n * ({@link statewireRejectionPayload}): the host's `_structured_reject(...,\n * retryable=True)` envelope — `command_auth_context_expired` when a pod\n * replacement dropped the socket-scoped auth a replayed command needed,\n * `pod_draining` when the host was closing. The command never ran, and the\n * host itself says a resend after the reconnect will; `detail.code` is the\n * wire-frozen contract clients classify on. Same shape as\n * {@link readRetryableRunRefusal}, which reads it off a replicated run entry.\n */\nexport interface RetryableCommandRejection {\n /** The structured `detail.code`. */\n code: string;\n /** The server's human-readable reason, when it sent one. */\n message: string | null;\n}\n\nexport function readRetryableCommandRejection(error: unknown): RetryableCommandRejection | null {\n const payload = statewireRejectionPayload(error);\n return payload === null ? null : readRetryableDetail(payload.detail);\n}\n\n/** The host's `detail.code` for a command replayed onto a pod that could not restore its auth context. */\nexport const STATEWIRE_COMMAND_AUTH_CONTEXT_EXPIRED = 'command_auth_context_expired';\n\n/**\n * Whether a rejected command hit the host's fail-closed auth recovery: the\n * command was replayed onto a replacement pod that could not restore the\n * attach's auth context, so it was refused unrun (503, retryable). The\n * reconnect already under way restores the context; a single resend after it\n * is the recovery, not a failure to report.\n */\nexport function isStatewireCommandAuthContextExpired(error: unknown): boolean {\n const payload = statewireRejectionPayload(error);\n return (\n payload?.status === 503 &&\n readRetryableDetail(payload.detail)?.code === STATEWIRE_COMMAND_AUTH_CONTEXT_EXPIRED\n );\n}\n\n/**\n * The `detail.code` agora answers for a write to an archived (trashed)\n * conversation (`host_rejects._conversation_archived_reject`, a 409): it\n * takes no new turns, config writes or approval answers until it is\n * restored, and stopping still works. Wire-frozen.\n */\nexport const CONVERSATION_ARCHIVED = 'conversation_archived';\n\n/** What a person is told when that refusal comes back (the server says the same). */\nexport const CONVERSATION_ARCHIVED_MESSAGE =\n 'This conversation is archived. Restore it to continue.';\n\n/**\n * Whether a rejected command was refused because the conversation is archived\n * ({@link CONVERSATION_ARCHIVED}). Not retriable: nothing changes until a\n * restore, so callers show {@link CONVERSATION_ARCHIVED_MESSAGE} rather than a\n * \"try again\".\n */\nexport function isConversationArchivedRejection(error: unknown): boolean {\n return statewireRejectionCode(error) === CONVERSATION_ARCHIVED;\n}\n\n/**\n * Whether a rejected command hit the legacy-thread dispatch fence: the\n * structured 409 the server answers when an out-of-band run is writing a\n * pre-cutover thread (or its adoption failed). A per-send failure — the\n * snapshot never carries a standing read-only flag.\n */\nexport function isLegacyThreadReadOnlyRejection(error: unknown): boolean {\n const payload = statewireRejectionPayload(error);\n if (payload?.status !== 409) return false;\n\n const detail = payload.detail as { code?: unknown } | undefined;\n return detail?.code === 'legacy_thread_read_only';\n}\n\n/**\n * Whether a rejected command was refused because its rewind anchor no longer\n * matches the host's parent for the edited message (`wrong-anchor`).\n *\n * A retry/edit resubmit is dispatched optimistically, so this rejection lands\n * after the UI already cleared its edit affordances: the turn simply never\n * re-runs. Callers use this to tell the user the resubmit was dropped instead\n * of leaving a console-only failure.\n */\nexport function isStatewireRewindAnchorRejection(error: unknown): boolean {\n const failure = (error as { failure?: { fate?: unknown; payload?: unknown } } | null | undefined)\n ?.failure;\n if (failure?.fate !== 'rejected') return false;\n return (failure.payload as { reason?: unknown } | undefined)?.reason === 'wrong-anchor';\n}\n\n/**\n * Whether a statewire send failure is the host's `expired` verdict\n * (`result-unavailable`): the command's seq was at or below the host's\n * admitted watermark and no retained result was left for it. Either the\n * command ran and settled but the client re-asked for the answer (a resend\n * after the stream came back) only after the host had let the retained result\n * go, or the seq was already admitted and the command was absorbed as a\n * duplicate without ever running — a client whose shared session record fell\n * behind the watermark stays there until a reconnect re-syncs it. The library\n * never reruns the command on replay, so for an idempotent read the answer is\n * simply gone — asking again is the correct reaction, not reporting a failure;\n * a write cannot assume it was applied.\n */\nexport function isStatewireExpiredVerdict(error: unknown): boolean {\n const failure = (error as { failure?: { fate?: unknown; cause?: unknown } | null | undefined })\n ?.failure;\n return failure?.fate === 'expired' && failure.cause === 'server';\n}\n\n/**\n * Whether a statewire send failure is a local channel death rather than a\n * command error.\n *\n * The library's contract for `SendFailure.cause`: `\"server\"` is the server's\n * own answer; every other cause is \"a channel death the client settled\n * locally\" — `unmount`, `stream-gone`, and `session-lost`. A thread switch\n * settles every in-flight command that way, so logging these at error level\n * reports two failures for an ordinary switch and buries the ones that mean\n * something.\n *\n * Channel health is already surfaced where it belongs: the connection\n * indicator renders the connection state. This\n * predicate only decides the log level.\n */\nexport function isStatewireChannelTeardown(error: unknown): boolean {\n const cause = (error as { failure?: { cause?: unknown } } | null | undefined)?.failure?.cause;\n return typeof cause === 'string' && cause !== 'server';\n}\n\n/**\n * The low-cardinality reason a statewire send settled as transport weather\n * rather than a defect, or `null` when the failure is a real error.\n *\n * Three families qualify: a channel death the client settled locally\n * ({@link isStatewireChannelTeardown} — the cause: `unmount`, `stream-gone`,\n * `session-lost`), the host's `expired` verdict\n * ({@link isStatewireExpiredVerdict} — the answer outlived the host's\n * retention before the post-reconnect resend collected it), and a retryable\n * structured rejection ({@link readRetryableCommandRejection} — its code: the\n * host asked for a resend). In every case the sender's own retry or poll is\n * the recovery and the connection indicator already shows the channel, so\n * error reporting counts the outcome instead of paging on it. Handler\n * failures, crashes, and non-retryable rejections stay `null`: those are\n * defects to page on.\n */\nexport function statewireTransportOutcome(error: unknown): string | null {\n const cause = (error as { failure?: { cause?: unknown } } | null | undefined)?.failure?.cause;\n if (typeof cause === 'string' && cause !== 'server') return cause;\n if (isStatewireExpiredVerdict(error)) return 'expired';\n return readRetryableCommandRejection(error)?.code ?? null;\n}\n\nconst sanitizeConnectionMessage = (message: string): string | undefined => {\n const printable = Array.from(message, (character) => {\n const code = character.charCodeAt(0);\n return code < 32 || code === 127 ? ' ' : character;\n })\n .join('')\n .replace(/\\s+/g, ' ')\n .trim();\n return printable ? printable.slice(0, 200) : undefined;\n};\n\n/** Preserve the Statewire lifecycle and sanitize host detail for display. */\nexport function projectDeepAgentConnection(\n connection: StatewireClient.ConnectionState\n): DeepAgentConnectionState {\n const message =\n 'message' in connection && typeof connection.message === 'string'\n ? sanitizeConnectionMessage(connection.message)\n : undefined;\n switch (connection.status) {\n case 'standby':\n return {\n status: connection.status,\n reason: connection.reason,\n degraded: connection.degraded,\n ...(message !== undefined && { message }),\n };\n case 'connecting':\n case 'connected':\n return { status: connection.status, degraded: connection.degraded };\n case 'retrying':\n return {\n status: connection.status,\n degraded: connection.degraded,\n attempt: connection.attempt,\n ...(connection.cause !== undefined && { cause: connection.cause }),\n ...(connection.code !== undefined && { code: connection.code }),\n ...(connection.nextRetryAt !== undefined && { nextRetryAt: connection.nextRetryAt }),\n ...(connection.lastError !== undefined && { lastError: connection.lastError }),\n ...(message !== undefined && { message }),\n };\n case 'stopped':\n return {\n status: connection.status,\n degraded: connection.degraded,\n reason: connection.reason,\n ...(connection.payload !== undefined && { payload: connection.payload }),\n ...(message !== undefined && { message }),\n };\n default:\n return unknownConnectionStatus(connection);\n }\n}\n\n/** Compile-time exhaustiveness: reachable only when the library grows a status this build does not project. */\nfunction unknownConnectionStatus(connection: never): never {\n throw new Error(\n `statewire: unknown connection status ${JSON.stringify(\n (connection as { status?: unknown }).status\n )}`\n );\n}\n"],"names":[],"mappings":"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"}
@@ -1,13 +1,17 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
3
  const RUN_CONFIG_CUSTOM_KEYS = [
4
+ "addressed_agents",
4
5
  "agent",
6
+ "agent_available_toolkits",
5
7
  "agent_catalog_asset_ids",
6
8
  "allowed_tab_ids",
7
9
  "app_id",
8
10
  "approve_changes",
9
11
  "catalog_asset_ids",
10
12
  "channel",
13
+ "channel_reply_turn",
14
+ "channel_router",
11
15
  "client_tools",
12
16
  "coding_worker_asset_id",
13
17
  "coding_workers",
@@ -62,6 +66,7 @@ const RUN_CONFIG_CUSTOM_KEYS = [
62
66
  "panel_config",
63
67
  "permissions",
64
68
  "posthog_session_id",
69
+ "pre_approved_tools",
65
70
  "project_id",
66
71
  "read_only",
67
72
  "recursion_limit",
@@ -96,10 +101,14 @@ new Set(
96
101
  RUN_CONFIG_CUSTOM_KEYS
97
102
  );
98
103
  const RUN_CONFIG_PER_SEND_CUSTOM_KEYS = [
104
+ "addressed_agents",
99
105
  "agent",
106
+ "agent_available_toolkits",
100
107
  "allowed_tab_ids",
101
108
  "app_id",
102
109
  "channel",
110
+ "channel_reply_turn",
111
+ "channel_router",
103
112
  "client_tools",
104
113
  "collab_channel_id",
105
114
  "collab_entry_channel_id",
@@ -176,6 +185,7 @@ const THREAD_CONFIG_CUSTOM_KEYS = [
176
185
  "model",
177
186
  "outbound_approval_allowlist",
178
187
  "permissions",
188
+ "pre_approved_tools",
179
189
  "recursion_limit",
180
190
  "run_label",
181
191
  "sandbox_runtime",
@@ -209,7 +219,9 @@ const KNOWN_START_CHANNELS = [
209
219
  "default_voice",
210
220
  "desktop_app",
211
221
  "email",
222
+ "meetings",
212
223
  "mobile_app",
224
+ "mobile_app_voice",
213
225
  "office_addin",
214
226
  "orchestration",
215
227
  "programmatic",
@@ -1 +1 @@
1
- {"version":3,"file":"runconfig-contract.cjs","sources":["../../../../../agent-runtime/src/generated/runconfig-contract.ts"],"sourcesContent":["// GENERATED FILE — DO NOT EDIT BY HAND.\n//\n// Source of truth (agora):\n// agora/agora/graphs/athena_deep_agent/run_config.py (_PARSED_CUSTOM_KEYS / _COMPANION_CUSTOM_KEYS / PER_SEND_CUSTOM_KEYS)\n// agora/agora/graphs/athena_deep_agent/thread_config.py (server config lane + config/* command names)\n// agora/agora/graphs/athena_deep_agent/session_asset.py (KNOWN_START_CHANNELS / DEEP_AGENT_RUNTIME_MARKER)\n// agora/agora/graphs/athena_deep_agent/client_tools.py (client-tool interrupt + result-envelope literals)\n// agora/agora/graphs/athena_deep_agent/protocol_version.py (wire-contract version negotiation)\n// agora/agora/graphs/athena_deep_agent/message_window.py (interest windows + history commands)\n// agora/agora/type_definitions/collab_agent.py (CAPABILITIES ladder: absent mode + new-agent default)\n//\n// Regenerate:\n// cd agora && mise exec -- infisical run --command 'uv run python scripts/export_runconfig_contract.py'\n//\n// CI verifies this file matches the Python source (agora-check runs the\n// exporter with --check), so hand edits and un-regenerated key changes fail.\n\n/** `runConfig.custom` keys parsed by agora's `parse_deep_agent_run_config`. */\nexport const RUN_CONFIG_PARSED_CUSTOM_KEYS = [\n \"agent_catalog_asset_ids\",\n \"approve_changes\",\n \"catalog_asset_ids\",\n \"coding_worker_asset_id\",\n \"coding_workers\",\n \"compiled_subagents\",\n \"declined_toolkit_ids\",\n \"drive_mounts\",\n \"enable_interpreter\",\n \"enable_persistent_fs\",\n \"enable_sandbox\",\n \"enable_skills\",\n \"enabled_tools\",\n \"environment\",\n \"environment_id\",\n \"environment_name\",\n \"excluded_middleware\",\n \"excluded_tools\",\n \"extra_middleware\",\n \"include_citation_instructions\",\n \"interpreter_max_ptc_calls\",\n \"interpreter_mode\",\n \"interpreter_ptc\",\n \"interpreter_ptc_exclusive\",\n \"interpreter_runtime\",\n \"interpreter_subagents\",\n \"interpreter_timeout_seconds\",\n \"interrupt_on\",\n \"knowledge_base\",\n \"mcp_server_configs\",\n \"mcp_servers\",\n \"memory\",\n \"outbound_approval_allowlist\",\n \"permissions\",\n \"project_id\",\n \"read_only\",\n \"recursion_limit\",\n \"run_label\",\n \"sandbox_runtime\",\n \"secret_asset_ids\",\n \"session_computer\",\n \"session_machine\",\n \"session_vm_retention\",\n \"skill_asset_ids\",\n \"skills\",\n \"subagents\",\n \"system_prompt\",\n \"tool_description_overrides\",\n \"voice_update_handle\",\n \"workbench\",\n] as const;\n\n/** `runConfig.custom` keys consumed by the surrounding deep-agent request machinery rather than the capability parser. */\nexport const RUN_CONFIG_COMPANION_CUSTOM_KEYS = [\n \"agent\",\n \"allowed_tab_ids\",\n \"app_id\",\n \"channel\",\n \"client_tools\",\n \"collab_agent_id\",\n \"collab_channel_id\",\n \"collab_entry_channel_id\",\n \"custom_tool_configs\",\n \"deterministic\",\n \"device_id\",\n \"device_toolkits\",\n \"dry_run\",\n \"enabled_toolkits\",\n \"entry_point\",\n \"from_stored_config\",\n \"frontend_available\",\n \"generative_frame_inline\",\n \"github_identity\",\n \"max_tokens\",\n \"middleware\",\n \"model\",\n \"muses_enabled\",\n \"muses_recall_enabled\",\n \"office_context\",\n \"panel_config\",\n \"posthog_session_id\",\n \"run_budget\",\n \"runtime\",\n \"session_id\",\n \"session_origin_kind\",\n \"session_tab_id\",\n \"skip_title_generation\",\n \"source_aop_id\",\n \"start_channel\",\n \"structured_output\",\n \"temperature\",\n \"tool_limit_override\",\n \"trigger_type\",\n \"workspace_id\",\n] as const;\n\n/** Every `runConfig.custom` key some deep-agent request consumer reads. A key outside this set is invisible to the run and trips agora's unknown-key telemetry. */\nexport const RUN_CONFIG_CUSTOM_KEYS = [\n \"agent\",\n \"agent_catalog_asset_ids\",\n \"allowed_tab_ids\",\n \"app_id\",\n \"approve_changes\",\n \"catalog_asset_ids\",\n \"channel\",\n \"client_tools\",\n \"coding_worker_asset_id\",\n \"coding_workers\",\n \"collab_agent_id\",\n \"collab_channel_id\",\n \"collab_entry_channel_id\",\n \"compiled_subagents\",\n \"custom_tool_configs\",\n \"declined_toolkit_ids\",\n \"deterministic\",\n \"device_id\",\n \"device_toolkits\",\n \"drive_mounts\",\n \"dry_run\",\n \"enable_interpreter\",\n \"enable_persistent_fs\",\n \"enable_sandbox\",\n \"enable_skills\",\n \"enabled_toolkits\",\n \"enabled_tools\",\n \"entry_point\",\n \"environment\",\n \"environment_id\",\n \"environment_name\",\n \"excluded_middleware\",\n \"excluded_tools\",\n \"extra_middleware\",\n \"from_stored_config\",\n \"frontend_available\",\n \"generative_frame_inline\",\n \"github_identity\",\n \"include_citation_instructions\",\n \"interpreter_max_ptc_calls\",\n \"interpreter_mode\",\n \"interpreter_ptc\",\n \"interpreter_ptc_exclusive\",\n \"interpreter_runtime\",\n \"interpreter_subagents\",\n \"interpreter_timeout_seconds\",\n \"interrupt_on\",\n \"knowledge_base\",\n \"max_tokens\",\n \"mcp_server_configs\",\n \"mcp_servers\",\n \"memory\",\n \"middleware\",\n \"model\",\n \"muses_enabled\",\n \"muses_recall_enabled\",\n \"office_context\",\n \"outbound_approval_allowlist\",\n \"panel_config\",\n \"permissions\",\n \"posthog_session_id\",\n \"project_id\",\n \"read_only\",\n \"recursion_limit\",\n \"run_budget\",\n \"run_label\",\n \"runtime\",\n \"sandbox_runtime\",\n \"secret_asset_ids\",\n \"session_computer\",\n \"session_id\",\n \"session_machine\",\n \"session_origin_kind\",\n \"session_tab_id\",\n \"session_vm_retention\",\n \"skill_asset_ids\",\n \"skills\",\n \"skip_title_generation\",\n \"source_aop_id\",\n \"start_channel\",\n \"structured_output\",\n \"subagents\",\n \"system_prompt\",\n \"temperature\",\n \"tool_description_overrides\",\n \"tool_limit_override\",\n \"trigger_type\",\n \"voice_update_handle\",\n \"workbench\",\n \"workspace_id\",\n] as const;\n\nexport type RunConfigCustomKey = (typeof RUN_CONFIG_CUSTOM_KEYS)[number];\n\n/** Fast membership checks for builder/test assertions. */\nexport const RUN_CONFIG_CUSTOM_KEY_SET: ReadonlySet<string> = new Set(\n RUN_CONFIG_CUSTOM_KEYS,\n);\n\n/** `runConfig.custom` keys a client still carries per send on a thread with server config; every other key is dropped at dispatch. */\nexport const RUN_CONFIG_PER_SEND_CUSTOM_KEYS = [\n \"agent\",\n \"allowed_tab_ids\",\n \"app_id\",\n \"channel\",\n \"client_tools\",\n \"collab_channel_id\",\n \"collab_entry_channel_id\",\n \"deterministic\",\n \"device_id\",\n \"device_toolkits\",\n \"dry_run\",\n \"entry_point\",\n \"from_stored_config\",\n \"frontend_available\",\n \"generative_frame_inline\",\n \"github_identity\",\n \"muses_enabled\",\n \"muses_recall_enabled\",\n \"office_context\",\n \"posthog_session_id\",\n \"project_id\",\n \"read_only\",\n \"run_budget\",\n \"runtime\",\n \"session_id\",\n \"session_origin_kind\",\n \"session_tab_id\",\n \"skip_title_generation\",\n \"source_aop_id\",\n \"start_channel\",\n \"structured_output\",\n \"tool_limit_override\",\n \"trigger_type\",\n \"voice_update_handle\",\n \"workspace_id\",\n] as const;\n\nexport type RunConfigPerSendCustomKey =\n (typeof RUN_CONFIG_PER_SEND_CUSTOM_KEYS)[number];\n\n/** Fast membership checks for builder/test assertions. */\nexport const RUN_CONFIG_PER_SEND_CUSTOM_KEY_SET: ReadonlySet<string> = new Set(\n RUN_CONFIG_PER_SEND_CUSTOM_KEYS,\n);\n\n/** Keys the thread's server config lane owns — changed only through the `config/*` commands, never per send. */\nexport const THREAD_CONFIG_CUSTOM_KEYS = [\n \"agent_catalog_asset_ids\",\n \"approve_changes\",\n \"catalog_asset_ids\",\n \"coding_worker_asset_id\",\n \"coding_workers\",\n \"collab_agent_id\",\n \"compiled_subagents\",\n \"custom_tool_configs\",\n \"declined_toolkit_ids\",\n \"drive_mounts\",\n \"enable_interpreter\",\n \"enable_persistent_fs\",\n \"enable_sandbox\",\n \"enable_skills\",\n \"enabled_toolkits\",\n \"enabled_tools\",\n \"environment\",\n \"environment_id\",\n \"environment_name\",\n \"excluded_middleware\",\n \"excluded_tools\",\n \"extra_middleware\",\n \"include_citation_instructions\",\n \"interpreter_max_ptc_calls\",\n \"interpreter_mode\",\n \"interpreter_ptc\",\n \"interpreter_ptc_exclusive\",\n \"interpreter_runtime\",\n \"interpreter_subagents\",\n \"interpreter_timeout_seconds\",\n \"interrupt_on\",\n \"knowledge_base\",\n \"max_tokens\",\n \"mcp_server_configs\",\n \"mcp_servers\",\n \"memory\",\n \"middleware\",\n \"model\",\n \"outbound_approval_allowlist\",\n \"permissions\",\n \"recursion_limit\",\n \"run_label\",\n \"sandbox_runtime\",\n \"secret_asset_ids\",\n \"session_computer\",\n \"session_machine\",\n \"session_vm_retention\",\n \"skill_asset_ids\",\n \"skills\",\n \"subagents\",\n \"system_prompt\",\n \"temperature\",\n \"tool_description_overrides\",\n \"workbench\",\n] as const;\n\nexport type ThreadConfigCustomKey = (typeof THREAD_CONFIG_CUSTOM_KEYS)[number];\n\n/** Fast membership checks for builder/test assertions. */\nexport const THREAD_CONFIG_CUSTOM_KEY_SET: ReadonlySet<string> = new Set(\n THREAD_CONFIG_CUSTOM_KEYS,\n);\n\n/** Replicated-state key of the server config lane (`{ version, custom }`). */\nexport const DEEP_AGENT_CONFIG_STATE_KEY = \"config\";\n\n/** The statewire commands that mutate the server config lane. */\nexport const DEEP_AGENT_CONFIG_COMMANDS = {\n patch: \"config/patch\",\n toolsEnable: \"config/tools/enable\",\n toolsDisable: \"config/tools/disable\",\n} as const;\n\n/** `start_channel` values the session substrate stamps as provenance; anything else clamps to \"web\". */\nexport const KNOWN_START_CHANNELS = [\n \"agent_orchestration\",\n \"api\",\n \"automation\",\n \"chrome_extension\",\n \"cli\",\n \"comment_agent\",\n \"default_voice\",\n \"desktop_app\",\n \"email\",\n \"mobile_app\",\n \"office_addin\",\n \"orchestration\",\n \"programmatic\",\n \"slack\",\n \"sms\",\n \"task\",\n \"teams\",\n \"voice\",\n \"voice_memo\",\n \"web\",\n] as const;\n\nexport type KnownStartChannel = (typeof KNOWN_START_CHANNELS)[number];\n\n/** Fast membership checks for builder/test assertions. */\nexport const KNOWN_START_CHANNEL_SET: ReadonlySet<string> = new Set(\n KNOWN_START_CHANNELS,\n);\n\n/** `runConfig.custom.runtime` marker selecting the deep-agent runtime. */\nexport const DEEP_AGENT_RUNTIME_MARKER = \"athena_deep_agent\";\n\n/**\n * Collab-agent capability ladder (agent schema v3): per explicit\n * capability field, what an ABSENT value means and the value stamped on\n * a new agent. Resolved by agora's `capability_decoder` and the one agent\n * compiler on every run: `passthrough` — explicit only, absent means off;\n * `off` — absent means off under every `runtime` marker; `runtime` —\n * absent derives from the `runtime` marker (`athena_deep_agent` on, any\n * other or missing marker off).\n */\nexport const COLLAB_AGENT_CAPABILITIES = {\n deepAgentBuiltinsEnabled: { absent: \"runtime\", default: true },\n interpreterEnabled: { absent: \"off\", default: false },\n sandboxEnabled: { absent: \"passthrough\", default: false },\n skillsEnabled: { absent: \"runtime\", default: true },\n} as const;\n\nexport type CollabAgentCapabilityField = keyof typeof COLLAB_AGENT_CAPABILITIES;\n\nexport type CollabAgentCapabilityAbsentMode =\n (typeof COLLAB_AGENT_CAPABILITIES)[CollabAgentCapabilityField][\"absent\"];\n\n/** `source`/`type` stamped on client-tool interrupt payloads by agora. */\nexport const CLIENT_TOOL_INTERRUPT_SOURCE = \"client_tool\";\n\n/** `status` literals of the result envelope a client resumes a parked client-tool call with. */\nexport const CLIENT_TOOL_RESULT_STATUSES = [\"error\", \"success\"] as const;\n\nexport type ClientToolResultStatus =\n (typeof CLIENT_TOOL_RESULT_STATUSES)[number];\n\nexport const CLIENT_TOOL_RESULT_STATUS_SUCCESS = \"success\";\n\nexport const CLIENT_TOOL_RESULT_STATUS_ERROR = \"error\";\n\n/**\n * Result envelope a client resumes a parked client-tool call with,\n * keyed by interrupt id:\n * `{ client_tool_results: { <interrupt_id>: <envelope> } }`.\n * Agora relays the envelope to the model verbatim.\n */\nexport type ClientToolResultEnvelopeContract =\n | { status: typeof CLIENT_TOOL_RESULT_STATUS_SUCCESS; result: unknown }\n | { status: typeof CLIENT_TOOL_RESULT_STATUS_ERROR; error: string };\n\n/**\n * The deep-agent wire-contract version this client build speaks,\n * declared on every attach. The host records it for attach telemetry\n * and per-version behaviour; it has no minimum client version, so no\n * build is refused for the version it declares (the `protocol` state\n * lane's `minClientVersion` is the constant 1).\n */\nexport const DEEP_AGENT_PROTOCOL_VERSION = 2;\n\n/**\n * The first contract version whose host a client states `follow` to (a\n * subagent lane's steps, each its own document): a client follows a\n * lane only on a host whose `protocol` lane advertises at least this\n * version. A host that predates `follow` refuses it with\n * `invalid-interest`.\n */\nexport const DEEP_AGENT_LANE_FOLLOW_PROTOCOL_VERSION = 2;\n\n/** Attach header carrying the client's declared contract version. */\nexport const DEEP_AGENT_PROTOCOL_VERSION_HEADER =\n \"x-athena-deep-agent-protocol-version\";\n\n/** Attach header declaring the head window a fresh client wants in its hello (host-clamped). */\nexport const DEEP_AGENT_MESSAGE_WINDOW_HEADER = \"x-athena-deep-agent-window\";\n\n/** Replicated-state key of the server-advertised version lane. */\nexport const DEEP_AGENT_PROTOCOL_STATE_KEY = \"protocol\";\n\n/** Ephemeral subprotocol carrying a client's message-window interests. */\nexport const DEEP_AGENT_INTEREST_PROTOCOL = \"athena/interest\";\n\n/** Ephemeral subprotocol carrying a client's synced context document. */\nexport const DEEP_AGENT_CONTEXT_PROTOCOL = \"athena/context\";\n\n/** The only interest namespace the host resolves (the linear transcript). */\nexport const DEEP_AGENT_MAIN_NS = \"main\";\n\n/** Window size (interest `before`) a client asks for by default. */\nexport const DEEP_AGENT_DEFAULT_MESSAGE_WINDOW = 40;\n\n/** Bounds on a window size. */\nexport const DEEP_AGENT_MIN_MESSAGE_WINDOW = 8;\n\nexport const DEEP_AGENT_MAX_MESSAGE_WINDOW = 200;\n\n/** Interests one attach may hold at once (the head plus its pages). */\nexport const DEEP_AGENT_MAX_INTERESTS = 16;\n\n/** Command returning a truncated tool output whole. */\nexport const DEEP_AGENT_HISTORY_TOOL_OUTPUT_COMMAND = \"history/tool_output\";\n\n/** Command returning one stored message whole (provenance and full tool output included). */\nexport const DEEP_AGENT_HISTORY_MESSAGE_COMMAND = \"history/message\";\n\n/** Wire key marking a tool message whose content was truncated. */\nexport const DEEP_AGENT_TRUNCATED_CONTENT_KEY = \"athena_content_truncated\";\n\n/**\n * Wire key on a running `task` card whose nested transcript rides cut to its\n * newest steps: `{ messages, tool_calls }` over the whole stored transcript.\n */\nexport const DEEP_AGENT_TRUNCATED_LANE_KEY = \"athena_lane_truncated\";\n\n/**\n * Wire key on a `task` card, and on an in-eval lane's `ptc_subagents` entry,\n * carrying the whole lane's token use however much of the lane the wire\n * carries: `{ input_tokens, output_tokens, cache_read_input_tokens,\n * cache_creation_input_tokens }`, the input counting its cache reads and\n * writes. Absent while the lane's steps report no usage.\n */\nexport const DEEP_AGENT_LANE_USAGE_KEY = \"athena_lane_usage\";\n\n/**\n * The newest nested messages a cut card carries whole; the entries ahead\n * of them are the older assistant turns that requested results among\n * them, cut to those calls.\n */\nexport const DEEP_AGENT_RUNNING_LANE_WIRE_MESSAGES = 8;\n\n/**\n * Key of a followed lane's window (`follows[ns]` on a resolution whose\n * request added `follow: {before}`) naming the `task` call whose card\n * holds the lane.\n */\nexport const DEEP_AGENT_FOLLOW_TOOL_CALL_ID_KEY = \"toolCallId\";\n\n/** The most lane steps one attach follows, across every lane. */\nexport const DEEP_AGENT_MAX_FOLLOWED_STEPS = 200;\n\n/**\n * The first contract version a client declares to see a finished card cut\n * like a running one (and to follow lanes and page them through\n * `history/lane`). Below it, or declaring nothing, finished cards ride whole.\n */\nexport const DEEP_AGENT_LANE_CUT_PROTOCOL_VERSION = 2;\n\n/**\n * Last element of the key a cut finished card's document rides under:\n * `[threadId, \"main\", messageId, \"cut\"]`. A view holds that key or the\n * card's own, never both.\n */\nexport const DEEP_AGENT_CUT_LANE_DOCUMENT = \"cut\";\n\n/**\n * Command returning one page of a card's nested transcript, oldest first:\n * `{ messageId, before, at? }` answers\n * `{ messageId, toolCallId, ns, steps, more: { before }, total }`; the page\n * holds the newest `before` entries, or those strictly older than `at`.\n */\nexport const DEEP_AGENT_HISTORY_LANE_COMMAND = \"history/lane\";\n\n/** The most entries one `history/lane` page asks for. */\nexport const DEEP_AGENT_MAX_LANE_PAGE = 200;\n\n/** The most encoded characters one `history/lane` page carries (at least one entry). */\nexport const DEEP_AGENT_HISTORY_LANE_PAGE_CHARS = 1048576;\n\n/**\n * Set on the last step of a cut finished card whose text is the card's own\n * `content` (the subagent's report): the step rides with empty content, and\n * the card's `content` is its text.\n */\nexport const DEEP_AGENT_REPEATS_RESULT_KEY = \"athena_content_repeats_result\";\n\n/** Most inline-image payload characters one message carries whole on the wire. */\nexport const DEEP_AGENT_INLINE_IMAGE_WIRE_BUDGET = 4194304;\n\n/** Wire key on an image block left off the wire: `{ index, chars, mediaType }`. */\nexport const DEEP_AGENT_OMITTED_IMAGE_KEY = \"athena_image_omitted\";\n\n/** The image an omitted block carries instead of its own (a neutral PNG tile). */\nexport const DEEP_AGENT_OMITTED_IMAGE_PLACEHOLDER_URL =\n \"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAKAAAAB4AQMAAABPbGssAAAABlBMVEXi6PCUo7jao11HAAAA6ElEQVR42u2UyW3DMBBF3wxogEd2EJbCElKQDRCwC3MpSRc5eLuYokgNLEUxctK/CHyanQts2vRO3QdlALVsXsBvecqxxr1ob0A5GlDJU+hICxN54p/qXAx/+FpoeeE8hTerzfvByn7ifzpaBtWCOwv6bMVMBgzRgNGKmUL9McDs4XOSyEHuoKCI76AiqOugg+y0gx6SN+YQg3QwALGk19pQSKV/reOocyoww27oU5sxhAbKUNgIqrVxrvnovJ80MFgxYy23wtTss44tmL+bAuOE2p2o0fJa3iW/6iR/lEfx8kv3TZtW6AFk5Sf3k+GTswAAAABJRU5ErkJggg==\";\n\n/**\n * Command returning one inline image of a stored message in chunks:\n * `{ messageId, index, offset? }` answers\n * `{ messageId, index, mediaType, offset, total, chunk, next }`; the\n * chunks joined in order are the image's `data:` URL, and `next` is\n * the offset to ask for next (`null` after the last chunk).\n */\nexport const DEEP_AGENT_HISTORY_IMAGE_COMMAND = \"history/image\";\n\n/**\n * Command returning one inline image of a lane step in chunks, as\n * `history/image` does a stored message's: `{ messageId | lane, step,\n * index, offset? }` answers `{ messageId, lane, step, index, mediaType,\n * offset, total, chunk, next }`, with `messageId` null for an in-eval\n * lane and `lane` null for a card.\n */\nexport const DEEP_AGENT_HISTORY_LANE_IMAGE_COMMAND = \"history/lane_image\";\n"],"names":[],"mappings":";;AAoHO,MAAM,yBAAyB;AAAA,EACpC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF;AAK8D,IAAI;AAAA,EAChE;AACF;AAGO,MAAM,kCAAkC;AAAA,EAC7C;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF;AAMuE,IAAI;AAAA,EACzE;AACF;AAGO,MAAM,4BAA4B;AAAA,EACvC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF;AAKiE,IAAI;AAAA,EACnE;AACF;AAMO,MAAM,6BAA6B;AAAA,EACxC,OAAO;AAAA,EACP,aAAa;AAAA,EACb,cAAc;AAChB;AAGO,MAAM,uBAAuB;AAAA,EAClC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF;AAK4D,IAAI;AAAA,EAC9D;AACF;AA2BO,MAAM,+BAA+B;AAQrC,MAAM,oCAAoC;AAE1C,MAAM,kCAAkC;AA+BxC,MAAM,qCACX;AAGK,MAAM,mCAAmC;AAGzC,MAAM,gCAAgC;AAGtC,MAAM,+BAA+B;AAMrC,MAAM,qBAAqB;AAG3B,MAAM,oCAAoC;AAG1C,MAAM,gCAAgC;AAEtC,MAAM,gCAAgC;AAGtC,MAAM,2BAA2B;AAGjC,MAAM,yCAAyC;AAG/C,MAAM,qCAAqC;AAG3C,MAAM,mCAAmC;AAMzC,MAAM,gCAAgC;AAStC,MAAM,4BAA4B;AAwBlC,MAAM,uCAAuC;AAO7C,MAAM,+BAA+B;AAQrC,MAAM,kCAAkC;AAGxC,MAAM,2BAA2B;AAUjC,MAAM,gCAAgC;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"runconfig-contract.cjs","sources":["../../../../../agent-runtime/src/generated/runconfig-contract.ts"],"sourcesContent":["// GENERATED FILE — DO NOT EDIT BY HAND.\n//\n// Source of truth (agora):\n// agora/agora/graphs/athena_deep_agent/run_config.py (_PARSED_CUSTOM_KEYS / _COMPANION_CUSTOM_KEYS / PER_SEND_CUSTOM_KEYS)\n// agora/agora/graphs/athena_deep_agent/thread_config.py (server config lane + config/* command names)\n// agora/agora/graphs/athena_deep_agent/session_asset.py (KNOWN_START_CHANNELS / DEEP_AGENT_RUNTIME_MARKER)\n// agora/agora/graphs/athena_deep_agent/client_tools.py (client-tool interrupt + result-envelope literals)\n// agora/agora/graphs/athena_deep_agent/protocol_version.py (wire-contract version negotiation)\n// agora/agora/graphs/athena_deep_agent/message_window.py (interest windows + history commands)\n// agora/agora/type_definitions/collab_agent.py (CAPABILITIES ladder: absent mode + new-agent default)\n//\n// Regenerate:\n// cd agora && mise exec -- infisical run --command 'uv run python scripts/export_runconfig_contract.py'\n//\n// CI verifies this file matches the Python source (agora-check runs the\n// exporter with --check), so hand edits and un-regenerated key changes fail.\n\n/** `runConfig.custom` keys parsed by agora's `parse_deep_agent_run_config`. */\nexport const RUN_CONFIG_PARSED_CUSTOM_KEYS = [\n \"agent_catalog_asset_ids\",\n \"approve_changes\",\n \"catalog_asset_ids\",\n \"channel_reply_turn\",\n \"coding_worker_asset_id\",\n \"coding_workers\",\n \"compiled_subagents\",\n \"declined_toolkit_ids\",\n \"drive_mounts\",\n \"enable_interpreter\",\n \"enable_persistent_fs\",\n \"enable_sandbox\",\n \"enable_skills\",\n \"enabled_tools\",\n \"environment\",\n \"environment_id\",\n \"environment_name\",\n \"excluded_middleware\",\n \"excluded_tools\",\n \"extra_middleware\",\n \"include_citation_instructions\",\n \"interpreter_max_ptc_calls\",\n \"interpreter_mode\",\n \"interpreter_ptc\",\n \"interpreter_ptc_exclusive\",\n \"interpreter_runtime\",\n \"interpreter_subagents\",\n \"interpreter_timeout_seconds\",\n \"interrupt_on\",\n \"knowledge_base\",\n \"mcp_server_configs\",\n \"mcp_servers\",\n \"memory\",\n \"outbound_approval_allowlist\",\n \"permissions\",\n \"pre_approved_tools\",\n \"project_id\",\n \"read_only\",\n \"recursion_limit\",\n \"run_label\",\n \"sandbox_runtime\",\n \"secret_asset_ids\",\n \"session_computer\",\n \"session_machine\",\n \"session_vm_retention\",\n \"skill_asset_ids\",\n \"skills\",\n \"subagents\",\n \"system_prompt\",\n \"tool_description_overrides\",\n \"voice_update_handle\",\n \"workbench\",\n] as const;\n\n/** `runConfig.custom` keys consumed by the surrounding deep-agent request machinery rather than the capability parser. */\nexport const RUN_CONFIG_COMPANION_CUSTOM_KEYS = [\n \"addressed_agents\",\n \"agent\",\n \"agent_available_toolkits\",\n \"allowed_tab_ids\",\n \"app_id\",\n \"channel\",\n \"channel_router\",\n \"client_tools\",\n \"collab_agent_id\",\n \"collab_channel_id\",\n \"collab_entry_channel_id\",\n \"custom_tool_configs\",\n \"deterministic\",\n \"device_id\",\n \"device_toolkits\",\n \"dry_run\",\n \"enabled_toolkits\",\n \"entry_point\",\n \"from_stored_config\",\n \"frontend_available\",\n \"generative_frame_inline\",\n \"github_identity\",\n \"max_tokens\",\n \"middleware\",\n \"model\",\n \"muses_enabled\",\n \"muses_recall_enabled\",\n \"office_context\",\n \"panel_config\",\n \"posthog_session_id\",\n \"run_budget\",\n \"runtime\",\n \"session_id\",\n \"session_origin_kind\",\n \"session_tab_id\",\n \"skip_title_generation\",\n \"source_aop_id\",\n \"start_channel\",\n \"structured_output\",\n \"temperature\",\n \"tool_limit_override\",\n \"trigger_type\",\n \"workspace_id\",\n] as const;\n\n/** Every `runConfig.custom` key some deep-agent request consumer reads. A key outside this set is invisible to the run and trips agora's unknown-key telemetry. */\nexport const RUN_CONFIG_CUSTOM_KEYS = [\n \"addressed_agents\",\n \"agent\",\n \"agent_available_toolkits\",\n \"agent_catalog_asset_ids\",\n \"allowed_tab_ids\",\n \"app_id\",\n \"approve_changes\",\n \"catalog_asset_ids\",\n \"channel\",\n \"channel_reply_turn\",\n \"channel_router\",\n \"client_tools\",\n \"coding_worker_asset_id\",\n \"coding_workers\",\n \"collab_agent_id\",\n \"collab_channel_id\",\n \"collab_entry_channel_id\",\n \"compiled_subagents\",\n \"custom_tool_configs\",\n \"declined_toolkit_ids\",\n \"deterministic\",\n \"device_id\",\n \"device_toolkits\",\n \"drive_mounts\",\n \"dry_run\",\n \"enable_interpreter\",\n \"enable_persistent_fs\",\n \"enable_sandbox\",\n \"enable_skills\",\n \"enabled_toolkits\",\n \"enabled_tools\",\n \"entry_point\",\n \"environment\",\n \"environment_id\",\n \"environment_name\",\n \"excluded_middleware\",\n \"excluded_tools\",\n \"extra_middleware\",\n \"from_stored_config\",\n \"frontend_available\",\n \"generative_frame_inline\",\n \"github_identity\",\n \"include_citation_instructions\",\n \"interpreter_max_ptc_calls\",\n \"interpreter_mode\",\n \"interpreter_ptc\",\n \"interpreter_ptc_exclusive\",\n \"interpreter_runtime\",\n \"interpreter_subagents\",\n \"interpreter_timeout_seconds\",\n \"interrupt_on\",\n \"knowledge_base\",\n \"max_tokens\",\n \"mcp_server_configs\",\n \"mcp_servers\",\n \"memory\",\n \"middleware\",\n \"model\",\n \"muses_enabled\",\n \"muses_recall_enabled\",\n \"office_context\",\n \"outbound_approval_allowlist\",\n \"panel_config\",\n \"permissions\",\n \"posthog_session_id\",\n \"pre_approved_tools\",\n \"project_id\",\n \"read_only\",\n \"recursion_limit\",\n \"run_budget\",\n \"run_label\",\n \"runtime\",\n \"sandbox_runtime\",\n \"secret_asset_ids\",\n \"session_computer\",\n \"session_id\",\n \"session_machine\",\n \"session_origin_kind\",\n \"session_tab_id\",\n \"session_vm_retention\",\n \"skill_asset_ids\",\n \"skills\",\n \"skip_title_generation\",\n \"source_aop_id\",\n \"start_channel\",\n \"structured_output\",\n \"subagents\",\n \"system_prompt\",\n \"temperature\",\n \"tool_description_overrides\",\n \"tool_limit_override\",\n \"trigger_type\",\n \"voice_update_handle\",\n \"workbench\",\n \"workspace_id\",\n] as const;\n\nexport type RunConfigCustomKey = (typeof RUN_CONFIG_CUSTOM_KEYS)[number];\n\n/** Fast membership checks for builder/test assertions. */\nexport const RUN_CONFIG_CUSTOM_KEY_SET: ReadonlySet<string> = new Set(\n RUN_CONFIG_CUSTOM_KEYS,\n);\n\n/** `runConfig.custom` keys a client still carries per send on a thread with server config; every other key is dropped at dispatch. */\nexport const RUN_CONFIG_PER_SEND_CUSTOM_KEYS = [\n \"addressed_agents\",\n \"agent\",\n \"agent_available_toolkits\",\n \"allowed_tab_ids\",\n \"app_id\",\n \"channel\",\n \"channel_reply_turn\",\n \"channel_router\",\n \"client_tools\",\n \"collab_channel_id\",\n \"collab_entry_channel_id\",\n \"deterministic\",\n \"device_id\",\n \"device_toolkits\",\n \"dry_run\",\n \"entry_point\",\n \"from_stored_config\",\n \"frontend_available\",\n \"generative_frame_inline\",\n \"github_identity\",\n \"muses_enabled\",\n \"muses_recall_enabled\",\n \"office_context\",\n \"posthog_session_id\",\n \"project_id\",\n \"read_only\",\n \"run_budget\",\n \"runtime\",\n \"session_id\",\n \"session_origin_kind\",\n \"session_tab_id\",\n \"skip_title_generation\",\n \"source_aop_id\",\n \"start_channel\",\n \"structured_output\",\n \"tool_limit_override\",\n \"trigger_type\",\n \"voice_update_handle\",\n \"workspace_id\",\n] as const;\n\nexport type RunConfigPerSendCustomKey =\n (typeof RUN_CONFIG_PER_SEND_CUSTOM_KEYS)[number];\n\n/** Fast membership checks for builder/test assertions. */\nexport const RUN_CONFIG_PER_SEND_CUSTOM_KEY_SET: ReadonlySet<string> = new Set(\n RUN_CONFIG_PER_SEND_CUSTOM_KEYS,\n);\n\n/** Keys the thread's server config lane owns — changed only through the `config/*` commands, never per send. */\nexport const THREAD_CONFIG_CUSTOM_KEYS = [\n \"agent_catalog_asset_ids\",\n \"approve_changes\",\n \"catalog_asset_ids\",\n \"coding_worker_asset_id\",\n \"coding_workers\",\n \"collab_agent_id\",\n \"compiled_subagents\",\n \"custom_tool_configs\",\n \"declined_toolkit_ids\",\n \"drive_mounts\",\n \"enable_interpreter\",\n \"enable_persistent_fs\",\n \"enable_sandbox\",\n \"enable_skills\",\n \"enabled_toolkits\",\n \"enabled_tools\",\n \"environment\",\n \"environment_id\",\n \"environment_name\",\n \"excluded_middleware\",\n \"excluded_tools\",\n \"extra_middleware\",\n \"include_citation_instructions\",\n \"interpreter_max_ptc_calls\",\n \"interpreter_mode\",\n \"interpreter_ptc\",\n \"interpreter_ptc_exclusive\",\n \"interpreter_runtime\",\n \"interpreter_subagents\",\n \"interpreter_timeout_seconds\",\n \"interrupt_on\",\n \"knowledge_base\",\n \"max_tokens\",\n \"mcp_server_configs\",\n \"mcp_servers\",\n \"memory\",\n \"middleware\",\n \"model\",\n \"outbound_approval_allowlist\",\n \"permissions\",\n \"pre_approved_tools\",\n \"recursion_limit\",\n \"run_label\",\n \"sandbox_runtime\",\n \"secret_asset_ids\",\n \"session_computer\",\n \"session_machine\",\n \"session_vm_retention\",\n \"skill_asset_ids\",\n \"skills\",\n \"subagents\",\n \"system_prompt\",\n \"temperature\",\n \"tool_description_overrides\",\n \"workbench\",\n] as const;\n\nexport type ThreadConfigCustomKey = (typeof THREAD_CONFIG_CUSTOM_KEYS)[number];\n\n/** Fast membership checks for builder/test assertions. */\nexport const THREAD_CONFIG_CUSTOM_KEY_SET: ReadonlySet<string> = new Set(\n THREAD_CONFIG_CUSTOM_KEYS,\n);\n\n/** Replicated-state key of the server config lane (`{ version, custom }`). */\nexport const DEEP_AGENT_CONFIG_STATE_KEY = \"config\";\n\n/** The statewire commands that mutate the server config lane. */\nexport const DEEP_AGENT_CONFIG_COMMANDS = {\n patch: \"config/patch\",\n toolsEnable: \"config/tools/enable\",\n toolsDisable: \"config/tools/disable\",\n} as const;\n\n/** `start_channel` values the session substrate stamps as provenance; anything else clamps to \"web\". */\nexport const KNOWN_START_CHANNELS = [\n \"agent_orchestration\",\n \"api\",\n \"automation\",\n \"chrome_extension\",\n \"cli\",\n \"comment_agent\",\n \"default_voice\",\n \"desktop_app\",\n \"email\",\n \"meetings\",\n \"mobile_app\",\n \"mobile_app_voice\",\n \"office_addin\",\n \"orchestration\",\n \"programmatic\",\n \"slack\",\n \"sms\",\n \"task\",\n \"teams\",\n \"voice\",\n \"voice_memo\",\n \"web\",\n] as const;\n\nexport type KnownStartChannel = (typeof KNOWN_START_CHANNELS)[number];\n\n/** Fast membership checks for builder/test assertions. */\nexport const KNOWN_START_CHANNEL_SET: ReadonlySet<string> = new Set(\n KNOWN_START_CHANNELS,\n);\n\n/** `runConfig.custom.runtime` marker selecting the deep-agent runtime. */\nexport const DEEP_AGENT_RUNTIME_MARKER = \"athena_deep_agent\";\n\n/**\n * Collab-agent capability ladder (agent schema v3): per explicit\n * capability field, what an ABSENT value means and the value stamped on\n * a new agent. Resolved by agora's `capability_decoder` and the one agent\n * compiler on every run: `passthrough` — explicit only, absent means off;\n * `off` — absent means off under every `runtime` marker; `runtime` —\n * absent derives from the `runtime` marker (`athena_deep_agent` on, any\n * other or missing marker off).\n */\nexport const COLLAB_AGENT_CAPABILITIES = {\n deepAgentBuiltinsEnabled: { absent: \"runtime\", default: true },\n interpreterEnabled: { absent: \"off\", default: false },\n sandboxEnabled: { absent: \"passthrough\", default: false },\n skillsEnabled: { absent: \"runtime\", default: true },\n} as const;\n\nexport type CollabAgentCapabilityField = keyof typeof COLLAB_AGENT_CAPABILITIES;\n\nexport type CollabAgentCapabilityAbsentMode =\n (typeof COLLAB_AGENT_CAPABILITIES)[CollabAgentCapabilityField][\"absent\"];\n\n/** `source`/`type` stamped on client-tool interrupt payloads by agora. */\nexport const CLIENT_TOOL_INTERRUPT_SOURCE = \"client_tool\";\n\n/** `status` literals of the result envelope a client resumes a parked client-tool call with. */\nexport const CLIENT_TOOL_RESULT_STATUSES = [\"error\", \"success\"] as const;\n\nexport type ClientToolResultStatus =\n (typeof CLIENT_TOOL_RESULT_STATUSES)[number];\n\nexport const CLIENT_TOOL_RESULT_STATUS_SUCCESS = \"success\";\n\nexport const CLIENT_TOOL_RESULT_STATUS_ERROR = \"error\";\n\n/**\n * Result envelope a client resumes a parked client-tool call with,\n * keyed by interrupt id:\n * `{ client_tool_results: { <interrupt_id>: <envelope> } }`.\n * Agora relays the envelope to the model verbatim.\n */\nexport type ClientToolResultEnvelopeContract =\n | { status: typeof CLIENT_TOOL_RESULT_STATUS_SUCCESS; result: unknown }\n | { status: typeof CLIENT_TOOL_RESULT_STATUS_ERROR; error: string };\n\n/**\n * The deep-agent wire-contract version this client build speaks,\n * declared on every attach. The host records it for attach telemetry\n * and per-version behaviour; it has no minimum client version, so no\n * build is refused for the version it declares (the `protocol` state\n * lane's `minClientVersion` is the constant 1).\n */\nexport const DEEP_AGENT_PROTOCOL_VERSION = 2;\n\n/**\n * The first contract version whose host a client states `follow` to (a\n * subagent lane's steps, each its own document): a client follows a\n * lane only on a host whose `protocol` lane advertises at least this\n * version. A host that predates `follow` refuses it with\n * `invalid-interest`.\n */\nexport const DEEP_AGENT_LANE_FOLLOW_PROTOCOL_VERSION = 2;\n\n/** Attach header carrying the client's declared contract version. */\nexport const DEEP_AGENT_PROTOCOL_VERSION_HEADER =\n \"x-athena-deep-agent-protocol-version\";\n\n/** Attach header declaring the head window a fresh client wants in its hello (host-clamped). */\nexport const DEEP_AGENT_MESSAGE_WINDOW_HEADER = \"x-athena-deep-agent-window\";\n\n/** Replicated-state key of the server-advertised version lane. */\nexport const DEEP_AGENT_PROTOCOL_STATE_KEY = \"protocol\";\n\n/** Ephemeral subprotocol carrying a client's message-window interests. */\nexport const DEEP_AGENT_INTEREST_PROTOCOL = \"athena/interest\";\n\n/** Ephemeral subprotocol carrying a client's synced context document. */\nexport const DEEP_AGENT_CONTEXT_PROTOCOL = \"athena/context\";\n\n/** The only interest namespace the host resolves (the linear transcript). */\nexport const DEEP_AGENT_MAIN_NS = \"main\";\n\n/** Window size (interest `before`) a client asks for by default. */\nexport const DEEP_AGENT_DEFAULT_MESSAGE_WINDOW = 40;\n\n/** Bounds on a window size. */\nexport const DEEP_AGENT_MIN_MESSAGE_WINDOW = 8;\n\nexport const DEEP_AGENT_MAX_MESSAGE_WINDOW = 200;\n\n/** Interests one attach may hold at once (the head plus its pages). */\nexport const DEEP_AGENT_MAX_INTERESTS = 16;\n\n/** Command returning a truncated tool output whole. */\nexport const DEEP_AGENT_HISTORY_TOOL_OUTPUT_COMMAND = \"history/tool_output\";\n\n/** Command returning one stored message whole (provenance and full tool output included). */\nexport const DEEP_AGENT_HISTORY_MESSAGE_COMMAND = \"history/message\";\n\n/** Wire key marking a tool message whose content was truncated. */\nexport const DEEP_AGENT_TRUNCATED_CONTENT_KEY = \"athena_content_truncated\";\n\n/**\n * Wire key on a running `task` card whose nested transcript rides cut to its\n * newest steps: `{ messages, tool_calls }` over the whole stored transcript.\n */\nexport const DEEP_AGENT_TRUNCATED_LANE_KEY = \"athena_lane_truncated\";\n\n/**\n * Wire key on a `task` card, and on an in-eval lane's `ptc_subagents` entry,\n * carrying the whole lane's token use however much of the lane the wire\n * carries: `{ input_tokens, output_tokens, cache_read_input_tokens,\n * cache_creation_input_tokens }`, the input counting its cache reads and\n * writes. Absent while the lane's steps report no usage.\n */\nexport const DEEP_AGENT_LANE_USAGE_KEY = \"athena_lane_usage\";\n\n/**\n * The newest nested messages a cut card carries whole; the entries ahead\n * of them are the older assistant turns that requested results among\n * them, cut to those calls.\n */\nexport const DEEP_AGENT_RUNNING_LANE_WIRE_MESSAGES = 8;\n\n/**\n * Key of a followed lane's window (`follows[ns]` on a resolution whose\n * request added `follow: {before}`) naming the `task` call whose card\n * holds the lane.\n */\nexport const DEEP_AGENT_FOLLOW_TOOL_CALL_ID_KEY = \"toolCallId\";\n\n/** The most lane steps one attach follows, across every lane. */\nexport const DEEP_AGENT_MAX_FOLLOWED_STEPS = 200;\n\n/**\n * The first contract version a client declares to see a finished card cut\n * like a running one (and to follow lanes and page them through\n * `history/lane`). Below it, or declaring nothing, finished cards ride whole.\n */\nexport const DEEP_AGENT_LANE_CUT_PROTOCOL_VERSION = 2;\n\n/**\n * Last element of the key a cut finished card's document rides under:\n * `[threadId, \"main\", messageId, \"cut\"]`. A view holds that key or the\n * card's own, never both.\n */\nexport const DEEP_AGENT_CUT_LANE_DOCUMENT = \"cut\";\n\n/**\n * Command returning one page of a card's nested transcript, oldest first:\n * `{ messageId, before, at? }` answers\n * `{ messageId, toolCallId, ns, steps, more: { before }, total }`; the page\n * holds the newest `before` entries, or those strictly older than `at`.\n */\nexport const DEEP_AGENT_HISTORY_LANE_COMMAND = \"history/lane\";\n\n/** The most entries one `history/lane` page asks for. */\nexport const DEEP_AGENT_MAX_LANE_PAGE = 200;\n\n/** The most encoded characters one `history/lane` page carries (at least one entry). */\nexport const DEEP_AGENT_HISTORY_LANE_PAGE_CHARS = 1048576;\n\n/**\n * Set on the last step of a cut finished card whose text is the card's own\n * `content` (the subagent's report): the step rides with empty content, and\n * the card's `content` is its text.\n */\nexport const DEEP_AGENT_REPEATS_RESULT_KEY = \"athena_content_repeats_result\";\n\n/** Most inline-image payload characters one message carries whole on the wire. */\nexport const DEEP_AGENT_INLINE_IMAGE_WIRE_BUDGET = 4194304;\n\n/** Wire key on an image block left off the wire: `{ index, chars, mediaType }`. */\nexport const DEEP_AGENT_OMITTED_IMAGE_KEY = \"athena_image_omitted\";\n\n/** The image an omitted block carries instead of its own (a neutral PNG tile). */\nexport const DEEP_AGENT_OMITTED_IMAGE_PLACEHOLDER_URL =\n \"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAKAAAAB4AQMAAABPbGssAAAABlBMVEXi6PCUo7jao11HAAAA6ElEQVR42u2UyW3DMBBF3wxogEd2EJbCElKQDRCwC3MpSRc5eLuYokgNLEUxctK/CHyanQts2vRO3QdlALVsXsBvecqxxr1ob0A5GlDJU+hICxN54p/qXAx/+FpoeeE8hTerzfvByn7ifzpaBtWCOwv6bMVMBgzRgNGKmUL9McDs4XOSyEHuoKCI76AiqOugg+y0gx6SN+YQg3QwALGk19pQSKV/reOocyoww27oU5sxhAbKUNgIqrVxrvnovJ80MFgxYy23wtTss44tmL+bAuOE2p2o0fJa3iW/6iR/lEfx8kv3TZtW6AFk5Sf3k+GTswAAAABJRU5ErkJggg==\";\n\n/**\n * Command returning one inline image of a stored message in chunks:\n * `{ messageId, index, offset? }` answers\n * `{ messageId, index, mediaType, offset, total, chunk, next }`; the\n * chunks joined in order are the image's `data:` URL, and `next` is\n * the offset to ask for next (`null` after the last chunk).\n */\nexport const DEEP_AGENT_HISTORY_IMAGE_COMMAND = \"history/image\";\n\n/**\n * Command returning one inline image of a lane step in chunks, as\n * `history/image` does a stored message's: `{ messageId | lane, step,\n * index, offset? }` answers `{ messageId, lane, step, index, mediaType,\n * offset, total, chunk, next }`, with `messageId` null for an in-eval\n * lane and `lane` null for a card.\n */\nexport const DEEP_AGENT_HISTORY_LANE_IMAGE_COMMAND = \"history/lane_image\";\n"],"names":[],"mappings":";;AAyHO,MAAM,yBAAyB;AAAA,EACpC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF;AAK8D,IAAI;AAAA,EAChE;AACF;AAGO,MAAM,kCAAkC;AAAA,EAC7C;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF;AAMuE,IAAI;AAAA,EACzE;AACF;AAGO,MAAM,4BAA4B;AAAA,EACvC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF;AAKiE,IAAI;AAAA,EACnE;AACF;AAMO,MAAM,6BAA6B;AAAA,EACxC,OAAO;AAAA,EACP,aAAa;AAAA,EACb,cAAc;AAChB;AAGO,MAAM,uBAAuB;AAAA,EAClC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF;AAK4D,IAAI;AAAA,EAC9D;AACF;AA2BO,MAAM,+BAA+B;AAQrC,MAAM,oCAAoC;AAE1C,MAAM,kCAAkC;AA+BxC,MAAM,qCACX;AAGK,MAAM,mCAAmC;AAGzC,MAAM,gCAAgC;AAGtC,MAAM,+BAA+B;AAMrC,MAAM,qBAAqB;AAG3B,MAAM,oCAAoC;AAG1C,MAAM,gCAAgC;AAEtC,MAAM,gCAAgC;AAGtC,MAAM,2BAA2B;AAGjC,MAAM,yCAAyC;AAG/C,MAAM,qCAAqC;AAG3C,MAAM,mCAAmC;AAMzC,MAAM,gCAAgC;AAStC,MAAM,4BAA4B;AAwBlC,MAAM,uCAAuC;AAO7C,MAAM,+BAA+B;AAQrC,MAAM,kCAAkC;AAGxC,MAAM,2BAA2B;AAUjC,MAAM,gCAAgC;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -1,19 +1,19 @@
1
1
  /** `runConfig.custom` keys parsed by agora's `parse_deep_agent_run_config`. */
2
- export declare const RUN_CONFIG_PARSED_CUSTOM_KEYS: readonly ["agent_catalog_asset_ids", "approve_changes", "catalog_asset_ids", "coding_worker_asset_id", "coding_workers", "compiled_subagents", "declined_toolkit_ids", "drive_mounts", "enable_interpreter", "enable_persistent_fs", "enable_sandbox", "enable_skills", "enabled_tools", "environment", "environment_id", "environment_name", "excluded_middleware", "excluded_tools", "extra_middleware", "include_citation_instructions", "interpreter_max_ptc_calls", "interpreter_mode", "interpreter_ptc", "interpreter_ptc_exclusive", "interpreter_runtime", "interpreter_subagents", "interpreter_timeout_seconds", "interrupt_on", "knowledge_base", "mcp_server_configs", "mcp_servers", "memory", "outbound_approval_allowlist", "permissions", "project_id", "read_only", "recursion_limit", "run_label", "sandbox_runtime", "secret_asset_ids", "session_computer", "session_machine", "session_vm_retention", "skill_asset_ids", "skills", "subagents", "system_prompt", "tool_description_overrides", "voice_update_handle", "workbench"];
2
+ export declare const RUN_CONFIG_PARSED_CUSTOM_KEYS: readonly ["agent_catalog_asset_ids", "approve_changes", "catalog_asset_ids", "channel_reply_turn", "coding_worker_asset_id", "coding_workers", "compiled_subagents", "declined_toolkit_ids", "drive_mounts", "enable_interpreter", "enable_persistent_fs", "enable_sandbox", "enable_skills", "enabled_tools", "environment", "environment_id", "environment_name", "excluded_middleware", "excluded_tools", "extra_middleware", "include_citation_instructions", "interpreter_max_ptc_calls", "interpreter_mode", "interpreter_ptc", "interpreter_ptc_exclusive", "interpreter_runtime", "interpreter_subagents", "interpreter_timeout_seconds", "interrupt_on", "knowledge_base", "mcp_server_configs", "mcp_servers", "memory", "outbound_approval_allowlist", "permissions", "pre_approved_tools", "project_id", "read_only", "recursion_limit", "run_label", "sandbox_runtime", "secret_asset_ids", "session_computer", "session_machine", "session_vm_retention", "skill_asset_ids", "skills", "subagents", "system_prompt", "tool_description_overrides", "voice_update_handle", "workbench"];
3
3
  /** `runConfig.custom` keys consumed by the surrounding deep-agent request machinery rather than the capability parser. */
4
- export declare const RUN_CONFIG_COMPANION_CUSTOM_KEYS: readonly ["agent", "allowed_tab_ids", "app_id", "channel", "client_tools", "collab_agent_id", "collab_channel_id", "collab_entry_channel_id", "custom_tool_configs", "deterministic", "device_id", "device_toolkits", "dry_run", "enabled_toolkits", "entry_point", "from_stored_config", "frontend_available", "generative_frame_inline", "github_identity", "max_tokens", "middleware", "model", "muses_enabled", "muses_recall_enabled", "office_context", "panel_config", "posthog_session_id", "run_budget", "runtime", "session_id", "session_origin_kind", "session_tab_id", "skip_title_generation", "source_aop_id", "start_channel", "structured_output", "temperature", "tool_limit_override", "trigger_type", "workspace_id"];
4
+ export declare const RUN_CONFIG_COMPANION_CUSTOM_KEYS: readonly ["addressed_agents", "agent", "agent_available_toolkits", "allowed_tab_ids", "app_id", "channel", "channel_router", "client_tools", "collab_agent_id", "collab_channel_id", "collab_entry_channel_id", "custom_tool_configs", "deterministic", "device_id", "device_toolkits", "dry_run", "enabled_toolkits", "entry_point", "from_stored_config", "frontend_available", "generative_frame_inline", "github_identity", "max_tokens", "middleware", "model", "muses_enabled", "muses_recall_enabled", "office_context", "panel_config", "posthog_session_id", "run_budget", "runtime", "session_id", "session_origin_kind", "session_tab_id", "skip_title_generation", "source_aop_id", "start_channel", "structured_output", "temperature", "tool_limit_override", "trigger_type", "workspace_id"];
5
5
  /** Every `runConfig.custom` key some deep-agent request consumer reads. A key outside this set is invisible to the run and trips agora's unknown-key telemetry. */
6
- export declare const RUN_CONFIG_CUSTOM_KEYS: readonly ["agent", "agent_catalog_asset_ids", "allowed_tab_ids", "app_id", "approve_changes", "catalog_asset_ids", "channel", "client_tools", "coding_worker_asset_id", "coding_workers", "collab_agent_id", "collab_channel_id", "collab_entry_channel_id", "compiled_subagents", "custom_tool_configs", "declined_toolkit_ids", "deterministic", "device_id", "device_toolkits", "drive_mounts", "dry_run", "enable_interpreter", "enable_persistent_fs", "enable_sandbox", "enable_skills", "enabled_toolkits", "enabled_tools", "entry_point", "environment", "environment_id", "environment_name", "excluded_middleware", "excluded_tools", "extra_middleware", "from_stored_config", "frontend_available", "generative_frame_inline", "github_identity", "include_citation_instructions", "interpreter_max_ptc_calls", "interpreter_mode", "interpreter_ptc", "interpreter_ptc_exclusive", "interpreter_runtime", "interpreter_subagents", "interpreter_timeout_seconds", "interrupt_on", "knowledge_base", "max_tokens", "mcp_server_configs", "mcp_servers", "memory", "middleware", "model", "muses_enabled", "muses_recall_enabled", "office_context", "outbound_approval_allowlist", "panel_config", "permissions", "posthog_session_id", "project_id", "read_only", "recursion_limit", "run_budget", "run_label", "runtime", "sandbox_runtime", "secret_asset_ids", "session_computer", "session_id", "session_machine", "session_origin_kind", "session_tab_id", "session_vm_retention", "skill_asset_ids", "skills", "skip_title_generation", "source_aop_id", "start_channel", "structured_output", "subagents", "system_prompt", "temperature", "tool_description_overrides", "tool_limit_override", "trigger_type", "voice_update_handle", "workbench", "workspace_id"];
6
+ export declare const RUN_CONFIG_CUSTOM_KEYS: readonly ["addressed_agents", "agent", "agent_available_toolkits", "agent_catalog_asset_ids", "allowed_tab_ids", "app_id", "approve_changes", "catalog_asset_ids", "channel", "channel_reply_turn", "channel_router", "client_tools", "coding_worker_asset_id", "coding_workers", "collab_agent_id", "collab_channel_id", "collab_entry_channel_id", "compiled_subagents", "custom_tool_configs", "declined_toolkit_ids", "deterministic", "device_id", "device_toolkits", "drive_mounts", "dry_run", "enable_interpreter", "enable_persistent_fs", "enable_sandbox", "enable_skills", "enabled_toolkits", "enabled_tools", "entry_point", "environment", "environment_id", "environment_name", "excluded_middleware", "excluded_tools", "extra_middleware", "from_stored_config", "frontend_available", "generative_frame_inline", "github_identity", "include_citation_instructions", "interpreter_max_ptc_calls", "interpreter_mode", "interpreter_ptc", "interpreter_ptc_exclusive", "interpreter_runtime", "interpreter_subagents", "interpreter_timeout_seconds", "interrupt_on", "knowledge_base", "max_tokens", "mcp_server_configs", "mcp_servers", "memory", "middleware", "model", "muses_enabled", "muses_recall_enabled", "office_context", "outbound_approval_allowlist", "panel_config", "permissions", "posthog_session_id", "pre_approved_tools", "project_id", "read_only", "recursion_limit", "run_budget", "run_label", "runtime", "sandbox_runtime", "secret_asset_ids", "session_computer", "session_id", "session_machine", "session_origin_kind", "session_tab_id", "session_vm_retention", "skill_asset_ids", "skills", "skip_title_generation", "source_aop_id", "start_channel", "structured_output", "subagents", "system_prompt", "temperature", "tool_description_overrides", "tool_limit_override", "trigger_type", "voice_update_handle", "workbench", "workspace_id"];
7
7
  export type RunConfigCustomKey = (typeof RUN_CONFIG_CUSTOM_KEYS)[number];
8
8
  /** Fast membership checks for builder/test assertions. */
9
9
  export declare const RUN_CONFIG_CUSTOM_KEY_SET: ReadonlySet<string>;
10
10
  /** `runConfig.custom` keys a client still carries per send on a thread with server config; every other key is dropped at dispatch. */
11
- export declare const RUN_CONFIG_PER_SEND_CUSTOM_KEYS: readonly ["agent", "allowed_tab_ids", "app_id", "channel", "client_tools", "collab_channel_id", "collab_entry_channel_id", "deterministic", "device_id", "device_toolkits", "dry_run", "entry_point", "from_stored_config", "frontend_available", "generative_frame_inline", "github_identity", "muses_enabled", "muses_recall_enabled", "office_context", "posthog_session_id", "project_id", "read_only", "run_budget", "runtime", "session_id", "session_origin_kind", "session_tab_id", "skip_title_generation", "source_aop_id", "start_channel", "structured_output", "tool_limit_override", "trigger_type", "voice_update_handle", "workspace_id"];
11
+ export declare const RUN_CONFIG_PER_SEND_CUSTOM_KEYS: readonly ["addressed_agents", "agent", "agent_available_toolkits", "allowed_tab_ids", "app_id", "channel", "channel_reply_turn", "channel_router", "client_tools", "collab_channel_id", "collab_entry_channel_id", "deterministic", "device_id", "device_toolkits", "dry_run", "entry_point", "from_stored_config", "frontend_available", "generative_frame_inline", "github_identity", "muses_enabled", "muses_recall_enabled", "office_context", "posthog_session_id", "project_id", "read_only", "run_budget", "runtime", "session_id", "session_origin_kind", "session_tab_id", "skip_title_generation", "source_aop_id", "start_channel", "structured_output", "tool_limit_override", "trigger_type", "voice_update_handle", "workspace_id"];
12
12
  export type RunConfigPerSendCustomKey = (typeof RUN_CONFIG_PER_SEND_CUSTOM_KEYS)[number];
13
13
  /** Fast membership checks for builder/test assertions. */
14
14
  export declare const RUN_CONFIG_PER_SEND_CUSTOM_KEY_SET: ReadonlySet<string>;
15
15
  /** Keys the thread's server config lane owns — changed only through the `config/*` commands, never per send. */
16
- export declare const THREAD_CONFIG_CUSTOM_KEYS: readonly ["agent_catalog_asset_ids", "approve_changes", "catalog_asset_ids", "coding_worker_asset_id", "coding_workers", "collab_agent_id", "compiled_subagents", "custom_tool_configs", "declined_toolkit_ids", "drive_mounts", "enable_interpreter", "enable_persistent_fs", "enable_sandbox", "enable_skills", "enabled_toolkits", "enabled_tools", "environment", "environment_id", "environment_name", "excluded_middleware", "excluded_tools", "extra_middleware", "include_citation_instructions", "interpreter_max_ptc_calls", "interpreter_mode", "interpreter_ptc", "interpreter_ptc_exclusive", "interpreter_runtime", "interpreter_subagents", "interpreter_timeout_seconds", "interrupt_on", "knowledge_base", "max_tokens", "mcp_server_configs", "mcp_servers", "memory", "middleware", "model", "outbound_approval_allowlist", "permissions", "recursion_limit", "run_label", "sandbox_runtime", "secret_asset_ids", "session_computer", "session_machine", "session_vm_retention", "skill_asset_ids", "skills", "subagents", "system_prompt", "temperature", "tool_description_overrides", "workbench"];
16
+ export declare const THREAD_CONFIG_CUSTOM_KEYS: readonly ["agent_catalog_asset_ids", "approve_changes", "catalog_asset_ids", "coding_worker_asset_id", "coding_workers", "collab_agent_id", "compiled_subagents", "custom_tool_configs", "declined_toolkit_ids", "drive_mounts", "enable_interpreter", "enable_persistent_fs", "enable_sandbox", "enable_skills", "enabled_toolkits", "enabled_tools", "environment", "environment_id", "environment_name", "excluded_middleware", "excluded_tools", "extra_middleware", "include_citation_instructions", "interpreter_max_ptc_calls", "interpreter_mode", "interpreter_ptc", "interpreter_ptc_exclusive", "interpreter_runtime", "interpreter_subagents", "interpreter_timeout_seconds", "interrupt_on", "knowledge_base", "max_tokens", "mcp_server_configs", "mcp_servers", "memory", "middleware", "model", "outbound_approval_allowlist", "permissions", "pre_approved_tools", "recursion_limit", "run_label", "sandbox_runtime", "secret_asset_ids", "session_computer", "session_machine", "session_vm_retention", "skill_asset_ids", "skills", "subagents", "system_prompt", "temperature", "tool_description_overrides", "workbench"];
17
17
  export type ThreadConfigCustomKey = (typeof THREAD_CONFIG_CUSTOM_KEYS)[number];
18
18
  /** Fast membership checks for builder/test assertions. */
19
19
  export declare const THREAD_CONFIG_CUSTOM_KEY_SET: ReadonlySet<string>;
@@ -26,7 +26,7 @@ export declare const DEEP_AGENT_CONFIG_COMMANDS: {
26
26
  readonly toolsDisable: "config/tools/disable";
27
27
  };
28
28
  /** `start_channel` values the session substrate stamps as provenance; anything else clamps to "web". */
29
- export declare const KNOWN_START_CHANNELS: readonly ["agent_orchestration", "api", "automation", "chrome_extension", "cli", "comment_agent", "default_voice", "desktop_app", "email", "mobile_app", "office_addin", "orchestration", "programmatic", "slack", "sms", "task", "teams", "voice", "voice_memo", "web"];
29
+ export declare const KNOWN_START_CHANNELS: readonly ["agent_orchestration", "api", "automation", "chrome_extension", "cli", "comment_agent", "default_voice", "desktop_app", "email", "meetings", "mobile_app", "mobile_app_voice", "office_addin", "orchestration", "programmatic", "slack", "sms", "task", "teams", "voice", "voice_memo", "web"];
30
30
  export type KnownStartChannel = (typeof KNOWN_START_CHANNELS)[number];
31
31
  /** Fast membership checks for builder/test assertions. */
32
32
  export declare const KNOWN_START_CHANNEL_SET: ReadonlySet<string>;
@@ -1,11 +1,15 @@
1
1
  const RUN_CONFIG_CUSTOM_KEYS = [
2
+ "addressed_agents",
2
3
  "agent",
4
+ "agent_available_toolkits",
3
5
  "agent_catalog_asset_ids",
4
6
  "allowed_tab_ids",
5
7
  "app_id",
6
8
  "approve_changes",
7
9
  "catalog_asset_ids",
8
10
  "channel",
11
+ "channel_reply_turn",
12
+ "channel_router",
9
13
  "client_tools",
10
14
  "coding_worker_asset_id",
11
15
  "coding_workers",
@@ -60,6 +64,7 @@ const RUN_CONFIG_CUSTOM_KEYS = [
60
64
  "panel_config",
61
65
  "permissions",
62
66
  "posthog_session_id",
67
+ "pre_approved_tools",
63
68
  "project_id",
64
69
  "read_only",
65
70
  "recursion_limit",
@@ -94,10 +99,14 @@ new Set(
94
99
  RUN_CONFIG_CUSTOM_KEYS
95
100
  );
96
101
  const RUN_CONFIG_PER_SEND_CUSTOM_KEYS = [
102
+ "addressed_agents",
97
103
  "agent",
104
+ "agent_available_toolkits",
98
105
  "allowed_tab_ids",
99
106
  "app_id",
100
107
  "channel",
108
+ "channel_reply_turn",
109
+ "channel_router",
101
110
  "client_tools",
102
111
  "collab_channel_id",
103
112
  "collab_entry_channel_id",
@@ -174,6 +183,7 @@ const THREAD_CONFIG_CUSTOM_KEYS = [
174
183
  "model",
175
184
  "outbound_approval_allowlist",
176
185
  "permissions",
186
+ "pre_approved_tools",
177
187
  "recursion_limit",
178
188
  "run_label",
179
189
  "sandbox_runtime",
@@ -207,7 +217,9 @@ const KNOWN_START_CHANNELS = [
207
217
  "default_voice",
208
218
  "desktop_app",
209
219
  "email",
220
+ "meetings",
210
221
  "mobile_app",
222
+ "mobile_app_voice",
211
223
  "office_addin",
212
224
  "orchestration",
213
225
  "programmatic",