@agent-native/core 0.121.1 → 0.122.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/corpus/README.md +2 -2
- package/corpus/core/CHANGELOG.md +145 -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/getting-started.mdx +477 -115
- 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/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/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/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/default/.agents/skills/upgrade-agent-native/SKILL.md +24 -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 +5 -0
- 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/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/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/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/assets/.agents/skills/upgrade-agent-native/SKILL.md +24 -2
- package/corpus/templates/brain/.agents/skills/upgrade-agent-native/SKILL.md +24 -2
- package/corpus/templates/brain/_gitignore +1 -0
- package/corpus/templates/calendar/.agents/skills/upgrade-agent-native/SKILL.md +24 -2
- package/corpus/templates/calendar/_gitignore +1 -0
- package/corpus/templates/chat/.agents/skills/upgrade-agent-native/SKILL.md +24 -2
- package/corpus/templates/chat/_gitignore +1 -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/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/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.meetings.$meetingId.tsx +27 -0
- package/corpus/templates/clips/app/routes/r.$recordingId.tsx +46 -15
- package/corpus/templates/clips/app/routes/record.tsx +77 -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/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 +25 -0
- package/corpus/templates/clips/server/lib/agent-views.ts +145 -0
- 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/db.ts +23 -0
- 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/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/dispatch/.agents/skills/upgrade-agent-native/SKILL.md +24 -2
- package/corpus/templates/dispatch/_gitignore +1 -0
- package/corpus/templates/dispatch/changelog/2026-07-24-signing-in-now-puts-you-in-your-companys-workspace.md +6 -0
- package/corpus/templates/forms/.agents/skills/upgrade-agent-native/SKILL.md +24 -2
- package/corpus/templates/forms/_gitignore +1 -0
- package/corpus/templates/forms/server/lib/public-form-ssr.ts +2 -2
- package/corpus/templates/macros/.agents/skills/upgrade-agent-native/SKILL.md +24 -2
- package/corpus/templates/macros/_gitignore +1 -0
- package/corpus/templates/mail/.agents/skills/upgrade-agent-native/SKILL.md +24 -2
- package/corpus/templates/mail/_gitignore +1 -0
- package/corpus/templates/plan/.agents/skills/upgrade-agent-native/SKILL.md +24 -2
- package/corpus/templates/plan/_gitignore +1 -0
- package/corpus/templates/slides/.agents/skills/upgrade-agent-native/SKILL.md +24 -2
- package/corpus/templates/slides/_gitignore +1 -0
- 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/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/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/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/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 +3 -3
- 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/resources/handlers.d.ts +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/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/default/.agents/skills/upgrade-agent-native/SKILL.md +24 -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 +2 -0
- 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/getting-started.mdx +477 -115
- 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/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/sse-event-processor.ts +3 -0
- package/src/data-widgets/index.ts +41 -0
- package/src/deploy/build.ts +11 -9
- 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/default/.agents/skills/upgrade-agent-native/SKILL.md +24 -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 +5 -0
|
@@ -104,10 +104,39 @@ export declare function resolveHasCompleteBuilderConnection(): Promise<boolean>;
|
|
|
104
104
|
* status UIs don't report a mixed user/org credential set as connected.
|
|
105
105
|
*/
|
|
106
106
|
export declare function resolveBuilderCredentialSource(): Promise<BuilderCredentialSource | null>;
|
|
107
|
+
export interface BuilderCredentialsDetailed {
|
|
108
|
+
privateKey: string | null;
|
|
109
|
+
publicKey: string | null;
|
|
110
|
+
userId: string | null;
|
|
111
|
+
orgName: string | null;
|
|
112
|
+
orgKind: string | null;
|
|
113
|
+
subscription: string | null;
|
|
114
|
+
subscriptionLevel: string | null;
|
|
115
|
+
subscriptionName: string | null;
|
|
116
|
+
isEnterprise: boolean | null;
|
|
117
|
+
isFreeAccount: boolean | null;
|
|
118
|
+
/** Which scope answered, or null when nothing did. */
|
|
119
|
+
source: BuilderCredentialSource | null;
|
|
120
|
+
/**
|
|
121
|
+
* True when reading the credential store itself failed (db timeout, etc).
|
|
122
|
+
* Callers must report this as retryable rather than "not configured".
|
|
123
|
+
*/
|
|
124
|
+
lookupFailed: boolean;
|
|
125
|
+
}
|
|
126
|
+
/**
|
|
127
|
+
* Resolve the Builder assistant credential bundle from one complete scope,
|
|
128
|
+
* plus where it came from and whether the credential-store read itself
|
|
129
|
+
* failed. A partial user row is treated as a miss so the org-shared
|
|
130
|
+
* connection can still power the assistant for teammates.
|
|
131
|
+
*
|
|
132
|
+
* Callers that only need the plain credential bundle (the historical shape)
|
|
133
|
+
* should use `resolveBuilderCredentials()` instead.
|
|
134
|
+
*/
|
|
135
|
+
export declare function resolveBuilderCredentialsDetailed(): Promise<BuilderCredentialsDetailed>;
|
|
107
136
|
/**
|
|
108
137
|
* Resolve the Builder assistant credential bundle from one complete scope.
|
|
109
|
-
*
|
|
110
|
-
*
|
|
138
|
+
* Kept to its original return shape (no `source`/`lookupFailed`) for existing
|
|
139
|
+
* callers; use `resolveBuilderCredentialsDetailed()` for those fields.
|
|
111
140
|
*/
|
|
112
141
|
export declare function resolveBuilderCredentials(): Promise<{
|
|
113
142
|
privateKey: string | null;
|
|
@@ -121,6 +150,13 @@ export declare function resolveBuilderCredentials(): Promise<{
|
|
|
121
150
|
isEnterprise: boolean | null;
|
|
122
151
|
isFreeAccount: boolean | null;
|
|
123
152
|
}>;
|
|
153
|
+
/**
|
|
154
|
+
* Stale markers expire so a rejected model or a transient gateway failure
|
|
155
|
+
* cannot pin a signed-in user to "Builder not connected" forever. Only a
|
|
156
|
+
* successful gateway call clears the marker early, and that call never happens
|
|
157
|
+
* while the marker is what makes the connection look broken.
|
|
158
|
+
*/
|
|
159
|
+
export declare const BUILDER_AUTH_FAILURE_TTL_MS: number;
|
|
124
160
|
export interface BuilderCredentialAuthFailure {
|
|
125
161
|
fingerprint: string;
|
|
126
162
|
message: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"credential-provider.d.ts","sourceRoot":"","sources":["../../src/server/credential-provider.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAOH;;;;;;;;GAQ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AgB,qBAAqB,IAAI,MAAM,CAO9C;AAED;;;;GAIG;AACH,wBAAgB,wBAAwB,IAAI,MAAM,CAKjD;AAED;;;GAGG;AACH,wBAAgB,gCAAgC,IAAI,MAAM,CAKzD;AAED;;;GAGG;AACH,wBAAgB,0BAA0B,IAAI,MAAM,CAKnD;AAED,uEAAuE;AACvE,wBAAgB,oBAAoB,IAAI,MAAM,GAAG,IAAI,CAGpD"}
|
|
@@ -212,6 +212,21 @@ async function readBuilderCredentialScope(readAppSecrets, scope, scopeId) {
|
|
|
212
212
|
source: scope === "workspace" ? "workspace" : scope,
|
|
213
213
|
};
|
|
214
214
|
}
|
|
215
|
+
/**
|
|
216
|
+
* A transient org_members read failure makes getOrgContext report no org, which
|
|
217
|
+
* would otherwise hide an org-scoped Builder connection behind a permanent-
|
|
218
|
+
* sounding "not configured" error. resolveOrgIdForEmail honors an explicit
|
|
219
|
+
* Personal selection, so this cannot promote a user into an org they left.
|
|
220
|
+
*/
|
|
221
|
+
async function resolveOrgIdForRequestEmail(email) {
|
|
222
|
+
try {
|
|
223
|
+
const { resolveOrgIdForEmail } = await import("../org/context.js");
|
|
224
|
+
return await resolveOrgIdForEmail(email);
|
|
225
|
+
}
|
|
226
|
+
catch {
|
|
227
|
+
return null;
|
|
228
|
+
}
|
|
229
|
+
}
|
|
215
230
|
async function resolveScopedBuilderCredential(key) {
|
|
216
231
|
const email = getRequestUserEmail();
|
|
217
232
|
if (!email)
|
|
@@ -235,12 +250,20 @@ async function resolveScopedBuilderCredential(key) {
|
|
|
235
250
|
}
|
|
236
251
|
return { value: userSecret.value, source: "user" };
|
|
237
252
|
}
|
|
253
|
+
let orgId = getRequestOrgId();
|
|
254
|
+
let orgSource = orgId
|
|
255
|
+
? "request"
|
|
256
|
+
: "none";
|
|
257
|
+
if (!orgId) {
|
|
258
|
+
orgId = await resolveOrgIdForRequestEmail(email);
|
|
259
|
+
if (orgId)
|
|
260
|
+
orgSource = "email-fallback";
|
|
261
|
+
}
|
|
238
262
|
// 2. Per-org shared credential: when one teammate connects Builder
|
|
239
263
|
// as an owner/admin we write the OAuth result at org scope so
|
|
240
264
|
// every member of that org gets the AI chat working without
|
|
241
265
|
// re-running the connect flow. Resolution falls back here
|
|
242
266
|
// silently — the caller never has to know which scope answered.
|
|
243
|
-
const orgId = getRequestOrgId();
|
|
244
267
|
if (orgId) {
|
|
245
268
|
scopeAttempted = "org";
|
|
246
269
|
const orgSecret = await readAppSecret({
|
|
@@ -250,7 +273,7 @@ async function resolveScopedBuilderCredential(key) {
|
|
|
250
273
|
});
|
|
251
274
|
if (orgSecret) {
|
|
252
275
|
if (traceLookup) {
|
|
253
|
-
console.log(`[builder-credential] key=${key} email=${email} orgId=${orgId} scope=org hit=true`);
|
|
276
|
+
console.log(`[builder-credential] key=${key} email=${email} orgId=${orgId} orgSource=${orgSource} scope=org hit=true`);
|
|
254
277
|
}
|
|
255
278
|
return { value: orgSecret.value, source: "org" };
|
|
256
279
|
}
|
|
@@ -265,30 +288,32 @@ async function resolveScopedBuilderCredential(key) {
|
|
|
265
288
|
});
|
|
266
289
|
if (workspaceSecret) {
|
|
267
290
|
if (traceLookup) {
|
|
268
|
-
console.log(`[builder-credential] key=${key} email=${email} orgId=${orgId} scope=workspace hit=true`);
|
|
291
|
+
console.log(`[builder-credential] key=${key} email=${email} orgId=${orgId} orgSource=${orgSource} scope=workspace hit=true`);
|
|
269
292
|
}
|
|
270
293
|
return { value: workspaceSecret.value, source: "workspace" };
|
|
271
294
|
}
|
|
272
295
|
if (traceLookup) {
|
|
273
|
-
console.log(`[builder-credential] key=${key} email=${email} orgId=${orgId} miss tried=user,org,workspace`);
|
|
296
|
+
console.log(`[builder-credential] key=${key} email=${email} orgId=${orgId} orgSource=${orgSource} miss tried=user,org,workspace`);
|
|
274
297
|
}
|
|
275
298
|
}
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
return { value: soloWorkspaceSecret.value, source: "workspace" };
|
|
288
|
-
}
|
|
299
|
+
// 3. Solo-workspace fallback: always checked, even when an org id was
|
|
300
|
+
// found above. Older no-org connect flows wrote here, so a credential
|
|
301
|
+
// written before the user joined/created an org must not become
|
|
302
|
+
// unreachable once that org exists.
|
|
303
|
+
scopeAttempted = "workspace-solo";
|
|
304
|
+
const soloWorkspaceSecret = await readAppSecret({
|
|
305
|
+
key,
|
|
306
|
+
scope: "workspace",
|
|
307
|
+
scopeId: `solo:${email}`,
|
|
308
|
+
});
|
|
309
|
+
if (soloWorkspaceSecret) {
|
|
289
310
|
if (traceLookup) {
|
|
290
|
-
console.log(`[builder-credential] key=${key} email=${email} orgId
|
|
311
|
+
console.log(`[builder-credential] key=${key} email=${email} orgId=${orgId ?? "(none)"} orgSource=${orgSource} scope=workspace-solo hit=true`);
|
|
291
312
|
}
|
|
313
|
+
return { value: soloWorkspaceSecret.value, source: "workspace" };
|
|
314
|
+
}
|
|
315
|
+
if (traceLookup) {
|
|
316
|
+
console.log(`[builder-credential] key=${key} email=${email} orgId=${orgId ?? "(none)"} orgSource=${orgSource} miss tried=${orgId ? "user,org,workspace,workspace-solo" : "user,workspace-solo"}`);
|
|
292
317
|
}
|
|
293
318
|
}
|
|
294
319
|
catch (err) {
|
|
@@ -302,48 +327,62 @@ async function resolveScopedBuilderCredential(key) {
|
|
|
302
327
|
async function resolveScopedBuilderCredentials() {
|
|
303
328
|
const email = getRequestUserEmail();
|
|
304
329
|
if (!email)
|
|
305
|
-
return null;
|
|
330
|
+
return { creds: null, lookupFailed: false };
|
|
306
331
|
const traceLookup = shouldTraceCredentialResolve();
|
|
307
332
|
let scopeAttempted = "user";
|
|
308
333
|
try {
|
|
309
334
|
const { readAppSecrets } = await import("../secrets/storage.js");
|
|
310
|
-
const traceScope = (creds, scopeId) => {
|
|
335
|
+
const traceScope = (creds, scopeId, extra = "") => {
|
|
311
336
|
if (!traceLookup)
|
|
312
337
|
return;
|
|
313
|
-
console.log(`[builder-credential] scope=${creds.source} scopeId=${scopeId} email=${email} complete=${isCompleteBuilderConnection(creds)} private=${Boolean(creds.privateKey)} public=${Boolean(creds.publicKey)}`);
|
|
338
|
+
console.log(`[builder-credential] scope=${creds.source} scopeId=${scopeId} email=${email}${extra} complete=${isCompleteBuilderConnection(creds)} private=${Boolean(creds.privateKey)} public=${Boolean(creds.publicKey)}`);
|
|
314
339
|
};
|
|
315
340
|
const userCreds = await readBuilderCredentialScope(readAppSecrets, "user", email);
|
|
316
341
|
traceScope(userCreds, email);
|
|
317
|
-
if (isCompleteBuilderConnection(userCreds))
|
|
318
|
-
return userCreds;
|
|
319
|
-
|
|
342
|
+
if (isCompleteBuilderConnection(userCreds)) {
|
|
343
|
+
return { creds: userCreds, lookupFailed: false };
|
|
344
|
+
}
|
|
345
|
+
let orgId = getRequestOrgId();
|
|
346
|
+
let orgSource = orgId
|
|
347
|
+
? "request"
|
|
348
|
+
: "none";
|
|
349
|
+
if (!orgId) {
|
|
350
|
+
orgId = await resolveOrgIdForRequestEmail(email);
|
|
351
|
+
if (orgId)
|
|
352
|
+
orgSource = "email-fallback";
|
|
353
|
+
}
|
|
320
354
|
if (orgId) {
|
|
321
355
|
scopeAttempted = "org";
|
|
322
356
|
const orgCreds = await readBuilderCredentialScope(readAppSecrets, "org", orgId);
|
|
323
|
-
traceScope(orgCreds, orgId);
|
|
324
|
-
if (isCompleteBuilderConnection(orgCreds))
|
|
325
|
-
return orgCreds;
|
|
357
|
+
traceScope(orgCreds, orgId, ` orgSource=${orgSource}`);
|
|
358
|
+
if (isCompleteBuilderConnection(orgCreds)) {
|
|
359
|
+
return { creds: orgCreds, lookupFailed: false };
|
|
360
|
+
}
|
|
326
361
|
scopeAttempted = "workspace";
|
|
327
362
|
const workspaceCreds = await readBuilderCredentialScope(readAppSecrets, "workspace", orgId);
|
|
328
|
-
traceScope(workspaceCreds, orgId);
|
|
329
|
-
if (isCompleteBuilderConnection(workspaceCreds))
|
|
330
|
-
return workspaceCreds;
|
|
363
|
+
traceScope(workspaceCreds, orgId, ` orgSource=${orgSource}`);
|
|
364
|
+
if (isCompleteBuilderConnection(workspaceCreds)) {
|
|
365
|
+
return { creds: workspaceCreds, lookupFailed: false };
|
|
366
|
+
}
|
|
331
367
|
}
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
368
|
+
// Solo-workspace fallback: always checked, even when an org id was found
|
|
369
|
+
// above. See resolveScopedBuilderCredential for why this must not be
|
|
370
|
+
// gated behind "no org".
|
|
371
|
+
scopeAttempted = "workspace-solo";
|
|
372
|
+
const soloScopeId = `solo:${email}`;
|
|
373
|
+
const soloCreds = await readBuilderCredentialScope(readAppSecrets, "workspace", soloScopeId);
|
|
374
|
+
traceScope(soloCreds, soloScopeId, ` orgId=${orgId ?? "(none)"} orgSource=${orgSource}`);
|
|
375
|
+
if (isCompleteBuilderConnection(soloCreds)) {
|
|
376
|
+
return { creds: soloCreds, lookupFailed: false };
|
|
339
377
|
}
|
|
340
378
|
}
|
|
341
379
|
catch (err) {
|
|
342
380
|
if (traceLookup) {
|
|
343
381
|
console.log(`[builder-credential] email=${email} scope=${scopeAttempted} credentials error=${err?.message ?? err}`);
|
|
344
382
|
}
|
|
383
|
+
return { creds: null, lookupFailed: true };
|
|
345
384
|
}
|
|
346
|
-
return null;
|
|
385
|
+
return { creds: null, lookupFailed: false };
|
|
347
386
|
}
|
|
348
387
|
/**
|
|
349
388
|
* Resolve a Builder credential for the current request. User/org credentials
|
|
@@ -402,23 +441,22 @@ export async function resolveHasCompleteBuilderConnection() {
|
|
|
402
441
|
* status UIs don't report a mixed user/org credential set as connected.
|
|
403
442
|
*/
|
|
404
443
|
export async function resolveBuilderCredentialSource() {
|
|
405
|
-
const
|
|
406
|
-
|
|
407
|
-
return scoped.source;
|
|
408
|
-
return canUseBuilderDeployCredentialFallbackForRequest() &&
|
|
409
|
-
process.env.BUILDER_PRIVATE_KEY
|
|
410
|
-
? "env"
|
|
411
|
-
: null;
|
|
444
|
+
const detailed = await resolveBuilderCredentialsDetailed();
|
|
445
|
+
return detailed.source;
|
|
412
446
|
}
|
|
413
447
|
/**
|
|
414
|
-
* Resolve the Builder assistant credential bundle from one complete scope
|
|
415
|
-
*
|
|
416
|
-
*
|
|
448
|
+
* Resolve the Builder assistant credential bundle from one complete scope,
|
|
449
|
+
* plus where it came from and whether the credential-store read itself
|
|
450
|
+
* failed. A partial user row is treated as a miss so the org-shared
|
|
451
|
+
* connection can still power the assistant for teammates.
|
|
452
|
+
*
|
|
453
|
+
* Callers that only need the plain credential bundle (the historical shape)
|
|
454
|
+
* should use `resolveBuilderCredentials()` instead.
|
|
417
455
|
*/
|
|
418
|
-
export async function
|
|
419
|
-
const scoped = await resolveScopedBuilderCredentials();
|
|
456
|
+
export async function resolveBuilderCredentialsDetailed() {
|
|
457
|
+
const { creds: scoped, lookupFailed } = await resolveScopedBuilderCredentials();
|
|
420
458
|
if (scoped) {
|
|
421
|
-
const { privateKey, publicKey, userId, orgName, orgKind, subscription, subscriptionLevel, subscriptionName, isEnterprise, isFreeAccount, } = scoped;
|
|
459
|
+
const { privateKey, publicKey, userId, orgName, orgKind, subscription, subscriptionLevel, subscriptionName, isEnterprise, isFreeAccount, source, } = scoped;
|
|
422
460
|
return {
|
|
423
461
|
privateKey,
|
|
424
462
|
publicKey,
|
|
@@ -430,38 +468,63 @@ export async function resolveBuilderCredentials() {
|
|
|
430
468
|
subscriptionName,
|
|
431
469
|
isEnterprise,
|
|
432
470
|
isFreeAccount,
|
|
471
|
+
source,
|
|
472
|
+
lookupFailed: false,
|
|
433
473
|
};
|
|
434
474
|
}
|
|
435
|
-
const
|
|
475
|
+
const canUseEnv = canUseBuilderDeployCredentialFallbackForRequest();
|
|
476
|
+
const privateKey = canUseEnv
|
|
436
477
|
? (readDeployCredentialEnv("BUILDER_PRIVATE_KEY") ?? null)
|
|
437
478
|
: null;
|
|
438
|
-
const publicKey =
|
|
479
|
+
const publicKey = canUseEnv
|
|
439
480
|
? (readDeployCredentialEnv("BUILDER_PUBLIC_KEY") ?? null)
|
|
440
481
|
: null;
|
|
441
|
-
const userId =
|
|
482
|
+
const userId = canUseEnv
|
|
442
483
|
? (readDeployCredentialEnv("BUILDER_USER_ID") ?? null)
|
|
443
484
|
: null;
|
|
444
|
-
const orgName =
|
|
485
|
+
const orgName = canUseEnv
|
|
445
486
|
? (readDeployCredentialEnv("BUILDER_ORG_NAME") ?? null)
|
|
446
487
|
: null;
|
|
447
|
-
const orgKind =
|
|
488
|
+
const orgKind = canUseEnv
|
|
448
489
|
? (readDeployCredentialEnv("BUILDER_ORG_KIND") ?? null)
|
|
449
490
|
: null;
|
|
450
|
-
const subscription =
|
|
491
|
+
const subscription = canUseEnv
|
|
451
492
|
? (readDeployCredentialEnv("BUILDER_SUBSCRIPTION") ?? null)
|
|
452
493
|
: null;
|
|
453
|
-
const subscriptionLevel =
|
|
494
|
+
const subscriptionLevel = canUseEnv
|
|
454
495
|
? (readDeployCredentialEnv("BUILDER_SUBSCRIPTION_LEVEL") ?? null)
|
|
455
496
|
: null;
|
|
456
|
-
const subscriptionName =
|
|
497
|
+
const subscriptionName = canUseEnv
|
|
457
498
|
? (readDeployCredentialEnv("BUILDER_SUBSCRIPTION_NAME") ?? null)
|
|
458
499
|
: null;
|
|
459
|
-
const isEnterprise =
|
|
500
|
+
const isEnterprise = canUseEnv
|
|
460
501
|
? readOptionalBuilderBoolean(readDeployCredentialEnv("BUILDER_IS_ENTERPRISE"))
|
|
461
502
|
: null;
|
|
462
|
-
const isFreeAccount =
|
|
503
|
+
const isFreeAccount = canUseEnv
|
|
463
504
|
? readOptionalBuilderBoolean(readDeployCredentialEnv("BUILDER_IS_FREE_ACCOUNT"))
|
|
464
505
|
: null;
|
|
506
|
+
return {
|
|
507
|
+
privateKey,
|
|
508
|
+
publicKey,
|
|
509
|
+
userId,
|
|
510
|
+
orgName,
|
|
511
|
+
orgKind,
|
|
512
|
+
subscription,
|
|
513
|
+
subscriptionLevel,
|
|
514
|
+
subscriptionName,
|
|
515
|
+
isEnterprise,
|
|
516
|
+
isFreeAccount,
|
|
517
|
+
source: canUseEnv && privateKey ? "env" : null,
|
|
518
|
+
lookupFailed,
|
|
519
|
+
};
|
|
520
|
+
}
|
|
521
|
+
/**
|
|
522
|
+
* Resolve the Builder assistant credential bundle from one complete scope.
|
|
523
|
+
* Kept to its original return shape (no `source`/`lookupFailed`) for existing
|
|
524
|
+
* callers; use `resolveBuilderCredentialsDetailed()` for those fields.
|
|
525
|
+
*/
|
|
526
|
+
export async function resolveBuilderCredentials() {
|
|
527
|
+
const { privateKey, publicKey, userId, orgName, orgKind, subscription, subscriptionLevel, subscriptionName, isEnterprise, isFreeAccount, } = await resolveBuilderCredentialsDetailed();
|
|
465
528
|
return {
|
|
466
529
|
privateKey,
|
|
467
530
|
publicKey,
|
|
@@ -476,6 +539,13 @@ export async function resolveBuilderCredentials() {
|
|
|
476
539
|
};
|
|
477
540
|
}
|
|
478
541
|
const BUILDER_AUTH_FAILURE_SETTING_PREFIX = "builder-auth-failure:";
|
|
542
|
+
/**
|
|
543
|
+
* Stale markers expire so a rejected model or a transient gateway failure
|
|
544
|
+
* cannot pin a signed-in user to "Builder not connected" forever. Only a
|
|
545
|
+
* successful gateway call clears the marker early, and that call never happens
|
|
546
|
+
* while the marker is what makes the connection look broken.
|
|
547
|
+
*/
|
|
548
|
+
export const BUILDER_AUTH_FAILURE_TTL_MS = 15 * 60 * 1000;
|
|
479
549
|
export function builderCredentialFingerprint(privateKey, publicKey) {
|
|
480
550
|
if (!privateKey || !publicKey)
|
|
481
551
|
return null;
|
|
@@ -494,10 +564,18 @@ export async function getBuilderCredentialAuthFailure(creds = {}) {
|
|
|
494
564
|
if (!fingerprint)
|
|
495
565
|
return null;
|
|
496
566
|
try {
|
|
497
|
-
const
|
|
498
|
-
const
|
|
567
|
+
const settings = await import("../settings/store.js");
|
|
568
|
+
const settingKey = builderAuthFailureSettingKey(fingerprint);
|
|
569
|
+
const row = await settings.getSetting(settingKey);
|
|
499
570
|
if (!row)
|
|
500
571
|
return null;
|
|
572
|
+
const at = typeof row.at === "number" ? row.at : Date.now();
|
|
573
|
+
if (Date.now() - at > BUILDER_AUTH_FAILURE_TTL_MS) {
|
|
574
|
+
if (typeof settings.deleteSetting === "function") {
|
|
575
|
+
await settings.deleteSetting(settingKey).catch(() => { });
|
|
576
|
+
}
|
|
577
|
+
return null;
|
|
578
|
+
}
|
|
501
579
|
return {
|
|
502
580
|
fingerprint,
|
|
503
581
|
message: typeof row.message === "string" && row.message
|
|
@@ -505,7 +583,7 @@ export async function getBuilderCredentialAuthFailure(creds = {}) {
|
|
|
505
583
|
: "Builder rejected the connected credentials. Reconnect Builder.io.",
|
|
506
584
|
status: typeof row.status === "number" ? row.status : undefined,
|
|
507
585
|
code: typeof row.code === "string" ? row.code : undefined,
|
|
508
|
-
at
|
|
586
|
+
at,
|
|
509
587
|
ownerEmail: typeof row.ownerEmail === "string" ? row.ownerEmail : undefined,
|
|
510
588
|
orgId: typeof row.orgId === "string" ? row.orgId : undefined,
|
|
511
589
|
};
|