@agent-native/core 0.98.16 → 0.99.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (546) hide show
  1. package/corpus/README.md +2 -2
  2. package/corpus/core/CHANGELOG.md +21 -0
  3. package/corpus/core/docs/content/actions.mdx +1 -1
  4. package/corpus/core/docs/content/authentication.mdx +1 -1
  5. package/corpus/core/docs/content/dispatch.mdx +3 -3
  6. package/corpus/core/docs/content/external-agents.mdx +30 -19
  7. package/corpus/core/docs/content/locales/ar-SA/actions.mdx +1 -1
  8. package/corpus/core/docs/content/locales/ar-SA/authentication.mdx +1 -1
  9. package/corpus/core/docs/content/locales/ar-SA/dispatch.mdx +3 -3
  10. package/corpus/core/docs/content/locales/ar-SA/external-agents.mdx +23 -19
  11. package/corpus/core/docs/content/locales/ar-SA/mcp-clients.mdx +31 -3
  12. package/corpus/core/docs/content/locales/ar-SA/mcp-protocol.mdx +29 -15
  13. package/corpus/core/docs/content/locales/ar-SA/plan-plugin.mdx +3 -3
  14. package/corpus/core/docs/content/locales/ar-SA/server.mdx +2 -2
  15. package/corpus/core/docs/content/locales/ar-SA/skills-guide.mdx +1 -1
  16. package/corpus/core/docs/content/locales/ar-SA/template-assets.mdx +1 -1
  17. package/corpus/core/docs/content/locales/ar-SA/template-dispatch.mdx +2 -2
  18. package/corpus/core/docs/content/locales/ar-SA/template-plan.mdx +3 -3
  19. package/corpus/core/docs/content/locales/de-DE/actions.mdx +1 -1
  20. package/corpus/core/docs/content/locales/de-DE/authentication.mdx +1 -1
  21. package/corpus/core/docs/content/locales/de-DE/dispatch.mdx +3 -3
  22. package/corpus/core/docs/content/locales/de-DE/external-agents.mdx +23 -19
  23. package/corpus/core/docs/content/locales/de-DE/mcp-clients.mdx +37 -3
  24. package/corpus/core/docs/content/locales/de-DE/mcp-protocol.mdx +29 -15
  25. package/corpus/core/docs/content/locales/de-DE/plan-plugin.mdx +3 -3
  26. package/corpus/core/docs/content/locales/de-DE/server.mdx +2 -2
  27. package/corpus/core/docs/content/locales/de-DE/skills-guide.mdx +1 -1
  28. package/corpus/core/docs/content/locales/de-DE/template-assets.mdx +1 -1
  29. package/corpus/core/docs/content/locales/de-DE/template-dispatch.mdx +2 -2
  30. package/corpus/core/docs/content/locales/de-DE/template-plan.mdx +3 -3
  31. package/corpus/core/docs/content/locales/es-ES/actions.mdx +1 -1
  32. package/corpus/core/docs/content/locales/es-ES/authentication.mdx +1 -1
  33. package/corpus/core/docs/content/locales/es-ES/dispatch.mdx +3 -3
  34. package/corpus/core/docs/content/locales/es-ES/external-agents.mdx +32 -19
  35. package/corpus/core/docs/content/locales/es-ES/mcp-clients.mdx +17 -3
  36. package/corpus/core/docs/content/locales/es-ES/mcp-protocol.mdx +38 -15
  37. package/corpus/core/docs/content/locales/es-ES/plan-plugin.mdx +3 -3
  38. package/corpus/core/docs/content/locales/es-ES/server.mdx +2 -2
  39. package/corpus/core/docs/content/locales/es-ES/skills-guide.mdx +1 -1
  40. package/corpus/core/docs/content/locales/es-ES/template-assets.mdx +1 -1
  41. package/corpus/core/docs/content/locales/es-ES/template-dispatch.mdx +2 -2
  42. package/corpus/core/docs/content/locales/es-ES/template-plan.mdx +3 -3
  43. package/corpus/core/docs/content/locales/fr-FR/actions.mdx +1 -1
  44. package/corpus/core/docs/content/locales/fr-FR/authentication.mdx +1 -1
  45. package/corpus/core/docs/content/locales/fr-FR/dispatch.mdx +3 -3
  46. package/corpus/core/docs/content/locales/fr-FR/external-agents.mdx +23 -19
  47. package/corpus/core/docs/content/locales/fr-FR/mcp-clients.mdx +17 -3
  48. package/corpus/core/docs/content/locales/fr-FR/mcp-protocol.mdx +29 -15
  49. package/corpus/core/docs/content/locales/fr-FR/plan-plugin.mdx +3 -3
  50. package/corpus/core/docs/content/locales/fr-FR/server.mdx +2 -2
  51. package/corpus/core/docs/content/locales/fr-FR/skills-guide.mdx +1 -1
  52. package/corpus/core/docs/content/locales/fr-FR/template-assets.mdx +1 -1
  53. package/corpus/core/docs/content/locales/fr-FR/template-dispatch.mdx +2 -2
  54. package/corpus/core/docs/content/locales/fr-FR/template-plan.mdx +3 -3
  55. package/corpus/core/docs/content/locales/hi-IN/actions.mdx +1 -1
  56. package/corpus/core/docs/content/locales/hi-IN/authentication.mdx +1 -1
  57. package/corpus/core/docs/content/locales/hi-IN/dispatch.mdx +3 -3
  58. package/corpus/core/docs/content/locales/hi-IN/external-agents.mdx +31 -19
  59. package/corpus/core/docs/content/locales/hi-IN/mcp-clients.mdx +17 -3
  60. package/corpus/core/docs/content/locales/hi-IN/mcp-protocol.mdx +36 -15
  61. package/corpus/core/docs/content/locales/hi-IN/plan-plugin.mdx +3 -3
  62. package/corpus/core/docs/content/locales/hi-IN/server.mdx +2 -2
  63. package/corpus/core/docs/content/locales/hi-IN/skills-guide.mdx +1 -1
  64. package/corpus/core/docs/content/locales/hi-IN/template-assets.mdx +1 -1
  65. package/corpus/core/docs/content/locales/hi-IN/template-dispatch.mdx +2 -2
  66. package/corpus/core/docs/content/locales/hi-IN/template-plan.mdx +3 -3
  67. package/corpus/core/docs/content/locales/ja-JP/actions.mdx +1 -1
  68. package/corpus/core/docs/content/locales/ja-JP/authentication.mdx +1 -1
  69. package/corpus/core/docs/content/locales/ja-JP/dispatch.mdx +3 -3
  70. package/corpus/core/docs/content/locales/ja-JP/external-agents.mdx +23 -19
  71. package/corpus/core/docs/content/locales/ja-JP/mcp-clients.mdx +34 -3
  72. package/corpus/core/docs/content/locales/ja-JP/mcp-protocol.mdx +29 -15
  73. package/corpus/core/docs/content/locales/ja-JP/plan-plugin.mdx +3 -3
  74. package/corpus/core/docs/content/locales/ja-JP/server.mdx +2 -2
  75. package/corpus/core/docs/content/locales/ja-JP/skills-guide.mdx +1 -1
  76. package/corpus/core/docs/content/locales/ja-JP/template-assets.mdx +1 -1
  77. package/corpus/core/docs/content/locales/ja-JP/template-dispatch.mdx +2 -2
  78. package/corpus/core/docs/content/locales/ja-JP/template-plan.mdx +3 -3
  79. package/corpus/core/docs/content/locales/ko-KR/actions.mdx +1 -1
  80. package/corpus/core/docs/content/locales/ko-KR/authentication.mdx +1 -1
  81. package/corpus/core/docs/content/locales/ko-KR/dispatch.mdx +3 -3
  82. package/corpus/core/docs/content/locales/ko-KR/external-agents.mdx +30 -19
  83. package/corpus/core/docs/content/locales/ko-KR/mcp-clients.mdx +33 -3
  84. package/corpus/core/docs/content/locales/ko-KR/mcp-protocol.mdx +36 -15
  85. package/corpus/core/docs/content/locales/ko-KR/plan-plugin.mdx +3 -3
  86. package/corpus/core/docs/content/locales/ko-KR/server.mdx +2 -2
  87. package/corpus/core/docs/content/locales/ko-KR/skills-guide.mdx +1 -1
  88. package/corpus/core/docs/content/locales/ko-KR/template-assets.mdx +1 -1
  89. package/corpus/core/docs/content/locales/ko-KR/template-dispatch.mdx +2 -2
  90. package/corpus/core/docs/content/locales/ko-KR/template-plan.mdx +3 -3
  91. package/corpus/core/docs/content/locales/pt-BR/actions.mdx +1 -1
  92. package/corpus/core/docs/content/locales/pt-BR/authentication.mdx +1 -1
  93. package/corpus/core/docs/content/locales/pt-BR/dispatch.mdx +3 -3
  94. package/corpus/core/docs/content/locales/pt-BR/external-agents.mdx +32 -19
  95. package/corpus/core/docs/content/locales/pt-BR/mcp-clients.mdx +34 -3
  96. package/corpus/core/docs/content/locales/pt-BR/mcp-protocol.mdx +32 -15
  97. package/corpus/core/docs/content/locales/pt-BR/plan-plugin.mdx +3 -3
  98. package/corpus/core/docs/content/locales/pt-BR/server.mdx +2 -2
  99. package/corpus/core/docs/content/locales/pt-BR/skills-guide.mdx +1 -1
  100. package/corpus/core/docs/content/locales/pt-BR/template-assets.mdx +1 -1
  101. package/corpus/core/docs/content/locales/pt-BR/template-dispatch.mdx +2 -2
  102. package/corpus/core/docs/content/locales/pt-BR/template-plan.mdx +3 -3
  103. package/corpus/core/docs/content/locales/zh-CN/actions.mdx +1 -1
  104. package/corpus/core/docs/content/locales/zh-CN/authentication.mdx +1 -1
  105. package/corpus/core/docs/content/locales/zh-CN/dispatch.mdx +3 -3
  106. package/corpus/core/docs/content/locales/zh-CN/external-agents.mdx +23 -19
  107. package/corpus/core/docs/content/locales/zh-CN/mcp-clients.mdx +28 -3
  108. package/corpus/core/docs/content/locales/zh-CN/mcp-protocol.mdx +29 -15
  109. package/corpus/core/docs/content/locales/zh-CN/plan-plugin.mdx +3 -3
  110. package/corpus/core/docs/content/locales/zh-CN/server.mdx +2 -2
  111. package/corpus/core/docs/content/locales/zh-CN/skills-guide.mdx +1 -1
  112. package/corpus/core/docs/content/locales/zh-CN/template-assets.mdx +1 -1
  113. package/corpus/core/docs/content/locales/zh-CN/template-dispatch.mdx +2 -2
  114. package/corpus/core/docs/content/locales/zh-CN/template-plan.mdx +3 -3
  115. package/corpus/core/docs/content/locales/zh-TW/actions.mdx +1 -1
  116. package/corpus/core/docs/content/locales/zh-TW/authentication.mdx +1 -1
  117. package/corpus/core/docs/content/locales/zh-TW/dispatch.mdx +3 -3
  118. package/corpus/core/docs/content/locales/zh-TW/external-agents.mdx +23 -19
  119. package/corpus/core/docs/content/locales/zh-TW/mcp-clients.mdx +28 -3
  120. package/corpus/core/docs/content/locales/zh-TW/mcp-protocol.mdx +30 -15
  121. package/corpus/core/docs/content/locales/zh-TW/plan-plugin.mdx +3 -3
  122. package/corpus/core/docs/content/locales/zh-TW/server.mdx +2 -2
  123. package/corpus/core/docs/content/locales/zh-TW/skills-guide.mdx +1 -1
  124. package/corpus/core/docs/content/locales/zh-TW/template-assets.mdx +1 -1
  125. package/corpus/core/docs/content/locales/zh-TW/template-dispatch.mdx +2 -2
  126. package/corpus/core/docs/content/locales/zh-TW/template-plan.mdx +3 -3
  127. package/corpus/core/docs/content/mcp-clients.mdx +31 -4
  128. package/corpus/core/docs/content/mcp-protocol.mdx +35 -15
  129. package/corpus/core/docs/content/plan-plugin.mdx +3 -3
  130. package/corpus/core/docs/content/server.mdx +2 -2
  131. package/corpus/core/docs/content/skills-guide.mdx +1 -1
  132. package/corpus/core/docs/content/template-assets.mdx +1 -1
  133. package/corpus/core/docs/content/template-dispatch.mdx +2 -2
  134. package/corpus/core/docs/content/template-plan.mdx +3 -3
  135. package/corpus/core/package.json +1 -1
  136. package/corpus/core/src/a2a/client.ts +3 -0
  137. package/corpus/core/src/a2a/handlers.ts +95 -7
  138. package/corpus/core/src/cli/connect.ts +50 -24
  139. package/corpus/core/src/cli/mcp-config-writers.ts +10 -0
  140. package/corpus/core/src/cli/mcp.ts +5 -5
  141. package/corpus/core/src/cli/skills-content/assets-skill.ts +1 -1
  142. package/corpus/core/src/cli/skills-content/design-exploration-skill.ts +1 -1
  143. package/corpus/core/src/cli/skills-content/help.ts +1 -1
  144. package/corpus/core/src/cli/skills-content/plan-setup-auth.ts +1 -1
  145. package/corpus/core/src/cli/skills-content/visual-plan-skill.ts +1 -1
  146. package/corpus/core/src/cli/skills-content/visual-recap-skill.ts +2 -2
  147. package/corpus/core/src/cli/skills.ts +23 -12
  148. package/corpus/core/src/client/resources/McpIntegrationDialog.tsx +5 -0
  149. package/corpus/core/src/client/resources/mcp-integration-catalog.ts +17 -0
  150. package/corpus/core/src/embedding/agent.ts +8 -6
  151. package/corpus/core/src/localization/default-messages.ts +7 -0
  152. package/corpus/core/src/mcp/ask-app-inline-tasks.ts +125 -0
  153. package/corpus/core/src/mcp/build-server.ts +65 -3
  154. package/corpus/core/src/mcp/builtin-tools.ts +186 -22
  155. package/corpus/core/src/mcp/connect-route.ts +17 -14
  156. package/corpus/core/src/mcp/oauth-route.ts +38 -13
  157. package/corpus/core/src/mcp/route-paths.ts +34 -0
  158. package/corpus/core/src/mcp/server.ts +21 -10
  159. package/corpus/core/src/mcp/stdio.ts +34 -16
  160. package/corpus/core/src/mcp/workspace-resolve.ts +2 -1
  161. package/corpus/core/src/mcp-client/manager.ts +5 -3
  162. package/corpus/core/src/mcp-client/remote-store.ts +10 -10
  163. package/corpus/core/src/server/agent-chat-plugin.ts +59 -8
  164. package/corpus/core/src/server/auth.ts +22 -6
  165. package/corpus/core/src/server/core-routes-plugin.ts +30 -24
  166. package/corpus/core/src/server/csrf.ts +17 -0
  167. package/corpus/core/src/server/framework-request-handler.ts +8 -2
  168. package/corpus/core/src/server/google-oauth.ts +6 -0
  169. package/corpus/core/src/server/http-response-telemetry.ts +6 -1
  170. package/corpus/core/src/server/recap-image-route.ts +3 -3
  171. package/corpus/core/src/server/security-headers.ts +7 -1
  172. package/corpus/core/src/server/ssr-handler.ts +2 -0
  173. package/corpus/core/src/shared/cache-control.ts +6 -4
  174. package/corpus/core/src/templates/default/.agents/skills/security/SKILL.md +10 -0
  175. package/corpus/core/src/templates/workspace-core/.agents/skills/authentication/SKILL.md +15 -6
  176. package/corpus/core/src/templates/workspace-core/.agents/skills/external-agents/SKILL.md +16 -10
  177. package/corpus/core/src/templates/workspace-core/.agents/skills/performance/SKILL.md +20 -1
  178. package/corpus/core/src/templates/workspace-core/.agents/skills/security/SKILL.md +10 -0
  179. package/corpus/templates/analytics/.agents/skills/security/SKILL.md +10 -0
  180. package/corpus/templates/analytics/app/global.css +63 -4
  181. package/corpus/templates/analytics/app/pages/sessions/SessionDetailPage.tsx +8 -5
  182. package/corpus/templates/analytics/changelog/2026-07-13-daily-dashboard-emails-recover-more-reliably-from-serverless.md +6 -0
  183. package/corpus/templates/analytics/changelog/2026-07-13-session-replays-keep-a-visible-mac-style-cursor-over-the-vis.md +6 -0
  184. package/corpus/templates/analytics/server/jobs/dashboard-report.ts +21 -2
  185. package/corpus/templates/analytics/server/lib/dashboard-report-subscriptions.ts +57 -1
  186. package/corpus/templates/analytics/server/lib/dashboard-report.ts +266 -28
  187. package/corpus/templates/analytics/server/routes/[...page].get.ts +0 -2
  188. package/corpus/templates/assets/.agents/skills/security/SKILL.md +10 -0
  189. package/corpus/templates/assets/agent-native.app-skill.json +1 -1
  190. package/corpus/templates/brain/.agents/skills/security/SKILL.md +10 -0
  191. package/corpus/templates/calendar/.agents/skills/security/SKILL.md +10 -0
  192. package/corpus/templates/calendar/AGENTS.md +2 -1
  193. package/corpus/templates/calendar/app/components/calendar/EventDetailPopover.tsx +0 -19
  194. package/corpus/templates/calendar/app/lib/attendee-local-time.ts +14 -5
  195. package/corpus/templates/calendar/changelog/2026-07-13-your-local-time-now-follows-your-browser-timezone-and-event-.md +6 -0
  196. package/corpus/templates/chat/.agents/skills/security/SKILL.md +10 -0
  197. package/corpus/templates/clips/.agents/skills/recording/SKILL.md +7 -2
  198. package/corpus/templates/clips/.agents/skills/security/SKILL.md +10 -0
  199. package/corpus/templates/clips/AGENTS.md +7 -0
  200. package/corpus/templates/clips/actions/list-meetings.ts +19 -4
  201. package/corpus/templates/clips/actions/start-meeting-recording.ts +7 -1
  202. package/corpus/templates/clips/app/components/meetings/transcript-bubbles.tsx +75 -78
  203. package/corpus/templates/clips/app/components/recorder/confetti-canvas.tsx +18 -1
  204. package/corpus/templates/clips/app/components/recorder/recorder-engine.ts +6 -12
  205. package/corpus/templates/clips/app/components/recorder/recording-toolbar.tsx +19 -2
  206. package/corpus/templates/clips/app/lib/camera-composite.ts +70 -10
  207. package/corpus/templates/clips/app/routes/_app.meetings.$meetingId.tsx +1 -1
  208. package/corpus/templates/clips/app/routes/record.tsx +5 -25
  209. package/corpus/templates/clips/changelog/2026-07-13-clips-desktop-now-requires-macos-13-for-native-capture.md +6 -0
  210. package/corpus/templates/clips/changelog/2026-07-13-clips-hide-solo-meeting-reminders.md +6 -0
  211. package/corpus/templates/clips/changelog/2026-07-13-clips-now-removes-duplicate-mic-and-system-transcript-turns-.md +6 -0
  212. package/corpus/templates/clips/changelog/2026-07-13-desktop-recordings-run-cooler-and-quieter-live-transcription.md +6 -0
  213. package/corpus/templates/clips/changelog/2026-07-13-meeting-recordings-now-stop-after-a-calendar-meeting-ends-an.md +6 -0
  214. package/corpus/templates/clips/changelog/2026-07-13-meeting-transcripts-now-use-a-clean-agent-chat-style-reading.md +6 -0
  215. package/corpus/templates/clips/changelog/2026-07-13-screen-recordings-use-less-processing-power-during-longer-ca.md +6 -0
  216. package/corpus/templates/clips/chrome-extension/src/background.ts +5 -3
  217. package/corpus/templates/clips/chrome-extension/src/offscreen.ts +17 -14
  218. package/corpus/templates/clips/chrome-extension/src/overlay.ts +8 -2
  219. package/corpus/templates/clips/desktop/README.md +3 -0
  220. package/corpus/templates/clips/desktop/src/hooks/useMeetingTranscription.ts +9 -0
  221. package/corpus/templates/clips/desktop/src/lib/recorder.ts +8 -2
  222. package/corpus/templates/clips/desktop/src/lib/silence-events.ts +1 -0
  223. package/corpus/templates/clips/desktop/src/lib/transcription-capture.ts +5 -0
  224. package/corpus/templates/clips/desktop/src/lib/transcription-engine.ts +134 -5
  225. package/corpus/templates/clips/desktop/src/lib/upload-video-stream.ts +28 -0
  226. package/corpus/templates/clips/desktop/src/overlays/flow-bar.tsx +10 -3
  227. package/corpus/templates/clips/desktop/src/overlays/meeting-notification.tsx +42 -9
  228. package/corpus/templates/clips/desktop/src/overlays/recording-pill.tsx +10 -2
  229. package/corpus/templates/clips/desktop/src-tauri/Cargo.toml +6 -1
  230. package/corpus/templates/clips/desktop/src-tauri/src/notifications.rs +77 -1
  231. package/corpus/templates/clips/desktop/src-tauri/src/silence_detector.rs +104 -25
  232. package/corpus/templates/clips/desktop/src-tauri/src/system_audio.rs +4 -0
  233. package/corpus/templates/clips/desktop/src-tauri/src/whisper_speech.rs +287 -32
  234. package/corpus/templates/clips/desktop/src-tauri/tauri.conf.json +1 -1
  235. package/corpus/templates/clips/server/lib/calendar-event-classification.ts +28 -0
  236. package/corpus/templates/clips/server/routes/[...page].get.ts +1 -59
  237. package/corpus/templates/clips/shared/recording-capture.ts +37 -0
  238. package/corpus/templates/content/.agents/skills/security/SKILL.md +10 -0
  239. package/corpus/templates/content/agent-native.app-skill.json +1 -1
  240. package/corpus/templates/content/server/routes/[...page].get.ts +1 -15
  241. package/corpus/templates/design/.agents/skills/security/SKILL.md +10 -0
  242. package/corpus/templates/design/actions/connect-assets-mcp.ts +1 -1
  243. package/corpus/templates/design/agent-native.app-skill.json +1 -1
  244. package/corpus/templates/design/app/components/design/DesignCanvas.tsx +88 -12
  245. package/corpus/templates/design/app/components/design/MultiScreenCanvas.tsx +1 -0
  246. package/corpus/templates/design/app/components/design/bridge/editor-chrome.bridge.ts +4 -1
  247. package/corpus/templates/design/changelog/2026-07-13-adding-shapes-preserves-canvas-background.md +6 -0
  248. package/corpus/templates/design/changelog/2026-07-13-clicking-quickly-between-overlapping-elements-no-longer-bounc.md +6 -0
  249. package/corpus/templates/design/server/plugins/assets-mcp.ts +1 -1
  250. package/corpus/templates/design/server/routes/[...page].get.ts +0 -2
  251. package/corpus/templates/dispatch/.agents/skills/security/SKILL.md +10 -0
  252. package/corpus/templates/forms/.agents/skills/security/SKILL.md +10 -0
  253. package/corpus/templates/macros/.agents/skills/security/SKILL.md +10 -0
  254. package/corpus/templates/mail/.agents/skills/security/SKILL.md +10 -0
  255. package/corpus/templates/plan/.agents/skills/security/SKILL.md +10 -0
  256. package/corpus/templates/plan/.agents/skills/visual-plan/SKILL.md +1 -1
  257. package/corpus/templates/plan/.agents/skills/visual-recap/SKILL.md +2 -2
  258. package/corpus/templates/plan/agent-native.app-skill.json +1 -1
  259. package/corpus/templates/plan/app/lib/plan-local-bridge.ts +6 -1
  260. package/corpus/templates/plan/app/pages/PlansPage.tsx +15 -6
  261. package/corpus/templates/plan/changelog/2026-07-13-fixed-local-plan-previews-continuously-flickering-while-revi.md +6 -0
  262. package/corpus/templates/plan/server/routes/[...page].get.ts +0 -2
  263. package/corpus/templates/slides/.agents/skills/security/SKILL.md +10 -0
  264. package/dist/a2a/client.d.ts +2 -0
  265. package/dist/a2a/client.d.ts.map +1 -1
  266. package/dist/a2a/client.js +2 -0
  267. package/dist/a2a/client.js.map +1 -1
  268. package/dist/a2a/handlers.d.ts.map +1 -1
  269. package/dist/a2a/handlers.js +84 -7
  270. package/dist/a2a/handlers.js.map +1 -1
  271. package/dist/cli/connect.d.ts +2 -2
  272. package/dist/cli/connect.d.ts.map +1 -1
  273. package/dist/cli/connect.js +45 -23
  274. package/dist/cli/connect.js.map +1 -1
  275. package/dist/cli/mcp-config-writers.d.ts.map +1 -1
  276. package/dist/cli/mcp-config-writers.js +7 -0
  277. package/dist/cli/mcp-config-writers.js.map +1 -1
  278. package/dist/cli/mcp.js +5 -3
  279. package/dist/cli/mcp.js.map +1 -1
  280. package/dist/cli/skills-content/assets-skill.d.ts +1 -1
  281. package/dist/cli/skills-content/assets-skill.d.ts.map +1 -1
  282. package/dist/cli/skills-content/assets-skill.js +1 -1
  283. package/dist/cli/skills-content/assets-skill.js.map +1 -1
  284. package/dist/cli/skills-content/design-exploration-skill.d.ts +1 -1
  285. package/dist/cli/skills-content/design-exploration-skill.d.ts.map +1 -1
  286. package/dist/cli/skills-content/design-exploration-skill.js +1 -1
  287. package/dist/cli/skills-content/design-exploration-skill.js.map +1 -1
  288. package/dist/cli/skills-content/help.d.ts +1 -1
  289. package/dist/cli/skills-content/help.d.ts.map +1 -1
  290. package/dist/cli/skills-content/help.js +1 -1
  291. package/dist/cli/skills-content/help.js.map +1 -1
  292. package/dist/cli/skills-content/plan-setup-auth.d.ts +1 -1
  293. package/dist/cli/skills-content/plan-setup-auth.d.ts.map +1 -1
  294. package/dist/cli/skills-content/plan-setup-auth.js +1 -1
  295. package/dist/cli/skills-content/plan-setup-auth.js.map +1 -1
  296. package/dist/cli/skills-content/visual-plan-skill.d.ts +1 -1
  297. package/dist/cli/skills-content/visual-plan-skill.d.ts.map +1 -1
  298. package/dist/cli/skills-content/visual-plan-skill.js +1 -1
  299. package/dist/cli/skills-content/visual-plan-skill.js.map +1 -1
  300. package/dist/cli/skills-content/visual-recap-skill.d.ts +1 -1
  301. package/dist/cli/skills-content/visual-recap-skill.d.ts.map +1 -1
  302. package/dist/cli/skills-content/visual-recap-skill.js +2 -2
  303. package/dist/cli/skills-content/visual-recap-skill.js.map +1 -1
  304. package/dist/cli/skills.d.ts.map +1 -1
  305. package/dist/cli/skills.js +16 -12
  306. package/dist/cli/skills.js.map +1 -1
  307. package/dist/client/resources/McpIntegrationDialog.d.ts.map +1 -1
  308. package/dist/client/resources/McpIntegrationDialog.js +1 -1
  309. package/dist/client/resources/McpIntegrationDialog.js.map +1 -1
  310. package/dist/client/resources/mcp-integration-catalog.d.ts +1 -0
  311. package/dist/client/resources/mcp-integration-catalog.d.ts.map +1 -1
  312. package/dist/client/resources/mcp-integration-catalog.js +14 -0
  313. package/dist/client/resources/mcp-integration-catalog.js.map +1 -1
  314. package/dist/collab/awareness.d.ts +2 -2
  315. package/dist/collab/awareness.d.ts.map +1 -1
  316. package/dist/collab/struct-routes.d.ts +1 -1
  317. package/dist/embedding/agent.d.ts.map +1 -1
  318. package/dist/embedding/agent.js +6 -7
  319. package/dist/embedding/agent.js.map +1 -1
  320. package/dist/localization/default-messages.d.ts +5 -0
  321. package/dist/localization/default-messages.d.ts.map +1 -1
  322. package/dist/localization/default-messages.js +5 -0
  323. package/dist/localization/default-messages.js.map +1 -1
  324. package/dist/mcp/ask-app-inline-tasks.d.ts +47 -0
  325. package/dist/mcp/ask-app-inline-tasks.d.ts.map +1 -0
  326. package/dist/mcp/ask-app-inline-tasks.js +87 -0
  327. package/dist/mcp/ask-app-inline-tasks.js.map +1 -0
  328. package/dist/mcp/build-server.d.ts.map +1 -1
  329. package/dist/mcp/build-server.js +56 -3
  330. package/dist/mcp/build-server.js.map +1 -1
  331. package/dist/mcp/builtin-tools.d.ts.map +1 -1
  332. package/dist/mcp/builtin-tools.js +141 -21
  333. package/dist/mcp/builtin-tools.js.map +1 -1
  334. package/dist/mcp/connect-route.d.ts +12 -10
  335. package/dist/mcp/connect-route.d.ts.map +1 -1
  336. package/dist/mcp/connect-route.js +17 -14
  337. package/dist/mcp/connect-route.js.map +1 -1
  338. package/dist/mcp/oauth-route.d.ts +1 -1
  339. package/dist/mcp/oauth-route.d.ts.map +1 -1
  340. package/dist/mcp/oauth-route.js +30 -13
  341. package/dist/mcp/oauth-route.js.map +1 -1
  342. package/dist/mcp/route-paths.d.ts +13 -0
  343. package/dist/mcp/route-paths.d.ts.map +1 -0
  344. package/dist/mcp/route-paths.js +27 -0
  345. package/dist/mcp/route-paths.js.map +1 -0
  346. package/dist/mcp/server.d.ts +2 -1
  347. package/dist/mcp/server.d.ts.map +1 -1
  348. package/dist/mcp/server.js +14 -6
  349. package/dist/mcp/server.js.map +1 -1
  350. package/dist/mcp/stdio.d.ts +7 -6
  351. package/dist/mcp/stdio.d.ts.map +1 -1
  352. package/dist/mcp/stdio.js +27 -15
  353. package/dist/mcp/stdio.js.map +1 -1
  354. package/dist/mcp/workspace-resolve.d.ts +2 -1
  355. package/dist/mcp/workspace-resolve.d.ts.map +1 -1
  356. package/dist/mcp/workspace-resolve.js +2 -1
  357. package/dist/mcp/workspace-resolve.js.map +1 -1
  358. package/dist/mcp-client/manager.js +6 -3
  359. package/dist/mcp-client/manager.js.map +1 -1
  360. package/dist/mcp-client/remote-store.js +5 -7
  361. package/dist/mcp-client/remote-store.js.map +1 -1
  362. package/dist/notifications/routes.d.ts +2 -2
  363. package/dist/observability/routes.d.ts +3 -3
  364. package/dist/progress/routes.d.ts +1 -1
  365. package/dist/provider-api/corpus-jobs.d.ts +2 -2
  366. package/dist/resources/handlers.d.ts +3 -3
  367. package/dist/secrets/routes.d.ts +6 -6
  368. package/dist/server/agent-chat-plugin.d.ts.map +1 -1
  369. package/dist/server/agent-chat-plugin.js +60 -9
  370. package/dist/server/agent-chat-plugin.js.map +1 -1
  371. package/dist/server/auth.d.ts.map +1 -1
  372. package/dist/server/auth.js +16 -6
  373. package/dist/server/auth.js.map +1 -1
  374. package/dist/server/core-routes-plugin.d.ts +4 -3
  375. package/dist/server/core-routes-plugin.d.ts.map +1 -1
  376. package/dist/server/core-routes-plugin.js +20 -15
  377. package/dist/server/core-routes-plugin.js.map +1 -1
  378. package/dist/server/csrf.d.ts.map +1 -1
  379. package/dist/server/csrf.js +11 -0
  380. package/dist/server/csrf.js.map +1 -1
  381. package/dist/server/framework-request-handler.d.ts.map +1 -1
  382. package/dist/server/framework-request-handler.js +8 -2
  383. package/dist/server/framework-request-handler.js.map +1 -1
  384. package/dist/server/google-oauth.d.ts +2 -0
  385. package/dist/server/google-oauth.d.ts.map +1 -1
  386. package/dist/server/google-oauth.js +5 -0
  387. package/dist/server/google-oauth.js.map +1 -1
  388. package/dist/server/http-response-telemetry.d.ts.map +1 -1
  389. package/dist/server/http-response-telemetry.js +4 -1
  390. package/dist/server/http-response-telemetry.js.map +1 -1
  391. package/dist/server/recap-image-route.js +3 -3
  392. package/dist/server/recap-image-route.js.map +1 -1
  393. package/dist/server/security-headers.d.ts.map +1 -1
  394. package/dist/server/security-headers.js +4 -1
  395. package/dist/server/security-headers.js.map +1 -1
  396. package/dist/server/ssr-handler.d.ts.map +1 -1
  397. package/dist/server/ssr-handler.js +3 -1
  398. package/dist/server/ssr-handler.js.map +1 -1
  399. package/dist/server/transcribe-voice.d.ts +1 -1
  400. package/dist/shared/cache-control.d.ts +7 -6
  401. package/dist/shared/cache-control.d.ts.map +1 -1
  402. package/dist/shared/cache-control.js +4 -3
  403. package/dist/shared/cache-control.js.map +1 -1
  404. package/dist/templates/default/.agents/skills/security/SKILL.md +10 -0
  405. package/dist/templates/workspace-core/.agents/skills/authentication/SKILL.md +15 -6
  406. package/dist/templates/workspace-core/.agents/skills/external-agents/SKILL.md +16 -10
  407. package/dist/templates/workspace-core/.agents/skills/performance/SKILL.md +20 -1
  408. package/dist/templates/workspace-core/.agents/skills/security/SKILL.md +10 -0
  409. package/docs/content/actions.mdx +1 -1
  410. package/docs/content/authentication.mdx +1 -1
  411. package/docs/content/dispatch.mdx +3 -3
  412. package/docs/content/external-agents.mdx +30 -19
  413. package/docs/content/locales/ar-SA/actions.mdx +1 -1
  414. package/docs/content/locales/ar-SA/authentication.mdx +1 -1
  415. package/docs/content/locales/ar-SA/dispatch.mdx +3 -3
  416. package/docs/content/locales/ar-SA/external-agents.mdx +23 -19
  417. package/docs/content/locales/ar-SA/mcp-clients.mdx +31 -3
  418. package/docs/content/locales/ar-SA/mcp-protocol.mdx +29 -15
  419. package/docs/content/locales/ar-SA/plan-plugin.mdx +3 -3
  420. package/docs/content/locales/ar-SA/server.mdx +2 -2
  421. package/docs/content/locales/ar-SA/skills-guide.mdx +1 -1
  422. package/docs/content/locales/ar-SA/template-assets.mdx +1 -1
  423. package/docs/content/locales/ar-SA/template-dispatch.mdx +2 -2
  424. package/docs/content/locales/ar-SA/template-plan.mdx +3 -3
  425. package/docs/content/locales/de-DE/actions.mdx +1 -1
  426. package/docs/content/locales/de-DE/authentication.mdx +1 -1
  427. package/docs/content/locales/de-DE/dispatch.mdx +3 -3
  428. package/docs/content/locales/de-DE/external-agents.mdx +23 -19
  429. package/docs/content/locales/de-DE/mcp-clients.mdx +37 -3
  430. package/docs/content/locales/de-DE/mcp-protocol.mdx +29 -15
  431. package/docs/content/locales/de-DE/plan-plugin.mdx +3 -3
  432. package/docs/content/locales/de-DE/server.mdx +2 -2
  433. package/docs/content/locales/de-DE/skills-guide.mdx +1 -1
  434. package/docs/content/locales/de-DE/template-assets.mdx +1 -1
  435. package/docs/content/locales/de-DE/template-dispatch.mdx +2 -2
  436. package/docs/content/locales/de-DE/template-plan.mdx +3 -3
  437. package/docs/content/locales/es-ES/actions.mdx +1 -1
  438. package/docs/content/locales/es-ES/authentication.mdx +1 -1
  439. package/docs/content/locales/es-ES/dispatch.mdx +3 -3
  440. package/docs/content/locales/es-ES/external-agents.mdx +32 -19
  441. package/docs/content/locales/es-ES/mcp-clients.mdx +17 -3
  442. package/docs/content/locales/es-ES/mcp-protocol.mdx +38 -15
  443. package/docs/content/locales/es-ES/plan-plugin.mdx +3 -3
  444. package/docs/content/locales/es-ES/server.mdx +2 -2
  445. package/docs/content/locales/es-ES/skills-guide.mdx +1 -1
  446. package/docs/content/locales/es-ES/template-assets.mdx +1 -1
  447. package/docs/content/locales/es-ES/template-dispatch.mdx +2 -2
  448. package/docs/content/locales/es-ES/template-plan.mdx +3 -3
  449. package/docs/content/locales/fr-FR/actions.mdx +1 -1
  450. package/docs/content/locales/fr-FR/authentication.mdx +1 -1
  451. package/docs/content/locales/fr-FR/dispatch.mdx +3 -3
  452. package/docs/content/locales/fr-FR/external-agents.mdx +23 -19
  453. package/docs/content/locales/fr-FR/mcp-clients.mdx +17 -3
  454. package/docs/content/locales/fr-FR/mcp-protocol.mdx +29 -15
  455. package/docs/content/locales/fr-FR/plan-plugin.mdx +3 -3
  456. package/docs/content/locales/fr-FR/server.mdx +2 -2
  457. package/docs/content/locales/fr-FR/skills-guide.mdx +1 -1
  458. package/docs/content/locales/fr-FR/template-assets.mdx +1 -1
  459. package/docs/content/locales/fr-FR/template-dispatch.mdx +2 -2
  460. package/docs/content/locales/fr-FR/template-plan.mdx +3 -3
  461. package/docs/content/locales/hi-IN/actions.mdx +1 -1
  462. package/docs/content/locales/hi-IN/authentication.mdx +1 -1
  463. package/docs/content/locales/hi-IN/dispatch.mdx +3 -3
  464. package/docs/content/locales/hi-IN/external-agents.mdx +31 -19
  465. package/docs/content/locales/hi-IN/mcp-clients.mdx +17 -3
  466. package/docs/content/locales/hi-IN/mcp-protocol.mdx +36 -15
  467. package/docs/content/locales/hi-IN/plan-plugin.mdx +3 -3
  468. package/docs/content/locales/hi-IN/server.mdx +2 -2
  469. package/docs/content/locales/hi-IN/skills-guide.mdx +1 -1
  470. package/docs/content/locales/hi-IN/template-assets.mdx +1 -1
  471. package/docs/content/locales/hi-IN/template-dispatch.mdx +2 -2
  472. package/docs/content/locales/hi-IN/template-plan.mdx +3 -3
  473. package/docs/content/locales/ja-JP/actions.mdx +1 -1
  474. package/docs/content/locales/ja-JP/authentication.mdx +1 -1
  475. package/docs/content/locales/ja-JP/dispatch.mdx +3 -3
  476. package/docs/content/locales/ja-JP/external-agents.mdx +23 -19
  477. package/docs/content/locales/ja-JP/mcp-clients.mdx +34 -3
  478. package/docs/content/locales/ja-JP/mcp-protocol.mdx +29 -15
  479. package/docs/content/locales/ja-JP/plan-plugin.mdx +3 -3
  480. package/docs/content/locales/ja-JP/server.mdx +2 -2
  481. package/docs/content/locales/ja-JP/skills-guide.mdx +1 -1
  482. package/docs/content/locales/ja-JP/template-assets.mdx +1 -1
  483. package/docs/content/locales/ja-JP/template-dispatch.mdx +2 -2
  484. package/docs/content/locales/ja-JP/template-plan.mdx +3 -3
  485. package/docs/content/locales/ko-KR/actions.mdx +1 -1
  486. package/docs/content/locales/ko-KR/authentication.mdx +1 -1
  487. package/docs/content/locales/ko-KR/dispatch.mdx +3 -3
  488. package/docs/content/locales/ko-KR/external-agents.mdx +30 -19
  489. package/docs/content/locales/ko-KR/mcp-clients.mdx +33 -3
  490. package/docs/content/locales/ko-KR/mcp-protocol.mdx +36 -15
  491. package/docs/content/locales/ko-KR/plan-plugin.mdx +3 -3
  492. package/docs/content/locales/ko-KR/server.mdx +2 -2
  493. package/docs/content/locales/ko-KR/skills-guide.mdx +1 -1
  494. package/docs/content/locales/ko-KR/template-assets.mdx +1 -1
  495. package/docs/content/locales/ko-KR/template-dispatch.mdx +2 -2
  496. package/docs/content/locales/ko-KR/template-plan.mdx +3 -3
  497. package/docs/content/locales/pt-BR/actions.mdx +1 -1
  498. package/docs/content/locales/pt-BR/authentication.mdx +1 -1
  499. package/docs/content/locales/pt-BR/dispatch.mdx +3 -3
  500. package/docs/content/locales/pt-BR/external-agents.mdx +32 -19
  501. package/docs/content/locales/pt-BR/mcp-clients.mdx +34 -3
  502. package/docs/content/locales/pt-BR/mcp-protocol.mdx +32 -15
  503. package/docs/content/locales/pt-BR/plan-plugin.mdx +3 -3
  504. package/docs/content/locales/pt-BR/server.mdx +2 -2
  505. package/docs/content/locales/pt-BR/skills-guide.mdx +1 -1
  506. package/docs/content/locales/pt-BR/template-assets.mdx +1 -1
  507. package/docs/content/locales/pt-BR/template-dispatch.mdx +2 -2
  508. package/docs/content/locales/pt-BR/template-plan.mdx +3 -3
  509. package/docs/content/locales/zh-CN/actions.mdx +1 -1
  510. package/docs/content/locales/zh-CN/authentication.mdx +1 -1
  511. package/docs/content/locales/zh-CN/dispatch.mdx +3 -3
  512. package/docs/content/locales/zh-CN/external-agents.mdx +23 -19
  513. package/docs/content/locales/zh-CN/mcp-clients.mdx +28 -3
  514. package/docs/content/locales/zh-CN/mcp-protocol.mdx +29 -15
  515. package/docs/content/locales/zh-CN/plan-plugin.mdx +3 -3
  516. package/docs/content/locales/zh-CN/server.mdx +2 -2
  517. package/docs/content/locales/zh-CN/skills-guide.mdx +1 -1
  518. package/docs/content/locales/zh-CN/template-assets.mdx +1 -1
  519. package/docs/content/locales/zh-CN/template-dispatch.mdx +2 -2
  520. package/docs/content/locales/zh-CN/template-plan.mdx +3 -3
  521. package/docs/content/locales/zh-TW/actions.mdx +1 -1
  522. package/docs/content/locales/zh-TW/authentication.mdx +1 -1
  523. package/docs/content/locales/zh-TW/dispatch.mdx +3 -3
  524. package/docs/content/locales/zh-TW/external-agents.mdx +23 -19
  525. package/docs/content/locales/zh-TW/mcp-clients.mdx +28 -3
  526. package/docs/content/locales/zh-TW/mcp-protocol.mdx +30 -15
  527. package/docs/content/locales/zh-TW/plan-plugin.mdx +3 -3
  528. package/docs/content/locales/zh-TW/server.mdx +2 -2
  529. package/docs/content/locales/zh-TW/skills-guide.mdx +1 -1
  530. package/docs/content/locales/zh-TW/template-assets.mdx +1 -1
  531. package/docs/content/locales/zh-TW/template-dispatch.mdx +2 -2
  532. package/docs/content/locales/zh-TW/template-plan.mdx +3 -3
  533. package/docs/content/mcp-clients.mdx +31 -4
  534. package/docs/content/mcp-protocol.mdx +35 -15
  535. package/docs/content/plan-plugin.mdx +3 -3
  536. package/docs/content/server.mdx +2 -2
  537. package/docs/content/skills-guide.mdx +1 -1
  538. package/docs/content/template-assets.mdx +1 -1
  539. package/docs/content/template-dispatch.mdx +2 -2
  540. package/docs/content/template-plan.mdx +3 -3
  541. package/package.json +1 -1
  542. package/src/templates/default/.agents/skills/security/SKILL.md +10 -0
  543. package/src/templates/workspace-core/.agents/skills/authentication/SKILL.md +15 -6
  544. package/src/templates/workspace-core/.agents/skills/external-agents/SKILL.md +16 -10
  545. package/src/templates/workspace-core/.agents/skills/performance/SKILL.md +20 -1
  546. package/src/templates/workspace-core/.agents/skills/security/SKILL.md +10 -0
@@ -39,17 +39,19 @@ function trimEndpointPath(pathname: string, suffix: string): string | null {
39
39
  return normalized.slice(0, -suffix.length) || "/";
40
40
  }
41
41
 
42
+ const MCP_PUBLIC_PATH = "/mcp";
43
+ const MCP_LEGACY_PATH = "/_agent-native/mcp";
44
+
42
45
  export function getMcpUrl(
43
46
  url: string,
44
47
  options: AgentEndpointOptions = {},
45
48
  ): string {
46
49
  const parsed = appUrl(url, options);
47
- const trimmed = trimEndpointPath(parsed.pathname, "/_agent-native/mcp");
48
- if (trimmed !== null) {
49
- parsed.pathname = `${trimmed.replace(/\/$/, "")}/_agent-native/mcp`;
50
- } else {
51
- parsed.pathname = `${parsed.pathname.replace(/\/$/, "")}/_agent-native/mcp`;
52
- }
50
+ const trimmed =
51
+ trimEndpointPath(parsed.pathname, MCP_LEGACY_PATH) ??
52
+ trimEndpointPath(parsed.pathname, MCP_PUBLIC_PATH);
53
+ const basePath = (trimmed ?? parsed.pathname).replace(/\/$/, "");
54
+ parsed.pathname = `${basePath}${MCP_PUBLIC_PATH}`;
53
55
  parsed.search = "";
54
56
  parsed.hash = "";
55
57
  return parsed.toString();
@@ -620,6 +620,13 @@ const messages = {
620
620
  description: "Manage payments, subscriptions, and customers.",
621
621
  useCase: "Payments, subscriptions, invoicing, customer management",
622
622
  },
623
+ atlassian: {
624
+ description: "Read and write Jira issues and Confluence content.",
625
+ useCase:
626
+ "Project management, issue tracking, documentation, team collaboration",
627
+ setupNote:
628
+ "Your Atlassian organization admin may need to allow this app's domain and enable the required Rovo MCP permissions before OAuth can complete.",
629
+ },
623
630
  },
624
631
  auth: {
625
632
  none: "No auth",
@@ -0,0 +1,125 @@
1
+ /**
2
+ * Process-local fallback task tracker for `ask_app` (and the legacy
3
+ * `ask-agent` meta-tool) for the one case where no app origin is derivable
4
+ * from the MCP request — `selfA2AEndpointUrl(requestMeta)` returns null in
5
+ * `builtin-tools.ts`. Without an origin there is no `/_agent-native/a2a`
6
+ * endpoint to submit a durable task to, so `config.askAgent(message)` used
7
+ * to be awaited unbounded, which can hold a hosted MCP request open past a
8
+ * serverless gateway's inactivity timeout. This gives that path the same
9
+ * bounded "return a taskId, keep working in the background" contract as the
10
+ * durable A2A path, without needing a database.
11
+ *
12
+ * Entries are **process-local, not durable** — they live only in this
13
+ * server instance's memory and are lost on restart or if a different
14
+ * instance handles the poll. That is an acceptable trade-off here: this
15
+ * fallback only exists because no app origin was derivable in the first
16
+ * place, so there was never a reachable endpoint another instance could
17
+ * have polled anyway.
18
+ *
19
+ * Eviction is lazy (checked on each map access) instead of timer-based, so
20
+ * this stays serverless-safe — nothing keeps the process alive to sweep.
21
+ */
22
+
23
+ type AskAppInlineTaskStatus = "working" | "completed" | "failed";
24
+
25
+ interface AskAppInlineTaskEntry {
26
+ status: AskAppInlineTaskStatus;
27
+ response?: string;
28
+ error?: string;
29
+ createdAt: number;
30
+ settledAt?: number;
31
+ }
32
+
33
+ export interface AskAppInlineTaskSnapshot {
34
+ taskId: string;
35
+ status: AskAppInlineTaskStatus;
36
+ response?: string;
37
+ error?: string;
38
+ }
39
+
40
+ const SETTLED_TASK_TTL_MS = 10 * 60_000;
41
+ const UNSETTLED_TASK_TTL_MS = 30 * 60_000;
42
+
43
+ const inlineTasks = new Map<string, AskAppInlineTaskEntry>();
44
+
45
+ function evictStaleInlineTasks(now: number): void {
46
+ for (const [taskId, entry] of inlineTasks) {
47
+ const ttlMs =
48
+ entry.settledAt != null ? SETTLED_TASK_TTL_MS : UNSETTLED_TASK_TTL_MS;
49
+ const anchor = entry.settledAt ?? entry.createdAt;
50
+ if (now - anchor > ttlMs) inlineTasks.delete(taskId);
51
+ }
52
+ }
53
+
54
+ function toSnapshot(
55
+ taskId: string,
56
+ entry: AskAppInlineTaskEntry,
57
+ ): AskAppInlineTaskSnapshot {
58
+ return {
59
+ taskId,
60
+ status: entry.status,
61
+ ...(entry.response !== undefined ? { response: entry.response } : {}),
62
+ ...(entry.error !== undefined ? { error: entry.error } : {}),
63
+ };
64
+ }
65
+
66
+ /**
67
+ * Start `askAgent(message)` under a fresh process-local taskId and wait up
68
+ * to `maxWaitMs` for it to settle. The map entry is written synchronously
69
+ * before the async work starts, so a poll racing this call can never see a
70
+ * missing taskId. Returns the settled snapshot when it finishes in time, or
71
+ * a `"working"` snapshot once `maxWaitMs` elapses — the caller can hand that
72
+ * taskId back to `getAskAppInlineTask` later to pick up the final result.
73
+ */
74
+ export async function startAskAppInlineTask(
75
+ askAgent: (message: string) => Promise<string>,
76
+ message: string,
77
+ maxWaitMs: number,
78
+ ): Promise<AskAppInlineTaskSnapshot> {
79
+ const now = Date.now();
80
+ evictStaleInlineTasks(now);
81
+
82
+ const taskId = globalThis.crypto.randomUUID();
83
+ const entry: AskAppInlineTaskEntry = { status: "working", createdAt: now };
84
+ inlineTasks.set(taskId, entry);
85
+
86
+ const settled = askAgent(message).then(
87
+ (response) => {
88
+ entry.status = "completed";
89
+ entry.response = response;
90
+ entry.settledAt = Date.now();
91
+ },
92
+ (err) => {
93
+ entry.status = "failed";
94
+ entry.error =
95
+ err instanceof Error
96
+ ? err.message
97
+ : String(err ?? "ask_app task failed.");
98
+ entry.settledAt = Date.now();
99
+ },
100
+ );
101
+
102
+ if (maxWaitMs > 0) {
103
+ await Promise.race([
104
+ settled,
105
+ new Promise<void>((resolve) => setTimeout(resolve, maxWaitMs)),
106
+ ]);
107
+ }
108
+
109
+ return toSnapshot(taskId, entry);
110
+ }
111
+
112
+ /**
113
+ * Look up a process-local inline task started by `startAskAppInlineTask`.
114
+ * Returns `undefined` when the id is unknown — never started here, already
115
+ * evicted, or (in a multi-instance deployment) started on a different
116
+ * instance. Callers should fall through to the normal A2A HTTP status path
117
+ * in that case.
118
+ */
119
+ export function getAskAppInlineTask(
120
+ taskId: string,
121
+ ): AskAppInlineTaskSnapshot | undefined {
122
+ evictStaleInlineTasks(Date.now());
123
+ const entry = inlineTasks.get(taskId);
124
+ return entry ? toSnapshot(taskId, entry) : undefined;
125
+ }
@@ -204,6 +204,35 @@ export interface MCPRequestMeta {
204
204
  inlineMcpApps?: boolean;
205
205
  }
206
206
 
207
+ const ASK_AGENT_DEFAULT_INLINE_WAIT_MS = 20_000;
208
+ const ASK_AGENT_MAX_INLINE_WAIT_MS = 25_000;
209
+
210
+ function boundedAskAgentWaitMs(raw: unknown): number {
211
+ if (raw == null || raw === "") return ASK_AGENT_DEFAULT_INLINE_WAIT_MS;
212
+ const parsed = Number(raw);
213
+ if (!Number.isFinite(parsed)) return ASK_AGENT_DEFAULT_INLINE_WAIT_MS;
214
+ return Math.max(
215
+ 0,
216
+ Math.min(ASK_AGENT_MAX_INLINE_WAIT_MS, Math.trunc(parsed)),
217
+ );
218
+ }
219
+
220
+ function isExplicitAsyncAskAgent(raw: unknown): boolean {
221
+ return raw === true || raw === "true" || raw === 1 || raw === "1";
222
+ }
223
+
224
+ function formatAskAgentResult(result: unknown): string {
225
+ if (typeof result === "string") return result;
226
+ if (result && typeof result === "object") {
227
+ const record = result as Record<string, unknown>;
228
+ if (record.status === "completed" && typeof record.response === "string") {
229
+ return record.response;
230
+ }
231
+ }
232
+ const serialized = JSON.stringify(result);
233
+ return serialized === undefined ? String(result) : serialized;
234
+ }
235
+
207
236
  /**
208
237
  * Deploy-toggleable kill switch for inline MCP App embeds — the `ui://`
209
238
  * resource reference hosts like Codex / Cursor / ChatGPT render in a sandboxed
@@ -1618,7 +1647,9 @@ export async function createMCPServerForRequest(
1618
1647
  description:
1619
1648
  "Send a natural-language message to the app's AI agent and get a response. " +
1620
1649
  "Use this for complex, multi-step tasks that require the agent's reasoning " +
1621
- "and full context about the app.",
1650
+ "and full context about the app. On hosted MCP, the server waits briefly " +
1651
+ "for fast completions and returns a taskId plus ask_app_status polling " +
1652
+ "instructions when the agent needs longer.",
1622
1653
  inputSchema: {
1623
1654
  type: "object" as const,
1624
1655
  properties: {
@@ -1626,6 +1657,16 @@ export async function createMCPServerForRequest(
1626
1657
  type: "string",
1627
1658
  description: "The message to send to the agent",
1628
1659
  },
1660
+ async: {
1661
+ type: "boolean",
1662
+ description:
1663
+ "Start a durable task and return immediately with a taskId.",
1664
+ },
1665
+ maxWaitMs: {
1666
+ type: "number",
1667
+ description:
1668
+ "Maximum inline wait in milliseconds. Hosted MCP clamps this to 25000ms.",
1669
+ },
1629
1670
  },
1630
1671
  required: ["message"],
1631
1672
  },
@@ -1668,8 +1709,29 @@ export async function createMCPServerForRequest(
1668
1709
  }
1669
1710
  const message = args?.message ?? "";
1670
1711
  try {
1671
- const result = await config.askAgent(message);
1672
- return { content: [{ type: "text", text: result }] };
1712
+ // Keep the legacy meta-tool compatible for local callers, but use
1713
+ // the same durable A2A submission path as ask_app whenever this is
1714
+ // an HTTP/hosted request. A full agent loop must never be held open
1715
+ // for minutes behind one MCP tools/call request. Always route
1716
+ // through ask_app's own run() — even with no request origin, since
1717
+ // it now bounds that case too via its process-local inline-task
1718
+ // fallback (ask-app-inline-tasks.ts) instead of us awaiting
1719
+ // config.askAgent() here unbounded. This is the shared helper: no
1720
+ // second task map to keep in sync.
1721
+ const hostedAskApp = getBuiltinCrossAppTools(
1722
+ config,
1723
+ requestMeta,
1724
+ ).ask_app;
1725
+ const result = await hostedAskApp.run({
1726
+ message,
1727
+ async: isExplicitAsyncAskAgent(args?.async),
1728
+ maxWaitMs: isExplicitAsyncAskAgent(args?.async)
1729
+ ? 0
1730
+ : boundedAskAgentWaitMs(args?.maxWaitMs),
1731
+ });
1732
+ return {
1733
+ content: [{ type: "text", text: formatAskAgentResult(result) }],
1734
+ };
1673
1735
  } catch (err: any) {
1674
1736
  return {
1675
1737
  content: [{ type: "text", text: `Error: ${err.message}` }],
@@ -88,14 +88,23 @@ const ASK_APP_TERMINAL_STATES = new Set<string>([
88
88
  "completed",
89
89
  "failed",
90
90
  "canceled",
91
+ "input-required",
91
92
  ]);
92
93
 
94
+ class AskAppInlineDeadlineError extends Error {
95
+ constructor() {
96
+ super("ask_app inline wait deadline reached");
97
+ this.name = "AskAppInlineDeadlineError";
98
+ }
99
+ }
100
+
93
101
  type AskAppRequestMeta = { origin?: string; basePath?: string };
94
102
 
95
103
  interface AskAppRoute {
96
104
  app: string;
97
105
  origin: string;
98
106
  routedVia: "local" | "a2a";
107
+ requestOrigin?: string;
99
108
  note?: string;
100
109
  }
101
110
 
@@ -106,7 +115,9 @@ interface AskAppTaskResult {
106
115
  status: string;
107
116
  response?: string;
108
117
  error?: string;
118
+ inputRequired?: string;
109
119
  note?: string;
120
+ pollAfterMs?: number;
110
121
  poll?: {
111
122
  tool: "ask_app_status";
112
123
  arguments: { app: string; taskId: string };
@@ -236,8 +247,20 @@ function askAppTaskResult(route: AskAppRoute, task: Task): AskAppTaskResult {
236
247
  };
237
248
  }
238
249
 
250
+ if (status === "input-required") {
251
+ const inputRequired =
252
+ response || "The agent needs additional input before it can continue.";
253
+ return {
254
+ ...base,
255
+ response: inputRequired,
256
+ inputRequired,
257
+ message: inputRequired,
258
+ };
259
+ }
260
+
239
261
  return {
240
262
  ...base,
263
+ pollAfterMs: ASK_APP_POLL_INTERVAL_MS,
241
264
  poll: {
242
265
  tool: "ask_app_status",
243
266
  arguments: { app: route.app, taskId: task.id },
@@ -248,7 +271,57 @@ function askAppTaskResult(route: AskAppRoute, task: Task): AskAppTaskResult {
248
271
  };
249
272
  }
250
273
 
251
- async function createA2AClientForAskApp(origin: string): Promise<{
274
+ /**
275
+ * Same shape as `askAppTaskResult`, but built from an in-process
276
+ * `ask-app-inline-tasks.ts` snapshot instead of an A2A `Task` — used by the
277
+ * no-origin fallback (no A2A task exists to describe). Kept field-for-field
278
+ * identical so `ask_app` / `ask_app_status` callers can't tell which backing
279
+ * store answered.
280
+ */
281
+ function askAppInlineTaskResult(
282
+ selfId: string,
283
+ taskId: string,
284
+ inline: {
285
+ status: "working" | "completed" | "failed";
286
+ response?: string;
287
+ error?: string;
288
+ },
289
+ note?: string,
290
+ ): AskAppTaskResult {
291
+ const base = {
292
+ app: selfId,
293
+ routedVia: "local" as const,
294
+ taskId,
295
+ status: inline.status,
296
+ ...(note ? { note } : {}),
297
+ };
298
+
299
+ if (inline.status === "completed") {
300
+ return { ...base, response: inline.response || "(no response)" };
301
+ }
302
+
303
+ if (inline.status === "failed") {
304
+ return { ...base, error: inline.error || "ask_app task failed." };
305
+ }
306
+
307
+ return {
308
+ ...base,
309
+ pollAfterMs: ASK_APP_POLL_INTERVAL_MS,
310
+ poll: {
311
+ tool: "ask_app_status",
312
+ arguments: { app: selfId, taskId },
313
+ },
314
+ message:
315
+ `ask_app is still ${inline.status}. Call ask_app_status with ` +
316
+ `taskId "${taskId}" to retrieve the final response.`,
317
+ };
318
+ }
319
+
320
+ async function createA2AClientForAskApp(
321
+ origin: string,
322
+ requestOrigin?: string,
323
+ deadline?: number,
324
+ ): Promise<{
252
325
  client: import("../a2a/client.js").A2AClient;
253
326
  metadata: Record<string, unknown>;
254
327
  }> {
@@ -258,9 +331,14 @@ async function createA2AClientForAskApp(origin: string): Promise<{
258
331
  const metadata: Record<string, unknown> = {};
259
332
  if (auth.userEmail) metadata.userEmail = auth.userEmail;
260
333
  if (auth.orgDomain) metadata.orgDomain = auth.orgDomain;
334
+ if (requestOrigin) metadata.requestOrigin = requestOrigin;
335
+ const remainingMs = deadline == null ? null : deadline - Date.now();
261
336
  return {
262
337
  client: new A2AClient(origin, auth.apiKey, {
263
- requestTimeoutMs: ASK_APP_A2A_REQUEST_TIMEOUT_MS,
338
+ requestTimeoutMs:
339
+ remainingMs == null
340
+ ? ASK_APP_A2A_REQUEST_TIMEOUT_MS
341
+ : Math.max(1, Math.min(ASK_APP_A2A_REQUEST_TIMEOUT_MS, remainingMs)),
264
342
  ...(auth.apiKeyFallbacks
265
343
  ? { fallbackApiKeys: auth.apiKeyFallbacks }
266
344
  : {}),
@@ -269,13 +347,35 @@ async function createA2AClientForAskApp(origin: string): Promise<{
269
347
  };
270
348
  }
271
349
 
350
+ async function runBeforeAskAppDeadline<T>(
351
+ operation: () => Promise<T>,
352
+ deadline: number,
353
+ ): Promise<T> {
354
+ const remainingMs = deadline - Date.now();
355
+ if (remainingMs <= 0) throw new AskAppInlineDeadlineError();
356
+
357
+ let timeout: ReturnType<typeof setTimeout> | undefined;
358
+ try {
359
+ return await Promise.race([
360
+ operation(),
361
+ new Promise<T>((_resolve, reject) => {
362
+ timeout = setTimeout(
363
+ () => reject(new AskAppInlineDeadlineError()),
364
+ remainingMs,
365
+ );
366
+ }),
367
+ ]);
368
+ } finally {
369
+ if (timeout) clearTimeout(timeout);
370
+ }
371
+ }
372
+
272
373
  async function waitForA2ATask(
273
374
  client: import("../a2a/client.js").A2AClient,
274
375
  initialTask: Task,
275
- maxWaitMs: number,
376
+ deadline: number | undefined,
276
377
  ): Promise<Task> {
277
- if (maxWaitMs <= 0 || isTerminalTask(initialTask)) return initialTask;
278
- const deadline = Date.now() + maxWaitMs;
378
+ if (deadline == null || isTerminalTask(initialTask)) return initialTask;
279
379
  let current = initialTask;
280
380
 
281
381
  while (!isTerminalTask(current)) {
@@ -284,13 +384,16 @@ async function waitForA2ATask(
284
384
  await new Promise((resolve) =>
285
385
  setTimeout(resolve, Math.min(ASK_APP_POLL_INTERVAL_MS, remaining)),
286
386
  );
387
+ if (Date.now() >= deadline) return current;
287
388
  try {
288
- current = await client.getTask(initialTask.id);
289
- } catch {
290
- // Transient status fetch failures should not turn a successfully
291
- // submitted durable task into a failed MCP call.
389
+ current = await runBeforeAskAppDeadline(
390
+ () => client.getTask(initialTask.id),
391
+ deadline,
392
+ );
393
+ } catch (err) {
394
+ if (err instanceof AskAppInlineDeadlineError) return current;
395
+ if (!isTransientAskAppStatusError(err)) throw err;
292
396
  if (Date.now() >= deadline) return current;
293
- continue;
294
397
  }
295
398
  }
296
399
 
@@ -302,7 +405,12 @@ async function submitAskAppA2ATask(
302
405
  message: string,
303
406
  maxWaitMs: number,
304
407
  ): Promise<AskAppTaskResult> {
305
- const { client, metadata } = await createA2AClientForAskApp(route.origin);
408
+ const deadline = maxWaitMs > 0 ? Date.now() + maxWaitMs : undefined;
409
+ const { client, metadata } = await createA2AClientForAskApp(
410
+ route.origin,
411
+ route.requestOrigin,
412
+ deadline,
413
+ );
306
414
  const task = await client.send(
307
415
  {
308
416
  role: "user",
@@ -313,7 +421,7 @@ async function submitAskAppA2ATask(
313
421
  metadata,
314
422
  },
315
423
  );
316
- const finalOrRunning = await waitForA2ATask(client, task, maxWaitMs);
424
+ const finalOrRunning = await waitForA2ATask(client, task, deadline);
317
425
  return askAppTaskResult(route, finalOrRunning);
318
426
  }
319
427
 
@@ -778,13 +886,22 @@ async function routeAskOverA2A(
778
886
  origin: string,
779
887
  id: string,
780
888
  message: string,
781
- options?: { durable?: boolean; maxWaitMs?: number },
889
+ options?: {
890
+ durable?: boolean;
891
+ maxWaitMs?: number;
892
+ requestOrigin?: string;
893
+ },
782
894
  ): Promise<
783
895
  { app: string; routedVia: "a2a"; response: string } | AskAppTaskResult
784
896
  > {
785
897
  if (options?.durable) {
786
898
  return submitAskAppA2ATask(
787
- { app: id, origin: agentNativeA2AEndpoint(origin), routedVia: "a2a" },
899
+ {
900
+ app: id,
901
+ origin: agentNativeA2AEndpoint(origin),
902
+ routedVia: "a2a",
903
+ requestOrigin: options.requestOrigin ?? origin,
904
+ },
788
905
  message,
789
906
  options.maxWaitMs ?? ASK_APP_DEFAULT_INLINE_WAIT_MS,
790
907
  );
@@ -801,6 +918,7 @@ async function routeAskOverA2A(
801
918
  userEmail: auth.userEmail,
802
919
  orgDomain: auth.orgDomain,
803
920
  orgSecret: auth.orgSecret,
921
+ requestOrigin: options?.requestOrigin,
804
922
  // Bound the wait — cross-app A2A polls async by default.
805
923
  timeoutMs: 5 * 60_000,
806
924
  });
@@ -822,7 +940,12 @@ async function resolveAskAppStatusRoute(
822
940
  "ask_app_status requires a running app origin for local tasks.",
823
941
  );
824
942
  }
825
- return { app: selfId, origin: selfEndpointUrl, routedVia: "local" };
943
+ return {
944
+ app: selfId,
945
+ origin: selfEndpointUrl,
946
+ routedVia: "local",
947
+ requestOrigin: requestMeta?.origin,
948
+ };
826
949
  }
827
950
 
828
951
  const targetApp = await resolveTargetAppOrigin(config, requestedApp);
@@ -831,6 +954,7 @@ async function resolveAskAppStatusRoute(
831
954
  app: targetApp.id,
832
955
  origin: agentNativeA2AEndpoint(targetApp.origin),
833
956
  routedVia: "a2a",
957
+ requestOrigin: targetApp.origin,
834
958
  };
835
959
  }
836
960
 
@@ -841,6 +965,7 @@ async function resolveAskAppStatusRoute(
841
965
  app: dirMatch.id,
842
966
  origin: agentNativeA2AEndpoint(dirMatch.a2aUrl),
843
967
  routedVia: "a2a",
968
+ requestOrigin: dirMatch.url,
844
969
  };
845
970
  }
846
971
 
@@ -914,6 +1039,7 @@ function askAppTool(
914
1039
  {
915
1040
  durable: useDurableA2A,
916
1041
  maxWaitMs,
1042
+ requestOrigin: targetApp.origin,
917
1043
  },
918
1044
  );
919
1045
  } catch (err: any) {
@@ -947,6 +1073,7 @@ function askAppTool(
947
1073
  {
948
1074
  durable: useDurableA2A,
949
1075
  maxWaitMs,
1076
+ requestOrigin: dirMatch.url,
950
1077
  },
951
1078
  );
952
1079
  } catch (err: any) {
@@ -988,6 +1115,7 @@ function askAppTool(
988
1115
  app: selfId,
989
1116
  origin: localA2AEndpointUrl,
990
1117
  routedVia: "local",
1118
+ requestOrigin: requestMeta?.origin,
991
1119
  ...(note ? { note } : {}),
992
1120
  },
993
1121
  message,
@@ -995,13 +1123,35 @@ function askAppTool(
995
1123
  );
996
1124
  }
997
1125
 
998
- const response = await config.askAgent(message);
999
- return {
1000
- app: selfId,
1001
- routedVia: "local",
1002
- ...(note ? { note } : {}),
1003
- response,
1004
- };
1126
+ // No derivable app origin at all (e.g. stdio / no request context)
1127
+ // there is no `/_agent-native/a2a` endpoint to submit a durable task
1128
+ // to either. Bound the wait against a process-local task map instead
1129
+ // of awaiting config.askAgent() unbounded, so a slow agent run can't
1130
+ // hold this MCP call open indefinitely. Settling in time keeps the
1131
+ // original response shape; timing out returns the same still-working
1132
+ // poll payload the A2A path would, using the same taskId contract
1133
+ // (see ask-app-inline-tasks.ts).
1134
+ const { startAskAppInlineTask } =
1135
+ await import("./ask-app-inline-tasks.js");
1136
+ const inline = await startAskAppInlineTask(
1137
+ config.askAgent,
1138
+ message,
1139
+ maxWaitMs,
1140
+ );
1141
+ if (inline.status === "completed") {
1142
+ return {
1143
+ app: selfId,
1144
+ routedVia: "local",
1145
+ ...(note ? { note } : {}),
1146
+ response: inline.response || "(no response)",
1147
+ };
1148
+ }
1149
+ if (inline.status === "failed") {
1150
+ // Settled with an error inside the bounded wait — surface it the
1151
+ // same way the old unbounded `await config.askAgent(message)` did.
1152
+ throw new Error(inline.error || "ask_app task failed.");
1153
+ }
1154
+ return askAppInlineTaskResult(selfId, inline.taskId, inline, note);
1005
1155
  },
1006
1156
  };
1007
1157
  }
@@ -1031,6 +1181,20 @@ function askAppStatusTool(
1031
1181
  run: async (args: Record<string, any>) => {
1032
1182
  const taskId = String(args.taskId ?? "").trim();
1033
1183
  if (!taskId) throw new Error("ask_app_status requires 'taskId'.");
1184
+
1185
+ // The no-derivable-origin ask_app fallback tracks its tasks in a
1186
+ // process-local map, not the durable A2A store. Check it FIRST —
1187
+ // before any origin requirement — so a taskId minted by that fallback
1188
+ // never has to satisfy `resolveAskAppStatusRoute`'s "running app
1189
+ // origin" check. Falls through to the normal A2A route when the id
1190
+ // isn't one of these (never started here, evicted, or an ordinary A2A
1191
+ // task id).
1192
+ const { getAskAppInlineTask } = await import("./ask-app-inline-tasks.js");
1193
+ const inline = getAskAppInlineTask(taskId);
1194
+ if (inline) {
1195
+ return askAppInlineTaskResult(currentAppId(config), taskId, inline);
1196
+ }
1197
+
1034
1198
  const requestedApp = String(args.app ?? "").trim();
1035
1199
  const route = await resolveAskAppStatusRoute(
1036
1200
  config,