@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
|
@@ -96,6 +96,7 @@ import { TextStreamingContext } from "./chat/markdown-renderer.js";
|
|
|
96
96
|
import {
|
|
97
97
|
CheckpointContext,
|
|
98
98
|
MessageActionsContext,
|
|
99
|
+
assistantMessageRunId,
|
|
99
100
|
UserMessage,
|
|
100
101
|
AssistantMessage,
|
|
101
102
|
SelectionAttachedPill,
|
|
@@ -364,16 +365,7 @@ function activeRunMatchesThread(
|
|
|
364
365
|
return Boolean(threadId && state?.threadId === threadId && state.runId);
|
|
365
366
|
}
|
|
366
367
|
|
|
367
|
-
export
|
|
368
|
-
const metadata = (message as { metadata?: unknown })?.metadata as
|
|
369
|
-
| { custom?: { runId?: unknown }; runId?: unknown }
|
|
370
|
-
| undefined;
|
|
371
|
-
return typeof metadata?.custom?.runId === "string"
|
|
372
|
-
? metadata.custom.runId
|
|
373
|
-
: typeof metadata?.runId === "string"
|
|
374
|
-
? metadata.runId
|
|
375
|
-
: undefined;
|
|
376
|
-
}
|
|
368
|
+
export { assistantMessageRunId };
|
|
377
369
|
|
|
378
370
|
export function shouldAcceptRunError(args: {
|
|
379
371
|
errorRunId?: string;
|
|
@@ -4945,9 +4937,43 @@ const AssistantChatInner = forwardRef<
|
|
|
4945
4937
|
const chatScrollResetKey = `${tabId ?? ""}:${threadId ?? ""}`;
|
|
4946
4938
|
|
|
4947
4939
|
const { isDevMode: cpDevMode } = useDevMode(apiUrl);
|
|
4940
|
+
const [checkpointRunIds, setCheckpointRunIds] = useState<ReadonlySet<string>>(
|
|
4941
|
+
() => new Set<string>(),
|
|
4942
|
+
);
|
|
4943
|
+
useEffect(() => {
|
|
4944
|
+
if (!cpDevMode || !threadId) {
|
|
4945
|
+
setCheckpointRunIds(new Set<string>());
|
|
4946
|
+
return;
|
|
4947
|
+
}
|
|
4948
|
+
// Refetch once each run settles: the checkpoint for that turn is written
|
|
4949
|
+
// after the run completes, so a list loaded mid-run would miss it.
|
|
4950
|
+
if (isRunning) return;
|
|
4951
|
+
let cancelled = false;
|
|
4952
|
+
void (async () => {
|
|
4953
|
+
try {
|
|
4954
|
+
const res = await fetch(
|
|
4955
|
+
`${apiUrl}/checkpoints?threadId=${encodeURIComponent(threadId)}`,
|
|
4956
|
+
);
|
|
4957
|
+
if (!res.ok) throw new Error(String(res.status));
|
|
4958
|
+
const rows: unknown = await res.json();
|
|
4959
|
+
if (cancelled) return;
|
|
4960
|
+
const runIds = Array.isArray(rows)
|
|
4961
|
+
? rows
|
|
4962
|
+
.map((row) => (row as { runId?: unknown })?.runId)
|
|
4963
|
+
.filter((id): id is string => typeof id === "string" && !!id)
|
|
4964
|
+
: [];
|
|
4965
|
+
setCheckpointRunIds(new Set(runIds));
|
|
4966
|
+
} catch {
|
|
4967
|
+
if (!cancelled) setCheckpointRunIds(new Set<string>());
|
|
4968
|
+
}
|
|
4969
|
+
})();
|
|
4970
|
+
return () => {
|
|
4971
|
+
cancelled = true;
|
|
4972
|
+
};
|
|
4973
|
+
}, [apiUrl, cpDevMode, threadId, isRunning]);
|
|
4948
4974
|
const checkpointCtx = useMemo(
|
|
4949
|
-
() => ({ apiUrl, devMode: cpDevMode, threadId }),
|
|
4950
|
-
[apiUrl, cpDevMode, threadId],
|
|
4975
|
+
() => ({ apiUrl, devMode: cpDevMode, threadId, checkpointRunIds }),
|
|
4976
|
+
[apiUrl, cpDevMode, threadId, checkpointRunIds],
|
|
4951
4977
|
);
|
|
4952
4978
|
const messageActionsCtx = useMemo(() => ({ onForkChat }), [onForkChat]);
|
|
4953
4979
|
const lastMessageLoopLimit = useMemo(() => {
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import {
|
|
2
|
+
IconAlertTriangle,
|
|
2
3
|
IconArrowUpRight,
|
|
3
4
|
IconBook,
|
|
4
5
|
IconCheck,
|
|
@@ -13,6 +14,7 @@ import { sendToAgentChat } from "./agent-chat.js";
|
|
|
13
14
|
import { agentNativePath, appBasePath } from "./api-path.js";
|
|
14
15
|
import { isInBuilderFrame } from "./builder-frame.js";
|
|
15
16
|
import { PromptComposer } from "./composer/index.js";
|
|
17
|
+
import { useBuilderConnectFlow } from "./settings/useBuilderStatus.js";
|
|
16
18
|
import { useDevMode } from "./use-dev-mode.js";
|
|
17
19
|
|
|
18
20
|
export interface VaultSecretOption {
|
|
@@ -72,6 +74,16 @@ function defaultDispatchBasePath(sourceApp?: string): string | null {
|
|
|
72
74
|
return "/dispatch";
|
|
73
75
|
}
|
|
74
76
|
|
|
77
|
+
const ERROR_FAILURE_REASONS = new Set([
|
|
78
|
+
"builder-error",
|
|
79
|
+
"builder-not-connected",
|
|
80
|
+
"credential-store-unavailable",
|
|
81
|
+
]);
|
|
82
|
+
|
|
83
|
+
function isErrorFailureReason(reason: string | null): boolean {
|
|
84
|
+
return !!reason && ERROR_FAILURE_REASONS.has(reason);
|
|
85
|
+
}
|
|
86
|
+
|
|
75
87
|
async function fetchJson(url: string, init?: RequestInit): Promise<any> {
|
|
76
88
|
const res = await fetch(url, init);
|
|
77
89
|
const data = await res.json().catch(() => null);
|
|
@@ -162,6 +174,8 @@ export function NewWorkspaceAppFlow({
|
|
|
162
174
|
const [resourcesError, setResourcesError] = useState<string | null>(null);
|
|
163
175
|
const [statusMessage, setStatusMessage] = useState<string | null>(null);
|
|
164
176
|
const [branchUrl, setBranchUrl] = useState<string | null>(null);
|
|
177
|
+
const [failureReason, setFailureReason] = useState<string | null>(null);
|
|
178
|
+
const [lastSubmittedPrompt, setLastSubmittedPrompt] = useState("");
|
|
165
179
|
const [isSubmitting, setIsSubmitting] = useState(false);
|
|
166
180
|
const { isDevMode } = useDevMode();
|
|
167
181
|
|
|
@@ -170,6 +184,19 @@ export function NewWorkspaceAppFlow({
|
|
|
170
184
|
? defaultDispatchBasePath(sourceApp)
|
|
171
185
|
: dispatchBasePath;
|
|
172
186
|
|
|
187
|
+
// Enabled only while the connect CTA is on screen. Left always-on, the hook
|
|
188
|
+
// would poll Builder status on every mount and fire onConnected on its first
|
|
189
|
+
// status read for anyone already connected.
|
|
190
|
+
const connectFlow = useBuilderConnectFlow({
|
|
191
|
+
enabled: failureReason === "builder-not-connected",
|
|
192
|
+
trackingSource: "new_workspace_app_flow",
|
|
193
|
+
trackingFlow: "create_app",
|
|
194
|
+
onConnected: () => {
|
|
195
|
+
setFailureReason(null);
|
|
196
|
+
setStatusMessage("Builder connected. Press Create app to try again.");
|
|
197
|
+
},
|
|
198
|
+
});
|
|
199
|
+
|
|
173
200
|
useEffect(() => {
|
|
174
201
|
let cancelled = false;
|
|
175
202
|
const secretsUrl = actionUrl(
|
|
@@ -264,9 +291,11 @@ export function NewWorkspaceAppFlow({
|
|
|
264
291
|
selectedResources,
|
|
265
292
|
vaultAccessMode,
|
|
266
293
|
});
|
|
294
|
+
setLastSubmittedPrompt(prompt);
|
|
267
295
|
setIsSubmitting(true);
|
|
268
296
|
setStatusMessage(null);
|
|
269
297
|
setBranchUrl(null);
|
|
298
|
+
setFailureReason(null);
|
|
270
299
|
|
|
271
300
|
try {
|
|
272
301
|
if (isInBuilderFrame()) {
|
|
@@ -297,10 +326,14 @@ export function NewWorkspaceAppFlow({
|
|
|
297
326
|
result?.message ||
|
|
298
327
|
"This requires a code change. Edit locally or use Builder.io to edit this code in the cloud and continue customizing the app any way you like.",
|
|
299
328
|
);
|
|
329
|
+
setFailureReason(
|
|
330
|
+
result?.mode === "builder-unavailable" ? result.reason : null,
|
|
331
|
+
);
|
|
300
332
|
}
|
|
301
333
|
}
|
|
302
334
|
} catch (err: any) {
|
|
303
335
|
setStatusMessage(err?.message || "Could not start the new app flow.");
|
|
336
|
+
setFailureReason(null);
|
|
304
337
|
} finally {
|
|
305
338
|
setIsSubmitting(false);
|
|
306
339
|
}
|
|
@@ -338,17 +371,49 @@ export function NewWorkspaceAppFlow({
|
|
|
338
371
|
/>
|
|
339
372
|
|
|
340
373
|
{statusMessage ? (
|
|
341
|
-
<div
|
|
342
|
-
{
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
374
|
+
<div
|
|
375
|
+
className={`flex flex-col gap-2 rounded-md border px-3 py-2 text-sm ${
|
|
376
|
+
isErrorFailureReason(failureReason)
|
|
377
|
+
? "border-destructive/40 bg-destructive/10 text-destructive"
|
|
378
|
+
: "border-border bg-muted/40 text-muted-foreground"
|
|
379
|
+
}`}
|
|
380
|
+
>
|
|
381
|
+
<div className="flex flex-wrap items-center gap-2">
|
|
382
|
+
{isErrorFailureReason(failureReason) ? (
|
|
383
|
+
<IconAlertTriangle className="h-4 w-4 shrink-0" />
|
|
384
|
+
) : null}
|
|
385
|
+
<span>{statusMessage}</span>
|
|
386
|
+
{branchUrl ? (
|
|
387
|
+
<a
|
|
388
|
+
href={branchUrl}
|
|
389
|
+
target="_blank"
|
|
390
|
+
rel="noreferrer"
|
|
391
|
+
className="inline-flex items-center gap-1 font-medium text-foreground underline"
|
|
392
|
+
>
|
|
393
|
+
Open branch <IconArrowUpRight className="h-3 w-3" />
|
|
394
|
+
</a>
|
|
395
|
+
) : null}
|
|
396
|
+
</div>
|
|
397
|
+
{failureReason === "builder-not-connected" ? (
|
|
398
|
+
<button
|
|
399
|
+
type="button"
|
|
400
|
+
onClick={() => connectFlow.start()}
|
|
401
|
+
disabled={connectFlow.connecting}
|
|
402
|
+
className="inline-flex w-fit cursor-pointer items-center gap-1 rounded-md border border-border bg-background px-2.5 py-1 text-xs font-medium text-foreground hover:bg-accent/40 disabled:cursor-not-allowed disabled:opacity-60"
|
|
403
|
+
>
|
|
404
|
+
{connectFlow.connecting ? "Connecting..." : "Connect Builder"}
|
|
405
|
+
</button>
|
|
406
|
+
) : null}
|
|
407
|
+
{failureReason === "credential-store-unavailable" ||
|
|
408
|
+
failureReason === "builder-error" ? (
|
|
409
|
+
<button
|
|
410
|
+
type="button"
|
|
411
|
+
onClick={() => submit(lastSubmittedPrompt)}
|
|
412
|
+
disabled={isSubmitting}
|
|
413
|
+
className="inline-flex w-fit cursor-pointer items-center gap-1 rounded-md border border-border bg-background px-2.5 py-1 text-xs font-medium text-foreground hover:bg-accent/40 disabled:cursor-not-allowed disabled:opacity-60"
|
|
349
414
|
>
|
|
350
|
-
|
|
351
|
-
</
|
|
415
|
+
Try again
|
|
416
|
+
</button>
|
|
352
417
|
) : null}
|
|
353
418
|
</div>
|
|
354
419
|
) : null}
|
|
@@ -40,6 +40,7 @@ import {
|
|
|
40
40
|
IconStack2,
|
|
41
41
|
IconMessageChatbot,
|
|
42
42
|
IconPencil,
|
|
43
|
+
IconAlertTriangle,
|
|
43
44
|
IconLoader2,
|
|
44
45
|
} from "@tabler/icons-react";
|
|
45
46
|
import React, { useState, useEffect, useCallback, useRef } from "react";
|
|
@@ -284,12 +285,54 @@ export const CheckpointContext = React.createContext<{
|
|
|
284
285
|
apiUrl: string;
|
|
285
286
|
devMode: boolean;
|
|
286
287
|
threadId?: string;
|
|
288
|
+
// Run ids that actually have a saved checkpoint. Restore is only offered for
|
|
289
|
+
// these — auto-checkpointing skips turns that started from a dirty tree or a
|
|
290
|
+
// non-git cwd, and without this the menu item appears on every turn and does
|
|
291
|
+
// nothing when clicked.
|
|
292
|
+
checkpointRunIds?: ReadonlySet<string>;
|
|
287
293
|
} | null>(null);
|
|
288
294
|
|
|
289
295
|
export const MessageActionsContext = React.createContext<{
|
|
290
296
|
onForkChat?: () => void | boolean | Promise<void | boolean>;
|
|
291
297
|
} | null>(null);
|
|
292
298
|
|
|
299
|
+
/**
|
|
300
|
+
* Restore rewrites the working tree, so only offer it when the server actually
|
|
301
|
+
* has a checkpoint for this turn. Auto-checkpointing skips turns that started
|
|
302
|
+
* from a dirty tree or a non-git cwd; gating on Code mode alone put a
|
|
303
|
+
* "Revert to here" item on turns where clicking it could do nothing.
|
|
304
|
+
*/
|
|
305
|
+
export function shouldOfferRestore(args: {
|
|
306
|
+
devMode: boolean | undefined;
|
|
307
|
+
isComplete: boolean;
|
|
308
|
+
isLast: boolean;
|
|
309
|
+
runId: string | undefined;
|
|
310
|
+
checkpointRunIds: ReadonlySet<string> | undefined;
|
|
311
|
+
}): boolean {
|
|
312
|
+
return Boolean(
|
|
313
|
+
args.devMode &&
|
|
314
|
+
args.isComplete &&
|
|
315
|
+
!args.isLast &&
|
|
316
|
+
args.runId &&
|
|
317
|
+
args.checkpointRunIds?.has(args.runId),
|
|
318
|
+
);
|
|
319
|
+
}
|
|
320
|
+
|
|
321
|
+
/**
|
|
322
|
+
* Live yields put the run id at `metadata.custom.runId`; server-persisted
|
|
323
|
+
* messages put it at `metadata.runId`.
|
|
324
|
+
*/
|
|
325
|
+
export function assistantMessageRunId(message: unknown): string | undefined {
|
|
326
|
+
const metadata = (message as { metadata?: unknown })?.metadata as
|
|
327
|
+
| { custom?: { runId?: unknown }; runId?: unknown }
|
|
328
|
+
| undefined;
|
|
329
|
+
return typeof metadata?.custom?.runId === "string"
|
|
330
|
+
? metadata.custom.runId
|
|
331
|
+
: typeof metadata?.runId === "string"
|
|
332
|
+
? metadata.runId
|
|
333
|
+
: undefined;
|
|
334
|
+
}
|
|
335
|
+
|
|
293
336
|
// ─── MessageBranchPicker ──────────────────────────────────────────────────────
|
|
294
337
|
|
|
295
338
|
export function MessageBranchPicker() {
|
|
@@ -557,20 +600,12 @@ export function MessageActionsMenu({
|
|
|
557
600
|
|
|
558
601
|
const handleCopyRequestId = useCallback(() => {
|
|
559
602
|
const m = messageRuntime.getState();
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
}
|
|
565
|
-
| undefined;
|
|
566
|
-
// Live yields put the trace ID at metadata.custom.runId; server-persisted
|
|
567
|
-
// messages put it at metadata.runId. If neither is present (e.g. the run
|
|
568
|
-
// is still in flight and this is the first message), fall back to the
|
|
569
|
-
// active-run state so a hung / mid-stream chat still surfaces a usable
|
|
570
|
-
// trace ID. Last resort is the assistant-ui local message id.
|
|
603
|
+
// If the message carries no run id (e.g. the run is still in flight and
|
|
604
|
+
// this is the first message), fall back to the active-run state so a hung /
|
|
605
|
+
// mid-stream chat still surfaces a usable trace ID. Last resort is the
|
|
606
|
+
// assistant-ui local message id.
|
|
571
607
|
const runId =
|
|
572
|
-
(
|
|
573
|
-
(typeof meta?.runId === "string" && meta.runId) ||
|
|
608
|
+
assistantMessageRunId(m) ||
|
|
574
609
|
(typeof window !== "undefined" ? getActiveRun()?.runId : null) ||
|
|
575
610
|
m.id ||
|
|
576
611
|
"";
|
|
@@ -1013,6 +1048,27 @@ export function shouldShowMissingFinalResponse({
|
|
|
1013
1048
|
);
|
|
1014
1049
|
}
|
|
1015
1050
|
|
|
1051
|
+
/**
|
|
1052
|
+
* "The agent stopped" is derived from local client state, which dips to
|
|
1053
|
+
* not-running at every chunk boundary and transport re-attach while the turn is
|
|
1054
|
+
* still alive server-side. Requiring the shape to hold for a beat keeps the
|
|
1055
|
+
* notice off the screen for those gaps without hiding a real stop for long.
|
|
1056
|
+
*/
|
|
1057
|
+
const MISSING_FINAL_RESPONSE_SETTLE_MS = 3_000;
|
|
1058
|
+
|
|
1059
|
+
export function useSettledFlag(active: boolean, delayMs: number): boolean {
|
|
1060
|
+
const [settled, setSettled] = useState(false);
|
|
1061
|
+
useEffect(() => {
|
|
1062
|
+
if (!active || delayMs <= 0) {
|
|
1063
|
+
setSettled(false);
|
|
1064
|
+
return;
|
|
1065
|
+
}
|
|
1066
|
+
const timer = window.setTimeout(() => setSettled(true), delayMs);
|
|
1067
|
+
return () => window.clearTimeout(timer);
|
|
1068
|
+
}, [active, delayMs]);
|
|
1069
|
+
return active && (delayMs <= 0 || settled);
|
|
1070
|
+
}
|
|
1071
|
+
|
|
1016
1072
|
export function shouldShowAssistantWorkSummary({
|
|
1017
1073
|
isLast,
|
|
1018
1074
|
isComplete,
|
|
@@ -1201,8 +1257,9 @@ function isAssistantToolSummaryPart(
|
|
|
1201
1257
|
|
|
1202
1258
|
export function AssistantMessage() {
|
|
1203
1259
|
const [restoreState, setRestoreState] = useState<
|
|
1204
|
-
"idle" | "confirming" | "restoring"
|
|
1260
|
+
"idle" | "confirming" | "restoring" | "error"
|
|
1205
1261
|
>("idle");
|
|
1262
|
+
const [restoreError, setRestoreError] = useState<string | null>(null);
|
|
1206
1263
|
const messageRuntime = useMessageRuntime();
|
|
1207
1264
|
const thread = useThread();
|
|
1208
1265
|
const chatRunning = React.useContext(ChatRunningContext);
|
|
@@ -1221,13 +1278,16 @@ export function AssistantMessage() {
|
|
|
1221
1278
|
msg.content,
|
|
1222
1279
|
);
|
|
1223
1280
|
const hasCustomUi = assistantMessageHasCustomUi(msg.content);
|
|
1224
|
-
const showMissingFinalResponse =
|
|
1225
|
-
|
|
1226
|
-
|
|
1227
|
-
|
|
1228
|
-
|
|
1229
|
-
|
|
1230
|
-
|
|
1281
|
+
const showMissingFinalResponse = useSettledFlag(
|
|
1282
|
+
shouldShowMissingFinalResponse({
|
|
1283
|
+
isCurrentTurnRunning: isLast && chatRunning,
|
|
1284
|
+
statusIsTerminal,
|
|
1285
|
+
hasAssistantText: responseConnectionText.trim().length > 0,
|
|
1286
|
+
hasUnresolvedTool,
|
|
1287
|
+
hasCompletedCustomUi,
|
|
1288
|
+
}),
|
|
1289
|
+
isLast ? MISSING_FINAL_RESPONSE_SETTLE_MS : 0,
|
|
1290
|
+
);
|
|
1231
1291
|
const responseConnectionContext = userMessageTextBeforeAssistant(
|
|
1232
1292
|
thread.messages,
|
|
1233
1293
|
msg.id,
|
|
@@ -1275,60 +1335,60 @@ export function AssistantMessage() {
|
|
|
1275
1335
|
wasRunningRef.current = chatRunning && isLast;
|
|
1276
1336
|
}, [chatRunning, isComplete, isLast]);
|
|
1277
1337
|
|
|
1338
|
+
const messageRunId = assistantMessageRunId(msg);
|
|
1339
|
+
|
|
1278
1340
|
const handleRestore = useCallback(async () => {
|
|
1279
|
-
if (restoreState === "idle") {
|
|
1341
|
+
if (restoreState === "idle" || restoreState === "error") {
|
|
1342
|
+
setRestoreError(null);
|
|
1280
1343
|
setRestoreState("confirming");
|
|
1281
1344
|
return;
|
|
1282
1345
|
}
|
|
1283
1346
|
if (restoreState !== "confirming" || !cpCtx) return;
|
|
1347
|
+
if (!messageRunId) {
|
|
1348
|
+
setRestoreError("This message has no run to restore to.");
|
|
1349
|
+
setRestoreState("error");
|
|
1350
|
+
return;
|
|
1351
|
+
}
|
|
1284
1352
|
setRestoreState("restoring");
|
|
1285
1353
|
try {
|
|
1286
|
-
const m = messageRuntime.getState();
|
|
1287
|
-
const meta = m.metadata as
|
|
1288
|
-
| { custom?: { runId?: unknown }; runId?: unknown }
|
|
1289
|
-
| undefined;
|
|
1290
|
-
const runId =
|
|
1291
|
-
(typeof meta?.custom?.runId === "string" && meta.custom.runId) ||
|
|
1292
|
-
(typeof meta?.runId === "string" && meta.runId) ||
|
|
1293
|
-
null;
|
|
1294
|
-
if (!runId) {
|
|
1295
|
-
setRestoreState("idle");
|
|
1296
|
-
return;
|
|
1297
|
-
}
|
|
1298
|
-
const tid = cpCtx.threadId || "";
|
|
1299
|
-
const res = await fetch(
|
|
1300
|
-
`${cpCtx.apiUrl}/checkpoints?threadId=${encodeURIComponent(tid)}`,
|
|
1301
|
-
);
|
|
1302
|
-
const checkpoints: unknown[] = res.ok ? await res.json() : [];
|
|
1303
|
-
const checkpoint = checkpoints.find(
|
|
1304
|
-
(cp) => (cp as { runId?: string }).runId === runId,
|
|
1305
|
-
);
|
|
1306
|
-
if (!checkpoint) {
|
|
1307
|
-
setRestoreState("idle");
|
|
1308
|
-
return;
|
|
1309
|
-
}
|
|
1310
1354
|
const restoreRes = await fetch(`${cpCtx.apiUrl}/checkpoints/restore`, {
|
|
1311
1355
|
method: "POST",
|
|
1312
1356
|
headers: { "Content-Type": "application/json" },
|
|
1313
|
-
body: JSON.stringify({
|
|
1314
|
-
checkpointId: (checkpoint as { id?: string }).id,
|
|
1315
|
-
}),
|
|
1357
|
+
body: JSON.stringify({ runId: messageRunId }),
|
|
1316
1358
|
});
|
|
1317
1359
|
if (restoreRes.ok) {
|
|
1318
1360
|
window.location.reload();
|
|
1319
|
-
|
|
1320
|
-
setRestoreState("idle");
|
|
1361
|
+
return;
|
|
1321
1362
|
}
|
|
1322
|
-
|
|
1323
|
-
|
|
1363
|
+
const payload = (await restoreRes.json().catch(() => null)) as {
|
|
1364
|
+
error?: unknown;
|
|
1365
|
+
} | null;
|
|
1366
|
+
setRestoreError(
|
|
1367
|
+
typeof payload?.error === "string"
|
|
1368
|
+
? payload.error
|
|
1369
|
+
: `Restore failed (${restoreRes.status}).`,
|
|
1370
|
+
);
|
|
1371
|
+
setRestoreState("error");
|
|
1372
|
+
} catch (err) {
|
|
1373
|
+
setRestoreError(
|
|
1374
|
+
err instanceof Error ? err.message : "Restore request failed.",
|
|
1375
|
+
);
|
|
1376
|
+
setRestoreState("error");
|
|
1324
1377
|
}
|
|
1325
|
-
}, [restoreState, cpCtx,
|
|
1378
|
+
}, [restoreState, cpCtx, messageRunId]);
|
|
1326
1379
|
|
|
1327
1380
|
const cancelRestore = useCallback(() => {
|
|
1381
|
+
setRestoreError(null);
|
|
1328
1382
|
setRestoreState("idle");
|
|
1329
1383
|
}, []);
|
|
1330
1384
|
|
|
1331
|
-
const showRestore =
|
|
1385
|
+
const showRestore = shouldOfferRestore({
|
|
1386
|
+
devMode: cpCtx?.devMode,
|
|
1387
|
+
isComplete,
|
|
1388
|
+
isLast,
|
|
1389
|
+
runId: messageRunId,
|
|
1390
|
+
checkpointRunIds: cpCtx?.checkpointRunIds,
|
|
1391
|
+
});
|
|
1332
1392
|
|
|
1333
1393
|
// Collect parts for the files-changed summary (code-agent turns only).
|
|
1334
1394
|
const msgContent = msg.content as ContentPart[] | undefined;
|
|
@@ -1497,20 +1557,21 @@ export function AssistantMessage() {
|
|
|
1497
1557
|
<IconLoader2 className="h-3 w-3 animate-spin" />
|
|
1498
1558
|
Restoring...
|
|
1499
1559
|
</span>
|
|
1560
|
+
) : restoreState === "error" ? (
|
|
1561
|
+
<span className="flex items-center gap-1 text-xs text-destructive">
|
|
1562
|
+
<IconAlertTriangle className="h-3 w-3 shrink-0" />
|
|
1563
|
+
<span className="truncate">{restoreError}</span>
|
|
1564
|
+
<button
|
|
1565
|
+
onClick={cancelRestore}
|
|
1566
|
+
className="cursor-pointer rounded-md px-1.5 py-0.5 text-muted-foreground hover:bg-accent"
|
|
1567
|
+
>
|
|
1568
|
+
Dismiss
|
|
1569
|
+
</button>
|
|
1570
|
+
</span>
|
|
1500
1571
|
) : (
|
|
1501
1572
|
<ThumbsFeedback
|
|
1502
1573
|
threadId={cpCtx?.threadId ?? ""}
|
|
1503
|
-
runId={
|
|
1504
|
-
const meta = messageRuntime.getState().metadata as
|
|
1505
|
-
| { custom?: { runId?: unknown }; runId?: unknown }
|
|
1506
|
-
| undefined;
|
|
1507
|
-
return (
|
|
1508
|
-
(typeof meta?.custom?.runId === "string" &&
|
|
1509
|
-
meta.custom.runId) ||
|
|
1510
|
-
(typeof meta?.runId === "string" && meta.runId) ||
|
|
1511
|
-
""
|
|
1512
|
-
);
|
|
1513
|
-
})()}
|
|
1574
|
+
runId={messageRunId ?? ""}
|
|
1514
1575
|
messageSeq={thread.messages.findIndex((m) => m.id === msg.id)}
|
|
1515
1576
|
/>
|
|
1516
1577
|
)}
|
|
@@ -930,13 +930,22 @@ function AgentCallCell({
|
|
|
930
930
|
}) {
|
|
931
931
|
const t = useT();
|
|
932
932
|
const [open, setOpen] = useState(true);
|
|
933
|
-
const
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
|
|
933
|
+
const toolCount = activity?.toolCalls?.length ?? 0;
|
|
934
|
+
// Response segments are ordered against the tool calls that preceded them, so
|
|
935
|
+
// they render in the timeline where the remote agent actually said them.
|
|
936
|
+
// Once the authoritative result text arrives, its segment moves to the
|
|
937
|
+
// bottom block instead of being rendered twice.
|
|
938
|
+
const segments = activity?.response ?? [];
|
|
939
|
+
const inlineSegments =
|
|
940
|
+
responseText && !isRunning ? segments.slice(0, toolCount) : segments;
|
|
941
|
+
const finalText =
|
|
942
|
+
responseText || (inlineSegments.length ? "" : activity?.responseText);
|
|
943
|
+
const work =
|
|
944
|
+
activity?.reasoning?.length || toolCount || inlineSegments.length;
|
|
937
945
|
const workItemCount = Math.max(
|
|
938
946
|
activity?.reasoning?.length ?? 0,
|
|
939
|
-
|
|
947
|
+
toolCount,
|
|
948
|
+
inlineSegments.length,
|
|
940
949
|
);
|
|
941
950
|
const label = isRunning
|
|
942
951
|
? t("agentPanel.delegatedAgent.asking", { name: agentName })
|
|
@@ -947,6 +956,7 @@ function AgentCallCell({
|
|
|
947
956
|
<div className="space-y-1 ps-5">
|
|
948
957
|
{Array.from({ length: workItemCount }, (_, index) => {
|
|
949
958
|
const reasoningText = activity?.reasoning?.[index];
|
|
959
|
+
const segment = inlineSegments[index];
|
|
950
960
|
const tool = activity?.toolCalls?.[index];
|
|
951
961
|
return (
|
|
952
962
|
<React.Fragment key={`activity-${index}`}>
|
|
@@ -962,6 +972,20 @@ function AgentCallCell({
|
|
|
962
972
|
collapseWhenReplaced={index < activity.toolCalls.length}
|
|
963
973
|
/>
|
|
964
974
|
)}
|
|
975
|
+
{segment && (
|
|
976
|
+
<div className="pb-1">
|
|
977
|
+
<SmoothMarkdownText
|
|
978
|
+
text={segment}
|
|
979
|
+
streaming={
|
|
980
|
+
isRunning &&
|
|
981
|
+
activity?.activePhase === "responding" &&
|
|
982
|
+
index === inlineSegments.length - 1
|
|
983
|
+
}
|
|
984
|
+
resetKey={`agent-response-${agentName}-${index}`}
|
|
985
|
+
statusType={isRunning ? "running" : "complete"}
|
|
986
|
+
/>
|
|
987
|
+
</div>
|
|
988
|
+
)}
|
|
965
989
|
{tool && (
|
|
966
990
|
<AgentActivityToolCallRow
|
|
967
991
|
tool={tool}
|
|
@@ -123,6 +123,24 @@ export function normalizeChatError(
|
|
|
123
123
|
const looksHtml = /<html[\s>]|<body[\s>]|<head[\s>]/i.test(raw);
|
|
124
124
|
const text = looksHtml ? htmlToText(raw) : raw.trim();
|
|
125
125
|
|
|
126
|
+
const code = normalizeErrorCode(errorCode);
|
|
127
|
+
|
|
128
|
+
if (code === "builder_model_unauthorized") {
|
|
129
|
+
return {
|
|
130
|
+
message:
|
|
131
|
+
"The provider behind this model rejected the request. Pick a different model, then retry.",
|
|
132
|
+
details: text,
|
|
133
|
+
};
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
if (code === "builder_auth_error") {
|
|
137
|
+
return {
|
|
138
|
+
message:
|
|
139
|
+
"Builder rejected the connected credentials. Reconnect Builder.io in Settings, then retry.",
|
|
140
|
+
details: text,
|
|
141
|
+
};
|
|
142
|
+
}
|
|
143
|
+
|
|
126
144
|
if (isProviderRateLimit(text, errorCode)) {
|
|
127
145
|
return {
|
|
128
146
|
message:
|
|
@@ -64,6 +64,13 @@ export interface OrgSwitcherProps {
|
|
|
64
64
|
hideWhenSingle?: boolean;
|
|
65
65
|
/** Keep the switcher's button height reserved while org state is loading. */
|
|
66
66
|
reserveSpace?: boolean;
|
|
67
|
+
/**
|
|
68
|
+
* Icon-only trigger for collapsed sidebar rails. The popover — and with it
|
|
69
|
+
* the org list, pending invitations and "Join your team" — is identical;
|
|
70
|
+
* dropping the switcher instead leaves a collapsed rail with no way to
|
|
71
|
+
* reach another workspace.
|
|
72
|
+
*/
|
|
73
|
+
compact?: boolean;
|
|
67
74
|
/**
|
|
68
75
|
* Path to navigate to when the user clicks "Organization settings".
|
|
69
76
|
* Defaults to the Organization tab inside Settings. Templates with an
|
|
@@ -104,6 +111,9 @@ const APP_SUBMENU_CONTENT_CLASS =
|
|
|
104
111
|
const SWITCHER_BUTTON_CLASS =
|
|
105
112
|
"flex w-full items-center gap-2 rounded-md border-0 bg-accent/50 px-2.5 py-1.5 text-xs font-medium text-muted-foreground hover:bg-accent/70 hover:text-foreground focus:outline-none focus-visible:ring-2 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-60 cursor-pointer";
|
|
106
113
|
|
|
114
|
+
const COMPACT_SWITCHER_BUTTON_CLASS =
|
|
115
|
+
"flex items-center justify-center rounded-md border-0 bg-accent/50 p-1.5 text-muted-foreground hover:bg-accent/70 hover:text-foreground focus:outline-none focus-visible:ring-2 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-60 cursor-pointer";
|
|
116
|
+
|
|
107
117
|
const DEFAULT_ORGANIZATION_SETTINGS_PATH = "/settings#organization";
|
|
108
118
|
const DEFAULT_PROFILE_PATH = "/settings#account";
|
|
109
119
|
|
|
@@ -295,6 +305,7 @@ export function OrgSwitcher({
|
|
|
295
305
|
className,
|
|
296
306
|
hideWhenSingle,
|
|
297
307
|
reserveSpace,
|
|
308
|
+
compact,
|
|
298
309
|
settingsPath = DEFAULT_ORGANIZATION_SETTINGS_PATH,
|
|
299
310
|
profilePath = DEFAULT_PROFILE_PATH,
|
|
300
311
|
}: OrgSwitcherProps) {
|
|
@@ -380,14 +391,25 @@ export function OrgSwitcher({
|
|
|
380
391
|
return (
|
|
381
392
|
<PopoverPrimitive.Root open={open} onOpenChange={handleOpenChange}>
|
|
382
393
|
<PopoverPrimitive.Trigger asChild>
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
394
|
+
{compact ? (
|
|
395
|
+
<button
|
|
396
|
+
type="button"
|
|
397
|
+
title={buttonLabel}
|
|
398
|
+
aria-label={buttonLabel}
|
|
399
|
+
className={`${COMPACT_SWITCHER_BUTTON_CLASS} ${className ?? ""}`}
|
|
400
|
+
>
|
|
401
|
+
<ButtonIcon className="h-3.5 w-3.5 shrink-0" />
|
|
402
|
+
</button>
|
|
403
|
+
) : (
|
|
404
|
+
<button
|
|
405
|
+
type="button"
|
|
406
|
+
className={`${SWITCHER_BUTTON_CLASS} ${className ?? ""}`}
|
|
407
|
+
>
|
|
408
|
+
<ButtonIcon className="h-3.5 w-3.5 shrink-0" />
|
|
409
|
+
<span className="truncate flex-1 text-start">{buttonLabel}</span>
|
|
410
|
+
<IconSelector className="h-3 w-3 shrink-0 opacity-50" />
|
|
411
|
+
</button>
|
|
412
|
+
)}
|
|
391
413
|
</PopoverPrimitive.Trigger>
|
|
392
414
|
<PopoverPrimitive.Portal>
|
|
393
415
|
<PopoverPrimitive.Content
|
|
@@ -1513,13 +1513,14 @@ export function TeamPage({
|
|
|
1513
1513
|
{!isLoading && (
|
|
1514
1514
|
<>
|
|
1515
1515
|
<PendingInvitationsCard />
|
|
1516
|
+
{/* Sitting in a personal workspace still counts as having an org, so
|
|
1517
|
+
gating this on `!org?.orgId` hid the only in-page way to reach the
|
|
1518
|
+
company workspace from the people who most needed it. */}
|
|
1519
|
+
{org?.domainMatches && org.domainMatches.length > 0 && (
|
|
1520
|
+
<JoinByDomainCard matches={org.domainMatches} />
|
|
1521
|
+
)}
|
|
1516
1522
|
{!org?.orgId ? (
|
|
1517
|
-
|
|
1518
|
-
{org?.domainMatches && org.domainMatches.length > 0 && (
|
|
1519
|
-
<JoinByDomainCard matches={org.domainMatches} />
|
|
1520
|
-
)}
|
|
1521
|
-
<CreateOrgCard description={createOrgDescription} />
|
|
1522
|
-
</>
|
|
1523
|
+
<CreateOrgCard description={createOrgDescription} />
|
|
1523
1524
|
) : (
|
|
1524
1525
|
<MembersCard />
|
|
1525
1526
|
)}
|