@agent-native/core 0.98.16 → 0.99.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/corpus/README.md +2 -2
- package/corpus/core/CHANGELOG.md +21 -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/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/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/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-plugin.ts +59 -8
- 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 +6 -0
- 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/global.css +63 -4
- package/corpus/templates/analytics/app/pages/sessions/SessionDetailPage.tsx +8 -5
- 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-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/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/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/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/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/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/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/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 +2 -2
- package/dist/observability/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 +3 -3
- package/dist/secrets/routes.d.ts +6 -6
- package/dist/server/agent-chat-plugin.d.ts.map +1 -1
- package/dist/server/agent-chat-plugin.js +60 -9
- package/dist/server/agent-chat-plugin.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 +5 -0
- 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/server/transcribe-voice.d.ts +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 +1 -1
- 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
|
@@ -39,17 +39,19 @@ function trimEndpointPath(pathname: string, suffix: string): string | null {
|
|
|
39
39
|
return normalized.slice(0, -suffix.length) || "/";
|
|
40
40
|
}
|
|
41
41
|
|
|
42
|
+
const MCP_PUBLIC_PATH = "/mcp";
|
|
43
|
+
const MCP_LEGACY_PATH = "/_agent-native/mcp";
|
|
44
|
+
|
|
42
45
|
export function getMcpUrl(
|
|
43
46
|
url: string,
|
|
44
47
|
options: AgentEndpointOptions = {},
|
|
45
48
|
): string {
|
|
46
49
|
const parsed = appUrl(url, options);
|
|
47
|
-
const trimmed =
|
|
48
|
-
|
|
49
|
-
parsed.pathname
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
}
|
|
50
|
+
const trimmed =
|
|
51
|
+
trimEndpointPath(parsed.pathname, MCP_LEGACY_PATH) ??
|
|
52
|
+
trimEndpointPath(parsed.pathname, MCP_PUBLIC_PATH);
|
|
53
|
+
const basePath = (trimmed ?? parsed.pathname).replace(/\/$/, "");
|
|
54
|
+
parsed.pathname = `${basePath}${MCP_PUBLIC_PATH}`;
|
|
53
55
|
parsed.search = "";
|
|
54
56
|
parsed.hash = "";
|
|
55
57
|
return parsed.toString();
|
|
@@ -620,6 +620,13 @@ const messages = {
|
|
|
620
620
|
description: "Manage payments, subscriptions, and customers.",
|
|
621
621
|
useCase: "Payments, subscriptions, invoicing, customer management",
|
|
622
622
|
},
|
|
623
|
+
atlassian: {
|
|
624
|
+
description: "Read and write Jira issues and Confluence content.",
|
|
625
|
+
useCase:
|
|
626
|
+
"Project management, issue tracking, documentation, team collaboration",
|
|
627
|
+
setupNote:
|
|
628
|
+
"Your Atlassian organization admin may need to allow this app's domain and enable the required Rovo MCP permissions before OAuth can complete.",
|
|
629
|
+
},
|
|
623
630
|
},
|
|
624
631
|
auth: {
|
|
625
632
|
none: "No auth",
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Process-local fallback task tracker for `ask_app` (and the legacy
|
|
3
|
+
* `ask-agent` meta-tool) for the one case where no app origin is derivable
|
|
4
|
+
* from the MCP request — `selfA2AEndpointUrl(requestMeta)` returns null in
|
|
5
|
+
* `builtin-tools.ts`. Without an origin there is no `/_agent-native/a2a`
|
|
6
|
+
* endpoint to submit a durable task to, so `config.askAgent(message)` used
|
|
7
|
+
* to be awaited unbounded, which can hold a hosted MCP request open past a
|
|
8
|
+
* serverless gateway's inactivity timeout. This gives that path the same
|
|
9
|
+
* bounded "return a taskId, keep working in the background" contract as the
|
|
10
|
+
* durable A2A path, without needing a database.
|
|
11
|
+
*
|
|
12
|
+
* Entries are **process-local, not durable** — they live only in this
|
|
13
|
+
* server instance's memory and are lost on restart or if a different
|
|
14
|
+
* instance handles the poll. That is an acceptable trade-off here: this
|
|
15
|
+
* fallback only exists because no app origin was derivable in the first
|
|
16
|
+
* place, so there was never a reachable endpoint another instance could
|
|
17
|
+
* have polled anyway.
|
|
18
|
+
*
|
|
19
|
+
* Eviction is lazy (checked on each map access) instead of timer-based, so
|
|
20
|
+
* this stays serverless-safe — nothing keeps the process alive to sweep.
|
|
21
|
+
*/
|
|
22
|
+
|
|
23
|
+
type AskAppInlineTaskStatus = "working" | "completed" | "failed";
|
|
24
|
+
|
|
25
|
+
interface AskAppInlineTaskEntry {
|
|
26
|
+
status: AskAppInlineTaskStatus;
|
|
27
|
+
response?: string;
|
|
28
|
+
error?: string;
|
|
29
|
+
createdAt: number;
|
|
30
|
+
settledAt?: number;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
export interface AskAppInlineTaskSnapshot {
|
|
34
|
+
taskId: string;
|
|
35
|
+
status: AskAppInlineTaskStatus;
|
|
36
|
+
response?: string;
|
|
37
|
+
error?: string;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
const SETTLED_TASK_TTL_MS = 10 * 60_000;
|
|
41
|
+
const UNSETTLED_TASK_TTL_MS = 30 * 60_000;
|
|
42
|
+
|
|
43
|
+
const inlineTasks = new Map<string, AskAppInlineTaskEntry>();
|
|
44
|
+
|
|
45
|
+
function evictStaleInlineTasks(now: number): void {
|
|
46
|
+
for (const [taskId, entry] of inlineTasks) {
|
|
47
|
+
const ttlMs =
|
|
48
|
+
entry.settledAt != null ? SETTLED_TASK_TTL_MS : UNSETTLED_TASK_TTL_MS;
|
|
49
|
+
const anchor = entry.settledAt ?? entry.createdAt;
|
|
50
|
+
if (now - anchor > ttlMs) inlineTasks.delete(taskId);
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
function toSnapshot(
|
|
55
|
+
taskId: string,
|
|
56
|
+
entry: AskAppInlineTaskEntry,
|
|
57
|
+
): AskAppInlineTaskSnapshot {
|
|
58
|
+
return {
|
|
59
|
+
taskId,
|
|
60
|
+
status: entry.status,
|
|
61
|
+
...(entry.response !== undefined ? { response: entry.response } : {}),
|
|
62
|
+
...(entry.error !== undefined ? { error: entry.error } : {}),
|
|
63
|
+
};
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
/**
|
|
67
|
+
* Start `askAgent(message)` under a fresh process-local taskId and wait up
|
|
68
|
+
* to `maxWaitMs` for it to settle. The map entry is written synchronously
|
|
69
|
+
* before the async work starts, so a poll racing this call can never see a
|
|
70
|
+
* missing taskId. Returns the settled snapshot when it finishes in time, or
|
|
71
|
+
* a `"working"` snapshot once `maxWaitMs` elapses — the caller can hand that
|
|
72
|
+
* taskId back to `getAskAppInlineTask` later to pick up the final result.
|
|
73
|
+
*/
|
|
74
|
+
export async function startAskAppInlineTask(
|
|
75
|
+
askAgent: (message: string) => Promise<string>,
|
|
76
|
+
message: string,
|
|
77
|
+
maxWaitMs: number,
|
|
78
|
+
): Promise<AskAppInlineTaskSnapshot> {
|
|
79
|
+
const now = Date.now();
|
|
80
|
+
evictStaleInlineTasks(now);
|
|
81
|
+
|
|
82
|
+
const taskId = globalThis.crypto.randomUUID();
|
|
83
|
+
const entry: AskAppInlineTaskEntry = { status: "working", createdAt: now };
|
|
84
|
+
inlineTasks.set(taskId, entry);
|
|
85
|
+
|
|
86
|
+
const settled = askAgent(message).then(
|
|
87
|
+
(response) => {
|
|
88
|
+
entry.status = "completed";
|
|
89
|
+
entry.response = response;
|
|
90
|
+
entry.settledAt = Date.now();
|
|
91
|
+
},
|
|
92
|
+
(err) => {
|
|
93
|
+
entry.status = "failed";
|
|
94
|
+
entry.error =
|
|
95
|
+
err instanceof Error
|
|
96
|
+
? err.message
|
|
97
|
+
: String(err ?? "ask_app task failed.");
|
|
98
|
+
entry.settledAt = Date.now();
|
|
99
|
+
},
|
|
100
|
+
);
|
|
101
|
+
|
|
102
|
+
if (maxWaitMs > 0) {
|
|
103
|
+
await Promise.race([
|
|
104
|
+
settled,
|
|
105
|
+
new Promise<void>((resolve) => setTimeout(resolve, maxWaitMs)),
|
|
106
|
+
]);
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
return toSnapshot(taskId, entry);
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
/**
|
|
113
|
+
* Look up a process-local inline task started by `startAskAppInlineTask`.
|
|
114
|
+
* Returns `undefined` when the id is unknown — never started here, already
|
|
115
|
+
* evicted, or (in a multi-instance deployment) started on a different
|
|
116
|
+
* instance. Callers should fall through to the normal A2A HTTP status path
|
|
117
|
+
* in that case.
|
|
118
|
+
*/
|
|
119
|
+
export function getAskAppInlineTask(
|
|
120
|
+
taskId: string,
|
|
121
|
+
): AskAppInlineTaskSnapshot | undefined {
|
|
122
|
+
evictStaleInlineTasks(Date.now());
|
|
123
|
+
const entry = inlineTasks.get(taskId);
|
|
124
|
+
return entry ? toSnapshot(taskId, entry) : undefined;
|
|
125
|
+
}
|
|
@@ -204,6 +204,35 @@ export interface MCPRequestMeta {
|
|
|
204
204
|
inlineMcpApps?: boolean;
|
|
205
205
|
}
|
|
206
206
|
|
|
207
|
+
const ASK_AGENT_DEFAULT_INLINE_WAIT_MS = 20_000;
|
|
208
|
+
const ASK_AGENT_MAX_INLINE_WAIT_MS = 25_000;
|
|
209
|
+
|
|
210
|
+
function boundedAskAgentWaitMs(raw: unknown): number {
|
|
211
|
+
if (raw == null || raw === "") return ASK_AGENT_DEFAULT_INLINE_WAIT_MS;
|
|
212
|
+
const parsed = Number(raw);
|
|
213
|
+
if (!Number.isFinite(parsed)) return ASK_AGENT_DEFAULT_INLINE_WAIT_MS;
|
|
214
|
+
return Math.max(
|
|
215
|
+
0,
|
|
216
|
+
Math.min(ASK_AGENT_MAX_INLINE_WAIT_MS, Math.trunc(parsed)),
|
|
217
|
+
);
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
function isExplicitAsyncAskAgent(raw: unknown): boolean {
|
|
221
|
+
return raw === true || raw === "true" || raw === 1 || raw === "1";
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
function formatAskAgentResult(result: unknown): string {
|
|
225
|
+
if (typeof result === "string") return result;
|
|
226
|
+
if (result && typeof result === "object") {
|
|
227
|
+
const record = result as Record<string, unknown>;
|
|
228
|
+
if (record.status === "completed" && typeof record.response === "string") {
|
|
229
|
+
return record.response;
|
|
230
|
+
}
|
|
231
|
+
}
|
|
232
|
+
const serialized = JSON.stringify(result);
|
|
233
|
+
return serialized === undefined ? String(result) : serialized;
|
|
234
|
+
}
|
|
235
|
+
|
|
207
236
|
/**
|
|
208
237
|
* Deploy-toggleable kill switch for inline MCP App embeds — the `ui://`
|
|
209
238
|
* resource reference hosts like Codex / Cursor / ChatGPT render in a sandboxed
|
|
@@ -1618,7 +1647,9 @@ export async function createMCPServerForRequest(
|
|
|
1618
1647
|
description:
|
|
1619
1648
|
"Send a natural-language message to the app's AI agent and get a response. " +
|
|
1620
1649
|
"Use this for complex, multi-step tasks that require the agent's reasoning " +
|
|
1621
|
-
"and full context about the app."
|
|
1650
|
+
"and full context about the app. On hosted MCP, the server waits briefly " +
|
|
1651
|
+
"for fast completions and returns a taskId plus ask_app_status polling " +
|
|
1652
|
+
"instructions when the agent needs longer.",
|
|
1622
1653
|
inputSchema: {
|
|
1623
1654
|
type: "object" as const,
|
|
1624
1655
|
properties: {
|
|
@@ -1626,6 +1657,16 @@ export async function createMCPServerForRequest(
|
|
|
1626
1657
|
type: "string",
|
|
1627
1658
|
description: "The message to send to the agent",
|
|
1628
1659
|
},
|
|
1660
|
+
async: {
|
|
1661
|
+
type: "boolean",
|
|
1662
|
+
description:
|
|
1663
|
+
"Start a durable task and return immediately with a taskId.",
|
|
1664
|
+
},
|
|
1665
|
+
maxWaitMs: {
|
|
1666
|
+
type: "number",
|
|
1667
|
+
description:
|
|
1668
|
+
"Maximum inline wait in milliseconds. Hosted MCP clamps this to 25000ms.",
|
|
1669
|
+
},
|
|
1629
1670
|
},
|
|
1630
1671
|
required: ["message"],
|
|
1631
1672
|
},
|
|
@@ -1668,8 +1709,29 @@ export async function createMCPServerForRequest(
|
|
|
1668
1709
|
}
|
|
1669
1710
|
const message = args?.message ?? "";
|
|
1670
1711
|
try {
|
|
1671
|
-
|
|
1672
|
-
|
|
1712
|
+
// Keep the legacy meta-tool compatible for local callers, but use
|
|
1713
|
+
// the same durable A2A submission path as ask_app whenever this is
|
|
1714
|
+
// an HTTP/hosted request. A full agent loop must never be held open
|
|
1715
|
+
// for minutes behind one MCP tools/call request. Always route
|
|
1716
|
+
// through ask_app's own run() — even with no request origin, since
|
|
1717
|
+
// it now bounds that case too via its process-local inline-task
|
|
1718
|
+
// fallback (ask-app-inline-tasks.ts) instead of us awaiting
|
|
1719
|
+
// config.askAgent() here unbounded. This is the shared helper: no
|
|
1720
|
+
// second task map to keep in sync.
|
|
1721
|
+
const hostedAskApp = getBuiltinCrossAppTools(
|
|
1722
|
+
config,
|
|
1723
|
+
requestMeta,
|
|
1724
|
+
).ask_app;
|
|
1725
|
+
const result = await hostedAskApp.run({
|
|
1726
|
+
message,
|
|
1727
|
+
async: isExplicitAsyncAskAgent(args?.async),
|
|
1728
|
+
maxWaitMs: isExplicitAsyncAskAgent(args?.async)
|
|
1729
|
+
? 0
|
|
1730
|
+
: boundedAskAgentWaitMs(args?.maxWaitMs),
|
|
1731
|
+
});
|
|
1732
|
+
return {
|
|
1733
|
+
content: [{ type: "text", text: formatAskAgentResult(result) }],
|
|
1734
|
+
};
|
|
1673
1735
|
} catch (err: any) {
|
|
1674
1736
|
return {
|
|
1675
1737
|
content: [{ type: "text", text: `Error: ${err.message}` }],
|
|
@@ -88,14 +88,23 @@ const ASK_APP_TERMINAL_STATES = new Set<string>([
|
|
|
88
88
|
"completed",
|
|
89
89
|
"failed",
|
|
90
90
|
"canceled",
|
|
91
|
+
"input-required",
|
|
91
92
|
]);
|
|
92
93
|
|
|
94
|
+
class AskAppInlineDeadlineError extends Error {
|
|
95
|
+
constructor() {
|
|
96
|
+
super("ask_app inline wait deadline reached");
|
|
97
|
+
this.name = "AskAppInlineDeadlineError";
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
|
|
93
101
|
type AskAppRequestMeta = { origin?: string; basePath?: string };
|
|
94
102
|
|
|
95
103
|
interface AskAppRoute {
|
|
96
104
|
app: string;
|
|
97
105
|
origin: string;
|
|
98
106
|
routedVia: "local" | "a2a";
|
|
107
|
+
requestOrigin?: string;
|
|
99
108
|
note?: string;
|
|
100
109
|
}
|
|
101
110
|
|
|
@@ -106,7 +115,9 @@ interface AskAppTaskResult {
|
|
|
106
115
|
status: string;
|
|
107
116
|
response?: string;
|
|
108
117
|
error?: string;
|
|
118
|
+
inputRequired?: string;
|
|
109
119
|
note?: string;
|
|
120
|
+
pollAfterMs?: number;
|
|
110
121
|
poll?: {
|
|
111
122
|
tool: "ask_app_status";
|
|
112
123
|
arguments: { app: string; taskId: string };
|
|
@@ -236,8 +247,20 @@ function askAppTaskResult(route: AskAppRoute, task: Task): AskAppTaskResult {
|
|
|
236
247
|
};
|
|
237
248
|
}
|
|
238
249
|
|
|
250
|
+
if (status === "input-required") {
|
|
251
|
+
const inputRequired =
|
|
252
|
+
response || "The agent needs additional input before it can continue.";
|
|
253
|
+
return {
|
|
254
|
+
...base,
|
|
255
|
+
response: inputRequired,
|
|
256
|
+
inputRequired,
|
|
257
|
+
message: inputRequired,
|
|
258
|
+
};
|
|
259
|
+
}
|
|
260
|
+
|
|
239
261
|
return {
|
|
240
262
|
...base,
|
|
263
|
+
pollAfterMs: ASK_APP_POLL_INTERVAL_MS,
|
|
241
264
|
poll: {
|
|
242
265
|
tool: "ask_app_status",
|
|
243
266
|
arguments: { app: route.app, taskId: task.id },
|
|
@@ -248,7 +271,57 @@ function askAppTaskResult(route: AskAppRoute, task: Task): AskAppTaskResult {
|
|
|
248
271
|
};
|
|
249
272
|
}
|
|
250
273
|
|
|
251
|
-
|
|
274
|
+
/**
|
|
275
|
+
* Same shape as `askAppTaskResult`, but built from an in-process
|
|
276
|
+
* `ask-app-inline-tasks.ts` snapshot instead of an A2A `Task` — used by the
|
|
277
|
+
* no-origin fallback (no A2A task exists to describe). Kept field-for-field
|
|
278
|
+
* identical so `ask_app` / `ask_app_status` callers can't tell which backing
|
|
279
|
+
* store answered.
|
|
280
|
+
*/
|
|
281
|
+
function askAppInlineTaskResult(
|
|
282
|
+
selfId: string,
|
|
283
|
+
taskId: string,
|
|
284
|
+
inline: {
|
|
285
|
+
status: "working" | "completed" | "failed";
|
|
286
|
+
response?: string;
|
|
287
|
+
error?: string;
|
|
288
|
+
},
|
|
289
|
+
note?: string,
|
|
290
|
+
): AskAppTaskResult {
|
|
291
|
+
const base = {
|
|
292
|
+
app: selfId,
|
|
293
|
+
routedVia: "local" as const,
|
|
294
|
+
taskId,
|
|
295
|
+
status: inline.status,
|
|
296
|
+
...(note ? { note } : {}),
|
|
297
|
+
};
|
|
298
|
+
|
|
299
|
+
if (inline.status === "completed") {
|
|
300
|
+
return { ...base, response: inline.response || "(no response)" };
|
|
301
|
+
}
|
|
302
|
+
|
|
303
|
+
if (inline.status === "failed") {
|
|
304
|
+
return { ...base, error: inline.error || "ask_app task failed." };
|
|
305
|
+
}
|
|
306
|
+
|
|
307
|
+
return {
|
|
308
|
+
...base,
|
|
309
|
+
pollAfterMs: ASK_APP_POLL_INTERVAL_MS,
|
|
310
|
+
poll: {
|
|
311
|
+
tool: "ask_app_status",
|
|
312
|
+
arguments: { app: selfId, taskId },
|
|
313
|
+
},
|
|
314
|
+
message:
|
|
315
|
+
`ask_app is still ${inline.status}. Call ask_app_status with ` +
|
|
316
|
+
`taskId "${taskId}" to retrieve the final response.`,
|
|
317
|
+
};
|
|
318
|
+
}
|
|
319
|
+
|
|
320
|
+
async function createA2AClientForAskApp(
|
|
321
|
+
origin: string,
|
|
322
|
+
requestOrigin?: string,
|
|
323
|
+
deadline?: number,
|
|
324
|
+
): Promise<{
|
|
252
325
|
client: import("../a2a/client.js").A2AClient;
|
|
253
326
|
metadata: Record<string, unknown>;
|
|
254
327
|
}> {
|
|
@@ -258,9 +331,14 @@ async function createA2AClientForAskApp(origin: string): Promise<{
|
|
|
258
331
|
const metadata: Record<string, unknown> = {};
|
|
259
332
|
if (auth.userEmail) metadata.userEmail = auth.userEmail;
|
|
260
333
|
if (auth.orgDomain) metadata.orgDomain = auth.orgDomain;
|
|
334
|
+
if (requestOrigin) metadata.requestOrigin = requestOrigin;
|
|
335
|
+
const remainingMs = deadline == null ? null : deadline - Date.now();
|
|
261
336
|
return {
|
|
262
337
|
client: new A2AClient(origin, auth.apiKey, {
|
|
263
|
-
requestTimeoutMs:
|
|
338
|
+
requestTimeoutMs:
|
|
339
|
+
remainingMs == null
|
|
340
|
+
? ASK_APP_A2A_REQUEST_TIMEOUT_MS
|
|
341
|
+
: Math.max(1, Math.min(ASK_APP_A2A_REQUEST_TIMEOUT_MS, remainingMs)),
|
|
264
342
|
...(auth.apiKeyFallbacks
|
|
265
343
|
? { fallbackApiKeys: auth.apiKeyFallbacks }
|
|
266
344
|
: {}),
|
|
@@ -269,13 +347,35 @@ async function createA2AClientForAskApp(origin: string): Promise<{
|
|
|
269
347
|
};
|
|
270
348
|
}
|
|
271
349
|
|
|
350
|
+
async function runBeforeAskAppDeadline<T>(
|
|
351
|
+
operation: () => Promise<T>,
|
|
352
|
+
deadline: number,
|
|
353
|
+
): Promise<T> {
|
|
354
|
+
const remainingMs = deadline - Date.now();
|
|
355
|
+
if (remainingMs <= 0) throw new AskAppInlineDeadlineError();
|
|
356
|
+
|
|
357
|
+
let timeout: ReturnType<typeof setTimeout> | undefined;
|
|
358
|
+
try {
|
|
359
|
+
return await Promise.race([
|
|
360
|
+
operation(),
|
|
361
|
+
new Promise<T>((_resolve, reject) => {
|
|
362
|
+
timeout = setTimeout(
|
|
363
|
+
() => reject(new AskAppInlineDeadlineError()),
|
|
364
|
+
remainingMs,
|
|
365
|
+
);
|
|
366
|
+
}),
|
|
367
|
+
]);
|
|
368
|
+
} finally {
|
|
369
|
+
if (timeout) clearTimeout(timeout);
|
|
370
|
+
}
|
|
371
|
+
}
|
|
372
|
+
|
|
272
373
|
async function waitForA2ATask(
|
|
273
374
|
client: import("../a2a/client.js").A2AClient,
|
|
274
375
|
initialTask: Task,
|
|
275
|
-
|
|
376
|
+
deadline: number | undefined,
|
|
276
377
|
): Promise<Task> {
|
|
277
|
-
if (
|
|
278
|
-
const deadline = Date.now() + maxWaitMs;
|
|
378
|
+
if (deadline == null || isTerminalTask(initialTask)) return initialTask;
|
|
279
379
|
let current = initialTask;
|
|
280
380
|
|
|
281
381
|
while (!isTerminalTask(current)) {
|
|
@@ -284,13 +384,16 @@ async function waitForA2ATask(
|
|
|
284
384
|
await new Promise((resolve) =>
|
|
285
385
|
setTimeout(resolve, Math.min(ASK_APP_POLL_INTERVAL_MS, remaining)),
|
|
286
386
|
);
|
|
387
|
+
if (Date.now() >= deadline) return current;
|
|
287
388
|
try {
|
|
288
|
-
current = await
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
389
|
+
current = await runBeforeAskAppDeadline(
|
|
390
|
+
() => client.getTask(initialTask.id),
|
|
391
|
+
deadline,
|
|
392
|
+
);
|
|
393
|
+
} catch (err) {
|
|
394
|
+
if (err instanceof AskAppInlineDeadlineError) return current;
|
|
395
|
+
if (!isTransientAskAppStatusError(err)) throw err;
|
|
292
396
|
if (Date.now() >= deadline) return current;
|
|
293
|
-
continue;
|
|
294
397
|
}
|
|
295
398
|
}
|
|
296
399
|
|
|
@@ -302,7 +405,12 @@ async function submitAskAppA2ATask(
|
|
|
302
405
|
message: string,
|
|
303
406
|
maxWaitMs: number,
|
|
304
407
|
): Promise<AskAppTaskResult> {
|
|
305
|
-
const
|
|
408
|
+
const deadline = maxWaitMs > 0 ? Date.now() + maxWaitMs : undefined;
|
|
409
|
+
const { client, metadata } = await createA2AClientForAskApp(
|
|
410
|
+
route.origin,
|
|
411
|
+
route.requestOrigin,
|
|
412
|
+
deadline,
|
|
413
|
+
);
|
|
306
414
|
const task = await client.send(
|
|
307
415
|
{
|
|
308
416
|
role: "user",
|
|
@@ -313,7 +421,7 @@ async function submitAskAppA2ATask(
|
|
|
313
421
|
metadata,
|
|
314
422
|
},
|
|
315
423
|
);
|
|
316
|
-
const finalOrRunning = await waitForA2ATask(client, task,
|
|
424
|
+
const finalOrRunning = await waitForA2ATask(client, task, deadline);
|
|
317
425
|
return askAppTaskResult(route, finalOrRunning);
|
|
318
426
|
}
|
|
319
427
|
|
|
@@ -778,13 +886,22 @@ async function routeAskOverA2A(
|
|
|
778
886
|
origin: string,
|
|
779
887
|
id: string,
|
|
780
888
|
message: string,
|
|
781
|
-
options?: {
|
|
889
|
+
options?: {
|
|
890
|
+
durable?: boolean;
|
|
891
|
+
maxWaitMs?: number;
|
|
892
|
+
requestOrigin?: string;
|
|
893
|
+
},
|
|
782
894
|
): Promise<
|
|
783
895
|
{ app: string; routedVia: "a2a"; response: string } | AskAppTaskResult
|
|
784
896
|
> {
|
|
785
897
|
if (options?.durable) {
|
|
786
898
|
return submitAskAppA2ATask(
|
|
787
|
-
{
|
|
899
|
+
{
|
|
900
|
+
app: id,
|
|
901
|
+
origin: agentNativeA2AEndpoint(origin),
|
|
902
|
+
routedVia: "a2a",
|
|
903
|
+
requestOrigin: options.requestOrigin ?? origin,
|
|
904
|
+
},
|
|
788
905
|
message,
|
|
789
906
|
options.maxWaitMs ?? ASK_APP_DEFAULT_INLINE_WAIT_MS,
|
|
790
907
|
);
|
|
@@ -801,6 +918,7 @@ async function routeAskOverA2A(
|
|
|
801
918
|
userEmail: auth.userEmail,
|
|
802
919
|
orgDomain: auth.orgDomain,
|
|
803
920
|
orgSecret: auth.orgSecret,
|
|
921
|
+
requestOrigin: options?.requestOrigin,
|
|
804
922
|
// Bound the wait — cross-app A2A polls async by default.
|
|
805
923
|
timeoutMs: 5 * 60_000,
|
|
806
924
|
});
|
|
@@ -822,7 +940,12 @@ async function resolveAskAppStatusRoute(
|
|
|
822
940
|
"ask_app_status requires a running app origin for local tasks.",
|
|
823
941
|
);
|
|
824
942
|
}
|
|
825
|
-
return {
|
|
943
|
+
return {
|
|
944
|
+
app: selfId,
|
|
945
|
+
origin: selfEndpointUrl,
|
|
946
|
+
routedVia: "local",
|
|
947
|
+
requestOrigin: requestMeta?.origin,
|
|
948
|
+
};
|
|
826
949
|
}
|
|
827
950
|
|
|
828
951
|
const targetApp = await resolveTargetAppOrigin(config, requestedApp);
|
|
@@ -831,6 +954,7 @@ async function resolveAskAppStatusRoute(
|
|
|
831
954
|
app: targetApp.id,
|
|
832
955
|
origin: agentNativeA2AEndpoint(targetApp.origin),
|
|
833
956
|
routedVia: "a2a",
|
|
957
|
+
requestOrigin: targetApp.origin,
|
|
834
958
|
};
|
|
835
959
|
}
|
|
836
960
|
|
|
@@ -841,6 +965,7 @@ async function resolveAskAppStatusRoute(
|
|
|
841
965
|
app: dirMatch.id,
|
|
842
966
|
origin: agentNativeA2AEndpoint(dirMatch.a2aUrl),
|
|
843
967
|
routedVia: "a2a",
|
|
968
|
+
requestOrigin: dirMatch.url,
|
|
844
969
|
};
|
|
845
970
|
}
|
|
846
971
|
|
|
@@ -914,6 +1039,7 @@ function askAppTool(
|
|
|
914
1039
|
{
|
|
915
1040
|
durable: useDurableA2A,
|
|
916
1041
|
maxWaitMs,
|
|
1042
|
+
requestOrigin: targetApp.origin,
|
|
917
1043
|
},
|
|
918
1044
|
);
|
|
919
1045
|
} catch (err: any) {
|
|
@@ -947,6 +1073,7 @@ function askAppTool(
|
|
|
947
1073
|
{
|
|
948
1074
|
durable: useDurableA2A,
|
|
949
1075
|
maxWaitMs,
|
|
1076
|
+
requestOrigin: dirMatch.url,
|
|
950
1077
|
},
|
|
951
1078
|
);
|
|
952
1079
|
} catch (err: any) {
|
|
@@ -988,6 +1115,7 @@ function askAppTool(
|
|
|
988
1115
|
app: selfId,
|
|
989
1116
|
origin: localA2AEndpointUrl,
|
|
990
1117
|
routedVia: "local",
|
|
1118
|
+
requestOrigin: requestMeta?.origin,
|
|
991
1119
|
...(note ? { note } : {}),
|
|
992
1120
|
},
|
|
993
1121
|
message,
|
|
@@ -995,13 +1123,35 @@ function askAppTool(
|
|
|
995
1123
|
);
|
|
996
1124
|
}
|
|
997
1125
|
|
|
998
|
-
|
|
999
|
-
|
|
1000
|
-
|
|
1001
|
-
|
|
1002
|
-
|
|
1003
|
-
|
|
1004
|
-
|
|
1126
|
+
// No derivable app origin at all (e.g. stdio / no request context) —
|
|
1127
|
+
// there is no `/_agent-native/a2a` endpoint to submit a durable task
|
|
1128
|
+
// to either. Bound the wait against a process-local task map instead
|
|
1129
|
+
// of awaiting config.askAgent() unbounded, so a slow agent run can't
|
|
1130
|
+
// hold this MCP call open indefinitely. Settling in time keeps the
|
|
1131
|
+
// original response shape; timing out returns the same still-working
|
|
1132
|
+
// poll payload the A2A path would, using the same taskId contract
|
|
1133
|
+
// (see ask-app-inline-tasks.ts).
|
|
1134
|
+
const { startAskAppInlineTask } =
|
|
1135
|
+
await import("./ask-app-inline-tasks.js");
|
|
1136
|
+
const inline = await startAskAppInlineTask(
|
|
1137
|
+
config.askAgent,
|
|
1138
|
+
message,
|
|
1139
|
+
maxWaitMs,
|
|
1140
|
+
);
|
|
1141
|
+
if (inline.status === "completed") {
|
|
1142
|
+
return {
|
|
1143
|
+
app: selfId,
|
|
1144
|
+
routedVia: "local",
|
|
1145
|
+
...(note ? { note } : {}),
|
|
1146
|
+
response: inline.response || "(no response)",
|
|
1147
|
+
};
|
|
1148
|
+
}
|
|
1149
|
+
if (inline.status === "failed") {
|
|
1150
|
+
// Settled with an error inside the bounded wait — surface it the
|
|
1151
|
+
// same way the old unbounded `await config.askAgent(message)` did.
|
|
1152
|
+
throw new Error(inline.error || "ask_app task failed.");
|
|
1153
|
+
}
|
|
1154
|
+
return askAppInlineTaskResult(selfId, inline.taskId, inline, note);
|
|
1005
1155
|
},
|
|
1006
1156
|
};
|
|
1007
1157
|
}
|
|
@@ -1031,6 +1181,20 @@ function askAppStatusTool(
|
|
|
1031
1181
|
run: async (args: Record<string, any>) => {
|
|
1032
1182
|
const taskId = String(args.taskId ?? "").trim();
|
|
1033
1183
|
if (!taskId) throw new Error("ask_app_status requires 'taskId'.");
|
|
1184
|
+
|
|
1185
|
+
// The no-derivable-origin ask_app fallback tracks its tasks in a
|
|
1186
|
+
// process-local map, not the durable A2A store. Check it FIRST —
|
|
1187
|
+
// before any origin requirement — so a taskId minted by that fallback
|
|
1188
|
+
// never has to satisfy `resolveAskAppStatusRoute`'s "running app
|
|
1189
|
+
// origin" check. Falls through to the normal A2A route when the id
|
|
1190
|
+
// isn't one of these (never started here, evicted, or an ordinary A2A
|
|
1191
|
+
// task id).
|
|
1192
|
+
const { getAskAppInlineTask } = await import("./ask-app-inline-tasks.js");
|
|
1193
|
+
const inline = getAskAppInlineTask(taskId);
|
|
1194
|
+
if (inline) {
|
|
1195
|
+
return askAppInlineTaskResult(currentAppId(config), taskId, inline);
|
|
1196
|
+
}
|
|
1197
|
+
|
|
1034
1198
|
const requestedApp = String(args.app ?? "").trim();
|
|
1035
1199
|
const route = await resolveAskAppStatusRoute(
|
|
1036
1200
|
config,
|