@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
|
@@ -25,8 +25,11 @@ export async function assertPresetSkeletonAssetsValid(input: {
|
|
|
25
25
|
skeleton.mask?.type === "asset" && typeof skeleton.mask.assetId === "string"
|
|
26
26
|
? skeleton.mask.assetId
|
|
27
27
|
: "";
|
|
28
|
-
if (!backgroundAssetId
|
|
28
|
+
if (!backgroundAssetId) return;
|
|
29
29
|
|
|
30
|
+
const assetIds = maskAssetId
|
|
31
|
+
? [backgroundAssetId, maskAssetId]
|
|
32
|
+
: [backgroundAssetId];
|
|
30
33
|
const rows = await input.db
|
|
31
34
|
.select({
|
|
32
35
|
id: schema.assets.id,
|
|
@@ -35,18 +38,15 @@ export async function assertPresetSkeletonAssetsValid(input: {
|
|
|
35
38
|
height: schema.assets.height,
|
|
36
39
|
})
|
|
37
40
|
.from(schema.assets)
|
|
38
|
-
.where(inArray(schema.assets.id,
|
|
41
|
+
.where(inArray(schema.assets.id, assetIds));
|
|
39
42
|
const background = rows.find((asset: any) => asset.id === backgroundAssetId);
|
|
43
|
+
if (!background || background.libraryId !== input.libraryId) {
|
|
44
|
+
throw new Error("Skeleton image must belong to this asset library.");
|
|
45
|
+
}
|
|
46
|
+
if (!maskAssetId) return;
|
|
40
47
|
const mask = rows.find((asset: any) => asset.id === maskAssetId);
|
|
41
|
-
if (
|
|
42
|
-
|
|
43
|
-
!mask ||
|
|
44
|
-
background.libraryId !== input.libraryId ||
|
|
45
|
-
mask.libraryId !== input.libraryId
|
|
46
|
-
) {
|
|
47
|
-
throw new Error(
|
|
48
|
-
"Skeleton image and mask must belong to this asset library.",
|
|
49
|
-
);
|
|
48
|
+
if (!mask || mask.libraryId !== input.libraryId) {
|
|
49
|
+
throw new Error("Skeleton mask must belong to this asset library.");
|
|
50
50
|
}
|
|
51
51
|
if (
|
|
52
52
|
typeof background.width !== "number" ||
|
|
@@ -30,9 +30,11 @@ import {
|
|
|
30
30
|
compositeLogo,
|
|
31
31
|
maskFromManualMaskAlpha,
|
|
32
32
|
maskFromPlateAlpha,
|
|
33
|
+
prepareGptImage2SkeletonInpaintImages,
|
|
33
34
|
} from "../server/lib/image-processing.js";
|
|
34
35
|
import { nowIso, parseJson, stringifyJson } from "../server/lib/json.js";
|
|
35
36
|
import {
|
|
37
|
+
aspectRatioValue,
|
|
36
38
|
clampCutoutAspectRatio,
|
|
37
39
|
normalizePresetSkeletonSpec,
|
|
38
40
|
skeletonUsesCanonicalLogo,
|
|
@@ -350,13 +352,21 @@ export default defineAction({
|
|
|
350
352
|
isSkeletonCutout &&
|
|
351
353
|
Boolean(skeletonAssets?.backgroundAsset) &&
|
|
352
354
|
resolvedModel === "gpt-image-2";
|
|
355
|
+
const skeletonInpaint = useSkeletonInpaint
|
|
356
|
+
? await inpaintReferencesForSkeleton(skeletonAssets)
|
|
357
|
+
: null;
|
|
353
358
|
const resolvedAspectRatio =
|
|
354
|
-
|
|
355
|
-
?
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
:
|
|
359
|
+
useSkeletonInpaint && skeletonInpaint
|
|
360
|
+
? closestSupportedAspectRatioForSize(
|
|
361
|
+
skeletonInpaint.size,
|
|
362
|
+
supportedAspectRatiosForModel("gpt-image-2"),
|
|
363
|
+
)
|
|
364
|
+
: isSkeletonCutout
|
|
365
|
+
? clampCutoutAspectRatio({
|
|
366
|
+
aspectRatio: outputAspectRatio,
|
|
367
|
+
supported: supportedAspectRatiosForModel("gpt-image-1"),
|
|
368
|
+
})
|
|
369
|
+
: outputAspectRatio;
|
|
360
370
|
if (
|
|
361
371
|
isSkeletonCutout &&
|
|
362
372
|
!useSkeletonInpaint &&
|
|
@@ -386,7 +396,7 @@ export default defineAction({
|
|
|
386
396
|
: "";
|
|
387
397
|
let references: ReferenceForGeneration[];
|
|
388
398
|
if (useSkeletonInpaint) {
|
|
389
|
-
references =
|
|
399
|
+
references = skeletonInpaint?.references ?? [];
|
|
390
400
|
} else {
|
|
391
401
|
const backgroundPlateReference =
|
|
392
402
|
backgroundPlateReferenceForSkeleton(skeletonAssets);
|
|
@@ -839,7 +849,10 @@ function backgroundPlateReferenceForSkeleton(
|
|
|
839
849
|
|
|
840
850
|
async function inpaintReferencesForSkeleton(
|
|
841
851
|
skeletonAssets: LoadedSkeletonAssets | null,
|
|
842
|
-
): Promise<
|
|
852
|
+
): Promise<{
|
|
853
|
+
references: ReferenceForGeneration[];
|
|
854
|
+
size: { width: number; height: number };
|
|
855
|
+
}> {
|
|
843
856
|
if (
|
|
844
857
|
!skeletonAssets?.backgroundAsset ||
|
|
845
858
|
!skeletonAssets.backgroundAssetId ||
|
|
@@ -853,26 +866,49 @@ async function inpaintReferencesForSkeleton(
|
|
|
853
866
|
plate: skeletonAssets.backgroundAsset,
|
|
854
867
|
})
|
|
855
868
|
: await maskFromPlateAlpha(skeletonAssets.backgroundAsset);
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
869
|
+
const prepared = await prepareGptImage2SkeletonInpaintImages({
|
|
870
|
+
plate: skeletonAssets.backgroundAsset,
|
|
871
|
+
mask,
|
|
872
|
+
});
|
|
873
|
+
return {
|
|
874
|
+
size: prepared.size,
|
|
875
|
+
references: [
|
|
876
|
+
{
|
|
877
|
+
id: skeletonAssets.backgroundAssetId,
|
|
878
|
+
role: "edit_target",
|
|
879
|
+
category: "skeleton",
|
|
880
|
+
mimeType: prepared.resized
|
|
881
|
+
? "image/png"
|
|
882
|
+
: skeletonAssets.backgroundMimeType,
|
|
883
|
+
data: prepared.plate.toString("base64"),
|
|
884
|
+
selectionReason: "explicit",
|
|
885
|
+
},
|
|
886
|
+
{
|
|
887
|
+
id:
|
|
888
|
+
skeletonAssets.maskAssetId ??
|
|
889
|
+
`${skeletonAssets.backgroundAssetId}:mask`,
|
|
890
|
+
role: "mask",
|
|
891
|
+
category: "skeleton",
|
|
892
|
+
mimeType: "image/png",
|
|
893
|
+
data: prepared.mask.toString("base64"),
|
|
894
|
+
selectionReason: "explicit",
|
|
895
|
+
},
|
|
896
|
+
],
|
|
897
|
+
};
|
|
898
|
+
}
|
|
899
|
+
|
|
900
|
+
function closestSupportedAspectRatioForSize(
|
|
901
|
+
size: { width: number; height: number },
|
|
902
|
+
supported: readonly AspectRatio[],
|
|
903
|
+
): AspectRatio {
|
|
904
|
+
const target = size.width / size.height;
|
|
905
|
+
return (
|
|
906
|
+
[...supported].sort(
|
|
907
|
+
(left, right) =>
|
|
908
|
+
Math.abs(aspectRatioValue(left) - target) -
|
|
909
|
+
Math.abs(aspectRatioValue(right) - target),
|
|
910
|
+
)[0] ?? "1:1"
|
|
911
|
+
);
|
|
876
912
|
}
|
|
877
913
|
|
|
878
914
|
type LoadedSkeletonAssets = {
|
|
@@ -44,7 +44,7 @@ function variantStateKey(threadId: string | null) {
|
|
|
44
44
|
// STALE_IMAGE_RUN_MS in refresh-generation-run, so a slow-but-healthy run (e.g.
|
|
45
45
|
// gpt-image-2) is not flagged "interrupted" and flipped to an error slot before
|
|
46
46
|
// its finished image arrives.
|
|
47
|
-
const STALE_PENDING_RUN_MS =
|
|
47
|
+
const STALE_PENDING_RUN_MS = 10 * 60 * 1000;
|
|
48
48
|
|
|
49
49
|
function slotTime(slot: AssetVariantState["slots"][number]): number {
|
|
50
50
|
const raw = slot.createdAt ?? slot.updatedAt ?? "";
|
|
@@ -107,6 +107,12 @@ const NO_COLLECTION = "__none__";
|
|
|
107
107
|
const NO_SKELETON_BACKGROUND = "__none__";
|
|
108
108
|
const NO_SKELETON_MASK = "__none__";
|
|
109
109
|
|
|
110
|
+
function usesSkeletonInpaintMode(
|
|
111
|
+
form: Pick<PresetFormState, "model" | "skeletonContentMode">,
|
|
112
|
+
) {
|
|
113
|
+
return form.skeletonContentMode === "cutout" && form.model === "gpt-image-2";
|
|
114
|
+
}
|
|
115
|
+
|
|
110
116
|
export function meta() {
|
|
111
117
|
return [{ title: messagesByLocale["en-US"].routeTitles.generationPreset }];
|
|
112
118
|
}
|
|
@@ -147,7 +153,7 @@ function buildSkeletonSpec(
|
|
|
147
153
|
...(previous?.foreground ?? []).filter(
|
|
148
154
|
(layer) => layer.source !== "canonicalLogo",
|
|
149
155
|
),
|
|
150
|
-
...(form.skeletonLogo
|
|
156
|
+
...(form.skeletonLogo && !usesSkeletonInpaintMode(form)
|
|
151
157
|
? [logoLayerFromPlacement(form.skeletonLogoPlacement)]
|
|
152
158
|
: []),
|
|
153
159
|
];
|
|
@@ -957,7 +963,7 @@ export default function GenerationPresetEditorRoute() {
|
|
|
957
963
|
</span>
|
|
958
964
|
</span>
|
|
959
965
|
</label>
|
|
960
|
-
<div className="grid gap-4 rounded-md border border-border p-4">
|
|
966
|
+
<div className="grid min-w-0 gap-4 rounded-md border border-border p-4">
|
|
961
967
|
<label
|
|
962
968
|
htmlFor="preset-skeleton-enabled"
|
|
963
969
|
className={cn("flex items-start gap-3", readOnly && "opacity-70")}
|
|
@@ -981,7 +987,7 @@ export default function GenerationPresetEditorRoute() {
|
|
|
981
987
|
</span>
|
|
982
988
|
</label>
|
|
983
989
|
{form.skeletonEnabled ? (
|
|
984
|
-
<div className="grid gap-4 sm:grid-cols-2">
|
|
990
|
+
<div className="grid min-w-0 gap-4 sm:grid-cols-2">
|
|
985
991
|
<div className="grid gap-2">
|
|
986
992
|
<FieldLabel>{t("brandKitDetail.contentMode")}</FieldLabel>
|
|
987
993
|
<Select
|
|
@@ -1004,9 +1010,9 @@ export default function GenerationPresetEditorRoute() {
|
|
|
1004
1010
|
</SelectContent>
|
|
1005
1011
|
</Select>
|
|
1006
1012
|
</div>
|
|
1007
|
-
<div className="grid gap-3 sm:col-span-2">
|
|
1013
|
+
<div className="grid min-w-0 gap-3 sm:col-span-2">
|
|
1008
1014
|
<FieldLabel>{t("brandKitDetail.skeletonImage")}</FieldLabel>
|
|
1009
|
-
<div className="grid gap-3
|
|
1015
|
+
<div className="grid min-w-0 gap-3 md:grid-cols-[minmax(12rem,1fr)_minmax(12rem,16rem)]">
|
|
1010
1016
|
<button
|
|
1011
1017
|
type="button"
|
|
1012
1018
|
className={cn(
|
|
@@ -1029,7 +1035,7 @@ export default function GenerationPresetEditorRoute() {
|
|
|
1029
1035
|
</span>
|
|
1030
1036
|
)}
|
|
1031
1037
|
</button>
|
|
1032
|
-
<div className="grid content-start gap-2">
|
|
1038
|
+
<div className="grid min-w-0 content-start gap-2">
|
|
1033
1039
|
<input
|
|
1034
1040
|
ref={skeletonFileInputRef}
|
|
1035
1041
|
type="file"
|
|
@@ -1043,7 +1049,7 @@ export default function GenerationPresetEditorRoute() {
|
|
|
1043
1049
|
<Button
|
|
1044
1050
|
type="button"
|
|
1045
1051
|
variant="outline"
|
|
1046
|
-
className="gap-2"
|
|
1052
|
+
className="w-full min-w-0 gap-2"
|
|
1047
1053
|
disabled={readOnly || skeletonUploadPending}
|
|
1048
1054
|
onClick={() => skeletonFileInputRef.current?.click()}
|
|
1049
1055
|
>
|
|
@@ -1052,9 +1058,11 @@ export default function GenerationPresetEditorRoute() {
|
|
|
1052
1058
|
) : (
|
|
1053
1059
|
<IconUpload className="h-4 w-4" />
|
|
1054
1060
|
)}
|
|
1055
|
-
|
|
1056
|
-
|
|
1057
|
-
|
|
1061
|
+
<span className="min-w-0 truncate">
|
|
1062
|
+
{skeletonUploadPending
|
|
1063
|
+
? t("brandKitDetail.uploadingSkeletonImage")
|
|
1064
|
+
: t("brandKitDetail.uploadSkeletonImage")}
|
|
1065
|
+
</span>
|
|
1058
1066
|
</Button>
|
|
1059
1067
|
<Select
|
|
1060
1068
|
value={
|
|
@@ -1064,7 +1072,7 @@ export default function GenerationPresetEditorRoute() {
|
|
|
1064
1072
|
disabled={readOnly || !skeletonBackgroundAssets.length}
|
|
1065
1073
|
onValueChange={updateSkeletonBackgroundAsset}
|
|
1066
1074
|
>
|
|
1067
|
-
<SelectTrigger>
|
|
1075
|
+
<SelectTrigger className="min-w-0">
|
|
1068
1076
|
<SelectValue
|
|
1069
1077
|
placeholder={t(
|
|
1070
1078
|
"brandKitDetail.chooseSkeletonImage",
|
|
@@ -1090,9 +1098,9 @@ export default function GenerationPresetEditorRoute() {
|
|
|
1090
1098
|
</div>
|
|
1091
1099
|
{form.skeletonContentMode === "cutout" &&
|
|
1092
1100
|
form.model === "gpt-image-2" ? (
|
|
1093
|
-
<div className="grid gap-3 sm:col-span-2">
|
|
1101
|
+
<div className="grid min-w-0 gap-3 sm:col-span-2">
|
|
1094
1102
|
<FieldLabel>{t("brandKitDetail.skeletonMask")}</FieldLabel>
|
|
1095
|
-
<div className="grid gap-3
|
|
1103
|
+
<div className="grid min-w-0 gap-3 md:grid-cols-[minmax(12rem,1fr)_minmax(12rem,16rem)]">
|
|
1096
1104
|
<button
|
|
1097
1105
|
type="button"
|
|
1098
1106
|
className={cn(
|
|
@@ -1119,7 +1127,7 @@ export default function GenerationPresetEditorRoute() {
|
|
|
1119
1127
|
</span>
|
|
1120
1128
|
)}
|
|
1121
1129
|
</button>
|
|
1122
|
-
<div className="grid content-start gap-2">
|
|
1130
|
+
<div className="grid min-w-0 content-start gap-2">
|
|
1123
1131
|
<input
|
|
1124
1132
|
ref={skeletonMaskFileInputRef}
|
|
1125
1133
|
type="file"
|
|
@@ -1133,7 +1141,7 @@ export default function GenerationPresetEditorRoute() {
|
|
|
1133
1141
|
<Button
|
|
1134
1142
|
type="button"
|
|
1135
1143
|
variant="outline"
|
|
1136
|
-
className="gap-2"
|
|
1144
|
+
className="w-full min-w-0 gap-2"
|
|
1137
1145
|
disabled={readOnly || skeletonMaskUploadPending}
|
|
1138
1146
|
onClick={() =>
|
|
1139
1147
|
skeletonMaskFileInputRef.current?.click()
|
|
@@ -1144,9 +1152,11 @@ export default function GenerationPresetEditorRoute() {
|
|
|
1144
1152
|
) : (
|
|
1145
1153
|
<IconUpload className="h-4 w-4" />
|
|
1146
1154
|
)}
|
|
1147
|
-
|
|
1148
|
-
|
|
1149
|
-
|
|
1155
|
+
<span className="min-w-0 truncate">
|
|
1156
|
+
{skeletonMaskUploadPending
|
|
1157
|
+
? t("brandKitDetail.uploadingSkeletonMask")
|
|
1158
|
+
: t("brandKitDetail.uploadSkeletonMask")}
|
|
1159
|
+
</span>
|
|
1150
1160
|
</Button>
|
|
1151
1161
|
<Select
|
|
1152
1162
|
value={form.skeletonMaskAssetId || NO_SKELETON_MASK}
|
|
@@ -1155,7 +1165,7 @@ export default function GenerationPresetEditorRoute() {
|
|
|
1155
1165
|
}
|
|
1156
1166
|
onValueChange={updateSkeletonMaskAsset}
|
|
1157
1167
|
>
|
|
1158
|
-
<SelectTrigger>
|
|
1168
|
+
<SelectTrigger className="min-w-0">
|
|
1159
1169
|
<SelectValue
|
|
1160
1170
|
placeholder={t(
|
|
1161
1171
|
"brandKitDetail.chooseSkeletonMask",
|
|
@@ -1207,61 +1217,68 @@ export default function GenerationPresetEditorRoute() {
|
|
|
1207
1217
|
</span>
|
|
1208
1218
|
</label>
|
|
1209
1219
|
) : null}
|
|
1210
|
-
|
|
1211
|
-
|
|
1212
|
-
|
|
1213
|
-
|
|
1214
|
-
|
|
1215
|
-
|
|
1216
|
-
|
|
1217
|
-
|
|
1218
|
-
|
|
1219
|
-
|
|
1220
|
-
|
|
1221
|
-
|
|
1222
|
-
|
|
1223
|
-
|
|
1224
|
-
|
|
1225
|
-
|
|
1226
|
-
|
|
1227
|
-
|
|
1228
|
-
|
|
1229
|
-
|
|
1230
|
-
|
|
1231
|
-
|
|
1232
|
-
|
|
1233
|
-
|
|
1234
|
-
|
|
1235
|
-
|
|
1236
|
-
|
|
1237
|
-
|
|
1238
|
-
|
|
1239
|
-
|
|
1240
|
-
|
|
1241
|
-
|
|
1242
|
-
skeletonLogoPlacement
|
|
1243
|
-
|
|
1244
|
-
|
|
1245
|
-
|
|
1246
|
-
|
|
1247
|
-
|
|
1248
|
-
|
|
1249
|
-
|
|
1250
|
-
|
|
1251
|
-
|
|
1252
|
-
|
|
1253
|
-
|
|
1254
|
-
|
|
1255
|
-
|
|
1256
|
-
|
|
1257
|
-
|
|
1258
|
-
|
|
1259
|
-
|
|
1260
|
-
|
|
1261
|
-
|
|
1262
|
-
|
|
1263
|
-
|
|
1264
|
-
|
|
1220
|
+
{!usesSkeletonInpaintMode(form) ? (
|
|
1221
|
+
<>
|
|
1222
|
+
<label
|
|
1223
|
+
htmlFor="preset-skeleton-logo"
|
|
1224
|
+
className={cn(
|
|
1225
|
+
"flex items-start gap-3 rounded-md border border-border p-3",
|
|
1226
|
+
readOnly && "opacity-70",
|
|
1227
|
+
)}
|
|
1228
|
+
>
|
|
1229
|
+
<Checkbox
|
|
1230
|
+
id="preset-skeleton-logo"
|
|
1231
|
+
checked={form.skeletonLogo}
|
|
1232
|
+
disabled={readOnly || !library?.canonicalLogoAssetId}
|
|
1233
|
+
onCheckedChange={(checked) =>
|
|
1234
|
+
updateForm({ skeletonLogo: checked === true })
|
|
1235
|
+
}
|
|
1236
|
+
className="mt-0.5"
|
|
1237
|
+
/>
|
|
1238
|
+
<span className="grid gap-1">
|
|
1239
|
+
<span className="text-sm font-medium leading-none">
|
|
1240
|
+
{t("brandKitDetail.placeLogoInSkeleton")}
|
|
1241
|
+
</span>
|
|
1242
|
+
<span className="text-xs text-muted-foreground">
|
|
1243
|
+
{t("brandKitDetail.placeLogoInSkeletonHint")}
|
|
1244
|
+
</span>
|
|
1245
|
+
</span>
|
|
1246
|
+
</label>
|
|
1247
|
+
<div className="grid gap-2">
|
|
1248
|
+
<FieldLabel>
|
|
1249
|
+
{t("brandKitDetail.logoPlacement")}
|
|
1250
|
+
</FieldLabel>
|
|
1251
|
+
<Select
|
|
1252
|
+
value={form.skeletonLogoPlacement}
|
|
1253
|
+
disabled={readOnly || !form.skeletonLogo}
|
|
1254
|
+
onValueChange={(value) =>
|
|
1255
|
+
updateForm({
|
|
1256
|
+
skeletonLogoPlacement:
|
|
1257
|
+
value as SkeletonLogoPlacement,
|
|
1258
|
+
})
|
|
1259
|
+
}
|
|
1260
|
+
>
|
|
1261
|
+
<SelectTrigger>
|
|
1262
|
+
<SelectValue />
|
|
1263
|
+
</SelectTrigger>
|
|
1264
|
+
<SelectContent>
|
|
1265
|
+
<SelectItem value="upper-right">
|
|
1266
|
+
{t("brandKitDetail.upperRight")}
|
|
1267
|
+
</SelectItem>
|
|
1268
|
+
<SelectItem value="upper-left">
|
|
1269
|
+
{t("brandKitDetail.upperLeft")}
|
|
1270
|
+
</SelectItem>
|
|
1271
|
+
<SelectItem value="lower-right">
|
|
1272
|
+
{t("brandKitDetail.lowerRight")}
|
|
1273
|
+
</SelectItem>
|
|
1274
|
+
<SelectItem value="lower-left">
|
|
1275
|
+
{t("brandKitDetail.lowerLeft")}
|
|
1276
|
+
</SelectItem>
|
|
1277
|
+
</SelectContent>
|
|
1278
|
+
</Select>
|
|
1279
|
+
</div>
|
|
1280
|
+
</>
|
|
1281
|
+
) : null}
|
|
1265
1282
|
</div>
|
|
1266
1283
|
) : null}
|
|
1267
1284
|
</div>
|
|
@@ -642,7 +642,11 @@ export async function generateWithManagedImageProvider(
|
|
|
642
642
|
const shouldFallback =
|
|
643
643
|
err instanceof BuilderImageGenerationError &&
|
|
644
644
|
[401, 402, 403, 429, 503, 504].includes(err.status ?? 0);
|
|
645
|
-
if (
|
|
645
|
+
if (
|
|
646
|
+
shouldFallback &&
|
|
647
|
+
input.mode !== "edit" &&
|
|
648
|
+
(await isManualImageGenerationConfigured())
|
|
649
|
+
) {
|
|
646
650
|
logGeneration("builder.fallback_to_manual", {
|
|
647
651
|
model: input.model,
|
|
648
652
|
status:
|
|
@@ -652,7 +656,7 @@ export async function generateWithManagedImageProvider(
|
|
|
652
656
|
return generateWithManualImageProvider(input);
|
|
653
657
|
}
|
|
654
658
|
if (shouldFallback && err instanceof BuilderImageGenerationError) {
|
|
655
|
-
throw createBuilderImageGenerationFallbackError(err);
|
|
659
|
+
throw createBuilderImageGenerationFallbackError(err, input);
|
|
656
660
|
}
|
|
657
661
|
throw err;
|
|
658
662
|
}
|
|
@@ -660,12 +664,15 @@ export async function generateWithManagedImageProvider(
|
|
|
660
664
|
|
|
661
665
|
function createBuilderImageGenerationFallbackError(
|
|
662
666
|
err: BuilderImageGenerationError,
|
|
667
|
+
input?: GenerateProviderInput,
|
|
663
668
|
): Error {
|
|
664
|
-
const message = builderImageGenerationFallbackMessage(err);
|
|
669
|
+
const message = builderImageGenerationFallbackMessage(err, input);
|
|
665
670
|
if ([401, 402, 403].includes(err.status ?? 0)) {
|
|
666
671
|
return new FeatureNotConfiguredError({
|
|
667
672
|
requiredCredential:
|
|
668
|
-
err.status === 401
|
|
673
|
+
input?.mode === "edit" || err.status === 401
|
|
674
|
+
? "BUILDER_PRIVATE_KEY"
|
|
675
|
+
: "GEMINI_API_KEY",
|
|
669
676
|
builderConnectUrl: "/_agent-native/builder/connect",
|
|
670
677
|
byokDocsUrl: "https://aistudio.google.com/apikey",
|
|
671
678
|
message,
|
|
@@ -676,8 +683,26 @@ function createBuilderImageGenerationFallbackError(
|
|
|
676
683
|
|
|
677
684
|
function builderImageGenerationFallbackMessage(
|
|
678
685
|
err: BuilderImageGenerationError,
|
|
686
|
+
input?: GenerateProviderInput,
|
|
679
687
|
): string {
|
|
680
688
|
const detail = err.detail ? `: ${err.detail}` : ".";
|
|
689
|
+
if (input?.mode === "edit") {
|
|
690
|
+
switch (err.status) {
|
|
691
|
+
case 401:
|
|
692
|
+
return `Masked skeleton inpainting needs Builder.io connected or reconnected${err.detail ? ` (${err.detail})` : ""}. Open Settings and click Connect Builder.io; manual OpenAI or Gemini fallback cannot pass image-edit masks.`;
|
|
693
|
+
case 402:
|
|
694
|
+
return `Builder.io is connected, but this Builder space cannot use managed image generation credits${detail} Masked skeleton inpainting cannot use manual OpenAI or Gemini fallback because it must pass an image-edit mask.`;
|
|
695
|
+
case 403:
|
|
696
|
+
return `Builder.io is connected, but this Builder space does not have access to managed image generation${detail} Ask a space admin to enable access or reconnect to a different Builder space; manual fallback cannot pass image-edit masks.`;
|
|
697
|
+
case 429:
|
|
698
|
+
return `Builder-managed masked inpainting is rate limited right now${detail} Retry shortly; manual OpenAI or Gemini fallback cannot pass image-edit masks.`;
|
|
699
|
+
case 503:
|
|
700
|
+
case 504:
|
|
701
|
+
return `Builder-managed masked inpainting is temporarily unavailable${detail} Retry shortly; manual OpenAI or Gemini fallback cannot pass image-edit masks.`;
|
|
702
|
+
default:
|
|
703
|
+
return `Builder-managed masked inpainting failed${detail} Retry with Builder-managed image generation; manual OpenAI or Gemini fallback cannot pass image-edit masks.`;
|
|
704
|
+
}
|
|
705
|
+
}
|
|
681
706
|
switch (err.status) {
|
|
682
707
|
case 401:
|
|
683
708
|
return `Image generation needs Builder.io connected or reconnected${err.detail ? ` (${err.detail})` : ""}. Open Settings and click Connect Builder.io, or expand the Asset generation setup step and add an OpenAI or Gemini API key as the manual fallback.`;
|
|
@@ -130,6 +130,137 @@ export async function maskFromManualMaskAlpha(input: {
|
|
|
130
130
|
});
|
|
131
131
|
}
|
|
132
132
|
|
|
133
|
+
const GPT_IMAGE_2_EDIT_SIZE_MULTIPLE = 16;
|
|
134
|
+
const GPT_IMAGE_2_EDIT_MIN_PIXELS = 655_360;
|
|
135
|
+
const GPT_IMAGE_2_EDIT_MAX_PIXELS = 8_294_400;
|
|
136
|
+
const GPT_IMAGE_2_EDIT_MAX_SIDE = 3840;
|
|
137
|
+
const GPT_IMAGE_2_EDIT_MAX_RATIO = 3;
|
|
138
|
+
|
|
139
|
+
export async function prepareGptImage2SkeletonInpaintImages(input: {
|
|
140
|
+
plate: Buffer;
|
|
141
|
+
mask: Buffer;
|
|
142
|
+
}): Promise<{
|
|
143
|
+
plate: Buffer;
|
|
144
|
+
mask: Buffer;
|
|
145
|
+
size: { width: number; height: number };
|
|
146
|
+
resized: boolean;
|
|
147
|
+
}> {
|
|
148
|
+
const metadata = await sharp(input.plate, { failOn: "none" }).metadata();
|
|
149
|
+
const width = metadata.width ?? 0;
|
|
150
|
+
const height = metadata.height ?? 0;
|
|
151
|
+
if (!width || !height) {
|
|
152
|
+
throw new Error(
|
|
153
|
+
"Skeleton inpainting background plate dimensions are invalid.",
|
|
154
|
+
);
|
|
155
|
+
}
|
|
156
|
+
const size = gptImage2EditSizeForPlate({ width, height });
|
|
157
|
+
const resized = size.width !== width || size.height !== height;
|
|
158
|
+
if (!resized) {
|
|
159
|
+
return { plate: input.plate, mask: input.mask, size, resized };
|
|
160
|
+
}
|
|
161
|
+
return {
|
|
162
|
+
plate: await sharp(input.plate, { failOn: "none" })
|
|
163
|
+
.rotate()
|
|
164
|
+
.resize({ width: size.width, height: size.height, fit: "fill" })
|
|
165
|
+
.png()
|
|
166
|
+
.toBuffer(),
|
|
167
|
+
mask: await sharp(input.mask, { failOn: "none" })
|
|
168
|
+
.resize({ width: size.width, height: size.height, fit: "fill" })
|
|
169
|
+
.png()
|
|
170
|
+
.toBuffer(),
|
|
171
|
+
size,
|
|
172
|
+
resized,
|
|
173
|
+
};
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
function gptImage2EditSizeForPlate(input: { width: number; height: number }): {
|
|
177
|
+
width: number;
|
|
178
|
+
height: number;
|
|
179
|
+
} {
|
|
180
|
+
if (isValidGptImage2EditSize(input)) return input;
|
|
181
|
+
const ratio =
|
|
182
|
+
Math.max(input.width, input.height) / Math.min(input.width, input.height);
|
|
183
|
+
if (ratio > GPT_IMAGE_2_EDIT_MAX_RATIO) {
|
|
184
|
+
throw new Error(
|
|
185
|
+
"gpt-image-2 skeleton inpainting requires a background plate aspect ratio no wider or taller than 3:1.",
|
|
186
|
+
);
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
const pixels = input.width * input.height;
|
|
190
|
+
let scale = 1;
|
|
191
|
+
if (pixels < GPT_IMAGE_2_EDIT_MIN_PIXELS) {
|
|
192
|
+
scale = Math.sqrt(GPT_IMAGE_2_EDIT_MIN_PIXELS / pixels);
|
|
193
|
+
} else if (pixels > GPT_IMAGE_2_EDIT_MAX_PIXELS) {
|
|
194
|
+
scale = Math.sqrt(GPT_IMAGE_2_EDIT_MAX_PIXELS / pixels);
|
|
195
|
+
}
|
|
196
|
+
scale = Math.min(
|
|
197
|
+
scale,
|
|
198
|
+
GPT_IMAGE_2_EDIT_MAX_SIDE / Math.max(input.width, input.height),
|
|
199
|
+
);
|
|
200
|
+
|
|
201
|
+
for (let attempt = 0; attempt < 200; attempt += 1) {
|
|
202
|
+
const candidate = {
|
|
203
|
+
width: roundToMultiple(
|
|
204
|
+
input.width * scale,
|
|
205
|
+
GPT_IMAGE_2_EDIT_SIZE_MULTIPLE,
|
|
206
|
+
),
|
|
207
|
+
height: roundToMultiple(
|
|
208
|
+
input.height * scale,
|
|
209
|
+
GPT_IMAGE_2_EDIT_SIZE_MULTIPLE,
|
|
210
|
+
),
|
|
211
|
+
};
|
|
212
|
+
if (isValidGptImage2EditSize(candidate)) return candidate;
|
|
213
|
+
const candidatePixels = candidate.width * candidate.height;
|
|
214
|
+
if (
|
|
215
|
+
candidatePixels < GPT_IMAGE_2_EDIT_MIN_PIXELS ||
|
|
216
|
+
candidate.width % GPT_IMAGE_2_EDIT_SIZE_MULTIPLE !== 0 ||
|
|
217
|
+
candidate.height % GPT_IMAGE_2_EDIT_SIZE_MULTIPLE !== 0
|
|
218
|
+
) {
|
|
219
|
+
scale *= 1.01;
|
|
220
|
+
} else {
|
|
221
|
+
scale *= 0.99;
|
|
222
|
+
}
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
throw new Error(
|
|
226
|
+
"Unable to prepare a valid gpt-image-2 skeleton inpainting size.",
|
|
227
|
+
);
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
function isValidGptImage2EditSize(input: {
|
|
231
|
+
width: number;
|
|
232
|
+
height: number;
|
|
233
|
+
}): boolean {
|
|
234
|
+
if (!Number.isInteger(input.width) || !Number.isInteger(input.height)) {
|
|
235
|
+
return false;
|
|
236
|
+
}
|
|
237
|
+
if (input.width <= 0 || input.height <= 0) return false;
|
|
238
|
+
if (Math.max(input.width, input.height) > GPT_IMAGE_2_EDIT_MAX_SIDE) {
|
|
239
|
+
return false;
|
|
240
|
+
}
|
|
241
|
+
if (
|
|
242
|
+
input.width % GPT_IMAGE_2_EDIT_SIZE_MULTIPLE !== 0 ||
|
|
243
|
+
input.height % GPT_IMAGE_2_EDIT_SIZE_MULTIPLE !== 0
|
|
244
|
+
) {
|
|
245
|
+
return false;
|
|
246
|
+
}
|
|
247
|
+
if (
|
|
248
|
+
Math.max(input.width, input.height) / Math.min(input.width, input.height) >
|
|
249
|
+
GPT_IMAGE_2_EDIT_MAX_RATIO
|
|
250
|
+
) {
|
|
251
|
+
return false;
|
|
252
|
+
}
|
|
253
|
+
const pixels = input.width * input.height;
|
|
254
|
+
return (
|
|
255
|
+
pixels >= GPT_IMAGE_2_EDIT_MIN_PIXELS &&
|
|
256
|
+
pixels <= GPT_IMAGE_2_EDIT_MAX_PIXELS
|
|
257
|
+
);
|
|
258
|
+
}
|
|
259
|
+
|
|
260
|
+
function roundToMultiple(value: number, multiple: number): number {
|
|
261
|
+
return Math.max(multiple, Math.round(value / multiple) * multiple);
|
|
262
|
+
}
|
|
263
|
+
|
|
133
264
|
async function maskFromAlphaChannel(input: {
|
|
134
265
|
image: Buffer;
|
|
135
266
|
expectedSize?: { width: number; height: number };
|