@agent-native/core 0.98.17 → 0.99.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/corpus/README.md +2 -2
- package/corpus/core/CHANGELOG.md +25 -0
- package/corpus/core/docs/content/actions.mdx +1 -1
- package/corpus/core/docs/content/authentication.mdx +1 -1
- package/corpus/core/docs/content/dispatch.mdx +3 -3
- package/corpus/core/docs/content/external-agents.mdx +30 -19
- package/corpus/core/docs/content/locales/ar-SA/actions.mdx +1 -1
- package/corpus/core/docs/content/locales/ar-SA/authentication.mdx +1 -1
- package/corpus/core/docs/content/locales/ar-SA/dispatch.mdx +3 -3
- package/corpus/core/docs/content/locales/ar-SA/external-agents.mdx +23 -19
- package/corpus/core/docs/content/locales/ar-SA/mcp-clients.mdx +31 -3
- package/corpus/core/docs/content/locales/ar-SA/mcp-protocol.mdx +29 -15
- package/corpus/core/docs/content/locales/ar-SA/plan-plugin.mdx +3 -3
- package/corpus/core/docs/content/locales/ar-SA/server.mdx +2 -2
- package/corpus/core/docs/content/locales/ar-SA/skills-guide.mdx +1 -1
- package/corpus/core/docs/content/locales/ar-SA/template-assets.mdx +1 -1
- package/corpus/core/docs/content/locales/ar-SA/template-dispatch.mdx +2 -2
- package/corpus/core/docs/content/locales/ar-SA/template-plan.mdx +3 -3
- package/corpus/core/docs/content/locales/de-DE/actions.mdx +1 -1
- package/corpus/core/docs/content/locales/de-DE/authentication.mdx +1 -1
- package/corpus/core/docs/content/locales/de-DE/dispatch.mdx +3 -3
- package/corpus/core/docs/content/locales/de-DE/external-agents.mdx +23 -19
- package/corpus/core/docs/content/locales/de-DE/mcp-clients.mdx +37 -3
- package/corpus/core/docs/content/locales/de-DE/mcp-protocol.mdx +29 -15
- package/corpus/core/docs/content/locales/de-DE/plan-plugin.mdx +3 -3
- package/corpus/core/docs/content/locales/de-DE/server.mdx +2 -2
- package/corpus/core/docs/content/locales/de-DE/skills-guide.mdx +1 -1
- package/corpus/core/docs/content/locales/de-DE/template-assets.mdx +1 -1
- package/corpus/core/docs/content/locales/de-DE/template-dispatch.mdx +2 -2
- package/corpus/core/docs/content/locales/de-DE/template-plan.mdx +3 -3
- package/corpus/core/docs/content/locales/es-ES/actions.mdx +1 -1
- package/corpus/core/docs/content/locales/es-ES/authentication.mdx +1 -1
- package/corpus/core/docs/content/locales/es-ES/dispatch.mdx +3 -3
- package/corpus/core/docs/content/locales/es-ES/external-agents.mdx +32 -19
- package/corpus/core/docs/content/locales/es-ES/mcp-clients.mdx +17 -3
- package/corpus/core/docs/content/locales/es-ES/mcp-protocol.mdx +38 -15
- package/corpus/core/docs/content/locales/es-ES/plan-plugin.mdx +3 -3
- package/corpus/core/docs/content/locales/es-ES/server.mdx +2 -2
- package/corpus/core/docs/content/locales/es-ES/skills-guide.mdx +1 -1
- package/corpus/core/docs/content/locales/es-ES/template-assets.mdx +1 -1
- package/corpus/core/docs/content/locales/es-ES/template-dispatch.mdx +2 -2
- package/corpus/core/docs/content/locales/es-ES/template-plan.mdx +3 -3
- package/corpus/core/docs/content/locales/fr-FR/actions.mdx +1 -1
- package/corpus/core/docs/content/locales/fr-FR/authentication.mdx +1 -1
- package/corpus/core/docs/content/locales/fr-FR/dispatch.mdx +3 -3
- package/corpus/core/docs/content/locales/fr-FR/external-agents.mdx +23 -19
- package/corpus/core/docs/content/locales/fr-FR/mcp-clients.mdx +17 -3
- package/corpus/core/docs/content/locales/fr-FR/mcp-protocol.mdx +29 -15
- package/corpus/core/docs/content/locales/fr-FR/plan-plugin.mdx +3 -3
- package/corpus/core/docs/content/locales/fr-FR/server.mdx +2 -2
- package/corpus/core/docs/content/locales/fr-FR/skills-guide.mdx +1 -1
- package/corpus/core/docs/content/locales/fr-FR/template-assets.mdx +1 -1
- package/corpus/core/docs/content/locales/fr-FR/template-dispatch.mdx +2 -2
- package/corpus/core/docs/content/locales/fr-FR/template-plan.mdx +3 -3
- package/corpus/core/docs/content/locales/hi-IN/actions.mdx +1 -1
- package/corpus/core/docs/content/locales/hi-IN/authentication.mdx +1 -1
- package/corpus/core/docs/content/locales/hi-IN/dispatch.mdx +3 -3
- package/corpus/core/docs/content/locales/hi-IN/external-agents.mdx +31 -19
- package/corpus/core/docs/content/locales/hi-IN/mcp-clients.mdx +17 -3
- package/corpus/core/docs/content/locales/hi-IN/mcp-protocol.mdx +36 -15
- package/corpus/core/docs/content/locales/hi-IN/plan-plugin.mdx +3 -3
- package/corpus/core/docs/content/locales/hi-IN/server.mdx +2 -2
- package/corpus/core/docs/content/locales/hi-IN/skills-guide.mdx +1 -1
- package/corpus/core/docs/content/locales/hi-IN/template-assets.mdx +1 -1
- package/corpus/core/docs/content/locales/hi-IN/template-dispatch.mdx +2 -2
- package/corpus/core/docs/content/locales/hi-IN/template-plan.mdx +3 -3
- package/corpus/core/docs/content/locales/ja-JP/actions.mdx +1 -1
- package/corpus/core/docs/content/locales/ja-JP/authentication.mdx +1 -1
- package/corpus/core/docs/content/locales/ja-JP/dispatch.mdx +3 -3
- package/corpus/core/docs/content/locales/ja-JP/external-agents.mdx +23 -19
- package/corpus/core/docs/content/locales/ja-JP/mcp-clients.mdx +34 -3
- package/corpus/core/docs/content/locales/ja-JP/mcp-protocol.mdx +29 -15
- package/corpus/core/docs/content/locales/ja-JP/plan-plugin.mdx +3 -3
- package/corpus/core/docs/content/locales/ja-JP/server.mdx +2 -2
- package/corpus/core/docs/content/locales/ja-JP/skills-guide.mdx +1 -1
- package/corpus/core/docs/content/locales/ja-JP/template-assets.mdx +1 -1
- package/corpus/core/docs/content/locales/ja-JP/template-dispatch.mdx +2 -2
- package/corpus/core/docs/content/locales/ja-JP/template-plan.mdx +3 -3
- package/corpus/core/docs/content/locales/ko-KR/actions.mdx +1 -1
- package/corpus/core/docs/content/locales/ko-KR/authentication.mdx +1 -1
- package/corpus/core/docs/content/locales/ko-KR/dispatch.mdx +3 -3
- package/corpus/core/docs/content/locales/ko-KR/external-agents.mdx +30 -19
- package/corpus/core/docs/content/locales/ko-KR/mcp-clients.mdx +33 -3
- package/corpus/core/docs/content/locales/ko-KR/mcp-protocol.mdx +36 -15
- package/corpus/core/docs/content/locales/ko-KR/plan-plugin.mdx +3 -3
- package/corpus/core/docs/content/locales/ko-KR/server.mdx +2 -2
- package/corpus/core/docs/content/locales/ko-KR/skills-guide.mdx +1 -1
- package/corpus/core/docs/content/locales/ko-KR/template-assets.mdx +1 -1
- package/corpus/core/docs/content/locales/ko-KR/template-dispatch.mdx +2 -2
- package/corpus/core/docs/content/locales/ko-KR/template-plan.mdx +3 -3
- package/corpus/core/docs/content/locales/pt-BR/actions.mdx +1 -1
- package/corpus/core/docs/content/locales/pt-BR/authentication.mdx +1 -1
- package/corpus/core/docs/content/locales/pt-BR/dispatch.mdx +3 -3
- package/corpus/core/docs/content/locales/pt-BR/external-agents.mdx +32 -19
- package/corpus/core/docs/content/locales/pt-BR/mcp-clients.mdx +34 -3
- package/corpus/core/docs/content/locales/pt-BR/mcp-protocol.mdx +32 -15
- package/corpus/core/docs/content/locales/pt-BR/plan-plugin.mdx +3 -3
- package/corpus/core/docs/content/locales/pt-BR/server.mdx +2 -2
- package/corpus/core/docs/content/locales/pt-BR/skills-guide.mdx +1 -1
- package/corpus/core/docs/content/locales/pt-BR/template-assets.mdx +1 -1
- package/corpus/core/docs/content/locales/pt-BR/template-dispatch.mdx +2 -2
- package/corpus/core/docs/content/locales/pt-BR/template-plan.mdx +3 -3
- package/corpus/core/docs/content/locales/zh-CN/actions.mdx +1 -1
- package/corpus/core/docs/content/locales/zh-CN/authentication.mdx +1 -1
- package/corpus/core/docs/content/locales/zh-CN/dispatch.mdx +3 -3
- package/corpus/core/docs/content/locales/zh-CN/external-agents.mdx +23 -19
- package/corpus/core/docs/content/locales/zh-CN/mcp-clients.mdx +28 -3
- package/corpus/core/docs/content/locales/zh-CN/mcp-protocol.mdx +29 -15
- package/corpus/core/docs/content/locales/zh-CN/plan-plugin.mdx +3 -3
- package/corpus/core/docs/content/locales/zh-CN/server.mdx +2 -2
- package/corpus/core/docs/content/locales/zh-CN/skills-guide.mdx +1 -1
- package/corpus/core/docs/content/locales/zh-CN/template-assets.mdx +1 -1
- package/corpus/core/docs/content/locales/zh-CN/template-dispatch.mdx +2 -2
- package/corpus/core/docs/content/locales/zh-CN/template-plan.mdx +3 -3
- package/corpus/core/docs/content/locales/zh-TW/actions.mdx +1 -1
- package/corpus/core/docs/content/locales/zh-TW/authentication.mdx +1 -1
- package/corpus/core/docs/content/locales/zh-TW/dispatch.mdx +3 -3
- package/corpus/core/docs/content/locales/zh-TW/external-agents.mdx +23 -19
- package/corpus/core/docs/content/locales/zh-TW/mcp-clients.mdx +28 -3
- package/corpus/core/docs/content/locales/zh-TW/mcp-protocol.mdx +30 -15
- package/corpus/core/docs/content/locales/zh-TW/plan-plugin.mdx +3 -3
- package/corpus/core/docs/content/locales/zh-TW/server.mdx +2 -2
- package/corpus/core/docs/content/locales/zh-TW/skills-guide.mdx +1 -1
- package/corpus/core/docs/content/locales/zh-TW/template-assets.mdx +1 -1
- package/corpus/core/docs/content/locales/zh-TW/template-dispatch.mdx +2 -2
- package/corpus/core/docs/content/locales/zh-TW/template-plan.mdx +3 -3
- package/corpus/core/docs/content/mcp-clients.mdx +31 -4
- package/corpus/core/docs/content/mcp-protocol.mdx +35 -15
- package/corpus/core/docs/content/plan-plugin.mdx +3 -3
- package/corpus/core/docs/content/server.mdx +2 -2
- package/corpus/core/docs/content/skills-guide.mdx +1 -1
- package/corpus/core/docs/content/template-assets.mdx +1 -1
- package/corpus/core/docs/content/template-dispatch.mdx +2 -2
- package/corpus/core/docs/content/template-plan.mdx +3 -3
- package/corpus/core/package.json +1 -1
- package/corpus/core/src/a2a/client.ts +3 -0
- package/corpus/core/src/a2a/handlers.ts +95 -7
- package/corpus/core/src/agent/production-agent.ts +21 -0
- package/corpus/core/src/cli/connect.ts +50 -24
- package/corpus/core/src/cli/mcp-config-writers.ts +10 -0
- package/corpus/core/src/cli/mcp.ts +5 -5
- package/corpus/core/src/cli/pr-visual-recap-workflow.ts +1 -1
- package/corpus/core/src/cli/skills-content/assets-skill.ts +1 -1
- package/corpus/core/src/cli/skills-content/design-exploration-skill.ts +1 -1
- package/corpus/core/src/cli/skills-content/help.ts +1 -1
- package/corpus/core/src/cli/skills-content/plan-setup-auth.ts +1 -1
- package/corpus/core/src/cli/skills-content/visual-plan-skill.ts +1 -1
- package/corpus/core/src/cli/skills-content/visual-recap-skill.ts +2 -2
- package/corpus/core/src/cli/skills.ts +23 -12
- package/corpus/core/src/client/analytics.ts +13 -0
- package/corpus/core/src/client/resources/McpIntegrationDialog.tsx +5 -0
- package/corpus/core/src/client/resources/mcp-integration-catalog.ts +17 -0
- package/corpus/core/src/embedding/agent.ts +8 -6
- package/corpus/core/src/localization/default-messages.ts +7 -0
- package/corpus/core/src/mcp/ask-app-inline-tasks.ts +125 -0
- package/corpus/core/src/mcp/build-server.ts +65 -3
- package/corpus/core/src/mcp/builtin-tools.ts +186 -22
- package/corpus/core/src/mcp/connect-route.ts +17 -14
- package/corpus/core/src/mcp/oauth-route.ts +38 -13
- package/corpus/core/src/mcp/route-paths.ts +34 -0
- package/corpus/core/src/mcp/server.ts +21 -10
- package/corpus/core/src/mcp/stdio.ts +34 -16
- package/corpus/core/src/mcp/workspace-resolve.ts +2 -1
- package/corpus/core/src/mcp-client/manager.ts +5 -3
- package/corpus/core/src/mcp-client/remote-store.ts +10 -10
- package/corpus/core/src/server/agent-chat/action-filters-a2a.ts +13 -0
- package/corpus/core/src/server/agent-chat-plugin.ts +42 -9
- package/corpus/core/src/server/agent-teams.ts +17 -0
- package/corpus/core/src/server/auth.ts +22 -6
- package/corpus/core/src/server/core-routes-plugin.ts +30 -24
- package/corpus/core/src/server/csrf.ts +17 -0
- package/corpus/core/src/server/framework-request-handler.ts +8 -2
- package/corpus/core/src/server/google-oauth.ts +12 -2
- package/corpus/core/src/server/http-response-telemetry.ts +6 -1
- package/corpus/core/src/server/recap-image-route.ts +3 -3
- package/corpus/core/src/server/security-headers.ts +7 -1
- package/corpus/core/src/server/ssr-handler.ts +2 -0
- package/corpus/core/src/shared/cache-control.ts +6 -4
- package/corpus/core/src/templates/default/.agents/skills/security/SKILL.md +10 -0
- package/corpus/core/src/templates/workspace-core/.agents/skills/authentication/SKILL.md +15 -6
- package/corpus/core/src/templates/workspace-core/.agents/skills/external-agents/SKILL.md +16 -10
- package/corpus/core/src/templates/workspace-core/.agents/skills/performance/SKILL.md +20 -1
- package/corpus/core/src/templates/workspace-core/.agents/skills/security/SKILL.md +10 -0
- package/corpus/templates/analytics/.agents/skills/security/SKILL.md +10 -0
- package/corpus/templates/analytics/app/assets/replay-cursor.svg +17 -0
- package/corpus/templates/analytics/app/components/dashboard/SqlChart.tsx +4 -3
- package/corpus/templates/analytics/app/global.css +71 -4
- package/corpus/templates/analytics/app/pages/adhoc/sql-dashboard/DashboardFilterBar.tsx +32 -4
- package/corpus/templates/analytics/app/pages/monitoring/errors/IssueDetail.tsx +1 -1
- package/corpus/templates/analytics/app/pages/sessions/SessionDetailPage.tsx +49 -11
- package/corpus/templates/analytics/app/pages/sessions/SessionsPage.tsx +4 -6
- package/corpus/templates/analytics/changelog/2026-07-13-all-time-dashboard-filters-no-longer-send-invalid-dates-to-b.md +6 -0
- package/corpus/templates/analytics/changelog/2026-07-13-daily-dashboard-emails-recover-more-reliably-from-serverless.md +6 -0
- package/corpus/templates/analytics/changelog/2026-07-13-error-issue-titles-wrap-instead-of-overflowing.md +6 -0
- package/corpus/templates/analytics/changelog/2026-07-13-saving-a-new-dashboard-view-no-longer-fails-with-a-server-er.md +6 -0
- package/corpus/templates/analytics/changelog/2026-07-13-session-replay-cursors-stay-hidden-until-their-first-recorde.md +6 -0
- package/corpus/templates/analytics/changelog/2026-07-13-session-replay-links-now-support-cmd-click-and-middle-click-.md +6 -0
- package/corpus/templates/analytics/changelog/2026-07-13-session-replays-keep-a-visible-mac-style-cursor-over-the-vis.md +6 -0
- package/corpus/templates/analytics/server/jobs/dashboard-report.ts +21 -2
- package/corpus/templates/analytics/server/lib/dashboard-report-subscriptions.ts +57 -1
- package/corpus/templates/analytics/server/lib/dashboard-report.ts +266 -28
- package/corpus/templates/analytics/server/lib/dashboards-store.ts +43 -4
- package/corpus/templates/analytics/server/lib/error-capture.ts +24 -5
- package/corpus/templates/analytics/server/plugins/agent-chat.ts +5 -0
- package/corpus/templates/analytics/server/routes/[...page].get.ts +0 -2
- package/corpus/templates/assets/.agents/skills/security/SKILL.md +10 -0
- package/corpus/templates/assets/agent-native.app-skill.json +1 -1
- package/corpus/templates/brain/.agents/skills/security/SKILL.md +10 -0
- package/corpus/templates/calendar/.agents/skills/security/SKILL.md +10 -0
- package/corpus/templates/calendar/AGENTS.md +2 -1
- package/corpus/templates/calendar/app/components/calendar/EventDetailPopover.tsx +0 -19
- package/corpus/templates/calendar/app/lib/attendee-local-time.ts +14 -5
- package/corpus/templates/calendar/changelog/2026-07-13-your-local-time-now-follows-your-browser-timezone-and-event-.md +6 -0
- package/corpus/templates/chat/.agents/skills/security/SKILL.md +10 -0
- package/corpus/templates/clips/.agents/skills/recording/SKILL.md +7 -2
- package/corpus/templates/clips/.agents/skills/security/SKILL.md +10 -0
- package/corpus/templates/clips/AGENTS.md +7 -0
- package/corpus/templates/clips/actions/list-meetings.ts +19 -4
- package/corpus/templates/clips/actions/start-meeting-recording.ts +7 -1
- package/corpus/templates/clips/app/components/library/recording-card.tsx +27 -26
- package/corpus/templates/clips/app/components/library/space-card.tsx +4 -6
- package/corpus/templates/clips/app/components/meetings/transcript-bubbles.tsx +75 -78
- package/corpus/templates/clips/app/components/recorder/confetti-canvas.tsx +18 -1
- package/corpus/templates/clips/app/components/recorder/recorder-engine.ts +6 -12
- package/corpus/templates/clips/app/components/recorder/recording-toolbar.tsx +19 -2
- package/corpus/templates/clips/app/lib/camera-composite.ts +70 -10
- package/corpus/templates/clips/app/routes/_app.meetings.$meetingId.tsx +1 -1
- package/corpus/templates/clips/app/routes/record.tsx +5 -25
- package/corpus/templates/clips/changelog/2026-07-13-clips-desktop-now-requires-macos-13-for-native-capture.md +6 -0
- package/corpus/templates/clips/changelog/2026-07-13-clips-hide-solo-meeting-reminders.md +6 -0
- package/corpus/templates/clips/changelog/2026-07-13-clips-now-removes-duplicate-mic-and-system-transcript-turns-.md +6 -0
- package/corpus/templates/clips/changelog/2026-07-13-desktop-recordings-run-cooler-and-quieter-live-transcription.md +6 -0
- package/corpus/templates/clips/changelog/2026-07-13-meeting-recordings-now-stop-after-a-calendar-meeting-ends-an.md +6 -0
- package/corpus/templates/clips/changelog/2026-07-13-meeting-transcripts-now-use-a-clean-agent-chat-style-reading.md +6 -0
- package/corpus/templates/clips/changelog/2026-07-13-screen-recordings-use-less-processing-power-during-longer-ca.md +6 -0
- package/corpus/templates/clips/chrome-extension/src/background.ts +5 -3
- package/corpus/templates/clips/chrome-extension/src/offscreen.ts +17 -14
- package/corpus/templates/clips/chrome-extension/src/overlay.ts +8 -2
- package/corpus/templates/clips/desktop/README.md +3 -0
- package/corpus/templates/clips/desktop/src/hooks/useMeetingTranscription.ts +9 -0
- package/corpus/templates/clips/desktop/src/lib/recorder.ts +8 -2
- package/corpus/templates/clips/desktop/src/lib/silence-events.ts +1 -0
- package/corpus/templates/clips/desktop/src/lib/transcription-capture.ts +5 -0
- package/corpus/templates/clips/desktop/src/lib/transcription-engine.ts +134 -5
- package/corpus/templates/clips/desktop/src/lib/upload-video-stream.ts +28 -0
- package/corpus/templates/clips/desktop/src/overlays/flow-bar.tsx +10 -3
- package/corpus/templates/clips/desktop/src/overlays/meeting-notification.tsx +42 -9
- package/corpus/templates/clips/desktop/src/overlays/recording-pill.tsx +10 -2
- package/corpus/templates/clips/desktop/src-tauri/Cargo.toml +6 -1
- package/corpus/templates/clips/desktop/src-tauri/src/notifications.rs +77 -1
- package/corpus/templates/clips/desktop/src-tauri/src/silence_detector.rs +104 -25
- package/corpus/templates/clips/desktop/src-tauri/src/system_audio.rs +4 -0
- package/corpus/templates/clips/desktop/src-tauri/src/whisper_speech.rs +287 -32
- package/corpus/templates/clips/desktop/src-tauri/tauri.conf.json +1 -1
- package/corpus/templates/clips/server/lib/calendar-event-classification.ts +28 -0
- package/corpus/templates/clips/server/routes/[...page].get.ts +1 -59
- package/corpus/templates/clips/shared/recording-capture.ts +37 -0
- package/corpus/templates/content/.agents/skills/security/SKILL.md +10 -0
- package/corpus/templates/content/agent-native.app-skill.json +1 -1
- package/corpus/templates/content/app/components/sidebar/DocumentSidebar.tsx +18 -16
- package/corpus/templates/content/server/routes/[...page].get.ts +1 -15
- package/corpus/templates/design/.agents/skills/security/SKILL.md +10 -0
- package/corpus/templates/design/actions/connect-assets-mcp.ts +1 -1
- package/corpus/templates/design/agent-native.app-skill.json +1 -1
- package/corpus/templates/design/app/components/design/DesignCanvas.tsx +88 -12
- package/corpus/templates/design/app/components/design/MultiScreenCanvas.tsx +1 -0
- package/corpus/templates/design/app/components/design/bridge/editor-chrome.bridge.ts +4 -1
- package/corpus/templates/design/changelog/2026-07-13-adding-shapes-preserves-canvas-background.md +6 -0
- package/corpus/templates/design/changelog/2026-07-13-clicking-quickly-between-overlapping-elements-no-longer-bounc.md +6 -0
- package/corpus/templates/design/server/plugins/assets-mcp.ts +1 -1
- package/corpus/templates/design/server/routes/[...page].get.ts +0 -2
- package/corpus/templates/dispatch/.agents/skills/security/SKILL.md +10 -0
- package/corpus/templates/forms/.agents/skills/security/SKILL.md +10 -0
- package/corpus/templates/macros/.agents/skills/security/SKILL.md +10 -0
- package/corpus/templates/mail/.agents/skills/security/SKILL.md +10 -0
- package/corpus/templates/plan/.agents/skills/security/SKILL.md +10 -0
- package/corpus/templates/plan/.agents/skills/visual-plan/SKILL.md +1 -1
- package/corpus/templates/plan/.agents/skills/visual-recap/SKILL.md +2 -2
- package/corpus/templates/plan/agent-native.app-skill.json +1 -1
- package/corpus/templates/plan/app/lib/plan-local-bridge.ts +6 -1
- package/corpus/templates/plan/app/pages/PlansPage.tsx +15 -6
- package/corpus/templates/plan/changelog/2026-07-13-fixed-local-plan-previews-continuously-flickering-while-revi.md +6 -0
- package/corpus/templates/plan/server/routes/[...page].get.ts +0 -2
- package/corpus/templates/slides/.agents/skills/security/SKILL.md +10 -0
- package/dist/a2a/client.d.ts +2 -0
- package/dist/a2a/client.d.ts.map +1 -1
- package/dist/a2a/client.js +2 -0
- package/dist/a2a/client.js.map +1 -1
- package/dist/a2a/handlers.d.ts.map +1 -1
- package/dist/a2a/handlers.js +84 -7
- package/dist/a2a/handlers.js.map +1 -1
- package/dist/agent/production-agent.d.ts +9 -0
- package/dist/agent/production-agent.d.ts.map +1 -1
- package/dist/agent/production-agent.js +12 -0
- package/dist/agent/production-agent.js.map +1 -1
- package/dist/cli/connect.d.ts +2 -2
- package/dist/cli/connect.d.ts.map +1 -1
- package/dist/cli/connect.js +45 -23
- package/dist/cli/connect.js.map +1 -1
- package/dist/cli/mcp-config-writers.d.ts.map +1 -1
- package/dist/cli/mcp-config-writers.js +7 -0
- package/dist/cli/mcp-config-writers.js.map +1 -1
- package/dist/cli/mcp.js +5 -3
- package/dist/cli/mcp.js.map +1 -1
- package/dist/cli/pr-visual-recap-workflow.d.ts +1 -1
- package/dist/cli/pr-visual-recap-workflow.d.ts.map +1 -1
- package/dist/cli/pr-visual-recap-workflow.js +1 -1
- package/dist/cli/pr-visual-recap-workflow.js.map +1 -1
- package/dist/cli/skills-content/assets-skill.d.ts +1 -1
- package/dist/cli/skills-content/assets-skill.d.ts.map +1 -1
- package/dist/cli/skills-content/assets-skill.js +1 -1
- package/dist/cli/skills-content/assets-skill.js.map +1 -1
- package/dist/cli/skills-content/design-exploration-skill.d.ts +1 -1
- package/dist/cli/skills-content/design-exploration-skill.d.ts.map +1 -1
- package/dist/cli/skills-content/design-exploration-skill.js +1 -1
- package/dist/cli/skills-content/design-exploration-skill.js.map +1 -1
- package/dist/cli/skills-content/help.d.ts +1 -1
- package/dist/cli/skills-content/help.d.ts.map +1 -1
- package/dist/cli/skills-content/help.js +1 -1
- package/dist/cli/skills-content/help.js.map +1 -1
- package/dist/cli/skills-content/plan-setup-auth.d.ts +1 -1
- package/dist/cli/skills-content/plan-setup-auth.d.ts.map +1 -1
- package/dist/cli/skills-content/plan-setup-auth.js +1 -1
- package/dist/cli/skills-content/plan-setup-auth.js.map +1 -1
- package/dist/cli/skills-content/visual-plan-skill.d.ts +1 -1
- package/dist/cli/skills-content/visual-plan-skill.d.ts.map +1 -1
- package/dist/cli/skills-content/visual-plan-skill.js +1 -1
- package/dist/cli/skills-content/visual-plan-skill.js.map +1 -1
- package/dist/cli/skills-content/visual-recap-skill.d.ts +1 -1
- package/dist/cli/skills-content/visual-recap-skill.d.ts.map +1 -1
- package/dist/cli/skills-content/visual-recap-skill.js +2 -2
- package/dist/cli/skills-content/visual-recap-skill.js.map +1 -1
- package/dist/cli/skills.d.ts.map +1 -1
- package/dist/cli/skills.js +16 -12
- package/dist/cli/skills.js.map +1 -1
- package/dist/client/analytics.d.ts.map +1 -1
- package/dist/client/analytics.js +11 -0
- package/dist/client/analytics.js.map +1 -1
- package/dist/client/resources/McpIntegrationDialog.d.ts.map +1 -1
- package/dist/client/resources/McpIntegrationDialog.js +1 -1
- package/dist/client/resources/McpIntegrationDialog.js.map +1 -1
- package/dist/client/resources/mcp-integration-catalog.d.ts +1 -0
- package/dist/client/resources/mcp-integration-catalog.d.ts.map +1 -1
- package/dist/client/resources/mcp-integration-catalog.js +14 -0
- package/dist/client/resources/mcp-integration-catalog.js.map +1 -1
- package/dist/collab/awareness.d.ts +2 -2
- package/dist/collab/awareness.d.ts.map +1 -1
- package/dist/collab/routes.d.ts +1 -1
- package/dist/collab/struct-routes.d.ts +1 -1
- package/dist/embedding/agent.d.ts.map +1 -1
- package/dist/embedding/agent.js +6 -7
- package/dist/embedding/agent.js.map +1 -1
- package/dist/localization/default-messages.d.ts +5 -0
- package/dist/localization/default-messages.d.ts.map +1 -1
- package/dist/localization/default-messages.js +5 -0
- package/dist/localization/default-messages.js.map +1 -1
- package/dist/mcp/ask-app-inline-tasks.d.ts +47 -0
- package/dist/mcp/ask-app-inline-tasks.d.ts.map +1 -0
- package/dist/mcp/ask-app-inline-tasks.js +87 -0
- package/dist/mcp/ask-app-inline-tasks.js.map +1 -0
- package/dist/mcp/build-server.d.ts.map +1 -1
- package/dist/mcp/build-server.js +56 -3
- package/dist/mcp/build-server.js.map +1 -1
- package/dist/mcp/builtin-tools.d.ts.map +1 -1
- package/dist/mcp/builtin-tools.js +141 -21
- package/dist/mcp/builtin-tools.js.map +1 -1
- package/dist/mcp/connect-route.d.ts +12 -10
- package/dist/mcp/connect-route.d.ts.map +1 -1
- package/dist/mcp/connect-route.js +17 -14
- package/dist/mcp/connect-route.js.map +1 -1
- package/dist/mcp/oauth-route.d.ts +1 -1
- package/dist/mcp/oauth-route.d.ts.map +1 -1
- package/dist/mcp/oauth-route.js +30 -13
- package/dist/mcp/oauth-route.js.map +1 -1
- package/dist/mcp/route-paths.d.ts +13 -0
- package/dist/mcp/route-paths.d.ts.map +1 -0
- package/dist/mcp/route-paths.js +27 -0
- package/dist/mcp/route-paths.js.map +1 -0
- package/dist/mcp/server.d.ts +2 -1
- package/dist/mcp/server.d.ts.map +1 -1
- package/dist/mcp/server.js +14 -6
- package/dist/mcp/server.js.map +1 -1
- package/dist/mcp/stdio.d.ts +7 -6
- package/dist/mcp/stdio.d.ts.map +1 -1
- package/dist/mcp/stdio.js +27 -15
- package/dist/mcp/stdio.js.map +1 -1
- package/dist/mcp/workspace-resolve.d.ts +2 -1
- package/dist/mcp/workspace-resolve.d.ts.map +1 -1
- package/dist/mcp/workspace-resolve.js +2 -1
- package/dist/mcp/workspace-resolve.js.map +1 -1
- package/dist/mcp-client/manager.js +6 -3
- package/dist/mcp-client/manager.js.map +1 -1
- package/dist/mcp-client/remote-store.js +5 -7
- package/dist/mcp-client/remote-store.js.map +1 -1
- package/dist/notifications/routes.d.ts +3 -3
- package/dist/progress/routes.d.ts +1 -1
- package/dist/provider-api/corpus-jobs.d.ts +2 -2
- package/dist/resources/handlers.d.ts +2 -2
- package/dist/server/agent-chat/action-filters-a2a.d.ts.map +1 -1
- package/dist/server/agent-chat/action-filters-a2a.js +11 -1
- package/dist/server/agent-chat/action-filters-a2a.js.map +1 -1
- package/dist/server/agent-chat-plugin.d.ts.map +1 -1
- package/dist/server/agent-chat-plugin.js +43 -11
- package/dist/server/agent-chat-plugin.js.map +1 -1
- package/dist/server/agent-engine-api-key-route.d.ts +1 -1
- package/dist/server/agent-teams.d.ts.map +1 -1
- package/dist/server/agent-teams.js +15 -1
- package/dist/server/agent-teams.js.map +1 -1
- package/dist/server/auth.d.ts.map +1 -1
- package/dist/server/auth.js +16 -6
- package/dist/server/auth.js.map +1 -1
- package/dist/server/core-routes-plugin.d.ts +4 -3
- package/dist/server/core-routes-plugin.d.ts.map +1 -1
- package/dist/server/core-routes-plugin.js +20 -15
- package/dist/server/core-routes-plugin.js.map +1 -1
- package/dist/server/csrf.d.ts.map +1 -1
- package/dist/server/csrf.js +11 -0
- package/dist/server/csrf.js.map +1 -1
- package/dist/server/framework-request-handler.d.ts.map +1 -1
- package/dist/server/framework-request-handler.js +8 -2
- package/dist/server/framework-request-handler.js.map +1 -1
- package/dist/server/google-oauth.d.ts +2 -0
- package/dist/server/google-oauth.d.ts.map +1 -1
- package/dist/server/google-oauth.js +11 -2
- package/dist/server/google-oauth.js.map +1 -1
- package/dist/server/http-response-telemetry.d.ts.map +1 -1
- package/dist/server/http-response-telemetry.js +4 -1
- package/dist/server/http-response-telemetry.js.map +1 -1
- package/dist/server/recap-image-route.js +3 -3
- package/dist/server/recap-image-route.js.map +1 -1
- package/dist/server/security-headers.d.ts.map +1 -1
- package/dist/server/security-headers.js +4 -1
- package/dist/server/security-headers.js.map +1 -1
- package/dist/server/ssr-handler.d.ts.map +1 -1
- package/dist/server/ssr-handler.js +3 -1
- package/dist/server/ssr-handler.js.map +1 -1
- package/dist/shared/cache-control.d.ts +7 -6
- package/dist/shared/cache-control.d.ts.map +1 -1
- package/dist/shared/cache-control.js +4 -3
- package/dist/shared/cache-control.js.map +1 -1
- package/dist/templates/default/.agents/skills/security/SKILL.md +10 -0
- package/dist/templates/workspace-core/.agents/skills/authentication/SKILL.md +15 -6
- package/dist/templates/workspace-core/.agents/skills/external-agents/SKILL.md +16 -10
- package/dist/templates/workspace-core/.agents/skills/performance/SKILL.md +20 -1
- package/dist/templates/workspace-core/.agents/skills/security/SKILL.md +10 -0
- package/docs/content/actions.mdx +1 -1
- package/docs/content/authentication.mdx +1 -1
- package/docs/content/dispatch.mdx +3 -3
- package/docs/content/external-agents.mdx +30 -19
- package/docs/content/locales/ar-SA/actions.mdx +1 -1
- package/docs/content/locales/ar-SA/authentication.mdx +1 -1
- package/docs/content/locales/ar-SA/dispatch.mdx +3 -3
- package/docs/content/locales/ar-SA/external-agents.mdx +23 -19
- package/docs/content/locales/ar-SA/mcp-clients.mdx +31 -3
- package/docs/content/locales/ar-SA/mcp-protocol.mdx +29 -15
- package/docs/content/locales/ar-SA/plan-plugin.mdx +3 -3
- package/docs/content/locales/ar-SA/server.mdx +2 -2
- package/docs/content/locales/ar-SA/skills-guide.mdx +1 -1
- package/docs/content/locales/ar-SA/template-assets.mdx +1 -1
- package/docs/content/locales/ar-SA/template-dispatch.mdx +2 -2
- package/docs/content/locales/ar-SA/template-plan.mdx +3 -3
- package/docs/content/locales/de-DE/actions.mdx +1 -1
- package/docs/content/locales/de-DE/authentication.mdx +1 -1
- package/docs/content/locales/de-DE/dispatch.mdx +3 -3
- package/docs/content/locales/de-DE/external-agents.mdx +23 -19
- package/docs/content/locales/de-DE/mcp-clients.mdx +37 -3
- package/docs/content/locales/de-DE/mcp-protocol.mdx +29 -15
- package/docs/content/locales/de-DE/plan-plugin.mdx +3 -3
- package/docs/content/locales/de-DE/server.mdx +2 -2
- package/docs/content/locales/de-DE/skills-guide.mdx +1 -1
- package/docs/content/locales/de-DE/template-assets.mdx +1 -1
- package/docs/content/locales/de-DE/template-dispatch.mdx +2 -2
- package/docs/content/locales/de-DE/template-plan.mdx +3 -3
- package/docs/content/locales/es-ES/actions.mdx +1 -1
- package/docs/content/locales/es-ES/authentication.mdx +1 -1
- package/docs/content/locales/es-ES/dispatch.mdx +3 -3
- package/docs/content/locales/es-ES/external-agents.mdx +32 -19
- package/docs/content/locales/es-ES/mcp-clients.mdx +17 -3
- package/docs/content/locales/es-ES/mcp-protocol.mdx +38 -15
- package/docs/content/locales/es-ES/plan-plugin.mdx +3 -3
- package/docs/content/locales/es-ES/server.mdx +2 -2
- package/docs/content/locales/es-ES/skills-guide.mdx +1 -1
- package/docs/content/locales/es-ES/template-assets.mdx +1 -1
- package/docs/content/locales/es-ES/template-dispatch.mdx +2 -2
- package/docs/content/locales/es-ES/template-plan.mdx +3 -3
- package/docs/content/locales/fr-FR/actions.mdx +1 -1
- package/docs/content/locales/fr-FR/authentication.mdx +1 -1
- package/docs/content/locales/fr-FR/dispatch.mdx +3 -3
- package/docs/content/locales/fr-FR/external-agents.mdx +23 -19
- package/docs/content/locales/fr-FR/mcp-clients.mdx +17 -3
- package/docs/content/locales/fr-FR/mcp-protocol.mdx +29 -15
- package/docs/content/locales/fr-FR/plan-plugin.mdx +3 -3
- package/docs/content/locales/fr-FR/server.mdx +2 -2
- package/docs/content/locales/fr-FR/skills-guide.mdx +1 -1
- package/docs/content/locales/fr-FR/template-assets.mdx +1 -1
- package/docs/content/locales/fr-FR/template-dispatch.mdx +2 -2
- package/docs/content/locales/fr-FR/template-plan.mdx +3 -3
- package/docs/content/locales/hi-IN/actions.mdx +1 -1
- package/docs/content/locales/hi-IN/authentication.mdx +1 -1
- package/docs/content/locales/hi-IN/dispatch.mdx +3 -3
- package/docs/content/locales/hi-IN/external-agents.mdx +31 -19
- package/docs/content/locales/hi-IN/mcp-clients.mdx +17 -3
- package/docs/content/locales/hi-IN/mcp-protocol.mdx +36 -15
- package/docs/content/locales/hi-IN/plan-plugin.mdx +3 -3
- package/docs/content/locales/hi-IN/server.mdx +2 -2
- package/docs/content/locales/hi-IN/skills-guide.mdx +1 -1
- package/docs/content/locales/hi-IN/template-assets.mdx +1 -1
- package/docs/content/locales/hi-IN/template-dispatch.mdx +2 -2
- package/docs/content/locales/hi-IN/template-plan.mdx +3 -3
- package/docs/content/locales/ja-JP/actions.mdx +1 -1
- package/docs/content/locales/ja-JP/authentication.mdx +1 -1
- package/docs/content/locales/ja-JP/dispatch.mdx +3 -3
- package/docs/content/locales/ja-JP/external-agents.mdx +23 -19
- package/docs/content/locales/ja-JP/mcp-clients.mdx +34 -3
- package/docs/content/locales/ja-JP/mcp-protocol.mdx +29 -15
- package/docs/content/locales/ja-JP/plan-plugin.mdx +3 -3
- package/docs/content/locales/ja-JP/server.mdx +2 -2
- package/docs/content/locales/ja-JP/skills-guide.mdx +1 -1
- package/docs/content/locales/ja-JP/template-assets.mdx +1 -1
- package/docs/content/locales/ja-JP/template-dispatch.mdx +2 -2
- package/docs/content/locales/ja-JP/template-plan.mdx +3 -3
- package/docs/content/locales/ko-KR/actions.mdx +1 -1
- package/docs/content/locales/ko-KR/authentication.mdx +1 -1
- package/docs/content/locales/ko-KR/dispatch.mdx +3 -3
- package/docs/content/locales/ko-KR/external-agents.mdx +30 -19
- package/docs/content/locales/ko-KR/mcp-clients.mdx +33 -3
- package/docs/content/locales/ko-KR/mcp-protocol.mdx +36 -15
- package/docs/content/locales/ko-KR/plan-plugin.mdx +3 -3
- package/docs/content/locales/ko-KR/server.mdx +2 -2
- package/docs/content/locales/ko-KR/skills-guide.mdx +1 -1
- package/docs/content/locales/ko-KR/template-assets.mdx +1 -1
- package/docs/content/locales/ko-KR/template-dispatch.mdx +2 -2
- package/docs/content/locales/ko-KR/template-plan.mdx +3 -3
- package/docs/content/locales/pt-BR/actions.mdx +1 -1
- package/docs/content/locales/pt-BR/authentication.mdx +1 -1
- package/docs/content/locales/pt-BR/dispatch.mdx +3 -3
- package/docs/content/locales/pt-BR/external-agents.mdx +32 -19
- package/docs/content/locales/pt-BR/mcp-clients.mdx +34 -3
- package/docs/content/locales/pt-BR/mcp-protocol.mdx +32 -15
- package/docs/content/locales/pt-BR/plan-plugin.mdx +3 -3
- package/docs/content/locales/pt-BR/server.mdx +2 -2
- package/docs/content/locales/pt-BR/skills-guide.mdx +1 -1
- package/docs/content/locales/pt-BR/template-assets.mdx +1 -1
- package/docs/content/locales/pt-BR/template-dispatch.mdx +2 -2
- package/docs/content/locales/pt-BR/template-plan.mdx +3 -3
- package/docs/content/locales/zh-CN/actions.mdx +1 -1
- package/docs/content/locales/zh-CN/authentication.mdx +1 -1
- package/docs/content/locales/zh-CN/dispatch.mdx +3 -3
- package/docs/content/locales/zh-CN/external-agents.mdx +23 -19
- package/docs/content/locales/zh-CN/mcp-clients.mdx +28 -3
- package/docs/content/locales/zh-CN/mcp-protocol.mdx +29 -15
- package/docs/content/locales/zh-CN/plan-plugin.mdx +3 -3
- package/docs/content/locales/zh-CN/server.mdx +2 -2
- package/docs/content/locales/zh-CN/skills-guide.mdx +1 -1
- package/docs/content/locales/zh-CN/template-assets.mdx +1 -1
- package/docs/content/locales/zh-CN/template-dispatch.mdx +2 -2
- package/docs/content/locales/zh-CN/template-plan.mdx +3 -3
- package/docs/content/locales/zh-TW/actions.mdx +1 -1
- package/docs/content/locales/zh-TW/authentication.mdx +1 -1
- package/docs/content/locales/zh-TW/dispatch.mdx +3 -3
- package/docs/content/locales/zh-TW/external-agents.mdx +23 -19
- package/docs/content/locales/zh-TW/mcp-clients.mdx +28 -3
- package/docs/content/locales/zh-TW/mcp-protocol.mdx +30 -15
- package/docs/content/locales/zh-TW/plan-plugin.mdx +3 -3
- package/docs/content/locales/zh-TW/server.mdx +2 -2
- package/docs/content/locales/zh-TW/skills-guide.mdx +1 -1
- package/docs/content/locales/zh-TW/template-assets.mdx +1 -1
- package/docs/content/locales/zh-TW/template-dispatch.mdx +2 -2
- package/docs/content/locales/zh-TW/template-plan.mdx +3 -3
- package/docs/content/mcp-clients.mdx +31 -4
- package/docs/content/mcp-protocol.mdx +35 -15
- package/docs/content/plan-plugin.mdx +3 -3
- package/docs/content/server.mdx +2 -2
- package/docs/content/skills-guide.mdx +1 -1
- package/docs/content/template-assets.mdx +1 -1
- package/docs/content/template-dispatch.mdx +2 -2
- package/docs/content/template-plan.mdx +3 -3
- package/package.json +2 -2
- package/src/templates/default/.agents/skills/security/SKILL.md +10 -0
- package/src/templates/workspace-core/.agents/skills/authentication/SKILL.md +15 -6
- package/src/templates/workspace-core/.agents/skills/external-agents/SKILL.md +16 -10
- package/src/templates/workspace-core/.agents/skills/performance/SKILL.md +20 -1
- package/src/templates/workspace-core/.agents/skills/security/SKILL.md +10 -0
|
@@ -7,12 +7,13 @@
|
|
|
7
7
|
*
|
|
8
8
|
* - **proxy (default)** — connect an MCP `Client` over
|
|
9
9
|
* `StreamableHTTPClientTransport` to the *already-running* local app's
|
|
10
|
-
* `http://127.0.0.1:<port>/
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
* it lazily on first
|
|
10
|
+
* `http://127.0.0.1:<port>/mcp` (falling back to the legacy
|
|
11
|
+
* `/_agent-native/mcp` path), and run a stdio `Server` that forwards tools
|
|
12
|
+
* and optional MCP App resources to it. The live app is the single source
|
|
13
|
+
* of truth: HMR'd actions, the real registry, correct per-request deep
|
|
14
|
+
* links, and tenant scoping all come for free. If the app isn't running,
|
|
15
|
+
* we wait briefly for it (the workspace gateway boots it lazily on first
|
|
16
|
+
* request).
|
|
16
17
|
*
|
|
17
18
|
* - **standalone (`--standalone`)** — no running server, no HMR. Build the
|
|
18
19
|
* MCP server in-process from `autoDiscoverActions(cwd)` +
|
|
@@ -25,6 +26,10 @@
|
|
|
25
26
|
|
|
26
27
|
import type { ServerCapabilities } from "@modelcontextprotocol/sdk/types.js";
|
|
27
28
|
|
|
29
|
+
import {
|
|
30
|
+
MCP_LEGACY_ROUTE_PREFIX,
|
|
31
|
+
MCP_PUBLIC_ROUTE_PREFIX,
|
|
32
|
+
} from "./route-paths.js";
|
|
28
33
|
import { resolveLocalAppOrigin } from "./workspace-resolve.js";
|
|
29
34
|
|
|
30
35
|
export interface RunMCPStdioOptions {
|
|
@@ -42,7 +47,10 @@ export interface RunMCPStdioOptions {
|
|
|
42
47
|
waitForAppMs?: number;
|
|
43
48
|
}
|
|
44
49
|
|
|
45
|
-
const
|
|
50
|
+
const MCP_SUBPATHS = [
|
|
51
|
+
MCP_PUBLIC_ROUTE_PREFIX,
|
|
52
|
+
MCP_LEGACY_ROUTE_PREFIX,
|
|
53
|
+
] as const;
|
|
46
54
|
|
|
47
55
|
function log(msg: string): void {
|
|
48
56
|
// stderr only — stdout is the MCP protocol channel and must stay clean.
|
|
@@ -74,9 +82,13 @@ function authHeaders(env: NodeJS.ProcessEnv): Record<string, string> {
|
|
|
74
82
|
return headers;
|
|
75
83
|
}
|
|
76
84
|
|
|
77
|
-
async function probeOrigin(
|
|
85
|
+
async function probeOrigin(
|
|
86
|
+
origin: string,
|
|
87
|
+
subpath: string,
|
|
88
|
+
timeoutMs = 800,
|
|
89
|
+
): Promise<boolean> {
|
|
78
90
|
try {
|
|
79
|
-
const res = await fetch(`${origin}${
|
|
91
|
+
const res = await fetch(`${origin}${subpath}`, {
|
|
80
92
|
method: "GET",
|
|
81
93
|
signal: AbortSignal.timeout(timeoutMs),
|
|
82
94
|
});
|
|
@@ -87,6 +99,13 @@ async function probeOrigin(origin: string, timeoutMs = 800): Promise<boolean> {
|
|
|
87
99
|
}
|
|
88
100
|
}
|
|
89
101
|
|
|
102
|
+
async function resolveMcpSubpath(origin: string): Promise<string | null> {
|
|
103
|
+
for (const subpath of MCP_SUBPATHS) {
|
|
104
|
+
if (await probeOrigin(origin, subpath)) return subpath;
|
|
105
|
+
}
|
|
106
|
+
return null;
|
|
107
|
+
}
|
|
108
|
+
|
|
90
109
|
/**
|
|
91
110
|
* Proxy mode: stdio Server ⇄ HTTP Client to the running app.
|
|
92
111
|
*
|
|
@@ -103,27 +122,26 @@ async function runProxy(opts: RunMCPStdioOptions): Promise<void> {
|
|
|
103
122
|
port: opts.port,
|
|
104
123
|
});
|
|
105
124
|
const env = opts.env ?? process.env;
|
|
106
|
-
const target = `${origin}${MCP_SUBPATH}`;
|
|
107
|
-
|
|
108
125
|
// Wait for the app to come up. The workspace gateway lazily boots an app's
|
|
109
126
|
// dev server on first request, so a fresh `mcp serve` may briefly race the
|
|
110
127
|
// boot. Hit the gateway path too so the lazy start is triggered.
|
|
111
128
|
const deadline = Date.now() + (opts.waitForAppMs ?? 60_000);
|
|
112
|
-
let
|
|
113
|
-
if (!
|
|
129
|
+
let mcpSubpath = await resolveMcpSubpath(origin);
|
|
130
|
+
if (!mcpSubpath) {
|
|
114
131
|
log(`Waiting for ${appId} at ${origin} …`);
|
|
115
|
-
while (!
|
|
132
|
+
while (!mcpSubpath && Date.now() < deadline) {
|
|
116
133
|
await new Promise((r) => setTimeout(r, 750));
|
|
117
|
-
|
|
134
|
+
mcpSubpath = await resolveMcpSubpath(origin);
|
|
118
135
|
}
|
|
119
136
|
}
|
|
120
|
-
if (!
|
|
137
|
+
if (!mcpSubpath) {
|
|
121
138
|
throw new Error(
|
|
122
139
|
`Timed out waiting for the local app at ${origin}. Start it with ` +
|
|
123
140
|
`\`agent-native dev\` (or \`agent-native workspace-dev\`), or run ` +
|
|
124
141
|
`\`agent-native mcp serve --standalone\` to build the server from disk.`,
|
|
125
142
|
);
|
|
126
143
|
}
|
|
144
|
+
const target = `${origin}${mcpSubpath}`;
|
|
127
145
|
|
|
128
146
|
const { Client } = await import("@modelcontextprotocol/sdk/client/index.js");
|
|
129
147
|
const { StreamableHTTPClientTransport } =
|
|
@@ -213,7 +213,8 @@ export async function resolveWorkspace(
|
|
|
213
213
|
/**
|
|
214
214
|
* Resolve the local app the stdio proxy should connect its MCP HTTP client
|
|
215
215
|
* to. Honours an explicit `--app` / appId and `--port` / explicit port.
|
|
216
|
-
* Returns the chosen app's origin (where `/
|
|
216
|
+
* Returns the chosen app's origin (where `/mcp` is mounted; the legacy
|
|
217
|
+
* `/_agent-native/mcp` alias is supported too).
|
|
217
218
|
*
|
|
218
219
|
* Order of precedence:
|
|
219
220
|
* 1. explicit `port` → http://127.0.0.1:<port>
|
|
@@ -954,9 +954,11 @@ function firstPartyMcpAudienceForUrl(rawUrl: string): string | undefined {
|
|
|
954
954
|
try {
|
|
955
955
|
const url = new URL(rawUrl);
|
|
956
956
|
const pathname = url.pathname.replace(/\/+$/, "");
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
|
|
957
|
+
if (pathname.endsWith("/_agent-native/mcp")) {
|
|
958
|
+
url.pathname = `${pathname.slice(0, -"/_agent-native/mcp".length)}/mcp`;
|
|
959
|
+
} else {
|
|
960
|
+
url.pathname = pathname.endsWith("/mcp") ? pathname : `${pathname}/mcp`;
|
|
961
|
+
}
|
|
960
962
|
url.search = "";
|
|
961
963
|
url.hash = "";
|
|
962
964
|
return url.toString().replace(/\/+$/, "");
|
|
@@ -438,22 +438,22 @@ function normalizeEndpointPath(pathname: string): string {
|
|
|
438
438
|
return pathname.replace(/\/+$/, "") || "/";
|
|
439
439
|
}
|
|
440
440
|
|
|
441
|
-
function
|
|
441
|
+
function expectedFirstPartyMcpUrls(appUrl: string): URL[] {
|
|
442
442
|
try {
|
|
443
|
-
|
|
443
|
+
const base = appUrl.replace(/\/+$/, "");
|
|
444
|
+
return [new URL(`${base}/mcp`), new URL(`${base}/_agent-native/mcp`)];
|
|
444
445
|
} catch {
|
|
445
|
-
return
|
|
446
|
+
return [];
|
|
446
447
|
}
|
|
447
448
|
}
|
|
448
449
|
|
|
449
450
|
function sameFirstPartyMcpEndpoint(endpointUrl: URL, appUrl: string): boolean {
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
endpointUrl.search === expected.search
|
|
451
|
+
return expectedFirstPartyMcpUrls(appUrl).some(
|
|
452
|
+
(expected) =>
|
|
453
|
+
endpointUrl.origin === expected.origin &&
|
|
454
|
+
normalizeEndpointPath(endpointUrl.pathname) ===
|
|
455
|
+
normalizeEndpointPath(expected.pathname) &&
|
|
456
|
+
endpointUrl.search === expected.search,
|
|
457
457
|
);
|
|
458
458
|
}
|
|
459
459
|
|
|
@@ -6,9 +6,11 @@ import {
|
|
|
6
6
|
type A2AToolResultSummary,
|
|
7
7
|
} from "../../a2a/artifact-response.js";
|
|
8
8
|
import { collectFinalResponseTextFromAgentEvents } from "../../a2a/response-text.js";
|
|
9
|
+
import { resolveMainChatMaxOutputTokens } from "../../agent/engine/output-tokens.js";
|
|
9
10
|
import type { EngineTool } from "../../agent/engine/types.js";
|
|
10
11
|
import {
|
|
11
12
|
filterInitialEngineTools,
|
|
13
|
+
resolveAgentRequestReasoningEffort,
|
|
12
14
|
type ActionEntry,
|
|
13
15
|
} from "../../agent/production-agent.js";
|
|
14
16
|
import { runAgentLoopDirectWithSoftTimeout } from "../../agent/run-loop-with-resume.js";
|
|
@@ -160,6 +162,17 @@ function runDelegatedAgentLoop(
|
|
|
160
162
|
return runner(
|
|
161
163
|
{
|
|
162
164
|
...runOptions,
|
|
165
|
+
// Delegated runs resolve their own model and do not pass through the
|
|
166
|
+
// interactive request handler's output-token setup. Use the same
|
|
167
|
+
// model-aware headroom here so reasoning models (notably GPT-5.x) do
|
|
168
|
+
// not spend the small internal default entirely on reasoning before
|
|
169
|
+
// emitting a tool call or answer. Preserve explicit test/caller values.
|
|
170
|
+
maxOutputTokens:
|
|
171
|
+
runOptions.maxOutputTokens ??
|
|
172
|
+
resolveMainChatMaxOutputTokens(runOptions.model),
|
|
173
|
+
reasoningEffort:
|
|
174
|
+
runOptions.reasoningEffort ??
|
|
175
|
+
resolveAgentRequestReasoningEffort({ model: runOptions.model }),
|
|
163
176
|
finalResponseGuard: pluginOptions.finalResponseGuard,
|
|
164
177
|
},
|
|
165
178
|
pluginOptions.runSoftTimeoutMs,
|
|
@@ -168,6 +168,7 @@ import {
|
|
|
168
168
|
import { mountRealtimeVoiceRoutes } from "./realtime-voice.js";
|
|
169
169
|
import {
|
|
170
170
|
runWithRequestContext,
|
|
171
|
+
getRequestContext,
|
|
171
172
|
getRequestOrgId,
|
|
172
173
|
getRequestUserEmail,
|
|
173
174
|
getRequestRunContext,
|
|
@@ -1267,6 +1268,22 @@ export function createAgentChatPlugin(
|
|
|
1267
1268
|
if (a2aRunContext) {
|
|
1268
1269
|
a2aRunContext.owner = userEmail;
|
|
1269
1270
|
a2aRunContext.userApiKey = ownerApiKey;
|
|
1271
|
+
// The async processor restores the original request origin from
|
|
1272
|
+
// task metadata. Only derive a fallback for synchronous A2A calls
|
|
1273
|
+
// where the inbound event is still the caller request.
|
|
1274
|
+
if (!a2aRunContext.requestOrigin) {
|
|
1275
|
+
const restoredOrigin = getRequestContext()?.requestOrigin;
|
|
1276
|
+
if (restoredOrigin) {
|
|
1277
|
+
a2aRunContext.requestOrigin = restoredOrigin;
|
|
1278
|
+
}
|
|
1279
|
+
}
|
|
1280
|
+
if (!a2aRunContext.requestOrigin) {
|
|
1281
|
+
try {
|
|
1282
|
+
a2aRunContext.requestOrigin = getOrigin(context.event as any);
|
|
1283
|
+
} catch {
|
|
1284
|
+
// Keep the owner context even when no browser origin exists.
|
|
1285
|
+
}
|
|
1286
|
+
}
|
|
1270
1287
|
}
|
|
1271
1288
|
const a2aEngine = await resolveEngine({
|
|
1272
1289
|
engineOption: options?.engine,
|
|
@@ -1287,15 +1304,6 @@ export function createAgentChatPlugin(
|
|
|
1287
1304
|
? ""
|
|
1288
1305
|
: await buildSchemaBlock(owner, databaseToolsMode);
|
|
1289
1306
|
const extra = await resolveExtraContext(context.event, owner);
|
|
1290
|
-
// Stable content first, most-volatile-per-day last: the
|
|
1291
|
-
// runtime-context block is appended after resources/schema/extra so
|
|
1292
|
-
// a day rollover (or the resources/extra content changing) only
|
|
1293
|
-
// invalidates the cached prompt prefix as late as possible.
|
|
1294
|
-
const runtimeContext = runtimeContextForEvent(context.event);
|
|
1295
|
-
const systemPrompt = devActive
|
|
1296
|
-
? devPrompt + resources + schemaBlock + extra + runtimeContext
|
|
1297
|
-
: basePrompt + resources + schemaBlock + extra + runtimeContext;
|
|
1298
|
-
if (a2aRunContext) a2aRunContext.systemPrompt = systemPrompt;
|
|
1299
1307
|
|
|
1300
1308
|
const a2aModelCandidate =
|
|
1301
1309
|
options?.model ??
|
|
@@ -1309,6 +1317,30 @@ export function createAgentChatPlugin(
|
|
|
1309
1317
|
a2aRunContext.model = model;
|
|
1310
1318
|
}
|
|
1311
1319
|
|
|
1320
|
+
// Keep delegated runs aligned with the interactive production
|
|
1321
|
+
// prompt's model-specific behavior without importing interactive
|
|
1322
|
+
// onboarding into a background/cross-app task.
|
|
1323
|
+
const modelOverlay = getModelFamilyOverlay(model);
|
|
1324
|
+
// Stable content first, most-volatile-per-day last: the
|
|
1325
|
+
// runtime-context block is appended after resources/schema/extra so
|
|
1326
|
+
// a day rollover (or the resources/extra content changing) only
|
|
1327
|
+
// invalidates the cached prompt prefix as late as possible.
|
|
1328
|
+
const runtimeContext = runtimeContextForEvent(context.event);
|
|
1329
|
+
const systemPrompt = devActive
|
|
1330
|
+
? devPrompt +
|
|
1331
|
+
resources +
|
|
1332
|
+
schemaBlock +
|
|
1333
|
+
extra +
|
|
1334
|
+
modelOverlay +
|
|
1335
|
+
runtimeContext
|
|
1336
|
+
: basePrompt +
|
|
1337
|
+
resources +
|
|
1338
|
+
schemaBlock +
|
|
1339
|
+
extra +
|
|
1340
|
+
modelOverlay +
|
|
1341
|
+
runtimeContext;
|
|
1342
|
+
if (a2aRunContext) a2aRunContext.systemPrompt = systemPrompt;
|
|
1343
|
+
|
|
1312
1344
|
// Build tools — same as interactive handler but WITHOUT call-agent
|
|
1313
1345
|
// to prevent infinite recursive A2A loops (agent calling itself).
|
|
1314
1346
|
// In dev mode, template actions are invoked via bash (not native tools),
|
|
@@ -5361,6 +5393,7 @@ Non-code requests are still fine on this surface: read data, navigate the UI, su
|
|
|
5361
5393
|
"/_agent-native/actions",
|
|
5362
5394
|
"/_agent-native/agent-model-defaults",
|
|
5363
5395
|
"/_agent-native/mcp",
|
|
5396
|
+
"/mcp",
|
|
5364
5397
|
],
|
|
5365
5398
|
});
|
|
5366
5399
|
};
|
|
@@ -18,6 +18,7 @@
|
|
|
18
18
|
import { AsyncLocalStorage } from "node:async_hooks";
|
|
19
19
|
|
|
20
20
|
import { applyAgentTextEventToBuffer } from "../a2a/response-text.js";
|
|
21
|
+
import { resolveMainChatMaxOutputTokens } from "../agent/engine/output-tokens.js";
|
|
21
22
|
import type { AgentEngine, EngineMessage } from "../agent/engine/types.js";
|
|
22
23
|
import type {
|
|
23
24
|
ActionEntry,
|
|
@@ -26,6 +27,7 @@ import type {
|
|
|
26
27
|
import {
|
|
27
28
|
actionsToEngineTools,
|
|
28
29
|
filterInitialEngineTools,
|
|
30
|
+
resolveAgentRequestReasoningEffort,
|
|
29
31
|
} from "../agent/production-agent.js";
|
|
30
32
|
import {
|
|
31
33
|
runAgentLoop,
|
|
@@ -589,6 +591,11 @@ function createTaskMessageFinalGuard(
|
|
|
589
591
|
retryMessage: formatQueuedTaskMessages(queuedMessages),
|
|
590
592
|
fallbackMessage:
|
|
591
593
|
"I received an orchestrator update while finishing, but could not continue from it. Please check the task status and send the update again if needed.",
|
|
594
|
+
// A queued update can introduce a request for an action that was
|
|
595
|
+
// deferred behind tool-search. The retry is already a corrective turn,
|
|
596
|
+
// so expose the full authorized registry rather than making the
|
|
597
|
+
// sub-agent spend that turn rediscovering the same tool.
|
|
598
|
+
expandToolSurface: true,
|
|
592
599
|
};
|
|
593
600
|
};
|
|
594
601
|
}
|
|
@@ -1835,6 +1842,16 @@ export async function processAgentTeamRun(
|
|
|
1835
1842
|
chunkUsage = await runAgentLoop({
|
|
1836
1843
|
engine: config.engine,
|
|
1837
1844
|
model: config.model,
|
|
1845
|
+
// Agent-team runs are delegated turns too. Keep their
|
|
1846
|
+
// first attempt on the same model-aware budget as A2A /
|
|
1847
|
+
// MCP so reasoning models do not spend the old 4K
|
|
1848
|
+
// default before emitting a tool call or answer.
|
|
1849
|
+
maxOutputTokens: resolveMainChatMaxOutputTokens(
|
|
1850
|
+
config.model,
|
|
1851
|
+
),
|
|
1852
|
+
reasoningEffort: resolveAgentRequestReasoningEffort({
|
|
1853
|
+
model: config.model,
|
|
1854
|
+
}),
|
|
1838
1855
|
systemPrompt,
|
|
1839
1856
|
tools,
|
|
1840
1857
|
availableTools,
|
|
@@ -74,6 +74,11 @@ import {
|
|
|
74
74
|
} from "../db/client.js";
|
|
75
75
|
import { ensureColumnExists, ensureTableExists } from "../db/ddl-guard.js";
|
|
76
76
|
import { widenIntColumnsToBigInt } from "../db/widen-columns.js";
|
|
77
|
+
import {
|
|
78
|
+
MCP_LEGACY_ROUTE_PREFIX,
|
|
79
|
+
MCP_PUBLIC_ROUTE_PREFIX,
|
|
80
|
+
isMcpProtocolPath,
|
|
81
|
+
} from "../mcp/route-paths.js";
|
|
77
82
|
import { readBody } from "../server/h3-helpers.js";
|
|
78
83
|
import { putSetting } from "../settings/store.js";
|
|
79
84
|
import { DEFAULT_SSR_CACHE_HEADERS } from "../shared/cache-control.js";
|
|
@@ -718,8 +723,9 @@ async function getBearerLegacySession(
|
|
|
718
723
|
* `agent-native connect` mints this token for the local Plans publish flow and
|
|
719
724
|
* POSTs it to the HOSTED action route
|
|
720
725
|
* `/_agent-native/actions/import-visual-plan-source`. That token is audience-
|
|
721
|
-
* bound to the app's MCP resource (`{appUrl}/
|
|
722
|
-
*
|
|
726
|
+
* bound to the app's canonical MCP resource (`{appUrl}/mcp`; the legacy
|
|
727
|
+
* `/_agent-native/mcp` resource is also accepted), not to the legacy `sessions`
|
|
728
|
+
* table — so the legacy bearer lookup above never matches it.
|
|
723
729
|
* Reuse the MCP surface's canonical `verifyAuth` here so the HTTP action surface
|
|
724
730
|
* honors EXACTLY the tokens the MCP endpoint honors: same signature check, same
|
|
725
731
|
* audience binding to THIS app's resource, same connect-token revocation gate.
|
|
@@ -740,13 +746,13 @@ async function getMcpOAuthBearerSession(
|
|
|
740
746
|
if (!bearerToken) return null;
|
|
741
747
|
|
|
742
748
|
try {
|
|
743
|
-
const [{
|
|
749
|
+
const [{ getMcpOAuthAudiences }, { verifyAuth, resolveOrgIdFromDomain }] =
|
|
744
750
|
await Promise.all([
|
|
745
751
|
import("../mcp/oauth-route.js"),
|
|
746
752
|
import("../mcp/build-server.js"),
|
|
747
753
|
]);
|
|
748
754
|
const result = await verifyAuth(authHeader, undefined, {
|
|
749
|
-
resourceUrl:
|
|
755
|
+
resourceUrl: getMcpOAuthAudiences(event),
|
|
750
756
|
allowDevOpen: false,
|
|
751
757
|
});
|
|
752
758
|
const identity = result.authed ? result.identity : undefined;
|
|
@@ -1775,7 +1781,11 @@ function createAuthGuardFn(): (
|
|
|
1775
1781
|
// the stdio proxy or HTTP can never reach it. Exact protocol endpoint only:
|
|
1776
1782
|
// tolerate the common trailing slash, but keep
|
|
1777
1783
|
// `/_agent-native/mcp/*` management subroutes on normal session auth.
|
|
1778
|
-
if (
|
|
1784
|
+
if (
|
|
1785
|
+
isMcpProtocolPath(p) ||
|
|
1786
|
+
p === `${MCP_PUBLIC_ROUTE_PREFIX}/` ||
|
|
1787
|
+
p === `${MCP_LEGACY_ROUTE_PREFIX}/`
|
|
1788
|
+
) {
|
|
1779
1789
|
return;
|
|
1780
1790
|
}
|
|
1781
1791
|
|
|
@@ -1806,7 +1816,13 @@ function createAuthGuardFn(): (
|
|
|
1806
1816
|
p === "/_agent-native/mcp/connect/device/poll" ||
|
|
1807
1817
|
p === "/_agent-native/mcp/oauth/authorize" ||
|
|
1808
1818
|
p === "/_agent-native/mcp/oauth/token" ||
|
|
1809
|
-
p === "/_agent-native/mcp/oauth/register"
|
|
1819
|
+
p === "/_agent-native/mcp/oauth/register" ||
|
|
1820
|
+
p === `${MCP_PUBLIC_ROUTE_PREFIX}/connect` ||
|
|
1821
|
+
p === `${MCP_PUBLIC_ROUTE_PREFIX}/connect/device/start` ||
|
|
1822
|
+
p === `${MCP_PUBLIC_ROUTE_PREFIX}/connect/device/poll` ||
|
|
1823
|
+
p === `${MCP_PUBLIC_ROUTE_PREFIX}/oauth/authorize` ||
|
|
1824
|
+
p === `${MCP_PUBLIC_ROUTE_PREFIX}/oauth/token` ||
|
|
1825
|
+
p === `${MCP_PUBLIC_ROUTE_PREFIX}/oauth/register`
|
|
1810
1826
|
) {
|
|
1811
1827
|
return;
|
|
1812
1828
|
}
|
|
@@ -64,6 +64,7 @@ import {
|
|
|
64
64
|
handleMcpOAuthAuthorizationServerMetadata,
|
|
65
65
|
handleMcpOAuthProtectedResourceMetadata,
|
|
66
66
|
} from "../mcp/oauth-route.js";
|
|
67
|
+
import { MCP_ROUTE_PREFIXES } from "../mcp/route-paths.js";
|
|
67
68
|
import { registerBuiltinNotificationChannels } from "../notifications/channels.js";
|
|
68
69
|
import { createNotificationsHandler } from "../notifications/routes.js";
|
|
69
70
|
import { getOrgContext } from "../org/context.js";
|
|
@@ -873,9 +874,10 @@ export interface CoreRoutesPluginOptions {
|
|
|
873
874
|
/** Disable the /_agent-native/embed/start iframe session launcher. */
|
|
874
875
|
disableEmbedRoute?: boolean;
|
|
875
876
|
/**
|
|
876
|
-
* Disable the /
|
|
877
|
-
*
|
|
878
|
-
*
|
|
877
|
+
* Disable the /mcp/connect routes (browser Connect page + CLI device-code
|
|
878
|
+
* flow that mints per-user, revocable MCP tokens) and the standard remote-MCP
|
|
879
|
+
* OAuth endpoints under /mcp/oauth. The legacy /_agent-native/mcp aliases
|
|
880
|
+
* are disabled at the same time.
|
|
879
881
|
* Enabled by default — the routes are session-gated where they approve user
|
|
880
882
|
* access; token endpoints are protected by single-use codes / refresh
|
|
881
883
|
* tokens.
|
|
@@ -939,7 +941,7 @@ export function createCoreRoutesPlugin(
|
|
|
939
941
|
rejectInit = reject;
|
|
940
942
|
});
|
|
941
943
|
trackPluginInit(nitroApp, initPromise, {
|
|
942
|
-
paths: [FRAMEWORK_ROUTE_PREFIX, "/.well-known"],
|
|
944
|
+
paths: [FRAMEWORK_ROUTE_PREFIX, "/mcp", "/.well-known"],
|
|
943
945
|
});
|
|
944
946
|
try {
|
|
945
947
|
await awaitBootstrap(nitroApp);
|
|
@@ -3497,16 +3499,18 @@ export function createCoreRoutesPlugin(
|
|
|
3497
3499
|
handleMcpOAuthAuthorizationServerMetadata(event),
|
|
3498
3500
|
),
|
|
3499
3501
|
);
|
|
3500
|
-
|
|
3501
|
-
|
|
3502
|
-
|
|
3503
|
-
|
|
3504
|
-
|
|
3505
|
-
|
|
3506
|
-
|
|
3507
|
-
|
|
3508
|
-
|
|
3509
|
-
|
|
3502
|
+
for (const mcpRoutePrefix of MCP_ROUTE_PREFIXES) {
|
|
3503
|
+
getH3App(nitroApp).use(
|
|
3504
|
+
`${mcpRoutePrefix}/oauth`,
|
|
3505
|
+
defineEventHandler(async (event: H3Event) => {
|
|
3506
|
+
const subpath = event.url?.pathname || "";
|
|
3507
|
+
return handleMcpOAuth(event, subpath, {
|
|
3508
|
+
appId: options.mcpConnectAppId,
|
|
3509
|
+
appName: options.mcpConnectAppName ?? getAppName(),
|
|
3510
|
+
});
|
|
3511
|
+
}),
|
|
3512
|
+
);
|
|
3513
|
+
}
|
|
3510
3514
|
|
|
3511
3515
|
// Frictionless external-agent connection. A logged-in user mints a
|
|
3512
3516
|
// per-user, scoped, revocable MCP bearer token here — via the browser
|
|
@@ -3522,16 +3526,18 @@ export function createCoreRoutesPlugin(
|
|
|
3522
3526
|
appName: options.mcpConnectAppName ?? getAppName(),
|
|
3523
3527
|
serverName: options.mcpConnectServerName,
|
|
3524
3528
|
};
|
|
3525
|
-
|
|
3526
|
-
|
|
3527
|
-
|
|
3528
|
-
|
|
3529
|
-
|
|
3530
|
-
|
|
3531
|
-
|
|
3532
|
-
|
|
3533
|
-
|
|
3534
|
-
|
|
3529
|
+
for (const mcpRoutePrefix of MCP_ROUTE_PREFIXES) {
|
|
3530
|
+
getH3App(nitroApp).use(
|
|
3531
|
+
`${mcpRoutePrefix}/connect`,
|
|
3532
|
+
defineEventHandler(async (event: H3Event) => {
|
|
3533
|
+
// The framework strips the mount prefix from event.url.pathname,
|
|
3534
|
+
// so what remains is the subpath after `/connect` (e.g. `/token`,
|
|
3535
|
+
// `/device/start`, or `` for the page itself).
|
|
3536
|
+
const subpath = event.url?.pathname || "";
|
|
3537
|
+
return handleMcpConnect(event, subpath, mcpConnectOpts);
|
|
3538
|
+
}),
|
|
3539
|
+
);
|
|
3540
|
+
}
|
|
3535
3541
|
}
|
|
3536
3542
|
|
|
3537
3543
|
// Cross-app SSO ("Sign in with Agent-Native") — CLIENT side. Mounted
|
|
@@ -50,6 +50,7 @@ import {
|
|
|
50
50
|
setResponseStatus,
|
|
51
51
|
} from "h3";
|
|
52
52
|
|
|
53
|
+
import { MCP_PUBLIC_ROUTE_PREFIX } from "../mcp/route-paths.js";
|
|
53
54
|
import { getConfiguredAppBasePath } from "./app-base-path.js";
|
|
54
55
|
|
|
55
56
|
/**
|
|
@@ -166,12 +167,28 @@ function matchingFrameworkPrefix(
|
|
|
166
167
|
): string | undefined {
|
|
167
168
|
if (pathname.startsWith(frameworkPrefix)) return frameworkPrefix;
|
|
168
169
|
|
|
170
|
+
if (
|
|
171
|
+
pathname === MCP_PUBLIC_ROUTE_PREFIX ||
|
|
172
|
+
pathname.startsWith(`${MCP_PUBLIC_ROUTE_PREFIX}/`)
|
|
173
|
+
) {
|
|
174
|
+
return MCP_PUBLIC_ROUTE_PREFIX;
|
|
175
|
+
}
|
|
176
|
+
|
|
169
177
|
const basePath = getConfiguredAppBasePath();
|
|
170
178
|
const basePathFrameworkPrefix = `${basePath}${frameworkPrefix}`;
|
|
171
179
|
if (basePath && pathname.startsWith(basePathFrameworkPrefix)) {
|
|
172
180
|
return basePathFrameworkPrefix;
|
|
173
181
|
}
|
|
174
182
|
|
|
183
|
+
const basePathMcpPrefix = `${basePath}${MCP_PUBLIC_ROUTE_PREFIX}`;
|
|
184
|
+
if (
|
|
185
|
+
basePath &&
|
|
186
|
+
(pathname === basePathMcpPrefix ||
|
|
187
|
+
pathname.startsWith(`${basePathMcpPrefix}/`))
|
|
188
|
+
) {
|
|
189
|
+
return basePathMcpPrefix;
|
|
190
|
+
}
|
|
191
|
+
|
|
175
192
|
return undefined;
|
|
176
193
|
}
|
|
177
194
|
|
|
@@ -15,6 +15,7 @@ import type { EventHandler, H3Event } from "h3";
|
|
|
15
15
|
import { setResponseHeader, setResponseStatus } from "h3";
|
|
16
16
|
|
|
17
17
|
import { getMissingDefaultPlugins } from "../deploy/route-discovery.js";
|
|
18
|
+
import { MCP_PUBLIC_ROUTE_PREFIX } from "../mcp/route-paths.js";
|
|
18
19
|
import { getConfiguredAppBasePath } from "./app-base-path.js";
|
|
19
20
|
import { captureError } from "./capture-error.js";
|
|
20
21
|
import { createCsrfMiddleware } from "./csrf.js";
|
|
@@ -48,7 +49,8 @@ function pathMatchesPrefix(reqPath: string, prefix: string): boolean {
|
|
|
48
49
|
function supportsAppBasePathMount(path: string): boolean {
|
|
49
50
|
return (
|
|
50
51
|
pathMatchesPrefix(path, FRAMEWORK_PREFIX) ||
|
|
51
|
-
pathMatchesPrefix(path, WELL_KNOWN_PREFIX)
|
|
52
|
+
pathMatchesPrefix(path, WELL_KNOWN_PREFIX) ||
|
|
53
|
+
pathMatchesPrefix(path, MCP_PUBLIC_ROUTE_PREFIX)
|
|
52
54
|
);
|
|
53
55
|
}
|
|
54
56
|
|
|
@@ -164,6 +166,9 @@ export function getH3App(nitroApp: any): H3AppShim {
|
|
|
164
166
|
registerMiddleware(nitroApp, WELL_KNOWN_PREFIX, readinessGate, {
|
|
165
167
|
prepend: true,
|
|
166
168
|
});
|
|
169
|
+
registerMiddleware(nitroApp, MCP_PUBLIC_ROUTE_PREFIX, readinessGate, {
|
|
170
|
+
prepend: true,
|
|
171
|
+
});
|
|
167
172
|
|
|
168
173
|
// CSRF (see csrf.ts): registered here — synchronously, on the very
|
|
169
174
|
// first `getH3App()` call for this nitroApp — rather than inside
|
|
@@ -196,7 +201,8 @@ export function getH3App(nitroApp: any): H3AppShim {
|
|
|
196
201
|
const reqPath = event.url?.pathname ?? "";
|
|
197
202
|
if (
|
|
198
203
|
resolveMountMatch(reqPath, FRAMEWORK_PREFIX) ||
|
|
199
|
-
resolveMountMatch(reqPath, WELL_KNOWN_PREFIX)
|
|
204
|
+
resolveMountMatch(reqPath, WELL_KNOWN_PREFIX) ||
|
|
205
|
+
resolveMountMatch(reqPath, MCP_PUBLIC_ROUTE_PREFIX)
|
|
200
206
|
) {
|
|
201
207
|
await awaitFrameworkRoutesReadyForRequest(nitroApp, reqPath);
|
|
202
208
|
}
|
|
@@ -17,7 +17,7 @@ import {
|
|
|
17
17
|
type H3Event,
|
|
18
18
|
} from "h3";
|
|
19
19
|
|
|
20
|
-
import {
|
|
20
|
+
import { getAppBasePathFromViteEnv } from "./app-base-path.js";
|
|
21
21
|
import { getAppName } from "./app-name.js";
|
|
22
22
|
import { signupAttributionFromCookieHeader } from "./attribution.js";
|
|
23
23
|
import {
|
|
@@ -170,6 +170,12 @@ function getConfiguredOriginAllowlist(): Set<string> {
|
|
|
170
170
|
return out;
|
|
171
171
|
}
|
|
172
172
|
|
|
173
|
+
/** Return whether a candidate is one of this deployment's configured origins. */
|
|
174
|
+
export function isConfiguredAppOrigin(value: string | undefined): boolean {
|
|
175
|
+
const origin = normalizeOrigin(value);
|
|
176
|
+
return !!origin && getConfiguredOriginAllowlist().has(origin);
|
|
177
|
+
}
|
|
178
|
+
|
|
173
179
|
function getWorkspaceCallbackOrigin(): string | undefined {
|
|
174
180
|
const publicAuthOrigin = firstOriginFromEnv(EXPLICIT_PUBLIC_ORIGIN_ENV_KEYS, {
|
|
175
181
|
allowLoopback: true,
|
|
@@ -275,7 +281,11 @@ export function getOrigin(event: H3Event): string {
|
|
|
275
281
|
|
|
276
282
|
/** App mount prefix, if the template is served under APP_BASE_PATH. */
|
|
277
283
|
export function getAppBasePath(): string {
|
|
278
|
-
|
|
284
|
+
// Vite statically replaces VITE_* values in the server bundle during the
|
|
285
|
+
// build, but Netlify/Nitro does not necessarily expose those build vars at
|
|
286
|
+
// runtime. Keep auth and OAuth path matching aligned with the SSR handler by
|
|
287
|
+
// falling back to import.meta.env (including BASE_URL).
|
|
288
|
+
return getAppBasePathFromViteEnv();
|
|
279
289
|
}
|
|
280
290
|
|
|
281
291
|
/** Build an absolute same-origin URL that preserves APP_BASE_PATH. */
|
|
@@ -2,6 +2,7 @@ import { defineEventHandler, getHeader, getMethod } from "h3";
|
|
|
2
2
|
import type { EventHandler, H3Event } from "h3";
|
|
3
3
|
|
|
4
4
|
import { getDatabaseRuntimeFingerprint } from "../db/runtime-diagnostics.js";
|
|
5
|
+
import { isMcpPublicPath } from "../mcp/route-paths.js";
|
|
5
6
|
import { track } from "../tracking/index.js";
|
|
6
7
|
import { getAppName } from "./app-name.js";
|
|
7
8
|
|
|
@@ -74,7 +75,11 @@ function statusClass(statusCode: number): string {
|
|
|
74
75
|
}
|
|
75
76
|
|
|
76
77
|
function routeKind(pathname: string): string {
|
|
77
|
-
if (
|
|
78
|
+
if (
|
|
79
|
+
isMcpPublicPath(pathname) ||
|
|
80
|
+
pathname === "/_agent-native" ||
|
|
81
|
+
pathname.startsWith("/_agent-native/")
|
|
82
|
+
) {
|
|
78
83
|
return "framework";
|
|
79
84
|
}
|
|
80
85
|
if (pathname === "/api" || pathname.startsWith("/api/")) return "api";
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* Auth: `Authorization: Bearer <token>` — accepts the SAME tokens the MCP /
|
|
6
6
|
* action surface accepts: a legacy `sessions` bearer (desktop/native) OR a
|
|
7
7
|
* connect-minted MCP OAuth access token (the `agent-native connect` token,
|
|
8
|
-
* audience-bound to this app's `{origin}/
|
|
8
|
+
* audience-bound to this app's `{origin}/mcp` resource). A
|
|
9
9
|
* normal browser session cookie is also accepted. Rejects unauthenticated
|
|
10
10
|
* callers with 401.
|
|
11
11
|
* Body: raw `image/png` bytes, or JSON `{ "pngBase64": "..." }`. Capped at
|
|
@@ -74,13 +74,13 @@ async function resolveUploadSession(
|
|
|
74
74
|
if (!authHeader || !bearer) return null;
|
|
75
75
|
|
|
76
76
|
try {
|
|
77
|
-
const [{
|
|
77
|
+
const [{ getMcpOAuthAudiences }, { verifyAuth, resolveOrgIdFromDomain }] =
|
|
78
78
|
await Promise.all([
|
|
79
79
|
import("../mcp/oauth-route.js"),
|
|
80
80
|
import("../mcp/build-server.js"),
|
|
81
81
|
]);
|
|
82
82
|
const result = await verifyAuth(authHeader, undefined, {
|
|
83
|
-
resourceUrl:
|
|
83
|
+
resourceUrl: getMcpOAuthAudiences(event),
|
|
84
84
|
allowDevOpen: false,
|
|
85
85
|
});
|
|
86
86
|
const identity = result.authed ? result.identity : undefined;
|