@agent-native/core 0.145.5 → 0.145.6
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.
- package/corpus/README.md +1 -1
- package/corpus/templates/analytics/.agents/skills/actions/SKILL.md +18 -0
- package/corpus/templates/analytics/.agents/skills/agent-native-toolkit/SKILL.md +5 -0
- package/corpus/templates/analytics/.agents/skills/dashboard-management/SKILL.md +17 -1
- package/corpus/templates/analytics/.agents/skills/delegate-to-agent/SKILL.md +45 -47
- package/corpus/templates/analytics/.agents/skills/frontend-design/SKILL.md +1 -0
- package/corpus/templates/analytics/.agents/skills/gong/SKILL.md +22 -3
- package/corpus/templates/analytics/.agents/skills/turn-into-app/SKILL.md +76 -23
- package/corpus/templates/analytics/.agents/skills/turn-into-app/agents/openai.yaml +2 -2
- package/corpus/templates/analytics/.agents/skills/turn-into-app/references/fresh-project.md +64 -0
- package/corpus/templates/analytics/AGENTS.md +2 -1
- package/corpus/templates/analytics/actions/account-deep-dive.ts +83 -47
- package/corpus/templates/analytics/actions/create-dashboard-folder.ts +27 -0
- package/corpus/templates/analytics/actions/gong-calls.ts +3 -3
- package/corpus/templates/analytics/actions/list-dashboard-folders.ts +26 -0
- package/corpus/templates/analytics/actions/list-sql-dashboards.ts +1 -0
- package/corpus/templates/analytics/actions/set-dashboard-folder.ts +26 -0
- package/corpus/templates/analytics/app/components/ProviderCorpusJobNotifier.tsx +18 -3
- package/corpus/templates/analytics/app/components/layout/CommandPalette.tsx +6 -4
- package/corpus/templates/analytics/app/components/layout/Header.tsx +1 -0
- package/corpus/templates/analytics/app/components/layout/NewDashboardDialog.tsx +12 -2
- package/corpus/templates/analytics/app/components/layout/Sidebar.tsx +35 -20
- package/corpus/templates/analytics/app/global.css +17 -0
- package/corpus/templates/analytics/app/hooks/use-dashboard-revisions.ts +29 -15
- package/corpus/templates/analytics/app/hooks/use-dashboard-views.ts +15 -3
- package/corpus/templates/analytics/app/i18n-data.ts +296 -0
- package/corpus/templates/analytics/app/lib/prefetch-keys.ts +23 -2
- package/corpus/templates/analytics/app/pages/DashboardOverview.tsx +642 -0
- package/corpus/templates/analytics/app/pages/adhoc/sql-dashboard/index.tsx +66 -31
- package/corpus/templates/analytics/app/root.tsx +4 -0
- package/corpus/templates/analytics/app/routes/dashboards._index.tsx +5 -1
- package/corpus/templates/analytics/changelog/2026-08-07-added-a-dashboards-overview-with-personal-and-shared-folders.md +6 -0
- package/corpus/templates/analytics/changelog/2026-08-07-analytics-tracking-and-chat-startup-no-longer-emit-avoidable.md +6 -0
- package/corpus/templates/analytics/changelog/2026-08-07-dashboard-panels-now-load-custom-api-data-programs-reliably.md +6 -0
- package/corpus/templates/analytics/changelog/2026-08-07-gong-searches-conserve-api-quota-and-report-incomplete-coverage.md +6 -0
- package/corpus/templates/analytics/changelog/2026-08-07-searchable-dashboards-make-personal-and-shared-folders-easie.md +6 -0
- package/corpus/templates/analytics/netlify.toml +3 -0
- package/corpus/templates/analytics/scripts/emit-netlify-dashboard-report-cron.ts +112 -0
- package/corpus/templates/analytics/server/db/index.ts +12 -0
- package/corpus/templates/analytics/server/db/schema.ts +14 -0
- package/corpus/templates/analytics/server/jobs/analytics-rollup-backfill.ts +4 -0
- package/corpus/templates/analytics/server/lib/agent-chat-plan-mode.ts +1 -0
- package/corpus/templates/analytics/server/lib/analytics-query-catalog.ts +85 -15
- package/corpus/templates/analytics/server/lib/dashboard-folders-store.ts +168 -0
- package/corpus/templates/analytics/server/lib/dashboard-panel-query.ts +9 -4
- package/corpus/templates/analytics/server/lib/dashboards-store.ts +116 -1
- package/corpus/templates/analytics/server/lib/first-party-analytics-rollups.ts +4 -8
- package/corpus/templates/analytics/server/lib/gong.ts +139 -78
- package/corpus/templates/analytics/server/plugins/db.ts +55 -15
- package/corpus/templates/analytics/server/plugins/session-replay-retention-jobs.ts +6 -2
- package/corpus/templates/analytics/server/routes/api/session-replay/retention.post.ts +65 -0
- package/corpus/templates/assets/.agents/skills/actions/SKILL.md +18 -0
- package/corpus/templates/assets/.agents/skills/agent-native-toolkit/SKILL.md +5 -0
- package/corpus/templates/assets/.agents/skills/delegate-to-agent/SKILL.md +45 -47
- package/corpus/templates/assets/.agents/skills/frontend-design/SKILL.md +1 -0
- package/corpus/templates/assets/.agents/skills/turn-into-app/SKILL.md +76 -23
- package/corpus/templates/assets/.agents/skills/turn-into-app/agents/openai.yaml +2 -2
- package/corpus/templates/assets/.agents/skills/turn-into-app/references/fresh-project.md +64 -0
- package/corpus/templates/brain/.agents/skills/actions/SKILL.md +18 -0
- package/corpus/templates/brain/.agents/skills/agent-native-toolkit/SKILL.md +5 -0
- package/corpus/templates/brain/.agents/skills/delegate-to-agent/SKILL.md +45 -47
- package/corpus/templates/brain/.agents/skills/frontend-design/SKILL.md +1 -0
- package/corpus/templates/brain/.agents/skills/turn-into-app/SKILL.md +76 -23
- package/corpus/templates/brain/.agents/skills/turn-into-app/agents/openai.yaml +2 -2
- package/corpus/templates/brain/.agents/skills/turn-into-app/references/fresh-project.md +64 -0
- package/corpus/templates/calendar/.agents/skills/actions/SKILL.md +18 -0
- package/corpus/templates/calendar/.agents/skills/agent-native-toolkit/SKILL.md +5 -0
- package/corpus/templates/calendar/.agents/skills/delegate-to-agent/SKILL.md +45 -47
- package/corpus/templates/calendar/.agents/skills/frontend-design/SKILL.md +1 -0
- package/corpus/templates/calendar/.agents/skills/turn-into-app/SKILL.md +76 -23
- package/corpus/templates/calendar/.agents/skills/turn-into-app/agents/openai.yaml +2 -2
- package/corpus/templates/calendar/.agents/skills/turn-into-app/references/fresh-project.md +64 -0
- package/corpus/templates/chat/.agents/skills/actions/SKILL.md +18 -0
- package/corpus/templates/chat/.agents/skills/agent-native-toolkit/SKILL.md +5 -0
- package/corpus/templates/chat/.agents/skills/delegate-to-agent/SKILL.md +45 -47
- package/corpus/templates/chat/.agents/skills/frontend-design/SKILL.md +1 -0
- package/corpus/templates/chat/.agents/skills/turn-into-app/SKILL.md +76 -23
- package/corpus/templates/chat/.agents/skills/turn-into-app/agents/openai.yaml +2 -2
- package/corpus/templates/chat/.agents/skills/turn-into-app/references/fresh-project.md +64 -0
- package/corpus/templates/chat/.env.example +3 -0
- package/corpus/templates/chat/AGENTS.md +4 -0
- package/corpus/templates/clips/.agents/skills/actions/SKILL.md +18 -0
- package/corpus/templates/clips/.agents/skills/agent-native-toolkit/SKILL.md +5 -0
- package/corpus/templates/clips/.agents/skills/delegate-to-agent/SKILL.md +45 -47
- package/corpus/templates/clips/.agents/skills/frontend-design/SKILL.md +1 -0
- package/corpus/templates/clips/.agents/skills/turn-into-app/SKILL.md +76 -23
- package/corpus/templates/clips/.agents/skills/turn-into-app/agents/openai.yaml +2 -2
- package/corpus/templates/clips/.agents/skills/turn-into-app/references/fresh-project.md +64 -0
- package/corpus/templates/clips/actions/lib/audio-only-transcription.ts +4 -0
- package/corpus/templates/clips/actions/request-transcript.ts +52 -3
- package/corpus/templates/clips/app/components/recorder/recorder-engine.ts +3 -10
- package/corpus/templates/clips/app/routes/r.$recordingId.tsx +1 -0
- package/corpus/templates/clips/changelog/2026-08-07-screen-recordings-now-capture-tab-and-system-audio-even-when.md +6 -0
- package/corpus/templates/clips/changelog/2026-08-07-transcription-now-retries-transient-cloud-failures-automatic.md +6 -0
- package/corpus/templates/clips/server/db/schema.ts +7 -0
- package/corpus/templates/clips/server/plugins/db.ts +8 -0
- package/corpus/templates/clips/shared/recording-capture.ts +38 -0
- package/corpus/templates/clips/shared/transcript-failure.ts +89 -0
- package/corpus/templates/content/.agents/skills/actions/SKILL.md +18 -0
- package/corpus/templates/content/.agents/skills/agent-native-toolkit/SKILL.md +5 -0
- package/corpus/templates/content/.agents/skills/delegate-to-agent/SKILL.md +45 -47
- package/corpus/templates/content/.agents/skills/frontend-design/SKILL.md +1 -0
- package/corpus/templates/content/.agents/skills/turn-into-app/SKILL.md +76 -23
- package/corpus/templates/content/.agents/skills/turn-into-app/agents/openai.yaml +2 -2
- package/corpus/templates/content/.agents/skills/turn-into-app/references/fresh-project.md +64 -0
- package/corpus/templates/content/.env.example +9 -3
- package/corpus/templates/content/app/components/sidebar/DocumentSidebar.tsx +1 -0
- package/corpus/templates/content/changelog/2026-08-07-collapsed-sidebar-utility-buttons-stay-anchored-at-the-botto.md +6 -0
- package/corpus/templates/crm/.agents/skills/agent-native-toolkit/SKILL.md +5 -0
- package/corpus/templates/crm/.agents/skills/turn-into-app/SKILL.md +76 -23
- package/corpus/templates/crm/.agents/skills/turn-into-app/agents/openai.yaml +2 -2
- package/corpus/templates/crm/.agents/skills/turn-into-app/references/fresh-project.md +64 -0
- package/corpus/templates/design/.agents/skills/actions/SKILL.md +18 -0
- package/corpus/templates/design/.agents/skills/agent-native-toolkit/SKILL.md +5 -0
- package/corpus/templates/design/.agents/skills/delegate-to-agent/SKILL.md +45 -47
- package/corpus/templates/design/.agents/skills/frontend-design/SKILL.md +1 -0
- package/corpus/templates/design/.agents/skills/turn-into-app/SKILL.md +76 -23
- package/corpus/templates/design/.agents/skills/turn-into-app/agents/openai.yaml +2 -2
- package/corpus/templates/design/.agents/skills/turn-into-app/references/fresh-project.md +64 -0
- package/corpus/templates/dispatch/.agents/skills/actions/SKILL.md +18 -0
- package/corpus/templates/dispatch/.agents/skills/agent-native-toolkit/SKILL.md +5 -0
- package/corpus/templates/dispatch/.agents/skills/delegate-to-agent/SKILL.md +45 -47
- package/corpus/templates/dispatch/.agents/skills/frontend-design/SKILL.md +1 -0
- package/corpus/templates/dispatch/.agents/skills/turn-into-app/SKILL.md +76 -23
- package/corpus/templates/dispatch/.agents/skills/turn-into-app/agents/openai.yaml +2 -2
- package/corpus/templates/dispatch/.agents/skills/turn-into-app/references/fresh-project.md +64 -0
- package/corpus/templates/factory/.agents/skills/actions/SKILL.md +18 -0
- package/corpus/templates/factory/.agents/skills/agent-native-toolkit/SKILL.md +5 -0
- package/corpus/templates/factory/.agents/skills/delegate-to-agent/SKILL.md +45 -47
- package/corpus/templates/factory/.agents/skills/frontend-design/SKILL.md +1 -0
- package/corpus/templates/factory/.agents/skills/turn-into-app/SKILL.md +76 -23
- package/corpus/templates/factory/.agents/skills/turn-into-app/agents/openai.yaml +2 -2
- package/corpus/templates/factory/.agents/skills/turn-into-app/references/fresh-project.md +64 -0
- package/corpus/templates/factory/actions/babysit-agent-native-pull-request.ts +279 -0
- package/corpus/templates/factory/actions/get-factory-automation-health.ts +23 -4
- package/corpus/templates/factory/app/components/factory/FactoryCanvas.tsx +1 -1
- package/corpus/templates/factory/app/routes/factory.tsx +21 -3
- package/corpus/templates/factory/changelog/2026-08-07-factory-can-keep-builder-bot-pull-requests-moving-by-request.md +6 -0
- package/corpus/templates/factory/server/lib/require-factory-automation.ts +1 -0
- package/corpus/templates/factory/server/plugins/agent-chat.ts +4 -1
- package/corpus/templates/factory/server/plugins/factory-scheduler-job.ts +81 -12
- package/corpus/templates/factory/server/triage/github-client.ts +31 -0
- package/corpus/templates/factory/server/triage/pr-babysit.ts +75 -1
- package/corpus/templates/forms/.agents/skills/actions/SKILL.md +18 -0
- package/corpus/templates/forms/.agents/skills/agent-native-toolkit/SKILL.md +5 -0
- package/corpus/templates/forms/.agents/skills/delegate-to-agent/SKILL.md +45 -47
- package/corpus/templates/forms/.agents/skills/frontend-design/SKILL.md +1 -0
- package/corpus/templates/forms/.agents/skills/turn-into-app/SKILL.md +76 -23
- package/corpus/templates/forms/.agents/skills/turn-into-app/agents/openai.yaml +2 -2
- package/corpus/templates/forms/.agents/skills/turn-into-app/references/fresh-project.md +64 -0
- package/corpus/templates/macros/.agents/skills/agent-native-toolkit/SKILL.md +5 -0
- package/corpus/templates/macros/.agents/skills/frontend-design/SKILL.md +1 -0
- package/corpus/templates/macros/.agents/skills/turn-into-app/SKILL.md +76 -23
- package/corpus/templates/macros/.agents/skills/turn-into-app/agents/openai.yaml +2 -2
- package/corpus/templates/macros/.agents/skills/turn-into-app/references/fresh-project.md +64 -0
- package/corpus/templates/mail/.agents/skills/actions/SKILL.md +18 -0
- package/corpus/templates/mail/.agents/skills/agent-native-toolkit/SKILL.md +5 -0
- package/corpus/templates/mail/.agents/skills/delegate-to-agent/SKILL.md +45 -47
- package/corpus/templates/mail/.agents/skills/frontend-design/SKILL.md +1 -0
- package/corpus/templates/mail/.agents/skills/turn-into-app/SKILL.md +76 -23
- package/corpus/templates/mail/.agents/skills/turn-into-app/agents/openai.yaml +2 -2
- package/corpus/templates/mail/.agents/skills/turn-into-app/references/fresh-project.md +64 -0
- package/corpus/templates/plan/.agents/skills/actions/SKILL.md +18 -0
- package/corpus/templates/plan/.agents/skills/agent-native-toolkit/SKILL.md +5 -0
- package/corpus/templates/plan/.agents/skills/delegate-to-agent/SKILL.md +45 -47
- package/corpus/templates/plan/.agents/skills/frontend-design/SKILL.md +1 -0
- package/corpus/templates/plan/.agents/skills/turn-into-app/SKILL.md +76 -23
- package/corpus/templates/plan/.agents/skills/turn-into-app/agents/openai.yaml +2 -2
- package/corpus/templates/plan/.agents/skills/turn-into-app/references/fresh-project.md +64 -0
- package/corpus/templates/plan/app/pages/PlansPage.tsx +2 -1
- package/corpus/templates/plan/changelog/2026-08-07-inline-help-icons-now-stay-visually-balanced-with-nearby-tex.md +6 -0
- package/corpus/templates/slides/.agents/skills/actions/SKILL.md +18 -0
- package/corpus/templates/slides/.agents/skills/agent-native-toolkit/SKILL.md +5 -0
- package/corpus/templates/slides/.agents/skills/delegate-to-agent/SKILL.md +45 -47
- package/corpus/templates/slides/.agents/skills/frontend-design/SKILL.md +1 -0
- package/corpus/templates/slides/.agents/skills/turn-into-app/SKILL.md +76 -23
- package/corpus/templates/slides/.agents/skills/turn-into-app/agents/openai.yaml +2 -2
- package/corpus/templates/slides/.agents/skills/turn-into-app/references/fresh-project.md +64 -0
- package/corpus/templates/slides/.env.example +5 -0
- package/corpus/templates/slides/changelog/2026-08-07-fixed-generated-slides-briefly-disappearing-while-they-are-b.md +6 -0
- package/corpus/templates/slides/server/plugins/collab.ts +20 -8
- package/corpus/templates/tasks/.agents/skills/actions/SKILL.md +18 -0
- package/corpus/templates/tasks/.agents/skills/agent-native-toolkit/SKILL.md +5 -0
- package/corpus/templates/tasks/.agents/skills/delegate-to-agent/SKILL.md +45 -47
- package/corpus/templates/tasks/.agents/skills/frontend-design/SKILL.md +1 -0
- package/corpus/templates/tasks/.agents/skills/turn-into-app/SKILL.md +76 -23
- package/corpus/templates/tasks/.agents/skills/turn-into-app/agents/openai.yaml +2 -2
- package/corpus/templates/tasks/.agents/skills/turn-into-app/references/fresh-project.md +64 -0
- package/corpus/templates/tasks/.env.example +3 -0
- package/dist/agent/production-agent.js +24 -3
- package/dist/client/AgentPanel.d.ts +6 -0
- package/dist/client/AgentPanel.js +176 -30
- package/dist/client/AssistantChat.d.ts +2 -0
- package/dist/client/AssistantChat.js +4 -1
- package/dist/client/ConnectBuilderCard.js +6 -11
- package/dist/client/MultiTabAssistantChat.js +1 -1
- package/dist/client/RuntimeConfigNotice.d.ts +1 -0
- package/dist/client/RuntimeConfigNotice.js +94 -0
- package/dist/client/agent-chat/index.d.ts +1 -1
- package/dist/client/agent-chat/index.js +1 -1
- package/dist/client/agent-chat-adapter.js +85 -4
- package/dist/client/agent-page/AgentTabsPage.js +1 -1
- package/dist/client/agent-sidebar-state.d.ts +6 -0
- package/dist/client/agent-sidebar-state.js +25 -0
- package/dist/client/app-providers.js +2 -1
- package/dist/client/assistant-ui-recovery.js +1 -1
- package/dist/client/chat/index.d.ts +1 -1
- package/dist/client/chat/index.js +1 -1
- package/dist/client/chat/markdown-renderer.d.ts +2 -1
- package/dist/client/chat/markdown-renderer.js +48 -2
- package/dist/client/chat/message-components.d.ts +6 -0
- package/dist/client/chat/message-components.js +182 -53
- package/dist/client/chat/tool-call-display.d.ts +16 -4
- package/dist/client/chat/tool-call-display.js +225 -18
- package/dist/client/extensions/ExtensionsSidebarSection.js +1 -1
- package/dist/client/frame-protocol.d.ts +4 -0
- package/dist/client/i18n.js +9 -0
- package/dist/client/integrations/IntegrationsPanel.js +2 -5
- package/dist/client/onboarding/FirstRunOnboarding.js +2 -3
- package/dist/client/org/TeamPage.js +49 -6
- package/dist/client/org/hooks.d.ts +7 -2
- package/dist/client/org/hooks.js +11 -4
- package/dist/client/resources/McpConnectionSuggestion.js +2 -3
- package/dist/client/resources/McpIntegrationDialog.js +2 -16
- package/dist/client/resources/McpIntegrationLogo.d.ts +11 -0
- package/dist/client/resources/McpIntegrationLogo.js +14 -0
- package/dist/client/resources/ResourceTree.js +1 -1
- package/dist/client/resources/mcp-integration-logos.d.ts +1 -0
- package/dist/client/resources/mcp-integration-logos.js +47 -18
- package/dist/client/settings/useBuilderStatus.js +6 -0
- package/dist/client/ui/index.d.ts +1 -0
- package/dist/client/ui/index.js +1 -0
- package/dist/collab/routes.d.ts +1 -1
- package/dist/config.d.ts +26 -3
- package/dist/config.js +106 -14
- package/dist/db/ddl-guard.d.ts +15 -2
- package/dist/db/ddl-guard.js +53 -5
- package/dist/jobs/scheduler.js +7 -0
- package/dist/localization/default-messages.d.ts +17 -0
- package/dist/localization/default-messages.js +17 -0
- package/dist/mcp/oauth-client-metadata.js +5 -1
- package/dist/mcp/oauth-route.d.ts +5 -4
- package/dist/mcp/oauth-route.js +25 -9
- package/dist/mcp/screen-memory-stdio.d.ts +7 -7
- package/dist/mcp/server.d.ts +1 -1
- package/dist/mcp/server.js +9 -10
- package/dist/notifications/routes.d.ts +3 -3
- package/dist/org/handlers.d.ts +1 -0
- package/dist/org/handlers.js +17 -2
- package/dist/provider-api/actions/custom-provider-registration.d.ts +5 -5
- package/dist/provider-api/actions/provider-api.d.ts +7 -7
- package/dist/provider-api/corpus-jobs.d.ts +12 -2
- package/dist/provider-api/corpus-jobs.js +31 -1
- package/dist/provider-api/index.d.ts +2 -0
- package/dist/provider-api/index.js +7 -1
- package/dist/resources/handlers.d.ts +1 -1
- package/dist/secrets/routes.d.ts +3 -3
- package/dist/server/agent-chat/recurring-jobs-runtime.d.ts +1 -1
- package/dist/server/agent-chat/recurring-jobs-runtime.js +14 -2
- package/dist/server/agent-chat/script-entries.js +12 -1
- package/dist/server/agent-chat-plugin.js +2 -2
- package/dist/server/agent-engine-api-key-route.d.ts +1 -1
- package/dist/server/auth.d.ts +1 -0
- package/dist/server/auth.js +85 -1
- package/dist/server/better-auth-instance.d.ts +9 -0
- package/dist/server/better-auth-instance.js +25 -11
- package/dist/server/core-routes-plugin.d.ts +7 -0
- package/dist/server/core-routes-plugin.js +51 -5
- package/dist/server/create-server.js +23 -2
- package/dist/server/db-pressure.d.ts +38 -0
- package/dist/server/db-pressure.js +147 -0
- package/dist/server/index.d.ts +1 -0
- package/dist/server/index.js +1 -0
- package/dist/server/legacy-auth-migration.d.ts +10 -0
- package/dist/server/legacy-auth-migration.js +37 -0
- package/dist/server/onboarding-html.js +206 -2
- package/dist/server/poll.d.ts +26 -0
- package/dist/server/poll.js +108 -13
- package/dist/server/ssr-handler.js +4 -1
- package/dist/shared/index.d.ts +1 -0
- package/dist/shared/index.js +1 -0
- package/dist/shared/runtime-config.d.ts +44 -0
- package/dist/shared/runtime-config.js +284 -0
- package/dist/styles/agent-native.css +48 -1
- package/dist/templates/chat/.agents/skills/actions/SKILL.md +18 -0
- package/dist/templates/chat/.agents/skills/agent-native-toolkit/SKILL.md +5 -0
- package/dist/templates/chat/.agents/skills/delegate-to-agent/SKILL.md +45 -47
- package/dist/templates/chat/.agents/skills/frontend-design/SKILL.md +1 -0
- package/dist/templates/chat/.agents/skills/turn-into-app/SKILL.md +76 -23
- package/dist/templates/chat/.agents/skills/turn-into-app/agents/openai.yaml +2 -2
- package/dist/templates/chat/.agents/skills/turn-into-app/references/fresh-project.md +64 -0
- package/dist/templates/chat/.env.example +3 -0
- package/dist/templates/chat/AGENTS.md +4 -0
- package/dist/templates/default/.agents/skills/actions/SKILL.md +18 -0
- package/dist/templates/default/.agents/skills/agent-native-toolkit/SKILL.md +5 -0
- package/dist/templates/default/.agents/skills/delegate-to-agent/SKILL.md +45 -47
- package/dist/templates/default/.agents/skills/frontend-design/SKILL.md +1 -0
- package/dist/templates/default/.agents/skills/turn-into-app/SKILL.md +76 -23
- package/dist/templates/default/.agents/skills/turn-into-app/agents/openai.yaml +2 -2
- package/dist/templates/default/.agents/skills/turn-into-app/references/fresh-project.md +64 -0
- package/dist/templates/default/AGENTS.md +6 -1
- package/dist/templates/default/app/i18n/ar-SA.ts +6 -0
- package/dist/templates/default/app/i18n/de-DE.ts +6 -0
- package/dist/templates/default/app/i18n/en-US.ts +6 -0
- package/dist/templates/default/app/i18n/es-ES.ts +6 -0
- package/dist/templates/default/app/i18n/fr-FR.ts +6 -0
- package/dist/templates/default/app/i18n/hi-IN.ts +6 -0
- package/dist/templates/default/app/i18n/ja-JP.ts +6 -0
- package/dist/templates/default/app/i18n/ko-KR.ts +6 -0
- package/dist/templates/default/app/i18n/pt-BR.ts +6 -0
- package/dist/templates/default/app/i18n/zh-CN.ts +6 -0
- package/dist/templates/default/app/i18n/zh-TW.ts +6 -0
- package/dist/templates/headless/.agents/skills/actions/SKILL.md +18 -0
- package/dist/templates/headless/.agents/skills/agent-native-toolkit/SKILL.md +5 -0
- package/dist/templates/headless/.agents/skills/turn-into-app/SKILL.md +76 -23
- package/dist/templates/headless/.agents/skills/turn-into-app/agents/openai.yaml +2 -2
- package/dist/templates/headless/.agents/skills/turn-into-app/references/fresh-project.md +64 -0
- package/dist/templates/workspace-core/.agents/skills/actions/SKILL.md +18 -0
- package/dist/templates/workspace-core/.agents/skills/agent-native-toolkit/SKILL.md +5 -0
- package/dist/templates/workspace-core/.agents/skills/delegate-to-agent/SKILL.md +45 -47
- package/dist/templates/workspace-core/.agents/skills/frontend-design/SKILL.md +1 -0
- package/dist/templates/workspace-core/.agents/skills/turn-into-app/SKILL.md +76 -23
- package/dist/templates/workspace-core/.agents/skills/turn-into-app/agents/openai.yaml +2 -2
- package/dist/templates/workspace-core/.agents/skills/turn-into-app/references/fresh-project.md +64 -0
- package/dist/templates/workspace-core/.agents/skills/workspace-conventions/SKILL.md +4 -0
- package/dist/templates/workspace-core/.agents/skills/writing-agent-instructions/SKILL.md +8 -0
- package/dist/templates/workspace-core/AGENTS.md +7 -2
- package/dist/templates/workspace-root/AGENTS.md +5 -0
- package/dist/vite/client.d.ts +3 -3
- package/dist/vite/client.js +47 -1
- package/dist/vite/index.d.ts +1 -1
- package/docs/content/agent-native-config.mdx +240 -139
- package/docs/content/authentication.mdx +17 -0
- package/docs/content/deployment.mdx +19 -14
- package/docs/content/drop-in-agent.mdx +19 -2
- package/docs/content/environment-variables.mdx +63 -38
- package/docs/content/getting-started-actions.mdx +15 -6
- package/docs/content/getting-started-database.mdx +14 -10
- package/docs/content/getting-started-pages.mdx +32 -35
- package/docs/content/getting-started.mdx +7 -6
- package/package.json +1 -1
- package/src/templates/chat/.agents/skills/actions/SKILL.md +18 -0
- package/src/templates/chat/.agents/skills/agent-native-toolkit/SKILL.md +5 -0
- package/src/templates/chat/.agents/skills/delegate-to-agent/SKILL.md +45 -47
- package/src/templates/chat/.agents/skills/frontend-design/SKILL.md +1 -0
- package/src/templates/chat/.agents/skills/turn-into-app/SKILL.md +76 -23
- package/src/templates/chat/.agents/skills/turn-into-app/agents/openai.yaml +2 -2
- package/src/templates/chat/.agents/skills/turn-into-app/references/fresh-project.md +64 -0
- package/src/templates/chat/.env.example +3 -0
- package/src/templates/chat/AGENTS.md +4 -0
- package/src/templates/default/.agents/skills/actions/SKILL.md +18 -0
- package/src/templates/default/.agents/skills/agent-native-toolkit/SKILL.md +5 -0
- package/src/templates/default/.agents/skills/delegate-to-agent/SKILL.md +45 -47
- package/src/templates/default/.agents/skills/frontend-design/SKILL.md +1 -0
- package/src/templates/default/.agents/skills/turn-into-app/SKILL.md +76 -23
- package/src/templates/default/.agents/skills/turn-into-app/agents/openai.yaml +2 -2
- package/src/templates/default/.agents/skills/turn-into-app/references/fresh-project.md +64 -0
- package/src/templates/default/AGENTS.md +6 -1
- package/src/templates/default/app/i18n/ar-SA.ts +6 -0
- package/src/templates/default/app/i18n/de-DE.ts +6 -0
- package/src/templates/default/app/i18n/en-US.ts +6 -0
- package/src/templates/default/app/i18n/es-ES.ts +6 -0
- package/src/templates/default/app/i18n/fr-FR.ts +6 -0
- package/src/templates/default/app/i18n/hi-IN.ts +6 -0
- package/src/templates/default/app/i18n/ja-JP.ts +6 -0
- package/src/templates/default/app/i18n/ko-KR.ts +6 -0
- package/src/templates/default/app/i18n/pt-BR.ts +6 -0
- package/src/templates/default/app/i18n/zh-CN.ts +6 -0
- package/src/templates/default/app/i18n/zh-TW.ts +6 -0
- package/src/templates/headless/.agents/skills/actions/SKILL.md +18 -0
- package/src/templates/headless/.agents/skills/agent-native-toolkit/SKILL.md +5 -0
- package/src/templates/headless/.agents/skills/turn-into-app/SKILL.md +76 -23
- package/src/templates/headless/.agents/skills/turn-into-app/agents/openai.yaml +2 -2
- package/src/templates/headless/.agents/skills/turn-into-app/references/fresh-project.md +64 -0
- package/src/templates/workspace-core/.agents/skills/actions/SKILL.md +18 -0
- package/src/templates/workspace-core/.agents/skills/agent-native-toolkit/SKILL.md +5 -0
- package/src/templates/workspace-core/.agents/skills/delegate-to-agent/SKILL.md +45 -47
- package/src/templates/workspace-core/.agents/skills/frontend-design/SKILL.md +1 -0
- package/src/templates/workspace-core/.agents/skills/turn-into-app/SKILL.md +76 -23
- package/src/templates/workspace-core/.agents/skills/turn-into-app/agents/openai.yaml +2 -2
- package/src/templates/workspace-core/.agents/skills/turn-into-app/references/fresh-project.md +64 -0
- package/src/templates/workspace-core/.agents/skills/workspace-conventions/SKILL.md +4 -0
- package/src/templates/workspace-core/.agents/skills/writing-agent-instructions/SKILL.md +8 -0
- package/src/templates/workspace-core/AGENTS.md +7 -2
- package/src/templates/workspace-root/AGENTS.md +5 -0
- package/corpus/templates/dispatch/app/routes/admin.apps.$appId.tsx +0 -1
- package/corpus/templates/dispatch/app/routes/admin.apps.tsx +0 -1
package/dist/db/ddl-guard.js
CHANGED
|
@@ -71,7 +71,16 @@ async function loadSchemaSnapshot(client) {
|
|
|
71
71
|
try {
|
|
72
72
|
const [columnRows, indexRows] = await Promise.all([
|
|
73
73
|
client.execute(`SELECT table_name, column_name FROM information_schema.columns WHERE table_schema = 'public'`),
|
|
74
|
-
client.execute(`SELECT indexname
|
|
74
|
+
client.execute(`SELECT indexes.indexname
|
|
75
|
+
FROM pg_indexes AS indexes
|
|
76
|
+
JOIN pg_class AS index_class ON index_class.relname = indexes.indexname
|
|
77
|
+
JOIN pg_namespace AS index_namespace
|
|
78
|
+
ON index_namespace.oid = index_class.relnamespace
|
|
79
|
+
AND index_namespace.nspname = indexes.schemaname
|
|
80
|
+
JOIN pg_index AS index_state ON index_state.indexrelid = index_class.oid
|
|
81
|
+
WHERE indexes.schemaname = 'public'
|
|
82
|
+
AND index_state.indisvalid
|
|
83
|
+
AND index_state.indisready`),
|
|
75
84
|
]);
|
|
76
85
|
// An EMPTY result is a valid snapshot (a fresh database really has nothing
|
|
77
86
|
// in `public`). A result whose rows lack the columns we asked for is not —
|
|
@@ -233,8 +242,8 @@ export async function pgColumnExists(table, column, injectedClient) {
|
|
|
233
242
|
}
|
|
234
243
|
}
|
|
235
244
|
/**
|
|
236
|
-
* True when running against Postgres AND
|
|
237
|
-
* exists in the `public` schema. Returns `false` on SQLite, for invalid
|
|
245
|
+
* True when running against Postgres AND a valid, ready index with the given
|
|
246
|
+
* name already exists in the `public` schema. Returns `false` on SQLite, for invalid
|
|
238
247
|
* identifiers, and `undefined` when `pg_indexes` is unreadable.
|
|
239
248
|
*
|
|
240
249
|
* `CREATE INDEX` (without CONCURRENTLY) takes a `SHARE` lock that blocks
|
|
@@ -255,8 +264,20 @@ export async function pgIndexExists(indexName, injectedClient, dialectIsPostgres
|
|
|
255
264
|
return cached;
|
|
256
265
|
try {
|
|
257
266
|
const { rows } = await client.execute({
|
|
258
|
-
sql: `SELECT 1
|
|
259
|
-
|
|
267
|
+
sql: `SELECT 1
|
|
268
|
+
FROM pg_indexes AS indexes
|
|
269
|
+
JOIN pg_class AS index_class
|
|
270
|
+
ON index_class.relname = indexes.indexname
|
|
271
|
+
JOIN pg_namespace AS index_namespace
|
|
272
|
+
ON index_namespace.oid = index_class.relnamespace
|
|
273
|
+
AND index_namespace.nspname = indexes.schemaname
|
|
274
|
+
JOIN pg_index AS index_state
|
|
275
|
+
ON index_state.indexrelid = index_class.oid
|
|
276
|
+
WHERE indexes.schemaname = 'public'
|
|
277
|
+
AND indexes.indexname = ?
|
|
278
|
+
AND index_state.indisvalid
|
|
279
|
+
AND index_state.indisready
|
|
280
|
+
LIMIT 1`,
|
|
260
281
|
args: [indexName],
|
|
261
282
|
});
|
|
262
283
|
return rows.length > 0;
|
|
@@ -370,6 +391,33 @@ export async function ensureIndexExists(indexName, createIndexSql, options = {})
|
|
|
370
391
|
dialectIsPostgres: options.dialectIsPostgres,
|
|
371
392
|
});
|
|
372
393
|
}
|
|
394
|
+
/**
|
|
395
|
+
* Ensure an additive Postgres index with `CREATE INDEX CONCURRENTLY`.
|
|
396
|
+
*
|
|
397
|
+
* This is deliberately separate from `ensureIndexExists`: the normal helper
|
|
398
|
+
* wraps DDL in a transaction so it can scope `lock_timeout`, but PostgreSQL
|
|
399
|
+
* forbids `CREATE INDEX CONCURRENTLY` inside a transaction. The caller must
|
|
400
|
+
* supply the concurrent form of the statement; direct execution keeps the
|
|
401
|
+
* build outside a transaction and avoids blocking writes on a large table.
|
|
402
|
+
*/
|
|
403
|
+
export async function ensureIndexExistsConcurrently(indexName, createIndexSql, options = {}) {
|
|
404
|
+
if (!(options.dialectIsPostgres ?? isPostgres()))
|
|
405
|
+
return false;
|
|
406
|
+
const client = options.injectedClient ?? getDbExec();
|
|
407
|
+
const initiallyExists = await pgIndexExists(indexName, client, options.dialectIsPostgres);
|
|
408
|
+
if (initiallyExists === true)
|
|
409
|
+
return false;
|
|
410
|
+
if (initiallyExists === undefined) {
|
|
411
|
+
throw new Error(`ensureIndexExistsConcurrently: could not probe required index "${indexName}"; refusing to issue DDL`);
|
|
412
|
+
}
|
|
413
|
+
await client.execute(createIndexSql);
|
|
414
|
+
invalidateSchemaSnapshot(client);
|
|
415
|
+
const existsAfterCreate = await pgIndexExists(indexName, client, options.dialectIsPostgres);
|
|
416
|
+
if (existsAfterCreate !== true) {
|
|
417
|
+
throw new Error(`ensureIndexExistsConcurrently: index "${indexName}" is still missing after CREATE INDEX CONCURRENTLY`);
|
|
418
|
+
}
|
|
419
|
+
return true;
|
|
420
|
+
}
|
|
373
421
|
/** True when an error looks like a Postgres `lock_timeout` (SQLSTATE 55P03). */
|
|
374
422
|
export function isLockTimeoutError(err) {
|
|
375
423
|
const anyErr = err;
|
package/dist/jobs/scheduler.js
CHANGED
|
@@ -70,6 +70,13 @@ export async function processRecurringJobs(deps) {
|
|
|
70
70
|
subscribeToJobsResourceEvents();
|
|
71
71
|
// Skip if we recently confirmed there are no job resources to run.
|
|
72
72
|
const nowMs = Date.now();
|
|
73
|
+
// Write a global heartbeat before the resource scan. A slow or failed scan
|
|
74
|
+
// must not make a healthy worker look idle until the finally block runs.
|
|
75
|
+
await recordSchedulerHealthForScopes({
|
|
76
|
+
appId: deps.appId,
|
|
77
|
+
orgIds: [],
|
|
78
|
+
checkedAt: nowMs,
|
|
79
|
+
});
|
|
73
80
|
if (_hasJobsCache === false &&
|
|
74
81
|
nowMs - _lastJobsCheck < JOBS_CHECK_INTERVAL_MS) {
|
|
75
82
|
await recordSchedulerHealthForScopes({
|
|
@@ -428,6 +428,8 @@ declare const messages: {
|
|
|
428
428
|
newTerminal: string;
|
|
429
429
|
panelOptions: string;
|
|
430
430
|
collapseSidebar: string;
|
|
431
|
+
widenChat: string;
|
|
432
|
+
returnChatToLayout: string;
|
|
431
433
|
expandSidebar: string;
|
|
432
434
|
hideChats: string;
|
|
433
435
|
allChats: string;
|
|
@@ -852,6 +854,10 @@ declare const messages: {
|
|
|
852
854
|
noMembers: string;
|
|
853
855
|
memberCount_one: string;
|
|
854
856
|
memberCount_other: string;
|
|
857
|
+
memberPagination: string;
|
|
858
|
+
previousMemberPage: string;
|
|
859
|
+
nextMemberPage: string;
|
|
860
|
+
memberPageStatus: string;
|
|
855
861
|
youAreRole: string;
|
|
856
862
|
changeRole: string;
|
|
857
863
|
removeMember: string;
|
|
@@ -1194,5 +1200,16 @@ declare const messages: {
|
|
|
1194
1200
|
statusTitle: string;
|
|
1195
1201
|
goHome: string;
|
|
1196
1202
|
};
|
|
1203
|
+
runtimeConfig: {
|
|
1204
|
+
issue_one: string;
|
|
1205
|
+
issue_other: string;
|
|
1206
|
+
errorTitle: string;
|
|
1207
|
+
warningTitle: string;
|
|
1208
|
+
showDetails: string;
|
|
1209
|
+
hideDetails: string;
|
|
1210
|
+
copyPrompt: string;
|
|
1211
|
+
copied: string;
|
|
1212
|
+
copyFailed: string;
|
|
1213
|
+
};
|
|
1197
1214
|
};
|
|
1198
1215
|
export default messages;
|
|
@@ -434,6 +434,8 @@ const messages = {
|
|
|
434
434
|
newTerminal: "New terminal",
|
|
435
435
|
panelOptions: "Agent panel options",
|
|
436
436
|
collapseSidebar: "Collapse sidebar",
|
|
437
|
+
widenChat: "Widen chat to 75%",
|
|
438
|
+
returnChatToLayout: "Return chat to layout",
|
|
437
439
|
expandSidebar: "Expand sidebar",
|
|
438
440
|
hideChats: "Hide chats",
|
|
439
441
|
allChats: "All chats",
|
|
@@ -858,6 +860,10 @@ const messages = {
|
|
|
858
860
|
noMembers: "No members yet.",
|
|
859
861
|
memberCount_one: "{{count}} member",
|
|
860
862
|
memberCount_other: "{{count}} members",
|
|
863
|
+
memberPagination: "Member list pagination",
|
|
864
|
+
previousMemberPage: "Go to previous member page",
|
|
865
|
+
nextMemberPage: "Go to next member page",
|
|
866
|
+
memberPageStatus: "Page {{page}} of {{totalPages}}",
|
|
861
867
|
youAreRole: "You are {{role}}",
|
|
862
868
|
changeRole: "Change role",
|
|
863
869
|
removeMember: "Remove member",
|
|
@@ -1200,5 +1206,16 @@ const messages = {
|
|
|
1200
1206
|
statusTitle: "{{status}} Error",
|
|
1201
1207
|
goHome: "Go home",
|
|
1202
1208
|
},
|
|
1209
|
+
runtimeConfig: {
|
|
1210
|
+
issue_one: "{{count}} issue",
|
|
1211
|
+
issue_other: "{{count}} issues",
|
|
1212
|
+
errorTitle: "Configuration error",
|
|
1213
|
+
warningTitle: "Configuration warning",
|
|
1214
|
+
showDetails: "Show details",
|
|
1215
|
+
hideDetails: "Hide details",
|
|
1216
|
+
copyPrompt: "Copy prompt",
|
|
1217
|
+
copied: "Copied",
|
|
1218
|
+
copyFailed: "Copy failed",
|
|
1219
|
+
},
|
|
1203
1220
|
};
|
|
1204
1221
|
export default messages;
|
|
@@ -176,11 +176,15 @@ function validateClientMetadataDocument(clientId, value) {
|
|
|
176
176
|
// support). The token endpoint independently honors only
|
|
177
177
|
// "authorization_code"/"refresh_token" no matter what this list says.
|
|
178
178
|
const grantTypes = parseStringArray(document.grant_types);
|
|
179
|
+
// Metadata documents may advertise extension grants that this server does
|
|
180
|
+
// not implement. The authorization request still selects the supported
|
|
181
|
+
// authorization-code flow, so rejecting an extra grant here only prevents
|
|
182
|
+
// otherwise compatible clients such as Claude from connecting.
|
|
179
183
|
if ((document.grant_types !== undefined &&
|
|
180
184
|
(!Array.isArray(document.grant_types) ||
|
|
181
185
|
grantTypes.length !== document.grant_types.length)) ||
|
|
182
186
|
grantTypes.length > 10) {
|
|
183
|
-
throw new Error("Client metadata document grant_types are
|
|
187
|
+
throw new Error("Client metadata document grant_types are invalid");
|
|
184
188
|
}
|
|
185
189
|
const responseTypes = parseStringArray(document.response_types);
|
|
186
190
|
if ((document.response_types !== undefined &&
|
|
@@ -3,7 +3,8 @@
|
|
|
3
3
|
*
|
|
4
4
|
* These routes let MCP hosts such as Claude Code and ChatGPT authenticate
|
|
5
5
|
* through their native remote-MCP OAuth flow instead of pasting bearer tokens.
|
|
6
|
-
* The issued access tokens are audience-bound to `/mcp
|
|
6
|
+
* The issued access tokens are audience-bound to the public `/mcp` route or
|
|
7
|
+
* its legacy alias, carry
|
|
7
8
|
* the same user/org identity as the existing connect flow, and are mediated by
|
|
8
9
|
* `verifyAuth` before any MCP tool/resource request runs.
|
|
9
10
|
*/
|
|
@@ -13,7 +14,7 @@ export interface McpOAuthRouteOptions {
|
|
|
13
14
|
appName?: string;
|
|
14
15
|
}
|
|
15
16
|
export declare function getMcpOAuthIssuer(event: H3Event): string | undefined;
|
|
16
|
-
export declare function getMcpOAuthResource(event: H3Event): string | undefined;
|
|
17
|
+
export declare function getMcpOAuthResource(event: H3Event, routePath?: string): string | undefined;
|
|
17
18
|
/**
|
|
18
19
|
* All plausible MCP OAuth resource audiences for the given request, deduped.
|
|
19
20
|
*
|
|
@@ -24,8 +25,8 @@ export declare function getMcpOAuthResource(event: H3Event): string | undefined;
|
|
|
24
25
|
* accepts either without issuing a 401.
|
|
25
26
|
*/
|
|
26
27
|
export declare function getMcpOAuthAudiences(event: H3Event): string[];
|
|
27
|
-
export declare function getMcpOAuthProtectedResourceMetadataUrl(event: H3Event): string | undefined;
|
|
28
|
-
export declare function buildMcpOAuthChallenge(event: H3Event): string;
|
|
28
|
+
export declare function getMcpOAuthProtectedResourceMetadataUrl(event: H3Event, routePath?: string): string | undefined;
|
|
29
|
+
export declare function buildMcpOAuthChallenge(event: H3Event, routePath?: string): string;
|
|
29
30
|
export declare function handleMcpOAuthProtectedResourceMetadata(event: H3Event): Response;
|
|
30
31
|
export declare function handleMcpOAuthAuthorizationServerMetadata(event: H3Event): Response;
|
|
31
32
|
export declare function handleMcpOAuth(event: H3Event, subpath: string, options?: McpOAuthRouteOptions): Promise<Response>;
|
package/dist/mcp/oauth-route.js
CHANGED
|
@@ -3,7 +3,8 @@
|
|
|
3
3
|
*
|
|
4
4
|
* These routes let MCP hosts such as Claude Code and ChatGPT authenticate
|
|
5
5
|
* through their native remote-MCP OAuth flow instead of pasting bearer tokens.
|
|
6
|
-
* The issued access tokens are audience-bound to `/mcp
|
|
6
|
+
* The issued access tokens are audience-bound to the public `/mcp` route or
|
|
7
|
+
* its legacy alias, carry
|
|
7
8
|
* the same user/org identity as the existing connect flow, and are mediated by
|
|
8
9
|
* `verifyAuth` before any MCP tool/resource request runs.
|
|
9
10
|
*/
|
|
@@ -16,7 +17,7 @@ import { readBody } from "../server/h3-helpers.js";
|
|
|
16
17
|
import { applicationTypeForRedirectUris, isAllowedOAuthRedirectUri, isUrlBasedOAuthClientId, matchesRegisteredRedirectUri, resolveOAuthClientMetadataDocument, } from "./oauth-client-metadata.js";
|
|
17
18
|
import { createOAuthCode, createOAuthRefreshToken, consumeOAuthCode, generateOpaqueToken, getOAuthClient, getOAuthCode, getOAuthRefreshToken, registerOAuthClient, touchOAuthRefreshToken, } from "./oauth-store.js";
|
|
18
19
|
import { MCP_OAUTH_ACCESS_TOKEN_TTL_SECONDS, MCP_OAUTH_SCOPES, normalizeOAuthScope, signMcpOAuthAccessToken, } from "./oauth-token.js";
|
|
19
|
-
import { MCP_PUBLIC_ROUTE_PREFIX, MCP_ROUTE_PREFIXES } from "./route-paths.js";
|
|
20
|
+
import { MCP_LEGACY_ROUTE_PREFIX, MCP_PUBLIC_ROUTE_PREFIX, MCP_ROUTE_PREFIXES, } from "./route-paths.js";
|
|
20
21
|
const MCP_OAUTH_RESOURCE_SCOPES = MCP_OAUTH_SCOPES.filter((scope) => scope !== "offline_access");
|
|
21
22
|
const MCP_OAUTH_RESOURCE_SCOPE = MCP_OAUTH_RESOURCE_SCOPES.join(" ");
|
|
22
23
|
function json(body, status = 200) {
|
|
@@ -136,11 +137,16 @@ export function getMcpOAuthIssuer(event) {
|
|
|
136
137
|
return undefined;
|
|
137
138
|
return appendConfiguredBasePath(baseUrl);
|
|
138
139
|
}
|
|
139
|
-
|
|
140
|
+
function normalizeMcpResourcePath(routePath) {
|
|
141
|
+
return routePath === MCP_LEGACY_ROUTE_PREFIX
|
|
142
|
+
? MCP_LEGACY_ROUTE_PREFIX
|
|
143
|
+
: MCP_PUBLIC_ROUTE_PREFIX;
|
|
144
|
+
}
|
|
145
|
+
export function getMcpOAuthResource(event, routePath = MCP_PUBLIC_ROUTE_PREFIX) {
|
|
140
146
|
const issuer = getMcpOAuthIssuer(event);
|
|
141
147
|
if (!issuer)
|
|
142
148
|
return undefined;
|
|
143
|
-
return `${issuer}${
|
|
149
|
+
return `${issuer}${normalizeMcpResourcePath(routePath)}`;
|
|
144
150
|
}
|
|
145
151
|
function mcpResourcesForIssuer(issuer) {
|
|
146
152
|
return [
|
|
@@ -182,14 +188,21 @@ export function getMcpOAuthAudiences(event) {
|
|
|
182
188
|
}
|
|
183
189
|
return out;
|
|
184
190
|
}
|
|
185
|
-
export function getMcpOAuthProtectedResourceMetadataUrl(event) {
|
|
191
|
+
export function getMcpOAuthProtectedResourceMetadataUrl(event, routePath = MCP_PUBLIC_ROUTE_PREFIX) {
|
|
186
192
|
const issuer = getMcpOAuthIssuer(event);
|
|
187
193
|
if (!issuer)
|
|
188
194
|
return undefined;
|
|
189
|
-
|
|
195
|
+
const metadataUrl = new URL(`${issuer}/.well-known/oauth-protected-resource`);
|
|
196
|
+
// The public and legacy endpoints share one host-level metadata route. Keep
|
|
197
|
+
// the legacy resource identity in the challenge so OAuth clients that verify
|
|
198
|
+
// an exact resource URL can authenticate old MCP configurations.
|
|
199
|
+
if (normalizeMcpResourcePath(routePath) === MCP_LEGACY_ROUTE_PREFIX) {
|
|
200
|
+
metadataUrl.searchParams.set("resource", MCP_LEGACY_ROUTE_PREFIX);
|
|
201
|
+
}
|
|
202
|
+
return metadataUrl.toString();
|
|
190
203
|
}
|
|
191
|
-
export function buildMcpOAuthChallenge(event) {
|
|
192
|
-
const metadata = getMcpOAuthProtectedResourceMetadataUrl(event);
|
|
204
|
+
export function buildMcpOAuthChallenge(event, routePath = MCP_PUBLIC_ROUTE_PREFIX) {
|
|
205
|
+
const metadata = getMcpOAuthProtectedResourceMetadataUrl(event, routePath);
|
|
193
206
|
const scope = MCP_OAUTH_RESOURCE_SCOPE;
|
|
194
207
|
return metadata
|
|
195
208
|
? `Bearer resource_metadata="${metadata}", scope="${scope}"`
|
|
@@ -215,7 +228,10 @@ export function handleMcpOAuthProtectedResourceMetadata(event) {
|
|
|
215
228
|
if (getMethod(event) !== "GET") {
|
|
216
229
|
return oauthError("invalid_request", "Method not allowed", 405);
|
|
217
230
|
}
|
|
218
|
-
const
|
|
231
|
+
const requestedResourcePath = getQuery(event).resource;
|
|
232
|
+
const resource = getMcpOAuthResource(event, requestedResourcePath === MCP_LEGACY_ROUTE_PREFIX
|
|
233
|
+
? MCP_LEGACY_ROUTE_PREFIX
|
|
234
|
+
: MCP_PUBLIC_ROUTE_PREFIX);
|
|
219
235
|
const issuer = getMcpOAuthIssuer(event);
|
|
220
236
|
if (!resource || !issuer) {
|
|
221
237
|
return oauthError("server_error", "Unable to derive MCP resource", 500);
|
|
@@ -137,13 +137,13 @@ export declare function screenMemoryMcpToolDefinitions(): ({
|
|
|
137
137
|
inputSchema: {
|
|
138
138
|
type: string;
|
|
139
139
|
properties: {
|
|
140
|
-
count?: undefined;
|
|
141
140
|
query?: undefined;
|
|
142
141
|
minutes?: undefined;
|
|
143
142
|
limit?: undefined;
|
|
144
143
|
clientHint?: undefined;
|
|
145
144
|
timestamp?: undefined;
|
|
146
145
|
chapterId?: undefined;
|
|
146
|
+
count?: undefined;
|
|
147
147
|
startAt?: undefined;
|
|
148
148
|
endAt?: undefined;
|
|
149
149
|
reason?: undefined;
|
|
@@ -159,7 +159,6 @@ export declare function screenMemoryMcpToolDefinitions(): ({
|
|
|
159
159
|
inputSchema: {
|
|
160
160
|
type: string;
|
|
161
161
|
properties: {
|
|
162
|
-
count?: undefined;
|
|
163
162
|
query: {
|
|
164
163
|
type: string;
|
|
165
164
|
description: string;
|
|
@@ -175,6 +174,7 @@ export declare function screenMemoryMcpToolDefinitions(): ({
|
|
|
175
174
|
clientHint?: undefined;
|
|
176
175
|
timestamp?: undefined;
|
|
177
176
|
chapterId?: undefined;
|
|
177
|
+
count?: undefined;
|
|
178
178
|
startAt?: undefined;
|
|
179
179
|
endAt?: undefined;
|
|
180
180
|
reason?: undefined;
|
|
@@ -190,7 +190,6 @@ export declare function screenMemoryMcpToolDefinitions(): ({
|
|
|
190
190
|
inputSchema: {
|
|
191
191
|
type: string;
|
|
192
192
|
properties: {
|
|
193
|
-
count?: undefined;
|
|
194
193
|
minutes: {
|
|
195
194
|
type: string;
|
|
196
195
|
description: string;
|
|
@@ -200,6 +199,7 @@ export declare function screenMemoryMcpToolDefinitions(): ({
|
|
|
200
199
|
clientHint?: undefined;
|
|
201
200
|
timestamp?: undefined;
|
|
202
201
|
chapterId?: undefined;
|
|
202
|
+
count?: undefined;
|
|
203
203
|
startAt?: undefined;
|
|
204
204
|
endAt?: undefined;
|
|
205
205
|
reason?: undefined;
|
|
@@ -216,7 +216,6 @@ export declare function screenMemoryMcpToolDefinitions(): ({
|
|
|
216
216
|
type: string;
|
|
217
217
|
required: string[];
|
|
218
218
|
properties: {
|
|
219
|
-
count?: undefined;
|
|
220
219
|
query: {
|
|
221
220
|
type: string;
|
|
222
221
|
description: string;
|
|
@@ -235,6 +234,7 @@ export declare function screenMemoryMcpToolDefinitions(): ({
|
|
|
235
234
|
};
|
|
236
235
|
timestamp?: undefined;
|
|
237
236
|
chapterId?: undefined;
|
|
237
|
+
count?: undefined;
|
|
238
238
|
startAt?: undefined;
|
|
239
239
|
endAt?: undefined;
|
|
240
240
|
reason?: undefined;
|
|
@@ -250,7 +250,6 @@ export declare function screenMemoryMcpToolDefinitions(): ({
|
|
|
250
250
|
type: string;
|
|
251
251
|
required: string[];
|
|
252
252
|
properties: {
|
|
253
|
-
count?: undefined;
|
|
254
253
|
query?: undefined;
|
|
255
254
|
minutes?: undefined;
|
|
256
255
|
limit?: undefined;
|
|
@@ -264,6 +263,7 @@ export declare function screenMemoryMcpToolDefinitions(): ({
|
|
|
264
263
|
description: string;
|
|
265
264
|
};
|
|
266
265
|
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;
|
|
318
317
|
query?: undefined;
|
|
319
318
|
minutes?: undefined;
|
|
320
319
|
limit?: undefined;
|
|
321
320
|
clientHint?: undefined;
|
|
322
321
|
timestamp?: undefined;
|
|
323
322
|
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;
|
|
353
352
|
query?: undefined;
|
|
354
353
|
minutes?: undefined;
|
|
355
354
|
limit?: undefined;
|
|
356
355
|
clientHint?: undefined;
|
|
357
356
|
timestamp?: undefined;
|
|
358
357
|
chapterId?: undefined;
|
|
358
|
+
count?: undefined;
|
|
359
359
|
startAt?: undefined;
|
|
360
360
|
endAt?: undefined;
|
|
361
361
|
reason?: undefined;
|
package/dist/mcp/server.d.ts
CHANGED
|
@@ -20,7 +20,7 @@ export type { MCPConfig, MCPCallerIdentity, MCPRequestMeta };
|
|
|
20
20
|
* h3 mount falls through to the next handler.
|
|
21
21
|
* - a Web `Response` or an auth-error object otherwise.
|
|
22
22
|
*/
|
|
23
|
-
export declare function handleMcpRequest(event: H3Event, config: MCPConfig): Promise<Response | string | {
|
|
23
|
+
export declare function handleMcpRequest(event: H3Event, config: MCPConfig, routePath?: string): Promise<Response | string | {
|
|
24
24
|
error: string;
|
|
25
25
|
} | Record<string, unknown> | undefined>;
|
|
26
26
|
/**
|
package/dist/mcp/server.js
CHANGED
|
@@ -117,10 +117,10 @@ function buildWebRequest(event, method) {
|
|
|
117
117
|
* the authorize/metadata URL. Keeping the legacy `error: "Unauthorized"` field
|
|
118
118
|
* means existing clients that only check that field still work.
|
|
119
119
|
*/
|
|
120
|
-
function buildUnauthorizedBody(event) {
|
|
120
|
+
function buildUnauthorizedBody(event, routePath = MCP_PUBLIC_ROUTE_PREFIX) {
|
|
121
121
|
const issuer = getMcpOAuthIssuer(event);
|
|
122
|
-
const mcpUrl = getMcpOAuthResource(event);
|
|
123
|
-
const resourceMetadataUrl = getMcpOAuthProtectedResourceMetadataUrl(event);
|
|
122
|
+
const mcpUrl = getMcpOAuthResource(event, routePath);
|
|
123
|
+
const resourceMetadataUrl = getMcpOAuthProtectedResourceMetadataUrl(event, routePath);
|
|
124
124
|
const command = issuer
|
|
125
125
|
? `npx -y @agent-native/core@latest reconnect ${issuer}`
|
|
126
126
|
: undefined;
|
|
@@ -170,7 +170,7 @@ function buildUnauthorizedBody(event) {
|
|
|
170
170
|
* h3 mount falls through to the next handler.
|
|
171
171
|
* - a Web `Response` or an auth-error object otherwise.
|
|
172
172
|
*/
|
|
173
|
-
export async function handleMcpRequest(event, config) {
|
|
173
|
+
export async function handleMcpRequest(event, config, routePath = MCP_PUBLIC_ROUTE_PREFIX) {
|
|
174
174
|
const pathname = event.url?.pathname || "/";
|
|
175
175
|
const subpath = pathname.replace(/^\/+/, "").replace(/\/+$/, "");
|
|
176
176
|
if (subpath) {
|
|
@@ -207,8 +207,8 @@ export async function handleMcpRequest(event, config) {
|
|
|
207
207
|
});
|
|
208
208
|
if (!authResult.authed) {
|
|
209
209
|
setResponseStatus(event, 401);
|
|
210
|
-
setResponseHeader(event, "WWW-Authenticate", buildMcpOAuthChallenge(event));
|
|
211
|
-
return buildUnauthorizedBody(event);
|
|
210
|
+
setResponseHeader(event, "WWW-Authenticate", buildMcpOAuthChallenge(event, routePath));
|
|
211
|
+
return buildUnauthorizedBody(event, routePath);
|
|
212
212
|
}
|
|
213
213
|
// Read POST bodies through h3 exactly once. `createMcpHandler` accepts the
|
|
214
214
|
// parsed value, so neither its modern classifier nor its legacy fallback
|
|
@@ -267,11 +267,10 @@ export function mountMCP(nitroApp, config, routePrefix = "/_agent-native") {
|
|
|
267
267
|
const routePaths = routePrefix === "/_agent-native"
|
|
268
268
|
? [...MCP_ROUTE_PREFIXES]
|
|
269
269
|
: [joinMcpRoute(routePrefix, "/mcp")];
|
|
270
|
-
const handler = defineEventHandler(async (event) => {
|
|
271
|
-
return handleMcpRequest(event, config);
|
|
272
|
-
});
|
|
273
270
|
for (const routePath of routePaths) {
|
|
274
|
-
getH3App(nitroApp).use(routePath,
|
|
271
|
+
getH3App(nitroApp).use(routePath, defineEventHandler(async (event) => {
|
|
272
|
+
return handleMcpRequest(event, config, routePath);
|
|
273
|
+
}));
|
|
275
274
|
}
|
|
276
275
|
if (process.env.DEBUG)
|
|
277
276
|
console.log(`[mcp] Mounted MCP server at ${routePaths.join(" and ")} (${Object.keys(config.actions).length} tools${config.askAgent ? " + ask-agent" : ""})`);
|
|
@@ -13,13 +13,13 @@
|
|
|
13
13
|
export declare function createNotificationsHandler(): import("h3").EventHandlerWithFetch<import("h3").EventHandlerRequest, Promise<"" | import("./types.js").Notification[] | {
|
|
14
14
|
count: number;
|
|
15
15
|
updated?: undefined;
|
|
16
|
-
ok?: undefined;
|
|
17
16
|
error?: undefined;
|
|
17
|
+
ok?: undefined;
|
|
18
18
|
} | {
|
|
19
19
|
count?: undefined;
|
|
20
20
|
updated: number;
|
|
21
|
-
ok?: undefined;
|
|
22
21
|
error?: undefined;
|
|
22
|
+
ok?: undefined;
|
|
23
23
|
} | {
|
|
24
24
|
count?: undefined;
|
|
25
25
|
updated?: undefined;
|
|
@@ -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
|
}>>;
|
package/dist/org/handlers.d.ts
CHANGED
package/dist/org/handlers.js
CHANGED
|
@@ -172,8 +172,9 @@ export const createOrgHandler = defineEventHandler(async (event) => {
|
|
|
172
172
|
/** GET /_agent-native/org/members — list org members */
|
|
173
173
|
export const listMembersHandler = defineEventHandler(async (event) => {
|
|
174
174
|
const ctx = await getOrgContext(event);
|
|
175
|
-
if (!ctx.orgId)
|
|
176
|
-
return { members: [], hasMore: false, nextOffset: null };
|
|
175
|
+
if (!ctx.orgId) {
|
|
176
|
+
return { members: [], totalCount: 0, hasMore: false, nextOffset: null };
|
|
177
|
+
}
|
|
177
178
|
const url = getRequestURL(event);
|
|
178
179
|
const search = (url.searchParams.get("search") ??
|
|
179
180
|
url.searchParams.get("q") ??
|
|
@@ -191,22 +192,35 @@ export const listMembersHandler = defineEventHandler(async (event) => {
|
|
|
191
192
|
: 0;
|
|
192
193
|
const e = await exec();
|
|
193
194
|
const args = [ctx.orgId];
|
|
195
|
+
const countArgs = [ctx.orgId];
|
|
194
196
|
let sql = `SELECT email, role, joined_at AS "joinedAt" FROM org_members WHERE org_id = ?`;
|
|
197
|
+
let countSql = `SELECT COUNT(*) AS "totalCount" FROM org_members WHERE org_id = ?`;
|
|
195
198
|
if (search) {
|
|
196
199
|
sql += ` AND LOWER(email) LIKE ? ESCAPE '!'`;
|
|
197
200
|
args.push(`%${escapeLike(search)}%`);
|
|
201
|
+
countSql += ` AND LOWER(email) LIKE ? ESCAPE '!'`;
|
|
202
|
+
countArgs.push(`%${escapeLike(search)}%`);
|
|
198
203
|
}
|
|
199
204
|
sql += ` ORDER BY LOWER(email) ASC`;
|
|
200
205
|
if (limit !== null) {
|
|
201
206
|
sql += ` LIMIT ? OFFSET ?`;
|
|
202
207
|
args.push(limit + 1, offset);
|
|
203
208
|
}
|
|
209
|
+
const totalCountResult = limit === null
|
|
210
|
+
? undefined
|
|
211
|
+
: await e.execute({ sql: countSql, args: countArgs });
|
|
204
212
|
const { rows } = await e.execute({
|
|
205
213
|
sql,
|
|
206
214
|
args,
|
|
207
215
|
});
|
|
208
216
|
const pageRows = limit !== null ? rows.slice(0, limit) : rows;
|
|
209
217
|
const hasMore = limit !== null && rows.length > limit;
|
|
218
|
+
const totalCount = totalCountResult === undefined
|
|
219
|
+
? pageRows.length
|
|
220
|
+
: Number(totalCountResult.rows[0]?.totalCount);
|
|
221
|
+
if (!Number.isSafeInteger(totalCount) || totalCount < 0) {
|
|
222
|
+
throw new Error("Organization member count was not returned");
|
|
223
|
+
}
|
|
210
224
|
const members = pageRows.map((r) => ({
|
|
211
225
|
email: String(r.email),
|
|
212
226
|
role: String(r.role),
|
|
@@ -214,6 +228,7 @@ export const listMembersHandler = defineEventHandler(async (event) => {
|
|
|
214
228
|
}));
|
|
215
229
|
return {
|
|
216
230
|
members,
|
|
231
|
+
totalCount,
|
|
217
232
|
hasMore,
|
|
218
233
|
nextOffset: hasMore ? offset + members.length : null,
|
|
219
234
|
};
|
|
@@ -75,8 +75,8 @@ export declare function createCustomProviderRegistrationAction<TSchema extends Z
|
|
|
75
75
|
user: "user";
|
|
76
76
|
}>>;
|
|
77
77
|
}, z.core.$strip>>, {
|
|
78
|
+
id?: undefined;
|
|
78
79
|
deleted?: undefined;
|
|
79
|
-
found?: undefined;
|
|
80
80
|
providers: {
|
|
81
81
|
id: string;
|
|
82
82
|
label: string;
|
|
@@ -88,18 +88,18 @@ export declare function createCustomProviderRegistrationAction<TSchema extends Z
|
|
|
88
88
|
}[];
|
|
89
89
|
count: number;
|
|
90
90
|
provider?: undefined;
|
|
91
|
+
found?: undefined;
|
|
91
92
|
registered?: undefined;
|
|
92
|
-
id?: undefined;
|
|
93
93
|
label?: undefined;
|
|
94
94
|
message?: undefined;
|
|
95
95
|
} | {
|
|
96
|
+
id?: undefined;
|
|
96
97
|
deleted?: undefined;
|
|
97
98
|
providers?: undefined;
|
|
98
99
|
count?: undefined;
|
|
99
100
|
found: boolean;
|
|
100
101
|
provider: import("../custom-registry.js").CustomProviderConfig;
|
|
101
102
|
registered?: undefined;
|
|
102
|
-
id?: undefined;
|
|
103
103
|
label?: undefined;
|
|
104
104
|
message?: undefined;
|
|
105
105
|
} | {
|
|
@@ -113,10 +113,10 @@ export declare function createCustomProviderRegistrationAction<TSchema extends Z
|
|
|
113
113
|
label?: undefined;
|
|
114
114
|
message?: undefined;
|
|
115
115
|
} | {
|
|
116
|
-
found?: undefined;
|
|
117
116
|
providers?: undefined;
|
|
118
117
|
count?: undefined;
|
|
119
118
|
provider?: undefined;
|
|
119
|
+
found?: undefined;
|
|
120
120
|
deleted: boolean;
|
|
121
121
|
id: string;
|
|
122
122
|
registered?: undefined;
|
|
@@ -124,10 +124,10 @@ export declare function createCustomProviderRegistrationAction<TSchema extends Z
|
|
|
124
124
|
message?: undefined;
|
|
125
125
|
} | {
|
|
126
126
|
deleted?: undefined;
|
|
127
|
-
found?: undefined;
|
|
128
127
|
providers?: undefined;
|
|
129
128
|
count?: undefined;
|
|
130
129
|
provider?: undefined;
|
|
130
|
+
found?: undefined;
|
|
131
131
|
registered: boolean;
|
|
132
132
|
id: string;
|
|
133
133
|
label: string;
|
|
@@ -314,7 +314,6 @@ export declare function createProviderApiActions(runtime: Pick<ProviderApiRuntim
|
|
|
314
314
|
id?: undefined;
|
|
315
315
|
provider?: undefined;
|
|
316
316
|
deleted?: undefined;
|
|
317
|
-
found?: undefined;
|
|
318
317
|
providers: {
|
|
319
318
|
id: string;
|
|
320
319
|
label: string;
|
|
@@ -325,13 +324,14 @@ export declare function createProviderApiActions(runtime: Pick<ProviderApiRuntim
|
|
|
325
324
|
updatedAt: number;
|
|
326
325
|
}[];
|
|
327
326
|
count: number;
|
|
327
|
+
found?: undefined;
|
|
328
328
|
registered?: undefined;
|
|
329
329
|
label?: undefined;
|
|
330
330
|
message?: undefined;
|
|
331
331
|
} | {
|
|
332
332
|
id?: undefined;
|
|
333
|
-
deleted?: undefined;
|
|
334
333
|
count?: undefined;
|
|
334
|
+
deleted?: undefined;
|
|
335
335
|
providers?: undefined;
|
|
336
336
|
found: boolean;
|
|
337
337
|
provider: import("../custom-registry.js").CustomProviderConfig;
|
|
@@ -339,9 +339,9 @@ export declare function createProviderApiActions(runtime: Pick<ProviderApiRuntim
|
|
|
339
339
|
label?: undefined;
|
|
340
340
|
message?: undefined;
|
|
341
341
|
} | {
|
|
342
|
+
count?: undefined;
|
|
342
343
|
provider?: undefined;
|
|
343
344
|
deleted?: undefined;
|
|
344
|
-
count?: undefined;
|
|
345
345
|
providers?: undefined;
|
|
346
346
|
found: boolean;
|
|
347
347
|
id: string;
|
|
@@ -349,21 +349,21 @@ export declare function createProviderApiActions(runtime: Pick<ProviderApiRuntim
|
|
|
349
349
|
label?: undefined;
|
|
350
350
|
message?: undefined;
|
|
351
351
|
} | {
|
|
352
|
-
provider?: undefined;
|
|
353
|
-
found?: undefined;
|
|
354
352
|
count?: undefined;
|
|
353
|
+
provider?: undefined;
|
|
355
354
|
providers?: undefined;
|
|
355
|
+
found?: undefined;
|
|
356
356
|
deleted: boolean;
|
|
357
357
|
id: string;
|
|
358
358
|
registered?: undefined;
|
|
359
359
|
label?: undefined;
|
|
360
360
|
message?: undefined;
|
|
361
361
|
} | {
|
|
362
|
+
count?: undefined;
|
|
362
363
|
provider?: undefined;
|
|
363
364
|
deleted?: undefined;
|
|
364
|
-
found?: undefined;
|
|
365
|
-
count?: undefined;
|
|
366
365
|
providers?: undefined;
|
|
366
|
+
found?: undefined;
|
|
367
367
|
registered: boolean;
|
|
368
368
|
id: string;
|
|
369
369
|
label: string;
|