@agent-native/core 0.121.2 → 0.122.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/README.md +4 -12
- package/corpus/README.md +2 -2
- package/corpus/core/CHANGELOG.md +148 -0
- package/corpus/core/docs/content/actions.mdx +2 -2
- package/corpus/core/docs/content/agent-surfaces.mdx +1 -1
- package/corpus/core/docs/content/authentication.mdx +2 -0
- package/corpus/core/docs/content/deployment.mdx +36 -0
- package/corpus/core/docs/content/http-api.mdx +266 -0
- package/corpus/core/docs/content/syncing-template-changes.mdx +159 -0
- package/corpus/core/package.json +2 -1
- package/corpus/core/src/a2a/activity.ts +38 -27
- package/corpus/core/src/a2a/client.ts +57 -4
- package/corpus/core/src/agent/engine/builder-engine.ts +35 -4
- package/corpus/core/src/agent/run-manager.ts +20 -1
- package/corpus/core/src/agent/run-store.ts +4 -1
- package/corpus/core/src/agent/types.ts +28 -8
- package/corpus/core/src/chat-threads/store.ts +45 -0
- package/corpus/core/src/checkpoints/index.ts +2 -0
- package/corpus/core/src/checkpoints/route-match.ts +13 -0
- package/corpus/core/src/cli/create.ts +105 -17
- package/corpus/core/src/cli/index.ts +20 -0
- package/corpus/core/src/cli/template-baseline.ts +410 -0
- package/corpus/core/src/cli/template-sync.ts +1004 -0
- package/corpus/core/src/cli/templates-meta.ts +1 -0
- package/corpus/core/src/client/AssistantChat.tsx +38 -12
- package/corpus/core/src/client/NewWorkspaceAppFlow.tsx +75 -10
- package/corpus/core/src/client/chat/message-components.tsx +127 -66
- package/corpus/core/src/client/chat/tool-call-display.tsx +29 -5
- package/corpus/core/src/client/error-format.ts +18 -0
- package/corpus/core/src/client/org/OrgSwitcher.tsx +30 -8
- package/corpus/core/src/client/org/TeamPage.tsx +7 -6
- package/corpus/core/src/client/settings/SettingsPanel.tsx +9 -9
- package/corpus/core/src/client/settings/SettingsTabsPage.tsx +12 -2
- package/corpus/core/src/client/sse-event-processor.ts +3 -0
- package/corpus/core/src/data-widgets/index.ts +41 -0
- package/corpus/core/src/deploy/build.ts +11 -9
- package/corpus/core/src/extensions/url-safety.ts +67 -4
- package/corpus/core/src/integrations/webhook-handler.ts +63 -9
- package/corpus/core/src/org/auto-join-domain.ts +4 -3
- package/corpus/core/src/org/context.ts +108 -39
- package/corpus/core/src/org/index.ts +5 -0
- package/corpus/core/src/org/service-identity.ts +60 -0
- package/corpus/core/src/provider-api/index.ts +22 -1
- package/corpus/core/src/scripts/docs/search.ts +12 -1
- package/corpus/core/src/server/agent-chat/context-tools.ts +9 -4
- package/corpus/core/src/server/agent-chat/framework-prompts.ts +38 -66
- package/corpus/core/src/server/agent-chat-plugin.ts +17 -10
- package/corpus/core/src/server/agents-bundle.ts +84 -5
- package/corpus/core/src/server/auth.ts +4 -3
- package/corpus/core/src/server/builder-browser.ts +47 -19
- package/corpus/core/src/server/core-routes-plugin.ts +2 -2
- package/corpus/core/src/server/credential-provider.ts +209 -68
- package/corpus/core/src/server/index.ts +3 -0
- package/corpus/core/src/server/prompts/framework-core-compact.ts +6 -13
- package/corpus/core/src/server/prompts/framework-core.ts +9 -21
- package/corpus/core/src/server/prompts/index.ts +0 -1
- package/corpus/core/src/server/prompts/shared-rules.ts +19 -11
- package/corpus/core/src/server/ssr-handler.ts +13 -2
- package/corpus/core/src/settings/user-settings.ts +13 -1
- package/corpus/core/src/shared/cache-control.ts +141 -0
- package/corpus/core/src/templates/chat/.agents/skills/upgrade-agent-native/SKILL.md +24 -2
- package/corpus/core/src/templates/chat/_gitignore +1 -0
- package/corpus/core/src/templates/chat/app/components/layout/Sidebar.tsx +0 -7
- package/corpus/core/src/templates/default/.agents/skills/upgrade-agent-native/SKILL.md +24 -2
- package/corpus/core/src/templates/default/app/root.tsx +1 -1
- package/corpus/core/src/templates/default/public/manifest.json +2 -2
- package/corpus/core/src/templates/headless/.agents/skills/upgrade-agent-native/SKILL.md +24 -2
- package/corpus/core/src/templates/workspace-core/.agents/skills/performance/SKILL.md +19 -0
- package/corpus/core/src/templates/workspace-core/.agents/skills/upgrade-agent-native/SKILL.md +24 -2
- package/corpus/core/src/templates/workspace-core/.agents/skills/visual-answer/SKILL.md +1 -0
- package/corpus/core/src/vite/agents-bundle-plugin.ts +7 -6
- package/corpus/core/src/vite/client.ts +69 -3
- package/corpus/templates/analytics/.agents/skills/adhoc-analysis/SKILL.md +4 -5
- package/corpus/templates/analytics/.agents/skills/admin-surfaces/SKILL.md +55 -0
- package/corpus/templates/analytics/.agents/skills/dashboard-management/SKILL.md +10 -0
- package/corpus/templates/analytics/.agents/skills/dashboard-management/references/template-catalog-and-demo.md +62 -0
- package/corpus/templates/analytics/.agents/skills/dashboard-ops/SKILL.md +85 -0
- package/corpus/templates/analytics/.agents/skills/data-querying/SKILL.md +27 -2
- package/corpus/templates/analytics/.agents/skills/data-querying/references/inline-chart-embeds.md +139 -0
- package/corpus/templates/analytics/.agents/skills/monitoring/SKILL.md +77 -0
- package/corpus/templates/analytics/.agents/skills/upgrade-agent-native/SKILL.md +24 -2
- package/corpus/templates/analytics/AGENTS.md +91 -563
- package/corpus/templates/analytics/_gitignore +1 -0
- package/corpus/templates/analytics/actions/bigquery.ts +12 -4
- package/corpus/templates/analytics/actions/generate-chart.ts +5 -5
- package/corpus/templates/analytics/app/components/dashboard/SqlChart.tsx +30 -1
- package/corpus/templates/analytics/app/components/layout/Sidebar.tsx +1 -23
- package/corpus/templates/analytics/app/pages/adhoc/sql-dashboard/DashboardFilterBar.tsx +3 -0
- package/corpus/templates/analytics/app/pages/adhoc/sql-dashboard/SqlChartCard.tsx +1 -1
- package/corpus/templates/analytics/app/pages/adhoc/sql-dashboard/index.tsx +1 -0
- package/corpus/templates/analytics/app/routes/_index.tsx +1 -1
- package/corpus/templates/analytics/changelog/2026-07-24-analytics-finds-saved-dashboards-and-queries-far-more-reliab.md +6 -0
- package/corpus/templates/analytics/changelog/2026-07-24-notion-access-errors-now-explain-that-a-page-needs-sharing-w.md +6 -0
- package/corpus/templates/analytics/changelog/2026-07-25-app-branding-now-uses-the-product-name-without-the-agent-nat.md +6 -0
- package/corpus/templates/analytics/changelog/2026-07-25-settings-navigation-now-keeps-manage-agent-as-a-dedicated-li.md +6 -0
- package/corpus/templates/analytics/package.json +1 -1
- package/corpus/templates/analytics/public/manifest.json +1 -1
- package/corpus/templates/analytics/server/lib/agent-chat-plan-mode.ts +7 -0
- package/corpus/templates/analytics/server/lib/analytics-query-catalog.ts +191 -30
- package/corpus/templates/analytics/server/lib/bigquery.ts +11 -1
- package/corpus/templates/analytics/server/lib/notion.ts +15 -4
- package/corpus/templates/analytics/server/plugins/agent-chat.ts +10 -0
- package/corpus/templates/analytics/server/plugins/auth.ts +1 -1
- package/corpus/templates/assets/.agents/skills/upgrade-agent-native/SKILL.md +24 -2
- package/corpus/templates/assets/app/components/layout/Sidebar.tsx +0 -2
- package/corpus/templates/assets/app/routes/_index.tsx +1 -1
- package/corpus/templates/assets/changelog/2026-07-25-app-branding-now-uses-the-product-name-without-the-agent-nat.md +6 -0
- package/corpus/templates/assets/changelog/2026-07-25-settings-navigation-now-keeps-manage-agent-as-a-dedicated-li.md +6 -0
- package/corpus/templates/assets/server/plugins/auth.ts +1 -1
- package/corpus/templates/brain/.agents/skills/upgrade-agent-native/SKILL.md +24 -2
- package/corpus/templates/brain/_gitignore +1 -0
- package/corpus/templates/brain/app/lib/brain.ts +0 -7
- package/corpus/templates/brain/app/routes/_index.tsx +1 -2
- package/corpus/templates/brain/changelog/2026-07-25-app-branding-now-uses-the-product-name-without-the-agent-nat.md +6 -0
- package/corpus/templates/brain/changelog/2026-07-25-settings-navigation-now-keeps-manage-agent-as-a-dedicated-li.md +6 -0
- package/corpus/templates/brain/package.json +1 -1
- package/corpus/templates/brain/public/manifest.json +1 -1
- package/corpus/templates/brain/server/plugins/auth.ts +1 -1
- package/corpus/templates/calendar/.agents/skills/upgrade-agent-native/SKILL.md +24 -2
- package/corpus/templates/calendar/_gitignore +1 -0
- package/corpus/templates/calendar/app/components/layout/Sidebar.tsx +0 -6
- package/corpus/templates/calendar/app/routes/_app._index.tsx +1 -1
- package/corpus/templates/calendar/changelog/2026-07-25-app-branding-now-uses-the-product-name-without-the-agent-nat.md +6 -0
- package/corpus/templates/calendar/changelog/2026-07-25-settings-navigation-now-keeps-manage-agent-as-a-dedicated-li.md +6 -0
- package/corpus/templates/calendar/package.json +1 -1
- package/corpus/templates/calendar/public/manifest.json +1 -1
- package/corpus/templates/calendar/server/plugins/auth.ts +1 -1
- package/corpus/templates/chat/.agents/skills/upgrade-agent-native/SKILL.md +24 -2
- package/corpus/templates/chat/_gitignore +1 -0
- package/corpus/templates/chat/app/components/layout/Sidebar.tsx +0 -7
- package/corpus/templates/chat/changelog/2026-07-25-settings-navigation-now-keeps-manage-agent-as-a-dedicated-li.md +6 -0
- package/corpus/templates/clips/.agents/skills/upgrade-agent-native/SKILL.md +24 -2
- package/corpus/templates/clips/.agents/skills/video-sharing/SKILL.md +34 -0
- package/corpus/templates/clips/AGENTS.md +5 -4
- package/corpus/templates/clips/_gitignore +1 -0
- package/corpus/templates/clips/actions/cleanup-transcript.ts +5 -0
- package/corpus/templates/clips/actions/get-recording-insights.ts +44 -8
- package/corpus/templates/clips/actions/get-recording-player-data.ts +39 -70
- package/corpus/templates/clips/actions/import-loom-recording.ts +53 -98
- package/corpus/templates/clips/actions/lib/loom-import-job.ts +260 -0
- package/corpus/templates/clips/actions/list-clip-views.ts +2 -4
- package/corpus/templates/clips/actions/list-recordings.ts +69 -19
- package/corpus/templates/clips/actions/list-viewers.ts +5 -2
- package/corpus/templates/clips/actions/regenerate-summary.ts +5 -1
- package/corpus/templates/clips/actions/request-transcript.ts +28 -1
- package/corpus/templates/clips/app/components/editor/stitch-manager.tsx +21 -1
- package/corpus/templates/clips/app/components/library/library-layout.tsx +0 -7
- package/corpus/templates/clips/app/components/meetings/quick-ask-sidebar.tsx +14 -1
- package/corpus/templates/clips/app/components/player/insights-panel.tsx +8 -20
- package/corpus/templates/clips/app/components/player/recording-views-badge.tsx +335 -0
- package/corpus/templates/clips/app/components/player/video-player.tsx +13 -8
- package/corpus/templates/clips/app/components/sharing/share-ui.tsx +2 -1
- package/corpus/templates/clips/app/i18n/en-US.ts +13 -2
- package/corpus/templates/clips/app/lib/capture-permissions.ts +110 -0
- package/corpus/templates/clips/app/lib/recording-link.ts +32 -0
- package/corpus/templates/clips/app/routes/_app.library._index.tsx +1 -1
- package/corpus/templates/clips/app/routes/_app.meetings.$meetingId.tsx +27 -0
- package/corpus/templates/clips/app/routes/_index.tsx +1 -1
- package/corpus/templates/clips/app/routes/r.$recordingId.tsx +52 -15
- package/corpus/templates/clips/app/routes/record.tsx +82 -31
- package/corpus/templates/clips/app/routes/share.$shareId.tsx +42 -31
- package/corpus/templates/clips/changelog/2026-07-24-clip-pages-now-show-a-view-count-with-viewer-avatars-next-to.md +6 -0
- package/corpus/templates/clips/changelog/2026-07-24-clip-summaries-read-like-a-description-you-d-write-yourself-.md +6 -0
- package/corpus/templates/clips/changelog/2026-07-24-clip-view-counts-now-separate-human-views-from-agent-views-s.md +6 -0
- package/corpus/templates/clips/changelog/2026-07-24-clips-actions-can-now-be-called-by-org-service-tokens-so-ext.md +6 -0
- package/corpus/templates/clips/changelog/2026-07-24-clips-no-longer-briefly-shows-a-dock-icon-while-launching.md +6 -0
- package/corpus/templates/clips/changelog/2026-07-24-fixed-owner-and-editor-share-links-redirecting-to-the-record.md +6 -0
- package/corpus/templates/clips/changelog/2026-07-24-meeting-and-note-recordings-now-start-as-a-compact-pill-on-t.md +6 -0
- package/corpus/templates/clips/changelog/2026-07-24-new-clips-now-copy-a-shareable-link-instead-of-the-owner-onl.md +6 -0
- package/corpus/templates/clips/changelog/2026-07-24-opening-a-share-link-as-the-clip-s-owner-now-goes-straight-t.md +6 -0
- package/corpus/templates/clips/changelog/2026-07-24-permissions-and-rewind-controls-now-use-compact-consistent-h.md +6 -0
- package/corpus/templates/clips/changelog/2026-07-24-quitting-the-desktop-app-no-longer-shows-a-false-macos-crash.md +6 -0
- package/corpus/templates/clips/changelog/2026-07-24-screen-recording-permission-errors-now-name-the-exact-app-to.md +6 -0
- package/corpus/templates/clips/changelog/2026-07-24-the-desktop-app-now-copies-a-new-clip-s-share-link-to-your-c.md +6 -0
- package/corpus/templates/clips/changelog/2026-07-24-the-recording-toolbar-now-stays-above-other-apps-including-o.md +6 -0
- package/corpus/templates/clips/changelog/2026-07-24-transcript-captions-now-use-real-speech-timings-instead-of-a.md +6 -0
- package/corpus/templates/clips/changelog/2026-07-24-video-playback-no-longer-stutters-and-replays-the-last-momen.md +6 -0
- package/corpus/templates/clips/changelog/2026-07-25-app-branding-now-uses-the-product-name-without-the-agent-nat.md +6 -0
- package/corpus/templates/clips/changelog/2026-07-25-settings-navigation-now-keeps-manage-agent-as-a-dedicated-li.md +6 -0
- package/corpus/templates/clips/chrome-extension/src/background.ts +17 -1
- package/corpus/templates/clips/desktop/package.json +2 -0
- package/corpus/templates/clips/desktop/src/app.tsx +89 -0
- package/corpus/templates/clips/desktop/src/hooks/useMeetingTranscription.ts +9 -3
- package/corpus/templates/clips/desktop/src/lib/audio-meter.ts +51 -0
- package/corpus/templates/clips/desktop/src/lib/native-notification.ts +44 -0
- package/corpus/templates/clips/desktop/src/lib/recording-link.ts +67 -0
- package/corpus/templates/clips/desktop/src/overlays/live-audio-bars.tsx +35 -35
- package/corpus/templates/clips/desktop/src/overlays/live-transcript.tsx +3 -2
- package/corpus/templates/clips/desktop/src/overlays/recording-pill.tsx +47 -46
- package/corpus/templates/clips/desktop/src/styles.css +127 -78
- package/corpus/templates/clips/desktop/src-tauri/Cargo.toml +7 -0
- package/corpus/templates/clips/desktop/src-tauri/Info.plist +6 -0
- package/corpus/templates/clips/desktop/src-tauri/capabilities/default.json +1 -0
- package/corpus/templates/clips/desktop/src-tauri/src/clips/mod.rs +7 -3
- package/corpus/templates/clips/desktop/src-tauri/src/lib.rs +4 -1
- package/corpus/templates/clips/desktop/src-tauri/src/main.rs +8 -0
- package/corpus/templates/clips/desktop/src-tauri/src/recording_indicator.rs +21 -10
- package/corpus/templates/clips/desktop/src-tauri/src/util.rs +40 -0
- package/corpus/templates/clips/server/db/schema.ts +27 -0
- package/corpus/templates/clips/server/lib/agent-views.ts +145 -0
- package/corpus/templates/clips/server/lib/post-finalize-dispatch.ts +2 -1
- package/corpus/templates/clips/server/lib/public-agent-context.ts +7 -0
- package/corpus/templates/clips/server/lib/recording-share-grant.ts +79 -0
- package/corpus/templates/clips/server/lib/recordings.ts +51 -3
- package/corpus/templates/clips/server/plugins/auth.ts +1 -1
- package/corpus/templates/clips/server/plugins/db.ts +31 -0
- package/corpus/templates/clips/server/routes/api/_agent-native-background/post-finalize-worker.post.ts +56 -3
- package/corpus/templates/clips/server/routes/api/public-recording.get.ts +49 -17
- package/corpus/templates/clips/shared/recording-link.ts +43 -0
- package/corpus/templates/clips/shared/share-attribution.ts +4 -0
- package/corpus/templates/clips/shared/share-dashboard-redirect.ts +42 -0
- package/corpus/templates/clips/shared/view-analytics.ts +26 -0
- package/corpus/templates/content/.agents/skills/content/SKILL.md +5 -0
- package/corpus/templates/content/.agents/skills/content/references/local-file-mode.md +135 -0
- package/corpus/templates/content/.agents/skills/document-editing/SKILL.md +12 -0
- package/corpus/templates/content/.agents/skills/document-editing/references/databases.md +238 -0
- package/corpus/templates/content/.agents/skills/document-editing/references/document-behavior.md +91 -0
- package/corpus/templates/content/.agents/skills/upgrade-agent-native/SKILL.md +24 -2
- package/corpus/templates/content/AGENTS.md +62 -583
- package/corpus/templates/content/_gitignore +1 -0
- package/corpus/templates/content/app/components/sidebar/DocumentSidebar.tsx +1 -39
- package/corpus/templates/content/app/routes/_app._index.tsx +1 -2
- package/corpus/templates/content/changelog/2026-07-25-app-branding-now-uses-the-product-name-without-the-agent-nat.md +6 -0
- package/corpus/templates/content/changelog/2026-07-25-settings-navigation-now-keeps-manage-agent-as-a-dedicated-li.md +6 -0
- package/corpus/templates/content/package.json +1 -1
- package/corpus/templates/content/public/manifest.json +1 -1
- package/corpus/templates/content/server/plugins/auth.ts +1 -1
- package/corpus/templates/design/.agents/skills/creative-context/SKILL.md +11 -0
- package/corpus/templates/design/.agents/skills/design-generation/SKILL.md +50 -8
- package/corpus/templates/design/.agents/skills/design-generation/references/code-layers.md +81 -0
- package/corpus/templates/design/.agents/skills/design-generation/references/code-workspace.md +42 -0
- package/corpus/templates/design/.agents/skills/design-generation/references/editor-extensions.md +34 -0
- package/corpus/templates/design/.agents/skills/responsive-breakpoints/SKILL.md +4 -1
- package/corpus/templates/design/.agents/skills/upgrade-agent-native/SKILL.md +24 -2
- package/corpus/templates/design/.agents/skills/visual-edit/SKILL.md +17 -0
- package/corpus/templates/design/.generated/bridge/editor-chrome.generated.ts +8196 -0
- package/corpus/templates/design/.generated/bridge/embedded-wheel.generated.ts +265 -0
- package/corpus/templates/design/.generated/bridge/hit-test.generated.ts +642 -0
- package/corpus/templates/design/.generated/bridge/motion-preview.generated.ts +571 -0
- package/corpus/templates/design/.generated/bridge/nav.generated.ts +91 -0
- package/corpus/templates/design/.generated/bridge/sample.generated.ts +23 -0
- package/corpus/templates/design/.generated/bridge/shader-fill-preview.generated.ts +263 -0
- package/corpus/templates/design/.generated/bridge/shader-runtime.generated.ts +518 -0
- package/corpus/templates/design/.generated/bridge/tweak.generated.ts +20 -0
- package/corpus/templates/design/.generated/bridge/zoom.generated.ts +32 -0
- package/corpus/templates/design/AGENTS.md +88 -503
- package/corpus/templates/design/_gitignore +1 -0
- package/corpus/templates/design/app/components/layout/Sidebar.tsx +0 -2
- package/corpus/templates/design/app/routes/_index.tsx +1 -1
- package/corpus/templates/design/changelog/2026-07-25-app-branding-now-uses-the-product-name-without-the-agent-nat.md +6 -0
- package/corpus/templates/design/changelog/2026-07-25-settings-navigation-now-keeps-manage-agent-as-a-dedicated-li.md +6 -0
- package/corpus/templates/design/server/plugins/auth.ts +1 -1
- package/corpus/templates/dispatch/.agents/skills/upgrade-agent-native/SKILL.md +24 -2
- package/corpus/templates/dispatch/_gitignore +1 -0
- package/corpus/templates/dispatch/app/dispatch-extensions.tsx +1 -10
- package/corpus/templates/dispatch/app/routes/overview.tsx +1 -1
- package/corpus/templates/dispatch/changelog/2026-07-24-signing-in-now-puts-you-in-your-companys-workspace.md +6 -0
- package/corpus/templates/dispatch/changelog/2026-07-25-app-branding-now-uses-the-product-name-without-the-agent-nat.md +6 -0
- package/corpus/templates/dispatch/changelog/2026-07-25-settings-navigation-now-keeps-manage-agent-as-a-dedicated-li.md +6 -0
- package/corpus/templates/dispatch/package.json +1 -1
- package/corpus/templates/dispatch/public/manifest.json +1 -1
- package/corpus/templates/forms/.agents/skills/upgrade-agent-native/SKILL.md +24 -2
- package/corpus/templates/forms/_gitignore +1 -0
- package/corpus/templates/forms/app/components/layout/Sidebar.tsx +0 -35
- package/corpus/templates/forms/changelog/2026-07-25-app-branding-now-uses-the-product-name-without-the-agent-nat.md +6 -0
- package/corpus/templates/forms/changelog/2026-07-25-settings-navigation-now-keeps-manage-agent-as-a-dedicated-li.md +6 -0
- package/corpus/templates/forms/package.json +1 -1
- package/corpus/templates/forms/public/manifest.json +1 -1
- package/corpus/templates/forms/server/lib/public-form-ssr.ts +2 -2
- package/corpus/templates/forms/server/plugins/auth.ts +1 -1
- package/corpus/templates/macros/.agents/skills/upgrade-agent-native/SKILL.md +24 -2
- package/corpus/templates/macros/_gitignore +1 -0
- package/corpus/templates/macros/app/components/layout/AppLayout.tsx +0 -2
- package/corpus/templates/macros/changelog/2026-07-25-app-branding-now-uses-the-product-name-without-the-agent-nat.md +6 -0
- package/corpus/templates/macros/changelog/2026-07-25-settings-navigation-now-keeps-manage-agent-as-a-dedicated-li.md +6 -0
- package/corpus/templates/macros/package.json +1 -1
- package/corpus/templates/macros/server/plugins/auth.ts +2 -2
- package/corpus/templates/mail/.agents/skills/upgrade-agent-native/SKILL.md +24 -2
- package/corpus/templates/mail/_gitignore +1 -0
- package/corpus/templates/mail/app/components/layout/AppLayout.tsx +0 -39
- package/corpus/templates/mail/app/routes/$view.$threadId.tsx +1 -1
- package/corpus/templates/mail/app/routes/$view.tsx +1 -1
- package/corpus/templates/mail/app/routes/_index.tsx +1 -1
- package/corpus/templates/mail/changelog/2026-07-25-app-branding-now-uses-the-product-name-without-the-agent-nat.md +6 -0
- package/corpus/templates/mail/changelog/2026-07-25-settings-navigation-now-keeps-manage-agent-as-a-dedicated-li.md +6 -0
- package/corpus/templates/mail/package.json +1 -1
- package/corpus/templates/mail/public/manifest.json +1 -1
- package/corpus/templates/mail/server/plugins/auth.ts +1 -1
- package/corpus/templates/plan/.agents/skills/upgrade-agent-native/SKILL.md +24 -2
- package/corpus/templates/plan/_gitignore +1 -0
- package/corpus/templates/plan/agent-native.app-skill.json +1 -1
- package/corpus/templates/plan/app/components/layout/Sidebar.tsx +4 -9
- package/corpus/templates/plan/app/lib/app-config.ts +1 -1
- package/corpus/templates/plan/changelog/2026-07-25-app-branding-now-uses-the-product-name-without-the-agent-nat.md +6 -0
- package/corpus/templates/plan/changelog/2026-07-25-settings-navigation-now-keeps-manage-agent-as-a-dedicated-li.md +6 -0
- package/corpus/templates/plan/package.json +1 -1
- package/corpus/templates/plan/public/manifest.json +1 -1
- package/corpus/templates/plan/server/plugins/auth.ts +1 -1
- package/corpus/templates/slides/.agents/skills/upgrade-agent-native/SKILL.md +24 -2
- package/corpus/templates/slides/_gitignore +1 -0
- package/corpus/templates/slides/app/components/layout/Sidebar.tsx +0 -2
- package/corpus/templates/slides/app/routes/_index.tsx +1 -1
- package/corpus/templates/slides/changelog/2026-07-25-app-branding-now-uses-the-product-name-without-the-agent-nat.md +6 -0
- package/corpus/templates/slides/changelog/2026-07-25-settings-navigation-now-keeps-manage-agent-as-a-dedicated-li.md +6 -0
- package/corpus/templates/slides/package.json +1 -1
- package/corpus/templates/slides/public/manifest.json +1 -1
- package/corpus/templates/slides/server/plugins/auth.ts +1 -1
- package/corpus/templates/slides/server/plugins/db.ts +4 -0
- package/corpus/templates/tasks/.agents/skills/upgrade-agent-native/SKILL.md +24 -2
- package/corpus/templates/tasks/AGENTS.md +1 -1
- package/corpus/templates/tasks/_gitignore +1 -0
- package/dist/a2a/activity.d.ts +4 -1
- package/dist/a2a/activity.d.ts.map +1 -1
- package/dist/a2a/activity.js +27 -16
- package/dist/a2a/activity.js.map +1 -1
- package/dist/a2a/client.d.ts.map +1 -1
- package/dist/a2a/client.js +58 -4
- package/dist/a2a/client.js.map +1 -1
- package/dist/agent/engine/builder-engine.d.ts +1 -0
- package/dist/agent/engine/builder-engine.d.ts.map +1 -1
- package/dist/agent/engine/builder-engine.js +31 -4
- package/dist/agent/engine/builder-engine.js.map +1 -1
- package/dist/agent/run-manager.d.ts.map +1 -1
- package/dist/agent/run-manager.js +18 -1
- package/dist/agent/run-manager.js.map +1 -1
- package/dist/agent/run-store.d.ts +1 -0
- package/dist/agent/run-store.d.ts.map +1 -1
- package/dist/agent/run-store.js +2 -1
- package/dist/agent/run-store.js.map +1 -1
- package/dist/agent/types.d.ts +12 -1
- package/dist/agent/types.d.ts.map +1 -1
- package/dist/agent/types.js +21 -1
- package/dist/agent/types.js.map +1 -1
- package/dist/chat-threads/store.d.ts +10 -0
- package/dist/chat-threads/store.d.ts.map +1 -1
- package/dist/chat-threads/store.js +41 -0
- package/dist/chat-threads/store.js.map +1 -1
- package/dist/checkpoints/index.d.ts +1 -0
- package/dist/checkpoints/index.d.ts.map +1 -1
- package/dist/checkpoints/index.js +1 -0
- package/dist/checkpoints/index.js.map +1 -1
- package/dist/checkpoints/route-match.d.ts +8 -0
- package/dist/checkpoints/route-match.d.ts.map +1 -0
- package/dist/checkpoints/route-match.js +13 -0
- package/dist/checkpoints/route-match.js.map +1 -0
- package/dist/cli/create.d.ts +35 -4
- package/dist/cli/create.d.ts.map +1 -1
- package/dist/cli/create.js +69 -19
- package/dist/cli/create.js.map +1 -1
- package/dist/cli/index.js +19 -0
- package/dist/cli/index.js.map +1 -1
- package/dist/cli/template-baseline.d.ts +54 -0
- package/dist/cli/template-baseline.d.ts.map +1 -0
- package/dist/cli/template-baseline.js +334 -0
- package/dist/cli/template-baseline.js.map +1 -0
- package/dist/cli/template-sync.d.ts +57 -0
- package/dist/cli/template-sync.d.ts.map +1 -0
- package/dist/cli/template-sync.js +787 -0
- package/dist/cli/template-sync.js.map +1 -0
- package/dist/cli/templates-meta.d.ts.map +1 -1
- package/dist/cli/templates-meta.js +1 -0
- package/dist/cli/templates-meta.js.map +1 -1
- package/dist/client/AssistantChat.d.ts +2 -1
- package/dist/client/AssistantChat.d.ts.map +1 -1
- package/dist/client/AssistantChat.js +38 -10
- package/dist/client/AssistantChat.js.map +1 -1
- package/dist/client/NewWorkspaceAppFlow.d.ts.map +1 -1
- package/dist/client/NewWorkspaceAppFlow.js +32 -2
- package/dist/client/NewWorkspaceAppFlow.js.map +1 -1
- package/dist/client/chat/message-components.d.ts +20 -0
- package/dist/client/chat/message-components.d.ts.map +1 -1
- package/dist/client/chat/message-components.js +81 -46
- package/dist/client/chat/message-components.js.map +1 -1
- package/dist/client/chat/tool-call-display.d.ts.map +1 -1
- package/dist/client/chat/tool-call-display.js +14 -6
- package/dist/client/chat/tool-call-display.js.map +1 -1
- package/dist/client/error-format.d.ts.map +1 -1
- package/dist/client/error-format.js +13 -0
- package/dist/client/error-format.js.map +1 -1
- package/dist/client/org/OrgSwitcher.d.ts +8 -1
- package/dist/client/org/OrgSwitcher.d.ts.map +1 -1
- package/dist/client/org/OrgSwitcher.js +3 -2
- package/dist/client/org/OrgSwitcher.js.map +1 -1
- package/dist/client/org/TeamPage.d.ts.map +1 -1
- package/dist/client/org/TeamPage.js +1 -1
- package/dist/client/org/TeamPage.js.map +1 -1
- package/dist/client/settings/SettingsPanel.js +9 -9
- package/dist/client/settings/SettingsPanel.js.map +1 -1
- package/dist/client/settings/SettingsTabsPage.d.ts.map +1 -1
- package/dist/client/settings/SettingsTabsPage.js +7 -4
- package/dist/client/settings/SettingsTabsPage.js.map +1 -1
- package/dist/client/sse-event-processor.d.ts.map +1 -1
- package/dist/client/sse-event-processor.js +3 -0
- package/dist/client/sse-event-processor.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/data-widgets/index.d.ts +3 -0
- package/dist/data-widgets/index.d.ts.map +1 -1
- package/dist/data-widgets/index.js +33 -0
- package/dist/data-widgets/index.js.map +1 -1
- package/dist/deploy/build.d.ts.map +1 -1
- package/dist/deploy/build.js +11 -7
- package/dist/deploy/build.js.map +1 -1
- package/dist/eject/provider-api-definitions.d.ts +1 -0
- package/dist/eject/provider-api-definitions.d.ts.map +1 -1
- package/dist/extensions/url-safety.d.ts +9 -16
- package/dist/extensions/url-safety.d.ts.map +1 -1
- package/dist/extensions/url-safety.js +48 -4
- package/dist/extensions/url-safety.js.map +1 -1
- package/dist/file-upload/actions/upload-image.d.ts +1 -1
- package/dist/integrations/webhook-handler.d.ts.map +1 -1
- package/dist/integrations/webhook-handler.js +46 -9
- package/dist/integrations/webhook-handler.js.map +1 -1
- package/dist/notifications/routes.d.ts +2 -2
- package/dist/observability/routes.d.ts +3 -3
- package/dist/org/auto-join-domain.d.ts +3 -2
- package/dist/org/auto-join-domain.d.ts.map +1 -1
- package/dist/org/auto-join-domain.js +1 -1
- package/dist/org/auto-join-domain.js.map +1 -1
- package/dist/org/context.d.ts.map +1 -1
- package/dist/org/context.js +84 -28
- package/dist/org/context.js.map +1 -1
- package/dist/org/index.d.ts +1 -0
- package/dist/org/index.d.ts.map +1 -1
- package/dist/org/index.js +1 -0
- package/dist/org/index.js.map +1 -1
- package/dist/org/service-identity.d.ts +43 -0
- package/dist/org/service-identity.d.ts.map +1 -0
- package/dist/org/service-identity.js +34 -0
- package/dist/org/service-identity.js.map +1 -0
- package/dist/provider-api/actions/custom-provider-registration.d.ts +14 -14
- package/dist/provider-api/actions/provider-api.d.ts +13 -11
- package/dist/provider-api/actions/provider-api.d.ts.map +1 -1
- package/dist/provider-api/index.d.ts +4 -0
- package/dist/provider-api/index.d.ts.map +1 -1
- package/dist/provider-api/index.js +17 -1
- package/dist/provider-api/index.js.map +1 -1
- package/dist/scripts/docs/search.d.ts.map +1 -1
- package/dist/scripts/docs/search.js +12 -1
- package/dist/scripts/docs/search.js.map +1 -1
- package/dist/server/agent-chat/context-tools.d.ts.map +1 -1
- package/dist/server/agent-chat/context-tools.js +3 -3
- package/dist/server/agent-chat/context-tools.js.map +1 -1
- package/dist/server/agent-chat/framework-prompts.d.ts +8 -3
- package/dist/server/agent-chat/framework-prompts.d.ts.map +1 -1
- package/dist/server/agent-chat/framework-prompts.js +33 -62
- package/dist/server/agent-chat/framework-prompts.js.map +1 -1
- package/dist/server/agent-chat-plugin.d.ts.map +1 -1
- package/dist/server/agent-chat-plugin.js +16 -10
- 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/agents-bundle.d.ts +18 -0
- package/dist/server/agents-bundle.d.ts.map +1 -1
- package/dist/server/agents-bundle.js +70 -4
- package/dist/server/agents-bundle.js.map +1 -1
- package/dist/server/auth.d.ts.map +1 -1
- package/dist/server/auth.js +4 -3
- package/dist/server/auth.js.map +1 -1
- package/dist/server/builder-browser.d.ts.map +1 -1
- package/dist/server/builder-browser.js +43 -19
- package/dist/server/builder-browser.js.map +1 -1
- package/dist/server/core-routes-plugin.js +2 -2
- package/dist/server/core-routes-plugin.js.map +1 -1
- package/dist/server/credential-provider.d.ts +38 -2
- package/dist/server/credential-provider.d.ts.map +1 -1
- package/dist/server/credential-provider.js +142 -64
- package/dist/server/credential-provider.js.map +1 -1
- package/dist/server/index.d.ts +1 -1
- package/dist/server/index.d.ts.map +1 -1
- package/dist/server/index.js +1 -1
- package/dist/server/index.js.map +1 -1
- package/dist/server/prompts/framework-core-compact.d.ts +1 -1
- package/dist/server/prompts/framework-core-compact.d.ts.map +1 -1
- package/dist/server/prompts/framework-core-compact.js +7 -13
- package/dist/server/prompts/framework-core-compact.js.map +1 -1
- package/dist/server/prompts/framework-core.d.ts +1 -1
- package/dist/server/prompts/framework-core.d.ts.map +1 -1
- package/dist/server/prompts/framework-core.js +10 -21
- package/dist/server/prompts/framework-core.js.map +1 -1
- package/dist/server/prompts/index.d.ts +1 -1
- package/dist/server/prompts/index.d.ts.map +1 -1
- package/dist/server/prompts/index.js +1 -1
- package/dist/server/prompts/index.js.map +1 -1
- package/dist/server/prompts/shared-rules.d.ts +16 -10
- package/dist/server/prompts/shared-rules.d.ts.map +1 -1
- package/dist/server/prompts/shared-rules.js +19 -10
- package/dist/server/prompts/shared-rules.js.map +1 -1
- package/dist/server/ssr-handler.d.ts +1 -1
- package/dist/server/ssr-handler.d.ts.map +1 -1
- package/dist/server/ssr-handler.js +10 -3
- package/dist/server/ssr-handler.js.map +1 -1
- package/dist/server/transcribe-voice.d.ts +1 -1
- package/dist/settings/user-settings.d.ts.map +1 -1
- package/dist/settings/user-settings.js +13 -1
- package/dist/settings/user-settings.js.map +1 -1
- package/dist/shared/cache-control.d.ts +52 -0
- package/dist/shared/cache-control.d.ts.map +1 -1
- package/dist/shared/cache-control.js +107 -0
- package/dist/shared/cache-control.js.map +1 -1
- package/dist/templates/chat/.agents/skills/upgrade-agent-native/SKILL.md +24 -2
- package/dist/templates/chat/_gitignore +1 -0
- package/dist/templates/chat/app/components/layout/Sidebar.tsx +0 -7
- package/dist/templates/chat/changelog/2026-07-25-settings-navigation-now-keeps-manage-agent-as-a-dedicated-li.md +6 -0
- package/dist/templates/default/.agents/skills/upgrade-agent-native/SKILL.md +24 -2
- package/dist/templates/default/app/root.tsx +1 -1
- package/dist/templates/default/public/manifest.json +2 -2
- package/dist/templates/headless/.agents/skills/upgrade-agent-native/SKILL.md +24 -2
- package/dist/templates/workspace-core/.agents/skills/performance/SKILL.md +19 -0
- package/dist/templates/workspace-core/.agents/skills/upgrade-agent-native/SKILL.md +24 -2
- package/dist/templates/workspace-core/.agents/skills/visual-answer/SKILL.md +1 -0
- package/dist/vite/agents-bundle-plugin.d.ts.map +1 -1
- package/dist/vite/agents-bundle-plugin.js +8 -7
- package/dist/vite/agents-bundle-plugin.js.map +1 -1
- package/dist/vite/client.d.ts.map +1 -1
- package/dist/vite/client.js +66 -1
- package/dist/vite/client.js.map +1 -1
- package/docs/content/actions.mdx +2 -2
- package/docs/content/agent-surfaces.mdx +1 -1
- package/docs/content/authentication.mdx +2 -0
- package/docs/content/deployment.mdx +36 -0
- package/docs/content/http-api.mdx +266 -0
- package/docs/content/syncing-template-changes.mdx +159 -0
- package/package.json +4 -3
- package/src/a2a/activity.ts +38 -27
- package/src/a2a/client.ts +57 -4
- package/src/agent/engine/builder-engine.ts +35 -4
- package/src/agent/run-manager.ts +20 -1
- package/src/agent/run-store.ts +4 -1
- package/src/agent/types.ts +28 -8
- package/src/chat-threads/store.ts +45 -0
- package/src/checkpoints/index.ts +2 -0
- package/src/checkpoints/route-match.ts +13 -0
- package/src/cli/create.ts +105 -17
- package/src/cli/index.ts +20 -0
- package/src/cli/template-baseline.ts +410 -0
- package/src/cli/template-sync.ts +1004 -0
- package/src/cli/templates-meta.ts +1 -0
- package/src/client/AssistantChat.tsx +38 -12
- package/src/client/NewWorkspaceAppFlow.tsx +75 -10
- package/src/client/chat/message-components.tsx +127 -66
- package/src/client/chat/tool-call-display.tsx +29 -5
- package/src/client/error-format.ts +18 -0
- package/src/client/org/OrgSwitcher.tsx +30 -8
- package/src/client/org/TeamPage.tsx +7 -6
- package/src/client/settings/SettingsPanel.tsx +9 -9
- package/src/client/settings/SettingsTabsPage.tsx +12 -2
- package/src/client/sse-event-processor.ts +3 -0
- package/src/data-widgets/index.ts +41 -0
- package/src/deploy/build.ts +11 -9
- package/src/extensions/url-safety.ts +67 -4
- package/src/integrations/webhook-handler.ts +63 -9
- package/src/org/auto-join-domain.ts +4 -3
- package/src/org/context.ts +108 -39
- package/src/org/index.ts +5 -0
- package/src/org/service-identity.ts +60 -0
- package/src/provider-api/index.ts +22 -1
- package/src/scripts/docs/search.ts +12 -1
- package/src/server/__snapshots__/agent-chat-plugin.surface.spec.ts.snap +25 -36
- package/src/server/agent-chat/context-tools.ts +9 -4
- package/src/server/agent-chat/framework-prompts.ts +38 -66
- package/src/server/agent-chat-plugin.ts +17 -10
- package/src/server/agents-bundle.ts +84 -5
- package/src/server/auth.ts +4 -3
- package/src/server/builder-browser.ts +47 -19
- package/src/server/core-routes-plugin.ts +2 -2
- package/src/server/credential-provider.ts +209 -68
- package/src/server/index.ts +3 -0
- package/src/server/prompts/framework-core-compact.ts +6 -13
- package/src/server/prompts/framework-core.ts +9 -21
- package/src/server/prompts/index.ts +0 -1
- package/src/server/prompts/shared-rules.ts +19 -11
- package/src/server/ssr-handler.ts +13 -2
- package/src/settings/user-settings.ts +13 -1
- package/src/shared/cache-control.ts +141 -0
- package/src/templates/chat/.agents/skills/upgrade-agent-native/SKILL.md +24 -2
- package/src/templates/chat/_gitignore +1 -0
- package/src/templates/chat/app/components/layout/Sidebar.tsx +0 -7
- package/src/templates/chat/changelog/2026-07-25-settings-navigation-now-keeps-manage-agent-as-a-dedicated-li.md +6 -0
- package/src/templates/default/.agents/skills/upgrade-agent-native/SKILL.md +24 -2
- package/src/templates/default/app/root.tsx +1 -1
- package/src/templates/default/public/manifest.json +2 -2
- package/src/templates/headless/.agents/skills/upgrade-agent-native/SKILL.md +24 -2
- package/src/templates/workspace-core/.agents/skills/performance/SKILL.md +19 -0
- package/src/templates/workspace-core/.agents/skills/upgrade-agent-native/SKILL.md +24 -2
- package/src/templates/workspace-core/.agents/skills/visual-answer/SKILL.md +1 -0
- package/src/vite/agents-bundle-plugin.ts +7 -6
- package/src/vite/client.ts +69 -3
package/src/a2a/activity.ts
CHANGED
|
@@ -37,6 +37,9 @@ export interface A2AAgentActivitySnapshot extends Record<string, unknown> {
|
|
|
37
37
|
activePhase: A2AAgentActivityPhase;
|
|
38
38
|
reasoning: string[];
|
|
39
39
|
toolCalls: A2AAgentActivityToolCall[];
|
|
40
|
+
/** Response text segments, indexed by how many tool calls preceded them. */
|
|
41
|
+
response?: string[];
|
|
42
|
+
/** Tail segment only. Kept so peers predating `response` still render. */
|
|
40
43
|
responseText?: string;
|
|
41
44
|
}
|
|
42
45
|
|
|
@@ -47,7 +50,7 @@ export interface A2AAgentActivityState {
|
|
|
47
50
|
activePhase: A2AAgentActivityPhase;
|
|
48
51
|
reasoning: string[];
|
|
49
52
|
toolCalls: A2AAgentActivityToolCall[];
|
|
50
|
-
|
|
53
|
+
response: string[];
|
|
51
54
|
}
|
|
52
55
|
|
|
53
56
|
export function createA2AAgentActivityState(
|
|
@@ -60,7 +63,7 @@ export function createA2AAgentActivityState(
|
|
|
60
63
|
activePhase: "reasoning",
|
|
61
64
|
reasoning: [],
|
|
62
65
|
toolCalls: [],
|
|
63
|
-
|
|
66
|
+
response: [],
|
|
64
67
|
};
|
|
65
68
|
}
|
|
66
69
|
|
|
@@ -90,7 +93,6 @@ export function applyA2AAgentActivityEvent(
|
|
|
90
93
|
break;
|
|
91
94
|
case "tool_start":
|
|
92
95
|
next.activePhase = "tool";
|
|
93
|
-
next.responseText = "";
|
|
94
96
|
next.toolCalls = appendToolCall(next.toolCalls, toolFromEvent(event));
|
|
95
97
|
changed = true;
|
|
96
98
|
break;
|
|
@@ -101,10 +103,11 @@ export function applyA2AAgentActivityEvent(
|
|
|
101
103
|
break;
|
|
102
104
|
case "text":
|
|
103
105
|
next.activePhase = "responding";
|
|
104
|
-
next.
|
|
105
|
-
next.
|
|
106
|
+
next.response = appendBoundedSegment(
|
|
107
|
+
next.response,
|
|
106
108
|
event.text,
|
|
107
109
|
MAX_A2A_ACTIVITY_RESPONSE_CHARS,
|
|
110
|
+
next.toolCalls.length,
|
|
108
111
|
);
|
|
109
112
|
changed = true;
|
|
110
113
|
break;
|
|
@@ -117,7 +120,7 @@ export function applyA2AAgentActivityEvent(
|
|
|
117
120
|
changed = true;
|
|
118
121
|
break;
|
|
119
122
|
case "clear":
|
|
120
|
-
next.
|
|
123
|
+
next.response = [];
|
|
121
124
|
changed = true;
|
|
122
125
|
break;
|
|
123
126
|
}
|
|
@@ -138,10 +141,15 @@ export function buildA2AAgentActivitySnapshot(
|
|
|
138
141
|
activePhase: state.activePhase,
|
|
139
142
|
reasoning: state.reasoning,
|
|
140
143
|
toolCalls: state.toolCalls,
|
|
141
|
-
...(state.
|
|
144
|
+
...(state.response.length ? { response: state.response } : {}),
|
|
145
|
+
...(tailSegment(state) ? { responseText: tailSegment(state) } : {}),
|
|
142
146
|
};
|
|
143
147
|
}
|
|
144
148
|
|
|
149
|
+
function tailSegment(state: A2AAgentActivityState): string {
|
|
150
|
+
return state.response[state.toolCalls.length] ?? "";
|
|
151
|
+
}
|
|
152
|
+
|
|
145
153
|
export function buildA2AAgentActivityPart(
|
|
146
154
|
state: A2AAgentActivityState,
|
|
147
155
|
): DataPart {
|
|
@@ -165,8 +173,10 @@ export function parseA2AAgentActivityPart(
|
|
|
165
173
|
!isPhase(data.activePhase) ||
|
|
166
174
|
data.updatedAt < data.startedAt ||
|
|
167
175
|
data.durationMs !== data.updatedAt - data.startedAt ||
|
|
168
|
-
!
|
|
176
|
+
!isSafeSegments(data.reasoning, MAX_A2A_ACTIVITY_REASONING_CHARS) ||
|
|
169
177
|
!isSafeToolCalls(data.toolCalls) ||
|
|
178
|
+
(data.response !== undefined &&
|
|
179
|
+
!isSafeSegments(data.response, MAX_A2A_ACTIVITY_RESPONSE_CHARS)) ||
|
|
170
180
|
(data.responseText !== undefined &&
|
|
171
181
|
!isSafeText(data.responseText, MAX_A2A_ACTIVITY_RESPONSE_CHARS)) ||
|
|
172
182
|
activityCharacterCount(data) > MAX_A2A_ACTIVITY_TOTAL_CHARS
|
|
@@ -193,14 +203,6 @@ function toolFromEvent(
|
|
|
193
203
|
};
|
|
194
204
|
}
|
|
195
205
|
|
|
196
|
-
function appendBoundedText(
|
|
197
|
-
current: string,
|
|
198
|
-
addition: string,
|
|
199
|
-
maxChars: number,
|
|
200
|
-
) {
|
|
201
|
-
return sanitizeText(`${current}${addition}`, maxChars);
|
|
202
|
-
}
|
|
203
|
-
|
|
204
206
|
function appendBoundedSegment(
|
|
205
207
|
current: string[],
|
|
206
208
|
addition: string,
|
|
@@ -293,7 +295,7 @@ function isPhase(value: unknown): value is A2AAgentActivityPhase {
|
|
|
293
295
|
);
|
|
294
296
|
}
|
|
295
297
|
|
|
296
|
-
function
|
|
298
|
+
function isSafeSegments(value: unknown, maxChars: number): value is string[] {
|
|
297
299
|
return (
|
|
298
300
|
Array.isArray(value) &&
|
|
299
301
|
value.length <= MAX_A2A_ACTIVITY_REASONING_SEGMENTS &&
|
|
@@ -301,8 +303,8 @@ function isSafeReasoning(value: unknown): value is string[] {
|
|
|
301
303
|
(total, text) =>
|
|
302
304
|
total + (typeof text === "string" ? text.length : Infinity),
|
|
303
305
|
0,
|
|
304
|
-
) <=
|
|
305
|
-
value.every((text) => isSafeText(text,
|
|
306
|
+
) <= maxChars &&
|
|
307
|
+
value.every((text) => isSafeText(text, maxChars))
|
|
306
308
|
);
|
|
307
309
|
}
|
|
308
310
|
|
|
@@ -349,14 +351,14 @@ function isSafeToolId(value: unknown): value is string {
|
|
|
349
351
|
}
|
|
350
352
|
|
|
351
353
|
function activityCharacterCount(data: Record<string, unknown>): number {
|
|
352
|
-
const reasoning =
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
:
|
|
358
|
-
|
|
359
|
-
|
|
354
|
+
const reasoning = segmentCharacterCount(data.reasoning);
|
|
355
|
+
// `responseText` duplicates the tail of `response`; counting both would
|
|
356
|
+
// reject a snapshot that is within budget.
|
|
357
|
+
const response = Array.isArray(data.response)
|
|
358
|
+
? segmentCharacterCount(data.response)
|
|
359
|
+
: typeof data.responseText === "string"
|
|
360
|
+
? data.responseText.length
|
|
361
|
+
: 0;
|
|
360
362
|
const tools = Array.isArray(data.toolCalls)
|
|
361
363
|
? data.toolCalls.reduce((total, tool) => {
|
|
362
364
|
if (!isRecord(tool)) return total;
|
|
@@ -369,3 +371,12 @@ function activityCharacterCount(data: Record<string, unknown>): number {
|
|
|
369
371
|
: 0;
|
|
370
372
|
return reasoning + response + tools;
|
|
371
373
|
}
|
|
374
|
+
|
|
375
|
+
function segmentCharacterCount(value: unknown): number {
|
|
376
|
+
return Array.isArray(value)
|
|
377
|
+
? value.reduce(
|
|
378
|
+
(total, text) => total + (typeof text === "string" ? text.length : 0),
|
|
379
|
+
0,
|
|
380
|
+
)
|
|
381
|
+
: 0;
|
|
382
|
+
}
|
package/src/a2a/client.ts
CHANGED
|
@@ -1,6 +1,50 @@
|
|
|
1
1
|
import * as jose from "jose";
|
|
2
2
|
|
|
3
3
|
import { ssrfSafeFetch } from "../extensions/url-safety.js";
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* A workspace serves every app from one gateway on loopback, so sibling A2A
|
|
7
|
+
* targets are private addresses by construction and the SSRF guard cannot tell
|
|
8
|
+
* them apart from an attack. Trust only origins this deployment configured for
|
|
9
|
+
* itself — never a value that arrived on a request.
|
|
10
|
+
*/
|
|
11
|
+
function workspacePrivateOrigins(): string[] {
|
|
12
|
+
const origins = [
|
|
13
|
+
process.env.WORKSPACE_GATEWAY_URL,
|
|
14
|
+
process.env.APP_URL,
|
|
15
|
+
process.env.BETTER_AUTH_URL,
|
|
16
|
+
// Escape hatch for contexts that never receive the gateway manifest (the
|
|
17
|
+
// action CLI, one-off scripts). Comma-separated origins.
|
|
18
|
+
...(process.env.AGENT_NATIVE_A2A_ALLOWED_ORIGINS ?? "").split(","),
|
|
19
|
+
]
|
|
20
|
+
.map((value) => value?.trim())
|
|
21
|
+
.filter((value): value is string => !!value);
|
|
22
|
+
|
|
23
|
+
// The gateway also hands each child the sibling manifest, and siblings are
|
|
24
|
+
// reached on their own loopback ports rather than through the gateway.
|
|
25
|
+
const raw = process.env.AGENT_NATIVE_WORKSPACE_APPS_JSON;
|
|
26
|
+
if (raw) {
|
|
27
|
+
try {
|
|
28
|
+
const parsed = JSON.parse(raw);
|
|
29
|
+
const apps = Array.isArray(parsed?.apps)
|
|
30
|
+
? parsed.apps
|
|
31
|
+
: Array.isArray(parsed)
|
|
32
|
+
? parsed
|
|
33
|
+
: [];
|
|
34
|
+
for (const app of apps) {
|
|
35
|
+
const url = app?.url ?? app?.origin ?? app?.baseUrl;
|
|
36
|
+
if (typeof url === "string" && url) origins.push(url);
|
|
37
|
+
const port = app?.port;
|
|
38
|
+
if (typeof port === "number" && Number.isFinite(port)) {
|
|
39
|
+
origins.push(`http://127.0.0.1:${port}`);
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
} catch {
|
|
43
|
+
// A malformed manifest must not disable the SSRF guard.
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
return origins;
|
|
47
|
+
}
|
|
4
48
|
import { sanitizeA2ACorrelationMetadata } from "./correlation.js";
|
|
5
49
|
import type {
|
|
6
50
|
A2AApprovedAction,
|
|
@@ -138,7 +182,7 @@ export class A2AClient {
|
|
|
138
182
|
const res = await ssrfSafeFetch(
|
|
139
183
|
endpoint,
|
|
140
184
|
{ method: "OPTIONS" },
|
|
141
|
-
{ maxRedirects: 3 },
|
|
185
|
+
{ maxRedirects: 3, allowedPrivateOrigins: workspacePrivateOrigins() },
|
|
142
186
|
);
|
|
143
187
|
if (res.status !== 404 && res.status !== 405) {
|
|
144
188
|
this.endpointCandidates = [endpoint];
|
|
@@ -237,7 +281,7 @@ export class A2AClient {
|
|
|
237
281
|
const res = await ssrfSafeFetch(
|
|
238
282
|
`${this.baseUrl}/.well-known/agent-card.json`,
|
|
239
283
|
{},
|
|
240
|
-
{ maxRedirects: 3 },
|
|
284
|
+
{ maxRedirects: 3, allowedPrivateOrigins: workspacePrivateOrigins() },
|
|
241
285
|
);
|
|
242
286
|
if (!res.ok) {
|
|
243
287
|
throw new Error(`Failed to fetch agent card (${res.status})`);
|
|
@@ -548,7 +592,7 @@ export class A2AClient {
|
|
|
548
592
|
body: JSON.stringify(body),
|
|
549
593
|
signal: controller?.signal,
|
|
550
594
|
},
|
|
551
|
-
{ maxRedirects: 3 },
|
|
595
|
+
{ maxRedirects: 3, allowedPrivateOrigins: workspacePrivateOrigins() },
|
|
552
596
|
);
|
|
553
597
|
} finally {
|
|
554
598
|
if (timer) clearTimeout(timer);
|
|
@@ -883,7 +927,16 @@ async function buildA2AApiKeyAttempts(
|
|
|
883
927
|
|
|
884
928
|
function normalizeA2AAudience(url: string): string {
|
|
885
929
|
const explicit = splitExplicitA2AEndpoint(url.replace(/\/$/, ""));
|
|
886
|
-
|
|
930
|
+
const base = (explicit?.baseUrl ?? url).replace(/\/$/, "");
|
|
931
|
+
// Receivers derive their expected audience from APP_URL, which carries no
|
|
932
|
+
// app path. In a workspace every app is mounted under one gateway origin, so
|
|
933
|
+
// signing the path-qualified URL yields an audience the receiver can never
|
|
934
|
+
// match. The origin is the identifier both sides agree on.
|
|
935
|
+
try {
|
|
936
|
+
return new URL(base).origin;
|
|
937
|
+
} catch {
|
|
938
|
+
return base;
|
|
939
|
+
}
|
|
887
940
|
}
|
|
888
941
|
|
|
889
942
|
function isA2AAuthRejection(err: unknown): boolean {
|
|
@@ -71,6 +71,8 @@ const MAX_BACKGROUND_BUILDER_GATEWAY_TIMEOUT_MS = 14 * 60_000;
|
|
|
71
71
|
const MAX_LOCAL_BUILDER_GATEWAY_TIMEOUT_MS =
|
|
72
72
|
MAX_BACKGROUND_BUILDER_GATEWAY_TIMEOUT_MS;
|
|
73
73
|
const BUILDER_GATEWAY_NETWORK_ERROR_CODE = "builder_gateway_network_error";
|
|
74
|
+
export const BUILDER_MODEL_UNAUTHORIZED_ERROR_CODE =
|
|
75
|
+
"builder_model_unauthorized";
|
|
74
76
|
|
|
75
77
|
export const BUILDER_DEFAULT_MODEL = BUILDER_MODEL_CONFIG.defaultModel;
|
|
76
78
|
|
|
@@ -669,8 +671,16 @@ async function* parseJsonlStream(
|
|
|
669
671
|
explicitErrMsg ??
|
|
670
672
|
`Gateway error (no detail; raw event: ${JSON.stringify(event)})`;
|
|
671
673
|
const gatewayErrCode = event.errorCode ?? event.code;
|
|
674
|
+
// The gateway already authenticated this request before streaming,
|
|
675
|
+
// so a bare "Unauthorized" here means the account cannot use this
|
|
676
|
+
// model — not that the connection is broken. Only a message that
|
|
677
|
+
// names the credential may tear down the Builder connection.
|
|
672
678
|
const isCredentialAuthError =
|
|
673
679
|
Boolean(explicitErrMsg) &&
|
|
680
|
+
isBuilderCredentialAuthErrorInStream(String(errMsg));
|
|
681
|
+
const isModelAuthError =
|
|
682
|
+
Boolean(explicitErrMsg) &&
|
|
683
|
+
!isCredentialAuthError &&
|
|
674
684
|
isBuilderCredentialAuthError(String(errMsg));
|
|
675
685
|
// Anthropic's bare "Connection error." often arrives here with no
|
|
676
686
|
// gateway code. Tag it as a network error so in-run retries and
|
|
@@ -680,10 +690,12 @@ async function* parseJsonlStream(
|
|
|
680
690
|
isProviderConnectionErrorMessage(String(explicitErrMsg));
|
|
681
691
|
const errCode = isCredentialAuthError
|
|
682
692
|
? "builder_auth_error"
|
|
683
|
-
:
|
|
684
|
-
?
|
|
685
|
-
:
|
|
686
|
-
|
|
693
|
+
: isModelAuthError
|
|
694
|
+
? BUILDER_MODEL_UNAUTHORIZED_ERROR_CODE
|
|
695
|
+
: isProviderConnectionError
|
|
696
|
+
? BUILDER_GATEWAY_NETWORK_ERROR_CODE
|
|
697
|
+
: (gatewayErrCode ??
|
|
698
|
+
(!explicitErrMsg ? "builder_gateway_error" : undefined));
|
|
687
699
|
console.error(
|
|
688
700
|
`[builder-engine] stop reason=error model=${model} code=${errCode ?? "(none)"} error=${errMsg}`,
|
|
689
701
|
);
|
|
@@ -988,6 +1000,25 @@ function isBuilderCredentialAuthError(message: string): boolean {
|
|
|
988
1000
|
);
|
|
989
1001
|
}
|
|
990
1002
|
|
|
1003
|
+
/**
|
|
1004
|
+
* Stricter than {@link isBuilderCredentialAuthError} for errors that arrive
|
|
1005
|
+
* inside an already-authenticated stream, where a bare "unauthorized" is far
|
|
1006
|
+
* more likely to be a per-model entitlement rejection than a bad credential.
|
|
1007
|
+
* Misreading one there disconnects Builder for every model, including the ones
|
|
1008
|
+
* that still work.
|
|
1009
|
+
*/
|
|
1010
|
+
function isBuilderCredentialAuthErrorInStream(message: string): boolean {
|
|
1011
|
+
if (!isBuilderCredentialAuthError(message)) return false;
|
|
1012
|
+
const lowerMessage = message.toLowerCase();
|
|
1013
|
+
return (
|
|
1014
|
+
lowerMessage.includes("private key") ||
|
|
1015
|
+
lowerMessage.includes("access token") ||
|
|
1016
|
+
lowerMessage.includes("invalid token") ||
|
|
1017
|
+
lowerMessage.includes("invalid_token") ||
|
|
1018
|
+
lowerMessage.includes("token invalid")
|
|
1019
|
+
);
|
|
1020
|
+
}
|
|
1021
|
+
|
|
991
1022
|
function normalizeBuilderGatewayFetchError(
|
|
992
1023
|
err: unknown,
|
|
993
1024
|
timedOut: boolean,
|
package/src/agent/run-manager.ts
CHANGED
|
@@ -29,6 +29,7 @@ import {
|
|
|
29
29
|
setRunError,
|
|
30
30
|
setRunTerminalReason,
|
|
31
31
|
} from "./run-store.js";
|
|
32
|
+
import { isContinuationTerminalReason } from "./types.js";
|
|
32
33
|
import type { AgentChatEvent, RunEvent, RunStatus } from "./types.js";
|
|
33
34
|
|
|
34
35
|
export interface ActiveRun {
|
|
@@ -1429,10 +1430,28 @@ function subscribeFromSQL(
|
|
|
1429
1430
|
return;
|
|
1430
1431
|
}
|
|
1431
1432
|
} else if (run?.status === "completed") {
|
|
1433
|
+
// A chunk boundary is also status "completed" (with a
|
|
1434
|
+
// continuation terminal_reason, and a chained successor run
|
|
1435
|
+
// already carrying the turn). Synthesizing `done` here told the
|
|
1436
|
+
// client the agent stopped while it was still working, which
|
|
1437
|
+
// surfaced as a premature "stopped without sending a final
|
|
1438
|
+
// message". Prefer the run's REAL terminal event, then the
|
|
1439
|
+
// terminal_reason, before falling back to `done`.
|
|
1440
|
+
const existing = await getLastTerminalRunEvent(runId).catch(
|
|
1441
|
+
() => null,
|
|
1442
|
+
);
|
|
1443
|
+
const terminalEvent = existing
|
|
1444
|
+
? existing.event
|
|
1445
|
+
: isContinuationTerminalReason(run.terminalReason)
|
|
1446
|
+
? { type: "auto_continue", reason: run.terminalReason }
|
|
1447
|
+
: { type: "done" };
|
|
1432
1448
|
try {
|
|
1433
1449
|
controller.enqueue(
|
|
1434
1450
|
encoder.encode(
|
|
1435
|
-
`data: ${JSON.stringify({
|
|
1451
|
+
`data: ${JSON.stringify({
|
|
1452
|
+
...terminalEvent,
|
|
1453
|
+
seq: existing?.seq ?? lastSeq,
|
|
1454
|
+
})}\n\n`,
|
|
1436
1455
|
),
|
|
1437
1456
|
);
|
|
1438
1457
|
} catch {
|
package/src/agent/run-store.ts
CHANGED
|
@@ -1929,11 +1929,12 @@ export async function getRunById(runId: string): Promise<{
|
|
|
1929
1929
|
startedAt: number;
|
|
1930
1930
|
errorCode: string | null;
|
|
1931
1931
|
errorDetail: string | null;
|
|
1932
|
+
terminalReason: string | null;
|
|
1932
1933
|
} | null> {
|
|
1933
1934
|
await ensureRunTables();
|
|
1934
1935
|
const client = getDbExec();
|
|
1935
1936
|
const { rows } = await client.execute({
|
|
1936
|
-
sql: `SELECT id, thread_id, status, started_at, error_code, error_detail FROM agent_runs WHERE id = ?`,
|
|
1937
|
+
sql: `SELECT id, thread_id, status, started_at, error_code, error_detail, terminal_reason FROM agent_runs WHERE id = ?`,
|
|
1937
1938
|
args: [runId],
|
|
1938
1939
|
});
|
|
1939
1940
|
if (rows.length === 0) return null;
|
|
@@ -1944,6 +1945,7 @@ export async function getRunById(runId: string): Promise<{
|
|
|
1944
1945
|
started_at: number | string;
|
|
1945
1946
|
error_code?: string | null;
|
|
1946
1947
|
error_detail?: string | null;
|
|
1948
|
+
terminal_reason?: string | null;
|
|
1947
1949
|
};
|
|
1948
1950
|
return {
|
|
1949
1951
|
id: r.id,
|
|
@@ -1952,6 +1954,7 @@ export async function getRunById(runId: string): Promise<{
|
|
|
1952
1954
|
startedAt: Number(r.started_at),
|
|
1953
1955
|
errorCode: r.error_code ?? null,
|
|
1954
1956
|
errorDetail: r.error_detail ?? null,
|
|
1957
|
+
terminalReason: r.terminal_reason ?? null,
|
|
1955
1958
|
};
|
|
1956
1959
|
}
|
|
1957
1960
|
|
package/src/agent/types.ts
CHANGED
|
@@ -369,18 +369,38 @@ export type AgentChatEvent =
|
|
|
369
369
|
}
|
|
370
370
|
| {
|
|
371
371
|
type: "auto_continue";
|
|
372
|
-
reason:
|
|
373
|
-
| "run_timeout"
|
|
374
|
-
| "loop_limit"
|
|
375
|
-
| "max_tokens"
|
|
376
|
-
| "no_progress"
|
|
377
|
-
| "stream_ended"
|
|
378
|
-
| "gateway_timeout"
|
|
379
|
-
| "network_interrupted";
|
|
372
|
+
reason: ContinuationReason;
|
|
380
373
|
maxIterations?: number;
|
|
381
374
|
}
|
|
382
375
|
| { type: "clear" };
|
|
383
376
|
|
|
377
|
+
export const CONTINUATION_REASONS = [
|
|
378
|
+
"run_timeout",
|
|
379
|
+
"loop_limit",
|
|
380
|
+
"max_tokens",
|
|
381
|
+
"no_progress",
|
|
382
|
+
"stream_ended",
|
|
383
|
+
"gateway_timeout",
|
|
384
|
+
"network_interrupted",
|
|
385
|
+
] as const;
|
|
386
|
+
|
|
387
|
+
export type ContinuationReason = (typeof CONTINUATION_REASONS)[number];
|
|
388
|
+
|
|
389
|
+
/**
|
|
390
|
+
* True when an `agent_runs.terminal_reason` marks a CHUNK boundary rather than
|
|
391
|
+
* the end of the turn. Both writers (`terminalReasonForRun` in run-manager and
|
|
392
|
+
* `markBackgroundContinuationChunkTerminal` in production-agent) record
|
|
393
|
+
* status='completed' with one of these while a chained successor run carries the
|
|
394
|
+
* turn on, so such a row must never be reported to a client as a plain `done`.
|
|
395
|
+
* Mirrored client-side by `BACKGROUND_CONTINUATION_TERMINAL_REASONS`.
|
|
396
|
+
*/
|
|
397
|
+
export function isContinuationTerminalReason(reason: unknown): boolean {
|
|
398
|
+
return (
|
|
399
|
+
reason === "auto_continue" ||
|
|
400
|
+
CONTINUATION_REASONS.includes(reason as ContinuationReason)
|
|
401
|
+
);
|
|
402
|
+
}
|
|
403
|
+
|
|
384
404
|
export interface RunEvent {
|
|
385
405
|
seq: number;
|
|
386
406
|
event: AgentChatEvent;
|
|
@@ -1290,6 +1290,51 @@ export async function getThreadByShareToken(
|
|
|
1290
1290
|
return null;
|
|
1291
1291
|
}
|
|
1292
1292
|
|
|
1293
|
+
/**
|
|
1294
|
+
* Grant a user an explicit share on a thread they don't own. Used by the
|
|
1295
|
+
* messaging-integration path, where a channel conversation runs as the
|
|
1296
|
+
* integration service principal and so creates a thread owned by
|
|
1297
|
+
* `integration@<platform>` rather than the human who asked — without this the
|
|
1298
|
+
* "Open thread" deep link resolves to a 404 for them.
|
|
1299
|
+
*
|
|
1300
|
+
* Idempotent, and never downgrades an existing stronger role.
|
|
1301
|
+
*/
|
|
1302
|
+
export async function grantThreadUserShare(
|
|
1303
|
+
threadId: string,
|
|
1304
|
+
userEmail: string,
|
|
1305
|
+
role: ShareRole,
|
|
1306
|
+
grantedBy: string,
|
|
1307
|
+
): Promise<void> {
|
|
1308
|
+
const normalizedEmail = userEmail.trim().toLowerCase();
|
|
1309
|
+
if (!threadId || !normalizedEmail.includes("@")) return;
|
|
1310
|
+
await ensureTable();
|
|
1311
|
+
const client = getDbExec();
|
|
1312
|
+
const { rows } = await client.execute({
|
|
1313
|
+
sql: `SELECT id, role FROM chat_thread_shares WHERE resource_id = ? AND principal_type = 'user' AND LOWER(principal_id) = ?`,
|
|
1314
|
+
args: [threadId, normalizedEmail],
|
|
1315
|
+
});
|
|
1316
|
+
const existing = rows[0];
|
|
1317
|
+
if (existing) {
|
|
1318
|
+
if (roleSatisfies(existing.role as ShareRole, role)) return;
|
|
1319
|
+
await client.execute({
|
|
1320
|
+
sql: `UPDATE chat_thread_shares SET role = ? WHERE id = ?`,
|
|
1321
|
+
args: [role, existing.id as string],
|
|
1322
|
+
});
|
|
1323
|
+
return;
|
|
1324
|
+
}
|
|
1325
|
+
await client.execute({
|
|
1326
|
+
sql: `INSERT INTO chat_thread_shares (id, resource_id, principal_type, principal_id, role, created_by, created_at) VALUES (?, ?, 'user', ?, ?, ?, ?)`,
|
|
1327
|
+
args: [
|
|
1328
|
+
crypto.randomUUID(),
|
|
1329
|
+
threadId,
|
|
1330
|
+
normalizedEmail,
|
|
1331
|
+
role,
|
|
1332
|
+
grantedBy,
|
|
1333
|
+
new Date().toISOString(),
|
|
1334
|
+
],
|
|
1335
|
+
});
|
|
1336
|
+
}
|
|
1337
|
+
|
|
1293
1338
|
export async function deleteThread(id: string): Promise<boolean> {
|
|
1294
1339
|
await ensureTable();
|
|
1295
1340
|
const client = getDbExec();
|
package/src/checkpoints/index.ts
CHANGED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The framework mount shim normally rewrites `event.path` to the mount-relative
|
|
3
|
+
* remainder ("/restore"), but it falls back to the unstripped request path when
|
|
4
|
+
* `event.url` is read-only on the host runtime. Accept both so a restore POST
|
|
5
|
+
* never silently 405s.
|
|
6
|
+
*/
|
|
7
|
+
export function isCheckpointRestorePath(path: string | undefined): boolean {
|
|
8
|
+
if (!path) return false;
|
|
9
|
+
return (
|
|
10
|
+
/(^|\/)checkpoints\/restore(?:[/?]|$)/.test(path) ||
|
|
11
|
+
/^\/?restore(?:[/?]|$)/.test(path)
|
|
12
|
+
);
|
|
13
|
+
}
|