@agent-native/core 0.90.2 → 0.90.4
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/bin/agent-native.js +25 -3
- package/corpus/README.md +2 -2
- package/corpus/core/CHANGELOG.md +21 -0
- package/corpus/core/bin/agent-native.js +25 -3
- package/corpus/core/docs/content/agent-native-toolkit.mdx +87 -80
- package/corpus/core/docs/content/locales/ar-SA/agent-native-toolkit.mdx +89 -80
- package/corpus/core/docs/content/locales/de-DE/agent-native-toolkit.mdx +89 -80
- package/corpus/core/docs/content/locales/es-ES/agent-native-toolkit.mdx +89 -80
- package/corpus/core/docs/content/locales/fr-FR/agent-native-toolkit.mdx +89 -80
- package/corpus/core/docs/content/locales/hi-IN/agent-native-toolkit.mdx +89 -80
- package/corpus/core/docs/content/locales/ja-JP/agent-native-toolkit.mdx +89 -80
- package/corpus/core/docs/content/locales/ko-KR/agent-native-toolkit.mdx +89 -80
- package/corpus/core/docs/content/locales/pt-BR/agent-native-toolkit.mdx +89 -80
- package/corpus/core/docs/content/locales/zh-CN/agent-native-toolkit.mdx +89 -80
- package/corpus/core/docs/content/locales/zh-TW/agent-native-toolkit.mdx +89 -80
- package/corpus/core/docs/content/toolkit-agent-ux.mdx +43 -0
- package/corpus/core/docs/content/toolkit-app-adapters.mdx +9 -0
- package/corpus/core/docs/content/toolkit-collaboration-ui.mdx +12 -0
- package/corpus/core/docs/content/toolkit-collaboration.mdx +74 -0
- package/corpus/core/docs/content/toolkit-command-navigation.mdx +106 -0
- package/corpus/core/docs/content/toolkit-comments-review.mdx +98 -0
- package/corpus/core/docs/content/toolkit-history.mdx +95 -0
- package/corpus/core/docs/content/toolkit-observability.mdx +41 -0
- package/corpus/core/docs/content/toolkit-org-team.mdx +80 -0
- package/corpus/core/docs/content/toolkit-resources.mdx +57 -0
- package/corpus/core/docs/content/toolkit-settings.mdx +65 -0
- package/corpus/core/docs/content/toolkit-setup-connections.mdx +109 -0
- package/corpus/core/docs/content/toolkit-sharing-ui.mdx +18 -6
- package/corpus/core/docs/content/toolkit-sharing.mdx +81 -0
- package/corpus/core/docs/content/toolkit-shell-hooks.mdx +9 -0
- package/corpus/core/docs/content/toolkit-ui.mdx +9 -0
- package/corpus/core/package.json +35 -1
- package/corpus/core/src/agent/engine/ai-sdk-engine.ts +19 -1
- package/corpus/core/src/agent/engine/anthropic-engine.ts +25 -1
- package/corpus/core/src/agent/engine/index.ts +1 -0
- package/corpus/core/src/agent/engine/registry.ts +86 -18
- package/corpus/core/src/agent/production-agent.ts +37 -6
- package/corpus/core/src/cli/create.ts +35 -0
- package/corpus/core/src/cli/design-connect.ts +248 -0
- package/corpus/core/src/cli/index.ts +84 -7
- package/corpus/core/src/cli/workspacify.ts +34 -0
- package/corpus/core/src/client/command-navigation/index.ts +15 -0
- package/corpus/core/src/client/comments-review/index.ts +1 -0
- package/corpus/core/src/client/history/VersionHistoryPanel.tsx +175 -0
- package/corpus/core/src/client/history/index.ts +21 -0
- package/corpus/core/src/client/history/use-history.ts +114 -0
- package/corpus/core/src/client/index.ts +84 -9
- package/corpus/core/src/client/org/OrgSwitcher.tsx +6 -6
- package/corpus/core/src/client/org/RequireActiveOrg.tsx +2 -2
- package/corpus/core/src/client/org/TeamPage.tsx +3 -3
- package/corpus/core/src/client/org/hooks.ts +32 -0
- package/corpus/core/src/client/org/index.ts +30 -1
- package/corpus/core/src/client/org-team/index.ts +1 -0
- package/corpus/core/src/client/review/ReviewStatusBadge.tsx +39 -0
- package/corpus/core/src/client/review/ReviewThreadPanel.tsx +278 -0
- package/corpus/core/src/client/review/index.ts +30 -0
- package/corpus/core/src/client/review/use-review.ts +152 -0
- package/corpus/core/src/client/settings/index.ts +11 -1
- package/corpus/core/src/client/setup-connections/BuilderConnectCard.tsx +94 -0
- package/corpus/core/src/client/setup-connections/ProviderReadinessBadge.tsx +73 -0
- package/corpus/core/src/client/setup-connections/SetupConnectionsPage.tsx +94 -0
- package/corpus/core/src/client/setup-connections/index.ts +46 -0
- package/corpus/core/src/client/sharing/ShareButton.tsx +20 -14
- package/corpus/core/src/client/sharing/ShareDialog.tsx +3 -3
- package/corpus/core/src/command-navigation/actions.ts +100 -0
- package/corpus/core/src/command-navigation/index.ts +12 -0
- package/corpus/core/src/comments-review/index.ts +1 -0
- package/corpus/core/src/file-upload/builder.ts +24 -3
- package/corpus/core/src/file-upload/types.ts +3 -1
- package/corpus/core/src/history/actions/create-resource-version.ts +92 -0
- package/corpus/core/src/history/actions/get-resource-version.ts +60 -0
- package/corpus/core/src/history/actions/list-resource-history.ts +53 -0
- package/corpus/core/src/history/actions/list-resource-versions.ts +43 -0
- package/corpus/core/src/history/actions/restore-resource-version.ts +96 -0
- package/corpus/core/src/history/index.ts +26 -0
- package/corpus/core/src/history/registry.ts +111 -0
- package/corpus/core/src/history/store.ts +379 -0
- package/corpus/core/src/history/types.ts +69 -0
- package/corpus/core/src/index.ts +10 -0
- package/corpus/core/src/navigation/index.ts +170 -0
- package/corpus/core/src/org/index.ts +8 -0
- package/corpus/core/src/org/permissions.ts +30 -0
- package/corpus/core/src/org-team/index.ts +1 -0
- package/corpus/core/src/private-blob/registry.ts +1 -0
- package/corpus/core/src/review/actions/consume-review-feedback.ts +48 -0
- package/corpus/core/src/review/actions/create-review-comment.ts +107 -0
- package/corpus/core/src/review/actions/delete-review-comment.ts +67 -0
- package/corpus/core/src/review/actions/get-review-feedback.ts +54 -0
- package/corpus/core/src/review/actions/list-review-comments.ts +53 -0
- package/corpus/core/src/review/actions/reply-review-comment.ts +107 -0
- package/corpus/core/src/review/actions/resolve-review-thread.ts +67 -0
- package/corpus/core/src/review/actions/set-review-status.ts +58 -0
- package/corpus/core/src/review/index.ts +31 -0
- package/corpus/core/src/review/mentions.ts +44 -0
- package/corpus/core/src/review/registry.ts +111 -0
- package/corpus/core/src/review/store.ts +690 -0
- package/corpus/core/src/review/types.ts +97 -0
- package/corpus/core/src/server/action-discovery.ts +54 -0
- package/corpus/core/src/server/agent-chat-plugin.ts +6 -0
- package/corpus/core/src/server/agent-engine-api-key-route.ts +5 -0
- package/corpus/core/src/server/credential-provider.ts +118 -0
- package/corpus/core/src/setup-connections/index.ts +89 -0
- package/corpus/core/src/setup-connections/onboarding.ts +47 -0
- package/corpus/core/src/transcription/builder-transcription.ts +9 -2
- package/corpus/core/src/vite/action-types-plugin.ts +52 -0
- package/corpus/templates/analytics/app/components/layout/Layout.tsx +2 -1
- package/corpus/templates/analytics/app/components/layout/Sidebar.tsx +2 -2
- package/corpus/templates/analytics/app/global.css +22 -10
- package/corpus/templates/analytics/app/i18n/zh-TW.ts +6 -1
- package/corpus/templates/analytics/app/i18n-data.ts +81 -13
- package/corpus/templates/analytics/app/pages/adhoc/sql-dashboard/index.tsx +2 -2
- package/corpus/templates/analytics/app/pages/analyses/AnalysisDetail.tsx +2 -2
- package/corpus/templates/analytics/app/pages/sessions/SessionDetailPage.tsx +528 -108
- package/corpus/templates/analytics/app/pages/sessions/SessionDevToolsPanel.tsx +466 -183
- package/corpus/templates/analytics/changelog/2026-07-07-session-replays-load-sooner-show-clearer-activity-timelines-.md +6 -0
- package/corpus/templates/assets/actions/_preset-skeleton-validation.ts +11 -11
- package/corpus/templates/assets/actions/generate-image.ts +64 -28
- package/corpus/templates/assets/app/components/generation/GenerationResults.tsx +1 -1
- package/corpus/templates/assets/app/routes/brand-kits.$id_.presets.$presetId.tsx +91 -74
- package/corpus/templates/assets/server/lib/generation.ts +29 -4
- package/corpus/templates/assets/server/lib/image-processing.ts +131 -0
- package/corpus/templates/brain/app/routes/settings.tsx +2 -2
- package/corpus/templates/calendar/.agents/skills/event-management/SKILL.md +24 -2
- package/corpus/templates/calendar/AGENTS.md +3 -0
- package/corpus/templates/calendar/actions/create-event.ts +8 -34
- package/corpus/templates/calendar/actions/event-action-helpers.ts +52 -0
- package/corpus/templates/calendar/actions/manage-event-draft.ts +7 -34
- package/corpus/templates/calendar/actions/update-event.ts +10 -23
- package/corpus/templates/calendar/app/components/calendar/AttendeeAutocomplete.tsx +79 -6
- package/corpus/templates/calendar/app/components/calendar/CreateEventDialog.tsx +23 -0
- package/corpus/templates/calendar/app/components/calendar/EventAttendeesSection.tsx +59 -2
- package/corpus/templates/calendar/app/components/calendar/EventDetailPanel.tsx +40 -1
- package/corpus/templates/calendar/app/components/calendar/EventDetailPopover.tsx +154 -41
- package/corpus/templates/calendar/app/hooks/use-events.ts +6 -0
- package/corpus/templates/calendar/app/hooks/use-people.ts +55 -0
- package/corpus/templates/calendar/app/i18n/zh-TW.ts +4 -0
- package/corpus/templates/calendar/app/i18n-data.ts +40 -0
- package/corpus/templates/calendar/changelog/2026-07-07-guest-suggestions-now-find-coworkers-from-your-google-worksp.md +6 -0
- package/corpus/templates/calendar/changelog/2026-07-07-you-can-mark-event-guests-as-optional-while-inviting-them-or.md +6 -0
- package/corpus/templates/calendar/changelog/2026-07-07-zoom-stays-selected-after-connecting-it-from-a-draft-event.md +6 -0
- package/corpus/templates/calendar/server/handlers/events.ts +1 -0
- package/corpus/templates/calendar/server/lib/google-calendar.ts +4 -0
- package/corpus/templates/calendar/server/plugins/agent-chat.ts +1 -1
- package/corpus/templates/calendar/shared/api.ts +2 -0
- package/corpus/templates/clips/.agents/skills/ai-video-tools/SKILL.md +29 -3
- package/corpus/templates/clips/actions/create-recording.ts +5 -1
- package/corpus/templates/clips/actions/finalize-recording.ts +140 -1
- package/corpus/templates/clips/actions/generate-workflow.ts +19 -8
- package/corpus/templates/clips/actions/get-clips-ai-prefs.ts +36 -0
- package/corpus/templates/clips/actions/import-loom-recording.ts +1 -0
- package/corpus/templates/clips/actions/lib/clips-ai-prefs.ts +28 -0
- package/corpus/templates/clips/actions/lib/ensure-seekable-video.ts +1 -0
- package/corpus/templates/clips/actions/regenerate-chapters.ts +21 -7
- package/corpus/templates/clips/actions/regenerate-summary.ts +26 -8
- package/corpus/templates/clips/actions/regenerate-title.ts +44 -7
- package/corpus/templates/clips/actions/request-transcript.ts +31 -0
- package/corpus/templates/clips/actions/set-thumbnail.ts +2 -0
- package/corpus/templates/clips/actions/update-clips-ai-prefs.ts +50 -0
- package/corpus/templates/clips/app/components/library/organization-switcher.tsx +2 -2
- package/corpus/templates/clips/app/components/meetings/meeting-card.tsx +7 -2
- package/corpus/templates/clips/app/components/player/scrubber-position.ts +9 -0
- package/corpus/templates/clips/app/components/player/scrubber.tsx +5 -2
- package/corpus/templates/clips/app/components/player/share-dialog.tsx +69 -41
- package/corpus/templates/clips/app/components/player/video-player.tsx +38 -1
- package/corpus/templates/clips/app/components/sharing/share-ui.tsx +3 -3
- package/corpus/templates/clips/app/components/sharing/slack-share-hint.tsx +9 -19
- package/corpus/templates/clips/app/hooks/use-auto-title.ts +25 -10
- package/corpus/templates/clips/app/i18n/ar-SA.ts +28 -6
- package/corpus/templates/clips/app/i18n/de-DE.ts +28 -6
- package/corpus/templates/clips/app/i18n/en-US.ts +29 -6
- package/corpus/templates/clips/app/i18n/es-ES.ts +29 -6
- package/corpus/templates/clips/app/i18n/fr-FR.ts +30 -6
- package/corpus/templates/clips/app/i18n/hi-IN.ts +26 -6
- package/corpus/templates/clips/app/i18n/ja-JP.ts +27 -6
- package/corpus/templates/clips/app/i18n/ko-KR.ts +28 -6
- package/corpus/templates/clips/app/i18n/pt-BR.ts +28 -6
- package/corpus/templates/clips/app/i18n/zh-CN.ts +26 -6
- package/corpus/templates/clips/app/i18n/zh-TW.ts +25 -6
- package/corpus/templates/clips/app/routes/_app.meetings._index.tsx +73 -0
- package/corpus/templates/clips/app/routes/_app.settings._index.tsx +1 -0
- package/corpus/templates/clips/app/routes/r.$recordingId.tsx +79 -5
- package/corpus/templates/clips/app/routes/record.tsx +21 -12
- package/corpus/templates/clips/changelog/2026-07-02-recordings-now-wait-for-storage-media-to-serve-before-finishing.md +6 -0
- package/corpus/templates/clips/changelog/2026-07-07-a-pending-app-update-no-longer-blocks-screen-recording-updat.md +6 -0
- package/corpus/templates/clips/changelog/2026-07-07-ai-tools-can-include-the-full-video-not-just-the-transcript-.md +6 -0
- package/corpus/templates/clips/changelog/2026-07-07-chrome-extension-recordings-keep-audio-after-refreshing-tab.md +6 -0
- package/corpus/templates/clips/changelog/2026-07-07-clip-playback-progress-now-starts-and-finishes-at-the-right-times.md +6 -0
- package/corpus/templates/clips/changelog/2026-07-07-clips-desktop-now-surfaces-meetings-and-dictate-directly-in-.md +6 -0
- package/corpus/templates/clips/changelog/2026-07-07-meeting-notes-now-explain-exactly-how-to-start-granola-style.md +6 -0
- package/corpus/templates/clips/changelog/2026-07-07-meeting-start-alerts-now-include-separate-start-notes-and-jo.md +6 -0
- package/corpus/templates/clips/changelog/2026-07-07-recordings-start-more-predictably-and-newly-saved-clips-refr.md +6 -0
- package/corpus/templates/clips/changelog/2026-07-07-sharing-public-clips-now-stays-focused-on-the-normal-link-wi.md +6 -0
- package/corpus/templates/clips/chrome-extension/public/manifest.json +1 -1
- package/corpus/templates/clips/chrome-extension/src/background.ts +18 -0
- package/corpus/templates/clips/chrome-extension/src/offscreen.ts +23 -8
- package/corpus/templates/clips/desktop/src/app.tsx +475 -108
- package/corpus/templates/clips/desktop/src/hooks/useMediaDevices.ts +19 -7
- package/corpus/templates/clips/desktop/src/lib/permissions.ts +2 -0
- package/corpus/templates/clips/desktop/src/lib/recorder.ts +27 -21
- package/corpus/templates/clips/desktop/src/lib/updater.ts +25 -2
- package/corpus/templates/clips/desktop/src/overlays/meeting-notification.tsx +23 -22
- package/corpus/templates/clips/desktop/src/styles.css +167 -2
- package/corpus/templates/clips/desktop/src-tauri/src/native_screen.rs +8 -1
- package/corpus/templates/clips/desktop/src-tauri/src/notifications.rs +3 -7
- package/corpus/templates/clips/desktop/src-tauri/src/tray_meetings.rs +5 -4
- package/corpus/templates/clips/server/routes/_agent-native/clips/user-prefs.put.ts +16 -8
- package/corpus/templates/clips/server/routes/api/recordings/[recordingId]/thumbnail.post.ts +1 -0
- package/corpus/templates/clips/server/routes/api/uploads/[recordingId]/abort.post.ts +22 -5
- package/corpus/templates/clips/server/routes/api/uploads/[recordingId]/chunk.post.ts +8 -0
- package/corpus/templates/clips/server/routes/api/video/[recordingId].get.ts +13 -6
- package/corpus/templates/clips/shared/clips-ai-prefs.ts +81 -0
- package/corpus/templates/clips/shared/finalize-recovery.ts +12 -0
- package/corpus/templates/content/actions/delete-document.ts +337 -52
- package/corpus/templates/content/changelog/2026-07-07-permanently-deleting-trashed-databases-now-finishes-reliably.md +6 -0
- package/corpus/templates/design/.agents/skills/visual-edit/SKILL.md +16 -1
- package/corpus/templates/design/actions/add-localhost-screens.ts +1 -0
- package/corpus/templates/design/app/components/design/DesignCanvas.tsx +345 -11
- package/corpus/templates/design/app/components/design/bridge/editor-chrome.bridge.ts +89 -14
- package/corpus/templates/design/app/components/design/bridge-security.ts +7 -1
- package/corpus/templates/design/app/components/design/multi-screen/types.ts +1 -1
- package/corpus/templates/design/app/i18n/zh-TW.ts +3 -0
- package/corpus/templates/design/app/i18n-data.ts +41 -0
- package/corpus/templates/design/changelog/2026-07-07-local-visual-edit-uses-live-app-iframes-for-click-to-edit-pr.md +6 -0
- package/corpus/templates/slides/app/pages/DeckEditor.tsx +2 -2
- package/dist/agent/engine/ai-sdk-engine.d.ts.map +1 -1
- package/dist/agent/engine/ai-sdk-engine.js +15 -1
- package/dist/agent/engine/ai-sdk-engine.js.map +1 -1
- package/dist/agent/engine/anthropic-engine.d.ts.map +1 -1
- package/dist/agent/engine/anthropic-engine.js +20 -1
- package/dist/agent/engine/anthropic-engine.js.map +1 -1
- package/dist/agent/engine/index.d.ts +1 -1
- package/dist/agent/engine/index.d.ts.map +1 -1
- package/dist/agent/engine/index.js +1 -1
- package/dist/agent/engine/index.js.map +1 -1
- package/dist/agent/engine/registry.d.ts +14 -0
- package/dist/agent/engine/registry.d.ts.map +1 -1
- package/dist/agent/engine/registry.js +78 -16
- package/dist/agent/engine/registry.js.map +1 -1
- package/dist/agent/production-agent.d.ts.map +1 -1
- package/dist/agent/production-agent.js +27 -7
- package/dist/agent/production-agent.js.map +1 -1
- package/dist/cli/create.d.ts.map +1 -1
- package/dist/cli/create.js +31 -0
- package/dist/cli/create.js.map +1 -1
- package/dist/cli/design-connect.d.ts.map +1 -1
- package/dist/cli/design-connect.js +186 -0
- package/dist/cli/design-connect.js.map +1 -1
- package/dist/cli/index.js +76 -9
- package/dist/cli/index.js.map +1 -1
- package/dist/cli/workspacify.d.ts.map +1 -1
- package/dist/cli/workspacify.js +30 -0
- package/dist/cli/workspacify.js.map +1 -1
- package/dist/client/command-navigation/index.d.ts +4 -0
- package/dist/client/command-navigation/index.d.ts.map +1 -0
- package/dist/client/command-navigation/index.js +4 -0
- package/dist/client/command-navigation/index.js.map +1 -0
- package/dist/client/comments-review/index.d.ts +2 -0
- package/dist/client/comments-review/index.d.ts.map +1 -0
- package/dist/client/comments-review/index.js +2 -0
- package/dist/client/comments-review/index.js.map +1 -0
- package/dist/client/history/VersionHistoryPanel.d.ts +18 -0
- package/dist/client/history/VersionHistoryPanel.d.ts.map +1 -0
- package/dist/client/history/VersionHistoryPanel.js +31 -0
- package/dist/client/history/VersionHistoryPanel.js.map +1 -0
- package/dist/client/history/index.d.ts +3 -0
- package/dist/client/history/index.d.ts.map +1 -0
- package/dist/client/history/index.js +3 -0
- package/dist/client/history/index.js.map +1 -0
- package/dist/client/history/use-history.d.ts +58 -0
- package/dist/client/history/use-history.d.ts.map +1 -0
- package/dist/client/history/use-history.js +24 -0
- package/dist/client/history/use-history.js.map +1 -0
- package/dist/client/index.d.ts +6 -4
- package/dist/client/index.d.ts.map +1 -1
- package/dist/client/index.js +6 -4
- package/dist/client/index.js.map +1 -1
- package/dist/client/org/OrgSwitcher.js +5 -5
- package/dist/client/org/OrgSwitcher.js.map +1 -1
- package/dist/client/org/RequireActiveOrg.js +2 -2
- package/dist/client/org/RequireActiveOrg.js.map +1 -1
- package/dist/client/org/TeamPage.js +3 -3
- package/dist/client/org/TeamPage.js.map +1 -1
- package/dist/client/org/hooks.d.ts +12 -1
- package/dist/client/org/hooks.d.ts.map +1 -1
- package/dist/client/org/hooks.js +15 -0
- package/dist/client/org/hooks.js.map +1 -1
- package/dist/client/org/index.d.ts +4 -2
- package/dist/client/org/index.d.ts.map +1 -1
- package/dist/client/org/index.js +3 -1
- package/dist/client/org/index.js.map +1 -1
- package/dist/client/org-team/index.d.ts +2 -0
- package/dist/client/org-team/index.d.ts.map +1 -0
- package/dist/client/org-team/index.js +2 -0
- package/dist/client/org-team/index.js.map +1 -0
- package/dist/client/review/ReviewStatusBadge.d.ts +7 -0
- package/dist/client/review/ReviewStatusBadge.d.ts.map +1 -0
- package/dist/client/review/ReviewStatusBadge.js +19 -0
- package/dist/client/review/ReviewStatusBadge.js.map +1 -0
- package/dist/client/review/ReviewThreadPanel.d.ts +20 -0
- package/dist/client/review/ReviewThreadPanel.d.ts.map +1 -0
- package/dist/client/review/ReviewThreadPanel.js +84 -0
- package/dist/client/review/ReviewThreadPanel.js.map +1 -0
- package/dist/client/review/index.d.ts +4 -0
- package/dist/client/review/index.d.ts.map +1 -0
- package/dist/client/review/index.js +4 -0
- package/dist/client/review/index.js.map +1 -0
- package/dist/client/review/use-review.d.ts +91 -0
- package/dist/client/review/use-review.d.ts.map +1 -0
- package/dist/client/review/use-review.js +30 -0
- package/dist/client/review/use-review.js.map +1 -0
- package/dist/client/settings/index.d.ts +1 -1
- package/dist/client/settings/index.d.ts.map +1 -1
- package/dist/client/settings/index.js +1 -1
- package/dist/client/settings/index.js.map +1 -1
- package/dist/client/setup-connections/BuilderConnectCard.d.ts +9 -0
- package/dist/client/setup-connections/BuilderConnectCard.d.ts.map +1 -0
- package/dist/client/setup-connections/BuilderConnectCard.js +25 -0
- package/dist/client/setup-connections/BuilderConnectCard.js.map +1 -0
- package/dist/client/setup-connections/ProviderReadinessBadge.d.ts +8 -0
- package/dist/client/setup-connections/ProviderReadinessBadge.d.ts.map +1 -0
- package/dist/client/setup-connections/ProviderReadinessBadge.js +32 -0
- package/dist/client/setup-connections/ProviderReadinessBadge.js.map +1 -0
- package/dist/client/setup-connections/SetupConnectionsPage.d.ts +17 -0
- package/dist/client/setup-connections/SetupConnectionsPage.d.ts.map +1 -0
- package/dist/client/setup-connections/SetupConnectionsPage.js +10 -0
- package/dist/client/setup-connections/SetupConnectionsPage.js.map +1 -0
- package/dist/client/setup-connections/index.d.ts +7 -0
- package/dist/client/setup-connections/index.d.ts.map +1 -0
- package/dist/client/setup-connections/index.js +7 -0
- package/dist/client/setup-connections/index.js.map +1 -0
- package/dist/client/sharing/ShareButton.d.ts +4 -4
- package/dist/client/sharing/ShareButton.d.ts.map +1 -1
- package/dist/client/sharing/ShareButton.js +13 -7
- package/dist/client/sharing/ShareButton.js.map +1 -1
- package/dist/client/sharing/ShareDialog.js +3 -3
- package/dist/client/sharing/ShareDialog.js.map +1 -1
- package/dist/collab/awareness.d.ts +2 -2
- package/dist/collab/awareness.d.ts.map +1 -1
- package/dist/collab/routes.d.ts +1 -1
- package/dist/collab/struct-routes.d.ts +1 -1
- package/dist/command-navigation/actions.d.ts +25 -0
- package/dist/command-navigation/actions.d.ts.map +1 -0
- package/dist/command-navigation/actions.js +64 -0
- package/dist/command-navigation/actions.js.map +1 -0
- package/dist/command-navigation/index.d.ts +4 -0
- package/dist/command-navigation/index.d.ts.map +1 -0
- package/dist/command-navigation/index.js +4 -0
- package/dist/command-navigation/index.js.map +1 -0
- package/dist/comments-review/index.d.ts +2 -0
- package/dist/comments-review/index.d.ts.map +1 -0
- package/dist/comments-review/index.js +2 -0
- package/dist/comments-review/index.js.map +1 -0
- package/dist/file-upload/builder.d.ts.map +1 -1
- package/dist/file-upload/builder.js +18 -2
- package/dist/file-upload/builder.js.map +1 -1
- package/dist/file-upload/types.d.ts +3 -0
- package/dist/file-upload/types.d.ts.map +1 -1
- package/dist/file-upload/types.js.map +1 -1
- package/dist/history/actions/create-resource-version.d.ts +10 -0
- package/dist/history/actions/create-resource-version.d.ts.map +1 -0
- package/dist/history/actions/create-resource-version.js +68 -0
- package/dist/history/actions/create-resource-version.js.map +1 -0
- package/dist/history/actions/get-resource-version.d.ts +10 -0
- package/dist/history/actions/get-resource-version.d.ts.map +1 -0
- package/dist/history/actions/get-resource-version.js +38 -0
- package/dist/history/actions/get-resource-version.js.map +1 -0
- package/dist/history/actions/list-resource-history.d.ts +10 -0
- package/dist/history/actions/list-resource-history.d.ts.map +1 -0
- package/dist/history/actions/list-resource-history.js +45 -0
- package/dist/history/actions/list-resource-history.js.map +1 -0
- package/dist/history/actions/list-resource-versions.d.ts +10 -0
- package/dist/history/actions/list-resource-versions.d.ts.map +1 -0
- package/dist/history/actions/list-resource-versions.js +35 -0
- package/dist/history/actions/list-resource-versions.js.map +1 -0
- package/dist/history/actions/restore-resource-version.d.ts +11 -0
- package/dist/history/actions/restore-resource-version.d.ts.map +1 -0
- package/dist/history/actions/restore-resource-version.js +59 -0
- package/dist/history/actions/restore-resource-version.js.map +1 -0
- package/dist/history/index.d.ts +4 -0
- package/dist/history/index.d.ts.map +1 -0
- package/dist/history/index.js +3 -0
- package/dist/history/index.js.map +1 -0
- package/dist/history/registry.d.ts +10 -0
- package/dist/history/registry.d.ts.map +1 -0
- package/dist/history/registry.js +63 -0
- package/dist/history/registry.js.map +1 -0
- package/dist/history/store.d.ts +34 -0
- package/dist/history/store.d.ts.map +1 -0
- package/dist/history/store.js +290 -0
- package/dist/history/store.js.map +1 -0
- package/dist/history/types.d.ts +55 -0
- package/dist/history/types.d.ts.map +1 -0
- package/dist/history/types.js +2 -0
- package/dist/history/types.js.map +1 -0
- package/dist/index.d.ts +6 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +6 -0
- package/dist/index.js.map +1 -1
- package/dist/navigation/index.d.ts +53 -0
- package/dist/navigation/index.d.ts.map +1 -0
- package/dist/navigation/index.js +105 -0
- package/dist/navigation/index.js.map +1 -0
- package/dist/observability/routes.d.ts +3 -3
- 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/permissions.d.ts +7 -0
- package/dist/org/permissions.d.ts.map +1 -0
- package/dist/org/permissions.js +21 -0
- package/dist/org/permissions.js.map +1 -0
- package/dist/org-team/index.d.ts +2 -0
- package/dist/org-team/index.d.ts.map +1 -0
- package/dist/org-team/index.js +2 -0
- package/dist/org-team/index.js.map +1 -0
- package/dist/private-blob/registry.d.ts.map +1 -1
- package/dist/private-blob/registry.js +1 -0
- package/dist/private-blob/registry.js.map +1 -1
- package/dist/progress/routes.d.ts +1 -1
- package/dist/resources/handlers.d.ts +2 -2
- package/dist/review/actions/consume-review-feedback.d.ts +10 -0
- package/dist/review/actions/consume-review-feedback.d.ts.map +1 -0
- package/dist/review/actions/consume-review-feedback.js +35 -0
- package/dist/review/actions/consume-review-feedback.js.map +1 -0
- package/dist/review/actions/create-review-comment.d.ts +18 -0
- package/dist/review/actions/create-review-comment.d.ts.map +1 -0
- package/dist/review/actions/create-review-comment.js +81 -0
- package/dist/review/actions/create-review-comment.js.map +1 -0
- package/dist/review/actions/delete-review-comment.d.ts +11 -0
- package/dist/review/actions/delete-review-comment.d.ts.map +1 -0
- package/dist/review/actions/delete-review-comment.js +53 -0
- package/dist/review/actions/delete-review-comment.js.map +1 -0
- package/dist/review/actions/get-review-feedback.d.ts +10 -0
- package/dist/review/actions/get-review-feedback.d.ts.map +1 -0
- package/dist/review/actions/get-review-feedback.js +45 -0
- package/dist/review/actions/get-review-feedback.js.map +1 -0
- package/dist/review/actions/list-review-comments.d.ts +13 -0
- package/dist/review/actions/list-review-comments.d.ts.map +1 -0
- package/dist/review/actions/list-review-comments.js +44 -0
- package/dist/review/actions/list-review-comments.js.map +1 -0
- package/dist/review/actions/reply-review-comment.d.ts +16 -0
- package/dist/review/actions/reply-review-comment.d.ts.map +1 -0
- package/dist/review/actions/reply-review-comment.js +84 -0
- package/dist/review/actions/reply-review-comment.js.map +1 -0
- package/dist/review/actions/resolve-review-thread.d.ts +12 -0
- package/dist/review/actions/resolve-review-thread.d.ts.map +1 -0
- package/dist/review/actions/resolve-review-thread.js +49 -0
- package/dist/review/actions/resolve-review-thread.js.map +1 -0
- package/dist/review/actions/set-review-status.d.ts +9 -0
- package/dist/review/actions/set-review-status.d.ts.map +1 -0
- package/dist/review/actions/set-review-status.js +43 -0
- package/dist/review/actions/set-review-status.js.map +1 -0
- package/dist/review/index.d.ts +5 -0
- package/dist/review/index.d.ts.map +1 -0
- package/dist/review/index.js +4 -0
- package/dist/review/index.js.map +1 -0
- package/dist/review/mentions.d.ts +4 -0
- package/dist/review/mentions.d.ts.map +1 -0
- package/dist/review/mentions.js +39 -0
- package/dist/review/mentions.js.map +1 -0
- package/dist/review/registry.d.ts +10 -0
- package/dist/review/registry.d.ts.map +1 -0
- package/dist/review/registry.js +63 -0
- package/dist/review/registry.js.map +1 -0
- package/dist/review/store.d.ts +63 -0
- package/dist/review/store.d.ts.map +1 -0
- package/dist/review/store.js +561 -0
- package/dist/review/store.js.map +1 -0
- package/dist/review/types.d.ts +77 -0
- package/dist/review/types.d.ts.map +1 -0
- package/dist/review/types.js +2 -0
- package/dist/review/types.js.map +1 -0
- package/dist/secrets/routes.d.ts +9 -9
- package/dist/server/action-discovery.d.ts.map +1 -1
- package/dist/server/action-discovery.js +54 -0
- package/dist/server/action-discovery.js.map +1 -1
- package/dist/server/agent-chat-plugin.d.ts.map +1 -1
- package/dist/server/agent-chat-plugin.js +5 -0
- package/dist/server/agent-chat-plugin.js.map +1 -1
- package/dist/server/agent-engine-api-key-route.d.ts +1 -1
- package/dist/server/agent-engine-api-key-route.d.ts.map +1 -1
- package/dist/server/agent-engine-api-key-route.js +5 -0
- package/dist/server/agent-engine-api-key-route.js.map +1 -1
- package/dist/server/credential-provider.d.ts +28 -0
- package/dist/server/credential-provider.d.ts.map +1 -1
- package/dist/server/credential-provider.js +92 -0
- package/dist/server/credential-provider.js.map +1 -1
- package/dist/setup-connections/index.d.ts +6 -0
- package/dist/setup-connections/index.d.ts.map +1 -0
- package/dist/setup-connections/index.js +6 -0
- package/dist/setup-connections/index.js.map +1 -0
- package/dist/setup-connections/onboarding.d.ts +14 -0
- package/dist/setup-connections/onboarding.d.ts.map +1 -0
- package/dist/setup-connections/onboarding.js +23 -0
- package/dist/setup-connections/onboarding.js.map +1 -0
- package/dist/transcription/builder-transcription.d.ts +1 -0
- package/dist/transcription/builder-transcription.d.ts.map +1 -1
- package/dist/transcription/builder-transcription.js +5 -2
- package/dist/transcription/builder-transcription.js.map +1 -1
- package/dist/vite/action-types-plugin.d.ts.map +1 -1
- package/dist/vite/action-types-plugin.js +52 -0
- package/dist/vite/action-types-plugin.js.map +1 -1
- package/docs/content/agent-native-toolkit.mdx +87 -80
- package/docs/content/locales/ar-SA/agent-native-toolkit.mdx +89 -80
- package/docs/content/locales/de-DE/agent-native-toolkit.mdx +89 -80
- package/docs/content/locales/es-ES/agent-native-toolkit.mdx +89 -80
- package/docs/content/locales/fr-FR/agent-native-toolkit.mdx +89 -80
- package/docs/content/locales/hi-IN/agent-native-toolkit.mdx +89 -80
- package/docs/content/locales/ja-JP/agent-native-toolkit.mdx +89 -80
- package/docs/content/locales/ko-KR/agent-native-toolkit.mdx +89 -80
- package/docs/content/locales/pt-BR/agent-native-toolkit.mdx +89 -80
- package/docs/content/locales/zh-CN/agent-native-toolkit.mdx +89 -80
- package/docs/content/locales/zh-TW/agent-native-toolkit.mdx +89 -80
- package/docs/content/toolkit-agent-ux.mdx +43 -0
- package/docs/content/toolkit-app-adapters.mdx +9 -0
- package/docs/content/toolkit-collaboration-ui.mdx +12 -0
- package/docs/content/toolkit-collaboration.mdx +74 -0
- package/docs/content/toolkit-command-navigation.mdx +106 -0
- package/docs/content/toolkit-comments-review.mdx +98 -0
- package/docs/content/toolkit-history.mdx +95 -0
- package/docs/content/toolkit-observability.mdx +41 -0
- package/docs/content/toolkit-org-team.mdx +80 -0
- package/docs/content/toolkit-resources.mdx +57 -0
- package/docs/content/toolkit-settings.mdx +65 -0
- package/docs/content/toolkit-setup-connections.mdx +109 -0
- package/docs/content/toolkit-sharing-ui.mdx +18 -6
- package/docs/content/toolkit-sharing.mdx +81 -0
- package/docs/content/toolkit-shell-hooks.mdx +9 -0
- package/docs/content/toolkit-ui.mdx +9 -0
- package/package.json +36 -2
|
@@ -12,6 +12,7 @@ import { createRequire } from "node:module";
|
|
|
12
12
|
|
|
13
13
|
import {
|
|
14
14
|
canUseDeployCredentialFallbackForRequest,
|
|
15
|
+
getProviderCredentialAuthFailure,
|
|
15
16
|
readDeployCredentialEnv,
|
|
16
17
|
resolveBuilderCredentials,
|
|
17
18
|
resolveSecret,
|
|
@@ -155,6 +156,10 @@ function assertAgentEnginePackageInstalled(entry: AgentEngineEntry): void {
|
|
|
155
156
|
* on the first pass, so an explicit provider key (ANTHROPIC_API_KEY etc.)
|
|
156
157
|
* is picked instead. Builder is still used as the fallback when no other
|
|
157
158
|
* provider key is set.
|
|
159
|
+
*
|
|
160
|
+
* This sync helper is for CLI/status callers that cannot await settings. Prefer
|
|
161
|
+
* {@link detectEngineFromEnvForRequest} at request time so sticky auth-failure
|
|
162
|
+
* markers can skip rejected deploy keys.
|
|
158
163
|
*/
|
|
159
164
|
export function detectEngineFromEnv(): AgentEngineEntry | null {
|
|
160
165
|
const preferByo = /^(1|true)$/i.test(
|
|
@@ -195,6 +200,59 @@ export function detectEngineFromEnv(): AgentEngineEntry | null {
|
|
|
195
200
|
return null;
|
|
196
201
|
}
|
|
197
202
|
|
|
203
|
+
async function envKeyUsableForEntry(
|
|
204
|
+
entry: AgentEngineEntry,
|
|
205
|
+
key: string,
|
|
206
|
+
): Promise<boolean> {
|
|
207
|
+
if (
|
|
208
|
+
!(
|
|
209
|
+
canUseDeployCredentialFallbackForRequest(key) &&
|
|
210
|
+
!!readDeployCredentialEnv(key)
|
|
211
|
+
)
|
|
212
|
+
) {
|
|
213
|
+
return false;
|
|
214
|
+
}
|
|
215
|
+
if (entry.name === "builder") {
|
|
216
|
+
return true;
|
|
217
|
+
}
|
|
218
|
+
const value = readDeployCredentialEnv(key);
|
|
219
|
+
if (!value) return false;
|
|
220
|
+
return !(await getProviderCredentialAuthFailure({ key, value }));
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
async function hasUsableEnvKeys(entry: AgentEngineEntry): Promise<boolean> {
|
|
224
|
+
if (!isAgentEnginePackageInstalled(entry)) return false;
|
|
225
|
+
if (entry.requiredEnvVars.length === 0) return false;
|
|
226
|
+
for (const key of entry.requiredEnvVars) {
|
|
227
|
+
if (!(await envKeyUsableForEntry(entry, key))) return false;
|
|
228
|
+
}
|
|
229
|
+
return true;
|
|
230
|
+
}
|
|
231
|
+
|
|
232
|
+
/**
|
|
233
|
+
* Request-aware env auto-detect. Same priority as {@link detectEngineFromEnv},
|
|
234
|
+
* but skips provider keys that currently have an auth-failure marker so a
|
|
235
|
+
* rejected deploy key does not permanently win selection and leave chat stuck
|
|
236
|
+
* on `missing_credentials`.
|
|
237
|
+
*/
|
|
238
|
+
export async function detectEngineFromEnvForRequest(): Promise<AgentEngineEntry | null> {
|
|
239
|
+
const preferByo = /^(1|true)$/i.test(
|
|
240
|
+
process.env.AGENT_ENGINE_PREFER_BYO_KEY ?? "",
|
|
241
|
+
);
|
|
242
|
+
|
|
243
|
+
if (preferByo) {
|
|
244
|
+
for (const entry of _registry.values()) {
|
|
245
|
+
if (entry.name === "builder") continue;
|
|
246
|
+
if (await hasUsableEnvKeys(entry)) return entry;
|
|
247
|
+
}
|
|
248
|
+
}
|
|
249
|
+
|
|
250
|
+
for (const entry of _registry.values()) {
|
|
251
|
+
if (await hasUsableEnvKeys(entry)) return entry;
|
|
252
|
+
}
|
|
253
|
+
return null;
|
|
254
|
+
}
|
|
255
|
+
|
|
198
256
|
function shouldTraceEngineDetection(): boolean {
|
|
199
257
|
return /^(1|true)$/i.test(
|
|
200
258
|
process.env.AGENT_NATIVE_DEBUG_AGENT_ENGINE_DETECT ??
|
|
@@ -260,7 +318,7 @@ export async function detectEngineFromUserSecrets(): Promise<AgentEngineEntry |
|
|
|
260
318
|
}
|
|
261
319
|
for (const key of entry.requiredEnvVars) {
|
|
262
320
|
try {
|
|
263
|
-
if (!(await
|
|
321
|
+
if (!(await resolveUsableProviderSecret(key))) return false;
|
|
264
322
|
} catch {
|
|
265
323
|
return false;
|
|
266
324
|
}
|
|
@@ -366,6 +424,15 @@ async function resolveOpenAiBaseUrl(): Promise<string | undefined> {
|
|
|
366
424
|
return raw ? normalizeOpenAiBaseUrl(raw) : undefined;
|
|
367
425
|
}
|
|
368
426
|
|
|
427
|
+
async function resolveUsableProviderSecret(
|
|
428
|
+
key: string,
|
|
429
|
+
): Promise<string | null> {
|
|
430
|
+
const value = await resolveSecret(key);
|
|
431
|
+
if (!value) return null;
|
|
432
|
+
const authFailure = await getProviderCredentialAuthFailure({ key, value });
|
|
433
|
+
return authFailure ? null : value;
|
|
434
|
+
}
|
|
435
|
+
|
|
369
436
|
async function engineCreateConfigForEntry(
|
|
370
437
|
entry: AgentEngineEntry,
|
|
371
438
|
apiKey: string | undefined,
|
|
@@ -389,6 +456,9 @@ async function engineCreateConfigForEntry(
|
|
|
389
456
|
* AND an API key for it is reachable via the engine's required env vars.
|
|
390
457
|
* Inline keys on the global settings row are ignored; see
|
|
391
458
|
* `isAgentEngineSettingConfigured`.
|
|
459
|
+
*
|
|
460
|
+
* Sync helper for CLI/status. Prefer {@link isStoredEngineUsableForRequest}
|
|
461
|
+
* so sticky auth-failure markers are respected.
|
|
392
462
|
*/
|
|
393
463
|
export function isStoredEngineUsable(
|
|
394
464
|
stored: unknown,
|
|
@@ -425,16 +495,11 @@ export async function isStoredEngineUsableForRequest(
|
|
|
425
495
|
}
|
|
426
496
|
for (const key of entry.requiredEnvVars) {
|
|
427
497
|
try {
|
|
428
|
-
if (await
|
|
498
|
+
if (await resolveUsableProviderSecret(key)) continue;
|
|
429
499
|
} catch {
|
|
430
|
-
// Fall through to the deployment-level check below.
|
|
431
|
-
}
|
|
432
|
-
if (
|
|
433
|
-
!canUseDeployCredentialFallbackForRequest(key) ||
|
|
434
|
-
!readDeployCredentialEnv(key)
|
|
435
|
-
) {
|
|
436
500
|
return false;
|
|
437
501
|
}
|
|
502
|
+
return false;
|
|
438
503
|
}
|
|
439
504
|
return true;
|
|
440
505
|
}
|
|
@@ -461,20 +526,22 @@ export async function isResolvedEngineUsableForRequest(
|
|
|
461
526
|
return Boolean(creds.privateKey && creds.publicKey);
|
|
462
527
|
}
|
|
463
528
|
|
|
464
|
-
if (options.apiKey?.trim())
|
|
529
|
+
if (options.apiKey?.trim()) {
|
|
530
|
+
const key = entry.requiredEnvVars[0];
|
|
531
|
+
if (!key) return true;
|
|
532
|
+
return !(await getProviderCredentialAuthFailure({
|
|
533
|
+
key,
|
|
534
|
+
value: options.apiKey,
|
|
535
|
+
}));
|
|
536
|
+
}
|
|
465
537
|
|
|
466
538
|
for (const key of entry.requiredEnvVars) {
|
|
467
539
|
try {
|
|
468
|
-
if (await
|
|
540
|
+
if (await resolveUsableProviderSecret(key)) continue;
|
|
469
541
|
} catch {
|
|
470
|
-
// Fall through to deployment-level fallback when allowed.
|
|
471
|
-
}
|
|
472
|
-
if (
|
|
473
|
-
!canUseDeployCredentialFallbackForRequest(key) ||
|
|
474
|
-
!readDeployCredentialEnv(key)
|
|
475
|
-
) {
|
|
476
542
|
return false;
|
|
477
543
|
}
|
|
544
|
+
return false;
|
|
478
545
|
}
|
|
479
546
|
return true;
|
|
480
547
|
}
|
|
@@ -611,8 +678,9 @@ export async function resolveEngine(
|
|
|
611
678
|
}
|
|
612
679
|
|
|
613
680
|
// 8. Auto-detect from any provider env var — so just dropping a key in
|
|
614
|
-
// .env works without also setting AGENT_ENGINE.
|
|
615
|
-
|
|
681
|
+
// .env works without also setting AGENT_ENGINE. Skip keys with active
|
|
682
|
+
// auth-failure markers so a rejected deploy key cannot permanently win.
|
|
683
|
+
const detected = await detectEngineFromEnvForRequest();
|
|
616
684
|
if (detected) {
|
|
617
685
|
return detected.create(await engineCreateConfigForEntry(detected, apiKey));
|
|
618
686
|
}
|
|
@@ -29,6 +29,7 @@ import {
|
|
|
29
29
|
} from "../resources/metadata.js";
|
|
30
30
|
import {
|
|
31
31
|
canUseDeployCredentialFallbackForRequest,
|
|
32
|
+
getProviderCredentialAuthFailure,
|
|
32
33
|
readDeployCredentialEnv,
|
|
33
34
|
} from "../server/credential-provider.js";
|
|
34
35
|
import { readBody } from "../server/h3-helpers.js";
|
|
@@ -436,7 +437,15 @@ export async function getOwnerApiKey(
|
|
|
436
437
|
scope: ref.scope,
|
|
437
438
|
scopeId: ref.scopeId,
|
|
438
439
|
});
|
|
439
|
-
if (
|
|
440
|
+
if (
|
|
441
|
+
fromSecrets?.value &&
|
|
442
|
+
!(await getProviderCredentialAuthFailure({
|
|
443
|
+
key: secretKey,
|
|
444
|
+
value: fromSecrets.value,
|
|
445
|
+
}))
|
|
446
|
+
) {
|
|
447
|
+
return fromSecrets.value;
|
|
448
|
+
}
|
|
440
449
|
}
|
|
441
450
|
} catch {
|
|
442
451
|
// app_secrets table not ready — fall through to legacy lookup.
|
|
@@ -446,12 +455,26 @@ export async function getOwnerApiKey(
|
|
|
446
455
|
const stored = await getSetting(`user-api-key:${provider}:${ownerEmail}`);
|
|
447
456
|
const key =
|
|
448
457
|
stored && typeof stored.key === "string" ? stored.key.trim() : "";
|
|
449
|
-
if (
|
|
458
|
+
if (
|
|
459
|
+
key &&
|
|
460
|
+
!(await getProviderCredentialAuthFailure({ key: secretKey, value: key }))
|
|
461
|
+
) {
|
|
462
|
+
return key;
|
|
463
|
+
}
|
|
450
464
|
if (provider === "anthropic") {
|
|
451
465
|
const legacy = await getSetting(`user-anthropic-api-key:${ownerEmail}`);
|
|
452
466
|
const legacyKey =
|
|
453
467
|
legacy && typeof legacy.key === "string" ? legacy.key.trim() : "";
|
|
454
|
-
|
|
468
|
+
if (
|
|
469
|
+
legacyKey &&
|
|
470
|
+
!(await getProviderCredentialAuthFailure({
|
|
471
|
+
key: secretKey,
|
|
472
|
+
value: legacyKey,
|
|
473
|
+
}))
|
|
474
|
+
) {
|
|
475
|
+
return legacyKey;
|
|
476
|
+
}
|
|
477
|
+
return undefined;
|
|
455
478
|
}
|
|
456
479
|
return undefined;
|
|
457
480
|
} catch {
|
|
@@ -490,9 +513,17 @@ export async function getOwnerActiveApiKey(
|
|
|
490
513
|
const userKey = await getOwnerApiKey(provider, ownerEmail);
|
|
491
514
|
if (userKey) return userKey;
|
|
492
515
|
const envVar = PROVIDER_TO_ENV[provider];
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
516
|
+
if (!envVar || !canUseDeployCredentialFallbackForRequest(envVar)) {
|
|
517
|
+
return undefined;
|
|
518
|
+
}
|
|
519
|
+
const envKey = readDeployCredentialEnv(envVar);
|
|
520
|
+
if (
|
|
521
|
+
envKey &&
|
|
522
|
+
!(await getProviderCredentialAuthFailure({ key: envVar, value: envKey }))
|
|
523
|
+
) {
|
|
524
|
+
return envKey;
|
|
525
|
+
}
|
|
526
|
+
return undefined;
|
|
496
527
|
} catch {
|
|
497
528
|
return undefined;
|
|
498
529
|
}
|
|
@@ -27,6 +27,12 @@ const STANDALONE_EXACT_DEPENDENCY_OVERRIDES: Record<string, string> = {
|
|
|
27
27
|
"@react-router/fs-routes": "8.1.0",
|
|
28
28
|
"react-router": "8.1.0",
|
|
29
29
|
};
|
|
30
|
+
const REACT_ROUTER_BUILD_DEPENDENCIES = [
|
|
31
|
+
"@react-router/dev",
|
|
32
|
+
"@react-router/fs-routes",
|
|
33
|
+
"react-router",
|
|
34
|
+
"vite",
|
|
35
|
+
] as const;
|
|
30
36
|
const SENTRY_MINIMUM_RELEASE_AGE_EXCLUDES = ['"@sentry/*"'];
|
|
31
37
|
const FIRST_PARTY_TARBALL_SYMLINK_EXCLUDES = [
|
|
32
38
|
"*/CLAUDE.md",
|
|
@@ -1045,6 +1051,7 @@ function postProcessStandalone(
|
|
|
1045
1051
|
// under pnpm 10+ without prompting for `pnpm approve-builds`.
|
|
1046
1052
|
pkg.dependencies = pkg.dependencies ?? {};
|
|
1047
1053
|
pkg.dependencies.postgres ??= POSTGRES_DEPENDENCY_VERSION;
|
|
1054
|
+
ensureReactRouterBuildDependencies(pkg);
|
|
1048
1055
|
|
|
1049
1056
|
const requiredBuilt = ["better-sqlite3", "esbuild", "node-pty"];
|
|
1050
1057
|
if (!pkg.pnpm || typeof pkg.pnpm !== "object") {
|
|
@@ -1105,6 +1112,34 @@ function postProcessStandalone(
|
|
|
1105
1112
|
setupAgentSymlinks(targetDir);
|
|
1106
1113
|
}
|
|
1107
1114
|
|
|
1115
|
+
function ensureReactRouterBuildDependencies(pkg: Record<string, any>): void {
|
|
1116
|
+
const allDeps = {
|
|
1117
|
+
...pkg.dependencies,
|
|
1118
|
+
...pkg.devDependencies,
|
|
1119
|
+
...pkg.peerDependencies,
|
|
1120
|
+
};
|
|
1121
|
+
if (
|
|
1122
|
+
!allDeps["@react-router/dev"] &&
|
|
1123
|
+
!allDeps["react-router"] &&
|
|
1124
|
+
!allDeps["@react-router/fs-routes"]
|
|
1125
|
+
) {
|
|
1126
|
+
return;
|
|
1127
|
+
}
|
|
1128
|
+
|
|
1129
|
+
pkg.dependencies = pkg.dependencies ?? {};
|
|
1130
|
+
for (const key of REACT_ROUTER_BUILD_DEPENDENCIES) {
|
|
1131
|
+
const existing =
|
|
1132
|
+
pkg.dependencies[key] ??
|
|
1133
|
+
pkg.devDependencies?.[key] ??
|
|
1134
|
+
pkg.peerDependencies?.[key];
|
|
1135
|
+
if (!existing) continue;
|
|
1136
|
+
pkg.dependencies[key] =
|
|
1137
|
+
STANDALONE_EXACT_DEPENDENCY_OVERRIDES[key] ?? existing;
|
|
1138
|
+
delete pkg.devDependencies?.[key];
|
|
1139
|
+
delete pkg.peerDependencies?.[key];
|
|
1140
|
+
}
|
|
1141
|
+
}
|
|
1142
|
+
|
|
1108
1143
|
function fixStandaloneTsconfig(targetDir: string, templateName?: string): void {
|
|
1109
1144
|
const tsconfigPath = path.join(targetDir, "tsconfig.json");
|
|
1110
1145
|
if (!fs.existsSync(tsconfigPath)) return;
|
|
@@ -507,6 +507,47 @@ function sendJson(
|
|
|
507
507
|
res.end(`${JSON.stringify(body, null, 2)}\n`);
|
|
508
508
|
}
|
|
509
509
|
|
|
510
|
+
function sendText(
|
|
511
|
+
res: ServerResponse,
|
|
512
|
+
statusCode: number,
|
|
513
|
+
body: string,
|
|
514
|
+
contentType: string,
|
|
515
|
+
) {
|
|
516
|
+
res.writeHead(statusCode, {
|
|
517
|
+
"content-type": contentType,
|
|
518
|
+
"access-control-allow-origin": "*",
|
|
519
|
+
"access-control-allow-methods": "GET, POST, OPTIONS",
|
|
520
|
+
"access-control-allow-headers": "content-type, x-bridge-token",
|
|
521
|
+
"access-control-allow-private-network": "true",
|
|
522
|
+
});
|
|
523
|
+
res.end(body);
|
|
524
|
+
}
|
|
525
|
+
|
|
526
|
+
function sendBytes(
|
|
527
|
+
res: ServerResponse,
|
|
528
|
+
statusCode: number,
|
|
529
|
+
body: Buffer,
|
|
530
|
+
headers: Headers,
|
|
531
|
+
) {
|
|
532
|
+
const responseHeaders: Record<string, string> = {
|
|
533
|
+
"access-control-allow-origin": "*",
|
|
534
|
+
"access-control-allow-methods": "GET, HEAD, POST, OPTIONS",
|
|
535
|
+
"access-control-allow-headers": "content-type, x-bridge-token",
|
|
536
|
+
"access-control-allow-private-network": "true",
|
|
537
|
+
};
|
|
538
|
+
for (const name of [
|
|
539
|
+
"content-type",
|
|
540
|
+
"cache-control",
|
|
541
|
+
"etag",
|
|
542
|
+
"last-modified",
|
|
543
|
+
]) {
|
|
544
|
+
const value = headers.get(name);
|
|
545
|
+
if (value) responseHeaders[name] = value;
|
|
546
|
+
}
|
|
547
|
+
res.writeHead(statusCode, responseHeaders);
|
|
548
|
+
res.end(body);
|
|
549
|
+
}
|
|
550
|
+
|
|
510
551
|
function sameOrigin(a: string, b: string): boolean {
|
|
511
552
|
try {
|
|
512
553
|
return new URL(a).origin === new URL(b).origin;
|
|
@@ -531,6 +572,23 @@ function resolvePreviewSnapshotUrl(
|
|
|
531
572
|
return parsed.toString();
|
|
532
573
|
}
|
|
533
574
|
|
|
575
|
+
function resolvePreviewProxyUrl(
|
|
576
|
+
devServerUrl: string,
|
|
577
|
+
requestUrl: string | undefined,
|
|
578
|
+
): string {
|
|
579
|
+
const base = normalizeHttpUrl(devServerUrl);
|
|
580
|
+
const parsedRequest = new URL(requestUrl ?? "/", base);
|
|
581
|
+
const parsed = new URL(
|
|
582
|
+
`${parsedRequest.pathname}${parsedRequest.search}`,
|
|
583
|
+
`${base}/`,
|
|
584
|
+
);
|
|
585
|
+
parsed.hash = "";
|
|
586
|
+
if (!sameOrigin(parsed.toString(), base)) {
|
|
587
|
+
throw new Error("Proxy URL must stay on the connected dev server.");
|
|
588
|
+
}
|
|
589
|
+
return parsed.toString();
|
|
590
|
+
}
|
|
591
|
+
|
|
534
592
|
async function fetchPreviewSnapshot(
|
|
535
593
|
devServerUrl: string,
|
|
536
594
|
targetUrl: string,
|
|
@@ -579,6 +637,79 @@ async function fetchPreviewSnapshot(
|
|
|
579
637
|
}
|
|
580
638
|
}
|
|
581
639
|
|
|
640
|
+
async function fetchPreviewProxyResource(
|
|
641
|
+
devServerUrl: string,
|
|
642
|
+
targetUrl: string,
|
|
643
|
+
redirects = 0,
|
|
644
|
+
): Promise<{
|
|
645
|
+
url: string;
|
|
646
|
+
status: number;
|
|
647
|
+
headers: Headers;
|
|
648
|
+
body: Buffer;
|
|
649
|
+
}> {
|
|
650
|
+
if (redirects > 5) {
|
|
651
|
+
throw new Error("Too many redirects while proxying preview resource.");
|
|
652
|
+
}
|
|
653
|
+
const controller = new AbortController();
|
|
654
|
+
const timeout = setTimeout(() => controller.abort(), 10_000);
|
|
655
|
+
try {
|
|
656
|
+
const response = await fetch(targetUrl, {
|
|
657
|
+
method: "GET",
|
|
658
|
+
redirect: "manual",
|
|
659
|
+
signal: controller.signal,
|
|
660
|
+
});
|
|
661
|
+
const location = response.headers.get("location");
|
|
662
|
+
if (location && response.status >= 300 && response.status < 400) {
|
|
663
|
+
const redirected = new URL(location, targetUrl);
|
|
664
|
+
redirected.hash = "";
|
|
665
|
+
if (!sameOrigin(redirected.toString(), devServerUrl)) {
|
|
666
|
+
throw new Error("Proxy redirect left the connected dev server.");
|
|
667
|
+
}
|
|
668
|
+
return fetchPreviewProxyResource(
|
|
669
|
+
devServerUrl,
|
|
670
|
+
redirected.toString(),
|
|
671
|
+
redirects + 1,
|
|
672
|
+
);
|
|
673
|
+
}
|
|
674
|
+
return {
|
|
675
|
+
url: response.url || targetUrl,
|
|
676
|
+
status: response.status,
|
|
677
|
+
headers: response.headers,
|
|
678
|
+
body: Buffer.from(await response.arrayBuffer()),
|
|
679
|
+
};
|
|
680
|
+
} finally {
|
|
681
|
+
clearTimeout(timeout);
|
|
682
|
+
}
|
|
683
|
+
}
|
|
684
|
+
|
|
685
|
+
function addLiveEditBaseHref(html: string, href: string): string {
|
|
686
|
+
const escapedHref = href.replace(/&/g, "&").replace(/"/g, """);
|
|
687
|
+
const baseTag = `<base href="${escapedHref}">`;
|
|
688
|
+
if (/<base\b/i.test(html)) return html;
|
|
689
|
+
if (/<head\b[^>]*>/i.test(html)) {
|
|
690
|
+
return html.replace(/<head\b[^>]*>/i, (match) => `${match}${baseTag}`);
|
|
691
|
+
}
|
|
692
|
+
if (/<html\b[^>]*>/i.test(html)) {
|
|
693
|
+
return html.replace(
|
|
694
|
+
/<html\b[^>]*>/i,
|
|
695
|
+
(match) => `${match}<head>${baseTag}</head>`,
|
|
696
|
+
);
|
|
697
|
+
}
|
|
698
|
+
return `<!DOCTYPE html><html><head>${baseTag}<meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1"></head><body>${html}</body></html>`;
|
|
699
|
+
}
|
|
700
|
+
|
|
701
|
+
function injectLiveEditBridge(html: string, targetUrl: string, script: string) {
|
|
702
|
+
const withBase = addLiveEditBaseHref(html, targetUrl);
|
|
703
|
+
if (!script) return withBase;
|
|
704
|
+
if (withBase.includes("</body>")) {
|
|
705
|
+
return withBase.replace("</body>", `${script}</body>`);
|
|
706
|
+
}
|
|
707
|
+
if (withBase.includes("</html>")) {
|
|
708
|
+
return withBase.replace("</html>", `${script}</html>`);
|
|
709
|
+
}
|
|
710
|
+
return `${withBase}${script}`;
|
|
711
|
+
}
|
|
712
|
+
|
|
582
713
|
/** Read the full request body as a UTF-8 string. */
|
|
583
714
|
async function readRequestBody(req: IncomingMessage): Promise<string> {
|
|
584
715
|
return new Promise<string>((resolve, reject) => {
|
|
@@ -1046,6 +1177,7 @@ export async function startDesignConnectBridge(
|
|
|
1046
1177
|
// an unauthenticated caller cannot read it. The server-side grant action
|
|
1047
1178
|
// obtains it out-of-band (via the exported bridge reference).
|
|
1048
1179
|
const bridgeToken = crypto.randomBytes(32).toString("hex");
|
|
1180
|
+
let liveEditBridgeScript = "";
|
|
1049
1181
|
|
|
1050
1182
|
const server = http.createServer(
|
|
1051
1183
|
(req: IncomingMessage, res: ServerResponse) => {
|
|
@@ -1077,6 +1209,95 @@ export async function startDesignConnectBridge(
|
|
|
1077
1209
|
sendJson(res, 200, { ok: true, source: manifest.source });
|
|
1078
1210
|
return;
|
|
1079
1211
|
}
|
|
1212
|
+
if (pathname === "/live-edit-bridge") {
|
|
1213
|
+
if (req.method !== "POST") {
|
|
1214
|
+
sendJson(res, 405, { ok: false, error: "method not allowed" });
|
|
1215
|
+
return;
|
|
1216
|
+
}
|
|
1217
|
+
const tokenHeader = req.headers["x-bridge-token"];
|
|
1218
|
+
const providedToken =
|
|
1219
|
+
typeof tokenHeader === "string" ? tokenHeader : "";
|
|
1220
|
+
let tokenValid = false;
|
|
1221
|
+
try {
|
|
1222
|
+
tokenValid =
|
|
1223
|
+
providedToken.length === bridgeToken.length &&
|
|
1224
|
+
crypto.timingSafeEqual(
|
|
1225
|
+
Buffer.from(providedToken, "utf8"),
|
|
1226
|
+
Buffer.from(bridgeToken, "utf8"),
|
|
1227
|
+
);
|
|
1228
|
+
} catch {
|
|
1229
|
+
tokenValid = false;
|
|
1230
|
+
}
|
|
1231
|
+
if (!tokenValid) {
|
|
1232
|
+
sendJson(res, 401, {
|
|
1233
|
+
ok: false,
|
|
1234
|
+
error: "invalid or missing bridge token",
|
|
1235
|
+
});
|
|
1236
|
+
return;
|
|
1237
|
+
}
|
|
1238
|
+
void (async () => {
|
|
1239
|
+
try {
|
|
1240
|
+
const raw = await readRequestBody(req);
|
|
1241
|
+
const body = JSON.parse(raw) as Record<string, unknown>;
|
|
1242
|
+
const script =
|
|
1243
|
+
typeof body["script"] === "string" ? body["script"] : "";
|
|
1244
|
+
if (!script.includes("agent-native:editor-chrome-ready")) {
|
|
1245
|
+
sendJson(res, 400, {
|
|
1246
|
+
ok: false,
|
|
1247
|
+
error: "script must install the Agent Native editor bridge",
|
|
1248
|
+
});
|
|
1249
|
+
return;
|
|
1250
|
+
}
|
|
1251
|
+
liveEditBridgeScript = script;
|
|
1252
|
+
sendJson(res, 200, { ok: true });
|
|
1253
|
+
} catch (err: unknown) {
|
|
1254
|
+
sendJson(res, 400, {
|
|
1255
|
+
ok: false,
|
|
1256
|
+
error: err instanceof Error ? err.message : String(err),
|
|
1257
|
+
});
|
|
1258
|
+
}
|
|
1259
|
+
})();
|
|
1260
|
+
return;
|
|
1261
|
+
}
|
|
1262
|
+
if (pathname === "/live-edit") {
|
|
1263
|
+
if (req.method !== "GET") {
|
|
1264
|
+
sendJson(res, 405, { ok: false, error: "method not allowed" });
|
|
1265
|
+
return;
|
|
1266
|
+
}
|
|
1267
|
+
void (async () => {
|
|
1268
|
+
try {
|
|
1269
|
+
const requestUrl = new URL(req.url ?? "/", manifest.bridgeUrl);
|
|
1270
|
+
const targetUrl = resolvePreviewSnapshotUrl(
|
|
1271
|
+
manifest.devServerUrl,
|
|
1272
|
+
requestUrl.searchParams.get("url") ??
|
|
1273
|
+
requestUrl.searchParams.get("path"),
|
|
1274
|
+
);
|
|
1275
|
+
const snapshot = await fetchPreviewSnapshot(
|
|
1276
|
+
manifest.devServerUrl,
|
|
1277
|
+
targetUrl,
|
|
1278
|
+
);
|
|
1279
|
+
const html = injectLiveEditBridge(
|
|
1280
|
+
snapshot.html,
|
|
1281
|
+
new URL("/", manifest.bridgeUrl).toString(),
|
|
1282
|
+
liveEditBridgeScript,
|
|
1283
|
+
);
|
|
1284
|
+
sendText(
|
|
1285
|
+
res,
|
|
1286
|
+
snapshot.status >= 400 ? snapshot.status : 200,
|
|
1287
|
+
html,
|
|
1288
|
+
snapshot.contentType.includes("html")
|
|
1289
|
+
? snapshot.contentType
|
|
1290
|
+
: "text/html; charset=utf-8",
|
|
1291
|
+
);
|
|
1292
|
+
} catch (err: unknown) {
|
|
1293
|
+
sendJson(res, 400, {
|
|
1294
|
+
ok: false,
|
|
1295
|
+
error: err instanceof Error ? err.message : String(err),
|
|
1296
|
+
});
|
|
1297
|
+
}
|
|
1298
|
+
})();
|
|
1299
|
+
return;
|
|
1300
|
+
}
|
|
1080
1301
|
if (pathname === "/snapshot") {
|
|
1081
1302
|
if (req.method !== "GET") {
|
|
1082
1303
|
sendJson(res, 405, { ok: false, error: "method not allowed" });
|
|
@@ -1356,6 +1577,33 @@ export async function startDesignConnectBridge(
|
|
|
1356
1577
|
return;
|
|
1357
1578
|
}
|
|
1358
1579
|
|
|
1580
|
+
if (req.method === "GET" || req.method === "HEAD") {
|
|
1581
|
+
void (async () => {
|
|
1582
|
+
try {
|
|
1583
|
+
const targetUrl = resolvePreviewProxyUrl(
|
|
1584
|
+
manifest.devServerUrl,
|
|
1585
|
+
req.url,
|
|
1586
|
+
);
|
|
1587
|
+
const proxied = await fetchPreviewProxyResource(
|
|
1588
|
+
manifest.devServerUrl,
|
|
1589
|
+
targetUrl,
|
|
1590
|
+
);
|
|
1591
|
+
sendBytes(
|
|
1592
|
+
res,
|
|
1593
|
+
proxied.status >= 400 ? proxied.status : 200,
|
|
1594
|
+
req.method === "HEAD" ? Buffer.alloc(0) : proxied.body,
|
|
1595
|
+
proxied.headers,
|
|
1596
|
+
);
|
|
1597
|
+
} catch (err: unknown) {
|
|
1598
|
+
sendJson(res, 400, {
|
|
1599
|
+
ok: false,
|
|
1600
|
+
error: err instanceof Error ? err.message : String(err),
|
|
1601
|
+
});
|
|
1602
|
+
}
|
|
1603
|
+
})();
|
|
1604
|
+
return;
|
|
1605
|
+
}
|
|
1606
|
+
|
|
1359
1607
|
sendJson(res, 404, { ok: false, error: "not found" });
|
|
1360
1608
|
},
|
|
1361
1609
|
);
|