@agent-native/core 0.121.2 → 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 +139 -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/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/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/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/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
|
@@ -288,6 +288,23 @@ async function readBuilderCredentialScope(
|
|
|
288
288
|
};
|
|
289
289
|
}
|
|
290
290
|
|
|
291
|
+
/**
|
|
292
|
+
* A transient org_members read failure makes getOrgContext report no org, which
|
|
293
|
+
* would otherwise hide an org-scoped Builder connection behind a permanent-
|
|
294
|
+
* sounding "not configured" error. resolveOrgIdForEmail honors an explicit
|
|
295
|
+
* Personal selection, so this cannot promote a user into an org they left.
|
|
296
|
+
*/
|
|
297
|
+
async function resolveOrgIdForRequestEmail(
|
|
298
|
+
email: string,
|
|
299
|
+
): Promise<string | null> {
|
|
300
|
+
try {
|
|
301
|
+
const { resolveOrgIdForEmail } = await import("../org/context.js");
|
|
302
|
+
return await resolveOrgIdForEmail(email);
|
|
303
|
+
} catch {
|
|
304
|
+
return null;
|
|
305
|
+
}
|
|
306
|
+
}
|
|
307
|
+
|
|
291
308
|
async function resolveScopedBuilderCredential(
|
|
292
309
|
key: string,
|
|
293
310
|
): Promise<{ value: string; source: "user" | "org" | "workspace" } | null> {
|
|
@@ -317,12 +334,20 @@ async function resolveScopedBuilderCredential(
|
|
|
317
334
|
return { value: userSecret.value, source: "user" };
|
|
318
335
|
}
|
|
319
336
|
|
|
337
|
+
let orgId: string | null | undefined = getRequestOrgId();
|
|
338
|
+
let orgSource: "request" | "email-fallback" | "none" = orgId
|
|
339
|
+
? "request"
|
|
340
|
+
: "none";
|
|
341
|
+
if (!orgId) {
|
|
342
|
+
orgId = await resolveOrgIdForRequestEmail(email);
|
|
343
|
+
if (orgId) orgSource = "email-fallback";
|
|
344
|
+
}
|
|
345
|
+
|
|
320
346
|
// 2. Per-org shared credential: when one teammate connects Builder
|
|
321
347
|
// as an owner/admin we write the OAuth result at org scope so
|
|
322
348
|
// every member of that org gets the AI chat working without
|
|
323
349
|
// re-running the connect flow. Resolution falls back here
|
|
324
350
|
// silently — the caller never has to know which scope answered.
|
|
325
|
-
const orgId = getRequestOrgId();
|
|
326
351
|
if (orgId) {
|
|
327
352
|
scopeAttempted = "org";
|
|
328
353
|
const orgSecret = await readAppSecret({
|
|
@@ -333,7 +358,7 @@ async function resolveScopedBuilderCredential(
|
|
|
333
358
|
if (orgSecret) {
|
|
334
359
|
if (traceLookup) {
|
|
335
360
|
console.log(
|
|
336
|
-
`[builder-credential] key=${key} email=${email} orgId=${orgId} scope=org hit=true`,
|
|
361
|
+
`[builder-credential] key=${key} email=${email} orgId=${orgId} orgSource=${orgSource} scope=org hit=true`,
|
|
337
362
|
);
|
|
338
363
|
}
|
|
339
364
|
return { value: orgSecret.value, source: "org" };
|
|
@@ -351,36 +376,40 @@ async function resolveScopedBuilderCredential(
|
|
|
351
376
|
if (workspaceSecret) {
|
|
352
377
|
if (traceLookup) {
|
|
353
378
|
console.log(
|
|
354
|
-
`[builder-credential] key=${key} email=${email} orgId=${orgId} scope=workspace hit=true`,
|
|
379
|
+
`[builder-credential] key=${key} email=${email} orgId=${orgId} orgSource=${orgSource} scope=workspace hit=true`,
|
|
355
380
|
);
|
|
356
381
|
}
|
|
357
382
|
return { value: workspaceSecret.value, source: "workspace" };
|
|
358
383
|
}
|
|
359
384
|
if (traceLookup) {
|
|
360
385
|
console.log(
|
|
361
|
-
`[builder-credential] key=${key} email=${email} orgId=${orgId} miss tried=user,org,workspace`,
|
|
386
|
+
`[builder-credential] key=${key} email=${email} orgId=${orgId} orgSource=${orgSource} miss tried=user,org,workspace`,
|
|
362
387
|
);
|
|
363
388
|
}
|
|
364
|
-
}
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
return { value: soloWorkspaceSecret.value, source: "workspace" };
|
|
378
|
-
}
|
|
389
|
+
}
|
|
390
|
+
|
|
391
|
+
// 3. Solo-workspace fallback: always checked, even when an org id was
|
|
392
|
+
// found above. Older no-org connect flows wrote here, so a credential
|
|
393
|
+
// written before the user joined/created an org must not become
|
|
394
|
+
// unreachable once that org exists.
|
|
395
|
+
scopeAttempted = "workspace-solo";
|
|
396
|
+
const soloWorkspaceSecret = await readAppSecret({
|
|
397
|
+
key,
|
|
398
|
+
scope: "workspace",
|
|
399
|
+
scopeId: `solo:${email}`,
|
|
400
|
+
});
|
|
401
|
+
if (soloWorkspaceSecret) {
|
|
379
402
|
if (traceLookup) {
|
|
380
403
|
console.log(
|
|
381
|
-
`[builder-credential] key=${key} email=${email} orgId
|
|
404
|
+
`[builder-credential] key=${key} email=${email} orgId=${orgId ?? "(none)"} orgSource=${orgSource} scope=workspace-solo hit=true`,
|
|
382
405
|
);
|
|
383
406
|
}
|
|
407
|
+
return { value: soloWorkspaceSecret.value, source: "workspace" };
|
|
408
|
+
}
|
|
409
|
+
if (traceLookup) {
|
|
410
|
+
console.log(
|
|
411
|
+
`[builder-credential] key=${key} email=${email} orgId=${orgId ?? "(none)"} orgSource=${orgSource} miss tried=${orgId ? "user,org,workspace,workspace-solo" : "user,workspace-solo"}`,
|
|
412
|
+
);
|
|
384
413
|
}
|
|
385
414
|
} catch (err) {
|
|
386
415
|
if (traceLookup) {
|
|
@@ -393,18 +422,32 @@ async function resolveScopedBuilderCredential(
|
|
|
393
422
|
return null;
|
|
394
423
|
}
|
|
395
424
|
|
|
396
|
-
|
|
425
|
+
interface ScopedBuilderCredentialsResult {
|
|
426
|
+
creds: BuilderResolvedCredentials | null;
|
|
427
|
+
/**
|
|
428
|
+
* True when reading the credential store itself threw (db timeout, etc),
|
|
429
|
+
* as opposed to the store answering cleanly with "no row". Callers must
|
|
430
|
+
* report this as retryable rather than "not configured".
|
|
431
|
+
*/
|
|
432
|
+
lookupFailed: boolean;
|
|
433
|
+
}
|
|
434
|
+
|
|
435
|
+
async function resolveScopedBuilderCredentials(): Promise<ScopedBuilderCredentialsResult> {
|
|
397
436
|
const email = getRequestUserEmail();
|
|
398
|
-
if (!email) return null;
|
|
437
|
+
if (!email) return { creds: null, lookupFailed: false };
|
|
399
438
|
|
|
400
439
|
const traceLookup = shouldTraceCredentialResolve();
|
|
401
440
|
let scopeAttempted = "user";
|
|
402
441
|
try {
|
|
403
442
|
const { readAppSecrets } = await import("../secrets/storage.js");
|
|
404
|
-
const traceScope = (
|
|
443
|
+
const traceScope = (
|
|
444
|
+
creds: BuilderResolvedCredentials,
|
|
445
|
+
scopeId: string,
|
|
446
|
+
extra = "",
|
|
447
|
+
) => {
|
|
405
448
|
if (!traceLookup) return;
|
|
406
449
|
console.log(
|
|
407
|
-
`[builder-credential] scope=${creds.source} scopeId=${scopeId} email=${email} complete=${isCompleteBuilderConnection(creds)} private=${Boolean(creds.privateKey)} public=${Boolean(creds.publicKey)}`,
|
|
450
|
+
`[builder-credential] scope=${creds.source} scopeId=${scopeId} email=${email}${extra} complete=${isCompleteBuilderConnection(creds)} private=${Boolean(creds.privateKey)} public=${Boolean(creds.publicKey)}`,
|
|
408
451
|
);
|
|
409
452
|
};
|
|
410
453
|
|
|
@@ -414,9 +457,19 @@ async function resolveScopedBuilderCredentials(): Promise<BuilderResolvedCredent
|
|
|
414
457
|
email,
|
|
415
458
|
);
|
|
416
459
|
traceScope(userCreds, email);
|
|
417
|
-
if (isCompleteBuilderConnection(userCreds))
|
|
460
|
+
if (isCompleteBuilderConnection(userCreds)) {
|
|
461
|
+
return { creds: userCreds, lookupFailed: false };
|
|
462
|
+
}
|
|
463
|
+
|
|
464
|
+
let orgId: string | null | undefined = getRequestOrgId();
|
|
465
|
+
let orgSource: "request" | "email-fallback" | "none" = orgId
|
|
466
|
+
? "request"
|
|
467
|
+
: "none";
|
|
468
|
+
if (!orgId) {
|
|
469
|
+
orgId = await resolveOrgIdForRequestEmail(email);
|
|
470
|
+
if (orgId) orgSource = "email-fallback";
|
|
471
|
+
}
|
|
418
472
|
|
|
419
|
-
const orgId = getRequestOrgId();
|
|
420
473
|
if (orgId) {
|
|
421
474
|
scopeAttempted = "org";
|
|
422
475
|
const orgCreds = await readBuilderCredentialScope(
|
|
@@ -424,8 +477,10 @@ async function resolveScopedBuilderCredentials(): Promise<BuilderResolvedCredent
|
|
|
424
477
|
"org",
|
|
425
478
|
orgId,
|
|
426
479
|
);
|
|
427
|
-
traceScope(orgCreds, orgId);
|
|
428
|
-
if (isCompleteBuilderConnection(orgCreds))
|
|
480
|
+
traceScope(orgCreds, orgId, ` orgSource=${orgSource}`);
|
|
481
|
+
if (isCompleteBuilderConnection(orgCreds)) {
|
|
482
|
+
return { creds: orgCreds, lookupFailed: false };
|
|
483
|
+
}
|
|
429
484
|
|
|
430
485
|
scopeAttempted = "workspace";
|
|
431
486
|
const workspaceCreds = await readBuilderCredentialScope(
|
|
@@ -433,18 +488,29 @@ async function resolveScopedBuilderCredentials(): Promise<BuilderResolvedCredent
|
|
|
433
488
|
"workspace",
|
|
434
489
|
orgId,
|
|
435
490
|
);
|
|
436
|
-
traceScope(workspaceCreds, orgId);
|
|
437
|
-
if (isCompleteBuilderConnection(workspaceCreds))
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
491
|
+
traceScope(workspaceCreds, orgId, ` orgSource=${orgSource}`);
|
|
492
|
+
if (isCompleteBuilderConnection(workspaceCreds)) {
|
|
493
|
+
return { creds: workspaceCreds, lookupFailed: false };
|
|
494
|
+
}
|
|
495
|
+
}
|
|
496
|
+
|
|
497
|
+
// Solo-workspace fallback: always checked, even when an org id was found
|
|
498
|
+
// above. See resolveScopedBuilderCredential for why this must not be
|
|
499
|
+
// gated behind "no org".
|
|
500
|
+
scopeAttempted = "workspace-solo";
|
|
501
|
+
const soloScopeId = `solo:${email}`;
|
|
502
|
+
const soloCreds = await readBuilderCredentialScope(
|
|
503
|
+
readAppSecrets,
|
|
504
|
+
"workspace",
|
|
505
|
+
soloScopeId,
|
|
506
|
+
);
|
|
507
|
+
traceScope(
|
|
508
|
+
soloCreds,
|
|
509
|
+
soloScopeId,
|
|
510
|
+
` orgId=${orgId ?? "(none)"} orgSource=${orgSource}`,
|
|
511
|
+
);
|
|
512
|
+
if (isCompleteBuilderConnection(soloCreds)) {
|
|
513
|
+
return { creds: soloCreds, lookupFailed: false };
|
|
448
514
|
}
|
|
449
515
|
} catch (err) {
|
|
450
516
|
if (traceLookup) {
|
|
@@ -452,8 +518,9 @@ async function resolveScopedBuilderCredentials(): Promise<BuilderResolvedCredent
|
|
|
452
518
|
`[builder-credential] email=${email} scope=${scopeAttempted} credentials error=${(err as Error)?.message ?? err}`,
|
|
453
519
|
);
|
|
454
520
|
}
|
|
521
|
+
return { creds: null, lookupFailed: true };
|
|
455
522
|
}
|
|
456
|
-
return null;
|
|
523
|
+
return { creds: null, lookupFailed: false };
|
|
457
524
|
}
|
|
458
525
|
|
|
459
526
|
/**
|
|
@@ -519,20 +586,11 @@ export async function resolveHasCompleteBuilderConnection(): Promise<boolean> {
|
|
|
519
586
|
* status UIs don't report a mixed user/org credential set as connected.
|
|
520
587
|
*/
|
|
521
588
|
export async function resolveBuilderCredentialSource(): Promise<BuilderCredentialSource | null> {
|
|
522
|
-
const
|
|
523
|
-
|
|
524
|
-
return canUseBuilderDeployCredentialFallbackForRequest() &&
|
|
525
|
-
process.env.BUILDER_PRIVATE_KEY
|
|
526
|
-
? "env"
|
|
527
|
-
: null;
|
|
589
|
+
const detailed = await resolveBuilderCredentialsDetailed();
|
|
590
|
+
return detailed.source;
|
|
528
591
|
}
|
|
529
592
|
|
|
530
|
-
|
|
531
|
-
* Resolve the Builder assistant credential bundle from one complete scope.
|
|
532
|
-
* A partial user row is treated as a miss so the org-shared connection can
|
|
533
|
-
* still power the assistant for teammates.
|
|
534
|
-
*/
|
|
535
|
-
export async function resolveBuilderCredentials(): Promise<{
|
|
593
|
+
export interface BuilderCredentialsDetailed {
|
|
536
594
|
privateKey: string | null;
|
|
537
595
|
publicKey: string | null;
|
|
538
596
|
userId: string | null;
|
|
@@ -543,8 +601,27 @@ export async function resolveBuilderCredentials(): Promise<{
|
|
|
543
601
|
subscriptionName: string | null;
|
|
544
602
|
isEnterprise: boolean | null;
|
|
545
603
|
isFreeAccount: boolean | null;
|
|
546
|
-
|
|
547
|
-
|
|
604
|
+
/** Which scope answered, or null when nothing did. */
|
|
605
|
+
source: BuilderCredentialSource | null;
|
|
606
|
+
/**
|
|
607
|
+
* True when reading the credential store itself failed (db timeout, etc).
|
|
608
|
+
* Callers must report this as retryable rather than "not configured".
|
|
609
|
+
*/
|
|
610
|
+
lookupFailed: boolean;
|
|
611
|
+
}
|
|
612
|
+
|
|
613
|
+
/**
|
|
614
|
+
* Resolve the Builder assistant credential bundle from one complete scope,
|
|
615
|
+
* plus where it came from and whether the credential-store read itself
|
|
616
|
+
* failed. A partial user row is treated as a miss so the org-shared
|
|
617
|
+
* connection can still power the assistant for teammates.
|
|
618
|
+
*
|
|
619
|
+
* Callers that only need the plain credential bundle (the historical shape)
|
|
620
|
+
* should use `resolveBuilderCredentials()` instead.
|
|
621
|
+
*/
|
|
622
|
+
export async function resolveBuilderCredentialsDetailed(): Promise<BuilderCredentialsDetailed> {
|
|
623
|
+
const { creds: scoped, lookupFailed } =
|
|
624
|
+
await resolveScopedBuilderCredentials();
|
|
548
625
|
if (scoped) {
|
|
549
626
|
const {
|
|
550
627
|
privateKey,
|
|
@@ -557,6 +634,7 @@ export async function resolveBuilderCredentials(): Promise<{
|
|
|
557
634
|
subscriptionName,
|
|
558
635
|
isEnterprise,
|
|
559
636
|
isFreeAccount,
|
|
637
|
+
source,
|
|
560
638
|
} = scoped;
|
|
561
639
|
return {
|
|
562
640
|
privateKey,
|
|
@@ -569,42 +647,90 @@ export async function resolveBuilderCredentials(): Promise<{
|
|
|
569
647
|
subscriptionName,
|
|
570
648
|
isEnterprise,
|
|
571
649
|
isFreeAccount,
|
|
650
|
+
source,
|
|
651
|
+
lookupFailed: false,
|
|
572
652
|
};
|
|
573
653
|
}
|
|
574
|
-
const
|
|
654
|
+
const canUseEnv = canUseBuilderDeployCredentialFallbackForRequest();
|
|
655
|
+
const privateKey = canUseEnv
|
|
575
656
|
? (readDeployCredentialEnv("BUILDER_PRIVATE_KEY") ?? null)
|
|
576
657
|
: null;
|
|
577
|
-
const publicKey =
|
|
658
|
+
const publicKey = canUseEnv
|
|
578
659
|
? (readDeployCredentialEnv("BUILDER_PUBLIC_KEY") ?? null)
|
|
579
660
|
: null;
|
|
580
|
-
const userId =
|
|
661
|
+
const userId = canUseEnv
|
|
581
662
|
? (readDeployCredentialEnv("BUILDER_USER_ID") ?? null)
|
|
582
663
|
: null;
|
|
583
|
-
const orgName =
|
|
664
|
+
const orgName = canUseEnv
|
|
584
665
|
? (readDeployCredentialEnv("BUILDER_ORG_NAME") ?? null)
|
|
585
666
|
: null;
|
|
586
|
-
const orgKind =
|
|
667
|
+
const orgKind = canUseEnv
|
|
587
668
|
? (readDeployCredentialEnv("BUILDER_ORG_KIND") ?? null)
|
|
588
669
|
: null;
|
|
589
|
-
const subscription =
|
|
670
|
+
const subscription = canUseEnv
|
|
590
671
|
? (readDeployCredentialEnv("BUILDER_SUBSCRIPTION") ?? null)
|
|
591
672
|
: null;
|
|
592
|
-
const subscriptionLevel =
|
|
673
|
+
const subscriptionLevel = canUseEnv
|
|
593
674
|
? (readDeployCredentialEnv("BUILDER_SUBSCRIPTION_LEVEL") ?? null)
|
|
594
675
|
: null;
|
|
595
|
-
const subscriptionName =
|
|
676
|
+
const subscriptionName = canUseEnv
|
|
596
677
|
? (readDeployCredentialEnv("BUILDER_SUBSCRIPTION_NAME") ?? null)
|
|
597
678
|
: null;
|
|
598
|
-
const isEnterprise =
|
|
679
|
+
const isEnterprise = canUseEnv
|
|
599
680
|
? readOptionalBuilderBoolean(
|
|
600
681
|
readDeployCredentialEnv("BUILDER_IS_ENTERPRISE"),
|
|
601
682
|
)
|
|
602
683
|
: null;
|
|
603
|
-
const isFreeAccount =
|
|
684
|
+
const isFreeAccount = canUseEnv
|
|
604
685
|
? readOptionalBuilderBoolean(
|
|
605
686
|
readDeployCredentialEnv("BUILDER_IS_FREE_ACCOUNT"),
|
|
606
687
|
)
|
|
607
688
|
: null;
|
|
689
|
+
return {
|
|
690
|
+
privateKey,
|
|
691
|
+
publicKey,
|
|
692
|
+
userId,
|
|
693
|
+
orgName,
|
|
694
|
+
orgKind,
|
|
695
|
+
subscription,
|
|
696
|
+
subscriptionLevel,
|
|
697
|
+
subscriptionName,
|
|
698
|
+
isEnterprise,
|
|
699
|
+
isFreeAccount,
|
|
700
|
+
source: canUseEnv && privateKey ? "env" : null,
|
|
701
|
+
lookupFailed,
|
|
702
|
+
};
|
|
703
|
+
}
|
|
704
|
+
|
|
705
|
+
/**
|
|
706
|
+
* Resolve the Builder assistant credential bundle from one complete scope.
|
|
707
|
+
* Kept to its original return shape (no `source`/`lookupFailed`) for existing
|
|
708
|
+
* callers; use `resolveBuilderCredentialsDetailed()` for those fields.
|
|
709
|
+
*/
|
|
710
|
+
export async function resolveBuilderCredentials(): Promise<{
|
|
711
|
+
privateKey: string | null;
|
|
712
|
+
publicKey: string | null;
|
|
713
|
+
userId: string | null;
|
|
714
|
+
orgName: string | null;
|
|
715
|
+
orgKind: string | null;
|
|
716
|
+
subscription: string | null;
|
|
717
|
+
subscriptionLevel: string | null;
|
|
718
|
+
subscriptionName: string | null;
|
|
719
|
+
isEnterprise: boolean | null;
|
|
720
|
+
isFreeAccount: boolean | null;
|
|
721
|
+
}> {
|
|
722
|
+
const {
|
|
723
|
+
privateKey,
|
|
724
|
+
publicKey,
|
|
725
|
+
userId,
|
|
726
|
+
orgName,
|
|
727
|
+
orgKind,
|
|
728
|
+
subscription,
|
|
729
|
+
subscriptionLevel,
|
|
730
|
+
subscriptionName,
|
|
731
|
+
isEnterprise,
|
|
732
|
+
isFreeAccount,
|
|
733
|
+
} = await resolveBuilderCredentialsDetailed();
|
|
608
734
|
return {
|
|
609
735
|
privateKey,
|
|
610
736
|
publicKey,
|
|
@@ -620,6 +746,13 @@ export async function resolveBuilderCredentials(): Promise<{
|
|
|
620
746
|
}
|
|
621
747
|
|
|
622
748
|
const BUILDER_AUTH_FAILURE_SETTING_PREFIX = "builder-auth-failure:";
|
|
749
|
+
/**
|
|
750
|
+
* Stale markers expire so a rejected model or a transient gateway failure
|
|
751
|
+
* cannot pin a signed-in user to "Builder not connected" forever. Only a
|
|
752
|
+
* successful gateway call clears the marker early, and that call never happens
|
|
753
|
+
* while the marker is what makes the connection look broken.
|
|
754
|
+
*/
|
|
755
|
+
export const BUILDER_AUTH_FAILURE_TTL_MS = 15 * 60 * 1000;
|
|
623
756
|
|
|
624
757
|
export interface BuilderCredentialAuthFailure {
|
|
625
758
|
fingerprint: string;
|
|
@@ -660,9 +793,17 @@ export async function getBuilderCredentialAuthFailure(
|
|
|
660
793
|
);
|
|
661
794
|
if (!fingerprint) return null;
|
|
662
795
|
try {
|
|
663
|
-
const
|
|
664
|
-
const
|
|
796
|
+
const settings = await import("../settings/store.js");
|
|
797
|
+
const settingKey = builderAuthFailureSettingKey(fingerprint);
|
|
798
|
+
const row = await settings.getSetting(settingKey);
|
|
665
799
|
if (!row) return null;
|
|
800
|
+
const at = typeof row.at === "number" ? row.at : Date.now();
|
|
801
|
+
if (Date.now() - at > BUILDER_AUTH_FAILURE_TTL_MS) {
|
|
802
|
+
if (typeof settings.deleteSetting === "function") {
|
|
803
|
+
await settings.deleteSetting(settingKey).catch(() => {});
|
|
804
|
+
}
|
|
805
|
+
return null;
|
|
806
|
+
}
|
|
666
807
|
return {
|
|
667
808
|
fingerprint,
|
|
668
809
|
message:
|
|
@@ -671,7 +812,7 @@ export async function getBuilderCredentialAuthFailure(
|
|
|
671
812
|
: "Builder rejected the connected credentials. Reconnect Builder.io.",
|
|
672
813
|
status: typeof row.status === "number" ? row.status : undefined,
|
|
673
814
|
code: typeof row.code === "string" ? row.code : undefined,
|
|
674
|
-
at
|
|
815
|
+
at,
|
|
675
816
|
ownerEmail:
|
|
676
817
|
typeof row.ownerEmail === "string" ? row.ownerEmail : undefined,
|
|
677
818
|
orgId: typeof row.orgId === "string" ? row.orgId : undefined,
|
|
@@ -472,11 +472,14 @@ export {
|
|
|
472
472
|
resolveHasBuilderPrivateKey,
|
|
473
473
|
resolveHasCompleteBuilderConnection,
|
|
474
474
|
resolveBuilderCredentials,
|
|
475
|
+
resolveBuilderCredentialsDetailed,
|
|
476
|
+
resolveBuilderCredentialSource,
|
|
475
477
|
resolveBuilderCredential,
|
|
476
478
|
readDeployCredentialEnv,
|
|
477
479
|
writeBuilderCredentials,
|
|
478
480
|
deleteBuilderCredentials,
|
|
479
481
|
resolveSecret,
|
|
482
|
+
type BuilderCredentialsDetailed,
|
|
480
483
|
} from "./credential-provider.js";
|
|
481
484
|
export {
|
|
482
485
|
builderDesignSystemUrl,
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Compact framework core instructions (FRAMEWORK_CORE_COMPACT).
|
|
3
3
|
* Used in lazy-context mode (lazyContext: true — the default).
|
|
4
4
|
*
|
|
5
|
-
* Shares rules 8–
|
|
5
|
+
* Shares rules 8–9, 12–13 with the full variant via shared-rules.ts.
|
|
6
6
|
* The compact version omits:
|
|
7
7
|
* - Verbose "Extended Capabilities" section (agent uses get-framework-context)
|
|
8
8
|
* - Detailed "Parallel Tool Calls" prose (replaced with one-liner)
|
|
@@ -17,7 +17,6 @@ import {
|
|
|
17
17
|
import {
|
|
18
18
|
sharedRule8,
|
|
19
19
|
SHARED_RULE_9,
|
|
20
|
-
SHARED_RULE_10,
|
|
21
20
|
SHARED_RULE_14,
|
|
22
21
|
SHARED_RULE_15,
|
|
23
22
|
type PromptExamples,
|
|
@@ -71,18 +70,16 @@ Bring a senior engineer's judgment, arrived at through attention not premature c
|
|
|
71
70
|
|
|
72
71
|
1. **Data lives in SQL** — ${dataRule}
|
|
73
72
|
2. **Context awareness** — The user's current screen state is in \`<current-screen>\`, current URL in \`<current-url>\`. Use both to understand what the user is looking at. To change URL state, use \`set-search-params\` or \`set-url-path\`.
|
|
74
|
-
3. **Navigate the UI** —
|
|
73
|
+
3. **Navigate the UI** — On "show me", "go to", "open", or similar, use \`navigate\` first, then fetch/display data.
|
|
75
74
|
4. **Application state** — Ephemeral UI state lives in \`application_state\`. Use \`readAppState\`/\`writeAppState\`.
|
|
76
75
|
5. **Screen refresh is automatic** — The framework auto-refreshes after mutating tool calls. Only call \`refresh-screen\` when you mutated data via a path the framework can't detect.
|
|
77
76
|
6. **Memory** — Use \`save-memory\` proactively when you learn preferences, corrections, or project context.
|
|
78
77
|
7. **Security** — ${securityRule}
|
|
79
78
|
${sharedRule8(examples, options)}
|
|
80
79
|
${SHARED_RULE_9}
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
11. **
|
|
84
|
-
12. **Find tools when unsure** — Use \`tool-search\` to find the exact action/tool for a capability. It searches the live registry, including connected MCP server tools.
|
|
85
|
-
13. **Relative dates use runtime context** — The \`<runtime-context>\` block gives the authoritative current date/time. Resolve "today", "yesterday", "last week", and similar phrases to explicit calendar dates before querying data or creating artifacts.
|
|
80
|
+
**Native widgets** — For table/chart/graph/report requests, prefer actions labeled \`Native chat widget\`; use \`render-data-widget\` for already-summarized data (≤50 rows) instead of markdown tables. Above that, give the total plus the top rows — never retype a full result set as widget arguments.
|
|
81
|
+
10. **Find tools when unsure** — Use \`tool-search\` to find the exact action/tool for a capability. It searches the live registry, including connected MCP server tools.
|
|
82
|
+
11. **Relative dates use runtime context** — The \`<runtime-context>\` block gives the authoritative current date/time. Resolve "today", "yesterday", "last week", and similar phrases to explicit calendar dates before querying data or creating artifacts.
|
|
86
83
|
${SHARED_RULE_14}
|
|
87
84
|
${SHARED_RULE_15}
|
|
88
85
|
|
|
@@ -92,13 +89,9 @@ Use the \`resources\` tool for persistent notes and context files: \`action: "li
|
|
|
92
89
|
Resources have three levels: workspace defaults inherited from Dispatch, shared organization/app overrides, and personal overrides. Use \`resources\` with \`action: "effective"\` before editing when you need to explain or inspect which level is active for a path.
|
|
93
90
|
Workspace resources are user-facing by default. If you need temporary working files, write them as agent scratch (\`visibility: "agent_scratch"\`); scratch is hidden from the Workspace view by default and expires. Use \`visibility: "workspace"\` only when the user explicitly asked to save/manage that file, or for durable AGENTS.md, LEARNINGS.md, memory, skills, jobs, or custom agents.
|
|
94
91
|
|
|
95
|
-
### Navigation Rule
|
|
96
|
-
|
|
97
|
-
When the user says "show me", "go to", "open", etc., ALWAYS use \`navigate\` first.
|
|
98
|
-
|
|
99
92
|
### Extended Capabilities
|
|
100
93
|
|
|
101
|
-
You also have tools for
|
|
94
|
+
You also have tools for inline embeds, chat history search (\`chat-history\`), recurring jobs (\`manage-jobs\`), structured memory (\`save-memory\`/\`delete-memory\`), and browser automation (\`activate-browser\` in production, \`set-browser-control\` locally). Call \`get-framework-context\` with the matching key — it lists its own topics — for full instructions when needed.
|
|
102
95
|
|
|
103
96
|
**Agent teams:** default to doing the work yourself. Delegate ONE sub-agent (\`agent-teams\` action "spawn") for self-contained heavy work; fan out to several only for genuinely independent units; never parallelize tightly-coupled work; cap fan-out around 3. Treat "background agent", "sub-agent", "parallel", "batch", "kick off", "run the rest", and "queued items" as delegation intent when the user is asking you to start or continue independent work items. After \`spawn\`, say the task started/running, not completed; use \`status\`/\`read-result\` before claiming the delegated work is done. Give each sub-agent a self-contained brief (objective, the specific context/IDs it needs, output format, boundaries) — it can't see this thread — then read all results and synthesize one integrated answer. Full details: \`get-framework-context\` key \`agent-teams\`.
|
|
104
97
|
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Full framework core instructions (FRAMEWORK_CORE).
|
|
3
3
|
* Used in the verbose prompt variant (lazyContext: false).
|
|
4
4
|
*
|
|
5
|
-
* Shared rules (8-
|
|
5
|
+
* Shared rules (8-9, 12-13) are imported from shared-rules.ts so the
|
|
6
6
|
* compact variant uses the same text and the two can never drift.
|
|
7
7
|
*/
|
|
8
8
|
|
|
@@ -14,7 +14,6 @@ import {
|
|
|
14
14
|
import {
|
|
15
15
|
sharedRule8,
|
|
16
16
|
SHARED_RULE_9,
|
|
17
|
-
SHARED_RULE_10,
|
|
18
17
|
SHARED_RULE_14,
|
|
19
18
|
SHARED_RULE_15,
|
|
20
19
|
type PromptExamples,
|
|
@@ -94,18 +93,16 @@ Scale response length to the task: a small change or lookup warrants 2–5 sente
|
|
|
94
93
|
|
|
95
94
|
1. **Data lives in SQL** — ${dataRule}
|
|
96
95
|
2. **Context awareness** — The user's current screen state is automatically included in each message as a \`<current-screen>\` block, and the current URL (path + search params) as a \`<current-url>\` block. Use both to understand what the user is looking at — filters, search terms, and other URL-driven state live in \`<current-url>\`'s \`searchParams\`, NOT in the settings table. To change URL state (e.g. toggle a filter, clear a query string), use the \`set-search-params\` or \`set-url-path\` tools — never try to edit URL state by writing to settings or application_state directly.
|
|
97
|
-
3. **Navigate the UI** —
|
|
96
|
+
3. **Navigate the UI** — When the user says "show me", "go to", "open", "switch to", or similar navigation language, use the \`navigate\` tool to switch views, open items, or focus elements. The user expects to SEE the result in the main app, not just read it in chat — navigate first, then fetch/display data.
|
|
98
97
|
4. **Application state** — Ephemeral UI state (drafts, selections, navigation) lives in \`application_state\`. Use \`readAppState\`/\`writeAppState\` to read and write it. When you write state, the UI updates automatically.
|
|
99
98
|
${refreshRule}
|
|
100
99
|
6. **Memory** — Use the structured memory system to persist knowledge across sessions. Use \`save-memory\` proactively when you learn preferences, corrections, or project context. Update shared AGENTS.md for instructions that should apply to all users.
|
|
101
100
|
${securityRule}
|
|
102
101
|
${sharedRule8(examples, options)}
|
|
103
102
|
${SHARED_RULE_9}
|
|
104
|
-
|
|
105
|
-
**
|
|
106
|
-
11. **
|
|
107
|
-
12. **Find tools when unsure** — Use \`tool-search\` to find the exact action/tool for a capability. It searches the live registry, including connected MCP server tools added through config, settings, or the MCP hub.
|
|
108
|
-
13. **Relative dates use runtime context** — The \`<runtime-context>\` block gives the authoritative current date/time. Resolve "today", "yesterday", "last week", and similar phrases to explicit calendar dates before querying data or creating artifacts. When answering factual questions, include the exact date or date range you used.
|
|
103
|
+
**Native chat widgets** — When an available action says it renders a native widget such as \`data-table\`, \`data-chart\`, or \`data-insights\`, call that action for user requests asking for a table, chart, graph, trend, report, or inline data view. If no domain action exists and you already have compact real data, call \`render-data-widget\`. Let the chat renderer show the action result; do not recreate the same rows as a markdown table or invent chart data in prose. Add only a short human summary or next-step link around the widget. Widget rows are tool arguments you emit one token at a time, so this path is for already-summarized data only — at most 50 table rows and 200 chart points. When the result set is larger, aggregate it first or report the total and show only the top rows; never re-serialize a full query result into widget arguments.
|
|
104
|
+
10. **Find tools when unsure** — Use \`tool-search\` to find the exact action/tool for a capability. It searches the live registry, including connected MCP server tools added through config, settings, or the MCP hub.
|
|
105
|
+
11. **Relative dates use runtime context** — The \`<runtime-context>\` block gives the authoritative current date/time. Resolve "today", "yesterday", "last week", and similar phrases to explicit calendar dates before querying data or creating artifacts. When answering factual questions, include the exact date or date range you used.
|
|
109
106
|
${SHARED_RULE_14}
|
|
110
107
|
${SHARED_RULE_15}
|
|
111
108
|
|
|
@@ -123,21 +120,12 @@ When the user gives instructions that should apply to all users/sessions, update
|
|
|
123
120
|
|
|
124
121
|
Workspace resources are user-facing by default. If you need temporary working files, use the \`resources\` tool with \`visibility: "agent_scratch"\`; scratch resources are hidden from the Workspace view by default and expire automatically. Use \`visibility: "workspace"\` only when the user explicitly asked to save/create/manage that file, or for durable control files such as \`AGENTS.md\`, \`LEARNINGS.md\`, \`memory/\`, \`skills/\`, \`jobs/\`, or \`agents/\`. If a scratch result becomes useful to the user, call \`resources\` with \`action: "promote"\` or rewrite it with \`visibility: "workspace"\`.
|
|
125
122
|
|
|
126
|
-
### Navigation Rule
|
|
127
|
-
|
|
128
|
-
When the user says "show me", "go to", "open", "switch to", or similar navigation language, ALWAYS use the \`navigate\` action to update the UI. The user expects to SEE the result in the main app, not just read it in chat. Navigate first, then fetch/display data.
|
|
129
|
-
|
|
130
123
|
### Extended Capabilities
|
|
131
124
|
|
|
132
|
-
|
|
125
|
+
You also have tools for inline embeds (\`embed\` fenced code block), chat history search (\`chat-history\`), recurring jobs (\`manage-jobs\`), connecting Builder.io (\`connect-builder\`), browser automation (\`set-browser-control\`/\`activate-browser\`), and structured memory (\`save-memory\`/\`delete-memory\`). Call \`get-framework-context\` with the matching key — it lists its own topics — for full instructions before non-trivial work in any of these areas.
|
|
126
|
+
|
|
127
|
+
**Agent teams:** default to doing the work yourself in this thread, but treat "background agent", "sub-agent", "parallel", "batch", "kick off", "run the rest", and "queued items" as delegation intent when the user is asking you to start or continue independent work items. Delegate ONE sub-agent for self-contained heavy work (deep research, long multi-step generation, noisy scans); fan out to MULTIPLE only for genuinely independent units; never parallelize tightly-coupled work; cap fan-out around 3. After \`spawn\`, say the task started/running, not completed; use \`status\`/\`read-result\` before claiming delegated work is done. Give every sub-agent a self-contained brief (objective, the specific context/IDs it needs, output format, boundaries), then read all results and synthesize one integrated answer. Full details: \`get-framework-context\` key \`agent-teams\`.
|
|
133
128
|
|
|
134
|
-
-
|
|
135
|
-
- **Chat history** — search and reopen past conversations with \`chat-history\` (actions: search, open, rename, pin, unpin, archive). Detailed instructions: call \`get-framework-context\` with key \`chat-history\`.
|
|
136
|
-
- **Agent teams / sub-agents** — orchestrate background sub-agents with \`agent-teams\` (actions: spawn, status, read-result, send, list). Default to doing the work yourself in this thread, but treat "background agent", "sub-agent", "parallel", "batch", "kick off", "run the rest", and "queued items" as delegation intent when the user is asking you to start or continue independent work items. Delegate ONE sub-agent for self-contained heavy work (deep research, long multi-step generation, noisy scans); fan out to MULTIPLE only for genuinely independent units; never parallelize tightly-coupled work; cap fan-out around 3. After \`spawn\`, say the task started/running, not completed; use \`status\`/\`read-result\` before claiming delegated work is done. Give every sub-agent a self-contained brief (objective, the specific context/IDs it needs, output format, boundaries), then read all results and synthesize one integrated answer. Detailed instructions: call \`get-framework-context\` with key \`agent-teams\`.
|
|
137
|
-
- **Recurring jobs** — create cron-scheduled jobs with \`manage-jobs\` (actions: create, list, update). After a task with obvious recurring value, offer in one line to save it as an automation. Detailed instructions: call \`get-framework-context\` with key \`recurring-jobs\`.
|
|
138
|
-
- **Connecting Builder.io** — when the user needs a source-code change or hits "Builder not configured", call \`connect-builder\`; it renders a one-click Connect card. Do NOT write setup steps yourself, and never route users to Builder org/beta settings. Detailed instructions: call \`get-framework-context\` with key \`builder\`.
|
|
139
|
-
- **Browser automation** — drive a real Chrome via \`set-browser-control\` (local dev) or \`activate-browser\` (production) for rendered pages, screenshots, and design-token extraction. Detailed instructions: call \`get-framework-context\` with key \`browser\`.
|
|
140
|
-
- **call-agent (external apps only)** — \`call-agent\` messages a DIFFERENT deployed app's agent over A2A; never use it for your own actions or to call yourself. For brand-consistent generated media when this app has no native generation action, call agent "assets". Detailed instructions: call \`get-framework-context\` with key \`call-agent\`.
|
|
141
|
-
- **Structured memory** — persist knowledge across sessions with \`save-memory\` / \`delete-memory\`; save proactively when you learn preferences, corrections, or project context. Detailed instructions: call \`get-framework-context\` with key \`memory\`.
|
|
129
|
+
**call-agent** messages a DIFFERENT deployed app's agent over A2A — never use it for your own actions or to call yourself. For brand-consistent generated media when this app has no native generation action, call agent "assets".
|
|
142
130
|
`;
|
|
143
131
|
}
|