@agent-native/core 0.93.0 → 0.94.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (1197) hide show
  1. package/corpus/README.md +2 -2
  2. package/corpus/core/CHANGELOG.md +31 -0
  3. package/corpus/core/docs/content/a2a-protocol.mdx +21 -5
  4. package/corpus/core/docs/content/actions.mdx +9 -23
  5. package/corpus/core/docs/content/agent-mentions.mdx +31 -29
  6. package/corpus/core/docs/content/agent-native-toolkit.mdx +15 -6
  7. package/corpus/core/docs/content/agent-surfaces.mdx +9 -13
  8. package/corpus/core/docs/content/agent-teams.mdx +1 -0
  9. package/corpus/core/docs/content/authentication.mdx +10 -3
  10. package/corpus/core/docs/content/automation-connectors.mdx +82 -39
  11. package/corpus/core/docs/content/automations.mdx +17 -3
  12. package/corpus/core/docs/content/blueprint-installer.mdx +11 -4
  13. package/corpus/core/docs/content/cli-adapters.mdx +9 -6
  14. package/corpus/core/docs/content/client.mdx +16 -0
  15. package/corpus/core/docs/content/cloneable-saas.mdx +14 -11
  16. package/corpus/core/docs/content/code-agents-ui.mdx +65 -0
  17. package/corpus/core/docs/content/components.mdx +30 -14
  18. package/corpus/core/docs/content/context-awareness.mdx +27 -15
  19. package/corpus/core/docs/content/creating-templates.mdx +15 -9
  20. package/corpus/core/docs/content/cross-app-sso.mdx +16 -6
  21. package/corpus/core/docs/content/data-programs.mdx +1 -1
  22. package/corpus/core/docs/content/database.mdx +17 -5
  23. package/corpus/core/docs/content/deployment.mdx +19 -18
  24. package/corpus/core/docs/content/dispatch.mdx +6 -2
  25. package/corpus/core/docs/content/drop-in-agent.mdx +10 -4
  26. package/corpus/core/docs/content/durable-background-runs.mdx +9 -5
  27. package/corpus/core/docs/content/durable-resume.mdx +9 -4
  28. package/corpus/core/docs/content/embedding-sdk.mdx +26 -8
  29. package/corpus/core/docs/content/evals.mdx +3 -5
  30. package/corpus/core/docs/content/extensions.mdx +22 -9
  31. package/corpus/core/docs/content/external-agents.mdx +25 -34
  32. package/corpus/core/docs/content/faq.mdx +8 -0
  33. package/corpus/core/docs/content/file-uploads.mdx +12 -3
  34. package/corpus/core/docs/content/frames.mdx +16 -0
  35. package/corpus/core/docs/content/generative-ui.mdx +1 -1
  36. package/corpus/core/docs/content/getting-started.mdx +34 -21
  37. package/corpus/core/docs/content/harness-agents.mdx +8 -4
  38. package/corpus/core/docs/content/human-approval.mdx +8 -3
  39. package/corpus/core/docs/content/internationalization.mdx +9 -4
  40. package/corpus/core/docs/content/key-concepts.mdx +13 -20
  41. package/corpus/core/docs/content/local-file-mode.mdx +14 -8
  42. package/corpus/core/docs/content/locales/ar-SA/actions.mdx +2 -2
  43. package/corpus/core/docs/content/locales/ar-SA/agent-native-toolkit.mdx +2 -2
  44. package/corpus/core/docs/content/locales/ar-SA/agent-surfaces.mdx +8 -10
  45. package/corpus/core/docs/content/locales/ar-SA/agent-teams.mdx +1 -0
  46. package/corpus/core/docs/content/locales/ar-SA/authentication.mdx +1 -1
  47. package/corpus/core/docs/content/locales/ar-SA/components.mdx +11 -1
  48. package/corpus/core/docs/content/locales/ar-SA/creating-templates.mdx +3 -7
  49. package/corpus/core/docs/content/locales/ar-SA/cross-app-sso.mdx +16 -6
  50. package/corpus/core/docs/content/locales/ar-SA/deployment.mdx +8 -0
  51. package/corpus/core/docs/content/locales/ar-SA/external-agents.mdx +2 -7
  52. package/corpus/core/docs/content/locales/ar-SA/key-concepts.mdx +13 -20
  53. package/corpus/core/docs/content/locales/ar-SA/multi-tenancy.mdx +5 -5
  54. package/corpus/core/docs/content/locales/ar-SA/notifications.mdx +18 -10
  55. package/corpus/core/docs/content/locales/ar-SA/processors.mdx +11 -5
  56. package/corpus/core/docs/content/locales/ar-SA/server.mdx +17 -10
  57. package/corpus/core/docs/content/locales/ar-SA/sharing.mdx +10 -10
  58. package/corpus/core/docs/content/locales/ar-SA/skills-guide.mdx +34 -17
  59. package/corpus/core/docs/content/locales/ar-SA/template-assets.mdx +16 -13
  60. package/corpus/core/docs/content/locales/ar-SA/template-brain.mdx +3 -1
  61. package/corpus/core/docs/content/locales/ar-SA/template-clips.mdx +3 -3
  62. package/corpus/core/docs/content/locales/ar-SA/template-design.mdx +3 -1
  63. package/corpus/core/docs/content/locales/ar-SA/template-dispatch.mdx +5 -1
  64. package/corpus/core/docs/content/locales/ar-SA/template-mail.mdx +8 -0
  65. package/corpus/core/docs/content/locales/ar-SA/tracking.mdx +9 -6
  66. package/corpus/core/docs/content/locales/ar-SA/using-your-agent.mdx +0 -7
  67. package/corpus/core/docs/content/locales/ar-SA/voice-input.mdx +6 -0
  68. package/corpus/core/docs/content/locales/ar-SA/workspace-connections.mdx +9 -2
  69. package/corpus/core/docs/content/locales/ar-SA/workspace.mdx +19 -18
  70. package/corpus/core/docs/content/locales/de-DE/actions.mdx +2 -2
  71. package/corpus/core/docs/content/locales/de-DE/agent-native-toolkit.mdx +2 -2
  72. package/corpus/core/docs/content/locales/de-DE/agent-surfaces.mdx +8 -10
  73. package/corpus/core/docs/content/locales/de-DE/agent-teams.mdx +1 -0
  74. package/corpus/core/docs/content/locales/de-DE/authentication.mdx +1 -1
  75. package/corpus/core/docs/content/locales/de-DE/components.mdx +11 -1
  76. package/corpus/core/docs/content/locales/de-DE/creating-templates.mdx +3 -7
  77. package/corpus/core/docs/content/locales/de-DE/cross-app-sso.mdx +16 -6
  78. package/corpus/core/docs/content/locales/de-DE/deployment.mdx +8 -0
  79. package/corpus/core/docs/content/locales/de-DE/external-agents.mdx +3 -7
  80. package/corpus/core/docs/content/locales/de-DE/key-concepts.mdx +13 -20
  81. package/corpus/core/docs/content/locales/de-DE/multi-tenancy.mdx +5 -5
  82. package/corpus/core/docs/content/locales/de-DE/notifications.mdx +18 -10
  83. package/corpus/core/docs/content/locales/de-DE/processors.mdx +11 -5
  84. package/corpus/core/docs/content/locales/de-DE/server.mdx +18 -10
  85. package/corpus/core/docs/content/locales/de-DE/sharing.mdx +10 -10
  86. package/corpus/core/docs/content/locales/de-DE/skills-guide.mdx +34 -17
  87. package/corpus/core/docs/content/locales/de-DE/template-assets.mdx +16 -13
  88. package/corpus/core/docs/content/locales/de-DE/template-brain.mdx +3 -1
  89. package/corpus/core/docs/content/locales/de-DE/template-clips.mdx +3 -3
  90. package/corpus/core/docs/content/locales/de-DE/template-design.mdx +3 -1
  91. package/corpus/core/docs/content/locales/de-DE/template-dispatch.mdx +5 -1
  92. package/corpus/core/docs/content/locales/de-DE/template-mail.mdx +8 -0
  93. package/corpus/core/docs/content/locales/de-DE/tracking.mdx +9 -6
  94. package/corpus/core/docs/content/locales/de-DE/using-your-agent.mdx +0 -7
  95. package/corpus/core/docs/content/locales/de-DE/voice-input.mdx +6 -0
  96. package/corpus/core/docs/content/locales/de-DE/workspace-connections.mdx +9 -2
  97. package/corpus/core/docs/content/locales/de-DE/workspace.mdx +19 -18
  98. package/corpus/core/docs/content/locales/es-ES/actions.mdx +2 -2
  99. package/corpus/core/docs/content/locales/es-ES/agent-native-toolkit.mdx +2 -2
  100. package/corpus/core/docs/content/locales/es-ES/agent-surfaces.mdx +8 -10
  101. package/corpus/core/docs/content/locales/es-ES/agent-teams.mdx +1 -0
  102. package/corpus/core/docs/content/locales/es-ES/authentication.mdx +1 -1
  103. package/corpus/core/docs/content/locales/es-ES/components.mdx +11 -1
  104. package/corpus/core/docs/content/locales/es-ES/creating-templates.mdx +3 -7
  105. package/corpus/core/docs/content/locales/es-ES/cross-app-sso.mdx +16 -6
  106. package/corpus/core/docs/content/locales/es-ES/deployment.mdx +8 -0
  107. package/corpus/core/docs/content/locales/es-ES/external-agents.mdx +3 -7
  108. package/corpus/core/docs/content/locales/es-ES/key-concepts.mdx +13 -20
  109. package/corpus/core/docs/content/locales/es-ES/multi-tenancy.mdx +5 -5
  110. package/corpus/core/docs/content/locales/es-ES/notifications.mdx +18 -10
  111. package/corpus/core/docs/content/locales/es-ES/processors.mdx +11 -5
  112. package/corpus/core/docs/content/locales/es-ES/server.mdx +17 -10
  113. package/corpus/core/docs/content/locales/es-ES/sharing.mdx +10 -10
  114. package/corpus/core/docs/content/locales/es-ES/skills-guide.mdx +34 -17
  115. package/corpus/core/docs/content/locales/es-ES/template-assets.mdx +16 -13
  116. package/corpus/core/docs/content/locales/es-ES/template-brain.mdx +3 -1
  117. package/corpus/core/docs/content/locales/es-ES/template-clips.mdx +3 -3
  118. package/corpus/core/docs/content/locales/es-ES/template-design.mdx +3 -1
  119. package/corpus/core/docs/content/locales/es-ES/template-dispatch.mdx +5 -1
  120. package/corpus/core/docs/content/locales/es-ES/template-mail.mdx +8 -0
  121. package/corpus/core/docs/content/locales/es-ES/tracking.mdx +9 -6
  122. package/corpus/core/docs/content/locales/es-ES/using-your-agent.mdx +0 -7
  123. package/corpus/core/docs/content/locales/es-ES/voice-input.mdx +6 -0
  124. package/corpus/core/docs/content/locales/es-ES/workspace-connections.mdx +9 -2
  125. package/corpus/core/docs/content/locales/es-ES/workspace.mdx +19 -18
  126. package/corpus/core/docs/content/locales/fr-FR/actions.mdx +2 -2
  127. package/corpus/core/docs/content/locales/fr-FR/agent-native-toolkit.mdx +2 -2
  128. package/corpus/core/docs/content/locales/fr-FR/agent-surfaces.mdx +8 -10
  129. package/corpus/core/docs/content/locales/fr-FR/agent-teams.mdx +1 -0
  130. package/corpus/core/docs/content/locales/fr-FR/authentication.mdx +1 -1
  131. package/corpus/core/docs/content/locales/fr-FR/components.mdx +11 -1
  132. package/corpus/core/docs/content/locales/fr-FR/creating-templates.mdx +3 -7
  133. package/corpus/core/docs/content/locales/fr-FR/cross-app-sso.mdx +16 -6
  134. package/corpus/core/docs/content/locales/fr-FR/deployment.mdx +8 -0
  135. package/corpus/core/docs/content/locales/fr-FR/external-agents.mdx +3 -7
  136. package/corpus/core/docs/content/locales/fr-FR/key-concepts.mdx +13 -20
  137. package/corpus/core/docs/content/locales/fr-FR/multi-tenancy.mdx +5 -5
  138. package/corpus/core/docs/content/locales/fr-FR/notifications.mdx +18 -10
  139. package/corpus/core/docs/content/locales/fr-FR/processors.mdx +11 -5
  140. package/corpus/core/docs/content/locales/fr-FR/server.mdx +17 -10
  141. package/corpus/core/docs/content/locales/fr-FR/sharing.mdx +10 -10
  142. package/corpus/core/docs/content/locales/fr-FR/skills-guide.mdx +34 -17
  143. package/corpus/core/docs/content/locales/fr-FR/template-assets.mdx +16 -13
  144. package/corpus/core/docs/content/locales/fr-FR/template-brain.mdx +3 -1
  145. package/corpus/core/docs/content/locales/fr-FR/template-clips.mdx +3 -3
  146. package/corpus/core/docs/content/locales/fr-FR/template-design.mdx +3 -1
  147. package/corpus/core/docs/content/locales/fr-FR/template-dispatch.mdx +5 -1
  148. package/corpus/core/docs/content/locales/fr-FR/template-mail.mdx +8 -0
  149. package/corpus/core/docs/content/locales/fr-FR/tracking.mdx +9 -6
  150. package/corpus/core/docs/content/locales/fr-FR/using-your-agent.mdx +0 -7
  151. package/corpus/core/docs/content/locales/fr-FR/voice-input.mdx +6 -0
  152. package/corpus/core/docs/content/locales/fr-FR/workspace-connections.mdx +9 -2
  153. package/corpus/core/docs/content/locales/fr-FR/workspace.mdx +19 -18
  154. package/corpus/core/docs/content/locales/hi-IN/actions.mdx +2 -2
  155. package/corpus/core/docs/content/locales/hi-IN/agent-native-toolkit.mdx +2 -2
  156. package/corpus/core/docs/content/locales/hi-IN/agent-surfaces.mdx +8 -10
  157. package/corpus/core/docs/content/locales/hi-IN/agent-teams.mdx +1 -0
  158. package/corpus/core/docs/content/locales/hi-IN/authentication.mdx +1 -1
  159. package/corpus/core/docs/content/locales/hi-IN/components.mdx +11 -1
  160. package/corpus/core/docs/content/locales/hi-IN/creating-templates.mdx +3 -7
  161. package/corpus/core/docs/content/locales/hi-IN/cross-app-sso.mdx +16 -6
  162. package/corpus/core/docs/content/locales/hi-IN/deployment.mdx +8 -0
  163. package/corpus/core/docs/content/locales/hi-IN/external-agents.mdx +2 -7
  164. package/corpus/core/docs/content/locales/hi-IN/key-concepts.mdx +13 -20
  165. package/corpus/core/docs/content/locales/hi-IN/multi-tenancy.mdx +5 -5
  166. package/corpus/core/docs/content/locales/hi-IN/notifications.mdx +18 -10
  167. package/corpus/core/docs/content/locales/hi-IN/processors.mdx +11 -5
  168. package/corpus/core/docs/content/locales/hi-IN/server.mdx +17 -10
  169. package/corpus/core/docs/content/locales/hi-IN/sharing.mdx +10 -10
  170. package/corpus/core/docs/content/locales/hi-IN/skills-guide.mdx +34 -17
  171. package/corpus/core/docs/content/locales/hi-IN/template-assets.mdx +16 -13
  172. package/corpus/core/docs/content/locales/hi-IN/template-brain.mdx +3 -1
  173. package/corpus/core/docs/content/locales/hi-IN/template-clips.mdx +3 -3
  174. package/corpus/core/docs/content/locales/hi-IN/template-design.mdx +3 -1
  175. package/corpus/core/docs/content/locales/hi-IN/template-dispatch.mdx +5 -1
  176. package/corpus/core/docs/content/locales/hi-IN/template-mail.mdx +8 -0
  177. package/corpus/core/docs/content/locales/hi-IN/tracking.mdx +9 -6
  178. package/corpus/core/docs/content/locales/hi-IN/using-your-agent.mdx +0 -7
  179. package/corpus/core/docs/content/locales/hi-IN/voice-input.mdx +6 -0
  180. package/corpus/core/docs/content/locales/hi-IN/workspace-connections.mdx +9 -2
  181. package/corpus/core/docs/content/locales/hi-IN/workspace.mdx +19 -18
  182. package/corpus/core/docs/content/locales/ja-JP/actions.mdx +2 -2
  183. package/corpus/core/docs/content/locales/ja-JP/agent-native-toolkit.mdx +2 -2
  184. package/corpus/core/docs/content/locales/ja-JP/agent-surfaces.mdx +8 -10
  185. package/corpus/core/docs/content/locales/ja-JP/agent-teams.mdx +1 -0
  186. package/corpus/core/docs/content/locales/ja-JP/authentication.mdx +1 -1
  187. package/corpus/core/docs/content/locales/ja-JP/components.mdx +11 -1
  188. package/corpus/core/docs/content/locales/ja-JP/creating-templates.mdx +3 -7
  189. package/corpus/core/docs/content/locales/ja-JP/cross-app-sso.mdx +16 -6
  190. package/corpus/core/docs/content/locales/ja-JP/deployment.mdx +8 -0
  191. package/corpus/core/docs/content/locales/ja-JP/external-agents.mdx +2 -7
  192. package/corpus/core/docs/content/locales/ja-JP/key-concepts.mdx +13 -20
  193. package/corpus/core/docs/content/locales/ja-JP/multi-tenancy.mdx +5 -5
  194. package/corpus/core/docs/content/locales/ja-JP/notifications.mdx +18 -10
  195. package/corpus/core/docs/content/locales/ja-JP/processors.mdx +11 -5
  196. package/corpus/core/docs/content/locales/ja-JP/server.mdx +17 -10
  197. package/corpus/core/docs/content/locales/ja-JP/sharing.mdx +10 -10
  198. package/corpus/core/docs/content/locales/ja-JP/skills-guide.mdx +34 -17
  199. package/corpus/core/docs/content/locales/ja-JP/template-assets.mdx +16 -13
  200. package/corpus/core/docs/content/locales/ja-JP/template-brain.mdx +3 -1
  201. package/corpus/core/docs/content/locales/ja-JP/template-clips.mdx +3 -4
  202. package/corpus/core/docs/content/locales/ja-JP/template-design.mdx +3 -1
  203. package/corpus/core/docs/content/locales/ja-JP/template-dispatch.mdx +5 -1
  204. package/corpus/core/docs/content/locales/ja-JP/template-mail.mdx +8 -0
  205. package/corpus/core/docs/content/locales/ja-JP/tracking.mdx +9 -6
  206. package/corpus/core/docs/content/locales/ja-JP/using-your-agent.mdx +0 -7
  207. package/corpus/core/docs/content/locales/ja-JP/voice-input.mdx +6 -0
  208. package/corpus/core/docs/content/locales/ja-JP/workspace-connections.mdx +9 -2
  209. package/corpus/core/docs/content/locales/ja-JP/workspace.mdx +19 -18
  210. package/corpus/core/docs/content/locales/ko-KR/actions.mdx +2 -2
  211. package/corpus/core/docs/content/locales/ko-KR/agent-native-toolkit.mdx +2 -2
  212. package/corpus/core/docs/content/locales/ko-KR/agent-surfaces.mdx +8 -10
  213. package/corpus/core/docs/content/locales/ko-KR/agent-teams.mdx +1 -0
  214. package/corpus/core/docs/content/locales/ko-KR/authentication.mdx +1 -1
  215. package/corpus/core/docs/content/locales/ko-KR/components.mdx +11 -1
  216. package/corpus/core/docs/content/locales/ko-KR/creating-templates.mdx +3 -7
  217. package/corpus/core/docs/content/locales/ko-KR/cross-app-sso.mdx +16 -6
  218. package/corpus/core/docs/content/locales/ko-KR/deployment.mdx +8 -0
  219. package/corpus/core/docs/content/locales/ko-KR/external-agents.mdx +2 -7
  220. package/corpus/core/docs/content/locales/ko-KR/key-concepts.mdx +13 -20
  221. package/corpus/core/docs/content/locales/ko-KR/multi-tenancy.mdx +5 -5
  222. package/corpus/core/docs/content/locales/ko-KR/notifications.mdx +18 -10
  223. package/corpus/core/docs/content/locales/ko-KR/processors.mdx +11 -5
  224. package/corpus/core/docs/content/locales/ko-KR/server.mdx +17 -10
  225. package/corpus/core/docs/content/locales/ko-KR/sharing.mdx +10 -10
  226. package/corpus/core/docs/content/locales/ko-KR/skills-guide.mdx +34 -17
  227. package/corpus/core/docs/content/locales/ko-KR/template-assets.mdx +16 -13
  228. package/corpus/core/docs/content/locales/ko-KR/template-brain.mdx +3 -1
  229. package/corpus/core/docs/content/locales/ko-KR/template-clips.mdx +3 -4
  230. package/corpus/core/docs/content/locales/ko-KR/template-design.mdx +3 -1
  231. package/corpus/core/docs/content/locales/ko-KR/template-dispatch.mdx +5 -1
  232. package/corpus/core/docs/content/locales/ko-KR/template-mail.mdx +8 -0
  233. package/corpus/core/docs/content/locales/ko-KR/tracking.mdx +9 -6
  234. package/corpus/core/docs/content/locales/ko-KR/using-your-agent.mdx +0 -7
  235. package/corpus/core/docs/content/locales/ko-KR/voice-input.mdx +6 -0
  236. package/corpus/core/docs/content/locales/ko-KR/workspace-connections.mdx +9 -2
  237. package/corpus/core/docs/content/locales/ko-KR/workspace.mdx +19 -18
  238. package/corpus/core/docs/content/locales/pt-BR/actions.mdx +2 -2
  239. package/corpus/core/docs/content/locales/pt-BR/agent-native-toolkit.mdx +2 -2
  240. package/corpus/core/docs/content/locales/pt-BR/agent-surfaces.mdx +8 -10
  241. package/corpus/core/docs/content/locales/pt-BR/agent-teams.mdx +1 -0
  242. package/corpus/core/docs/content/locales/pt-BR/authentication.mdx +1 -1
  243. package/corpus/core/docs/content/locales/pt-BR/components.mdx +11 -1
  244. package/corpus/core/docs/content/locales/pt-BR/creating-templates.mdx +3 -7
  245. package/corpus/core/docs/content/locales/pt-BR/cross-app-sso.mdx +16 -6
  246. package/corpus/core/docs/content/locales/pt-BR/deployment.mdx +8 -0
  247. package/corpus/core/docs/content/locales/pt-BR/external-agents.mdx +3 -7
  248. package/corpus/core/docs/content/locales/pt-BR/key-concepts.mdx +13 -20
  249. package/corpus/core/docs/content/locales/pt-BR/multi-tenancy.mdx +5 -5
  250. package/corpus/core/docs/content/locales/pt-BR/notifications.mdx +18 -10
  251. package/corpus/core/docs/content/locales/pt-BR/processors.mdx +11 -5
  252. package/corpus/core/docs/content/locales/pt-BR/server.mdx +17 -10
  253. package/corpus/core/docs/content/locales/pt-BR/sharing.mdx +10 -10
  254. package/corpus/core/docs/content/locales/pt-BR/skills-guide.mdx +34 -17
  255. package/corpus/core/docs/content/locales/pt-BR/template-assets.mdx +16 -13
  256. package/corpus/core/docs/content/locales/pt-BR/template-brain.mdx +3 -1
  257. package/corpus/core/docs/content/locales/pt-BR/template-clips.mdx +3 -3
  258. package/corpus/core/docs/content/locales/pt-BR/template-design.mdx +3 -1
  259. package/corpus/core/docs/content/locales/pt-BR/template-dispatch.mdx +5 -1
  260. package/corpus/core/docs/content/locales/pt-BR/template-mail.mdx +8 -0
  261. package/corpus/core/docs/content/locales/pt-BR/tracking.mdx +9 -6
  262. package/corpus/core/docs/content/locales/pt-BR/using-your-agent.mdx +0 -7
  263. package/corpus/core/docs/content/locales/pt-BR/voice-input.mdx +6 -0
  264. package/corpus/core/docs/content/locales/pt-BR/workspace-connections.mdx +9 -2
  265. package/corpus/core/docs/content/locales/pt-BR/workspace.mdx +19 -18
  266. package/corpus/core/docs/content/locales/zh-CN/actions.mdx +2 -2
  267. package/corpus/core/docs/content/locales/zh-CN/agent-native-toolkit.mdx +2 -2
  268. package/corpus/core/docs/content/locales/zh-CN/agent-surfaces.mdx +8 -10
  269. package/corpus/core/docs/content/locales/zh-CN/agent-teams.mdx +1 -0
  270. package/corpus/core/docs/content/locales/zh-CN/authentication.mdx +1 -1
  271. package/corpus/core/docs/content/locales/zh-CN/components.mdx +11 -1
  272. package/corpus/core/docs/content/locales/zh-CN/creating-templates.mdx +3 -7
  273. package/corpus/core/docs/content/locales/zh-CN/cross-app-sso.mdx +16 -6
  274. package/corpus/core/docs/content/locales/zh-CN/deployment.mdx +8 -0
  275. package/corpus/core/docs/content/locales/zh-CN/external-agents.mdx +2 -7
  276. package/corpus/core/docs/content/locales/zh-CN/key-concepts.mdx +13 -20
  277. package/corpus/core/docs/content/locales/zh-CN/multi-tenancy.mdx +5 -5
  278. package/corpus/core/docs/content/locales/zh-CN/notifications.mdx +18 -10
  279. package/corpus/core/docs/content/locales/zh-CN/processors.mdx +11 -5
  280. package/corpus/core/docs/content/locales/zh-CN/server.mdx +16 -10
  281. package/corpus/core/docs/content/locales/zh-CN/sharing.mdx +10 -10
  282. package/corpus/core/docs/content/locales/zh-CN/skills-guide.mdx +34 -17
  283. package/corpus/core/docs/content/locales/zh-CN/template-assets.mdx +16 -13
  284. package/corpus/core/docs/content/locales/zh-CN/template-brain.mdx +3 -1
  285. package/corpus/core/docs/content/locales/zh-CN/template-clips.mdx +3 -4
  286. package/corpus/core/docs/content/locales/zh-CN/template-design.mdx +3 -1
  287. package/corpus/core/docs/content/locales/zh-CN/template-dispatch.mdx +5 -1
  288. package/corpus/core/docs/content/locales/zh-CN/template-mail.mdx +8 -0
  289. package/corpus/core/docs/content/locales/zh-CN/tracking.mdx +9 -6
  290. package/corpus/core/docs/content/locales/zh-CN/using-your-agent.mdx +0 -7
  291. package/corpus/core/docs/content/locales/zh-CN/voice-input.mdx +6 -0
  292. package/corpus/core/docs/content/locales/zh-CN/workspace-connections.mdx +9 -2
  293. package/corpus/core/docs/content/locales/zh-CN/workspace.mdx +19 -18
  294. package/corpus/core/docs/content/locales/zh-TW/actions.mdx +2 -2
  295. package/corpus/core/docs/content/locales/zh-TW/agent-native-toolkit.mdx +2 -2
  296. package/corpus/core/docs/content/locales/zh-TW/agent-surfaces.mdx +8 -10
  297. package/corpus/core/docs/content/locales/zh-TW/agent-teams.mdx +1 -0
  298. package/corpus/core/docs/content/locales/zh-TW/authentication.mdx +1 -1
  299. package/corpus/core/docs/content/locales/zh-TW/components.mdx +11 -1
  300. package/corpus/core/docs/content/locales/zh-TW/creating-templates.mdx +3 -7
  301. package/corpus/core/docs/content/locales/zh-TW/cross-app-sso.mdx +16 -6
  302. package/corpus/core/docs/content/locales/zh-TW/deployment.mdx +8 -0
  303. package/corpus/core/docs/content/locales/zh-TW/external-agents.mdx +2 -7
  304. package/corpus/core/docs/content/locales/zh-TW/key-concepts.mdx +13 -20
  305. package/corpus/core/docs/content/locales/zh-TW/multi-tenancy.mdx +5 -5
  306. package/corpus/core/docs/content/locales/zh-TW/notifications.mdx +18 -10
  307. package/corpus/core/docs/content/locales/zh-TW/processors.mdx +11 -5
  308. package/corpus/core/docs/content/locales/zh-TW/server.mdx +16 -10
  309. package/corpus/core/docs/content/locales/zh-TW/sharing.mdx +10 -10
  310. package/corpus/core/docs/content/locales/zh-TW/skills-guide.mdx +34 -17
  311. package/corpus/core/docs/content/locales/zh-TW/template-assets.mdx +16 -13
  312. package/corpus/core/docs/content/locales/zh-TW/template-brain.mdx +3 -1
  313. package/corpus/core/docs/content/locales/zh-TW/template-clips.mdx +3 -4
  314. package/corpus/core/docs/content/locales/zh-TW/template-design.mdx +3 -1
  315. package/corpus/core/docs/content/locales/zh-TW/template-dispatch.mdx +5 -1
  316. package/corpus/core/docs/content/locales/zh-TW/template-mail.mdx +8 -0
  317. package/corpus/core/docs/content/locales/zh-TW/tracking.mdx +9 -6
  318. package/corpus/core/docs/content/locales/zh-TW/using-your-agent.mdx +0 -7
  319. package/corpus/core/docs/content/locales/zh-TW/voice-input.mdx +6 -0
  320. package/corpus/core/docs/content/locales/zh-TW/workspace-connections.mdx +9 -2
  321. package/corpus/core/docs/content/locales/zh-TW/workspace.mdx +19 -18
  322. package/corpus/core/docs/content/mcp-apps.mdx +14 -32
  323. package/corpus/core/docs/content/mcp-clients.mdx +48 -54
  324. package/corpus/core/docs/content/mcp-protocol.mdx +25 -10
  325. package/corpus/core/docs/content/messaging.mdx +19 -11
  326. package/corpus/core/docs/content/multi-app-workspace.mdx +11 -96
  327. package/corpus/core/docs/content/multi-tenancy.mdx +5 -5
  328. package/corpus/core/docs/content/native-chat-ui.mdx +4 -4
  329. package/corpus/core/docs/content/notifications.mdx +19 -12
  330. package/corpus/core/docs/content/observability.mdx +2 -4
  331. package/corpus/core/docs/content/observational-memory.mdx +7 -3
  332. package/corpus/core/docs/content/onboarding.mdx +9 -2
  333. package/corpus/core/docs/content/plan-plugin.mdx +10 -2
  334. package/corpus/core/docs/content/pr-visual-recap.mdx +1 -1
  335. package/corpus/core/docs/content/processors.mdx +11 -5
  336. package/corpus/core/docs/content/pure-agent-apps.mdx +5 -1
  337. package/corpus/core/docs/content/real-time-collaboration.mdx +30 -67
  338. package/corpus/core/docs/content/recurring-jobs.mdx +8 -6
  339. package/corpus/core/docs/content/routing.mdx +3 -4
  340. package/corpus/core/docs/content/sandbox-adapters.mdx +30 -53
  341. package/corpus/core/docs/content/security.mdx +8 -0
  342. package/corpus/core/docs/content/server.mdx +17 -10
  343. package/corpus/core/docs/content/sharing.mdx +10 -10
  344. package/corpus/core/docs/content/skills-guide.mdx +35 -16
  345. package/corpus/core/docs/content/template-analytics.mdx +11 -8
  346. package/corpus/core/docs/content/template-assets.mdx +16 -13
  347. package/corpus/core/docs/content/template-brain.mdx +3 -1
  348. package/corpus/core/docs/content/template-calendar.mdx +12 -4
  349. package/corpus/core/docs/content/template-chat.mdx +4 -4
  350. package/corpus/core/docs/content/template-clips.mdx +3 -3
  351. package/corpus/core/docs/content/template-content.mdx +23 -18
  352. package/corpus/core/docs/content/template-design.mdx +3 -1
  353. package/corpus/core/docs/content/template-dispatch.mdx +5 -1
  354. package/corpus/core/docs/content/template-mail.mdx +14 -2
  355. package/corpus/core/docs/content/template-plan.mdx +22 -15
  356. package/corpus/core/docs/content/template-slides.mdx +11 -3
  357. package/corpus/core/docs/content/toolkit-agent-ux.mdx +46 -3
  358. package/corpus/core/docs/content/toolkit-collaboration.mdx +58 -4
  359. package/corpus/core/docs/content/toolkit-command-navigation.mdx +8 -2
  360. package/corpus/core/docs/content/toolkit-comments-review.mdx +10 -2
  361. package/corpus/core/docs/content/toolkit-history.mdx +8 -3
  362. package/corpus/core/docs/content/toolkit-observability.mdx +48 -2
  363. package/corpus/core/docs/content/toolkit-org-team.mdx +8 -2
  364. package/corpus/core/docs/content/toolkit-resources.mdx +45 -2
  365. package/corpus/core/docs/content/toolkit-settings.mdx +8 -2
  366. package/corpus/core/docs/content/toolkit-setup-connections.mdx +7 -2
  367. package/corpus/core/docs/content/toolkit-sharing.mdx +46 -3
  368. package/corpus/core/docs/content/toolkit-ui.mdx +82 -11
  369. package/corpus/core/docs/content/tracking.mdx +10 -8
  370. package/corpus/core/docs/content/using-your-agent.mdx +0 -12
  371. package/corpus/core/docs/content/voice-input.mdx +7 -1
  372. package/corpus/core/docs/content/what-is-agent-native.mdx +7 -8
  373. package/corpus/core/docs/content/workspace-connections.mdx +16 -23
  374. package/corpus/core/docs/content/workspace-management.mdx +16 -4
  375. package/corpus/core/docs/content/workspace.mdx +19 -18
  376. package/corpus/core/package.json +1 -1
  377. package/corpus/core/src/agent/context-xray/tokenize.ts +6 -1
  378. package/corpus/core/src/agent/engine/ai-sdk-engine.ts +9 -5
  379. package/corpus/core/src/agent/engine/anthropic-engine.ts +2 -4
  380. package/corpus/core/src/agent/engine/builder-engine.ts +5 -7
  381. package/corpus/core/src/agent/engine/index.ts +1 -0
  382. package/corpus/core/src/agent/engine/registry.ts +40 -0
  383. package/corpus/core/src/agent/harness/ai-sdk-adapter.ts +6 -1
  384. package/corpus/core/src/agent/harness/background.ts +96 -19
  385. package/corpus/core/src/agent/harness/index.ts +11 -0
  386. package/corpus/core/src/agent/harness/lifecycle.ts +498 -0
  387. package/corpus/core/src/agent/harness/runner.ts +38 -0
  388. package/corpus/core/src/agent/harness/store.ts +22 -3
  389. package/corpus/core/src/agent/model-config.ts +4 -1
  390. package/corpus/core/src/agent/production-agent.ts +190 -6
  391. package/corpus/core/src/agent/run-manager.ts +5 -1
  392. package/corpus/core/src/application-state/index.ts +1 -0
  393. package/corpus/core/src/application-state/store.ts +32 -0
  394. package/corpus/core/src/cli/code-agent-connector.ts +263 -8
  395. package/corpus/core/src/cli/code-agent-executor.ts +15 -1
  396. package/corpus/core/src/client/AgentPanel.tsx +41 -38
  397. package/corpus/core/src/client/AssistantChat.tsx +98 -6
  398. package/corpus/core/src/client/MultiTabAssistantChat.tsx +33 -40
  399. package/corpus/core/src/client/appearance.ts +8 -5
  400. package/corpus/core/src/client/chat/connectors.ts +293 -29
  401. package/corpus/core/src/client/chat/message-components.tsx +23 -1
  402. package/corpus/core/src/client/chat/runtime.ts +126 -25
  403. package/corpus/core/src/client/chat/tool-call-display.tsx +45 -4
  404. package/corpus/core/src/client/composer/RealtimeVoiceMode.tsx +294 -0
  405. package/corpus/core/src/client/composer/TiptapComposer.tsx +21 -20
  406. package/corpus/core/src/client/composer/VoiceButton.tsx +20 -0
  407. package/corpus/core/src/client/composer/index.ts +22 -0
  408. package/corpus/core/src/client/composer/useRealtimeVoiceMode.tsx +640 -0
  409. package/corpus/core/src/client/guided-questions.tsx +12 -3
  410. package/corpus/core/src/client/index.ts +18 -0
  411. package/corpus/core/src/client/settings/DemoModeSection.tsx +4 -3
  412. package/corpus/core/src/client/settings/SettingsPanel.tsx +4 -0
  413. package/corpus/core/src/client/settings/SettingsTabsPage.tsx +95 -37
  414. package/corpus/core/src/client/use-chat-models.ts +17 -17
  415. package/corpus/core/src/client/use-db-sync.ts +108 -7
  416. package/corpus/core/src/code-agents/background-controller.ts +18 -0
  417. package/corpus/core/src/collab/ydoc-manager.ts +41 -6
  418. package/corpus/core/src/db/migrations.ts +17 -1
  419. package/corpus/core/src/demo/fetch-interceptor.ts +16 -11
  420. package/corpus/core/src/integrations/adapters/slack.ts +41 -2
  421. package/corpus/core/src/integrations/awaiting-input-store.ts +130 -0
  422. package/corpus/core/src/integrations/computer-supervision-store.ts +423 -0
  423. package/corpus/core/src/integrations/computer-supervision.ts +213 -0
  424. package/corpus/core/src/integrations/index.ts +29 -1
  425. package/corpus/core/src/integrations/plugin.ts +231 -2
  426. package/corpus/core/src/integrations/remote-commands-store.ts +334 -3
  427. package/corpus/core/src/integrations/remote-devices-store.ts +68 -9
  428. package/corpus/core/src/integrations/remote-json-safety.ts +127 -0
  429. package/corpus/core/src/integrations/remote-run-events-store.ts +104 -19
  430. package/corpus/core/src/integrations/remote-types.ts +66 -3
  431. package/corpus/core/src/integrations/webhook-handler.ts +161 -2
  432. package/corpus/core/src/localization/default-messages.ts +28 -0
  433. package/corpus/core/src/mcp-client/config.ts +48 -2
  434. package/corpus/core/src/mcp-client/index.ts +35 -2
  435. package/corpus/core/src/mcp-client/tool-policy.ts +182 -0
  436. package/corpus/core/src/secrets/register-framework-secrets.ts +27 -4
  437. package/corpus/core/src/server/agent-chat-plugin.ts +62 -8
  438. package/corpus/core/src/server/index.ts +16 -0
  439. package/corpus/core/src/server/realtime-voice.ts +590 -0
  440. package/corpus/core/src/shared/reasoning-effort.ts +61 -19
  441. package/corpus/core/src/styles/agent-conversation.css +17 -0
  442. package/corpus/core/src/templates/workspace-core/.agents/skills/voice-transcription/SKILL.md +39 -5
  443. package/corpus/templates/brain/app/lib/settings-navigation.ts +22 -0
  444. package/corpus/templates/brain/app/routes/settings.tsx +367 -252
  445. package/corpus/templates/brain/changelog/2026-07-10-brain-settings-now-separate-assistant-behavior-publishing-re.md +6 -0
  446. package/corpus/templates/brain/changelog/2026-07-10-organization-settings-now-opens-directly-from-the-workspace-.md +6 -0
  447. package/corpus/templates/calendar/.agents/skills/event-management/SKILL.md +36 -4
  448. package/corpus/templates/calendar/AGENTS.md +4 -0
  449. package/corpus/templates/calendar/actions/create-event.ts +7 -19
  450. package/corpus/templates/calendar/actions/delete-event.ts +10 -3
  451. package/corpus/templates/calendar/actions/rsvp-event.ts +1 -1
  452. package/corpus/templates/calendar/actions/update-event.ts +4 -3
  453. package/corpus/templates/calendar/app/components/calendar/CreateEventDialog.tsx +100 -13
  454. package/corpus/templates/calendar/app/components/calendar/DayView.tsx +12 -4
  455. package/corpus/templates/calendar/app/components/calendar/EventDetailPanel.tsx +3 -3
  456. package/corpus/templates/calendar/app/components/calendar/EventDetailPopover.tsx +86 -8
  457. package/corpus/templates/calendar/app/components/calendar/EventDialog.tsx +3 -1
  458. package/corpus/templates/calendar/app/components/calendar/WeekView.tsx +12 -4
  459. package/corpus/templates/calendar/app/hooks/use-events.ts +1 -0
  460. package/corpus/templates/calendar/app/lib/event-account-selection.ts +36 -0
  461. package/corpus/templates/calendar/app/lib/event-form-initialization.ts +21 -0
  462. package/corpus/templates/calendar/app/lib/event-mutation-inputs.ts +18 -0
  463. package/corpus/templates/calendar/app/pages/CalendarView.tsx +119 -26
  464. package/corpus/templates/calendar/changelog/2026-07-10-choose-which-connected-google-account-receives-a-new-event-w.md +6 -0
  465. package/corpus/templates/calendar/server/db/schema.ts +2 -0
  466. package/corpus/templates/calendar/server/handlers/bookings.ts +43 -6
  467. package/corpus/templates/calendar/server/handlers/events.ts +28 -9
  468. package/corpus/templates/calendar/server/lib/google-calendar.ts +66 -38
  469. package/corpus/templates/calendar/server/plugins/db.ts +5 -0
  470. package/corpus/templates/clips/.agents/skills/ai-video-tools/SKILL.md +12 -3
  471. package/corpus/templates/clips/.agents/skills/meetings/SKILL.md +1 -1
  472. package/corpus/templates/clips/AGENTS.md +4 -2
  473. package/corpus/templates/clips/actions/regenerate-title.ts +53 -7
  474. package/corpus/templates/clips/actions/request-transcript.ts +152 -41
  475. package/corpus/templates/clips/actions/save-browser-transcript.ts +11 -9
  476. package/corpus/templates/clips/app/components/player/comments-panel.tsx +101 -53
  477. package/corpus/templates/clips/app/components/player/playback-comment-overlay.tsx +102 -0
  478. package/corpus/templates/clips/app/components/player/video-player.tsx +10 -1
  479. package/corpus/templates/clips/app/hooks/use-auto-title.ts +14 -0
  480. package/corpus/templates/clips/app/routes/embed.$shareId.tsx +2 -0
  481. package/corpus/templates/clips/changelog/2026-07-10-comment-replies-now-open-inline-and-focus-immediately-while-.md +6 -0
  482. package/corpus/templates/clips/changelog/2026-07-10-dismissed-upload-warnings-now-keep-recordings-in-clip-drafts.md +6 -0
  483. package/corpus/templates/clips/changelog/2026-07-10-dragging-the-meeting-recorder-no-longer-opens-the-expanded.md +6 -0
  484. package/corpus/templates/clips/changelog/2026-07-10-finishing-meeting-notes-no-longer-opens-your-browser.md +6 -0
  485. package/corpus/templates/clips/changelog/2026-07-10-meeting-recordings-now-keep-microphone-audio-and-recover-tra.md +6 -0
  486. package/corpus/templates/clips/changelog/2026-07-10-recording-pause-and-resume-controls-now-respond-reliably-on-.md +6 -0
  487. package/corpus/templates/clips/changelog/2026-07-10-starting-and-joining-a-meeting-now-closes-the-desktop-popover.md +6 -0
  488. package/corpus/templates/clips/changelog/2026-07-10-timestamped-comments-now-appear-over-the-video-as-playback-r.md +6 -0
  489. package/corpus/templates/clips/changelog/2026-07-10-transcript-backed-titles-and-summaries-now-finish-after-recording.md +6 -0
  490. package/corpus/templates/clips/changelog/2026-07-10-zoom-meetings-now-open-directly-in-the-desktop-app.md +6 -0
  491. package/corpus/templates/clips/chrome-extension/src/overlay.ts +49 -7
  492. package/corpus/templates/clips/desktop/src/app.tsx +70 -42
  493. package/corpus/templates/clips/desktop/src/hooks/useMeetingTranscription.ts +8 -14
  494. package/corpus/templates/clips/desktop/src/lib/meeting-join-url.ts +33 -0
  495. package/corpus/templates/clips/desktop/src/lib/pause-transition.ts +79 -0
  496. package/corpus/templates/clips/desktop/src/lib/pill-interaction.ts +19 -0
  497. package/corpus/templates/clips/desktop/src/lib/recorder.ts +90 -39
  498. package/corpus/templates/clips/desktop/src/lib/transcription-engine.ts +3 -2
  499. package/corpus/templates/clips/desktop/src/overlays/meeting-notification.tsx +3 -2
  500. package/corpus/templates/clips/desktop/src/overlays/recording-pill.tsx +32 -6
  501. package/corpus/templates/clips/desktop/src/overlays/toolbar.tsx +50 -5
  502. package/corpus/templates/clips/desktop/src/styles.css +11 -19
  503. package/corpus/templates/clips/desktop/src-tauri/src/lib.rs +2 -1
  504. package/corpus/templates/clips/desktop/src-tauri/src/native_screen.rs +121 -4
  505. package/corpus/templates/clips/desktop/src-tauri/src/native_speech.rs +97 -17
  506. package/corpus/templates/clips/desktop/src-tauri/src/whisper_speech.rs +80 -5
  507. package/corpus/templates/clips/desktop/src-tauri/tauri.conf.json +1 -1
  508. package/corpus/templates/clips/vitest.config.ts +23 -0
  509. package/corpus/templates/content/app/components/editor/DocumentEditor.tsx +28 -9
  510. package/corpus/templates/content/changelog/2026-07-10-open-documents-no-longer-make-constant-background-requests-w.md +6 -0
  511. package/corpus/templates/design/.agents/skills/design-systems/SKILL.md +21 -4
  512. package/corpus/templates/design/AGENTS.md +7 -0
  513. package/corpus/templates/design/app/components/design/DesignCanvas.tsx +132 -7
  514. package/corpus/templates/design/app/components/design/MultiScreenCanvas.tsx +73 -18
  515. package/corpus/templates/design/app/components/design/bridge/editor-chrome.bridge.ts +6 -1
  516. package/corpus/templates/design/app/components/design/multi-screen/frame-geometry.ts +135 -5
  517. package/corpus/templates/design/app/lib/clipboard-content-lineage.ts +64 -0
  518. package/corpus/templates/design/app/lib/design-clipboard-managed-styles.ts +247 -0
  519. package/corpus/templates/design/app/lib/design-clipboard.ts +60 -3
  520. package/corpus/templates/design/app/lib/design-import.ts +31 -3
  521. package/corpus/templates/design/app/pages/design-editor/latest-write-queue.ts +56 -0
  522. package/corpus/templates/design/app/pages/design-editor/performance-buffer-guard.ts +80 -0
  523. package/corpus/templates/design/changelog/2026-07-10-concurrent-agent-and-artboard-edits-no-longer-show-misleadin.md +6 -0
  524. package/corpus/templates/design/changelog/2026-07-10-designs-with-html-examples-inside-alpine-attributes-or-comme.md +6 -0
  525. package/corpus/templates/design/changelog/2026-07-10-interactive-designs-no-longer-appear-blank-in-the-canvas-whe.md +6 -0
  526. package/corpus/templates/design/changelog/2026-07-10-long-overview-editing-sessions-lots-of-pan-zoom-screen-switc.md +6 -0
  527. package/corpus/templates/design/changelog/2026-07-10-rapid-breakpoint-and-edit-scope-changes-no-longer-jump-back-.md +6 -0
  528. package/corpus/templates/design/changelog/2026-07-10-responsive-breakpoint-previews-stay-visible-while-panning-ac.md +6 -0
  529. package/corpus/templates/design/changelog/2026-07-10-rich-design-clipboard-markers-are-now-accepted-only-from-the.md +6 -0
  530. package/corpus/templates/design/e2e/helpers.ts +16 -5
  531. package/corpus/templates/design/server/source-workspace.ts +28 -2
  532. package/corpus/templates/design/shared/html-integrity.ts +119 -24
  533. package/corpus/templates/dispatch/AGENTS.md +10 -2
  534. package/corpus/templates/dispatch/actions/view-screen.ts +11 -0
  535. package/corpus/templates/dispatch/app/hooks/use-navigation-state.ts +13 -0
  536. package/corpus/templates/dispatch/app/i18n/zh-TW.ts +3 -0
  537. package/corpus/templates/dispatch/app/i18n-data.ts +37 -1
  538. package/corpus/templates/dispatch/app/routes/operations.tsx +1 -0
  539. package/corpus/templates/dispatch/changelog/2026-07-10-dispatch-now-has-a-cleaner-chat-history-and-quieter-sidebar-.md +6 -0
  540. package/corpus/templates/dispatch/changelog/2026-07-10-operations-console-brings-agent-monitoring-and-database-inspection-tog.md +6 -0
  541. package/corpus/templates/mail/actions/get-integration-statuses.ts +36 -0
  542. package/corpus/templates/mail/app/components/email/EmailThread.tsx +3 -2
  543. package/corpus/templates/mail/app/components/email/IntegrationsSidebar.tsx +3 -3
  544. package/corpus/templates/mail/app/hooks/use-apollo.ts +5 -71
  545. package/corpus/templates/mail/app/hooks/use-draft-queue.ts +1 -1
  546. package/corpus/templates/mail/app/hooks/use-integrations.ts +51 -48
  547. package/corpus/templates/mail/app/lib/integration-status.ts +31 -0
  548. package/corpus/templates/mail/app/lib/sync-invalidation.ts +5 -0
  549. package/corpus/templates/mail/app/pages/SettingsPage.tsx +3 -0
  550. package/corpus/templates/mail/app/root.tsx +22 -12
  551. package/corpus/templates/mail/changelog/2026-07-10-email-content-backgrounds-now-blend-cleanly-with-dark-mode.md +6 -0
  552. package/corpus/templates/mail/changelog/2026-07-10-mail-settings-now-group-drafting-automation-and-connected-se.md +6 -0
  553. package/corpus/templates/mail/changelog/2026-07-10-organization-settings-now-opens-directly-from-the-workspace-.md +6 -0
  554. package/dist/agent/context-xray/tokenize.d.ts.map +1 -1
  555. package/dist/agent/context-xray/tokenize.js +6 -1
  556. package/dist/agent/context-xray/tokenize.js.map +1 -1
  557. package/dist/agent/engine/ai-sdk-engine.d.ts.map +1 -1
  558. package/dist/agent/engine/ai-sdk-engine.js +8 -3
  559. package/dist/agent/engine/ai-sdk-engine.js.map +1 -1
  560. package/dist/agent/engine/anthropic-engine.d.ts.map +1 -1
  561. package/dist/agent/engine/anthropic-engine.js +2 -4
  562. package/dist/agent/engine/anthropic-engine.js.map +1 -1
  563. package/dist/agent/engine/builder-engine.d.ts +1 -1
  564. package/dist/agent/engine/builder-engine.d.ts.map +1 -1
  565. package/dist/agent/engine/builder-engine.js +2 -3
  566. package/dist/agent/engine/builder-engine.js.map +1 -1
  567. package/dist/agent/engine/index.d.ts +1 -1
  568. package/dist/agent/engine/index.d.ts.map +1 -1
  569. package/dist/agent/engine/index.js +1 -1
  570. package/dist/agent/engine/index.js.map +1 -1
  571. package/dist/agent/engine/registry.d.ts +13 -0
  572. package/dist/agent/engine/registry.d.ts.map +1 -1
  573. package/dist/agent/engine/registry.js +33 -0
  574. package/dist/agent/engine/registry.js.map +1 -1
  575. package/dist/agent/harness/ai-sdk-adapter.d.ts.map +1 -1
  576. package/dist/agent/harness/ai-sdk-adapter.js +3 -1
  577. package/dist/agent/harness/ai-sdk-adapter.js.map +1 -1
  578. package/dist/agent/harness/background.d.ts +9 -9
  579. package/dist/agent/harness/background.d.ts.map +1 -1
  580. package/dist/agent/harness/background.js +77 -19
  581. package/dist/agent/harness/background.js.map +1 -1
  582. package/dist/agent/harness/index.d.ts +1 -0
  583. package/dist/agent/harness/index.d.ts.map +1 -1
  584. package/dist/agent/harness/index.js +1 -0
  585. package/dist/agent/harness/index.js.map +1 -1
  586. package/dist/agent/harness/lifecycle.d.ts +45 -0
  587. package/dist/agent/harness/lifecycle.d.ts.map +1 -0
  588. package/dist/agent/harness/lifecycle.js +318 -0
  589. package/dist/agent/harness/lifecycle.js.map +1 -0
  590. package/dist/agent/harness/runner.d.ts.map +1 -1
  591. package/dist/agent/harness/runner.js +29 -1
  592. package/dist/agent/harness/runner.js.map +1 -1
  593. package/dist/agent/harness/store.d.ts +2 -0
  594. package/dist/agent/harness/store.d.ts.map +1 -1
  595. package/dist/agent/harness/store.js +17 -3
  596. package/dist/agent/harness/store.js.map +1 -1
  597. package/dist/agent/model-config.d.ts +2 -2
  598. package/dist/agent/model-config.d.ts.map +1 -1
  599. package/dist/agent/model-config.js +4 -1
  600. package/dist/agent/model-config.js.map +1 -1
  601. package/dist/agent/production-agent.d.ts +38 -0
  602. package/dist/agent/production-agent.d.ts.map +1 -1
  603. package/dist/agent/production-agent.js +135 -4
  604. package/dist/agent/production-agent.js.map +1 -1
  605. package/dist/agent/run-manager.d.ts.map +1 -1
  606. package/dist/agent/run-manager.js.map +1 -1
  607. package/dist/application-state/index.d.ts +1 -1
  608. package/dist/application-state/index.d.ts.map +1 -1
  609. package/dist/application-state/index.js +1 -1
  610. package/dist/application-state/index.js.map +1 -1
  611. package/dist/application-state/store.d.ts +6 -0
  612. package/dist/application-state/store.d.ts.map +1 -1
  613. package/dist/application-state/store.js +31 -0
  614. package/dist/application-state/store.js.map +1 -1
  615. package/dist/cli/code-agent-connector.d.ts +9 -0
  616. package/dist/cli/code-agent-connector.d.ts.map +1 -1
  617. package/dist/cli/code-agent-connector.js +212 -10
  618. package/dist/cli/code-agent-connector.js.map +1 -1
  619. package/dist/cli/code-agent-executor.d.ts +2 -0
  620. package/dist/cli/code-agent-executor.d.ts.map +1 -1
  621. package/dist/cli/code-agent-executor.js +8 -1
  622. package/dist/cli/code-agent-executor.js.map +1 -1
  623. package/dist/client/AgentPanel.d.ts.map +1 -1
  624. package/dist/client/AgentPanel.js +6 -5
  625. package/dist/client/AgentPanel.js.map +1 -1
  626. package/dist/client/AssistantChat.d.ts +12 -0
  627. package/dist/client/AssistantChat.d.ts.map +1 -1
  628. package/dist/client/AssistantChat.js +71 -5
  629. package/dist/client/AssistantChat.js.map +1 -1
  630. package/dist/client/MultiTabAssistantChat.d.ts.map +1 -1
  631. package/dist/client/MultiTabAssistantChat.js +16 -37
  632. package/dist/client/MultiTabAssistantChat.js.map +1 -1
  633. package/dist/client/appearance.d.ts +4 -2
  634. package/dist/client/appearance.d.ts.map +1 -1
  635. package/dist/client/appearance.js +8 -5
  636. package/dist/client/appearance.js.map +1 -1
  637. package/dist/client/chat/connectors.d.ts.map +1 -1
  638. package/dist/client/chat/connectors.js +206 -28
  639. package/dist/client/chat/connectors.js.map +1 -1
  640. package/dist/client/chat/message-components.d.ts.map +1 -1
  641. package/dist/client/chat/message-components.js +17 -1
  642. package/dist/client/chat/message-components.js.map +1 -1
  643. package/dist/client/chat/runtime.d.ts.map +1 -1
  644. package/dist/client/chat/runtime.js +84 -24
  645. package/dist/client/chat/runtime.js.map +1 -1
  646. package/dist/client/chat/tool-call-display.d.ts +8 -1
  647. package/dist/client/chat/tool-call-display.d.ts.map +1 -1
  648. package/dist/client/chat/tool-call-display.js +21 -3
  649. package/dist/client/chat/tool-call-display.js.map +1 -1
  650. package/dist/client/composer/RealtimeVoiceMode.d.ts +54 -0
  651. package/dist/client/composer/RealtimeVoiceMode.d.ts.map +1 -0
  652. package/dist/client/composer/RealtimeVoiceMode.js +63 -0
  653. package/dist/client/composer/RealtimeVoiceMode.js.map +1 -0
  654. package/dist/client/composer/TiptapComposer.d.ts +1 -0
  655. package/dist/client/composer/TiptapComposer.d.ts.map +1 -1
  656. package/dist/client/composer/TiptapComposer.js +17 -20
  657. package/dist/client/composer/TiptapComposer.js.map +1 -1
  658. package/dist/client/composer/VoiceButton.d.ts.map +1 -1
  659. package/dist/client/composer/VoiceButton.js +9 -0
  660. package/dist/client/composer/VoiceButton.js.map +1 -1
  661. package/dist/client/composer/index.d.ts +2 -0
  662. package/dist/client/composer/index.d.ts.map +1 -1
  663. package/dist/client/composer/index.js +2 -0
  664. package/dist/client/composer/index.js.map +1 -1
  665. package/dist/client/composer/useRealtimeVoiceMode.d.ts +56 -0
  666. package/dist/client/composer/useRealtimeVoiceMode.d.ts.map +1 -0
  667. package/dist/client/composer/useRealtimeVoiceMode.js +492 -0
  668. package/dist/client/composer/useRealtimeVoiceMode.js.map +1 -0
  669. package/dist/client/guided-questions.d.ts.map +1 -1
  670. package/dist/client/guided-questions.js +7 -2
  671. package/dist/client/guided-questions.js.map +1 -1
  672. package/dist/client/index.d.ts +1 -1
  673. package/dist/client/index.d.ts.map +1 -1
  674. package/dist/client/index.js +1 -1
  675. package/dist/client/index.js.map +1 -1
  676. package/dist/client/settings/DemoModeSection.d.ts.map +1 -1
  677. package/dist/client/settings/DemoModeSection.js +4 -3
  678. package/dist/client/settings/DemoModeSection.js.map +1 -1
  679. package/dist/client/settings/SettingsPanel.d.ts.map +1 -1
  680. package/dist/client/settings/SettingsPanel.js +4 -0
  681. package/dist/client/settings/SettingsPanel.js.map +1 -1
  682. package/dist/client/settings/SettingsTabsPage.d.ts +10 -3
  683. package/dist/client/settings/SettingsTabsPage.d.ts.map +1 -1
  684. package/dist/client/settings/SettingsTabsPage.js +49 -11
  685. package/dist/client/settings/SettingsTabsPage.js.map +1 -1
  686. package/dist/client/use-chat-models.d.ts.map +1 -1
  687. package/dist/client/use-chat-models.js +6 -14
  688. package/dist/client/use-chat-models.js.map +1 -1
  689. package/dist/client/use-db-sync.d.ts.map +1 -1
  690. package/dist/client/use-db-sync.js +87 -7
  691. package/dist/client/use-db-sync.js.map +1 -1
  692. package/dist/code-agents/background-controller.d.ts +1 -1
  693. package/dist/code-agents/background-controller.d.ts.map +1 -1
  694. package/dist/code-agents/background-controller.js +17 -1
  695. package/dist/code-agents/background-controller.js.map +1 -1
  696. package/dist/collab/struct-routes.d.ts +1 -1
  697. package/dist/collab/ydoc-manager.d.ts +9 -1
  698. package/dist/collab/ydoc-manager.d.ts.map +1 -1
  699. package/dist/collab/ydoc-manager.js +30 -6
  700. package/dist/collab/ydoc-manager.js.map +1 -1
  701. package/dist/db/migrations.d.ts.map +1 -1
  702. package/dist/db/migrations.js +4 -2
  703. package/dist/db/migrations.js.map +1 -1
  704. package/dist/demo/fetch-interceptor.d.ts +5 -1
  705. package/dist/demo/fetch-interceptor.d.ts.map +1 -1
  706. package/dist/demo/fetch-interceptor.js +16 -12
  707. package/dist/demo/fetch-interceptor.js.map +1 -1
  708. package/dist/integrations/adapters/slack.d.ts +2 -0
  709. package/dist/integrations/adapters/slack.d.ts.map +1 -1
  710. package/dist/integrations/adapters/slack.js +38 -2
  711. package/dist/integrations/adapters/slack.js.map +1 -1
  712. package/dist/integrations/awaiting-input-store.d.ts +27 -0
  713. package/dist/integrations/awaiting-input-store.d.ts.map +1 -0
  714. package/dist/integrations/awaiting-input-store.js +112 -0
  715. package/dist/integrations/awaiting-input-store.js.map +1 -0
  716. package/dist/integrations/computer-supervision-store.d.ts +65 -0
  717. package/dist/integrations/computer-supervision-store.d.ts.map +1 -0
  718. package/dist/integrations/computer-supervision-store.js +296 -0
  719. package/dist/integrations/computer-supervision-store.js.map +1 -0
  720. package/dist/integrations/computer-supervision.d.ts +11 -0
  721. package/dist/integrations/computer-supervision.d.ts.map +1 -0
  722. package/dist/integrations/computer-supervision.js +160 -0
  723. package/dist/integrations/computer-supervision.js.map +1 -0
  724. package/dist/integrations/index.d.ts +6 -3
  725. package/dist/integrations/index.d.ts.map +1 -1
  726. package/dist/integrations/index.js +5 -2
  727. package/dist/integrations/index.js.map +1 -1
  728. package/dist/integrations/plugin.d.ts.map +1 -1
  729. package/dist/integrations/plugin.js +205 -3
  730. package/dist/integrations/plugin.js.map +1 -1
  731. package/dist/integrations/remote-commands-store.d.ts +15 -1
  732. package/dist/integrations/remote-commands-store.d.ts.map +1 -1
  733. package/dist/integrations/remote-commands-store.js +273 -3
  734. package/dist/integrations/remote-commands-store.js.map +1 -1
  735. package/dist/integrations/remote-devices-store.d.ts +4 -3
  736. package/dist/integrations/remote-devices-store.d.ts.map +1 -1
  737. package/dist/integrations/remote-devices-store.js +49 -2
  738. package/dist/integrations/remote-devices-store.js.map +1 -1
  739. package/dist/integrations/remote-json-safety.d.ts +6 -0
  740. package/dist/integrations/remote-json-safety.d.ts.map +1 -0
  741. package/dist/integrations/remote-json-safety.js +114 -0
  742. package/dist/integrations/remote-json-safety.js.map +1 -0
  743. package/dist/integrations/remote-run-events-store.d.ts +11 -1
  744. package/dist/integrations/remote-run-events-store.d.ts.map +1 -1
  745. package/dist/integrations/remote-run-events-store.js +85 -17
  746. package/dist/integrations/remote-run-events-store.js.map +1 -1
  747. package/dist/integrations/remote-types.d.ts +54 -3
  748. package/dist/integrations/remote-types.d.ts.map +1 -1
  749. package/dist/integrations/remote-types.js.map +1 -1
  750. package/dist/integrations/webhook-handler.d.ts.map +1 -1
  751. package/dist/integrations/webhook-handler.js +133 -4
  752. package/dist/integrations/webhook-handler.js.map +1 -1
  753. package/dist/localization/default-messages.d.ts +26 -0
  754. package/dist/localization/default-messages.d.ts.map +1 -1
  755. package/dist/localization/default-messages.js +26 -0
  756. package/dist/localization/default-messages.js.map +1 -1
  757. package/dist/mcp-client/config.d.ts.map +1 -1
  758. package/dist/mcp-client/config.js +44 -3
  759. package/dist/mcp-client/config.js.map +1 -1
  760. package/dist/mcp-client/index.d.ts +6 -1
  761. package/dist/mcp-client/index.d.ts.map +1 -1
  762. package/dist/mcp-client/index.js +11 -3
  763. package/dist/mcp-client/index.js.map +1 -1
  764. package/dist/mcp-client/tool-policy.d.ts +24 -0
  765. package/dist/mcp-client/tool-policy.d.ts.map +1 -0
  766. package/dist/mcp-client/tool-policy.js +139 -0
  767. package/dist/mcp-client/tool-policy.js.map +1 -0
  768. package/dist/observability/routes.d.ts +5 -5
  769. package/dist/resources/handlers.d.ts +1 -1
  770. package/dist/secrets/register-framework-secrets.d.ts +3 -4
  771. package/dist/secrets/register-framework-secrets.d.ts.map +1 -1
  772. package/dist/secrets/register-framework-secrets.js +25 -4
  773. package/dist/secrets/register-framework-secrets.js.map +1 -1
  774. package/dist/secrets/routes.d.ts +9 -9
  775. package/dist/server/agent-chat-plugin.d.ts.map +1 -1
  776. package/dist/server/agent-chat-plugin.js +53 -6
  777. package/dist/server/agent-chat-plugin.js.map +1 -1
  778. package/dist/server/index.d.ts +2 -1
  779. package/dist/server/index.d.ts.map +1 -1
  780. package/dist/server/index.js +2 -1
  781. package/dist/server/index.js.map +1 -1
  782. package/dist/server/realtime-voice.d.ts +53 -0
  783. package/dist/server/realtime-voice.d.ts.map +1 -0
  784. package/dist/server/realtime-voice.js +404 -0
  785. package/dist/server/realtime-voice.js.map +1 -0
  786. package/dist/server/transcribe-voice.d.ts +1 -1
  787. package/dist/shared/reasoning-effort.d.ts +20 -0
  788. package/dist/shared/reasoning-effort.d.ts.map +1 -1
  789. package/dist/shared/reasoning-effort.js +52 -18
  790. package/dist/shared/reasoning-effort.js.map +1 -1
  791. package/dist/styles/agent-conversation.css +17 -0
  792. package/dist/templates/workspace-core/.agents/skills/voice-transcription/SKILL.md +39 -5
  793. package/docs/content/a2a-protocol.mdx +21 -5
  794. package/docs/content/actions.mdx +9 -23
  795. package/docs/content/agent-mentions.mdx +31 -29
  796. package/docs/content/agent-native-toolkit.mdx +15 -6
  797. package/docs/content/agent-surfaces.mdx +9 -13
  798. package/docs/content/agent-teams.mdx +1 -0
  799. package/docs/content/authentication.mdx +10 -3
  800. package/docs/content/automation-connectors.mdx +82 -39
  801. package/docs/content/automations.mdx +17 -3
  802. package/docs/content/blueprint-installer.mdx +11 -4
  803. package/docs/content/cli-adapters.mdx +9 -6
  804. package/docs/content/client.mdx +16 -0
  805. package/docs/content/cloneable-saas.mdx +14 -11
  806. package/docs/content/code-agents-ui.mdx +65 -0
  807. package/docs/content/components.mdx +30 -14
  808. package/docs/content/context-awareness.mdx +27 -15
  809. package/docs/content/creating-templates.mdx +15 -9
  810. package/docs/content/cross-app-sso.mdx +16 -6
  811. package/docs/content/data-programs.mdx +1 -1
  812. package/docs/content/database.mdx +17 -5
  813. package/docs/content/deployment.mdx +19 -18
  814. package/docs/content/dispatch.mdx +6 -2
  815. package/docs/content/drop-in-agent.mdx +10 -4
  816. package/docs/content/durable-background-runs.mdx +9 -5
  817. package/docs/content/durable-resume.mdx +9 -4
  818. package/docs/content/embedding-sdk.mdx +26 -8
  819. package/docs/content/evals.mdx +3 -5
  820. package/docs/content/extensions.mdx +22 -9
  821. package/docs/content/external-agents.mdx +25 -34
  822. package/docs/content/faq.mdx +8 -0
  823. package/docs/content/file-uploads.mdx +12 -3
  824. package/docs/content/frames.mdx +16 -0
  825. package/docs/content/generative-ui.mdx +1 -1
  826. package/docs/content/getting-started.mdx +34 -21
  827. package/docs/content/harness-agents.mdx +8 -4
  828. package/docs/content/human-approval.mdx +8 -3
  829. package/docs/content/internationalization.mdx +9 -4
  830. package/docs/content/key-concepts.mdx +13 -20
  831. package/docs/content/local-file-mode.mdx +14 -8
  832. package/docs/content/locales/ar-SA/actions.mdx +2 -2
  833. package/docs/content/locales/ar-SA/agent-native-toolkit.mdx +2 -2
  834. package/docs/content/locales/ar-SA/agent-surfaces.mdx +8 -10
  835. package/docs/content/locales/ar-SA/agent-teams.mdx +1 -0
  836. package/docs/content/locales/ar-SA/authentication.mdx +1 -1
  837. package/docs/content/locales/ar-SA/components.mdx +11 -1
  838. package/docs/content/locales/ar-SA/creating-templates.mdx +3 -7
  839. package/docs/content/locales/ar-SA/cross-app-sso.mdx +16 -6
  840. package/docs/content/locales/ar-SA/deployment.mdx +8 -0
  841. package/docs/content/locales/ar-SA/external-agents.mdx +2 -7
  842. package/docs/content/locales/ar-SA/key-concepts.mdx +13 -20
  843. package/docs/content/locales/ar-SA/multi-tenancy.mdx +5 -5
  844. package/docs/content/locales/ar-SA/notifications.mdx +18 -10
  845. package/docs/content/locales/ar-SA/processors.mdx +11 -5
  846. package/docs/content/locales/ar-SA/server.mdx +17 -10
  847. package/docs/content/locales/ar-SA/sharing.mdx +10 -10
  848. package/docs/content/locales/ar-SA/skills-guide.mdx +34 -17
  849. package/docs/content/locales/ar-SA/template-assets.mdx +16 -13
  850. package/docs/content/locales/ar-SA/template-brain.mdx +3 -1
  851. package/docs/content/locales/ar-SA/template-clips.mdx +3 -3
  852. package/docs/content/locales/ar-SA/template-design.mdx +3 -1
  853. package/docs/content/locales/ar-SA/template-dispatch.mdx +5 -1
  854. package/docs/content/locales/ar-SA/template-mail.mdx +8 -0
  855. package/docs/content/locales/ar-SA/tracking.mdx +9 -6
  856. package/docs/content/locales/ar-SA/using-your-agent.mdx +0 -7
  857. package/docs/content/locales/ar-SA/voice-input.mdx +6 -0
  858. package/docs/content/locales/ar-SA/workspace-connections.mdx +9 -2
  859. package/docs/content/locales/ar-SA/workspace.mdx +19 -18
  860. package/docs/content/locales/de-DE/actions.mdx +2 -2
  861. package/docs/content/locales/de-DE/agent-native-toolkit.mdx +2 -2
  862. package/docs/content/locales/de-DE/agent-surfaces.mdx +8 -10
  863. package/docs/content/locales/de-DE/agent-teams.mdx +1 -0
  864. package/docs/content/locales/de-DE/authentication.mdx +1 -1
  865. package/docs/content/locales/de-DE/components.mdx +11 -1
  866. package/docs/content/locales/de-DE/creating-templates.mdx +3 -7
  867. package/docs/content/locales/de-DE/cross-app-sso.mdx +16 -6
  868. package/docs/content/locales/de-DE/deployment.mdx +8 -0
  869. package/docs/content/locales/de-DE/external-agents.mdx +3 -7
  870. package/docs/content/locales/de-DE/key-concepts.mdx +13 -20
  871. package/docs/content/locales/de-DE/multi-tenancy.mdx +5 -5
  872. package/docs/content/locales/de-DE/notifications.mdx +18 -10
  873. package/docs/content/locales/de-DE/processors.mdx +11 -5
  874. package/docs/content/locales/de-DE/server.mdx +18 -10
  875. package/docs/content/locales/de-DE/sharing.mdx +10 -10
  876. package/docs/content/locales/de-DE/skills-guide.mdx +34 -17
  877. package/docs/content/locales/de-DE/template-assets.mdx +16 -13
  878. package/docs/content/locales/de-DE/template-brain.mdx +3 -1
  879. package/docs/content/locales/de-DE/template-clips.mdx +3 -3
  880. package/docs/content/locales/de-DE/template-design.mdx +3 -1
  881. package/docs/content/locales/de-DE/template-dispatch.mdx +5 -1
  882. package/docs/content/locales/de-DE/template-mail.mdx +8 -0
  883. package/docs/content/locales/de-DE/tracking.mdx +9 -6
  884. package/docs/content/locales/de-DE/using-your-agent.mdx +0 -7
  885. package/docs/content/locales/de-DE/voice-input.mdx +6 -0
  886. package/docs/content/locales/de-DE/workspace-connections.mdx +9 -2
  887. package/docs/content/locales/de-DE/workspace.mdx +19 -18
  888. package/docs/content/locales/es-ES/actions.mdx +2 -2
  889. package/docs/content/locales/es-ES/agent-native-toolkit.mdx +2 -2
  890. package/docs/content/locales/es-ES/agent-surfaces.mdx +8 -10
  891. package/docs/content/locales/es-ES/agent-teams.mdx +1 -0
  892. package/docs/content/locales/es-ES/authentication.mdx +1 -1
  893. package/docs/content/locales/es-ES/components.mdx +11 -1
  894. package/docs/content/locales/es-ES/creating-templates.mdx +3 -7
  895. package/docs/content/locales/es-ES/cross-app-sso.mdx +16 -6
  896. package/docs/content/locales/es-ES/deployment.mdx +8 -0
  897. package/docs/content/locales/es-ES/external-agents.mdx +3 -7
  898. package/docs/content/locales/es-ES/key-concepts.mdx +13 -20
  899. package/docs/content/locales/es-ES/multi-tenancy.mdx +5 -5
  900. package/docs/content/locales/es-ES/notifications.mdx +18 -10
  901. package/docs/content/locales/es-ES/processors.mdx +11 -5
  902. package/docs/content/locales/es-ES/server.mdx +17 -10
  903. package/docs/content/locales/es-ES/sharing.mdx +10 -10
  904. package/docs/content/locales/es-ES/skills-guide.mdx +34 -17
  905. package/docs/content/locales/es-ES/template-assets.mdx +16 -13
  906. package/docs/content/locales/es-ES/template-brain.mdx +3 -1
  907. package/docs/content/locales/es-ES/template-clips.mdx +3 -3
  908. package/docs/content/locales/es-ES/template-design.mdx +3 -1
  909. package/docs/content/locales/es-ES/template-dispatch.mdx +5 -1
  910. package/docs/content/locales/es-ES/template-mail.mdx +8 -0
  911. package/docs/content/locales/es-ES/tracking.mdx +9 -6
  912. package/docs/content/locales/es-ES/using-your-agent.mdx +0 -7
  913. package/docs/content/locales/es-ES/voice-input.mdx +6 -0
  914. package/docs/content/locales/es-ES/workspace-connections.mdx +9 -2
  915. package/docs/content/locales/es-ES/workspace.mdx +19 -18
  916. package/docs/content/locales/fr-FR/actions.mdx +2 -2
  917. package/docs/content/locales/fr-FR/agent-native-toolkit.mdx +2 -2
  918. package/docs/content/locales/fr-FR/agent-surfaces.mdx +8 -10
  919. package/docs/content/locales/fr-FR/agent-teams.mdx +1 -0
  920. package/docs/content/locales/fr-FR/authentication.mdx +1 -1
  921. package/docs/content/locales/fr-FR/components.mdx +11 -1
  922. package/docs/content/locales/fr-FR/creating-templates.mdx +3 -7
  923. package/docs/content/locales/fr-FR/cross-app-sso.mdx +16 -6
  924. package/docs/content/locales/fr-FR/deployment.mdx +8 -0
  925. package/docs/content/locales/fr-FR/external-agents.mdx +3 -7
  926. package/docs/content/locales/fr-FR/key-concepts.mdx +13 -20
  927. package/docs/content/locales/fr-FR/multi-tenancy.mdx +5 -5
  928. package/docs/content/locales/fr-FR/notifications.mdx +18 -10
  929. package/docs/content/locales/fr-FR/processors.mdx +11 -5
  930. package/docs/content/locales/fr-FR/server.mdx +17 -10
  931. package/docs/content/locales/fr-FR/sharing.mdx +10 -10
  932. package/docs/content/locales/fr-FR/skills-guide.mdx +34 -17
  933. package/docs/content/locales/fr-FR/template-assets.mdx +16 -13
  934. package/docs/content/locales/fr-FR/template-brain.mdx +3 -1
  935. package/docs/content/locales/fr-FR/template-clips.mdx +3 -3
  936. package/docs/content/locales/fr-FR/template-design.mdx +3 -1
  937. package/docs/content/locales/fr-FR/template-dispatch.mdx +5 -1
  938. package/docs/content/locales/fr-FR/template-mail.mdx +8 -0
  939. package/docs/content/locales/fr-FR/tracking.mdx +9 -6
  940. package/docs/content/locales/fr-FR/using-your-agent.mdx +0 -7
  941. package/docs/content/locales/fr-FR/voice-input.mdx +6 -0
  942. package/docs/content/locales/fr-FR/workspace-connections.mdx +9 -2
  943. package/docs/content/locales/fr-FR/workspace.mdx +19 -18
  944. package/docs/content/locales/hi-IN/actions.mdx +2 -2
  945. package/docs/content/locales/hi-IN/agent-native-toolkit.mdx +2 -2
  946. package/docs/content/locales/hi-IN/agent-surfaces.mdx +8 -10
  947. package/docs/content/locales/hi-IN/agent-teams.mdx +1 -0
  948. package/docs/content/locales/hi-IN/authentication.mdx +1 -1
  949. package/docs/content/locales/hi-IN/components.mdx +11 -1
  950. package/docs/content/locales/hi-IN/creating-templates.mdx +3 -7
  951. package/docs/content/locales/hi-IN/cross-app-sso.mdx +16 -6
  952. package/docs/content/locales/hi-IN/deployment.mdx +8 -0
  953. package/docs/content/locales/hi-IN/external-agents.mdx +2 -7
  954. package/docs/content/locales/hi-IN/key-concepts.mdx +13 -20
  955. package/docs/content/locales/hi-IN/multi-tenancy.mdx +5 -5
  956. package/docs/content/locales/hi-IN/notifications.mdx +18 -10
  957. package/docs/content/locales/hi-IN/processors.mdx +11 -5
  958. package/docs/content/locales/hi-IN/server.mdx +17 -10
  959. package/docs/content/locales/hi-IN/sharing.mdx +10 -10
  960. package/docs/content/locales/hi-IN/skills-guide.mdx +34 -17
  961. package/docs/content/locales/hi-IN/template-assets.mdx +16 -13
  962. package/docs/content/locales/hi-IN/template-brain.mdx +3 -1
  963. package/docs/content/locales/hi-IN/template-clips.mdx +3 -3
  964. package/docs/content/locales/hi-IN/template-design.mdx +3 -1
  965. package/docs/content/locales/hi-IN/template-dispatch.mdx +5 -1
  966. package/docs/content/locales/hi-IN/template-mail.mdx +8 -0
  967. package/docs/content/locales/hi-IN/tracking.mdx +9 -6
  968. package/docs/content/locales/hi-IN/using-your-agent.mdx +0 -7
  969. package/docs/content/locales/hi-IN/voice-input.mdx +6 -0
  970. package/docs/content/locales/hi-IN/workspace-connections.mdx +9 -2
  971. package/docs/content/locales/hi-IN/workspace.mdx +19 -18
  972. package/docs/content/locales/ja-JP/actions.mdx +2 -2
  973. package/docs/content/locales/ja-JP/agent-native-toolkit.mdx +2 -2
  974. package/docs/content/locales/ja-JP/agent-surfaces.mdx +8 -10
  975. package/docs/content/locales/ja-JP/agent-teams.mdx +1 -0
  976. package/docs/content/locales/ja-JP/authentication.mdx +1 -1
  977. package/docs/content/locales/ja-JP/components.mdx +11 -1
  978. package/docs/content/locales/ja-JP/creating-templates.mdx +3 -7
  979. package/docs/content/locales/ja-JP/cross-app-sso.mdx +16 -6
  980. package/docs/content/locales/ja-JP/deployment.mdx +8 -0
  981. package/docs/content/locales/ja-JP/external-agents.mdx +2 -7
  982. package/docs/content/locales/ja-JP/key-concepts.mdx +13 -20
  983. package/docs/content/locales/ja-JP/multi-tenancy.mdx +5 -5
  984. package/docs/content/locales/ja-JP/notifications.mdx +18 -10
  985. package/docs/content/locales/ja-JP/processors.mdx +11 -5
  986. package/docs/content/locales/ja-JP/server.mdx +17 -10
  987. package/docs/content/locales/ja-JP/sharing.mdx +10 -10
  988. package/docs/content/locales/ja-JP/skills-guide.mdx +34 -17
  989. package/docs/content/locales/ja-JP/template-assets.mdx +16 -13
  990. package/docs/content/locales/ja-JP/template-brain.mdx +3 -1
  991. package/docs/content/locales/ja-JP/template-clips.mdx +3 -4
  992. package/docs/content/locales/ja-JP/template-design.mdx +3 -1
  993. package/docs/content/locales/ja-JP/template-dispatch.mdx +5 -1
  994. package/docs/content/locales/ja-JP/template-mail.mdx +8 -0
  995. package/docs/content/locales/ja-JP/tracking.mdx +9 -6
  996. package/docs/content/locales/ja-JP/using-your-agent.mdx +0 -7
  997. package/docs/content/locales/ja-JP/voice-input.mdx +6 -0
  998. package/docs/content/locales/ja-JP/workspace-connections.mdx +9 -2
  999. package/docs/content/locales/ja-JP/workspace.mdx +19 -18
  1000. package/docs/content/locales/ko-KR/actions.mdx +2 -2
  1001. package/docs/content/locales/ko-KR/agent-native-toolkit.mdx +2 -2
  1002. package/docs/content/locales/ko-KR/agent-surfaces.mdx +8 -10
  1003. package/docs/content/locales/ko-KR/agent-teams.mdx +1 -0
  1004. package/docs/content/locales/ko-KR/authentication.mdx +1 -1
  1005. package/docs/content/locales/ko-KR/components.mdx +11 -1
  1006. package/docs/content/locales/ko-KR/creating-templates.mdx +3 -7
  1007. package/docs/content/locales/ko-KR/cross-app-sso.mdx +16 -6
  1008. package/docs/content/locales/ko-KR/deployment.mdx +8 -0
  1009. package/docs/content/locales/ko-KR/external-agents.mdx +2 -7
  1010. package/docs/content/locales/ko-KR/key-concepts.mdx +13 -20
  1011. package/docs/content/locales/ko-KR/multi-tenancy.mdx +5 -5
  1012. package/docs/content/locales/ko-KR/notifications.mdx +18 -10
  1013. package/docs/content/locales/ko-KR/processors.mdx +11 -5
  1014. package/docs/content/locales/ko-KR/server.mdx +17 -10
  1015. package/docs/content/locales/ko-KR/sharing.mdx +10 -10
  1016. package/docs/content/locales/ko-KR/skills-guide.mdx +34 -17
  1017. package/docs/content/locales/ko-KR/template-assets.mdx +16 -13
  1018. package/docs/content/locales/ko-KR/template-brain.mdx +3 -1
  1019. package/docs/content/locales/ko-KR/template-clips.mdx +3 -4
  1020. package/docs/content/locales/ko-KR/template-design.mdx +3 -1
  1021. package/docs/content/locales/ko-KR/template-dispatch.mdx +5 -1
  1022. package/docs/content/locales/ko-KR/template-mail.mdx +8 -0
  1023. package/docs/content/locales/ko-KR/tracking.mdx +9 -6
  1024. package/docs/content/locales/ko-KR/using-your-agent.mdx +0 -7
  1025. package/docs/content/locales/ko-KR/voice-input.mdx +6 -0
  1026. package/docs/content/locales/ko-KR/workspace-connections.mdx +9 -2
  1027. package/docs/content/locales/ko-KR/workspace.mdx +19 -18
  1028. package/docs/content/locales/pt-BR/actions.mdx +2 -2
  1029. package/docs/content/locales/pt-BR/agent-native-toolkit.mdx +2 -2
  1030. package/docs/content/locales/pt-BR/agent-surfaces.mdx +8 -10
  1031. package/docs/content/locales/pt-BR/agent-teams.mdx +1 -0
  1032. package/docs/content/locales/pt-BR/authentication.mdx +1 -1
  1033. package/docs/content/locales/pt-BR/components.mdx +11 -1
  1034. package/docs/content/locales/pt-BR/creating-templates.mdx +3 -7
  1035. package/docs/content/locales/pt-BR/cross-app-sso.mdx +16 -6
  1036. package/docs/content/locales/pt-BR/deployment.mdx +8 -0
  1037. package/docs/content/locales/pt-BR/external-agents.mdx +3 -7
  1038. package/docs/content/locales/pt-BR/key-concepts.mdx +13 -20
  1039. package/docs/content/locales/pt-BR/multi-tenancy.mdx +5 -5
  1040. package/docs/content/locales/pt-BR/notifications.mdx +18 -10
  1041. package/docs/content/locales/pt-BR/processors.mdx +11 -5
  1042. package/docs/content/locales/pt-BR/server.mdx +17 -10
  1043. package/docs/content/locales/pt-BR/sharing.mdx +10 -10
  1044. package/docs/content/locales/pt-BR/skills-guide.mdx +34 -17
  1045. package/docs/content/locales/pt-BR/template-assets.mdx +16 -13
  1046. package/docs/content/locales/pt-BR/template-brain.mdx +3 -1
  1047. package/docs/content/locales/pt-BR/template-clips.mdx +3 -3
  1048. package/docs/content/locales/pt-BR/template-design.mdx +3 -1
  1049. package/docs/content/locales/pt-BR/template-dispatch.mdx +5 -1
  1050. package/docs/content/locales/pt-BR/template-mail.mdx +8 -0
  1051. package/docs/content/locales/pt-BR/tracking.mdx +9 -6
  1052. package/docs/content/locales/pt-BR/using-your-agent.mdx +0 -7
  1053. package/docs/content/locales/pt-BR/voice-input.mdx +6 -0
  1054. package/docs/content/locales/pt-BR/workspace-connections.mdx +9 -2
  1055. package/docs/content/locales/pt-BR/workspace.mdx +19 -18
  1056. package/docs/content/locales/zh-CN/actions.mdx +2 -2
  1057. package/docs/content/locales/zh-CN/agent-native-toolkit.mdx +2 -2
  1058. package/docs/content/locales/zh-CN/agent-surfaces.mdx +8 -10
  1059. package/docs/content/locales/zh-CN/agent-teams.mdx +1 -0
  1060. package/docs/content/locales/zh-CN/authentication.mdx +1 -1
  1061. package/docs/content/locales/zh-CN/components.mdx +11 -1
  1062. package/docs/content/locales/zh-CN/creating-templates.mdx +3 -7
  1063. package/docs/content/locales/zh-CN/cross-app-sso.mdx +16 -6
  1064. package/docs/content/locales/zh-CN/deployment.mdx +8 -0
  1065. package/docs/content/locales/zh-CN/external-agents.mdx +2 -7
  1066. package/docs/content/locales/zh-CN/key-concepts.mdx +13 -20
  1067. package/docs/content/locales/zh-CN/multi-tenancy.mdx +5 -5
  1068. package/docs/content/locales/zh-CN/notifications.mdx +18 -10
  1069. package/docs/content/locales/zh-CN/processors.mdx +11 -5
  1070. package/docs/content/locales/zh-CN/server.mdx +16 -10
  1071. package/docs/content/locales/zh-CN/sharing.mdx +10 -10
  1072. package/docs/content/locales/zh-CN/skills-guide.mdx +34 -17
  1073. package/docs/content/locales/zh-CN/template-assets.mdx +16 -13
  1074. package/docs/content/locales/zh-CN/template-brain.mdx +3 -1
  1075. package/docs/content/locales/zh-CN/template-clips.mdx +3 -4
  1076. package/docs/content/locales/zh-CN/template-design.mdx +3 -1
  1077. package/docs/content/locales/zh-CN/template-dispatch.mdx +5 -1
  1078. package/docs/content/locales/zh-CN/template-mail.mdx +8 -0
  1079. package/docs/content/locales/zh-CN/tracking.mdx +9 -6
  1080. package/docs/content/locales/zh-CN/using-your-agent.mdx +0 -7
  1081. package/docs/content/locales/zh-CN/voice-input.mdx +6 -0
  1082. package/docs/content/locales/zh-CN/workspace-connections.mdx +9 -2
  1083. package/docs/content/locales/zh-CN/workspace.mdx +19 -18
  1084. package/docs/content/locales/zh-TW/actions.mdx +2 -2
  1085. package/docs/content/locales/zh-TW/agent-native-toolkit.mdx +2 -2
  1086. package/docs/content/locales/zh-TW/agent-surfaces.mdx +8 -10
  1087. package/docs/content/locales/zh-TW/agent-teams.mdx +1 -0
  1088. package/docs/content/locales/zh-TW/authentication.mdx +1 -1
  1089. package/docs/content/locales/zh-TW/components.mdx +11 -1
  1090. package/docs/content/locales/zh-TW/creating-templates.mdx +3 -7
  1091. package/docs/content/locales/zh-TW/cross-app-sso.mdx +16 -6
  1092. package/docs/content/locales/zh-TW/deployment.mdx +8 -0
  1093. package/docs/content/locales/zh-TW/external-agents.mdx +2 -7
  1094. package/docs/content/locales/zh-TW/key-concepts.mdx +13 -20
  1095. package/docs/content/locales/zh-TW/multi-tenancy.mdx +5 -5
  1096. package/docs/content/locales/zh-TW/notifications.mdx +18 -10
  1097. package/docs/content/locales/zh-TW/processors.mdx +11 -5
  1098. package/docs/content/locales/zh-TW/server.mdx +16 -10
  1099. package/docs/content/locales/zh-TW/sharing.mdx +10 -10
  1100. package/docs/content/locales/zh-TW/skills-guide.mdx +34 -17
  1101. package/docs/content/locales/zh-TW/template-assets.mdx +16 -13
  1102. package/docs/content/locales/zh-TW/template-brain.mdx +3 -1
  1103. package/docs/content/locales/zh-TW/template-clips.mdx +3 -4
  1104. package/docs/content/locales/zh-TW/template-design.mdx +3 -1
  1105. package/docs/content/locales/zh-TW/template-dispatch.mdx +5 -1
  1106. package/docs/content/locales/zh-TW/template-mail.mdx +8 -0
  1107. package/docs/content/locales/zh-TW/tracking.mdx +9 -6
  1108. package/docs/content/locales/zh-TW/using-your-agent.mdx +0 -7
  1109. package/docs/content/locales/zh-TW/voice-input.mdx +6 -0
  1110. package/docs/content/locales/zh-TW/workspace-connections.mdx +9 -2
  1111. package/docs/content/locales/zh-TW/workspace.mdx +19 -18
  1112. package/docs/content/mcp-apps.mdx +14 -32
  1113. package/docs/content/mcp-clients.mdx +48 -54
  1114. package/docs/content/mcp-protocol.mdx +25 -10
  1115. package/docs/content/messaging.mdx +19 -11
  1116. package/docs/content/multi-app-workspace.mdx +11 -96
  1117. package/docs/content/multi-tenancy.mdx +5 -5
  1118. package/docs/content/native-chat-ui.mdx +4 -4
  1119. package/docs/content/notifications.mdx +19 -12
  1120. package/docs/content/observability.mdx +2 -4
  1121. package/docs/content/observational-memory.mdx +7 -3
  1122. package/docs/content/onboarding.mdx +9 -2
  1123. package/docs/content/plan-plugin.mdx +10 -2
  1124. package/docs/content/pr-visual-recap.mdx +1 -1
  1125. package/docs/content/processors.mdx +11 -5
  1126. package/docs/content/pure-agent-apps.mdx +5 -1
  1127. package/docs/content/real-time-collaboration.mdx +30 -67
  1128. package/docs/content/recurring-jobs.mdx +8 -6
  1129. package/docs/content/routing.mdx +3 -4
  1130. package/docs/content/sandbox-adapters.mdx +30 -53
  1131. package/docs/content/security.mdx +8 -0
  1132. package/docs/content/server.mdx +17 -10
  1133. package/docs/content/sharing.mdx +10 -10
  1134. package/docs/content/skills-guide.mdx +35 -16
  1135. package/docs/content/template-analytics.mdx +11 -8
  1136. package/docs/content/template-assets.mdx +16 -13
  1137. package/docs/content/template-brain.mdx +3 -1
  1138. package/docs/content/template-calendar.mdx +12 -4
  1139. package/docs/content/template-chat.mdx +4 -4
  1140. package/docs/content/template-clips.mdx +3 -3
  1141. package/docs/content/template-content.mdx +23 -18
  1142. package/docs/content/template-design.mdx +3 -1
  1143. package/docs/content/template-dispatch.mdx +5 -1
  1144. package/docs/content/template-mail.mdx +14 -2
  1145. package/docs/content/template-plan.mdx +22 -15
  1146. package/docs/content/template-slides.mdx +11 -3
  1147. package/docs/content/toolkit-agent-ux.mdx +46 -3
  1148. package/docs/content/toolkit-collaboration.mdx +58 -4
  1149. package/docs/content/toolkit-command-navigation.mdx +8 -2
  1150. package/docs/content/toolkit-comments-review.mdx +10 -2
  1151. package/docs/content/toolkit-history.mdx +8 -3
  1152. package/docs/content/toolkit-observability.mdx +48 -2
  1153. package/docs/content/toolkit-org-team.mdx +8 -2
  1154. package/docs/content/toolkit-resources.mdx +45 -2
  1155. package/docs/content/toolkit-settings.mdx +8 -2
  1156. package/docs/content/toolkit-setup-connections.mdx +7 -2
  1157. package/docs/content/toolkit-sharing.mdx +46 -3
  1158. package/docs/content/toolkit-ui.mdx +82 -11
  1159. package/docs/content/tracking.mdx +10 -8
  1160. package/docs/content/using-your-agent.mdx +0 -12
  1161. package/docs/content/voice-input.mdx +7 -1
  1162. package/docs/content/what-is-agent-native.mdx +7 -8
  1163. package/docs/content/workspace-connections.mdx +16 -23
  1164. package/docs/content/workspace-management.mdx +16 -4
  1165. package/docs/content/workspace.mdx +19 -18
  1166. package/package.json +1 -1
  1167. package/src/templates/workspace-core/.agents/skills/voice-transcription/SKILL.md +39 -5
  1168. package/corpus/core/docs/content/locales/ar-SA/migration-workbench.mdx +0 -76
  1169. package/corpus/core/docs/content/locales/de-DE/migration-workbench.mdx +0 -76
  1170. package/corpus/core/docs/content/locales/es-ES/migration-workbench.mdx +0 -76
  1171. package/corpus/core/docs/content/locales/fr-FR/migration-workbench.mdx +0 -76
  1172. package/corpus/core/docs/content/locales/hi-IN/migration-workbench.mdx +0 -74
  1173. package/corpus/core/docs/content/locales/ja-JP/migration-workbench.mdx +0 -76
  1174. package/corpus/core/docs/content/locales/ko-KR/migration-workbench.mdx +0 -74
  1175. package/corpus/core/docs/content/locales/pt-BR/migration-workbench.mdx +0 -76
  1176. package/corpus/core/docs/content/locales/zh-CN/migration-workbench.mdx +0 -74
  1177. package/corpus/core/docs/content/locales/zh-TW/migration-workbench.mdx +0 -74
  1178. package/corpus/core/docs/content/migration-workbench.mdx +0 -74
  1179. package/corpus/core/docs/content/toolkit-app-adapters.mdx +0 -55
  1180. package/corpus/core/docs/content/toolkit-collaboration-ui.mdx +0 -60
  1181. package/corpus/core/docs/content/toolkit-sharing-ui.mdx +0 -45
  1182. package/corpus/core/docs/content/toolkit-shell-hooks.mdx +0 -36
  1183. package/docs/content/locales/ar-SA/migration-workbench.mdx +0 -76
  1184. package/docs/content/locales/de-DE/migration-workbench.mdx +0 -76
  1185. package/docs/content/locales/es-ES/migration-workbench.mdx +0 -76
  1186. package/docs/content/locales/fr-FR/migration-workbench.mdx +0 -76
  1187. package/docs/content/locales/hi-IN/migration-workbench.mdx +0 -74
  1188. package/docs/content/locales/ja-JP/migration-workbench.mdx +0 -76
  1189. package/docs/content/locales/ko-KR/migration-workbench.mdx +0 -74
  1190. package/docs/content/locales/pt-BR/migration-workbench.mdx +0 -76
  1191. package/docs/content/locales/zh-CN/migration-workbench.mdx +0 -74
  1192. package/docs/content/locales/zh-TW/migration-workbench.mdx +0 -74
  1193. package/docs/content/migration-workbench.mdx +0 -74
  1194. package/docs/content/toolkit-app-adapters.mdx +0 -55
  1195. package/docs/content/toolkit-collaboration-ui.mdx +0 -60
  1196. package/docs/content/toolkit-sharing-ui.mdx +0 -45
  1197. package/docs/content/toolkit-shell-hooks.mdx +0 -36
@@ -0,0 +1,492 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { createContext, useCallback, useContext, useEffect, useMemo, useRef, useState, } from "react";
3
+ import { createPortal } from "react-dom";
4
+ import { SIDEBAR_STATE_CHANGE_EVENT, } from "../agent-sidebar-state.js";
5
+ import { agentNativePath } from "../api-path.js";
6
+ import { readClientAppState, setClientAppState } from "../application-state.js";
7
+ import { getBrowserTabId } from "../browser-tab-id.js";
8
+ import { useT } from "../i18n.js";
9
+ import { RealtimeVoiceModeDock, } from "./RealtimeVoiceMode.js";
10
+ const REALTIME_VOICE_STATE_KEY = "realtime-voice-session";
11
+ const REALTIME_VOICE_REQUEST_SOURCE = "realtime-voice";
12
+ const REALTIME_VOICE_SESSION_PATH = "/_agent-native/realtime-voice/session";
13
+ const REALTIME_VOICE_TOOL_PATH = "/_agent-native/realtime-voice/tool";
14
+ function errorMessage(error) {
15
+ return error instanceof Error ? error.message : String(error);
16
+ }
17
+ async function readErrorResponse(response) {
18
+ const raw = await response.text().catch(() => "");
19
+ if (!raw)
20
+ return response.statusText || `HTTP ${response.status}`;
21
+ try {
22
+ const parsed = JSON.parse(raw);
23
+ return String(parsed.error ?? parsed.message ?? raw);
24
+ }
25
+ catch {
26
+ return raw.slice(0, 500);
27
+ }
28
+ }
29
+ export async function createRealtimeVoiceSession(offerSdp, options = {}) {
30
+ const response = await fetch(agentNativePath(REALTIME_VOICE_SESSION_PATH), {
31
+ method: "POST",
32
+ credentials: "same-origin",
33
+ headers: {
34
+ "Content-Type": "application/sdp",
35
+ ...(options.browserTabId
36
+ ? { "X-Agent-Native-Browser-Tab": options.browserTabId }
37
+ : {}),
38
+ },
39
+ body: offerSdp,
40
+ signal: options.signal,
41
+ });
42
+ if (!response.ok) {
43
+ const message = await readErrorResponse(response);
44
+ const error = new Error(message);
45
+ error.status = response.status;
46
+ throw error;
47
+ }
48
+ return response.text();
49
+ }
50
+ export async function executeRealtimeVoiceTool(input) {
51
+ const response = await fetch(agentNativePath(REALTIME_VOICE_TOOL_PATH), {
52
+ method: "POST",
53
+ credentials: "same-origin",
54
+ headers: {
55
+ "Content-Type": "application/json",
56
+ ...(input.browserTabId
57
+ ? { "X-Agent-Native-Browser-Tab": input.browserTabId }
58
+ : {}),
59
+ },
60
+ body: JSON.stringify({
61
+ name: input.name,
62
+ args: input.args,
63
+ callId: input.callId,
64
+ sessionId: input.sessionId,
65
+ browserTabId: input.browserTabId,
66
+ }),
67
+ signal: input.signal,
68
+ });
69
+ if (!response.ok) {
70
+ throw new Error(await readErrorResponse(response));
71
+ }
72
+ return (await response.json());
73
+ }
74
+ export function extractRealtimeVoiceFunctionCalls(event) {
75
+ if (event.type === "response.function_call_arguments.done") {
76
+ const name = typeof event.name === "string" ? event.name : "";
77
+ const callId = typeof event.call_id === "string" ? event.call_id : "";
78
+ if (!name || !callId)
79
+ return [];
80
+ return [
81
+ {
82
+ name,
83
+ callId,
84
+ argumentsText: typeof event.arguments === "string" ? event.arguments : "{}",
85
+ },
86
+ ];
87
+ }
88
+ if (event.type !== "response.done")
89
+ return [];
90
+ const response = event.response;
91
+ if (!response || typeof response !== "object")
92
+ return [];
93
+ const output = response.output;
94
+ if (!Array.isArray(output))
95
+ return [];
96
+ return output.flatMap((item) => {
97
+ if (!item || typeof item !== "object")
98
+ return [];
99
+ const record = item;
100
+ if (record.type !== "function_call")
101
+ return [];
102
+ const name = typeof record.name === "string" ? record.name : "";
103
+ const callId = typeof record.call_id === "string" ? record.call_id : "";
104
+ if (!name || !callId)
105
+ return [];
106
+ return [
107
+ {
108
+ name,
109
+ callId,
110
+ argumentsText: typeof record.arguments === "string" ? record.arguments : "{}",
111
+ },
112
+ ];
113
+ });
114
+ }
115
+ function parseFunctionArguments(text) {
116
+ const parsed = JSON.parse(text || "{}");
117
+ if (!parsed || typeof parsed !== "object" || Array.isArray(parsed)) {
118
+ throw new Error("The voice model returned invalid tool arguments.");
119
+ }
120
+ return parsed;
121
+ }
122
+ function sendDataChannelEvent(channel, event) {
123
+ if (!channel || channel.readyState !== "open")
124
+ return;
125
+ channel.send(JSON.stringify(event));
126
+ }
127
+ function openOpenAiKeySettings() {
128
+ if (typeof window === "undefined")
129
+ return;
130
+ window.location.hash = "#secrets:OPENAI_API_KEY";
131
+ window.dispatchEvent(new Event("agent-panel:open"));
132
+ window.dispatchEvent(new CustomEvent("agent-panel:open-settings", {
133
+ detail: { section: "secrets" },
134
+ }));
135
+ }
136
+ function voiceCopy(t) {
137
+ return {
138
+ entryButtonLabel: t("agentPanel.voiceMode.entryButtonLabel"),
139
+ promptTitle: t("agentPanel.voiceMode.promptTitle"),
140
+ promptDescription: t("agentPanel.voiceMode.promptDescription"),
141
+ startVoiceMode: t("agentPanel.voiceMode.start"),
142
+ keepDictating: t("agentPanel.voiceMode.keepDictating"),
143
+ showChat: t("agentPanel.voiceMode.showChat"),
144
+ hideChat: t("agentPanel.voiceMode.hideChat"),
145
+ endVoiceMode: t("agentPanel.voiceMode.end"),
146
+ status: {
147
+ connecting: t("agentPanel.voiceMode.status.connecting"),
148
+ listening: t("agentPanel.voiceMode.status.listening"),
149
+ speaking: t("agentPanel.voiceMode.status.speaking"),
150
+ working: t("agentPanel.voiceMode.status.working"),
151
+ error: t("agentPanel.voiceMode.status.error"),
152
+ ending: t("agentPanel.voiceMode.status.ending"),
153
+ },
154
+ errors: {
155
+ unsupported: t("agentPanel.voiceMode.errors.unsupported"),
156
+ responseFailed: t("agentPanel.voiceMode.errors.responseFailed"),
157
+ sessionFailed: t("agentPanel.voiceMode.errors.sessionFailed"),
158
+ channelDisconnected: t("agentPanel.voiceMode.errors.channelDisconnected"),
159
+ connectionFailed: t("agentPanel.voiceMode.errors.connectionFailed"),
160
+ offerFailed: t("agentPanel.voiceMode.errors.offerFailed"),
161
+ },
162
+ };
163
+ }
164
+ export function useRealtimeVoiceModeCopy() {
165
+ const t = useT();
166
+ return useMemo(() => voiceCopy(t), [t]);
167
+ }
168
+ function useRealtimeVoiceModeController(browserTabId, copy) {
169
+ const [state, setState] = useState("idle");
170
+ const [error, setError] = useState(null);
171
+ const [chatVisible, setChatVisible] = useState(false);
172
+ const stateRef = useRef(state);
173
+ const peerRef = useRef(null);
174
+ const channelRef = useRef(null);
175
+ const streamRef = useRef(null);
176
+ const audioRef = useRef(null);
177
+ const abortRef = useRef(null);
178
+ const handledCallsRef = useRef(new Set());
179
+ const sessionIdRef = useRef(undefined);
180
+ const startedAtRef = useRef(undefined);
181
+ const lastUserTextRef = useRef("");
182
+ const lastAssistantTextRef = useRef("");
183
+ useEffect(() => {
184
+ stateRef.current = state;
185
+ }, [state]);
186
+ const syncAppState = useCallback((nextState) => {
187
+ const value = nextState === "idle"
188
+ ? null
189
+ : {
190
+ active: true,
191
+ status: nextState,
192
+ model: "gpt-realtime-2.1",
193
+ startedAt: startedAtRef.current,
194
+ sessionId: sessionIdRef.current,
195
+ browserTabId,
196
+ lastUserText: lastUserTextRef.current || undefined,
197
+ lastAssistantText: lastAssistantTextRef.current || undefined,
198
+ };
199
+ void setClientAppState(REALTIME_VOICE_STATE_KEY, value, {
200
+ requestSource: REALTIME_VOICE_REQUEST_SOURCE,
201
+ }).catch(() => undefined);
202
+ }, [browserTabId]);
203
+ const transition = useCallback((nextState) => {
204
+ stateRef.current = nextState;
205
+ setState(nextState);
206
+ syncAppState(nextState);
207
+ }, [syncAppState]);
208
+ const cleanupTransport = useCallback(() => {
209
+ abortRef.current?.abort();
210
+ abortRef.current = null;
211
+ channelRef.current?.close();
212
+ channelRef.current = null;
213
+ peerRef.current?.close();
214
+ peerRef.current = null;
215
+ for (const track of streamRef.current?.getTracks() ?? [])
216
+ track.stop();
217
+ streamRef.current = null;
218
+ if (audioRef.current) {
219
+ audioRef.current.pause();
220
+ audioRef.current.srcObject = null;
221
+ }
222
+ audioRef.current = null;
223
+ handledCallsRef.current.clear();
224
+ }, []);
225
+ const fail = useCallback((message, options) => {
226
+ cleanupTransport();
227
+ setError(message);
228
+ transition("error");
229
+ if (options?.openKeySettings)
230
+ openOpenAiKeySettings();
231
+ }, [cleanupTransport, transition]);
232
+ const handleFunctionCall = useCallback(async (call) => {
233
+ if (handledCallsRef.current.has(call.callId))
234
+ return;
235
+ handledCallsRef.current.add(call.callId);
236
+ transition("working");
237
+ let result;
238
+ try {
239
+ const args = parseFunctionArguments(call.argumentsText);
240
+ result = await executeRealtimeVoiceTool({
241
+ name: call.name,
242
+ args,
243
+ callId: call.callId,
244
+ sessionId: sessionIdRef.current,
245
+ browserTabId,
246
+ signal: abortRef.current?.signal,
247
+ });
248
+ }
249
+ catch (toolError) {
250
+ result = {
251
+ callId: call.callId,
252
+ status: "failed",
253
+ output: errorMessage(toolError),
254
+ };
255
+ }
256
+ sendDataChannelEvent(channelRef.current, {
257
+ type: "conversation.item.create",
258
+ item: {
259
+ type: "function_call_output",
260
+ call_id: call.callId,
261
+ output: JSON.stringify(result),
262
+ },
263
+ });
264
+ sendDataChannelEvent(channelRef.current, { type: "response.create" });
265
+ }, [browserTabId, transition]);
266
+ const handleServerEvent = useCallback((event) => {
267
+ if (event.type === "session.created") {
268
+ const session = event.session;
269
+ if (session && typeof session === "object") {
270
+ const id = session.id;
271
+ if (typeof id === "string")
272
+ sessionIdRef.current = id;
273
+ }
274
+ transition("listening");
275
+ }
276
+ else if (event.type === "input_audio_buffer.speech_started") {
277
+ transition("listening");
278
+ }
279
+ else if (event.type === "input_audio_buffer.speech_stopped") {
280
+ transition("working");
281
+ }
282
+ else if (event.type === "response.created") {
283
+ lastAssistantTextRef.current = "";
284
+ transition("working");
285
+ }
286
+ else if (event.type === "response.output_audio_transcript.delta") {
287
+ if (typeof event.delta === "string") {
288
+ lastAssistantTextRef.current += event.delta;
289
+ }
290
+ transition("speaking");
291
+ }
292
+ else if (event.type === "response.output_audio_transcript.done") {
293
+ if (typeof event.transcript === "string") {
294
+ lastAssistantTextRef.current = event.transcript;
295
+ }
296
+ syncAppState("speaking");
297
+ }
298
+ else if (event.type === "conversation.item.input_audio_transcription.completed") {
299
+ if (typeof event.transcript === "string") {
300
+ lastUserTextRef.current = event.transcript;
301
+ syncAppState("working");
302
+ }
303
+ }
304
+ else if (event.type === "response.done") {
305
+ const response = event.response;
306
+ const status = response && typeof response === "object"
307
+ ? response.status
308
+ : undefined;
309
+ if (status === "failed") {
310
+ fail(copy?.errors.responseFailed ??
311
+ "OpenAI could not complete the voice response.");
312
+ return;
313
+ }
314
+ }
315
+ else if (event.type === "error") {
316
+ const detail = event.error;
317
+ const message = detail && typeof detail === "object"
318
+ ? String(detail.message ?? "")
319
+ : typeof detail === "string"
320
+ ? detail
321
+ : "";
322
+ fail(message ||
323
+ copy?.errors.sessionFailed ||
324
+ "The realtime voice session encountered an error.");
325
+ return;
326
+ }
327
+ const calls = extractRealtimeVoiceFunctionCalls(event);
328
+ for (const call of calls)
329
+ void handleFunctionCall(call);
330
+ if (event.type === "response.done" && calls.length === 0) {
331
+ transition("listening");
332
+ }
333
+ }, [copy, fail, handleFunctionCall, syncAppState, transition]);
334
+ const start = useCallback(async () => {
335
+ if (stateRef.current !== "idle")
336
+ return;
337
+ if (typeof RTCPeerConnection === "undefined" ||
338
+ !navigator.mediaDevices?.getUserMedia) {
339
+ fail(copy?.errors.unsupported ??
340
+ "This browser does not support realtime voice conversations.");
341
+ return;
342
+ }
343
+ setError(null);
344
+ startedAtRef.current = new Date().toISOString();
345
+ lastUserTextRef.current = "";
346
+ lastAssistantTextRef.current = "";
347
+ sessionIdRef.current = undefined;
348
+ transition("connecting");
349
+ setChatVisible(false);
350
+ window.dispatchEvent(new Event("agent-panel:close"));
351
+ const abortController = new AbortController();
352
+ abortRef.current = abortController;
353
+ try {
354
+ const stream = await navigator.mediaDevices.getUserMedia({
355
+ audio: {
356
+ echoCancellation: true,
357
+ noiseSuppression: true,
358
+ autoGainControl: true,
359
+ },
360
+ });
361
+ streamRef.current = stream;
362
+ const peer = new RTCPeerConnection();
363
+ peerRef.current = peer;
364
+ for (const track of stream.getAudioTracks())
365
+ peer.addTrack(track, stream);
366
+ const audio = document.createElement("audio");
367
+ audio.autoplay = true;
368
+ audio.setAttribute("playsinline", "");
369
+ audioRef.current = audio;
370
+ peer.ontrack = (trackEvent) => {
371
+ audio.srcObject = trackEvent.streams[0] ?? null;
372
+ void audio.play().catch(() => undefined);
373
+ };
374
+ const channel = peer.createDataChannel("oai-events");
375
+ channelRef.current = channel;
376
+ channel.onopen = () => transition("listening");
377
+ channel.onmessage = (messageEvent) => {
378
+ try {
379
+ handleServerEvent(JSON.parse(String(messageEvent.data)));
380
+ }
381
+ catch {
382
+ // Ignore malformed provider events without ending a healthy call.
383
+ }
384
+ };
385
+ channel.onerror = () => fail(copy?.errors.channelDisconnected ??
386
+ "The realtime voice control channel disconnected.");
387
+ peer.onconnectionstatechange = () => {
388
+ if (peer.connectionState === "connected")
389
+ transition("listening");
390
+ if (peer.connectionState === "failed") {
391
+ fail(copy?.errors.connectionFailed ??
392
+ "The realtime voice connection failed.");
393
+ }
394
+ };
395
+ const offer = await peer.createOffer();
396
+ await peer.setLocalDescription(offer);
397
+ if (!offer.sdp) {
398
+ throw new Error(copy?.errors.offerFailed ??
399
+ "The browser did not create an audio offer.");
400
+ }
401
+ const answerSdp = await createRealtimeVoiceSession(offer.sdp, {
402
+ browserTabId,
403
+ signal: abortController.signal,
404
+ });
405
+ await peer.setRemoteDescription({ type: "answer", sdp: answerSdp });
406
+ }
407
+ catch (startError) {
408
+ const status = startError?.status;
409
+ fail(errorMessage(startError), { openKeySettings: status === 400 });
410
+ }
411
+ }, [browserTabId, copy, fail, handleServerEvent, transition]);
412
+ const end = useCallback(() => {
413
+ if (stateRef.current === "idle" || stateRef.current === "ending")
414
+ return;
415
+ transition("ending");
416
+ cleanupTransport();
417
+ setError(null);
418
+ sessionIdRef.current = undefined;
419
+ startedAtRef.current = undefined;
420
+ transition("idle");
421
+ }, [cleanupTransport, transition]);
422
+ const toggleChat = useCallback(() => {
423
+ setChatVisible((current) => !current);
424
+ window.dispatchEvent(new Event("agent-panel:toggle"));
425
+ }, []);
426
+ useEffect(() => {
427
+ const onSidebarState = (event) => {
428
+ const detail = event
429
+ .detail;
430
+ if (detail && typeof detail.open === "boolean") {
431
+ setChatVisible(detail.open);
432
+ }
433
+ };
434
+ window.addEventListener(SIDEBAR_STATE_CHANGE_EVENT, onSidebarState);
435
+ return () => window.removeEventListener(SIDEBAR_STATE_CHANGE_EVENT, onSidebarState);
436
+ }, []);
437
+ useEffect(() => cleanupTransport, [cleanupTransport]);
438
+ return {
439
+ state,
440
+ active: state !== "idle",
441
+ errorMessage: error,
442
+ chatVisible,
443
+ start,
444
+ end,
445
+ toggleChat,
446
+ };
447
+ }
448
+ const RealtimeVoiceModeContext = createContext(null);
449
+ export function RealtimeVoiceModeProvider({ children, browserTabId, }) {
450
+ const resolvedBrowserTabId = useMemo(() => browserTabId ?? getBrowserTabId(), [browserTabId]);
451
+ const copy = useRealtimeVoiceModeCopy();
452
+ const voice = useRealtimeVoiceModeController(resolvedBrowserTabId, copy);
453
+ return (_jsxs(RealtimeVoiceModeContext.Provider, { value: voice, children: [children, voice.active && typeof document !== "undefined"
454
+ ? createPortal(_jsx(RealtimeVoiceModeDock, { state: voice.state === "idle" ? "ending" : voice.state, copy: copy, chatVisible: voice.chatVisible, onToggleChat: voice.toggleChat, onEndVoiceMode: voice.end, errorMessage: voice.errorMessage, className: "z-[270]" }), document.body)
455
+ : null] }));
456
+ }
457
+ /**
458
+ * Ensure standalone/full-page composers get realtime voice without nesting a
459
+ * second session owner inside the persistent AgentSidebar provider.
460
+ */
461
+ export function RealtimeVoiceModeBoundary({ children, browserTabId, }) {
462
+ const existing = useRealtimeVoiceModeOptional();
463
+ if (existing) {
464
+ return (_jsx(RealtimeVoiceModeComposerSurface, { children: children }));
465
+ }
466
+ return (_jsx(RealtimeVoiceModeProvider, { browserTabId: browserTabId, children: _jsx(RealtimeVoiceModeComposerSurface, { children: children }) }));
467
+ }
468
+ /** Hide a composer while voice owns input; the dock can reveal it on demand. */
469
+ function RealtimeVoiceModeComposerSurface({ children, }) {
470
+ const voice = useRealtimeVoiceModeOptional();
471
+ if (voice?.active && !voice.chatVisible)
472
+ return null;
473
+ return children;
474
+ }
475
+ export function useRealtimeVoiceMode() {
476
+ const value = useContext(RealtimeVoiceModeContext);
477
+ if (!value) {
478
+ throw new Error("useRealtimeVoiceMode must be used inside RealtimeVoiceModeProvider.");
479
+ }
480
+ return value;
481
+ }
482
+ export function useRealtimeVoiceModeOptional() {
483
+ return useContext(RealtimeVoiceModeContext);
484
+ }
485
+ export async function readRealtimeVoiceContext() {
486
+ const [navigation, url] = await Promise.all([
487
+ readClientAppState("navigation").catch(() => null),
488
+ readClientAppState("__url__").catch(() => null),
489
+ ]);
490
+ return { navigation, url };
491
+ }
492
+ //# sourceMappingURL=useRealtimeVoiceMode.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useRealtimeVoiceMode.js","sourceRoot":"","sources":["../../../src/client/composer/useRealtimeVoiceMode.tsx"],"names":[],"mappings":";AAAA,OAAO,EACL,aAAa,EACb,WAAW,EACX,UAAU,EACV,SAAS,EACT,OAAO,EACP,MAAM,EACN,QAAQ,GAET,MAAM,OAAO,CAAC;AACf,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AAEzC,OAAO,EACL,0BAA0B,GAE3B,MAAM,2BAA2B,CAAC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,CAAC;IACnD,IAAI,CAAC,KAAK,EAAE,CAAC;QACX,MAAM,IAAI,KAAK,CACb,qEAAqE,CACtE,CAAC;IACJ,CAAC;IACD,OAAO,KAAK,CAAC;AACf,CAAC;AAED,MAAM,UAAU,4BAA4B;IAC1C,OAAO,UAAU,CAAC,wBAAwB,CAAC,CAAC;AAC9C,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,wBAAwB;IAI5C,MAAM,CAAC,UAAU,EAAE,GAAG,CAAC,GAAG,MAAM,OAAO,CAAC,GAAG,CAAC;QAC1C,kBAAkB,CAAC,YAAY,CAAC,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC,IAAI,CAAC;QAClD,kBAAkB,CAAC,SAAS,CAAC,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC,IAAI,CAAC;KAChD,CAAC,CAAC;IACH,OAAO,EAAE,UAAU,EAAE,GAAG,EAAE,CAAC;AAC7B,CAAC","sourcesContent":["import {\n createContext,\n useCallback,\n useContext,\n useEffect,\n useMemo,\n useRef,\n useState,\n type ReactNode,\n} from \"react\";\nimport { createPortal } from \"react-dom\";\n\nimport {\n SIDEBAR_STATE_CHANGE_EVENT,\n type AgentSidebarStateChangeDetail,\n} from \"../agent-sidebar-state.js\";\nimport { agentNativePath } from \"../api-path.js\";\nimport { readClientAppState, setClientAppState } from \"../application-state.js\";\nimport { getBrowserTabId } from \"../browser-tab-id.js\";\nimport { useT } from \"../i18n.js\";\nimport {\n RealtimeVoiceModeDock,\n type RealtimeVoiceModeCopy,\n type RealtimeVoiceModeState,\n} from \"./RealtimeVoiceMode.js\";\n\nconst REALTIME_VOICE_STATE_KEY = \"realtime-voice-session\";\nconst REALTIME_VOICE_REQUEST_SOURCE = \"realtime-voice\";\nconst REALTIME_VOICE_SESSION_PATH = \"/_agent-native/realtime-voice/session\";\nconst REALTIME_VOICE_TOOL_PATH = \"/_agent-native/realtime-voice/tool\";\n\ntype RealtimeServerEvent = Record<string, unknown> & { type?: string };\n\nexport interface RealtimeVoiceToolResult {\n callId: string;\n status: \"completed\" | \"failed\" | \"approval_required\";\n output: string;\n approvalKey?: string;\n}\n\nexport interface RealtimeVoiceModeApi {\n state: \"idle\" | RealtimeVoiceModeState;\n active: boolean;\n errorMessage: string | null;\n chatVisible: boolean;\n start: () => Promise<void>;\n end: () => void;\n toggleChat: () => void;\n}\n\nexport interface RealtimeVoiceModeProviderProps {\n children: ReactNode;\n browserTabId?: string;\n}\n\nfunction errorMessage(error: unknown): string {\n return error instanceof Error ? error.message : String(error);\n}\n\nasync function readErrorResponse(response: Response): Promise<string> {\n const raw = await response.text().catch(() => \"\");\n if (!raw) return response.statusText || `HTTP ${response.status}`;\n try {\n const parsed = JSON.parse(raw) as { error?: unknown; message?: unknown };\n return String(parsed.error ?? parsed.message ?? raw);\n } catch {\n return raw.slice(0, 500);\n }\n}\n\nexport async function createRealtimeVoiceSession(\n offerSdp: string,\n options: { browserTabId?: string; signal?: AbortSignal } = {},\n): Promise<string> {\n const response = await fetch(agentNativePath(REALTIME_VOICE_SESSION_PATH), {\n method: \"POST\",\n credentials: \"same-origin\",\n headers: {\n \"Content-Type\": \"application/sdp\",\n ...(options.browserTabId\n ? { \"X-Agent-Native-Browser-Tab\": options.browserTabId }\n : {}),\n },\n body: offerSdp,\n signal: options.signal,\n });\n if (!response.ok) {\n const message = await readErrorResponse(response);\n const error = new Error(message);\n (error as { status?: number }).status = response.status;\n throw error;\n }\n return response.text();\n}\n\nexport async function executeRealtimeVoiceTool(input: {\n name: string;\n args: Record<string, unknown>;\n callId: string;\n sessionId?: string;\n browserTabId?: string;\n signal?: AbortSignal;\n}): Promise<RealtimeVoiceToolResult> {\n const response = await fetch(agentNativePath(REALTIME_VOICE_TOOL_PATH), {\n method: \"POST\",\n credentials: \"same-origin\",\n headers: {\n \"Content-Type\": \"application/json\",\n ...(input.browserTabId\n ? { \"X-Agent-Native-Browser-Tab\": input.browserTabId }\n : {}),\n },\n body: JSON.stringify({\n name: input.name,\n args: input.args,\n callId: input.callId,\n sessionId: input.sessionId,\n browserTabId: input.browserTabId,\n }),\n signal: input.signal,\n });\n if (!response.ok) {\n throw new Error(await readErrorResponse(response));\n }\n return (await response.json()) as RealtimeVoiceToolResult;\n}\n\nexport function extractRealtimeVoiceFunctionCalls(\n event: RealtimeServerEvent,\n): Array<{ name: string; callId: string; argumentsText: string }> {\n if (event.type === \"response.function_call_arguments.done\") {\n const name = typeof event.name === \"string\" ? event.name : \"\";\n const callId = typeof event.call_id === \"string\" ? event.call_id : \"\";\n if (!name || !callId) return [];\n return [\n {\n name,\n callId,\n argumentsText:\n typeof event.arguments === \"string\" ? event.arguments : \"{}\",\n },\n ];\n }\n if (event.type !== \"response.done\") return [];\n const response = event.response;\n if (!response || typeof response !== \"object\") return [];\n const output = (response as { output?: unknown }).output;\n if (!Array.isArray(output)) return [];\n return output.flatMap((item) => {\n if (!item || typeof item !== \"object\") return [];\n const record = item as Record<string, unknown>;\n if (record.type !== \"function_call\") return [];\n const name = typeof record.name === \"string\" ? record.name : \"\";\n const callId = typeof record.call_id === \"string\" ? record.call_id : \"\";\n if (!name || !callId) return [];\n return [\n {\n name,\n callId,\n argumentsText:\n typeof record.arguments === \"string\" ? record.arguments : \"{}\",\n },\n ];\n });\n}\n\nfunction parseFunctionArguments(text: string): Record<string, unknown> {\n const parsed = JSON.parse(text || \"{}\");\n if (!parsed || typeof parsed !== \"object\" || Array.isArray(parsed)) {\n throw new Error(\"The voice model returned invalid tool arguments.\");\n }\n return parsed as Record<string, unknown>;\n}\n\nfunction sendDataChannelEvent(\n channel: RTCDataChannel | null,\n event: Record<string, unknown>,\n): void {\n if (!channel || channel.readyState !== \"open\") return;\n channel.send(JSON.stringify(event));\n}\n\nfunction openOpenAiKeySettings(): void {\n if (typeof window === \"undefined\") return;\n window.location.hash = \"#secrets:OPENAI_API_KEY\";\n window.dispatchEvent(new Event(\"agent-panel:open\"));\n window.dispatchEvent(\n new CustomEvent(\"agent-panel:open-settings\", {\n detail: { section: \"secrets\" },\n }),\n );\n}\n\nfunction voiceCopy(t: ReturnType<typeof useT>): RealtimeVoiceModeCopy {\n return {\n entryButtonLabel: t(\"agentPanel.voiceMode.entryButtonLabel\"),\n promptTitle: t(\"agentPanel.voiceMode.promptTitle\"),\n promptDescription: t(\"agentPanel.voiceMode.promptDescription\"),\n startVoiceMode: t(\"agentPanel.voiceMode.start\"),\n keepDictating: t(\"agentPanel.voiceMode.keepDictating\"),\n showChat: t(\"agentPanel.voiceMode.showChat\"),\n hideChat: t(\"agentPanel.voiceMode.hideChat\"),\n endVoiceMode: t(\"agentPanel.voiceMode.end\"),\n status: {\n connecting: t(\"agentPanel.voiceMode.status.connecting\"),\n listening: t(\"agentPanel.voiceMode.status.listening\"),\n speaking: t(\"agentPanel.voiceMode.status.speaking\"),\n working: t(\"agentPanel.voiceMode.status.working\"),\n error: t(\"agentPanel.voiceMode.status.error\"),\n ending: t(\"agentPanel.voiceMode.status.ending\"),\n },\n errors: {\n unsupported: t(\"agentPanel.voiceMode.errors.unsupported\"),\n responseFailed: t(\"agentPanel.voiceMode.errors.responseFailed\"),\n sessionFailed: t(\"agentPanel.voiceMode.errors.sessionFailed\"),\n channelDisconnected: t(\"agentPanel.voiceMode.errors.channelDisconnected\"),\n connectionFailed: t(\"agentPanel.voiceMode.errors.connectionFailed\"),\n offerFailed: t(\"agentPanel.voiceMode.errors.offerFailed\"),\n },\n };\n}\n\nexport function useRealtimeVoiceModeCopy(): RealtimeVoiceModeCopy {\n const t = useT();\n return useMemo(() => voiceCopy(t), [t]);\n}\n\nfunction useRealtimeVoiceModeController(\n browserTabId?: string,\n copy?: RealtimeVoiceModeCopy,\n): RealtimeVoiceModeApi {\n const [state, setState] = useState<\"idle\" | RealtimeVoiceModeState>(\"idle\");\n const [error, setError] = useState<string | null>(null);\n const [chatVisible, setChatVisible] = useState(false);\n const stateRef = useRef(state);\n const peerRef = useRef<RTCPeerConnection | null>(null);\n const channelRef = useRef<RTCDataChannel | null>(null);\n const streamRef = useRef<MediaStream | null>(null);\n const audioRef = useRef<HTMLAudioElement | null>(null);\n const abortRef = useRef<AbortController | null>(null);\n const handledCallsRef = useRef(new Set<string>());\n const sessionIdRef = useRef<string | undefined>(undefined);\n const startedAtRef = useRef<string | undefined>(undefined);\n const lastUserTextRef = useRef(\"\");\n const lastAssistantTextRef = useRef(\"\");\n\n useEffect(() => {\n stateRef.current = state;\n }, [state]);\n\n const syncAppState = useCallback(\n (nextState: \"idle\" | RealtimeVoiceModeState) => {\n const value =\n nextState === \"idle\"\n ? null\n : {\n active: true,\n status: nextState,\n model: \"gpt-realtime-2.1\",\n startedAt: startedAtRef.current,\n sessionId: sessionIdRef.current,\n browserTabId,\n lastUserText: lastUserTextRef.current || undefined,\n lastAssistantText: lastAssistantTextRef.current || undefined,\n };\n void setClientAppState(REALTIME_VOICE_STATE_KEY, value, {\n requestSource: REALTIME_VOICE_REQUEST_SOURCE,\n }).catch(() => undefined);\n },\n [browserTabId],\n );\n\n const transition = useCallback(\n (nextState: \"idle\" | RealtimeVoiceModeState) => {\n stateRef.current = nextState;\n setState(nextState);\n syncAppState(nextState);\n },\n [syncAppState],\n );\n\n const cleanupTransport = useCallback(() => {\n abortRef.current?.abort();\n abortRef.current = null;\n channelRef.current?.close();\n channelRef.current = null;\n peerRef.current?.close();\n peerRef.current = null;\n for (const track of streamRef.current?.getTracks() ?? []) track.stop();\n streamRef.current = null;\n if (audioRef.current) {\n audioRef.current.pause();\n audioRef.current.srcObject = null;\n }\n audioRef.current = null;\n handledCallsRef.current.clear();\n }, []);\n\n const fail = useCallback(\n (message: string, options?: { openKeySettings?: boolean }) => {\n cleanupTransport();\n setError(message);\n transition(\"error\");\n if (options?.openKeySettings) openOpenAiKeySettings();\n },\n [cleanupTransport, transition],\n );\n\n const handleFunctionCall = useCallback(\n async (call: { name: string; callId: string; argumentsText: string }) => {\n if (handledCallsRef.current.has(call.callId)) return;\n handledCallsRef.current.add(call.callId);\n transition(\"working\");\n let result: RealtimeVoiceToolResult;\n try {\n const args = parseFunctionArguments(call.argumentsText);\n result = await executeRealtimeVoiceTool({\n name: call.name,\n args,\n callId: call.callId,\n sessionId: sessionIdRef.current,\n browserTabId,\n signal: abortRef.current?.signal,\n });\n } catch (toolError) {\n result = {\n callId: call.callId,\n status: \"failed\",\n output: errorMessage(toolError),\n };\n }\n sendDataChannelEvent(channelRef.current, {\n type: \"conversation.item.create\",\n item: {\n type: \"function_call_output\",\n call_id: call.callId,\n output: JSON.stringify(result),\n },\n });\n sendDataChannelEvent(channelRef.current, { type: \"response.create\" });\n },\n [browserTabId, transition],\n );\n\n const handleServerEvent = useCallback(\n (event: RealtimeServerEvent) => {\n if (event.type === \"session.created\") {\n const session = event.session;\n if (session && typeof session === \"object\") {\n const id = (session as { id?: unknown }).id;\n if (typeof id === \"string\") sessionIdRef.current = id;\n }\n transition(\"listening\");\n } else if (event.type === \"input_audio_buffer.speech_started\") {\n transition(\"listening\");\n } else if (event.type === \"input_audio_buffer.speech_stopped\") {\n transition(\"working\");\n } else if (event.type === \"response.created\") {\n lastAssistantTextRef.current = \"\";\n transition(\"working\");\n } else if (event.type === \"response.output_audio_transcript.delta\") {\n if (typeof event.delta === \"string\") {\n lastAssistantTextRef.current += event.delta;\n }\n transition(\"speaking\");\n } else if (event.type === \"response.output_audio_transcript.done\") {\n if (typeof event.transcript === \"string\") {\n lastAssistantTextRef.current = event.transcript;\n }\n syncAppState(\"speaking\");\n } else if (\n event.type === \"conversation.item.input_audio_transcription.completed\"\n ) {\n if (typeof event.transcript === \"string\") {\n lastUserTextRef.current = event.transcript;\n syncAppState(\"working\");\n }\n } else if (event.type === \"response.done\") {\n const response = event.response;\n const status =\n response && typeof response === \"object\"\n ? (response as { status?: unknown }).status\n : undefined;\n if (status === \"failed\") {\n fail(\n copy?.errors.responseFailed ??\n \"OpenAI could not complete the voice response.\",\n );\n return;\n }\n } else if (event.type === \"error\") {\n const detail = event.error;\n const message =\n detail && typeof detail === \"object\"\n ? String((detail as { message?: unknown }).message ?? \"\")\n : typeof detail === \"string\"\n ? detail\n : \"\";\n fail(\n message ||\n copy?.errors.sessionFailed ||\n \"The realtime voice session encountered an error.\",\n );\n return;\n }\n\n const calls = extractRealtimeVoiceFunctionCalls(event);\n for (const call of calls) void handleFunctionCall(call);\n if (event.type === \"response.done\" && calls.length === 0) {\n transition(\"listening\");\n }\n },\n [copy, fail, handleFunctionCall, syncAppState, transition],\n );\n\n const start = useCallback(async () => {\n if (stateRef.current !== \"idle\") return;\n if (\n typeof RTCPeerConnection === \"undefined\" ||\n !navigator.mediaDevices?.getUserMedia\n ) {\n fail(\n copy?.errors.unsupported ??\n \"This browser does not support realtime voice conversations.\",\n );\n return;\n }\n setError(null);\n startedAtRef.current = new Date().toISOString();\n lastUserTextRef.current = \"\";\n lastAssistantTextRef.current = \"\";\n sessionIdRef.current = undefined;\n transition(\"connecting\");\n setChatVisible(false);\n window.dispatchEvent(new Event(\"agent-panel:close\"));\n\n const abortController = new AbortController();\n abortRef.current = abortController;\n try {\n const stream = await navigator.mediaDevices.getUserMedia({\n audio: {\n echoCancellation: true,\n noiseSuppression: true,\n autoGainControl: true,\n },\n });\n streamRef.current = stream;\n\n const peer = new RTCPeerConnection();\n peerRef.current = peer;\n for (const track of stream.getAudioTracks()) peer.addTrack(track, stream);\n\n const audio = document.createElement(\"audio\");\n audio.autoplay = true;\n audio.setAttribute(\"playsinline\", \"\");\n audioRef.current = audio;\n peer.ontrack = (trackEvent) => {\n audio.srcObject = trackEvent.streams[0] ?? null;\n void audio.play().catch(() => undefined);\n };\n\n const channel = peer.createDataChannel(\"oai-events\");\n channelRef.current = channel;\n channel.onopen = () => transition(\"listening\");\n channel.onmessage = (messageEvent) => {\n try {\n handleServerEvent(JSON.parse(String(messageEvent.data)));\n } catch {\n // Ignore malformed provider events without ending a healthy call.\n }\n };\n channel.onerror = () =>\n fail(\n copy?.errors.channelDisconnected ??\n \"The realtime voice control channel disconnected.\",\n );\n peer.onconnectionstatechange = () => {\n if (peer.connectionState === \"connected\") transition(\"listening\");\n if (peer.connectionState === \"failed\") {\n fail(\n copy?.errors.connectionFailed ??\n \"The realtime voice connection failed.\",\n );\n }\n };\n\n const offer = await peer.createOffer();\n await peer.setLocalDescription(offer);\n if (!offer.sdp) {\n throw new Error(\n copy?.errors.offerFailed ??\n \"The browser did not create an audio offer.\",\n );\n }\n const answerSdp = await createRealtimeVoiceSession(offer.sdp, {\n browserTabId,\n signal: abortController.signal,\n });\n await peer.setRemoteDescription({ type: \"answer\", sdp: answerSdp });\n } catch (startError) {\n const status = (startError as { status?: unknown })?.status;\n fail(errorMessage(startError), { openKeySettings: status === 400 });\n }\n }, [browserTabId, copy, fail, handleServerEvent, transition]);\n\n const end = useCallback(() => {\n if (stateRef.current === \"idle\" || stateRef.current === \"ending\") return;\n transition(\"ending\");\n cleanupTransport();\n setError(null);\n sessionIdRef.current = undefined;\n startedAtRef.current = undefined;\n transition(\"idle\");\n }, [cleanupTransport, transition]);\n\n const toggleChat = useCallback(() => {\n setChatVisible((current) => !current);\n window.dispatchEvent(new Event(\"agent-panel:toggle\"));\n }, []);\n\n useEffect(() => {\n const onSidebarState = (event: Event) => {\n const detail = (event as CustomEvent<AgentSidebarStateChangeDetail>)\n .detail;\n if (detail && typeof detail.open === \"boolean\") {\n setChatVisible(detail.open);\n }\n };\n window.addEventListener(SIDEBAR_STATE_CHANGE_EVENT, onSidebarState);\n return () =>\n window.removeEventListener(SIDEBAR_STATE_CHANGE_EVENT, onSidebarState);\n }, []);\n\n useEffect(() => cleanupTransport, [cleanupTransport]);\n\n return {\n state,\n active: state !== \"idle\",\n errorMessage: error,\n chatVisible,\n start,\n end,\n toggleChat,\n };\n}\n\nconst RealtimeVoiceModeContext = createContext<RealtimeVoiceModeApi | null>(\n null,\n);\n\nexport function RealtimeVoiceModeProvider({\n children,\n browserTabId,\n}: RealtimeVoiceModeProviderProps) {\n const resolvedBrowserTabId = useMemo(\n () => browserTabId ?? getBrowserTabId(),\n [browserTabId],\n );\n const copy = useRealtimeVoiceModeCopy();\n const voice = useRealtimeVoiceModeController(resolvedBrowserTabId, copy);\n\n return (\n <RealtimeVoiceModeContext.Provider value={voice}>\n {children}\n {voice.active && typeof document !== \"undefined\"\n ? createPortal(\n <RealtimeVoiceModeDock\n state={voice.state === \"idle\" ? \"ending\" : voice.state}\n copy={copy}\n chatVisible={voice.chatVisible}\n onToggleChat={voice.toggleChat}\n onEndVoiceMode={voice.end}\n errorMessage={voice.errorMessage}\n className=\"z-[270]\"\n />,\n document.body,\n )\n : null}\n </RealtimeVoiceModeContext.Provider>\n );\n}\n\n/**\n * Ensure standalone/full-page composers get realtime voice without nesting a\n * second session owner inside the persistent AgentSidebar provider.\n */\nexport function RealtimeVoiceModeBoundary({\n children,\n browserTabId,\n}: RealtimeVoiceModeProviderProps) {\n const existing = useRealtimeVoiceModeOptional();\n if (existing) {\n return (\n <RealtimeVoiceModeComposerSurface>\n {children}\n </RealtimeVoiceModeComposerSurface>\n );\n }\n return (\n <RealtimeVoiceModeProvider browserTabId={browserTabId}>\n <RealtimeVoiceModeComposerSurface>\n {children}\n </RealtimeVoiceModeComposerSurface>\n </RealtimeVoiceModeProvider>\n );\n}\n\n/** Hide a composer while voice owns input; the dock can reveal it on demand. */\nfunction RealtimeVoiceModeComposerSurface({\n children,\n}: Pick<RealtimeVoiceModeProviderProps, \"children\">) {\n const voice = useRealtimeVoiceModeOptional();\n if (voice?.active && !voice.chatVisible) return null;\n return children;\n}\n\nexport function useRealtimeVoiceMode(): RealtimeVoiceModeApi {\n const value = useContext(RealtimeVoiceModeContext);\n if (!value) {\n throw new Error(\n \"useRealtimeVoiceMode must be used inside RealtimeVoiceModeProvider.\",\n );\n }\n return value;\n}\n\nexport function useRealtimeVoiceModeOptional(): RealtimeVoiceModeApi | null {\n return useContext(RealtimeVoiceModeContext);\n}\n\nexport async function readRealtimeVoiceContext(): Promise<{\n navigation: unknown;\n url: unknown;\n}> {\n const [navigation, url] = await Promise.all([\n readClientAppState(\"navigation\").catch(() => null),\n readClientAppState(\"__url__\").catch(() => null),\n ]);\n return { navigation, url };\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"guided-questions.d.ts","sourceRoot":"","sources":["../../src/client/guided-questions.tsx"],"names":[],"mappings":"AAcA,MAAM,MAAM,kBAAkB,GAC1B,cAAc,GACd,eAAe,GACf,QAAQ,GACR,MAAM,GACN,UAAU,CAAC;AAEf,MAAM,WAAW,oBAAoB;IACnC,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB;;oEAEgE;IAChE,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,cAAc;IAC7B,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,kBAAkB,CAAC;IACzB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,MAAM,CAAC;IACjB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,OAAO,CAAC,EAAE,oBAAoB,EAAE,CAAC;IACjC,OAAO,CAAC,EAAE,oBAAoB,EAAE,CAAC;IACjC,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,iEAAiE;IACjE,cAAc,CAAC,EAAE,OAAO,CAAC;CAC1B;AAED,MAAM,MAAM,qBAAqB,GAAG,MAAM,CAAC,MAAM,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AC9B,eAAe,CAAC,EAAE,MAAM,GAAG,KAAK,CAAC;IACjC,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,kBAAkB,CAAC,EAAE,CAAC,IAAI,EAAE;QAC1B,OAAO,EAAE,qBAAqB,CAAC;QAC/B,gBAAgB,EAAE,MAAM,CAAC;KAC1B,KAAK,MAAM,CAAC;IACb,gBAAgB,CAAC,EAAE,MAAM,MAAM,CAAC;CACjC;AAED,wBAAgB,qBAAqB,CAAC,EACpC,QAA2B,EAC3B,YAAY,EACZ,QAA6B,EAC7B,eAAuB,EACvB,aAAiD,EACjD,WAAmD,EACnD,kBAAkB,EAClB,gBAAgB,GACjB,GAAE,4BAAiC;;;;;;;;4BA6FtB,qBAAqB;;EAmDlC"}
1
+ {"version":3,"file":"guided-questions.d.ts","sourceRoot":"","sources":["../../src/client/guided-questions.tsx"],"names":[],"mappings":"AAeA,MAAM,MAAM,kBAAkB,GAC1B,cAAc,GACd,eAAe,GACf,QAAQ,GACR,MAAM,GACN,UAAU,CAAC;AAEf,MAAM,WAAW,oBAAoB;IACnC,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB;;oEAEgE;IAChE,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,cAAc;IAC7B,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,kBAAkB,CAAC;IACzB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,MAAM,CAAC;IACjB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,OAAO,CAAC,EAAE,oBAAoB,EAAE,CAAC;IACjC,OAAO,CAAC,EAAE,oBAAoB,EAAE,CAA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S,CAAC,EAAE,MAAM,CAAC;IACnB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,wBAAgB,kBAAkB,CAAC,EACjC,SAAS,EACT,QAAQ,EACR,MAAM,EACN,KAA2B,EAC3B,WAAsE,EACtE,SAAkB,EAClB,WAAwB,EACxB,SAAS,GACV,EAAE,uBAAuB,+BA8FzB;AA4ZD,MAAM,WAAW,4BAA4B;IAC3C,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB;;;;;;OAMG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,EAAE,SAAS,OAAO,EAAE,CAAC;IAC9B,eAAe,CAAC,EAAE,MAAM,GAAG,KAAK,CAAC;IACjC,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,kBAAkB,CAAC,EAAE,CAAC,IAAI,EAAE;QAC1B,OAAO,EAAE,qBAAqB,CAAC;QAC/B,gBAAgB,EAAE,MAAM,CAAC;KAC1B,KAAK,MAAM,CAAC;IACb,gBAAgB,CAAC,EAAE,MAAM,MAAM,CAAC;CACjC;AAED,wBAAgB,qBAAqB,CAAC,EACpC,QAA2B,EAC3B,YAAY,EACZ,QAA6B,EAC7B,eAAuB,EACvB,aAAiD,EACjD,WAAmD,EACnD,kBAAkB,EAClB,gBAAgB,GACjB,GAAE,4BAAiC;;;;;;;;4BAqGtB,qBAAqB;;EAmDlC"}
@@ -5,6 +5,7 @@ import { useCallback, useEffect, useMemo, useState } from "react";
5
5
  import { sendToAgentChat } from "./agent-chat.js";
6
6
  import { agentNativePath } from "./api-path.js";
7
7
  import { setClientAppState } from "./application-state.js";
8
+ import { useChangeVersions } from "./use-change-version.js";
8
9
  import { cn } from "./utils.js";
9
10
  const OTHER_OPTION_PREFIX = "__other__:";
10
11
  const EXPLORE_OPTION = {
@@ -406,7 +407,7 @@ function normalizeBrowserTabId(browserTabId) {
406
407
  const trimmed = browserTabId.trim();
407
408
  return SAFE_BROWSER_TAB_ID_RE.test(trimmed) ? trimmed : undefined;
408
409
  }
409
- export function useGuidedQuestionFlow({ stateKey = "show-questions", browserTabId, queryKey = ["show-questions"], refetchInterval = 2_000, submitMessage = "Here are my answers — go ahead.", skipMessage = "Skip the questions — decide for me.", buildSubmitContext, buildSkipContext, } = {}) {
410
+ export function useGuidedQuestionFlow({ stateKey = "show-questions", browserTabId, queryKey = ["show-questions"], refetchInterval = false, submitMessage = "Here are my answers — go ahead.", skipMessage = "Skip the questions — decide for me.", buildSubmitContext, buildSkipContext, } = {}) {
410
411
  const queryClient = useQueryClient();
411
412
  const [payload, setPayload] = useState(null);
412
413
  const normalizedBrowserTabId = useMemo(() => normalizeBrowserTabId(browserTabId), [browserTabId]);
@@ -414,9 +415,13 @@ export function useGuidedQuestionFlow({ stateKey = "show-questions", browserTabI
414
415
  const scopedKey = normalizedBrowserTabId
415
416
  ? `${stateKey}:${normalizedBrowserTabId}`
416
417
  : stateKey;
418
+ const stateVersionSources = useMemo(() => normalizedBrowserTabId
419
+ ? [`app-state:${scopedKey}`, `app-state:${stateKey}`]
420
+ : [`app-state:${stateKey}`], [normalizedBrowserTabId, scopedKey, stateKey]);
421
+ const stateVersion = useChangeVersions(stateVersionSources);
417
422
  // Match the queryKey to the scope so two tabs polling different scoped keys
418
423
  // don't share a cache entry.
419
- const resolvedQueryKey = useMemo(() => [...queryKey, normalizedBrowserTabId ?? "global"], [queryKey, normalizedBrowserTabId]);
424
+ const resolvedQueryKey = useMemo(() => [...queryKey, normalizedBrowserTabId ?? "global", stateVersion], [queryKey, normalizedBrowserTabId, stateVersion]);
420
425
  const resolvedRefetchInterval = refetchInterval === false
421
426
  ? false
422
427
  : (query) => {