@agent-native/core 0.141.6 → 0.144.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 (501) hide show
  1. package/agent-native.eject.json +9 -0
  2. package/corpus/README.md +1 -1
  3. package/corpus/templates/analytics/.agents/skills/dashboard-management/SKILL.md +3 -14
  4. package/corpus/templates/analytics/.agents/skills/data-querying/SKILL.md +11 -6
  5. package/corpus/templates/analytics/.agents/skills/prometheus/SKILL.md +5 -5
  6. package/corpus/templates/analytics/.agents/skills/provider-api/SKILL.md +19 -0
  7. package/corpus/templates/analytics/.agents/skills/turn-into-app/SKILL.md +296 -0
  8. package/corpus/templates/analytics/.agents/skills/turn-into-app/agents/openai.yaml +4 -0
  9. package/corpus/templates/analytics/.agents/skills/turn-into-skill/SKILL.md +112 -0
  10. package/corpus/templates/analytics/.agents/skills/turn-into-skill/agents/openai.yaml +4 -0
  11. package/corpus/templates/analytics/AGENTS.md +37 -40
  12. package/corpus/templates/analytics/actions/compose-dashboard.ts +1 -1
  13. package/corpus/templates/analytics/actions/ensure-native-v2-dashboards.ts +1 -1
  14. package/corpus/templates/analytics/actions/list-dashboard-usage-stats.ts +17 -22
  15. package/corpus/templates/analytics/actions/migrate-first-party-analytics-to-bigquery.ts +135 -0
  16. package/corpus/templates/analytics/actions/navigate.ts +5 -6
  17. package/corpus/templates/analytics/actions/provider-api-register.ts +50 -0
  18. package/corpus/templates/analytics/actions/query-agent-native-analytics.ts +46 -13
  19. package/corpus/templates/analytics/actions/test-custom-api-connection.ts +106 -0
  20. package/corpus/templates/analytics/actions/update-dashboard.ts +0 -1
  21. package/corpus/templates/analytics/actions/view-screen.ts +0 -20
  22. package/corpus/templates/analytics/app/components/CustomApiCard.tsx +430 -0
  23. package/corpus/templates/analytics/app/components/layout/Header.tsx +0 -1
  24. package/corpus/templates/analytics/app/hooks/use-navigation-state.ts +5 -5
  25. package/corpus/templates/analytics/app/i18n-data.ts +682 -90
  26. package/corpus/templates/analytics/app/lib/native-mcp-exclusions.ts +6 -0
  27. package/corpus/templates/analytics/app/lib/sql-query.ts +33 -6
  28. package/corpus/templates/analytics/app/pages/Agents.tsx +0 -3
  29. package/corpus/templates/analytics/app/pages/DataSources.tsx +4 -0
  30. package/corpus/templates/analytics/app/pages/Settings.tsx +22 -43
  31. package/corpus/templates/analytics/app/pages/settings/settings-search.ts +23 -20
  32. package/corpus/templates/analytics/app/routes/extensions._index.tsx +1 -1
  33. package/corpus/templates/analytics/app/routes/settings.$.tsx +1 -0
  34. package/corpus/templates/analytics/app/routes/team.tsx +1 -1
  35. package/corpus/templates/analytics/changelog/2026-08-05-settings-no-longer-includes-an-unnecessary-about-section.md +6 -0
  36. package/corpus/templates/analytics/changelog/2026-08-06-analytics-dashboards-load-reliably-during-background-data-sw.md +6 -0
  37. package/corpus/templates/analytics/changelog/2026-08-06-analytics-dashboards-remain-responsive-while-historical-data.md +6 -0
  38. package/corpus/templates/analytics/changelog/2026-08-06-analytics-query-results-now-render-as-a-table-with-csv-downl.md +6 -0
  39. package/corpus/templates/analytics/changelog/2026-08-06-connect-public-https-custom-apis-and-hand-tested-endpoints-t.md +6 -0
  40. package/corpus/templates/analytics/changelog/2026-08-06-durable-agent-worker-memory.md +6 -0
  41. package/corpus/templates/analytics/changelog/2026-08-06-live-dashboard-panels-use-the-shared-query-timeout.md +6 -0
  42. package/corpus/templates/analytics/changelog/2026-08-06-on-demand-billing-is-available-as-a-native-dashboard-with-ta.md +6 -0
  43. package/corpus/templates/analytics/changelog/2026-08-06-visible-dashboard-names-are-unique.md +6 -0
  44. package/corpus/templates/analytics/docs/schemas/first-party-analytics.md +1 -1
  45. package/corpus/templates/analytics/netlify.toml +7 -0
  46. package/corpus/templates/analytics/scripts/emit-netlify-dashboard-report-cron.ts +4 -0
  47. package/corpus/templates/analytics/scripts/first-party-analytics-bigquery.sql +104 -0
  48. package/corpus/templates/analytics/server/db/index.ts +27 -0
  49. package/corpus/templates/analytics/server/db/schema.ts +10 -0
  50. package/corpus/templates/analytics/server/lib/agent-chat-plan-mode.ts +0 -2
  51. package/corpus/templates/analytics/server/lib/dashboards-store.ts +227 -60
  52. package/corpus/templates/analytics/server/lib/first-party-analytics-backend.ts +1147 -0
  53. package/corpus/templates/analytics/server/lib/first-party-analytics-health.ts +34 -15
  54. package/corpus/templates/analytics/server/lib/first-party-analytics.ts +57 -4
  55. package/corpus/templates/analytics/server/lib/native-v2-dashboards.ts +227 -1
  56. package/corpus/templates/analytics/server/lib/real-data-actions.ts +1 -3
  57. package/corpus/templates/analytics/server/plugins/agent-chat.ts +7 -4
  58. package/corpus/templates/analytics/server/plugins/analytics-rollup-backfill-jobs.ts +1 -0
  59. package/corpus/templates/analytics/server/plugins/db.ts +52 -18
  60. package/corpus/templates/assets/.agents/skills/asset-generation/SKILL.md +36 -8
  61. package/corpus/templates/assets/.agents/skills/image-generation/SKILL.md +16 -1
  62. package/corpus/templates/assets/.agents/skills/library-management/SKILL.md +16 -1
  63. package/corpus/templates/assets/.agents/skills/turn-into-app/SKILL.md +296 -0
  64. package/corpus/templates/assets/.agents/skills/turn-into-app/agents/openai.yaml +4 -0
  65. package/corpus/templates/assets/.agents/skills/turn-into-skill/SKILL.md +112 -0
  66. package/corpus/templates/assets/.agents/skills/turn-into-skill/agents/openai.yaml +4 -0
  67. package/corpus/templates/assets/AGENTS.md +1 -0
  68. package/corpus/templates/assets/actions/_helpers.ts +12 -0
  69. package/corpus/templates/assets/actions/generate-image.ts +9 -3
  70. package/corpus/templates/assets/actions/import-style-from-url.ts +115 -0
  71. package/corpus/templates/assets/app/hooks/use-navigation-state.ts +3 -1
  72. package/corpus/templates/assets/app/routes/extensions._index.tsx +1 -1
  73. package/corpus/templates/assets/app/routes/settings.$.tsx +1 -0
  74. package/corpus/templates/assets/app/routes/settings.tsx +5 -0
  75. package/corpus/templates/assets/app/routes/team.tsx +1 -1
  76. package/corpus/templates/assets/changelog/2026-08-05-brand-kits-can-import-a-website-s-hydrated-visual-language-a.md +6 -0
  77. package/corpus/templates/assets/changelog/2026-08-05-generated-images-now-hand-off-embeddable-previews-to-other-w.md +6 -0
  78. package/corpus/templates/assets/server/lib/generation.ts +58 -0
  79. package/corpus/templates/assets/shared/api.ts +12 -0
  80. package/corpus/templates/brain/.agents/skills/turn-into-app/SKILL.md +296 -0
  81. package/corpus/templates/brain/.agents/skills/turn-into-app/agents/openai.yaml +4 -0
  82. package/corpus/templates/brain/.agents/skills/turn-into-skill/SKILL.md +112 -0
  83. package/corpus/templates/brain/.agents/skills/turn-into-skill/agents/openai.yaml +4 -0
  84. package/corpus/templates/brain/actions/list-connection-providers.ts +24 -3
  85. package/corpus/templates/brain/app/lib/dispatch-links.ts +44 -0
  86. package/corpus/templates/brain/app/routes/extensions._index.tsx +1 -1
  87. package/corpus/templates/brain/app/routes/sources.tsx +15 -7
  88. package/corpus/templates/brain/app/routes/team.tsx +1 -1
  89. package/corpus/templates/brain/app/routes.ts +1 -1
  90. package/corpus/templates/brain/changelog/2026-08-06-brain-provider-setup-links-open-dispatch-correctly-in-standa.md +6 -0
  91. package/corpus/templates/brain/server/plugins/agent-chat.ts +1 -0
  92. package/corpus/templates/calendar/.agents/skills/event-management/SKILL.md +26 -0
  93. package/corpus/templates/calendar/.agents/skills/turn-into-app/SKILL.md +296 -0
  94. package/corpus/templates/calendar/.agents/skills/turn-into-app/agents/openai.yaml +4 -0
  95. package/corpus/templates/calendar/.agents/skills/turn-into-skill/SKILL.md +112 -0
  96. package/corpus/templates/calendar/.agents/skills/turn-into-skill/agents/openai.yaml +4 -0
  97. package/corpus/templates/calendar/AGENTS.md +11 -32
  98. package/corpus/templates/calendar/actions/update-event.ts +107 -1
  99. package/corpus/templates/calendar/app/components/calendar/EventCalendarSelect.tsx +83 -0
  100. package/corpus/templates/calendar/app/components/calendar/EventDetailPanel.tsx +57 -0
  101. package/corpus/templates/calendar/app/components/calendar/EventDetailPopover.tsx +59 -73
  102. package/corpus/templates/calendar/app/components/layout/AppLayout.tsx +3 -1
  103. package/corpus/templates/calendar/app/hooks/use-events.ts +4 -1
  104. package/corpus/templates/calendar/app/i18n-data.ts +20 -0
  105. package/corpus/templates/calendar/app/routes/_app.extensions._index.tsx +1 -1
  106. package/corpus/templates/calendar/app/routes/_app.settings.$.tsx +1 -0
  107. package/corpus/templates/calendar/app/routes/_app.team.tsx +1 -1
  108. package/corpus/templates/calendar/changelog/2026-08-06-delegated-requests-continue-in-the-background.md +6 -0
  109. package/corpus/templates/calendar/changelog/2026-08-06-existing-events-can-move-between-connected-google-account-ca.md +6 -0
  110. package/corpus/templates/calendar/server/lib/google-calendar.ts +101 -0
  111. package/corpus/templates/calendar/server/plugins/agent-chat.ts +7 -1
  112. package/corpus/templates/chat/.agents/skills/turn-into-app/SKILL.md +296 -0
  113. package/corpus/templates/chat/.agents/skills/turn-into-app/agents/openai.yaml +4 -0
  114. package/corpus/templates/chat/.agents/skills/turn-into-skill/SKILL.md +112 -0
  115. package/corpus/templates/chat/.agents/skills/turn-into-skill/agents/openai.yaml +4 -0
  116. package/corpus/templates/chat/app/components/layout/Layout.tsx +1 -1
  117. package/corpus/templates/chat/app/hooks/use-navigation-state.ts +1 -1
  118. package/corpus/templates/chat/app/root.tsx +1 -1
  119. package/corpus/templates/chat/app/routes/agent.tsx +7 -7
  120. package/corpus/templates/chat/app/routes/extensions._index.tsx +1 -1
  121. package/corpus/templates/chat/app/routes/settings.$.tsx +1 -0
  122. package/corpus/templates/chat/app/routes/team.tsx +1 -1
  123. package/corpus/templates/clips/.agents/skills/turn-into-app/SKILL.md +296 -0
  124. package/corpus/templates/clips/.agents/skills/turn-into-app/agents/openai.yaml +4 -0
  125. package/corpus/templates/clips/.agents/skills/turn-into-skill/SKILL.md +112 -0
  126. package/corpus/templates/clips/.agents/skills/turn-into-skill/agents/openai.yaml +4 -0
  127. package/corpus/templates/clips/app/components/editor/editor-layout.tsx +9 -24
  128. package/corpus/templates/clips/app/components/editor/timeline-geometry.ts +15 -0
  129. package/corpus/templates/clips/app/components/editor/waveform.tsx +4 -17
  130. package/corpus/templates/clips/app/components/library/library-layout.tsx +1 -1
  131. package/corpus/templates/clips/app/components/player/delete-recording-menu.tsx +14 -3
  132. package/corpus/templates/clips/app/components/player/transcript-panel.tsx +1 -1
  133. package/corpus/templates/clips/app/components/recorder/storage-setup-card.tsx +1 -1
  134. package/corpus/templates/clips/app/routes/_app.extensions._index.tsx +1 -1
  135. package/corpus/templates/clips/app/routes/_app.settings.$.tsx +1 -0
  136. package/corpus/templates/clips/app/routes/r.$recordingId.tsx +28 -38
  137. package/corpus/templates/clips/app/routes/share.$shareId.tsx +21 -27
  138. package/corpus/templates/clips/changelog/2026-08-06-clips-recovers-from-stalled-recording-setup-without-requirin.md +6 -0
  139. package/corpus/templates/clips/changelog/2026-08-06-clips-starts-faster-after-a-deploy-or-idle-period-startup-no.md +6 -0
  140. package/corpus/templates/clips/changelog/2026-08-06-deleting-a-recording-returns-cleanly-to-the-library-and-fit-.md +6 -0
  141. package/corpus/templates/clips/changelog/2026-08-06-hide-clip-insights-from-viewers-without-analytics-access.md +6 -0
  142. package/corpus/templates/clips/desktop/src/app.tsx +48 -20
  143. package/corpus/templates/clips/desktop/src/lib/recorder.ts +275 -74
  144. package/corpus/templates/clips/desktop/src/lib/recording-start-guard.ts +84 -0
  145. package/corpus/templates/clips/desktop/src/overlays/toolbar.tsx +14 -4
  146. package/corpus/templates/clips/server/plugins/db.ts +214 -26
  147. package/corpus/templates/content/.agents/skills/turn-into-app/SKILL.md +296 -0
  148. package/corpus/templates/content/.agents/skills/turn-into-app/agents/openai.yaml +4 -0
  149. package/corpus/templates/content/.agents/skills/turn-into-skill/SKILL.md +112 -0
  150. package/corpus/templates/content/.agents/skills/turn-into-skill/agents/openai.yaml +4 -0
  151. package/corpus/templates/content/app/routes/_app.extensions._index.tsx +1 -1
  152. package/corpus/templates/content/app/routes/_app.settings.$.tsx +1 -0
  153. package/corpus/templates/content/app/routes/_app.team.tsx +1 -1
  154. package/corpus/templates/content/e2e/global-setup.ts +1 -1
  155. package/corpus/templates/crm/.agents/skills/turn-into-app/SKILL.md +296 -0
  156. package/corpus/templates/crm/.agents/skills/turn-into-app/agents/openai.yaml +4 -0
  157. package/corpus/templates/crm/.agents/skills/turn-into-skill/SKILL.md +112 -0
  158. package/corpus/templates/crm/.agents/skills/turn-into-skill/agents/openai.yaml +4 -0
  159. package/corpus/templates/crm/changelog/2026-08-06-crm-starts-faster-after-a-deploy-or-idle-period-one-time-dat.md +6 -0
  160. package/corpus/templates/crm/server/plugins/db.ts +11 -8
  161. package/corpus/templates/design/.agents/skills/design-generation/SKILL.md +36 -1
  162. package/corpus/templates/design/.agents/skills/design-systems/SKILL.md +6 -1
  163. package/corpus/templates/design/.agents/skills/turn-into-app/SKILL.md +296 -0
  164. package/corpus/templates/design/.agents/skills/turn-into-app/agents/openai.yaml +4 -0
  165. package/corpus/templates/design/.agents/skills/turn-into-skill/SKILL.md +112 -0
  166. package/corpus/templates/design/.agents/skills/turn-into-skill/agents/openai.yaml +4 -0
  167. package/corpus/templates/design/actions/analyze-brand-assets.ts +7 -7
  168. package/corpus/templates/design/actions/import-from-url.ts +6 -5
  169. package/corpus/templates/design/app/components/design/LayersPanel.tsx +27 -18
  170. package/corpus/templates/design/app/pages/DesignSystemSetup.tsx +2 -2
  171. package/corpus/templates/design/app/pages/Index.tsx +6 -2
  172. package/corpus/templates/design/app/routes/extensions._index.tsx +1 -1
  173. package/corpus/templates/design/app/routes/settings.$.tsx +1 -0
  174. package/corpus/templates/design/app/routes/team.tsx +1 -1
  175. package/corpus/templates/design/changelog/2026-08-05-deleting-a-design-from-the-home-page-no-longer-leaves-the-ap.md +6 -0
  176. package/corpus/templates/design/changelog/2026-08-05-renaming-a-layer-now-focuses-its-name-field-automatically.md +6 -0
  177. package/corpus/templates/design/changelog/2026-08-05-website-url-imports-now-capture-hydrated-browser-computed-de.md +6 -0
  178. package/corpus/templates/design/e2e/global-setup.ts +1 -1
  179. package/corpus/templates/design/server/plugins/agent-chat.ts +2 -0
  180. package/corpus/templates/dispatch/.agents/skills/turn-into-app/SKILL.md +296 -0
  181. package/corpus/templates/dispatch/.agents/skills/turn-into-app/agents/openai.yaml +4 -0
  182. package/corpus/templates/dispatch/.agents/skills/turn-into-skill/SKILL.md +112 -0
  183. package/corpus/templates/dispatch/.agents/skills/turn-into-skill/agents/openai.yaml +4 -0
  184. package/corpus/templates/dispatch/app/hooks/use-navigation-state.ts +1 -1
  185. package/corpus/templates/dispatch/app/routes/settings.$.tsx +1 -0
  186. package/corpus/templates/dispatch/app/routes/team.tsx +1 -1
  187. package/corpus/templates/dispatch/changelog/2026-08-06-ready-workspace-apps-stay-one-click-away-in-a-compact-dispat.md +6 -0
  188. package/corpus/templates/dispatch/changelog/2026-08-06-shared-vault-values-and-management-are-now-restricted-to-wor.md +6 -0
  189. package/corpus/templates/factory/.agents/skills/turn-into-app/SKILL.md +296 -0
  190. package/corpus/templates/factory/.agents/skills/turn-into-app/agents/openai.yaml +4 -0
  191. package/corpus/templates/factory/.agents/skills/turn-into-skill/SKILL.md +112 -0
  192. package/corpus/templates/factory/.agents/skills/turn-into-skill/agents/openai.yaml +4 -0
  193. package/corpus/templates/factory/app/hooks/use-navigation-state.ts +1 -1
  194. package/corpus/templates/factory/app/routes/extensions._index.tsx +1 -1
  195. package/corpus/templates/factory/app/routes/settings.$.tsx +1 -0
  196. package/corpus/templates/factory/app/routes/team.tsx +1 -1
  197. package/corpus/templates/forms/.agents/skills/turn-into-app/SKILL.md +296 -0
  198. package/corpus/templates/forms/.agents/skills/turn-into-app/agents/openai.yaml +4 -0
  199. package/corpus/templates/forms/.agents/skills/turn-into-skill/SKILL.md +112 -0
  200. package/corpus/templates/forms/.agents/skills/turn-into-skill/agents/openai.yaml +4 -0
  201. package/corpus/templates/forms/app/routes/_app.extensions._index.tsx +1 -1
  202. package/corpus/templates/forms/app/routes/_app.settings.$.tsx +1 -0
  203. package/corpus/templates/forms/app/routes/_app.team.tsx +1 -1
  204. package/corpus/templates/forms/changelog/2026-08-06-delegated-requests-continue-in-the-background.md +6 -0
  205. package/corpus/templates/forms/server/plugins/agent-chat.ts +4 -0
  206. package/corpus/templates/forms/shared/navigation.ts +1 -1
  207. package/corpus/templates/macros/.agents/skills/turn-into-app/SKILL.md +296 -0
  208. package/corpus/templates/macros/.agents/skills/turn-into-app/agents/openai.yaml +4 -0
  209. package/corpus/templates/macros/.agents/skills/turn-into-skill/SKILL.md +112 -0
  210. package/corpus/templates/macros/.agents/skills/turn-into-skill/agents/openai.yaml +4 -0
  211. package/corpus/templates/macros/app/routes/extensions._index.tsx +1 -1
  212. package/corpus/templates/macros/app/routes/settings.$.tsx +1 -0
  213. package/corpus/templates/macros/app/routes/team.tsx +1 -1
  214. package/corpus/templates/mail/.agents/skills/turn-into-app/SKILL.md +296 -0
  215. package/corpus/templates/mail/.agents/skills/turn-into-app/agents/openai.yaml +4 -0
  216. package/corpus/templates/mail/.agents/skills/turn-into-skill/SKILL.md +112 -0
  217. package/corpus/templates/mail/.agents/skills/turn-into-skill/agents/openai.yaml +4 -0
  218. package/corpus/templates/mail/app/routes/extensions._index.tsx +1 -1
  219. package/corpus/templates/mail/app/routes/settings.$.tsx +1 -0
  220. package/corpus/templates/mail/changelog/2026-08-06-delegated-requests-continue-in-the-background.md +6 -0
  221. package/corpus/templates/mail/server/plugins/agent-chat.ts +6 -0
  222. package/corpus/templates/plan/.agents/skills/turn-into-app/SKILL.md +296 -0
  223. package/corpus/templates/plan/.agents/skills/turn-into-app/agents/openai.yaml +4 -0
  224. package/corpus/templates/plan/.agents/skills/turn-into-skill/SKILL.md +112 -0
  225. package/corpus/templates/plan/.agents/skills/turn-into-skill/agents/openai.yaml +4 -0
  226. package/corpus/templates/plan/app/hooks/use-navigation-state.ts +1 -1
  227. package/corpus/templates/plan/app/routes/extensions._index.tsx +1 -1
  228. package/corpus/templates/plan/app/routes/settings.$.tsx +1 -0
  229. package/corpus/templates/plan/app/routes/team.tsx +1 -1
  230. package/corpus/templates/slides/.agents/skills/create-deck/SKILL.md +48 -5
  231. package/corpus/templates/slides/.agents/skills/design-systems/SKILL.md +40 -2
  232. package/corpus/templates/slides/.agents/skills/image-generation-via-a2a/SKILL.md +6 -0
  233. package/corpus/templates/slides/.agents/skills/slide-editing/SKILL.md +15 -2
  234. package/corpus/templates/slides/.agents/skills/slide-images/SKILL.md +29 -24
  235. package/corpus/templates/slides/.agents/skills/turn-into-app/SKILL.md +296 -0
  236. package/corpus/templates/slides/.agents/skills/turn-into-app/agents/openai.yaml +4 -0
  237. package/corpus/templates/slides/.agents/skills/turn-into-skill/SKILL.md +112 -0
  238. package/corpus/templates/slides/.agents/skills/turn-into-skill/agents/openai.yaml +4 -0
  239. package/corpus/templates/slides/AGENTS.md +7 -9
  240. package/corpus/templates/slides/_gitignore +1 -0
  241. package/corpus/templates/slides/actions/analyze-brand-assets.ts +7 -7
  242. package/corpus/templates/slides/actions/export-pptx.ts +402 -36
  243. package/corpus/templates/slides/actions/import-file.ts +46 -85
  244. package/corpus/templates/slides/actions/import-from-url.ts +6 -6
  245. package/corpus/templates/slides/actions/import-google-slides-reference.ts +271 -12
  246. package/corpus/templates/slides/actions/import-pptx.ts +85 -60
  247. package/corpus/templates/slides/app/components/deck/DeckCard.tsx +10 -13
  248. package/corpus/templates/slides/app/components/design-system/DesignSystemSetup.tsx +1 -1
  249. package/corpus/templates/slides/app/components/editor/AddSlidePopover.tsx +5 -1
  250. package/corpus/templates/slides/app/components/editor/EditorToolbar.tsx +25 -12
  251. package/corpus/templates/slides/app/components/editor/ExportMenu.tsx +112 -57
  252. package/corpus/templates/slides/app/components/editor/GoogleDriveConnectionCta.tsx +202 -0
  253. package/corpus/templates/slides/app/components/editor/GoogleSlidesReferenceImport.tsx +26 -14
  254. package/corpus/templates/slides/app/components/editor/PromptDialog.tsx +176 -0
  255. package/corpus/templates/slides/app/components/editor/SlideEditor.tsx +182 -141
  256. package/corpus/templates/slides/app/components/editor/canvas-interactions/index.ts +1 -0
  257. package/corpus/templates/slides/app/components/editor/canvas-interactions/slides-canvas-adapter.ts +18 -0
  258. package/corpus/templates/slides/app/components/editor/slide-text-targets.ts +85 -0
  259. package/corpus/templates/slides/app/components/layout/Layout.tsx +3 -0
  260. package/corpus/templates/slides/app/components/onboarding/FirstDeckOnboardingFlow.tsx +13 -3
  261. package/corpus/templates/slides/app/components/presentation/PresentationView.tsx +27 -1
  262. package/corpus/templates/slides/app/context/DeckContext.tsx +71 -20
  263. package/corpus/templates/slides/app/global.css +6 -0
  264. package/corpus/templates/slides/app/i18n/en-US.ts +1 -0
  265. package/corpus/templates/slides/app/lib/create-deck-generation.ts +10 -6
  266. package/corpus/templates/slides/app/lib/deck-preview-frame.ts +15 -0
  267. package/corpus/templates/slides/app/lib/deck-share-links.ts +9 -0
  268. package/corpus/templates/slides/app/lib/export-pptx-client.ts +89 -0
  269. package/corpus/templates/slides/app/lib/slide-animation-elements.ts +3 -0
  270. package/corpus/templates/slides/app/pages/DeckEditor.tsx +17 -0
  271. package/corpus/templates/slides/app/pages/Index.tsx +107 -6
  272. package/corpus/templates/slides/app/routes/extensions._index.tsx +1 -1
  273. package/corpus/templates/slides/app/routes/settings.$.tsx +1 -0
  274. package/corpus/templates/slides/app/routes/team.tsx +1 -1
  275. package/corpus/templates/slides/changelog/2026-08-05-failed-deck-creation-and-reference-uploads-now-recover-clean.md +6 -0
  276. package/corpus/templates/slides/changelog/2026-08-05-slides-recover-completed-generation-results-after-a-sync-hic.md +6 -0
  277. package/corpus/templates/slides/changelog/2026-08-05-website-url-imports-now-capture-hydrated-browser-computed-st.md +6 -0
  278. package/corpus/templates/slides/changelog/2026-08-06-clicking-the-gray-canvas-around-a-slide-clears-its-selection.md +6 -0
  279. package/corpus/templates/slides/changelog/2026-08-06-deck-thumbnails-keep-a-consistent-listing-frame-across-aspec.md +6 -0
  280. package/corpus/templates/slides/changelog/2026-08-06-deep-linked-decks-open-directly-instead-of-being-interrupted.md +6 -0
  281. package/corpus/templates/slides/changelog/2026-08-06-google-slides-exports-now-show-clear-import-steps-when-direc.md +6 -0
  282. package/corpus/templates/slides/changelog/2026-08-06-import-pdf-google-slides-and-powerpoint-decks-directly-from-.md +6 -0
  283. package/corpus/templates/slides/changelog/2026-08-06-imported-powerpoint-exports-keep-text-and-images-editable-an.md +6 -0
  284. package/corpus/templates/slides/changelog/2026-08-06-presentation-prompts-continue-adding-rendered-slides-until-t.md +6 -0
  285. package/corpus/templates/slides/changelog/2026-08-06-public-decks-now-share-read-only-presentation-links-by-defau.md +6 -0
  286. package/corpus/templates/slides/changelog/2026-08-06-slides-offers-a-direct-connect-google-button-when-a-drive-co.md +6 -0
  287. package/corpus/templates/slides/changelog/2026-08-06-slides-preserve-uploaded-pdf-layouts-accept-larger-reference.md +6 -0
  288. package/corpus/templates/slides/changelog/2026-08-06-styled-words-stay-part-of-their-text-box-instead-of-becoming.md +6 -0
  289. package/corpus/templates/slides/server/handlers/google-docs-auth.ts +7 -20
  290. package/corpus/templates/slides/server/handlers/import/html-converter.ts +236 -13
  291. package/corpus/templates/slides/server/handlers/import/pptx-assets.ts +67 -0
  292. package/corpus/templates/slides/server/handlers/import/pptx-parser.ts +2 -0
  293. package/corpus/templates/slides/server/handlers/uploads.ts +7 -3
  294. package/corpus/templates/slides/server/lib/chat-attachments.ts +6 -3
  295. package/corpus/templates/slides/server/lib/emails.ts +7 -2
  296. package/corpus/templates/slides/server/lib/google-docs-error.ts +50 -0
  297. package/corpus/templates/slides/server/lib/google-docs-oauth.ts +1 -0
  298. package/corpus/templates/slides/server/lib/import-asset-storage.ts +127 -0
  299. package/corpus/templates/slides/server/plugins/agent-chat.ts +4 -3
  300. package/corpus/templates/slides/server/routes/api/import-assets/[token].get.ts +70 -0
  301. package/corpus/templates/slides/shared/upload-types.ts +3 -0
  302. package/corpus/templates/tasks/.agents/skills/turn-into-app/SKILL.md +296 -0
  303. package/corpus/templates/tasks/.agents/skills/turn-into-app/agents/openai.yaml +4 -0
  304. package/corpus/templates/tasks/.agents/skills/turn-into-skill/SKILL.md +112 -0
  305. package/corpus/templates/tasks/.agents/skills/turn-into-skill/agents/openai.yaml +4 -0
  306. package/corpus/templates/tasks/app/components/layout/Header.tsx +3 -1
  307. package/corpus/templates/tasks/app/routes/extensions._index.tsx +1 -1
  308. package/corpus/templates/tasks/app/routes/settings.$.tsx +1 -0
  309. package/dist/agent/engine/ai-sdk-engine.js +49 -3
  310. package/dist/agent/production-agent.d.ts +18 -0
  311. package/dist/agent/production-agent.js +80 -1
  312. package/dist/agent/types.d.ts +7 -0
  313. package/dist/cli/agent-plugin.d.ts +112 -0
  314. package/dist/cli/agent-plugin.js +1081 -0
  315. package/dist/cli/app-skill.js +39 -1
  316. package/dist/cli/code-agent-executor.d.ts +3 -0
  317. package/dist/cli/code-agent-executor.js +51 -13
  318. package/dist/cli/index.js +13 -0
  319. package/dist/cli/templates-meta.js +1 -1
  320. package/dist/client/AgentPanel.d.ts +3 -1
  321. package/dist/client/AgentPanel.js +9 -2
  322. package/dist/client/AssistantChat.d.ts +8 -0
  323. package/dist/client/AssistantChat.js +23 -8
  324. package/dist/client/NewWorkspaceAppFlow.js +1 -0
  325. package/dist/client/agent-chat-adapter.d.ts +1 -1
  326. package/dist/client/agent-chat-adapter.js +153 -7
  327. package/dist/client/agent-page/AgentWorkspaceContent.d.ts +1 -1
  328. package/dist/client/agent-page/AgentWorkspaceContent.js +13 -13
  329. package/dist/client/assistant-ui-recovery.d.ts +2 -1
  330. package/dist/client/assistant-ui-recovery.js +7 -3
  331. package/dist/client/chat/run-recovery.js +5 -1
  332. package/dist/client/embed-auth.js +6 -2
  333. package/dist/client/error-format.js +12 -0
  334. package/dist/client/integrations/IntegrationsPanel.js +40 -6
  335. package/dist/client/onboarding/FirstRunOnboarding.js +11 -4
  336. package/dist/client/org/OrgSwitcher.js +2 -2
  337. package/dist/client/org/TeamPage.js +92 -72
  338. package/dist/client/require-session.d.ts +1 -1
  339. package/dist/client/require-session.js +4 -4
  340. package/dist/client/resources/McpConnectionSuggestion.d.ts +1 -0
  341. package/dist/client/resources/McpConnectionSuggestion.js +27 -10
  342. package/dist/client/resources/McpIntegrationDialog.js +77 -45
  343. package/dist/client/resources/mcp-integration-catalog.d.ts +13 -1
  344. package/dist/client/resources/mcp-integration-catalog.js +255 -2
  345. package/dist/client/resources/mcp-integration-logos.js +18 -2
  346. package/dist/client/resources/use-mcp-servers.d.ts +5 -0
  347. package/dist/client/resources/use-mcp-servers.js +36 -0
  348. package/dist/client/settings/AccountSettingsCard.js +42 -36
  349. package/dist/client/settings/AutomationsSection.js +1 -1
  350. package/dist/client/settings/DemoModeSection.d.ts +3 -1
  351. package/dist/client/settings/DemoModeSection.js +4 -1
  352. package/dist/client/settings/ExtensionsSettingsContent.js +1 -1
  353. package/dist/client/settings/SchedulingTimezoneField.d.ts +3 -1
  354. package/dist/client/settings/SchedulingTimezoneField.js +9 -5
  355. package/dist/client/settings/SettingsPanel.d.ts +4 -1
  356. package/dist/client/settings/SettingsPanel.js +21 -21
  357. package/dist/client/settings/SettingsTabsPage.d.ts +2 -2
  358. package/dist/client/settings/SettingsTabsPage.js +98 -45
  359. package/dist/client/settings/VoiceTranscriptionSection.js +6 -1
  360. package/dist/client/settings/useSettingsPanelController.js +47 -8
  361. package/dist/collab/routes.d.ts +1 -1
  362. package/dist/db/client.d.ts +9 -0
  363. package/dist/db/client.js +51 -16
  364. package/dist/db/create-get-db.js +2 -2
  365. package/dist/db/ddl-guard.d.ts +11 -10
  366. package/dist/db/ddl-guard.js +40 -12
  367. package/dist/deploy/build.d.ts +2 -0
  368. package/dist/deploy/build.js +97 -4
  369. package/dist/deploy/workspace-deploy.js +0 -2
  370. package/dist/guards/no-env-credentials.js +9 -0
  371. package/dist/ingestion/index.d.ts +1 -1
  372. package/dist/ingestion/pptx.d.ts +68 -0
  373. package/dist/ingestion/pptx.js +660 -213
  374. package/dist/ingestion/website.d.ts +30 -0
  375. package/dist/integrations/plugin.js +9 -6
  376. package/dist/localization/default-messages.d.ts +59 -0
  377. package/dist/localization/default-messages.js +62 -2
  378. package/dist/mcp/screen-memory-stdio.d.ts +7 -7
  379. package/dist/mcp-client/oauth-routes.d.ts +2 -0
  380. package/dist/mcp-client/oauth-routes.js +74 -7
  381. package/dist/mcp-client/routes.d.ts +1 -0
  382. package/dist/mcp-client/routes.js +49 -0
  383. package/dist/navigation/index.js +16 -5
  384. package/dist/notifications/routes.d.ts +1 -1
  385. package/dist/observability/routes.d.ts +3 -3
  386. package/dist/onboarding/app-profile.js +11 -0
  387. package/dist/progress/routes.d.ts +1 -1
  388. package/dist/provider-api/actions/custom-provider-registration.d.ts +13 -13
  389. package/dist/provider-api/actions/provider-api.d.ts +11 -11
  390. package/dist/resources/store.js +15 -1
  391. package/dist/scripts/call-agent.js +45 -4
  392. package/dist/secrets/routes.d.ts +6 -6
  393. package/dist/server/agent-chat/action-filters-a2a.d.ts +1 -1
  394. package/dist/server/agent-chat/action-filters-a2a.js +36 -1
  395. package/dist/server/agent-chat-plugin.js +29 -8
  396. package/dist/server/agent-engine-api-key-route.d.ts +1 -1
  397. package/dist/server/auth.js +55 -17
  398. package/dist/server/better-auth-instance.js +5 -3
  399. package/dist/server/core-routes-plugin.d.ts +8 -1
  400. package/dist/server/core-routes-plugin.js +28 -3
  401. package/dist/server/credential-provider.d.ts +3 -3
  402. package/dist/server/credential-provider.js +90 -4
  403. package/dist/server/identity-sso.js +2 -1
  404. package/dist/server/onboarding-html.d.ts +2 -0
  405. package/dist/server/onboarding-html.js +171 -62
  406. package/dist/server/realtime-token.d.ts +1 -1
  407. package/dist/server/self-dispatch.d.ts +5 -4
  408. package/dist/server/self-dispatch.js +25 -14
  409. package/dist/server/ssr-handler.d.ts +1 -1
  410. package/dist/server/ssr-handler.js +1 -1
  411. package/dist/server/workspace-provider-oauth.js +1 -1
  412. package/dist/setup-connections/onboarding.js +1 -1
  413. package/dist/shared/cache-control.d.ts +26 -2
  414. package/dist/shared/cache-control.js +43 -2
  415. package/dist/shared/index.d.ts +1 -1
  416. package/dist/shared/index.js +1 -1
  417. package/dist/shared/password-policy.d.ts +3 -0
  418. package/dist/shared/password-policy.js +3 -0
  419. package/dist/shared/sign-in-journey.d.ts +5 -2
  420. package/dist/shared/sign-in-journey.js +10 -4
  421. package/dist/sharing/actions/set-resource-visibility.js +16 -4
  422. package/dist/sharing/registry.d.ts +14 -0
  423. package/dist/styles/agent-native.css +6 -0
  424. package/dist/templates/chat/.agents/skills/turn-into-app/SKILL.md +296 -0
  425. package/dist/templates/chat/.agents/skills/turn-into-app/agents/openai.yaml +4 -0
  426. package/dist/templates/chat/.agents/skills/turn-into-skill/SKILL.md +112 -0
  427. package/dist/templates/chat/.agents/skills/turn-into-skill/agents/openai.yaml +4 -0
  428. package/dist/templates/chat/app/components/layout/Layout.tsx +1 -1
  429. package/dist/templates/chat/app/hooks/use-navigation-state.ts +1 -1
  430. package/dist/templates/chat/app/root.tsx +1 -1
  431. package/dist/templates/chat/app/routes/agent.tsx +7 -7
  432. package/dist/templates/chat/app/routes/extensions._index.tsx +1 -1
  433. package/dist/templates/chat/app/routes/settings.$.tsx +1 -0
  434. package/dist/templates/chat/app/routes/team.tsx +1 -1
  435. package/dist/templates/default/.agents/skills/turn-into-app/SKILL.md +296 -0
  436. package/dist/templates/default/.agents/skills/turn-into-app/agents/openai.yaml +4 -0
  437. package/dist/templates/default/.agents/skills/turn-into-skill/SKILL.md +112 -0
  438. package/dist/templates/default/.agents/skills/turn-into-skill/agents/openai.yaml +4 -0
  439. package/dist/templates/headless/.agents/skills/turn-into-app/SKILL.md +296 -0
  440. package/dist/templates/headless/.agents/skills/turn-into-app/agents/openai.yaml +4 -0
  441. package/dist/templates/headless/.agents/skills/turn-into-skill/SKILL.md +112 -0
  442. package/dist/templates/headless/.agents/skills/turn-into-skill/agents/openai.yaml +4 -0
  443. package/dist/templates/workspace-core/.agents/skills/adding-workspace-apps/SKILL.md +6 -0
  444. package/dist/templates/workspace-core/.agents/skills/address-feedback/SKILL.md +37 -6
  445. package/dist/templates/workspace-core/.agents/skills/authentication/SKILL.md +4 -2
  446. package/dist/templates/workspace-core/.agents/skills/performance/SKILL.md +51 -0
  447. package/dist/templates/workspace-core/.agents/skills/turn-into-app/SKILL.md +296 -0
  448. package/dist/templates/workspace-core/.agents/skills/turn-into-app/agents/openai.yaml +4 -0
  449. package/dist/templates/workspace-core/.agents/skills/turn-into-skill/SKILL.md +112 -0
  450. package/dist/templates/workspace-core/.agents/skills/turn-into-skill/agents/openai.yaml +4 -0
  451. package/dist/templates/workspace-root/AGENTS.md +7 -0
  452. package/dist/user-profile/actions/change-password.js +8 -3
  453. package/dist/user-profile/actions/set-password.js +5 -1
  454. package/dist/vite/action-types-plugin.js +59 -0
  455. package/docs/content/authentication.mdx +4 -5
  456. package/docs/content/skills-guide.mdx +13 -0
  457. package/docs/content/template-analytics-developers.mdx +1 -1
  458. package/docs/content/template-calendar-developers.mdx +1 -1
  459. package/docs/content/template-chat-developers.mdx +2 -2
  460. package/docs/content/template-content-developers.mdx +1 -1
  461. package/docs/content/template-mail-developers.mdx +1 -1
  462. package/docs/content/template-plan-developers.mdx +1 -1
  463. package/docs/content/toolkit-command-navigation.mdx +6 -6
  464. package/docs/content/toolkit-org-team.mdx +1 -1
  465. package/docs/content/toolkit-settings.mdx +8 -8
  466. package/docs/content/toolkit-setup-connections.mdx +1 -1
  467. package/package.json +6 -2
  468. package/src/templates/chat/.agents/skills/turn-into-app/SKILL.md +296 -0
  469. package/src/templates/chat/.agents/skills/turn-into-app/agents/openai.yaml +4 -0
  470. package/src/templates/chat/.agents/skills/turn-into-skill/SKILL.md +112 -0
  471. package/src/templates/chat/.agents/skills/turn-into-skill/agents/openai.yaml +4 -0
  472. package/src/templates/chat/app/components/layout/Layout.tsx +1 -1
  473. package/src/templates/chat/app/hooks/use-navigation-state.ts +1 -1
  474. package/src/templates/chat/app/root.tsx +1 -1
  475. package/src/templates/chat/app/routes/agent.tsx +7 -7
  476. package/src/templates/chat/app/routes/extensions._index.tsx +1 -1
  477. package/src/templates/chat/app/routes/settings.$.tsx +1 -0
  478. package/src/templates/chat/app/routes/team.tsx +1 -1
  479. package/src/templates/default/.agents/skills/turn-into-app/SKILL.md +296 -0
  480. package/src/templates/default/.agents/skills/turn-into-app/agents/openai.yaml +4 -0
  481. package/src/templates/default/.agents/skills/turn-into-skill/SKILL.md +112 -0
  482. package/src/templates/default/.agents/skills/turn-into-skill/agents/openai.yaml +4 -0
  483. package/src/templates/headless/.agents/skills/turn-into-app/SKILL.md +296 -0
  484. package/src/templates/headless/.agents/skills/turn-into-app/agents/openai.yaml +4 -0
  485. package/src/templates/headless/.agents/skills/turn-into-skill/SKILL.md +112 -0
  486. package/src/templates/headless/.agents/skills/turn-into-skill/agents/openai.yaml +4 -0
  487. package/src/templates/workspace-core/.agents/skills/adding-workspace-apps/SKILL.md +6 -0
  488. package/src/templates/workspace-core/.agents/skills/address-feedback/SKILL.md +37 -6
  489. package/src/templates/workspace-core/.agents/skills/authentication/SKILL.md +4 -2
  490. package/src/templates/workspace-core/.agents/skills/performance/SKILL.md +51 -0
  491. package/src/templates/workspace-core/.agents/skills/turn-into-app/SKILL.md +296 -0
  492. package/src/templates/workspace-core/.agents/skills/turn-into-app/agents/openai.yaml +4 -0
  493. package/src/templates/workspace-core/.agents/skills/turn-into-skill/SKILL.md +112 -0
  494. package/src/templates/workspace-core/.agents/skills/turn-into-skill/agents/openai.yaml +4 -0
  495. package/src/templates/workspace-root/AGENTS.md +7 -0
  496. package/corpus/templates/analytics/.agents/skills/dashboard-management/references/template-catalog-and-demo.md +0 -62
  497. package/corpus/templates/analytics/actions/install-dashboard-template.ts +0 -369
  498. package/corpus/templates/analytics/actions/list-dashboard-templates.ts +0 -47
  499. package/corpus/templates/analytics/actions/list-native-v2-dashboard-templates.ts +0 -34
  500. package/corpus/templates/analytics/app/routes/catalog.tsx +0 -240
  501. package/src/templates/default/actions/navigate.spec.ts +0 -53
@@ -15,6 +15,36 @@ export interface WebsiteDesignTokens {
15
15
  spacing: string[];
16
16
  radii: string[];
17
17
  cssVariables: Record<string, string>;
18
+ /**
19
+ * Semantic roles are inferred from visible rendered elements, not from
20
+ * variable names. They are optional so static HTML callers can keep their
21
+ * smaller result without inventing values that were never observed.
22
+ */
23
+ semanticColors?: Partial<Record<"primary" | "secondary" | "accent" | "background" | "surface" | "text" | "textMuted", string>>;
24
+ shadows?: string[];
25
+ backgrounds?: string[];
26
+ components?: Array<{
27
+ role: "heading" | "body" | "button" | "link" | "card" | "input" | "nav" | "hero";
28
+ fontFamily?: string;
29
+ fontSize?: string;
30
+ fontWeight?: string;
31
+ lineHeight?: string;
32
+ letterSpacing?: string;
33
+ color?: string;
34
+ backgroundColor?: string;
35
+ backgroundImage?: string;
36
+ border?: string;
37
+ borderRadius?: string;
38
+ boxShadow?: string;
39
+ padding?: string;
40
+ gap?: string;
41
+ textTransform?: string;
42
+ }>;
43
+ layout?: {
44
+ contentWidth?: string;
45
+ pagePadding?: string;
46
+ sectionGap?: string;
47
+ };
18
48
  }
19
49
  export interface WebsiteExtraction {
20
50
  title: string;
@@ -3,6 +3,7 @@ import { getRequestHeader } from "h3";
3
3
  import { createRemoteJWKSet, jwtVerify } from "jose";
4
4
  import { AGENT_BACKGROUND_PROCESSOR_FIELD, AGENT_BACKGROUND_PROCESSOR_INTEGRATION, isInBackgroundFunctionRuntime, } from "../agent/durable-background.js";
5
5
  import { abortRun } from "../agent/run-manager.js";
6
+ import { isServerlessRuntime } from "../db/client.js";
6
7
  import { getOrgContext, resolveOrgIdForEmail } from "../org/context.js";
7
8
  import { loadResourcesForPrompt } from "../server/agent-chat-plugin.js";
8
9
  import { withConfiguredAppBasePath } from "../server/app-base-path.js";
@@ -2657,12 +2658,14 @@ export function createIntegrationsPlugin(options) {
2657
2658
  setResponseStatus(event, 404);
2658
2659
  return { error: "Not found" };
2659
2660
  }));
2660
- // Background agent and scheduled recovery functions mount the same Nitro
2661
- // app, but they are workers rather than hosts for recurring integration
2662
- // jobs. Starting these timers in every worker multiplies recovery sweeps
2663
- // and pollers across concurrent runs, exhausting the shared database
2664
- // precisely while those runs are trying to checkpoint and deliver replies.
2665
- if (!isInBackgroundFunctionRuntime() && !isInIntegrationRecoveryRuntime()) {
2661
+ // Serverless functions mount the same Nitro app as the durable workers,
2662
+ // but they are not a stable host for recurring integration jobs. Starting
2663
+ // these timers in every cold-started instance multiplies recovery sweeps
2664
+ // and pollers against the shared database; scheduled/background workers
2665
+ // own this work on hosted deployments.
2666
+ if (!isInBackgroundFunctionRuntime() &&
2667
+ !isInIntegrationRecoveryRuntime() &&
2668
+ !isServerlessRuntime()) {
2666
2669
  // ─── Start pending-tasks retry sweeper ────────────────────────
2667
2670
  // Sweeps the integration_pending_tasks queue every 60s and re-fires the
2668
2671
  // processor for any tasks that got stuck (initial dispatch lost or
@@ -904,6 +904,11 @@ declare const messages: {
904
904
  addYourOwn: string;
905
905
  noMatches: string;
906
906
  connected: string;
907
+ connectionError: string;
908
+ connectionErrorReason: string;
909
+ reconnect: string;
910
+ reconnecting: string;
911
+ reconnectFailed: string;
907
912
  configure: string;
908
913
  connect: string;
909
914
  connectWithOAuth: string;
@@ -918,8 +923,17 @@ declare const messages: {
918
923
  presetAuthDescription: string;
919
924
  customDescription: string;
920
925
  oauthNotice: string;
926
+ providerSetupRequired: string;
927
+ providerSetupDescription: string;
928
+ providerSetupFormDescription: string;
929
+ continueToConnect: string;
930
+ setupTitle: string;
921
931
  personal: string;
922
932
  organization: string;
933
+ scopeQuestion: string;
934
+ personalDescription: string;
935
+ sharedWithWorkspace: string;
936
+ organizationDescription: string;
923
937
  serverNameRequired: string;
924
938
  serverName: string;
925
939
  url: string;
@@ -950,6 +964,11 @@ declare const messages: {
950
964
  useCase: string;
951
965
  setupNote: string;
952
966
  };
967
+ amplitude: {
968
+ description: string;
969
+ useCase: string;
970
+ setupNote: string;
971
+ };
953
972
  notion: {
954
973
  description: string;
955
974
  useCase: string;
@@ -960,6 +979,11 @@ declare const messages: {
960
979
  useCase: string;
961
980
  setupNote: string;
962
981
  };
982
+ gong: {
983
+ description: string;
984
+ useCase: string;
985
+ setupNote: string;
986
+ };
963
987
  semgrep: {
964
988
  description: string;
965
989
  useCase: string;
@@ -968,6 +992,21 @@ declare const messages: {
968
992
  description: string;
969
993
  useCase: string;
970
994
  };
995
+ apollo: {
996
+ description: string;
997
+ useCase: string;
998
+ setupNote: string;
999
+ };
1000
+ commonRoom: {
1001
+ description: string;
1002
+ useCase: string;
1003
+ setupNote: string;
1004
+ };
1005
+ exa: {
1006
+ description: string;
1007
+ useCase: string;
1008
+ setupNote: string;
1009
+ };
971
1010
  supabase: {
972
1011
  description: string;
973
1012
  useCase: string;
@@ -990,6 +1029,16 @@ declare const messages: {
990
1029
  useCase: string;
991
1030
  setupNote: string;
992
1031
  };
1032
+ grafana: {
1033
+ description: string;
1034
+ useCase: string;
1035
+ setupNote: string;
1036
+ };
1037
+ googleWorkspace: {
1038
+ description: string;
1039
+ useCase: string;
1040
+ setupNote: string;
1041
+ };
993
1042
  gitlab: {
994
1043
  description: string;
995
1044
  useCase: string;
@@ -1030,6 +1079,11 @@ declare const messages: {
1030
1079
  useCase: string;
1031
1080
  setupNote: string;
1032
1081
  };
1082
+ pylon: {
1083
+ description: string;
1084
+ useCase: string;
1085
+ setupNote: string;
1086
+ };
1033
1087
  intercom: {
1034
1088
  description: string;
1035
1089
  useCase: string;
@@ -1055,6 +1109,11 @@ declare const messages: {
1055
1109
  useCase: string;
1056
1110
  setupNote: string;
1057
1111
  };
1112
+ builder: {
1113
+ description: string;
1114
+ useCase: string;
1115
+ setupNote: string;
1116
+ };
1058
1117
  netlify: {
1059
1118
  description: string;
1060
1119
  useCase: string;
@@ -3,6 +3,7 @@
3
3
  // can load it during SSR. Do not import core runtime code from src/templates:
4
4
  // templates ship as verbatim copy-only scaffolding (.ts), so their compiled
5
5
  // .js never exists in dist.
6
+ import { PASSWORD_MIN_LENGTH_MESSAGE } from "../shared/password-policy.js";
6
7
  const messages = {
7
8
  workspaceFile: {
8
9
  download: "Download",
@@ -65,7 +66,7 @@ const messages = {
65
66
  passwordNewLabel: "New password",
66
67
  passwordConfirmLabel: "Confirm new password",
67
68
  passwordPlaceholder: "Enter password",
68
- passwordMinLength: "Password must be at least 8 characters",
69
+ passwordMinLength: PASSWORD_MIN_LENGTH_MESSAGE,
69
70
  passwordMismatch: "Passwords do not match",
70
71
  passwordSave: "Save password",
71
72
  passwordSaving: "Saving...",
@@ -909,6 +910,11 @@ const messages = {
909
910
  addYourOwn: "Add your own",
910
911
  noMatches: "No integrations match that search.",
911
912
  connected: "Connected",
913
+ connectionError: "Connection error",
914
+ connectionErrorReason: "Reason: {{reason}}",
915
+ reconnect: "Reconnect",
916
+ reconnecting: "Reconnecting…",
917
+ reconnectFailed: "Reconnect failed: {{error}}",
912
918
  configure: "Configure",
913
919
  connect: "Connect",
914
920
  connectWithOAuth: "Connect",
@@ -923,8 +929,17 @@ const messages = {
923
929
  presetAuthDescription: "Preset values are filled in. Add any required authorization details before connecting.",
924
930
  customDescription: "Paste a Streamable HTTP or SSE endpoint and optional headers.",
925
931
  oauthNotice: "This provider usually requires an OAuth setup. Follow the provider docs, or add an Authorization header if your endpoint supports token-based access.",
932
+ providerSetupRequired: "Provider setup required",
933
+ providerSetupDescription: "Complete the required setup in {{name}} first. Then return here to authorize your account.",
934
+ providerSetupFormDescription: "Review the provider requirements and open the official setup guide before connecting your account.",
935
+ continueToConnect: "I've completed setup",
936
+ setupTitle: "Set up {{name}}",
926
937
  personal: "Personal",
927
938
  organization: "Organization",
939
+ scopeQuestion: "Who should be able to use this connection?",
940
+ personalDescription: "Only you can use this connection.",
941
+ sharedWithWorkspace: "Shared with workspace",
942
+ organizationDescription: "Permitted workspace members can use this connection. Provider permissions still apply.",
928
943
  serverNameRequired: "Enter an integration name before connecting with OAuth.",
929
944
  serverName: "Integration name",
930
945
  url: "URL",
@@ -955,6 +970,11 @@ const messages = {
955
970
  useCase: "Product analytics, session replay, qualitative behavior, user research",
956
971
  setupNote: "FullStory MCP is currently beta and requires StoryAI features plus the Model Context Protocol toggle to be enabled by a FullStory organization admin.",
957
972
  },
973
+ amplitude: {
974
+ description: "Read and work with Amplitude product analytics.",
975
+ useCase: "Product analytics, charts, dashboards, cohorts, experiments",
976
+ setupNote: "Amplitude MCP uses OAuth over streaming HTTP. The default endpoint is for US data residency; use Amplitude's EU endpoint when the account requires EU residency.",
977
+ },
958
978
  notion: {
959
979
  description: "Search pages and team knowledge.",
960
980
  useCase: "Documentation, knowledge management, notes, content creation",
@@ -965,6 +985,11 @@ const messages = {
965
985
  useCase: "Meeting notes, recordings, transcripts, action items, follow-ups",
966
986
  setupNote: "The Granola integration uses browser OAuth. Authorize the signed-in Granola account and review which meeting notes and transcripts the agent can access.",
967
987
  },
988
+ gong: {
989
+ description: "Search Gong calls and generate account and deal insights.",
990
+ useCase: "Sales calls, transcripts, deal insights, account summaries",
991
+ setupNote: "Gong requires a tech admin to create an MCP integration and choose personal or shared authorization. The generated client ID and secret must be configured before connecting.",
992
+ },
968
993
  semgrep: {
969
994
  description: "Scan code for security findings.",
970
995
  useCase: "Security scanning, vulnerability detection, code analysis",
@@ -973,6 +998,21 @@ const messages = {
973
998
  description: "Read and write Linear issues.",
974
999
  useCase: "Project management, issue tracking, planning, bug reports",
975
1000
  },
1001
+ apollo: {
1002
+ description: "Search, enrich, and manage Apollo GTM data.",
1003
+ useCase: "Prospecting, enrichment, contacts, sequences, account research",
1004
+ setupNote: "Apollo MCP uses user OAuth and does not require an Apollo API key. Apollo plan permissions, credits, and the provider's model-training restrictions still apply.",
1005
+ },
1006
+ commonRoom: {
1007
+ description: "Research buyer signals, contacts, and organizations.",
1008
+ useCase: "Buyer intelligence, product signals, intent, contact enrichment",
1009
+ setupNote: "Common Room MCP uses per-user OAuth and respects the authorized user's workspace role. An administrator may need to enable the MCP connection for the instance.",
1010
+ },
1011
+ exa: {
1012
+ description: "Search the web and fetch pages with Exa.",
1013
+ useCase: "Web search, research, code search, page fetching",
1014
+ setupNote: "Exa's remote MCP endpoint supports basic free usage without a key. Add an Exa API key through the provider's header configuration when higher limits or additional tools are needed.",
1015
+ },
976
1016
  supabase: {
977
1017
  description: "Manage data, auth, and backend services.",
978
1018
  useCase: "Database, authentication, storage, edge functions",
@@ -995,6 +1035,16 @@ const messages = {
995
1035
  useCase: "DNS, Workers, domains, security, observability, platform APIs",
996
1036
  setupNote: "Cloudflare's managed integration directory contains product-specific integrations as well as the broad API integration. Review the scopes and choose the narrowest endpoint that fits your workflow.",
997
1037
  },
1038
+ grafana: {
1039
+ description: "Query Grafana Cloud metrics, logs, and observability data.",
1040
+ useCase: "Observability, metrics, logs, traces, dashboards",
1041
+ setupNote: "Grafana Cloud MCP is in public preview and requires Grafana Cloud Assistant MCP access. It is hosted Grafana Cloud only; self-hosted Grafana needs the local MCP server.",
1042
+ },
1043
+ googleWorkspace: {
1044
+ description: "Search Google Workspace data through its remote MCP server.",
1045
+ useCase: "Workspace search across Gmail, Drive, Calendar, Chat, Docs, Sheets, Slides",
1046
+ setupNote: "Google Workspace MCP is in Developer Preview. Enable the relevant Google Workspace and MCP APIs, configure an OAuth consent screen and client, then authorize the products you want to use.",
1047
+ },
998
1048
  gitlab: {
999
1049
  description: "Read and manage GitLab projects, issues, and merge requests.",
1000
1050
  useCase: "Repositories, issues, merge requests, CI/CD, code analytics",
@@ -1033,7 +1083,12 @@ const messages = {
1033
1083
  hubspot: {
1034
1084
  description: "Search and update HubSpot CRM records through its integration.",
1035
1085
  useCase: "CRM, contacts, companies, deals, tickets, customer analytics",
1036
- setupNote: "The HubSpot integration requires a HubSpot Auth App and PKCE. Create the app in the HubSpot Developer Platform before connecting; the existing HubSpot OAuth connector remains available to app actions.",
1086
+ setupNote: "When a workspace-managed HubSpot MCP Auth App is configured, any member can connect a personal HubSpot account with OAuth and PKCE. Otherwise, create the app in the HubSpot Developer Platform before connecting; the existing HubSpot OAuth connector remains available to app actions.",
1087
+ },
1088
+ pylon: {
1089
+ description: "Search and update Pylon support data.",
1090
+ useCase: "Customer support, issues, accounts, contacts, conversations",
1091
+ setupNote: "Enable Pylon MCP access for the relevant users and turn on the MCP server in Pylon before connecting. Pylon requires a Member or Admin seat and uses user OAuth only.",
1037
1092
  },
1038
1093
  intercom: {
1039
1094
  description: "Search conversations and customer support knowledge.",
@@ -1060,6 +1115,11 @@ const messages = {
1060
1115
  useCase: "Files, folders, enterprise content, search, collaboration",
1061
1116
  setupNote: "The Box integration is beta and requires an administrator to enable it. Custom clients also need Box Integration Credentials, a redirect URI, and approved scopes.",
1062
1117
  },
1118
+ builder: {
1119
+ description: "Search Builder Publish and Hybrid Space content.",
1120
+ useCase: "Content models, pages, entries, Publish and Hybrid Spaces",
1121
+ setupNote: "Builder CMS MCP uses OAuth with dynamic client registration. It only connects to Publish or Hybrid Spaces, and the authorization flow asks you to select the Space.",
1122
+ },
1063
1123
  netlify: {
1064
1124
  description: "Inspect and operate Netlify sites and deployments.",
1065
1125
  useCase: "Sites, deployments, builds, domains, hosting operations",
@@ -137,13 +137,13 @@ export declare function screenMemoryMcpToolDefinitions(): ({
137
137
  inputSchema: {
138
138
  type: string;
139
139
  properties: {
140
+ count?: undefined;
140
141
  query?: undefined;
141
142
  minutes?: undefined;
142
143
  limit?: undefined;
143
144
  clientHint?: undefined;
144
145
  timestamp?: undefined;
145
146
  chapterId?: undefined;
146
- count?: undefined;
147
147
  startAt?: undefined;
148
148
  endAt?: undefined;
149
149
  reason?: undefined;
@@ -159,6 +159,7 @@ export declare function screenMemoryMcpToolDefinitions(): ({
159
159
  inputSchema: {
160
160
  type: string;
161
161
  properties: {
162
+ count?: undefined;
162
163
  query: {
163
164
  type: string;
164
165
  description: string;
@@ -174,7 +175,6 @@ export declare function screenMemoryMcpToolDefinitions(): ({
174
175
  clientHint?: undefined;
175
176
  timestamp?: undefined;
176
177
  chapterId?: undefined;
177
- count?: undefined;
178
178
  startAt?: undefined;
179
179
  endAt?: undefined;
180
180
  reason?: undefined;
@@ -190,6 +190,7 @@ export declare function screenMemoryMcpToolDefinitions(): ({
190
190
  inputSchema: {
191
191
  type: string;
192
192
  properties: {
193
+ count?: undefined;
193
194
  minutes: {
194
195
  type: string;
195
196
  description: string;
@@ -199,7 +200,6 @@ export declare function screenMemoryMcpToolDefinitions(): ({
199
200
  clientHint?: undefined;
200
201
  timestamp?: undefined;
201
202
  chapterId?: undefined;
202
- count?: undefined;
203
203
  startAt?: undefined;
204
204
  endAt?: undefined;
205
205
  reason?: undefined;
@@ -216,6 +216,7 @@ export declare function screenMemoryMcpToolDefinitions(): ({
216
216
  type: string;
217
217
  required: string[];
218
218
  properties: {
219
+ count?: undefined;
219
220
  query: {
220
221
  type: string;
221
222
  description: string;
@@ -234,7 +235,6 @@ export declare function screenMemoryMcpToolDefinitions(): ({
234
235
  };
235
236
  timestamp?: undefined;
236
237
  chapterId?: undefined;
237
- count?: undefined;
238
238
  startAt?: undefined;
239
239
  endAt?: undefined;
240
240
  reason?: undefined;
@@ -250,6 +250,7 @@ export declare function screenMemoryMcpToolDefinitions(): ({
250
250
  type: string;
251
251
  required: string[];
252
252
  properties: {
253
+ count?: undefined;
253
254
  query?: undefined;
254
255
  minutes?: undefined;
255
256
  limit?: undefined;
@@ -263,7 +264,6 @@ export declare function screenMemoryMcpToolDefinitions(): ({
263
264
  description: string;
264
265
  };
265
266
  chapterId?: undefined;
266
- count?: undefined;
267
267
  startAt?: undefined;
268
268
  endAt?: undefined;
269
269
  includeMicrophone?: undefined;
@@ -314,13 +314,13 @@ export declare function screenMemoryMcpToolDefinitions(): ({
314
314
  type: string;
315
315
  required: string[];
316
316
  properties: {
317
+ count?: undefined;
317
318
  query?: undefined;
318
319
  minutes?: undefined;
319
320
  limit?: undefined;
320
321
  clientHint?: undefined;
321
322
  timestamp?: undefined;
322
323
  chapterId?: undefined;
323
- count?: undefined;
324
324
  startAt: {
325
325
  type: string;
326
326
  description: string;
@@ -349,13 +349,13 @@ export declare function screenMemoryMcpToolDefinitions(): ({
349
349
  type: string;
350
350
  required: string[];
351
351
  properties: {
352
+ count?: undefined;
352
353
  query?: undefined;
353
354
  minutes?: undefined;
354
355
  limit?: undefined;
355
356
  clientHint?: undefined;
356
357
  timestamp?: undefined;
357
358
  chapterId?: undefined;
358
- count?: undefined;
359
359
  startAt?: undefined;
360
360
  endAt?: undefined;
361
361
  reason?: undefined;
@@ -23,6 +23,8 @@ export interface McpOAuthRoutesOptions {
23
23
  }
24
24
  export declare function redirectWithStagedCookies(event: H3Event, location: string): Response;
25
25
  export declare function mountMcpOAuthRoutes(nitroApp: any, options: McpOAuthRoutesOptions): void;
26
+ export declare function resolveMcpOAuthScope(serverUrl: URL, requestedScope: unknown): RemoteMcpScope | null;
27
+ export declare function resolveManagedMcpOAuthClient(serverUrl: URL): Promise<StoredOAuthClientInformation | undefined>;
26
28
  export declare function setMcpOAuthFlowCookie(event: H3Event, flow: McpOAuthFlow, secure: boolean): void;
27
29
  export declare function readMcpOAuthFlowCookie(event: H3Event): McpOAuthFlow | null;
28
30
  export declare function clearMcpOAuthFlowCookies(event: H3Event): void;
@@ -3,6 +3,7 @@ import { deleteCookie, defineEventHandler, getChunkedCookie, getCookie, getMetho
3
3
  import { getOrgContext } from "../org/context.js";
4
4
  import { decryptSecretValue, encryptSecretValue } from "../secrets/crypto.js";
5
5
  import { getSession, safeReturnPath } from "../server/auth.js";
6
+ import { resolveSecret } from "../server/credential-provider.js";
6
7
  import { getH3App } from "../server/framework-request-handler.js";
7
8
  import { getAppUrl, resolveOAuthRedirectUri } from "../server/google-oauth.js";
8
9
  import { runWithRequestContext } from "../server/request-context.js";
@@ -13,6 +14,21 @@ const FLOW_TTL_SECONDS = 10 * 60;
13
14
  const FLOW_COOKIE_CHUNK_SIZE = 2_800;
14
15
  const FLOW_COOKIE_MAX_CHUNKS = 8;
15
16
  const CHUNKED_COOKIE_PREFIX = "__chunked__";
17
+ const MANAGED_MCP_OAUTH_CLIENTS = [
18
+ {
19
+ serverOrigin: "https://mcp.hubspot.com",
20
+ clientIdKeys: [
21
+ "HUBSPOT_MCP_CLIENT_ID",
22
+ "HUBSPOT_INTEGRATION_CLIENT_ID",
23
+ "HUBSPOT_CLIENT_ID",
24
+ ],
25
+ clientSecretKeys: [
26
+ "HUBSPOT_MCP_CLIENT_SECRET",
27
+ "HUBSPOT_INTEGRATION_CLIENT_SECRET",
28
+ "HUBSPOT_CLIENT_SECRET",
29
+ ],
30
+ },
31
+ ];
16
32
  export function redirectWithStagedCookies(event, location) {
17
33
  const headers = new Headers({
18
34
  Location: location,
@@ -70,7 +86,13 @@ async function handleMcpOAuthStart(event) {
70
86
  setResponseStatus(event, 400);
71
87
  return { error: "MCP server name is invalid." };
72
88
  }
73
- const requestedScope = query.scope === "org" ? "org" : "user";
89
+ const requestedScope = resolveMcpOAuthScope(urlCheck.url, query.scope);
90
+ if (!requestedScope) {
91
+ setResponseStatus(event, 400);
92
+ return {
93
+ error: "Managed MCP OAuth connections must use personal scope.",
94
+ };
95
+ }
74
96
  const requestedOrgId = text(query.orgId);
75
97
  const org = requestedScope === "org"
76
98
  ? await getOrgContext(event).catch(() => null)
@@ -98,12 +120,29 @@ async function handleMcpOAuthStart(event) {
98
120
  }
99
121
  const state = crypto.randomUUID();
100
122
  const safeReturnUrl = returnUrl ? safeReturnPath(returnUrl) : undefined;
123
+ const requestContext = {
124
+ userEmail: session.email,
125
+ orgId: org?.orgId ?? undefined,
126
+ };
101
127
  try {
102
- const started = await runWithRequestContext({ userEmail: session.email, orgId: org?.orgId ?? undefined }, () => startMcpOAuthAuthorization({
103
- serverUrl: urlCheck.url.toString(),
104
- redirectUrl: redirectUri,
105
- state,
106
- }));
128
+ const started = await runWithRequestContext(requestContext, async () => {
129
+ const clientInformation = await resolveManagedMcpOAuthClient(urlCheck.url);
130
+ if (isManagedMcpOAuthServer(urlCheck.url) && !clientInformation) {
131
+ return null;
132
+ }
133
+ return startMcpOAuthAuthorization({
134
+ serverUrl: urlCheck.url.toString(),
135
+ redirectUrl: redirectUri,
136
+ state,
137
+ ...(clientInformation ? { clientInformation } : {}),
138
+ });
139
+ });
140
+ if (!started) {
141
+ setResponseStatus(event, 400);
142
+ return {
143
+ error: "HubSpot personal MCP connect is not configured for this workspace. A workspace owner must register the HubSpot MCP Auth App once; after that, any workspace member can connect a personal account.",
144
+ };
145
+ }
107
146
  const flow = {
108
147
  name,
109
148
  url: urlCheck.url.toString(),
@@ -132,6 +171,34 @@ async function handleMcpOAuthStart(event) {
132
171
  };
133
172
  }
134
173
  }
174
+ function isManagedMcpOAuthServer(serverUrl) {
175
+ return MANAGED_MCP_OAUTH_CLIENTS.some((client) => client.serverOrigin === serverUrl.origin);
176
+ }
177
+ export function resolveMcpOAuthScope(serverUrl, requestedScope) {
178
+ if (isManagedMcpOAuthServer(serverUrl) && requestedScope === "org") {
179
+ return null;
180
+ }
181
+ return requestedScope === "org" ? "org" : "user";
182
+ }
183
+ export async function resolveManagedMcpOAuthClient(serverUrl) {
184
+ const client = MANAGED_MCP_OAUTH_CLIENTS.find((candidate) => candidate.serverOrigin === serverUrl.origin);
185
+ if (!client)
186
+ return undefined;
187
+ for (let index = 0; index < client.clientIdKeys.length; index += 1) {
188
+ const [clientId, clientSecret] = await Promise.all([
189
+ resolveSecret(client.clientIdKeys[index]),
190
+ resolveSecret(client.clientSecretKeys[index]),
191
+ ]);
192
+ if (clientId && clientSecret) {
193
+ return {
194
+ client_id: clientId,
195
+ client_secret: clientSecret,
196
+ token_endpoint_auth_method: "client_secret_post",
197
+ };
198
+ }
199
+ }
200
+ return undefined;
201
+ }
135
202
  async function handleMcpOAuthCallback(event, options) {
136
203
  const session = await getSession(event).catch(() => null);
137
204
  if (!session?.email)
@@ -190,7 +257,7 @@ async function handleMcpOAuthCallback(event, options) {
190
257
  }
191
258
  await options.reconfigure();
192
259
  const returnPath = flow.returnUrl ??
193
- `/settings?connected=mcp-${encodeURIComponent(flow.name)}#integrations`;
260
+ `/settings/integrations?connected=mcp-${encodeURIComponent(flow.name)}`;
194
261
  return redirectWithStagedCookies(event, getAppUrl(event, returnPath));
195
262
  }
196
263
  catch {
@@ -9,6 +9,7 @@
9
9
  * POST /_agent-native/mcp/servers add a server
10
10
  * DELETE /_agent-native/mcp/servers/:id remove a server (scope via ?scope=)
11
11
  * POST /_agent-native/mcp/servers/:id/test dry-run connect (no persist)
12
+ * POST /_agent-native/mcp/servers/:id/reconnect retry connect + refresh
12
13
  * POST /_agent-native/mcp/servers/test dry-run a URL before persisting
13
14
  * GET /_agent-native/mcp/builtin list built-in capability toggles
14
15
  * POST /_agent-native/mcp/builtin update built-in capability toggles
@@ -9,6 +9,7 @@
9
9
  * POST /_agent-native/mcp/servers add a server
10
10
  * DELETE /_agent-native/mcp/servers/:id remove a server (scope via ?scope=)
11
11
  * POST /_agent-native/mcp/servers/:id/test dry-run connect (no persist)
12
+ * POST /_agent-native/mcp/servers/:id/reconnect retry connect + refresh
12
13
  * POST /_agent-native/mcp/servers/test dry-run a URL before persisting
13
14
  * GET /_agent-native/mcp/builtin list built-in capability toggles
14
15
  * POST /_agent-native/mcp/builtin update built-in capability toggles
@@ -63,6 +64,15 @@ function projectForClient(stored, scope, ownerId, status) {
63
64
  status,
64
65
  };
65
66
  }
67
+ function reconnectStatusForClient(manager, mergedId) {
68
+ const status = statusFor(manager, mergedId);
69
+ if (status.state !== "error")
70
+ return status;
71
+ return {
72
+ state: "error",
73
+ error: formatMcpConnectError(status.error),
74
+ };
75
+ }
66
76
  function statusFor(manager, mergedId) {
67
77
  const snap = manager.getStatus();
68
78
  if (snap.connectedServers.includes(mergedId)) {
@@ -328,6 +338,11 @@ export function mountMcpServersRoutes(nitroApp, manager, options = {}) {
328
338
  if (parts.length === 2 && parts[1] === "test" && method === "POST") {
329
339
  return handleTestExisting(event, manager, id);
330
340
  }
341
+ if (parts.length === 2 &&
342
+ parts[1] === "reconnect" &&
343
+ method === "POST") {
344
+ return handleReconnectExisting(event, manager, id);
345
+ }
331
346
  if (parts.length === 1 && method === "DELETE") {
332
347
  return handleDelete(event, manager, id);
333
348
  }
@@ -803,6 +818,40 @@ async function handleTestExisting(event, _manager, id) {
803
818
  }
804
819
  return { ok: true, toolCount: result.toolCount, tools: result.tools };
805
820
  }
821
+ async function handleReconnectExisting(event, manager, id) {
822
+ const scope = getQuery(event).scope;
823
+ const parsedScope = scope === "org" ? "org" : scope === "user" ? "user" : null;
824
+ if (!parsedScope) {
825
+ setResponseStatus(event, 400);
826
+ return { error: 'scope query param must be "user" or "org"' };
827
+ }
828
+ const { email, orgId } = await resolveContextForRequest(event);
829
+ let scopeId = null;
830
+ if (parsedScope === "user") {
831
+ scopeId = email;
832
+ }
833
+ else {
834
+ scopeId = orgId;
835
+ }
836
+ if (!scopeId) {
837
+ setResponseStatus(event, 401);
838
+ return { error: "Authentication required" };
839
+ }
840
+ const list = await listRemoteServers(parsedScope, scopeId);
841
+ const server = list.find((s) => s.id === id);
842
+ if (!server) {
843
+ setResponseStatus(event, 404);
844
+ return { error: "Server not found" };
845
+ }
846
+ await reconfigureManager(manager);
847
+ const mergedId = mergedConfigKey(parsedScope, server, scopeId);
848
+ const status = reconnectStatusForClient(manager, mergedId);
849
+ const projected = projectForClient(server, parsedScope, scopeId, status);
850
+ return {
851
+ ok: true,
852
+ server: projected,
853
+ };
854
+ }
806
855
  async function tryConnect(url, headers) {
807
856
  try {
808
857
  const { Client, StreamableHTTPClientTransport } = await import("@modelcontextprotocol/client");