@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 @@
1
+ {"version":3,"file":"realtime-voice.js","sourceRoot":"","sources":["../../src/server/realtime-voice.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,kBAAkB,EAClB,SAAS,EACT,SAAS,EACT,WAAW,EACX,iBAAiB,EACjB,iBAAiB,GAElB,MAAM,IAAI,CAAC;AAEZ,OAAO,EACL,oBAAoB,GAErB,MAAM,8BAA8B,CAAC;AACtC,OAAO,EACL,qBAAqB,EACrB,qBAAqB,EACrB,sBAAsB,GACvB,MAAM,kCAAkC,CAAC;AAC1C,OAAO,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AACvC,OAAO,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AACzD,OAAO,EAAE,QAAQ,EAAE,MAAM,gCAAgC,CAAC;AAC1D,OAAO,EAAE,qBAAqB,EAAE,MAAM,sBAAsB,CAAC;AAE7D,MAAM,CAAC,MAAM,2BAA2B,GACtC,uCAAuC,CAAC;AAC1C,MAAM,CAAC,MAAM,wBAAwB,GAAG,oCAAoC,CAAC;AAC7E,MAAM,CAAC,MAAM,4BAA4B,GAAG,EAAE,GAAG,IAAI,CAAC;AACtD,MAAM,CAAC,MAAM,kCAAkC,GAAG,EAAE,GAAG,IAAI,CAAC;AAC5D,MAAM,CAAC,MAAM,oCAAoC,G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G,CAAC,2BAA2B,EAAE,oBAAoB,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC,CAAC;IAC3E,GAAG,CAAC,GAAG,CACL,wBAAwB,EACxB,iBAAiB,CAAC,gBAAgB,EAAE,OAAO,CAAC,CAC7C,CAAC;IACF,OAAO;QACL,WAAW,EAAE,2BAA2B;QACxC,QAAQ,EAAE,wBAAwB;KACnC,CAAC;AACJ,CAAC","sourcesContent":["import {\n defineEventHandler,\n getHeader,\n getMethod,\n readRawBody,\n setResponseHeader,\n setResponseStatus,\n type H3Event,\n} from \"h3\";\n\nimport {\n actionsToEngineTools,\n type ActionEntry,\n} from \"../agent/production-agent.js\";\nimport {\n redactSensitiveFields,\n sanitizeToolErrorText,\n sanitizeToolErrorValue,\n} from \"../agent/tool-error-redaction.js\";\nimport { getSession } from \"./auth.js\";\nimport { resolveSecret } from \"./credential-provider.js\";\nimport { getH3App } from \"./framework-request-handler.js\";\nimport { runWithRequestContext } from \"./request-context.js\";\n\nexport const REALTIME_VOICE_SESSION_PATH =\n \"/_agent-native/realtime-voice/session\";\nexport const REALTIME_VOICE_TOOL_PATH = \"/_agent-native/realtime-voice/tool\";\nexport const REALTIME_VOICE_MAX_SDP_BYTES = 64 * 1024;\nexport const REALTIME_VOICE_MAX_TOOL_BODY_BYTES = 64 * 1024;\nexport const REALTIME_VOICE_MAX_TOOL_OUTPUT_CHARS = 16_000;\n\nconst OPENAI_REALTIME_CALLS_URL = \"https://api.openai.com/v1/realtime/calls\";\nconst DEFAULT_MODEL = \"gpt-realtime-2.1\";\nconst DEFAULT_VOICE = \"marin\";\nconst DEFAULT_INSTRUCTIONS =\n \"You are the live voice interface for this Agent Native app. Speak naturally, briefly, and conversationally. Use the available function tools when the user asks you to navigate or take an action. Never claim an action succeeded until its tool result confirms success. If a tool requires approval, explain that the user must approve it in chat.\";\nconst MAX_INSTRUCTIONS_CHARS = 16_000;\nconst MAX_TOOL_DESCRIPTION_CHARS = 2_000;\nconst MAX_TOOL_SCHEMA_CHARS = 64 * 1024;\nconst MAX_APPROVAL_KEY_CHARS = 1_024;\nconst REALTIME_TOOL_NAME = /^[A-Za-z0-9_-]{1,64}$/;\nconst CALL_ID = /^[A-Za-z0-9_-]{1,256}$/;\nconst SESSION_ID = /^[A-Za-z0-9_.:-]{1,256}$/;\nconst BROWSER_TAB_ID = /^[A-Za-z0-9_-]{1,96}$/;\n\nexport interface RealtimeVoiceRequestContext {\n event: H3Event;\n userEmail: string;\n orgId?: string;\n browserTabId?: string;\n}\n\nexport interface RealtimeVoiceToolExecutionRequest extends RealtimeVoiceRequestContext {\n name: string;\n args: Record<string, unknown>;\n callId: string;\n sessionId?: string;\n}\n\nexport interface RealtimeVoiceToolExecutionResult {\n status: \"completed\" | \"failed\" | \"approval_required\";\n output: string;\n approvalKey?: string;\n}\n\nexport interface MountRealtimeVoiceRoutesOptions {\n /** Server-controlled model. Defaults to gpt-realtime-2.1. */\n model?: string;\n /** Server-controlled output voice. Defaults to marin. */\n voice?: string;\n /** Static app guidance appended to the safe default voice instructions. */\n instructions?: string;\n /** Per-request app/navigation guidance. It is sent only to OpenAI. */\n getInstructions?: (\n context: RealtimeVoiceRequestContext,\n ) => string | null | undefined | Promise<string | null | undefined>;\n /** Optional app-specific active-organization resolver. */\n resolveOrgId?: (\n event: H3Event,\n ) => string | null | undefined | Promise<string | null | undefined>;\n /**\n * Central agent tool executor supplied by the agent-chat plugin. The executor\n * owns validation, approval, journaling, timeout, mutation notification, and\n * action-result normalization; this transport must not call ActionEntry.run.\n */\n executeTool: (\n request: RealtimeVoiceToolExecutionRequest,\n ) =>\n | RealtimeVoiceToolExecutionResult\n | Promise<RealtimeVoiceToolExecutionResult>;\n}\n\ninterface RealtimeFunctionTool {\n type: \"function\";\n name: string;\n description: string;\n parameters: Record<string, unknown>;\n}\n\ninterface AuthenticatedVoiceContext extends RealtimeVoiceRequestContext {\n timezone?: string;\n}\n\nfunction readSafeHeader(event: H3Event, name: string): string | undefined {\n const value = getHeader(event, name);\n if (typeof value !== \"string\") return undefined;\n const trimmed = value.trim();\n return trimmed || undefined;\n}\n\nfunction configuredIdentifier(\n value: string | undefined,\n fallback: string,\n): string {\n const trimmed = value?.trim();\n return trimmed && /^[A-Za-z0-9_.:-]{1,128}$/.test(trimmed)\n ? trimmed\n : fallback;\n}\n\nfunction truncate(value: string, maxChars: number): string {\n if (value.length <= maxChars) return value;\n return `${value.slice(0, maxChars)}\\n\\n...[truncated]`;\n}\n\nfunction sanitizeOutput(value: unknown, maxChars: number): string {\n let serialized: string;\n try {\n const redacted = redactSensitiveFields(value);\n serialized =\n typeof redacted === \"string\"\n ? redacted\n : (JSON.stringify(redacted, (_key, entry) =>\n typeof entry === \"bigint\" ? entry.toString() : entry,\n ) ?? \"null\");\n } catch {\n serialized = \"[Unserializable tool result]\";\n }\n return truncate(sanitizeToolErrorText(serialized), maxChars);\n}\n\nasync function safeOpenAiErrorDetail(\n response: Response,\n apiKey: string,\n): Promise<string | null> {\n const raw = await response.text().catch(() => \"\");\n if (!raw) return null;\n let detail = raw;\n try {\n const parsed = JSON.parse(raw) as {\n error?: { message?: unknown; code?: unknown; type?: unknown } | unknown;\n };\n if (parsed.error && typeof parsed.error === \"object\") {\n const error = parsed.error as {\n message?: unknown;\n code?: unknown;\n type?: unknown;\n };\n detail = [error.message, error.code, error.type]\n .filter((value) => typeof value === \"string\" && value.trim())\n .join(\" · \");\n }\n } catch {\n // Plain-text upstream errors are sanitized below.\n }\n const redacted = sanitizeToolErrorText(detail).replaceAll(\n apiKey,\n \"[REDACTED]\",\n );\n return truncate(redacted, 500) || null;\n}\n\nfunction normalizeToolSchema(\n inputSchema: unknown,\n): Record<string, unknown> | null {\n try {\n const serialized = JSON.stringify(inputSchema);\n if (!serialized || serialized.length > MAX_TOOL_SCHEMA_CHARS) return null;\n const parsed = JSON.parse(serialized) as unknown;\n if (!parsed || typeof parsed !== \"object\" || Array.isArray(parsed)) {\n return null;\n }\n return parsed as Record<string, unknown>;\n } catch {\n return null;\n }\n}\n\nfunction buildRealtimeTools(\n actions: Record<string, ActionEntry>,\n): RealtimeFunctionTool[] {\n const tools: RealtimeFunctionTool[] = [];\n for (const tool of actionsToEngineTools(actions)) {\n if (!REALTIME_TOOL_NAME.test(tool.name)) continue;\n const parameters = normalizeToolSchema(tool.inputSchema);\n if (!parameters) continue;\n tools.push({\n type: \"function\",\n name: tool.name,\n description: truncate(\n sanitizeToolErrorText(tool.description || \"\"),\n MAX_TOOL_DESCRIPTION_CHARS,\n ),\n parameters,\n });\n }\n return tools;\n}\n\nfunction declaredBodyBytes(event: H3Event): number | undefined {\n const raw = readSafeHeader(event, \"content-length\");\n if (!raw) return undefined;\n const parsed = Number.parseInt(raw, 10);\n return Number.isFinite(parsed) && parsed >= 0 ? parsed : undefined;\n}\n\nasync function readLimitedRawBody(\n event: H3Event,\n maxBytes: number,\n): Promise<string | null | \"oversize\"> {\n const declared = declaredBodyBytes(event);\n if (declared !== undefined && declared > maxBytes) return \"oversize\";\n\n const raw = await readRawBody(event, \"utf8\").catch(() => undefined);\n if (raw == null) return null;\n const text =\n typeof raw === \"string\" ? raw : new TextDecoder().decode(raw as Uint8Array);\n return new TextEncoder().encode(text).byteLength > maxBytes\n ? \"oversize\"\n : text;\n}\n\nasync function authenticateVoiceRequest(\n event: H3Event,\n options: MountRealtimeVoiceRoutesOptions,\n): Promise<AuthenticatedVoiceContext | null> {\n const session = await getSession(event).catch(() => null);\n if (!session?.email) return null;\n const resolvedOrgId = options.resolveOrgId\n ? await options.resolveOrgId(event)\n : session.orgId;\n const timezone = readSafeHeader(event, \"x-user-timezone\");\n const rawBrowserTabId = readSafeHeader(event, \"x-agent-native-browser-tab\");\n const browserTabId =\n rawBrowserTabId && BROWSER_TAB_ID.test(rawBrowserTabId)\n ? rawBrowserTabId\n : undefined;\n return {\n event,\n userEmail: session.email,\n ...(resolvedOrgId ? { orgId: resolvedOrgId } : {}),\n ...(timezone && timezone.length < 64 ? { timezone } : {}),\n ...(browserTabId ? { browserTabId } : {}),\n };\n}\n\nasync function buildInstructions(\n context: RealtimeVoiceRequestContext,\n options: MountRealtimeVoiceRoutesOptions,\n): Promise<string> {\n const dynamic = await options.getInstructions?.(context);\n const appInstructions = dynamic ?? options.instructions;\n if (!appInstructions?.trim()) return DEFAULT_INSTRUCTIONS;\n return truncate(\n sanitizeToolErrorText(\n `${DEFAULT_INSTRUCTIONS}\\n\\n${appInstructions.trim()}`,\n ),\n MAX_INSTRUCTIONS_CHARS,\n );\n}\n\n/**\n * Hash the authenticated identity before sending it to OpenAI. The stable\n * digest is useful for abuse detection without disclosing the user's email.\n */\nexport async function realtimeVoiceSafetyIdentifier(\n userEmail: string,\n): Promise<string> {\n const input = new TextEncoder().encode(\n `agent-native:${userEmail.trim().toLowerCase()}`,\n );\n const digest = await globalThis.crypto.subtle.digest(\"SHA-256\", input);\n return Array.from(new Uint8Array(digest), (byte) =>\n byte.toString(16).padStart(2, \"0\"),\n ).join(\"\");\n}\n\nfunction invalidMethod(event: H3Event): { error: string } {\n setResponseStatus(event, 405);\n return { error: \"Method not allowed\" };\n}\n\nfunction createSessionHandler(\n tools: RealtimeFunctionTool[],\n options: MountRealtimeVoiceRoutesOptions,\n) {\n return defineEventHandler(async (event: H3Event) => {\n if (getMethod(event) !== \"POST\") return invalidMethod(event);\n setResponseHeader(event, \"Cache-Control\", \"no-store\");\n\n const auth = await authenticateVoiceRequest(event, options);\n if (!auth) {\n setResponseStatus(event, 401);\n return { error: \"Authentication required\" };\n }\n\n const contentType = readSafeHeader(event, \"content-type\")?.toLowerCase();\n if (!contentType?.includes(\"application/sdp\")) {\n setResponseStatus(event, 415);\n return { error: \"Expected Content-Type: application/sdp\" };\n }\n\n const rawSdp = await readLimitedRawBody(\n event,\n REALTIME_VOICE_MAX_SDP_BYTES,\n );\n if (rawSdp === \"oversize\") {\n setResponseStatus(event, 413);\n return {\n error: `SDP offer is too large (max ${REALTIME_VOICE_MAX_SDP_BYTES} bytes)`,\n };\n }\n const sdp = rawSdp ?? \"\";\n if (!sdp.trim()) {\n setResponseStatus(event, 400);\n return { error: \"SDP offer is required\" };\n }\n\n return runWithRequestContext(\n {\n userEmail: auth.userEmail,\n orgId: auth.orgId,\n timezone: auth.timezone,\n run: auth.browserTabId\n ? { browserTabId: auth.browserTabId }\n : undefined,\n },\n async () => {\n const apiKey = (await resolveSecret(\"OPENAI_API_KEY\"))?.trim();\n if (!apiKey) {\n setResponseStatus(event, 400);\n return {\n error:\n \"Configure OPENAI_API_KEY in Settings to use realtime voice.\",\n };\n }\n\n const instructions = await buildInstructions(auth, options);\n const session = {\n type: \"realtime\",\n model: configuredIdentifier(options.model, DEFAULT_MODEL),\n instructions,\n output_modalities: [\"audio\"],\n audio: {\n input: {\n transcription: { model: \"gpt-4o-mini-transcribe\" },\n turn_detection: {\n type: \"semantic_vad\",\n create_response: true,\n interrupt_response: true,\n eagerness: \"auto\",\n },\n },\n output: {\n voice: configuredIdentifier(options.voice, DEFAULT_VOICE),\n },\n },\n tools,\n tool_choice: \"auto\",\n };\n\n const form = new FormData();\n form.set(\"sdp\", sdp);\n form.set(\"session\", JSON.stringify(session));\n\n let upstream: Response;\n try {\n upstream = await fetch(OPENAI_REALTIME_CALLS_URL, {\n method: \"POST\",\n headers: {\n Authorization: `Bearer ${apiKey}`,\n \"OpenAI-Safety-Identifier\": await realtimeVoiceSafetyIdentifier(\n auth.userEmail,\n ),\n },\n body: form,\n });\n } catch {\n setResponseStatus(event, 502);\n return { error: \"Could not reach the OpenAI Realtime API\" };\n }\n\n if (!upstream.ok) {\n const detail = await safeOpenAiErrorDetail(upstream, apiKey);\n setResponseStatus(event, 502);\n return {\n error: `OpenAI rejected the realtime session (${upstream.status})${detail ? `: ${detail}` : \"\"}`,\n };\n }\n\n const answerSdp = await upstream.text().catch(() => \"\");\n if (!answerSdp.trim()) {\n setResponseStatus(event, 502);\n return { error: \"OpenAI returned an empty realtime session answer\" };\n }\n\n setResponseStatus(event, upstream.status);\n setResponseHeader(event, \"Content-Type\", \"application/sdp\");\n return answerSdp;\n },\n );\n });\n}\n\nfunction isRecord(value: unknown): value is Record<string, unknown> {\n return Boolean(value) && typeof value === \"object\" && !Array.isArray(value);\n}\n\nfunction parseToolRequest(value: unknown): {\n name: string;\n args: Record<string, unknown>;\n callId: string;\n sessionId?: string;\n browserTabId?: string;\n} | null {\n if (!isRecord(value)) return null;\n const { name, args, callId, sessionId, browserTabId } = value;\n if (typeof name !== \"string\" || !REALTIME_TOOL_NAME.test(name)) return null;\n if (typeof callId !== \"string\" || !CALL_ID.test(callId)) return null;\n if (!isRecord(args)) return null;\n if (\n sessionId !== undefined &&\n (typeof sessionId !== \"string\" || !SESSION_ID.test(sessionId))\n ) {\n return null;\n }\n if (\n browserTabId !== undefined &&\n (typeof browserTabId !== \"string\" || !BROWSER_TAB_ID.test(browserTabId))\n ) {\n return null;\n }\n return {\n name,\n args,\n callId,\n ...(sessionId ? { sessionId } : {}),\n ...(browserTabId ? { browserTabId } : {}),\n };\n}\n\nfunction normalizeExecutionResult(\n result: RealtimeVoiceToolExecutionResult,\n): RealtimeVoiceToolExecutionResult {\n const status = result?.status;\n if (\n status !== \"completed\" &&\n status !== \"failed\" &&\n status !== \"approval_required\"\n ) {\n throw new Error(\"Invalid realtime tool execution status\");\n }\n const output = sanitizeOutput(\n result.output,\n REALTIME_VOICE_MAX_TOOL_OUTPUT_CHARS,\n );\n return {\n status,\n output,\n ...(status === \"approval_required\" &&\n typeof result.approvalKey === \"string\" &&\n result.approvalKey.length > 0 &&\n result.approvalKey.length <= MAX_APPROVAL_KEY_CHARS\n ? { approvalKey: result.approvalKey }\n : {}),\n };\n}\n\nfunction createToolHandler(\n allowedToolNames: ReadonlySet<string>,\n options: MountRealtimeVoiceRoutesOptions,\n) {\n return defineEventHandler(async (event: H3Event) => {\n if (getMethod(event) !== \"POST\") return invalidMethod(event);\n setResponseHeader(event, \"Cache-Control\", \"no-store\");\n\n const auth = await authenticateVoiceRequest(event, options);\n if (!auth) {\n setResponseStatus(event, 401);\n return { error: \"Authentication required\" };\n }\n\n const contentType = readSafeHeader(event, \"content-type\")?.toLowerCase();\n if (!contentType?.includes(\"application/json\")) {\n setResponseStatus(event, 415);\n return { error: \"Expected Content-Type: application/json\" };\n }\n\n const raw = await readLimitedRawBody(\n event,\n REALTIME_VOICE_MAX_TOOL_BODY_BYTES,\n );\n if (raw === \"oversize\") {\n setResponseStatus(event, 413);\n return {\n error: `Tool request is too large (max ${REALTIME_VOICE_MAX_TOOL_BODY_BYTES} bytes)`,\n };\n }\n\n let parsedBody: unknown;\n try {\n parsedBody = JSON.parse(raw ?? \"\");\n } catch {\n setResponseStatus(event, 400);\n return { error: \"Invalid realtime tool request\" };\n }\n const request = parseToolRequest(parsedBody);\n if (!request) {\n setResponseStatus(event, 400);\n return { error: \"Invalid realtime tool request\" };\n }\n if (!allowedToolNames.has(request.name)) {\n setResponseStatus(event, 404);\n return { error: \"Unknown realtime voice tool\" };\n }\n\n const browserTabId = request.browserTabId ?? auth.browserTabId;\n const threadId = request.sessionId\n ? `realtime:${request.sessionId}`\n : `realtime:${request.callId}`;\n return runWithRequestContext(\n {\n userEmail: auth.userEmail,\n orgId: auth.orgId,\n timezone: auth.timezone,\n run: {\n threadId,\n ...(browserTabId ? { browserTabId } : {}),\n },\n },\n async () => {\n try {\n const result = normalizeExecutionResult(\n await options.executeTool({\n event,\n userEmail: auth.userEmail,\n orgId: auth.orgId,\n ...request,\n }),\n );\n return { callId: request.callId, ...result };\n } catch (error) {\n setResponseStatus(event, 500);\n return {\n callId: request.callId,\n status: \"failed\" as const,\n output: truncate(\n sanitizeToolErrorValue(error) || \"Tool execution failed\",\n REALTIME_VOICE_MAX_TOOL_OUTPUT_CHARS,\n ),\n };\n }\n },\n );\n });\n}\n\n/** Mount the authenticated OpenAI Realtime WebRTC and tool bridge routes. */\nexport function mountRealtimeVoiceRoutes(\n nitroApp: any,\n actions: Record<string, ActionEntry>,\n options: MountRealtimeVoiceRoutesOptions,\n): { sessionPath: string; toolPath: string } {\n if (typeof options?.executeTool !== \"function\") {\n throw new Error(\"mountRealtimeVoiceRoutes requires executeTool\");\n }\n\n const tools = buildRealtimeTools(actions);\n const allowedToolNames = new Set(tools.map((tool) => tool.name));\n const app = getH3App(nitroApp);\n app.use(REALTIME_VOICE_SESSION_PATH, createSessionHandler(tools, options));\n app.use(\n REALTIME_VOICE_TOOL_PATH,\n createToolHandler(allowedToolNames, options),\n );\n return {\n sessionPath: REALTIME_VOICE_SESSION_PATH,\n toolPath: REALTIME_VOICE_TOOL_PATH,\n };\n}\n"]}
@@ -20,7 +20,7 @@ export declare function createTranscribeVoiceHandler(): import("h3").EventHandle
20
20
  error: string;
21
21
  text?: undefined;
22
22
  } | {
23
- text: string;
24
23
  error?: undefined;
24
+ text: string;
25
25
  }>>;
26
26
  //# sourceMappingURL=transcribe-voice.d.ts.map
@@ -1,9 +1,29 @@
1
1
  export declare const REASONING_EFFORTS: readonly ["auto", "none", "minimal", "low", "medium", "high", "xhigh", "max"];
2
2
  export type ReasoningEffort = (typeof REASONING_EFFORTS)[number];
3
+ /**
4
+ * Shared chat always chooses an explicit reasoning tier. Keep `auto` in the
5
+ * accepted type only so older persisted selections and external callers can
6
+ * migrate cleanly; new UI and engine defaults resolve it to Medium.
7
+ */
8
+ export declare const DEFAULT_REASONING_EFFORT: ReasoningEffort;
3
9
  export declare const REASONING_EFFORT_LABELS: Record<ReasoningEffort, string>;
4
10
  export declare function isReasoningEffort(value: unknown): value is ReasoningEffort;
5
11
  export declare function getReasoningEffortOptionsForModel(model: string | undefined): ReasoningEffort[];
6
12
  export declare function normalizeReasoningEffortForModel(model: string | undefined, effort: ReasoningEffort | undefined): ReasoningEffort | undefined;
13
+ /**
14
+ * Normalize a chat request before it reaches an engine. Explicit off/minimal
15
+ * sentinels must survive this layer so the engine can distinguish them from a
16
+ * missing selection, which now means the Medium default.
17
+ */
18
+ export declare function normalizeReasoningEffortForRequest(model: string | undefined, effort: ReasoningEffort | undefined): ReasoningEffort | undefined;
7
19
  export declare function reasoningEffortLabel(effort: ReasoningEffort | undefined): string;
20
+ /**
21
+ * Resolve a user-facing selection for a model. Legacy `auto`, missing values,
22
+ * and tiers unsupported by the newly selected model all become Medium.
23
+ * Non-reasoning models still retain Medium in persisted chat state so moving
24
+ * back to a reasoning model has a predictable default; their engines omit the
25
+ * effort through `normalizeReasoningEffortForModel`.
26
+ */
27
+ export declare function resolveReasoningEffortSelection(model: string | undefined, effort: ReasoningEffort | undefined): ReasoningEffort;
8
28
  export declare function stepDownReasoningEffort(effort: ReasoningEffort | undefined): ReasoningEffort | undefined;
9
29
  //# sourceMappingURL=reasoning-effort.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"reasoning-effort.d.ts","sourceRoot":"","sources":["../../src/shared/reasoning-effort.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,iBAAiB,YAC5B,MAAM,EACN,MAAM,EACN,SAAS,EACT,KAAK,EACL,QAAQ,EACR,MAAM,EACN,OAAO,EACP,KAAK,CACG,CAAC;AAEX,MAAM,MAAM,eAAe,GAAG,CAAC,OAAO,iBAAiB,CAAC,CAAC,MAAM,CAAC,CAAC;AAEjE,eAAO,MAAM,uBAAuB,EAAE,MAAM,CAAC,eAAe,EAAE,MAAM,CASnE,CAAC;AA2BF,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,eAAe,CAE1E;AAED,wBAAgB,iCAAiC,CAC/C,KAAK,EAAE,MAAM,GAAG,SAAS,GACxB,eAAe,EAAE,CAcnB;AAED,wBAAgB,gCAAgC,CAC9C,KAAK,EAAE,MAAM,GAAG,SAAS,EACzB,MAAM,EAAE,eAAe,GAAG,SAAS,GAClC,eAAe,GAAG,SAAS,CAoB7B;AAED,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,eAAe,GAAG,SAAS,UAEvE;AAkBD,wBAAgB,uBAAuB,CACrC,MAAM,EAAE,eAAe,GAAG,SAAS,GAClC,eAAe,GAAG,SAAS,CAG7B"}
1
+ {"version":3,"file":"reasoning-effort.d.ts","sourceRoot":"","sources":["../../src/shared/reasoning-effort.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,iBAAiB,YAC5B,MAAM,EACN,MAAM,EACN,SAAS,EACT,KAAK,EACL,QAAQ,EACR,MAAM,EACN,OAAO,EACP,KAAK,CACG,CAAC;AAEX,MAAM,MAAM,eAAe,GAAG,CAAC,OAAO,iBAAiB,CAAC,CAAC,MAAM,CAAC,CAAC;AAEjE;;;;GAIG;AACH,eAAO,MAAM,wBAAwB,EAAE,eAA0B,CAAC;AAElE,eAAO,MAAM,uBAAuB,EAAE,MAAM,CAAC,eAAe,EAAE,MAAM,CASnE,CAAC;AAsBF,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,eAAe,CAE1E;AAED,wBAAgB,iCAAiC,CAC/C,KAAK,EAAE,MAAM,GAAG,SAAS,GACxB,eAAe,EAAE,CAcnB;AAED,wBAAgB,gCAAgC,CAC9C,KAAK,EAAE,MAAM,GAAG,SAAS,EACzB,MAAM,EAAE,eAAe,GAAG,SAAS,GAClC,eAAe,GAAG,SAAS,CAmB7B;AAED;;;;GAIG;AACH,wBAAgB,kCAAkC,CAChD,KAAK,EAAE,MAAM,GAAG,SAAS,EACzB,MAAM,EAAE,eAAe,GAAG,SAAS,GAClC,eAAe,GAAG,SAAS,CAG7B;AAED,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,eAAe,GAAG,SAAS,UAIvE;AAED;;;;;;GAMG;AACH,wBAAgB,+BAA+B,CAC7C,KAAK,EAAE,MAAM,GAAG,SAAS,EACzB,MAAM,EAAE,eAAe,GAAG,SAAS,GAClC,eAAe,CAOjB;AAkBD,wBAAgB,uBAAuB,CACrC,MAAM,EAAE,eAAe,GAAG,SAAS,GAClC,eAAe,GAAG,SAAS,CAG7B"}
@@ -8,6 +8,12 @@ export const REASONING_EFFORTS = [
8
8
  "xhigh",
9
9
  "max",
10
10
  ];
11
+ /**
12
+ * Shared chat always chooses an explicit reasoning tier. Keep `auto` in the
13
+ * accepted type only so older persisted selections and external callers can
14
+ * migrate cleanly; new UI and engine defaults resolve it to Medium.
15
+ */
16
+ export const DEFAULT_REASONING_EFFORT = "medium";
11
17
  export const REASONING_EFFORT_LABELS = {
12
18
  auto: "Auto",
13
19
  none: "None",
@@ -18,12 +24,7 @@ export const REASONING_EFFORT_LABELS = {
18
24
  xhigh: "Extra High",
19
25
  max: "Max",
20
26
  };
21
- const VISIBLE_STANDARD_EFFORTS = [
22
- "auto",
23
- "low",
24
- "medium",
25
- "high",
26
- ];
27
+ const VISIBLE_STANDARD_EFFORTS = ["low", "medium", "high"];
27
28
  const VISIBLE_GPT_EFFORTS = [
28
29
  ...VISIBLE_STANDARD_EFFORTS,
29
30
  "xhigh",
@@ -58,10 +59,9 @@ export function getReasoningEffortOptionsForModel(model) {
58
59
  return [];
59
60
  }
60
61
  export function normalizeReasoningEffortForModel(model, effort) {
61
- if (!model || !effort || effort === "auto") {
62
+ if (!model)
62
63
  return undefined;
63
- }
64
- let normalized = effort;
64
+ let normalized = !effort || effort === "auto" ? DEFAULT_REASONING_EFFORT : effort;
65
65
  if (normalized === "xhigh" &&
66
66
  isClaudeReasoningModel(model) &&
67
67
  !supportsClaudeXHigh(model)) {
@@ -76,12 +76,36 @@ export function normalizeReasoningEffortForModel(model, effort) {
76
76
  }
77
77
  return normalized;
78
78
  }
79
+ /**
80
+ * Normalize a chat request before it reaches an engine. Explicit off/minimal
81
+ * sentinels must survive this layer so the engine can distinguish them from a
82
+ * missing selection, which now means the Medium default.
83
+ */
84
+ export function normalizeReasoningEffortForRequest(model, effort) {
85
+ if (effort === "none" || effort === "minimal")
86
+ return effort;
87
+ return normalizeReasoningEffortForModel(model, effort);
88
+ }
79
89
  export function reasoningEffortLabel(effort) {
80
- return REASONING_EFFORT_LABELS[effort ?? "auto"];
90
+ return REASONING_EFFORT_LABELS[!effort || effort === "auto" ? DEFAULT_REASONING_EFFORT : effort];
91
+ }
92
+ /**
93
+ * Resolve a user-facing selection for a model. Legacy `auto`, missing values,
94
+ * and tiers unsupported by the newly selected model all become Medium.
95
+ * Non-reasoning models still retain Medium in persisted chat state so moving
96
+ * back to a reasoning model has a predictable default; their engines omit the
97
+ * effort through `normalizeReasoningEffortForModel`.
98
+ */
99
+ export function resolveReasoningEffortSelection(model, effort) {
100
+ const requested = !effort || effort === "auto" ? DEFAULT_REASONING_EFFORT : effort;
101
+ const options = getReasoningEffortOptionsForModel(model);
102
+ return options.length === 0 || options.includes(requested)
103
+ ? requested
104
+ : DEFAULT_REASONING_EFFORT;
81
105
  }
82
106
  /**
83
- * One tier down from each effort, stopping at "minimal" — "none"/"auto"
84
- * (not really "tiers") and "minimal" itself are left unchanged. Used by the
107
+ * One tier down from each effort, stopping at "minimal" — legacy `auto`,
108
+ * "none", and "minimal" itself are left unchanged. Used by the
85
109
  * empty-final-response retry so a retried turn asks for meaningfully less
86
110
  * reasoning instead of repeating the exact request that came back empty.
87
111
  */
@@ -98,30 +122,40 @@ export function stepDownReasoningEffort(effort) {
98
122
  return REASONING_EFFORT_STEP_DOWN[effort] ?? effort;
99
123
  }
100
124
  function isGPTReasoningModel(model) {
101
- return /^gpt-5/.test(model) || /^o\d/.test(model);
125
+ const id = model.toLowerCase().replace(/^openai\//, "");
126
+ return /^gpt-5/.test(id) || /^o\d/.test(id);
102
127
  }
103
128
  function isClaudeReasoningModel(model) {
104
- return /^claude-/.test(model);
129
+ const id = model.toLowerCase().replace(/^anthropic\//, "");
130
+ if (id.includes("fable-5") || id.includes("mythos-5"))
131
+ return true;
132
+ if (id.includes("sonnet-5") || id.includes("sonnet-4-6"))
133
+ return true;
134
+ if (id.includes("haiku-4-5"))
135
+ return true;
136
+ const opusMatch = id.match(/opus-4[-.](\d+)/);
137
+ return opusMatch ? parseInt(opusMatch[1], 10) >= 6 : false;
105
138
  }
106
139
  function supportsClaudeXHigh(model) {
140
+ const id = model.toLowerCase().replace(/^anthropic\//, "");
107
141
  // Models that support the xhigh effort tier (built-in extended thinking via
108
142
  // output_config.effort). Keep this version-aware so any future Claude model
109
143
  // with a higher patch/minor number is automatically included rather than
110
144
  // silently falling back to the lower "high" tier.
111
145
  // claude-fable-5 is a Mythos-class model and also supports xhigh.
112
- if (model.includes("fable-5"))
146
+ if (id.includes("fable-5"))
113
147
  return true;
114
148
  // Sonnet 5 supports the expanded effort ladder through Builder/Anthropic.
115
- if (model.includes("sonnet-5"))
149
+ if (id.includes("sonnet-5"))
116
150
  return true;
117
151
  // opus-4-7 introduced xhigh; all opus-4.x successors (4-8, 4-9…) should too.
118
- const opusMatch = model.match(/opus-4-(\d+)/);
152
+ const opusMatch = id.match(/opus-4[-.](\d+)/);
119
153
  if (opusMatch) {
120
154
  return parseInt(opusMatch[1], 10) >= 7;
121
155
  }
122
156
  return false;
123
157
  }
124
158
  function isGeminiReasoningModel(model) {
125
- return /^gemini-/.test(model);
159
+ return /^gemini-/.test(model.toLowerCase().replace(/^google\//, ""));
126
160
  }
127
161
  //# sourceMappingURL=reasoning-effort.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"reasoning-effort.js","sourceRoot":"","sources":["../../src/shared/reasoning-effort.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,iBAAiB,GAAG;IAC/B,MAAM;IACN,MAAM;IACN,SAAS;IACT,KAAK;IACL,QAAQ;IACR,MAAM;IACN,OAAO;IACP,KAAK;CACG,CAAC;AAIX,MAAM,CAAC,MAAM,uBAAuB,GAAoC;IACtE,IAAI,EAAE,MAAM;IACZ,IAAI,EAAE,MAAM;IACZ,OAAO,EAAE,SAAS;IAClB,GAAG,EAAE,KAAK;IACV,MAAM,EAAE,QAAQ;IAChB,IAAI,EAAE,MAAM;IACZ,KAAK,EAAE,YAAY;IACnB,GAAG,EAAE,KAAK;CACX,CAAC;AAEF,MAAM,wBAAwB,GAAsB;IAClD,MAAM;IACN,KAAK;IACL,QAAQ;IACR,MAAM;CACP,CAAC;AAEF,MAAM,mBAAmB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AAC,QAAQ,CAAC,UAAU,CAAC;QAAE,OAAO,IAAI,CAAC;IAC5C,6EAA6E;IAC7E,MAAM,SAAS,GAAG,KAAK,CAAC,KAAK,CAAC,cAAc,CAAC,CAAC;IAC9C,IAAI,SAAS,EAAE,CAAC;QACd,OAAO,QAAQ,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,IAAI,CAAC,CAAC;IACzC,CAAC;IACD,OAAO,KAAK,CAAC;AACf,CAAC;AAED,SAAS,sBAAsB,CAAC,KAAa;IAC3C,OAAO,UAAU,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;AAChC,CAAC","sourcesContent":["export const REASONING_EFFORTS = [\n \"auto\",\n \"none\",\n \"minimal\",\n \"low\",\n \"medium\",\n \"high\",\n \"xhigh\",\n \"max\",\n] as const;\n\nexport type ReasoningEffort = (typeof REASONING_EFFORTS)[number];\n\nexport const REASONING_EFFORT_LABELS: Record<ReasoningEffort, string> = {\n auto: \"Auto\",\n none: \"None\",\n minimal: \"Minimal\",\n low: \"Low\",\n medium: \"Medium\",\n high: \"High\",\n xhigh: \"Extra High\",\n max: \"Max\",\n};\n\nconst VISIBLE_STANDARD_EFFORTS: ReasoningEffort[] = [\n \"auto\",\n \"low\",\n \"medium\",\n \"high\",\n];\n\nconst VISIBLE_GPT_EFFORTS: ReasoningEffort[] = [\n ...VISIBLE_STANDARD_EFFORTS,\n \"xhigh\",\n];\n\nconst VISIBLE_CLAUDE_BUILT_IN_EFFORTS: ReasoningEffort[] = [\n ...VISIBLE_STANDARD_EFFORTS,\n \"xhigh\",\n \"max\",\n];\n\nconst VISIBLE_CLAUDE_EFFORTS: ReasoningEffort[] = [\n ...VISIBLE_STANDARD_EFFORTS,\n \"max\",\n];\n\nconst effortSet = new Set<string>(REASONING_EFFORTS);\n\nexport function isReasoningEffort(value: unknown): value is ReasoningEffort {\n return typeof value === \"string\" && effortSet.has(value);\n}\n\nexport function getReasoningEffortOptionsForModel(\n model: string | undefined,\n): ReasoningEffort[] {\n if (!model) return [];\n if (isGPTReasoningModel(model)) {\n return VISIBLE_GPT_EFFORTS;\n }\n if (isClaudeReasoningModel(model)) {\n return supportsClaudeXHigh(model)\n ? VISIBLE_CLAUDE_BUILT_IN_EFFORTS\n : VISIBLE_CLAUDE_EFFORTS;\n }\n if (isGeminiReasoningModel(model)) {\n return VISIBLE_STANDARD_EFFORTS;\n }\n return [];\n}\n\nexport function normalizeReasoningEffortForModel(\n model: string | undefined,\n effort: ReasoningEffort | undefined,\n): ReasoningEffort | undefined {\n if (!model || !effort || effort === \"auto\") {\n return undefined;\n }\n let normalized = effort;\n if (\n normalized === \"xhigh\" &&\n isClaudeReasoningModel(model) &&\n !supportsClaudeXHigh(model)\n ) {\n normalized = \"high\";\n }\n if (normalized === \"max\" && isGPTReasoningModel(model)) {\n normalized = \"xhigh\";\n }\n const options = getReasoningEffortOptionsForModel(model);\n if (!options.length || !options.includes(normalized)) {\n return undefined;\n }\n return normalized;\n}\n\nexport function reasoningEffortLabel(effort: ReasoningEffort | undefined) {\n return REASONING_EFFORT_LABELS[effort ?? \"auto\"];\n}\n\n/**\n * One tier down from each effort, stopping at \"minimal\" — \"none\"/\"auto\"\n * (not really \"tiers\") and \"minimal\" itself are left unchanged. Used by the\n * empty-final-response retry so a retried turn asks for meaningfully less\n * reasoning instead of repeating the exact request that came back empty.\n */\nconst REASONING_EFFORT_STEP_DOWN: Partial<\n Record<ReasoningEffort, ReasoningEffort>\n> = {\n max: \"xhigh\",\n xhigh: \"high\",\n high: \"medium\",\n medium: \"low\",\n low: \"minimal\",\n};\n\nexport function stepDownReasoningEffort(\n effort: ReasoningEffort | undefined,\n): ReasoningEffort | undefined {\n if (!effort) return effort;\n return REASONING_EFFORT_STEP_DOWN[effort] ?? effort;\n}\n\nfunction isGPTReasoningModel(model: string) {\n return /^gpt-5/.test(model) || /^o\\d/.test(model);\n}\n\nfunction isClaudeReasoningModel(model: string) {\n return /^claude-/.test(model);\n}\n\nfunction supportsClaudeXHigh(model: string) {\n // Models that support the xhigh effort tier (built-in extended thinking via\n // output_config.effort). Keep this version-aware so any future Claude model\n // with a higher patch/minor number is automatically included rather than\n // silently falling back to the lower \"high\" tier.\n // claude-fable-5 is a Mythos-class model and also supports xhigh.\n if (model.includes(\"fable-5\")) return true;\n // Sonnet 5 supports the expanded effort ladder through Builder/Anthropic.\n if (model.includes(\"sonnet-5\")) return true;\n // opus-4-7 introduced xhigh; all opus-4.x successors (4-8, 4-9…) should too.\n const opusMatch = model.match(/opus-4-(\\d+)/);\n if (opusMatch) {\n return parseInt(opusMatch[1], 10) >= 7;\n }\n return false;\n}\n\nfunction isGeminiReasoningModel(model: string) {\n return /^gemini-/.test(model);\n}\n"]}
1
+ {"version":3,"file":"reasoning-effort.js","sourceRoot":"","sources":["../../src/shared/reasoning-effort.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,iBAAiB,GAAG;IAC/B,MAAM;IACN,MAAM;IACN,SAAS;IACT,KAAK;IACL,QAAQ;IACR,MAAM;IACN,OAAO;IACP,KAAK;CACG,CAAC;AAIX;;;;GAIG;AACH,MAAM,CAAC,MAAM,wBAAwB,GAAoB,QAAQ,CAAC;AAElE,MAAM,CAAC,MAAM,uBAAuB,GAAoC;IACtE,IAAI,EAAE,MAAM;IACZ,IAAI,EAAE,MAAM;IACZ,OAAO,EAAE,SAAS;IAClB,GAAG,EAAE,KAAK;IACV,MAAM,EAAE,QAAQ;IAChB,IAAI,EAAE,MAAM;IACZ,KAAK,EAAE,YAAY;IACnB,GAAG,EAAE,KAAK;CACX,CAAC;AAEF,MAAM,wBAAwB,GAAsB,CAAC,KAAK,EAAE,QAAQ,EAAE,MAAM,CAAC,CAAC;AAE9E,MAAM,mBAAmB,GAAsB;IAC7C,GAAG,wBAAwB;IAC3B,OAAO;CACR,CAAC;AAEF,MAAM,+BAA+B,GAAsB;IACzD,GAAG,wBAAwB;IAC3B,OAAO;IACP,KAAK;CACN,CAAC;AAEF,MAAM,sBAAsB,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AAE,OAAO,IAAI,CAAC;IACxC,0EAA0E;IAC1E,IAAI,EAAE,CAAC,QAAQ,CAAC,UAAU,CAAC;QAAE,OAAO,IAAI,CAAC;IACzC,6EAA6E;IAC7E,MAAM,SAAS,GAAG,EAAE,CAAC,KAAK,CAAC,iBAAiB,CAAC,CAAC;IAC9C,IAAI,SAAS,EAAE,CAAC;QACd,OAAO,QAAQ,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,IAAI,CAAC,CAAC;IACzC,CAAC;IACD,OAAO,KAAK,CAAC;AACf,CAAC;AAED,SAAS,sBAAsB,CAAC,KAAa;IAC3C,OAAO,UAAU,CAAC,IAAI,CAAC,KAAK,CAAC,WAAW,EAAE,CAAC,OAAO,CAAC,WAAW,EAAE,EAAE,CAAC,CAAC,CAAC;AACvE,CAAC","sourcesContent":["export const REASONING_EFFORTS = [\n \"auto\",\n \"none\",\n \"minimal\",\n \"low\",\n \"medium\",\n \"high\",\n \"xhigh\",\n \"max\",\n] as const;\n\nexport type ReasoningEffort = (typeof REASONING_EFFORTS)[number];\n\n/**\n * Shared chat always chooses an explicit reasoning tier. Keep `auto` in the\n * accepted type only so older persisted selections and external callers can\n * migrate cleanly; new UI and engine defaults resolve it to Medium.\n */\nexport const DEFAULT_REASONING_EFFORT: ReasoningEffort = \"medium\";\n\nexport const REASONING_EFFORT_LABELS: Record<ReasoningEffort, string> = {\n auto: \"Auto\",\n none: \"None\",\n minimal: \"Minimal\",\n low: \"Low\",\n medium: \"Medium\",\n high: \"High\",\n xhigh: \"Extra High\",\n max: \"Max\",\n};\n\nconst VISIBLE_STANDARD_EFFORTS: ReasoningEffort[] = [\"low\", \"medium\", \"high\"];\n\nconst VISIBLE_GPT_EFFORTS: ReasoningEffort[] = [\n ...VISIBLE_STANDARD_EFFORTS,\n \"xhigh\",\n];\n\nconst VISIBLE_CLAUDE_BUILT_IN_EFFORTS: ReasoningEffort[] = [\n ...VISIBLE_STANDARD_EFFORTS,\n \"xhigh\",\n \"max\",\n];\n\nconst VISIBLE_CLAUDE_EFFORTS: ReasoningEffort[] = [\n ...VISIBLE_STANDARD_EFFORTS,\n \"max\",\n];\n\nconst effortSet = new Set<string>(REASONING_EFFORTS);\n\nexport function isReasoningEffort(value: unknown): value is ReasoningEffort {\n return typeof value === \"string\" && effortSet.has(value);\n}\n\nexport function getReasoningEffortOptionsForModel(\n model: string | undefined,\n): ReasoningEffort[] {\n if (!model) return [];\n if (isGPTReasoningModel(model)) {\n return VISIBLE_GPT_EFFORTS;\n }\n if (isClaudeReasoningModel(model)) {\n return supportsClaudeXHigh(model)\n ? VISIBLE_CLAUDE_BUILT_IN_EFFORTS\n : VISIBLE_CLAUDE_EFFORTS;\n }\n if (isGeminiReasoningModel(model)) {\n return VISIBLE_STANDARD_EFFORTS;\n }\n return [];\n}\n\nexport function normalizeReasoningEffortForModel(\n model: string | undefined,\n effort: ReasoningEffort | undefined,\n): ReasoningEffort | undefined {\n if (!model) return undefined;\n let normalized =\n !effort || effort === \"auto\" ? DEFAULT_REASONING_EFFORT : effort;\n if (\n normalized === \"xhigh\" &&\n isClaudeReasoningModel(model) &&\n !supportsClaudeXHigh(model)\n ) {\n normalized = \"high\";\n }\n if (normalized === \"max\" && isGPTReasoningModel(model)) {\n normalized = \"xhigh\";\n }\n const options = getReasoningEffortOptionsForModel(model);\n if (!options.length || !options.includes(normalized)) {\n return undefined;\n }\n return normalized;\n}\n\n/**\n * Normalize a chat request before it reaches an engine. Explicit off/minimal\n * sentinels must survive this layer so the engine can distinguish them from a\n * missing selection, which now means the Medium default.\n */\nexport function normalizeReasoningEffortForRequest(\n model: string | undefined,\n effort: ReasoningEffort | undefined,\n): ReasoningEffort | undefined {\n if (effort === \"none\" || effort === \"minimal\") return effort;\n return normalizeReasoningEffortForModel(model, effort);\n}\n\nexport function reasoningEffortLabel(effort: ReasoningEffort | undefined) {\n return REASONING_EFFORT_LABELS[\n !effort || effort === \"auto\" ? DEFAULT_REASONING_EFFORT : effort\n ];\n}\n\n/**\n * Resolve a user-facing selection for a model. Legacy `auto`, missing values,\n * and tiers unsupported by the newly selected model all become Medium.\n * Non-reasoning models still retain Medium in persisted chat state so moving\n * back to a reasoning model has a predictable default; their engines omit the\n * effort through `normalizeReasoningEffortForModel`.\n */\nexport function resolveReasoningEffortSelection(\n model: string | undefined,\n effort: ReasoningEffort | undefined,\n): ReasoningEffort {\n const requested =\n !effort || effort === \"auto\" ? DEFAULT_REASONING_EFFORT : effort;\n const options = getReasoningEffortOptionsForModel(model);\n return options.length === 0 || options.includes(requested)\n ? requested\n : DEFAULT_REASONING_EFFORT;\n}\n\n/**\n * One tier down from each effort, stopping at \"minimal\" — legacy `auto`,\n * \"none\", and \"minimal\" itself are left unchanged. Used by the\n * empty-final-response retry so a retried turn asks for meaningfully less\n * reasoning instead of repeating the exact request that came back empty.\n */\nconst REASONING_EFFORT_STEP_DOWN: Partial<\n Record<ReasoningEffort, ReasoningEffort>\n> = {\n max: \"xhigh\",\n xhigh: \"high\",\n high: \"medium\",\n medium: \"low\",\n low: \"minimal\",\n};\n\nexport function stepDownReasoningEffort(\n effort: ReasoningEffort | undefined,\n): ReasoningEffort | undefined {\n if (!effort) return effort;\n return REASONING_EFFORT_STEP_DOWN[effort] ?? effort;\n}\n\nfunction isGPTReasoningModel(model: string) {\n const id = model.toLowerCase().replace(/^openai\\//, \"\");\n return /^gpt-5/.test(id) || /^o\\d/.test(id);\n}\n\nfunction isClaudeReasoningModel(model: string) {\n const id = model.toLowerCase().replace(/^anthropic\\//, \"\");\n if (id.includes(\"fable-5\") || id.includes(\"mythos-5\")) return true;\n if (id.includes(\"sonnet-5\") || id.includes(\"sonnet-4-6\")) return true;\n if (id.includes(\"haiku-4-5\")) return true;\n const opusMatch = id.match(/opus-4[-.](\\d+)/);\n return opusMatch ? parseInt(opusMatch[1], 10) >= 6 : false;\n}\n\nfunction supportsClaudeXHigh(model: string) {\n const id = model.toLowerCase().replace(/^anthropic\\//, \"\");\n // Models that support the xhigh effort tier (built-in extended thinking via\n // output_config.effort). Keep this version-aware so any future Claude model\n // with a higher patch/minor number is automatically included rather than\n // silently falling back to the lower \"high\" tier.\n // claude-fable-5 is a Mythos-class model and also supports xhigh.\n if (id.includes(\"fable-5\")) return true;\n // Sonnet 5 supports the expanded effort ladder through Builder/Anthropic.\n if (id.includes(\"sonnet-5\")) return true;\n // opus-4-7 introduced xhigh; all opus-4.x successors (4-8, 4-9…) should too.\n const opusMatch = id.match(/opus-4[-.](\\d+)/);\n if (opusMatch) {\n return parseInt(opusMatch[1], 10) >= 7;\n }\n return false;\n}\n\nfunction isGeminiReasoningModel(model: string) {\n return /^gemini-/.test(model.toLowerCase().replace(/^google\\//, \"\"));\n}\n"]}
@@ -476,6 +476,23 @@
476
476
  }
477
477
  }
478
478
 
479
+ /* ─── ReasoningCell streaming tail clamp ────────────────────────────────────── */
480
+ /* While a reasoning cell is actively streaming and open, clamp the body to
481
+ roughly the last ~6 lines instead of letting it grow and push the rest of
482
+ the transcript around (the Claude Code "tail view" behavior). The reversed
483
+ column anchors the box to its bottom edge, so overflow is clipped off the
484
+ top while the newest lines stay pinned in view — pure CSS, no scroll/rAF
485
+ tracking needed. A soft fade masks the clipped edge in both themes since
486
+ it only touches alpha, not color. */
487
+ .reasoning-cell-tail {
488
+ display: flex;
489
+ flex-direction: column-reverse;
490
+ overflow: hidden;
491
+ max-height: 8rem;
492
+ mask-image: linear-gradient(to bottom, transparent, black 1.5rem);
493
+ -webkit-mask-image: linear-gradient(to bottom, transparent, black 1.5rem);
494
+ }
495
+
479
496
  /* ─── Agent-Markdown (AssistantChat react-markdown render surface) ─────────── */
480
497
  /* These classes are applied by the SmoothMarkdownText/MarkdownText components */
481
498
  /* in the AssistantChat/AssistantChatInner tree. The shiki dual-theme rules */
@@ -13,17 +13,21 @@ metadata:
13
13
 
14
14
  # Voice Transcription
15
15
 
16
- Click-to-toggle microphone inside the sidebar composer turns speech into
17
- text. Users configure live transcription separately from AI cleanup in
18
- Settings Voice Transcription. The feature is available in every template
19
- that renders `TiptapComposer`.
16
+ The microphone inside the sidebar composer offers two distinct paths:
17
+ editable dictation and an opt-in realtime speech-to-speech agent session.
18
+ Users configure dictation separately from AI cleanup in Settings → Voice
19
+ Transcription. Both paths are available in every template that renders the
20
+ shared agent sidebar.
20
21
 
21
22
  ## UX rules
22
23
 
23
24
  - **Always show the mic alongside the send button.** Cursor replaces send
24
25
  with mic when the composer is empty; their users complain. We keep both
25
26
  visible — Lovable does the same.
26
- - **Click-to-toggle, not push-to-talk.** More forgiving in a sidebar, avoids
27
+ - **Ask before switching modes.** The mic opens a shadcn popover offering
28
+ **Start voice mode** and **Keep dictating**; never silently replace the
29
+ established dictation behavior.
30
+ - **Dictation is click-to-toggle, not push-to-talk.** More forgiving in a sidebar, avoids
27
31
  host-app hotkey clashes. Keyboard shortcut is `Cmd/Ctrl+Shift+M` and
28
32
  `Escape` cancels mid-recording.
29
33
  - **Transcript lands in the composer, editable, never auto-sent.** Insert at
@@ -34,6 +38,31 @@ that renders `TiptapComposer`.
34
38
  Never use a sparkle or robot icon.
35
39
  - **Errors via inline alert or toast, never `window.alert`.**
36
40
 
41
+ ## Realtime speech mode
42
+
43
+ Realtime speech mode is a full-duplex OpenAI Realtime WebRTC session, separate
44
+ from the dictation providers below. It requires the authenticated user's
45
+ `OPENAI_API_KEY`, uses the server-owned `gpt-realtime-2.1` session
46
+ configuration, and keeps the key out of browser code.
47
+
48
+ - Starting voice mode collapses the chat into a persistent bottom-end speech
49
+ orb. Clicking the orb shows or hides chat without ending the session; ending
50
+ the session is a separate, explicit control.
51
+ - Semantic VAD keeps listening, starts responses automatically, and supports
52
+ barge-in while the agent is speaking.
53
+ - Function calls must cross the authenticated realtime tool bridge and enter
54
+ `executeAgentToolCall`. Never call `ActionEntry.run` directly: that bypasses
55
+ schema validation, approvals, audit/journal behavior, timeouts, redaction,
56
+ and mutation refreshes.
57
+ - Preserve the active browser-tab id in request context so `set-url`,
58
+ `set-search-params`, `view-screen`, and tab-scoped application state affect
59
+ the app the user is actually speaking to.
60
+ - Do not persist audio. Store only compact lifecycle and latest-transcript
61
+ context at `application_state["realtime-voice-session"]`; delete it when the
62
+ session ends.
63
+ - Missing-key failures should open Settings focused on the user-scoped
64
+ `OPENAI_API_KEY` field. Never send, log, or echo the key to the browser.
65
+
37
66
  ## Source And Cleanup
38
67
 
39
68
  Settings must keep these as separate choices:
@@ -80,11 +109,14 @@ Default behavior:
80
109
  | --------------------------------------------------------------------- | --------------------------------------------------- |
81
110
  | `packages/core/src/client/composer/useVoiceDictation.ts` | Provider-routing hook (MediaRecorder / Web Speech) |
82
111
  | `packages/core/src/client/composer/VoiceButton.tsx` | Mic button + live amplitude + cancel overlay |
112
+ | `packages/core/src/client/composer/RealtimeVoiceMode.tsx` | Opt-in popover + persistent speech orb |
113
+ | `packages/core/src/client/composer/useRealtimeVoiceMode.tsx` | WebRTC lifecycle, provider events, and tool bridge |
83
114
  | `packages/core/src/client/composer/TiptapComposer.tsx` | Wires the hook, insertion, and keyboard shortcut |
84
115
  | `packages/core/src/client/settings/VoiceTranscriptionSection.tsx` | Live source + cleanup controls in sidebar settings |
85
116
  | `packages/core/src/client/transcription/BuilderTranscriptionCta.tsx` | CTA shown when Builder account isn't connected |
86
117
  | `packages/core/src/client/transcription/use-live-transcription.ts` | Web Speech live-transcription hook for recordings |
87
118
  | `packages/core/src/server/transcribe-voice.ts` | Route handler (routes to Builder/Gemini/Groq/Whisper) |
119
+ | `packages/core/src/server/realtime-voice.ts` | Authenticated OpenAI SDP and action-tool routes |
88
120
  | `packages/core/src/transcription/builder-transcription.ts` | Builder proxy transcription client |
89
121
  | `packages/core/src/voice/` | Shared voice context pack, prompt, and replacement helpers |
90
122
  | `packages/core/src/secrets/register-framework-secrets.ts` | Framework-level provider key registration |
@@ -139,4 +171,6 @@ Templates can:
139
171
  - Don't call transcription providers from the client — go through `/_agent-native/transcribe-voice` so the user's secret stays server-side.
140
172
  - Don't remove the cancel affordance — mic permission abuse paranoia is real.
141
173
  - Don't auto-submit the transcript — users always edit before sending.
174
+ - Don't route realtime tool calls around the central guarded agent executor.
175
+ - Don't persist realtime audio or put provider keys in SDP/session payloads.
142
176
  - Don't copy Cursor's "hide send when empty" pattern — it confuses users.
@@ -5,7 +5,13 @@ description: "Agent-to-agent communication via JSON-RPC: discovery, messaging, s
5
5
 
6
6
  # A2A Protocol
7
7
 
8
- Agent-to-agent communication over HTTP. Agents discover each other, send messages, and receive structured results.
8
+ A2A lets agents talk to each other directly over HTTP: they discover each other's capabilities, send messages, and get back structured results — no shared database or hand-wired API needed.
9
+
10
+ <Callout tone="info">
11
+
12
+ **A2A vs MCP.** A2A is for **agent-to-agent** delegation — one agent-native app's agent handing work to another app's agent, which reasons over it with its own LLM loop. [MCP](/docs/mcp-protocol) is for **tool-to-agent** access — an external host like Claude or Cursor calling your app's actions directly as tools, with no extra agent reasoning in between. Use A2A when the receiving side should think; use MCP when it should just execute. See [MCP Server — MCP vs A2A](/docs/mcp-protocol#mcp-vs-a2a) for the full comparison table.
13
+
14
+ </Callout>
9
15
 
10
16
  ## Overview {#overview}
11
17
 
@@ -159,7 +165,7 @@ All methods are called via `POST /_agent-native/a2a` with JSON-RPC 2.0 format:
159
165
  | `tasks/get` | Fetch a task by ID — used to poll an async task to completion | `id` |
160
166
  | `tasks/cancel` | Cancel a running task | `id` |
161
167
 
162
- <Endpoint id="doc-block-a6g596" title="Primary A2A endpoint" summary="All JSON-RPC methods are POSTed here. message/send shown." method="POST" path="/_agent-native/a2a" summary="Send a message and wait for the completed task" auth="JWT bearer signed with A2A_SECRET (or legacy apiKeyEnv static token)" params={[
168
+ <Endpoint id="doc-block-a6g596" title="Primary A2A endpoint" summary="All JSON-RPC methods are POSTed here. message/send shown." method="POST" path="/_agent-native/a2a" auth="JWT bearer signed with A2A_SECRET (or legacy apiKeyEnv static token)" params={[
163
169
  {
164
170
  "name": "Authorization",
165
171
  "in": "header",
@@ -272,9 +278,11 @@ When `message/send` is called with `async: true`, the JSON-RPC handler enqueues
272
278
 
273
279
  </Diagram>
274
280
 
275
- > [!IMPORTANT]
276
- > **Serverless Webhook & Gateway Timeouts:**
277
- > Hosted environment gateways (such as Netlify, Vercel, or Cloudflare Pages) impose strict execution limits (often 10 to 30 seconds) on public-facing HTTP routes. Because agent loops can take significant time to run queries, fetch context, and execute tools, you **must use `async: true`** when calling A2A endpoints or handling external webhooks. This immediately returns a `working` status to the API gateway, keeping the connection open only for a few milliseconds, while the self-fired `/process-task` POST executes the agent loop in the background. Do not block the primary HTTP request waiting for the agent loop to finish.
281
+ <Callout tone="warning">
282
+
283
+ **Serverless webhook and gateway timeouts.** Hosted environment gateways (such as Netlify, Vercel, or Cloudflare Pages) impose strict execution limits (often 10 to 30 seconds) on public-facing HTTP routes. Because agent loops can take significant time to run queries, fetch context, and execute tools, you **must use `async: true`** when calling A2A endpoints or handling external webhooks. This immediately returns a `working` status to the API gateway, keeping the connection open only for a few milliseconds, while the self-fired `/process-task` POST executes the agent loop in the background. Do not block the primary HTTP request waiting for the agent loop to finish.
284
+
285
+ </Callout>
278
286
 
279
287
  Messages contain typed parts — text, structured data, and files can all travel in one message:
280
288
 
@@ -534,3 +542,11 @@ export default defineAction({
534
542
  ```
535
543
 
536
544
  The analytics agent receives the message, runs the query via its handler, and returns the result. The mail action gets the text response back. No shared database, no direct API calls — just agent-to-agent communication.
545
+
546
+ ## What's next {#whats-next}
547
+
548
+ - [**MCP Server**](/docs/mcp-protocol#mcp-vs-a2a) — the sibling protocol for external tools calling your app directly
549
+ - [**Dispatch**](/docs/dispatch) — the app that routes inbound messages to the right A2A peer
550
+ - [**Messaging**](/docs/messaging) — reaching agents from Slack, email, Telegram, and WhatsApp
551
+ - [**Agent Mentions**](/docs/agent-mentions) — `@`-mentioning a connected agent in chat, which calls A2A under the hood
552
+ - [**Multi-App Workspaces**](/docs/multi-app-workspace) — same-origin workspace A2A with auto-signed credentials
@@ -11,7 +11,7 @@ Actions are the single source of truth for anything your app does. Define an act
11
11
  - **Typesafe React hooks** — `useActionQuery("name")` and `useActionMutation("name")` on the frontend, types inferred from the schema.
12
12
  - **Imperative client calls** — `callAction("name", params)` when a hook does not fit.
13
13
  - **Framework transport** — auto-mounted by the framework behind those hooks and available to external HTTP clients.
14
- - **An MCP tool** — exposed to Claude, ChatGPT custom MCP apps, Claude Desktop/Code, Cursor, Codex, and any other MCP client.
14
+ - **An MCP tool** — exposed to Claude, ChatGPT custom MCP apps, Claude Desktop/Code, Cursor, Codex, and any other MCP host.
15
15
  - **An A2A tool** — called by other agent-native apps over A2A.
16
16
  - **A CLI command** — `pnpm action <name>` for scripting and dev loops.
17
17
 
@@ -146,23 +146,23 @@ around actions, not a required prerequisite for the action itself.
146
146
  filename="actions/reply-to-email.ts"
147
147
  language="ts"
148
148
  code={
149
- 'import { defineAction } from "@agent-native/core/action";\nimport { z } from "zod";\n\nexport default defineAction({\n description: "Reply to an email thread in the user\'s voice.",\n schema: z.object({\n emailId: z.string().describe("The id of the email to reply to."),\n body: z.string().describe("The reply body, in markdown."),\n }),\n run: async ({ emailId, body }) => {\n await db.insert(replies).values({ emailId, body });\n return { ok: true, emailId };\n },\n});'
149
+ 'import { defineAction } from "@agent-native/core/action";\nimport { z } from "zod";\n\nimport { getDb, schema } from "../server/db/index.js";\n\nexport default defineAction({\n description: "Reply to an email thread in the user\'s voice.",\n schema: z.object({\n emailId: z.string().describe("The id of the email to reply to."),\n body: z.string().describe("The reply body, in markdown."),\n }),\n run: async ({ emailId, body }) => {\n const db = getDb();\n await db.insert(schema.replies).values({ emailId, body });\n return { ok: true, emailId };\n },\n});'
150
150
  }
151
151
  annotations={[
152
152
  {
153
- lines: "5",
153
+ lines: "7",
154
154
  label: "Tool surface",
155
155
  note: "`description` is what the agent reads to decide when to call this. The per-field `.describe()` calls flow into the JSON Schema too.",
156
156
  },
157
157
  {
158
- lines: "6-9",
158
+ lines: "8-11",
159
159
  label: "Typed contract",
160
160
  note: "One schema validates input from **every** surface and is converted to JSON Schema for the model. Invalid inputs never reach `run`.",
161
161
  },
162
162
  {
163
- lines: "10-13",
163
+ lines: "12-16",
164
164
  label: "One implementation",
165
- note: "The `run` body is the single source of truth — the UI button and the agent tool both execute exactly this.",
165
+ note: "The `run` body is the single source of truth — the UI button and the agent tool both execute exactly this. `getDb()` and `schema` come from your app's `server/db/index.ts` — see [Database](/docs/database).",
166
166
  },
167
167
  ]}
168
168
  />
@@ -392,23 +392,9 @@ For list and read actions, use `accessFilter` to scope the query to the current
392
392
 
393
393
  ### Human-in-the-loop approval {#needs-approval}
394
394
 
395
- A handful of actions are too consequential to let the agent run autonomously — sending an email, charging a card, deleting an account. For those, set `needsApproval` to pause the loop and require a human to approve the specific call before `run()` executes:
395
+ A handful of actions are too consequential to let the agent run autonomously — sending an email, charging a card, deleting an account. Set `needsApproval: true` (or a predicate `(args, ctx) => boolean | Promise<boolean>`) on `defineAction` and the loop pauses before `run()`, requiring a human to approve that specific call. The default is **off**, and almost every action should stay that way.
396
396
 
397
- ```ts
398
- export default defineAction({
399
- description: "Send an email via Gmail.",
400
- schema: z.object({ to: z.string(), subject: z.string(), body: z.string() }),
401
- needsApproval: true, // pause; a human must approve this specific send
402
- run: async (args) => {
403
- /* ...actually send... */
404
- },
405
- });
406
- ```
407
-
408
- `needsApproval` also accepts a predicate `(args, ctx) => boolean | Promise<boolean>` to gate conditionally (e.g. only external recipients, only above a threshold); it **fails closed**, so a throw counts as "approval required". When the gate is truthy and unapproved, the loop stops the turn and the side effect never fires until a human approves in the chat UI.
409
-
410
- > [!WARNING]
411
- > Keep approvals rare. Each gated action is a hard stop in the agent loop. The default is **off**, and almost every action should leave it off. See [Human-in-the-Loop Approvals](/docs/human-approval) for the predicate API, the `approval_required` event, and the full flow.
397
+ See [Human-in-the-Loop Approvals](/docs/human-approval) for the predicate API, the `approval_required` event, and the full end-to-end flow.
412
398
 
413
399
  ### Audit logging {#audit}
414
400
 
@@ -554,7 +540,7 @@ export default defineAction({
554
540
  });
555
541
  ```
556
542
 
557
- Keep `link` as the fallback for CLI and non-UI MCP clients; it is also the embed's launch target. The embed bridge — the signed embed-start session, transplant vs. controlled-frame rendering, the `ui/*` host bridge, CSP, and height clamping — is owned by [External Agents](/docs/external-agents#mcp-app-bridge).
543
+ Keep `link` as the fallback for CLI and non-UI MCP hosts; it is also the embed's launch target. The embed bridge — the signed embed-start session, transplant vs. controlled-frame rendering, the `ui/*` host bridge, CSP, and height clamping — is owned by [External Agents](/docs/external-agents#mcp-app-bridge).
558
544
 
559
545
  ## Standard actions {#standard-actions}
560
546