@agent-native/core 0.141.7 → 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 (328) hide show
  1. package/agent-native.eject.json +9 -0
  2. package/corpus/README.md +1 -1
  3. package/corpus/templates/analytics/.agents/skills/provider-api/SKILL.md +19 -0
  4. package/corpus/templates/analytics/.agents/skills/turn-into-app/SKILL.md +296 -0
  5. package/corpus/templates/analytics/.agents/skills/turn-into-app/agents/openai.yaml +4 -0
  6. package/corpus/templates/analytics/.agents/skills/turn-into-skill/SKILL.md +112 -0
  7. package/corpus/templates/analytics/.agents/skills/turn-into-skill/agents/openai.yaml +4 -0
  8. package/corpus/templates/analytics/AGENTS.md +35 -38
  9. package/corpus/templates/analytics/actions/ensure-native-v2-dashboards.ts +1 -1
  10. package/corpus/templates/analytics/actions/list-dashboard-usage-stats.ts +17 -22
  11. package/corpus/templates/analytics/actions/navigate.ts +4 -5
  12. package/corpus/templates/analytics/actions/provider-api-register.ts +50 -0
  13. package/corpus/templates/analytics/actions/query-agent-native-analytics.ts +44 -11
  14. package/corpus/templates/analytics/actions/test-custom-api-connection.ts +106 -0
  15. package/corpus/templates/analytics/app/components/CustomApiCard.tsx +430 -0
  16. package/corpus/templates/analytics/app/i18n-data.ts +680 -0
  17. package/corpus/templates/analytics/app/lib/native-mcp-exclusions.ts +6 -0
  18. package/corpus/templates/analytics/app/lib/sql-query.ts +33 -6
  19. package/corpus/templates/analytics/app/pages/DataSources.tsx +4 -0
  20. package/corpus/templates/analytics/changelog/2026-08-06-analytics-dashboards-load-reliably-during-background-data-sw.md +6 -0
  21. package/corpus/templates/analytics/changelog/2026-08-06-analytics-dashboards-remain-responsive-while-historical-data.md +6 -0
  22. package/corpus/templates/analytics/changelog/2026-08-06-analytics-query-results-now-render-as-a-table-with-csv-downl.md +6 -0
  23. package/corpus/templates/analytics/changelog/2026-08-06-connect-public-https-custom-apis-and-hand-tested-endpoints-t.md +6 -0
  24. package/corpus/templates/analytics/changelog/2026-08-06-durable-agent-worker-memory.md +6 -0
  25. package/corpus/templates/analytics/changelog/2026-08-06-live-dashboard-panels-use-the-shared-query-timeout.md +6 -0
  26. package/corpus/templates/analytics/changelog/2026-08-06-on-demand-billing-is-available-as-a-native-dashboard-with-ta.md +6 -0
  27. package/corpus/templates/analytics/changelog/2026-08-06-visible-dashboard-names-are-unique.md +6 -0
  28. package/corpus/templates/analytics/netlify.toml +7 -0
  29. package/corpus/templates/analytics/scripts/emit-netlify-dashboard-report-cron.ts +4 -0
  30. package/corpus/templates/analytics/server/db/index.ts +27 -0
  31. package/corpus/templates/analytics/server/db/schema.ts +10 -0
  32. package/corpus/templates/analytics/server/lib/dashboards-store.ts +227 -60
  33. package/corpus/templates/analytics/server/lib/first-party-analytics-backend.ts +133 -44
  34. package/corpus/templates/analytics/server/lib/native-v2-dashboards.ts +227 -1
  35. package/corpus/templates/analytics/server/plugins/agent-chat.ts +5 -0
  36. package/corpus/templates/analytics/server/plugins/analytics-rollup-backfill-jobs.ts +1 -0
  37. package/corpus/templates/analytics/server/plugins/db.ts +52 -18
  38. package/corpus/templates/assets/.agents/skills/asset-generation/SKILL.md +28 -2
  39. package/corpus/templates/assets/.agents/skills/image-generation/SKILL.md +16 -1
  40. package/corpus/templates/assets/.agents/skills/turn-into-app/SKILL.md +296 -0
  41. package/corpus/templates/assets/.agents/skills/turn-into-app/agents/openai.yaml +4 -0
  42. package/corpus/templates/assets/.agents/skills/turn-into-skill/SKILL.md +112 -0
  43. package/corpus/templates/assets/.agents/skills/turn-into-skill/agents/openai.yaml +4 -0
  44. package/corpus/templates/brain/.agents/skills/turn-into-app/SKILL.md +296 -0
  45. package/corpus/templates/brain/.agents/skills/turn-into-app/agents/openai.yaml +4 -0
  46. package/corpus/templates/brain/.agents/skills/turn-into-skill/SKILL.md +112 -0
  47. package/corpus/templates/brain/.agents/skills/turn-into-skill/agents/openai.yaml +4 -0
  48. package/corpus/templates/brain/actions/list-connection-providers.ts +24 -3
  49. package/corpus/templates/brain/app/lib/dispatch-links.ts +44 -0
  50. package/corpus/templates/brain/app/routes/sources.tsx +15 -7
  51. package/corpus/templates/brain/changelog/2026-08-06-brain-provider-setup-links-open-dispatch-correctly-in-standa.md +6 -0
  52. package/corpus/templates/brain/server/plugins/agent-chat.ts +1 -0
  53. package/corpus/templates/calendar/.agents/skills/event-management/SKILL.md +26 -0
  54. package/corpus/templates/calendar/.agents/skills/turn-into-app/SKILL.md +296 -0
  55. package/corpus/templates/calendar/.agents/skills/turn-into-app/agents/openai.yaml +4 -0
  56. package/corpus/templates/calendar/.agents/skills/turn-into-skill/SKILL.md +112 -0
  57. package/corpus/templates/calendar/.agents/skills/turn-into-skill/agents/openai.yaml +4 -0
  58. package/corpus/templates/calendar/AGENTS.md +11 -32
  59. package/corpus/templates/calendar/actions/update-event.ts +107 -1
  60. package/corpus/templates/calendar/app/components/calendar/EventCalendarSelect.tsx +83 -0
  61. package/corpus/templates/calendar/app/components/calendar/EventDetailPanel.tsx +57 -0
  62. package/corpus/templates/calendar/app/components/calendar/EventDetailPopover.tsx +59 -73
  63. package/corpus/templates/calendar/app/hooks/use-events.ts +4 -1
  64. package/corpus/templates/calendar/app/i18n-data.ts +20 -0
  65. package/corpus/templates/calendar/changelog/2026-08-06-delegated-requests-continue-in-the-background.md +6 -0
  66. package/corpus/templates/calendar/changelog/2026-08-06-existing-events-can-move-between-connected-google-account-ca.md +6 -0
  67. package/corpus/templates/calendar/server/lib/google-calendar.ts +101 -0
  68. package/corpus/templates/calendar/server/plugins/agent-chat.ts +7 -1
  69. package/corpus/templates/chat/.agents/skills/turn-into-app/SKILL.md +296 -0
  70. package/corpus/templates/chat/.agents/skills/turn-into-app/agents/openai.yaml +4 -0
  71. package/corpus/templates/chat/.agents/skills/turn-into-skill/SKILL.md +112 -0
  72. package/corpus/templates/chat/.agents/skills/turn-into-skill/agents/openai.yaml +4 -0
  73. package/corpus/templates/clips/.agents/skills/turn-into-app/SKILL.md +296 -0
  74. package/corpus/templates/clips/.agents/skills/turn-into-app/agents/openai.yaml +4 -0
  75. package/corpus/templates/clips/.agents/skills/turn-into-skill/SKILL.md +112 -0
  76. package/corpus/templates/clips/.agents/skills/turn-into-skill/agents/openai.yaml +4 -0
  77. package/corpus/templates/clips/app/components/editor/editor-layout.tsx +9 -24
  78. package/corpus/templates/clips/app/components/editor/timeline-geometry.ts +15 -0
  79. package/corpus/templates/clips/app/components/editor/waveform.tsx +4 -17
  80. package/corpus/templates/clips/app/components/player/delete-recording-menu.tsx +14 -3
  81. package/corpus/templates/clips/app/routes/r.$recordingId.tsx +28 -38
  82. package/corpus/templates/clips/app/routes/share.$shareId.tsx +21 -27
  83. package/corpus/templates/clips/changelog/2026-08-06-clips-recovers-from-stalled-recording-setup-without-requirin.md +6 -0
  84. package/corpus/templates/clips/changelog/2026-08-06-clips-starts-faster-after-a-deploy-or-idle-period-startup-no.md +6 -0
  85. package/corpus/templates/clips/changelog/2026-08-06-deleting-a-recording-returns-cleanly-to-the-library-and-fit-.md +6 -0
  86. package/corpus/templates/clips/changelog/2026-08-06-hide-clip-insights-from-viewers-without-analytics-access.md +6 -0
  87. package/corpus/templates/clips/desktop/src/app.tsx +48 -20
  88. package/corpus/templates/clips/desktop/src/lib/recorder.ts +275 -74
  89. package/corpus/templates/clips/desktop/src/lib/recording-start-guard.ts +84 -0
  90. package/corpus/templates/clips/desktop/src/overlays/toolbar.tsx +14 -4
  91. package/corpus/templates/clips/server/plugins/db.ts +214 -26
  92. package/corpus/templates/content/.agents/skills/turn-into-app/SKILL.md +296 -0
  93. package/corpus/templates/content/.agents/skills/turn-into-app/agents/openai.yaml +4 -0
  94. package/corpus/templates/content/.agents/skills/turn-into-skill/SKILL.md +112 -0
  95. package/corpus/templates/content/.agents/skills/turn-into-skill/agents/openai.yaml +4 -0
  96. package/corpus/templates/crm/.agents/skills/turn-into-app/SKILL.md +296 -0
  97. package/corpus/templates/crm/.agents/skills/turn-into-app/agents/openai.yaml +4 -0
  98. package/corpus/templates/crm/.agents/skills/turn-into-skill/SKILL.md +112 -0
  99. package/corpus/templates/crm/.agents/skills/turn-into-skill/agents/openai.yaml +4 -0
  100. package/corpus/templates/crm/changelog/2026-08-06-crm-starts-faster-after-a-deploy-or-idle-period-one-time-dat.md +6 -0
  101. package/corpus/templates/crm/server/plugins/db.ts +11 -8
  102. package/corpus/templates/design/.agents/skills/design-generation/SKILL.md +36 -1
  103. package/corpus/templates/design/.agents/skills/turn-into-app/SKILL.md +296 -0
  104. package/corpus/templates/design/.agents/skills/turn-into-app/agents/openai.yaml +4 -0
  105. package/corpus/templates/design/.agents/skills/turn-into-skill/SKILL.md +112 -0
  106. package/corpus/templates/design/.agents/skills/turn-into-skill/agents/openai.yaml +4 -0
  107. package/corpus/templates/design/actions/import-from-url.ts +1 -1
  108. package/corpus/templates/design/app/components/design/LayersPanel.tsx +27 -18
  109. package/corpus/templates/design/app/pages/Index.tsx +6 -2
  110. package/corpus/templates/design/changelog/2026-08-05-deleting-a-design-from-the-home-page-no-longer-leaves-the-ap.md +6 -0
  111. package/corpus/templates/design/changelog/2026-08-05-renaming-a-layer-now-focuses-its-name-field-automatically.md +6 -0
  112. package/corpus/templates/design/server/plugins/agent-chat.ts +2 -0
  113. package/corpus/templates/dispatch/.agents/skills/turn-into-app/SKILL.md +296 -0
  114. package/corpus/templates/dispatch/.agents/skills/turn-into-app/agents/openai.yaml +4 -0
  115. package/corpus/templates/dispatch/.agents/skills/turn-into-skill/SKILL.md +112 -0
  116. package/corpus/templates/dispatch/.agents/skills/turn-into-skill/agents/openai.yaml +4 -0
  117. package/corpus/templates/dispatch/changelog/2026-08-06-ready-workspace-apps-stay-one-click-away-in-a-compact-dispat.md +6 -0
  118. package/corpus/templates/dispatch/changelog/2026-08-06-shared-vault-values-and-management-are-now-restricted-to-wor.md +6 -0
  119. package/corpus/templates/factory/.agents/skills/turn-into-app/SKILL.md +296 -0
  120. package/corpus/templates/factory/.agents/skills/turn-into-app/agents/openai.yaml +4 -0
  121. package/corpus/templates/factory/.agents/skills/turn-into-skill/SKILL.md +112 -0
  122. package/corpus/templates/factory/.agents/skills/turn-into-skill/agents/openai.yaml +4 -0
  123. package/corpus/templates/forms/.agents/skills/turn-into-app/SKILL.md +296 -0
  124. package/corpus/templates/forms/.agents/skills/turn-into-app/agents/openai.yaml +4 -0
  125. package/corpus/templates/forms/.agents/skills/turn-into-skill/SKILL.md +112 -0
  126. package/corpus/templates/forms/.agents/skills/turn-into-skill/agents/openai.yaml +4 -0
  127. package/corpus/templates/forms/changelog/2026-08-06-delegated-requests-continue-in-the-background.md +6 -0
  128. package/corpus/templates/forms/server/plugins/agent-chat.ts +4 -0
  129. package/corpus/templates/macros/.agents/skills/turn-into-app/SKILL.md +296 -0
  130. package/corpus/templates/macros/.agents/skills/turn-into-app/agents/openai.yaml +4 -0
  131. package/corpus/templates/macros/.agents/skills/turn-into-skill/SKILL.md +112 -0
  132. package/corpus/templates/macros/.agents/skills/turn-into-skill/agents/openai.yaml +4 -0
  133. package/corpus/templates/mail/.agents/skills/turn-into-app/SKILL.md +296 -0
  134. package/corpus/templates/mail/.agents/skills/turn-into-app/agents/openai.yaml +4 -0
  135. package/corpus/templates/mail/.agents/skills/turn-into-skill/SKILL.md +112 -0
  136. package/corpus/templates/mail/.agents/skills/turn-into-skill/agents/openai.yaml +4 -0
  137. package/corpus/templates/mail/changelog/2026-08-06-delegated-requests-continue-in-the-background.md +6 -0
  138. package/corpus/templates/mail/server/plugins/agent-chat.ts +6 -0
  139. package/corpus/templates/plan/.agents/skills/turn-into-app/SKILL.md +296 -0
  140. package/corpus/templates/plan/.agents/skills/turn-into-app/agents/openai.yaml +4 -0
  141. package/corpus/templates/plan/.agents/skills/turn-into-skill/SKILL.md +112 -0
  142. package/corpus/templates/plan/.agents/skills/turn-into-skill/agents/openai.yaml +4 -0
  143. package/corpus/templates/slides/.agents/skills/create-deck/SKILL.md +48 -5
  144. package/corpus/templates/slides/.agents/skills/design-systems/SKILL.md +37 -1
  145. package/corpus/templates/slides/.agents/skills/image-generation-via-a2a/SKILL.md +6 -0
  146. package/corpus/templates/slides/.agents/skills/slide-editing/SKILL.md +15 -2
  147. package/corpus/templates/slides/.agents/skills/slide-images/SKILL.md +29 -24
  148. package/corpus/templates/slides/.agents/skills/turn-into-app/SKILL.md +296 -0
  149. package/corpus/templates/slides/.agents/skills/turn-into-app/agents/openai.yaml +4 -0
  150. package/corpus/templates/slides/.agents/skills/turn-into-skill/SKILL.md +112 -0
  151. package/corpus/templates/slides/.agents/skills/turn-into-skill/agents/openai.yaml +4 -0
  152. package/corpus/templates/slides/AGENTS.md +7 -9
  153. package/corpus/templates/slides/_gitignore +1 -0
  154. package/corpus/templates/slides/actions/export-pptx.ts +402 -36
  155. package/corpus/templates/slides/actions/import-file.ts +46 -85
  156. package/corpus/templates/slides/actions/import-google-slides-reference.ts +271 -12
  157. package/corpus/templates/slides/actions/import-pptx.ts +85 -60
  158. package/corpus/templates/slides/app/components/deck/DeckCard.tsx +10 -13
  159. package/corpus/templates/slides/app/components/editor/AddSlidePopover.tsx +5 -1
  160. package/corpus/templates/slides/app/components/editor/EditorToolbar.tsx +25 -12
  161. package/corpus/templates/slides/app/components/editor/ExportMenu.tsx +112 -57
  162. package/corpus/templates/slides/app/components/editor/GoogleDriveConnectionCta.tsx +202 -0
  163. package/corpus/templates/slides/app/components/editor/GoogleSlidesReferenceImport.tsx +26 -14
  164. package/corpus/templates/slides/app/components/editor/PromptDialog.tsx +173 -0
  165. package/corpus/templates/slides/app/components/editor/SlideEditor.tsx +182 -141
  166. package/corpus/templates/slides/app/components/editor/canvas-interactions/index.ts +1 -0
  167. package/corpus/templates/slides/app/components/editor/canvas-interactions/slides-canvas-adapter.ts +18 -0
  168. package/corpus/templates/slides/app/components/editor/slide-text-targets.ts +85 -0
  169. package/corpus/templates/slides/app/components/layout/Layout.tsx +3 -0
  170. package/corpus/templates/slides/app/components/onboarding/FirstDeckOnboardingFlow.tsx +4 -0
  171. package/corpus/templates/slides/app/components/presentation/PresentationView.tsx +27 -1
  172. package/corpus/templates/slides/app/i18n/en-US.ts +1 -0
  173. package/corpus/templates/slides/app/lib/create-deck-generation.ts +1 -1
  174. package/corpus/templates/slides/app/lib/deck-preview-frame.ts +15 -0
  175. package/corpus/templates/slides/app/lib/deck-share-links.ts +9 -0
  176. package/corpus/templates/slides/app/lib/export-pptx-client.ts +89 -0
  177. package/corpus/templates/slides/app/lib/slide-animation-elements.ts +3 -0
  178. package/corpus/templates/slides/app/pages/Index.tsx +91 -1
  179. package/corpus/templates/slides/changelog/2026-08-06-clicking-the-gray-canvas-around-a-slide-clears-its-selection.md +6 -0
  180. package/corpus/templates/slides/changelog/2026-08-06-deck-thumbnails-keep-a-consistent-listing-frame-across-aspec.md +6 -0
  181. package/corpus/templates/slides/changelog/2026-08-06-deep-linked-decks-open-directly-instead-of-being-interrupted.md +6 -0
  182. package/corpus/templates/slides/changelog/2026-08-06-google-slides-exports-now-show-clear-import-steps-when-direc.md +6 -0
  183. package/corpus/templates/slides/changelog/2026-08-06-import-pdf-google-slides-and-powerpoint-decks-directly-from-.md +6 -0
  184. package/corpus/templates/slides/changelog/2026-08-06-imported-powerpoint-exports-keep-text-and-images-editable-an.md +6 -0
  185. package/corpus/templates/slides/changelog/2026-08-06-presentation-prompts-continue-adding-rendered-slides-until-t.md +6 -0
  186. package/corpus/templates/slides/changelog/2026-08-06-public-decks-now-share-read-only-presentation-links-by-defau.md +6 -0
  187. package/corpus/templates/slides/changelog/2026-08-06-slides-offers-a-direct-connect-google-button-when-a-drive-co.md +6 -0
  188. package/corpus/templates/slides/changelog/2026-08-06-slides-preserve-uploaded-pdf-layouts-accept-larger-reference.md +6 -0
  189. package/corpus/templates/slides/changelog/2026-08-06-styled-words-stay-part-of-their-text-box-instead-of-becoming.md +6 -0
  190. package/corpus/templates/slides/server/handlers/google-docs-auth.ts +7 -20
  191. package/corpus/templates/slides/server/handlers/import/html-converter.ts +236 -13
  192. package/corpus/templates/slides/server/handlers/import/pptx-assets.ts +67 -0
  193. package/corpus/templates/slides/server/handlers/import/pptx-parser.ts +2 -0
  194. package/corpus/templates/slides/server/handlers/uploads.ts +7 -3
  195. package/corpus/templates/slides/server/lib/chat-attachments.ts +6 -3
  196. package/corpus/templates/slides/server/lib/emails.ts +7 -2
  197. package/corpus/templates/slides/server/lib/google-docs-error.ts +50 -0
  198. package/corpus/templates/slides/server/lib/google-docs-oauth.ts +1 -0
  199. package/corpus/templates/slides/server/lib/import-asset-storage.ts +127 -0
  200. package/corpus/templates/slides/server/plugins/agent-chat.ts +4 -3
  201. package/corpus/templates/slides/server/routes/api/import-assets/[token].get.ts +70 -0
  202. package/corpus/templates/slides/shared/upload-types.ts +3 -0
  203. package/corpus/templates/tasks/.agents/skills/turn-into-app/SKILL.md +296 -0
  204. package/corpus/templates/tasks/.agents/skills/turn-into-app/agents/openai.yaml +4 -0
  205. package/corpus/templates/tasks/.agents/skills/turn-into-skill/SKILL.md +112 -0
  206. package/corpus/templates/tasks/.agents/skills/turn-into-skill/agents/openai.yaml +4 -0
  207. package/dist/agent/production-agent.d.ts +17 -0
  208. package/dist/agent/production-agent.js +72 -1
  209. package/dist/cli/agent-plugin.d.ts +112 -0
  210. package/dist/cli/agent-plugin.js +1081 -0
  211. package/dist/cli/app-skill.js +39 -1
  212. package/dist/cli/code-agent-executor.d.ts +3 -0
  213. package/dist/cli/code-agent-executor.js +51 -13
  214. package/dist/cli/index.js +13 -0
  215. package/dist/cli/templates-meta.js +1 -1
  216. package/dist/client/AgentPanel.d.ts +3 -1
  217. package/dist/client/AgentPanel.js +9 -2
  218. package/dist/client/AssistantChat.d.ts +8 -0
  219. package/dist/client/AssistantChat.js +23 -8
  220. package/dist/client/NewWorkspaceAppFlow.js +1 -0
  221. package/dist/client/agent-chat-adapter.js +123 -4
  222. package/dist/client/assistant-ui-recovery.d.ts +2 -1
  223. package/dist/client/assistant-ui-recovery.js +7 -3
  224. package/dist/client/onboarding/FirstRunOnboarding.js +11 -4
  225. package/dist/client/org/TeamPage.js +1 -1
  226. package/dist/client/require-session.js +1 -1
  227. package/dist/client/resources/McpConnectionSuggestion.d.ts +1 -0
  228. package/dist/client/resources/McpConnectionSuggestion.js +27 -10
  229. package/dist/client/resources/McpIntegrationDialog.js +77 -45
  230. package/dist/client/resources/mcp-integration-catalog.d.ts +13 -1
  231. package/dist/client/resources/mcp-integration-catalog.js +255 -2
  232. package/dist/client/resources/mcp-integration-logos.js +18 -2
  233. package/dist/client/settings/AccountSettingsCard.js +2 -1
  234. package/dist/collab/routes.d.ts +1 -1
  235. package/dist/collab/struct-routes.d.ts +1 -1
  236. package/dist/db/client.d.ts +9 -0
  237. package/dist/db/client.js +51 -16
  238. package/dist/db/create-get-db.js +2 -2
  239. package/dist/db/ddl-guard.d.ts +11 -10
  240. package/dist/db/ddl-guard.js +40 -12
  241. package/dist/deploy/build.d.ts +2 -0
  242. package/dist/deploy/build.js +97 -4
  243. package/dist/deploy/workspace-deploy.js +0 -2
  244. package/dist/file-upload/actions/upload-image.d.ts +1 -1
  245. package/dist/guards/no-env-credentials.js +9 -0
  246. package/dist/ingestion/index.d.ts +1 -1
  247. package/dist/ingestion/pptx.d.ts +68 -0
  248. package/dist/ingestion/pptx.js +660 -213
  249. package/dist/integrations/plugin.js +9 -6
  250. package/dist/localization/default-messages.d.ts +54 -0
  251. package/dist/localization/default-messages.js +57 -2
  252. package/dist/mcp/screen-memory-stdio.d.ts +7 -7
  253. package/dist/mcp-client/oauth-routes.d.ts +2 -0
  254. package/dist/mcp-client/oauth-routes.js +73 -6
  255. package/dist/notifications/routes.d.ts +1 -1
  256. package/dist/observability/routes.d.ts +3 -3
  257. package/dist/onboarding/app-profile.js +11 -0
  258. package/dist/resources/handlers.d.ts +1 -1
  259. package/dist/resources/store.js +15 -1
  260. package/dist/scripts/call-agent.js +34 -4
  261. package/dist/secrets/routes.d.ts +9 -9
  262. package/dist/server/agent-chat/action-filters-a2a.d.ts +1 -1
  263. package/dist/server/agent-chat/action-filters-a2a.js +36 -1
  264. package/dist/server/agent-chat-plugin.js +29 -8
  265. package/dist/server/agent-engine-api-key-route.d.ts +1 -1
  266. package/dist/server/auth.js +47 -11
  267. package/dist/server/better-auth-instance.js +5 -3
  268. package/dist/server/core-routes-plugin.d.ts +8 -1
  269. package/dist/server/core-routes-plugin.js +28 -3
  270. package/dist/server/credential-provider.d.ts +3 -3
  271. package/dist/server/credential-provider.js +90 -4
  272. package/dist/server/onboarding-html.d.ts +2 -0
  273. package/dist/server/onboarding-html.js +115 -29
  274. package/dist/server/self-dispatch.d.ts +5 -4
  275. package/dist/server/self-dispatch.js +25 -14
  276. package/dist/server/ssr-handler.d.ts +1 -1
  277. package/dist/server/ssr-handler.js +1 -1
  278. package/dist/server/transcribe-voice.d.ts +1 -1
  279. package/dist/shared/cache-control.d.ts +26 -2
  280. package/dist/shared/cache-control.js +43 -2
  281. package/dist/shared/password-policy.d.ts +3 -0
  282. package/dist/shared/password-policy.js +3 -0
  283. package/dist/sharing/actions/set-resource-visibility.js +16 -4
  284. package/dist/sharing/registry.d.ts +14 -0
  285. package/dist/styles/agent-native.css +6 -0
  286. package/dist/templates/chat/.agents/skills/turn-into-app/SKILL.md +296 -0
  287. package/dist/templates/chat/.agents/skills/turn-into-app/agents/openai.yaml +4 -0
  288. package/dist/templates/chat/.agents/skills/turn-into-skill/SKILL.md +112 -0
  289. package/dist/templates/chat/.agents/skills/turn-into-skill/agents/openai.yaml +4 -0
  290. package/dist/templates/default/.agents/skills/turn-into-app/SKILL.md +296 -0
  291. package/dist/templates/default/.agents/skills/turn-into-app/agents/openai.yaml +4 -0
  292. package/dist/templates/default/.agents/skills/turn-into-skill/SKILL.md +112 -0
  293. package/dist/templates/default/.agents/skills/turn-into-skill/agents/openai.yaml +4 -0
  294. package/dist/templates/headless/.agents/skills/turn-into-app/SKILL.md +296 -0
  295. package/dist/templates/headless/.agents/skills/turn-into-app/agents/openai.yaml +4 -0
  296. package/dist/templates/headless/.agents/skills/turn-into-skill/SKILL.md +112 -0
  297. package/dist/templates/headless/.agents/skills/turn-into-skill/agents/openai.yaml +4 -0
  298. package/dist/templates/workspace-core/.agents/skills/adding-workspace-apps/SKILL.md +6 -0
  299. package/dist/templates/workspace-core/.agents/skills/performance/SKILL.md +51 -0
  300. package/dist/templates/workspace-core/.agents/skills/turn-into-app/SKILL.md +296 -0
  301. package/dist/templates/workspace-core/.agents/skills/turn-into-app/agents/openai.yaml +4 -0
  302. package/dist/templates/workspace-core/.agents/skills/turn-into-skill/SKILL.md +112 -0
  303. package/dist/templates/workspace-core/.agents/skills/turn-into-skill/agents/openai.yaml +4 -0
  304. package/dist/templates/workspace-root/AGENTS.md +7 -0
  305. package/dist/user-profile/actions/change-password.js +8 -3
  306. package/dist/user-profile/actions/set-password.js +5 -1
  307. package/dist/vite/action-types-plugin.js +59 -0
  308. package/docs/content/skills-guide.mdx +13 -0
  309. package/package.json +6 -2
  310. package/src/templates/chat/.agents/skills/turn-into-app/SKILL.md +296 -0
  311. package/src/templates/chat/.agents/skills/turn-into-app/agents/openai.yaml +4 -0
  312. package/src/templates/chat/.agents/skills/turn-into-skill/SKILL.md +112 -0
  313. package/src/templates/chat/.agents/skills/turn-into-skill/agents/openai.yaml +4 -0
  314. package/src/templates/default/.agents/skills/turn-into-app/SKILL.md +296 -0
  315. package/src/templates/default/.agents/skills/turn-into-app/agents/openai.yaml +4 -0
  316. package/src/templates/default/.agents/skills/turn-into-skill/SKILL.md +112 -0
  317. package/src/templates/default/.agents/skills/turn-into-skill/agents/openai.yaml +4 -0
  318. package/src/templates/headless/.agents/skills/turn-into-app/SKILL.md +296 -0
  319. package/src/templates/headless/.agents/skills/turn-into-app/agents/openai.yaml +4 -0
  320. package/src/templates/headless/.agents/skills/turn-into-skill/SKILL.md +112 -0
  321. package/src/templates/headless/.agents/skills/turn-into-skill/agents/openai.yaml +4 -0
  322. package/src/templates/workspace-core/.agents/skills/adding-workspace-apps/SKILL.md +6 -0
  323. package/src/templates/workspace-core/.agents/skills/performance/SKILL.md +51 -0
  324. package/src/templates/workspace-core/.agents/skills/turn-into-app/SKILL.md +296 -0
  325. package/src/templates/workspace-core/.agents/skills/turn-into-app/agents/openai.yaml +4 -0
  326. package/src/templates/workspace-core/.agents/skills/turn-into-skill/SKILL.md +112 -0
  327. package/src/templates/workspace-core/.agents/skills/turn-into-skill/agents/openai.yaml +4 -0
  328. package/src/templates/workspace-root/AGENTS.md +7 -0
@@ -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
@@ -923,8 +923,17 @@ declare const messages: {
923
923
  presetAuthDescription: string;
924
924
  customDescription: string;
925
925
  oauthNotice: string;
926
+ providerSetupRequired: string;
927
+ providerSetupDescription: string;
928
+ providerSetupFormDescription: string;
929
+ continueToConnect: string;
930
+ setupTitle: string;
926
931
  personal: string;
927
932
  organization: string;
933
+ scopeQuestion: string;
934
+ personalDescription: string;
935
+ sharedWithWorkspace: string;
936
+ organizationDescription: string;
928
937
  serverNameRequired: string;
929
938
  serverName: string;
930
939
  url: string;
@@ -955,6 +964,11 @@ declare const messages: {
955
964
  useCase: string;
956
965
  setupNote: string;
957
966
  };
967
+ amplitude: {
968
+ description: string;
969
+ useCase: string;
970
+ setupNote: string;
971
+ };
958
972
  notion: {
959
973
  description: string;
960
974
  useCase: string;
@@ -965,6 +979,11 @@ declare const messages: {
965
979
  useCase: string;
966
980
  setupNote: string;
967
981
  };
982
+ gong: {
983
+ description: string;
984
+ useCase: string;
985
+ setupNote: string;
986
+ };
968
987
  semgrep: {
969
988
  description: string;
970
989
  useCase: string;
@@ -973,6 +992,21 @@ declare const messages: {
973
992
  description: string;
974
993
  useCase: string;
975
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
+ };
976
1010
  supabase: {
977
1011
  description: string;
978
1012
  useCase: string;
@@ -995,6 +1029,16 @@ declare const messages: {
995
1029
  useCase: string;
996
1030
  setupNote: string;
997
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
+ };
998
1042
  gitlab: {
999
1043
  description: string;
1000
1044
  useCase: string;
@@ -1035,6 +1079,11 @@ declare const messages: {
1035
1079
  useCase: string;
1036
1080
  setupNote: string;
1037
1081
  };
1082
+ pylon: {
1083
+ description: string;
1084
+ useCase: string;
1085
+ setupNote: string;
1086
+ };
1038
1087
  intercom: {
1039
1088
  description: string;
1040
1089
  useCase: string;
@@ -1060,6 +1109,11 @@ declare const messages: {
1060
1109
  useCase: string;
1061
1110
  setupNote: string;
1062
1111
  };
1112
+ builder: {
1113
+ description: string;
1114
+ useCase: string;
1115
+ setupNote: string;
1116
+ };
1063
1117
  netlify: {
1064
1118
  description: string;
1065
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...",
@@ -928,8 +929,17 @@ const messages = {
928
929
  presetAuthDescription: "Preset values are filled in. Add any required authorization details before connecting.",
929
930
  customDescription: "Paste a Streamable HTTP or SSE endpoint and optional headers.",
930
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}}",
931
937
  personal: "Personal",
932
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.",
933
943
  serverNameRequired: "Enter an integration name before connecting with OAuth.",
934
944
  serverName: "Integration name",
935
945
  url: "URL",
@@ -960,6 +970,11 @@ const messages = {
960
970
  useCase: "Product analytics, session replay, qualitative behavior, user research",
961
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.",
962
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
+ },
963
978
  notion: {
964
979
  description: "Search pages and team knowledge.",
965
980
  useCase: "Documentation, knowledge management, notes, content creation",
@@ -970,6 +985,11 @@ const messages = {
970
985
  useCase: "Meeting notes, recordings, transcripts, action items, follow-ups",
971
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.",
972
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
+ },
973
993
  semgrep: {
974
994
  description: "Scan code for security findings.",
975
995
  useCase: "Security scanning, vulnerability detection, code analysis",
@@ -978,6 +998,21 @@ const messages = {
978
998
  description: "Read and write Linear issues.",
979
999
  useCase: "Project management, issue tracking, planning, bug reports",
980
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
+ },
981
1016
  supabase: {
982
1017
  description: "Manage data, auth, and backend services.",
983
1018
  useCase: "Database, authentication, storage, edge functions",
@@ -1000,6 +1035,16 @@ const messages = {
1000
1035
  useCase: "DNS, Workers, domains, security, observability, platform APIs",
1001
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.",
1002
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
+ },
1003
1048
  gitlab: {
1004
1049
  description: "Read and manage GitLab projects, issues, and merge requests.",
1005
1050
  useCase: "Repositories, issues, merge requests, CI/CD, code analytics",
@@ -1038,7 +1083,12 @@ const messages = {
1038
1083
  hubspot: {
1039
1084
  description: "Search and update HubSpot CRM records through its integration.",
1040
1085
  useCase: "CRM, contacts, companies, deals, tickets, customer analytics",
1041
- 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.",
1042
1092
  },
1043
1093
  intercom: {
1044
1094
  description: "Search conversations and customer support knowledge.",
@@ -1065,6 +1115,11 @@ const messages = {
1065
1115
  useCase: "Files, folders, enterprise content, search, collaboration",
1066
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.",
1067
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
+ },
1068
1123
  netlify: {
1069
1124
  description: "Inspect and operate Netlify sites and deployments.",
1070
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)
@@ -28,6 +28,6 @@ export declare function createNotificationsHandler(): import("h3").EventHandlerW
28
28
  } | {
29
29
  count?: undefined;
30
30
  updated?: undefined;
31
- ok: boolean;
32
31
  error?: undefined;
32
+ ok: boolean;
33
33
  }>>;
@@ -41,16 +41,16 @@ export declare function createObservabilityHandler(): import("h3").EventHandlerW
41
41
  thumbsUpRate: number;
42
42
  avgEvalScore: number;
43
43
  } | {
44
+ error?: undefined;
44
45
  summary: import("./types.js").TraceSummary;
45
46
  spans: import("./types.js").TraceSpan[];
46
47
  id?: undefined;
47
- error?: undefined;
48
48
  ok?: undefined;
49
49
  } | {
50
+ error?: undefined;
50
51
  summary?: undefined;
51
52
  spans?: undefined;
52
53
  id: string;
53
- error?: undefined;
54
54
  ok?: undefined;
55
55
  } | {
56
56
  summary?: undefined;
@@ -59,9 +59,9 @@ export declare function createObservabilityHandler(): import("h3").EventHandlerW
59
59
  error: any;
60
60
  ok?: undefined;
61
61
  } | {
62
+ error?: undefined;
62
63
  summary?: undefined;
63
64
  spans?: undefined;
64
65
  id?: undefined;
65
66
  ok: boolean;
66
- error?: undefined;
67
67
  }>>;
@@ -6,6 +6,14 @@ const LLM_CAPABILITY = {
6
6
  keySummary: "One model key: Anthropic, OpenAI, Gemini, Groq, Mistral, or Cohere",
7
7
  why: "The agent uses a language model to understand requests and produce answers.",
8
8
  };
9
+ const DESIGN_SYSTEM_INTELLIGENCE_CAPABILITY = {
10
+ id: "design-system-intelligence",
11
+ label: "Design system intelligence",
12
+ required: false,
13
+ builderIncluded: true,
14
+ keySummary: "Builder Design System Intelligence",
15
+ why: "Uses your brand and design-system guidance to keep generated work on brand.",
16
+ };
9
17
  const PROFILES = {
10
18
  analytics: {
11
19
  appId: "analytics",
@@ -42,6 +50,7 @@ const PROFILES = {
42
50
  keySummary: "Gemini for video, or OpenAI / Gemini for images",
43
51
  why: "These providers create the images and videos requested in the app.",
44
52
  },
53
+ DESIGN_SYSTEM_INTELLIGENCE_CAPABILITY,
45
54
  {
46
55
  id: "file-storage",
47
56
  label: "Media storage",
@@ -169,6 +178,7 @@ const PROFILES = {
169
178
  appName: "Design",
170
179
  capabilities: [
171
180
  LLM_CAPABILITY,
181
+ DESIGN_SYSTEM_INTELLIGENCE_CAPABILITY,
172
182
  {
173
183
  id: "assets-library",
174
184
  label: "Assets library",
@@ -313,6 +323,7 @@ const PROFILES = {
313
323
  appName: "Slides",
314
324
  capabilities: [
315
325
  LLM_CAPABILITY,
326
+ DESIGN_SYSTEM_INTELLIGENCE_CAPABILITY,
316
327
  {
317
328
  id: "image-generation",
318
329
  label: "Image generation",
@@ -48,8 +48,8 @@ export declare function handleUpdateResource(event: any): Promise<import("./stor
48
48
  }>;
49
49
  /** DELETE /_agent-native/resources/:id — delete a resource */
50
50
  export declare function handleDeleteResource(event: any): Promise<{
51
- error: string;
52
51
  ok?: undefined;
52
+ error: string;
53
53
  } | {
54
54
  error?: undefined;
55
55
  ok: boolean;
@@ -1,6 +1,6 @@
1
1
  import crypto from "crypto";
2
2
  import { getDbExec, isPostgres, intType, retryOnDdlRace, } from "../db/client.js";
3
- import { ensureColumnExists, ensureTableExists } from "../db/ddl-guard.js";
3
+ import { ensureColumnExists, ensureIndexExists, ensureTableExists, } from "../db/ddl-guard.js";
4
4
  import { widenIntColumnsToBigInt } from "../db/widen-columns.js";
5
5
  import { canUseLocalWorkspaceResourcePath, deleteLocalWorkspaceResource, isLocalWorkspaceResourceId, isLocalWorkspaceResourcesEnabled, listLocalWorkspaceResources, localWorkspaceResourcePathFromId, readLocalWorkspaceResource, writeLocalWorkspaceResource, } from "../local-artifacts/index.js";
6
6
  import { getRequestOrgId, getRequestUserEmail, } from "../server/request-context.js";
@@ -655,6 +655,20 @@ async function _doEnsureTable() {
655
655
  "updated_at",
656
656
  "expires_at",
657
657
  ]);
658
+ // `cleanupExpiredAgentScratchResources` filters on exactly these two columns
659
+ // and, without this, full-scans `resources` — a table shared by every
660
+ // template and read from agent discovery, docs, chat scratch and remote-agent
661
+ // manifests. Its 60s throttle is a module-scope timestamp that starts at 0 in
662
+ // a fresh isolate, so the first resource read after EVERY cold start pays
663
+ // that scan. Idempotent and dialect-agnostic, per the `performance` skill.
664
+ await ensureIndexExists("resources_visibility_expires_idx", `CREATE INDEX IF NOT EXISTS resources_visibility_expires_idx ON resources (visibility, expires_at)`).catch((err) => {
665
+ // An index is an optimization, not a correctness requirement: a
666
+ // concurrent creator or a permissions edge must not fail table init and
667
+ // take the app down with it. The scan it avoids is slow, not wrong — but
668
+ // say so, because "silently slow forever" is the outcome nobody notices.
669
+ // coercion-ok: absence of an index degrades latency, never correctness
670
+ console.warn("[resources] could not ensure resources_visibility_expires_idx; scratch cleanup will full-scan:", err?.message ?? err);
671
+ });
658
672
  // Seed default shared resources if they don't exist (INSERT OR IGNORE to avoid race conditions)
659
673
  const now = Date.now();
660
674
  const seedSql = isPostgres()