@agent-native/core 0.103.0 → 0.104.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/corpus/README.md +2 -2
- package/corpus/core/CHANGELOG.md +36 -0
- package/corpus/core/package.json +9 -2
- package/corpus/core/src/agent/engine/credential-errors.ts +2 -2
- package/corpus/core/src/agent/production-agent.ts +30 -0
- package/corpus/core/src/agent/run-store.ts +12 -2
- package/corpus/core/src/cli/create.ts +1 -0
- package/corpus/core/src/cli/skills-content/visual-plan-skill.ts +30 -11
- package/corpus/core/src/cli/templates-meta.ts +4 -3
- package/corpus/core/src/client/AgentAskPopover.tsx +89 -0
- package/corpus/core/src/client/AgentChatHome.tsx +4 -0
- package/corpus/core/src/client/AgentPanel.tsx +321 -223
- package/corpus/core/src/client/AssistantChat.tsx +6 -10
- package/corpus/core/src/client/MultiTabAssistantChat.tsx +53 -372
- package/corpus/core/src/client/agent-chat-adapter.ts +13 -1
- package/corpus/core/src/client/agent-page/AgentContextTab.tsx +133 -149
- package/corpus/core/src/client/agent-page/AgentEmptyState.tsx +44 -0
- package/corpus/core/src/client/agent-page/AgentJobsTab.tsx +153 -82
- package/corpus/core/src/client/agent-page/AgentTabFrame.tsx +39 -0
- package/corpus/core/src/client/agent-page/AgentTabsPage.tsx +368 -356
- package/corpus/core/src/client/agent-page/types.ts +1 -1
- package/corpus/core/src/client/analytics.ts +51 -5
- package/corpus/core/src/client/chat/run-recovery.tsx +12 -4
- package/corpus/core/src/client/composer/PromptComposer.tsx +5 -15
- package/corpus/core/src/client/composer/TiptapComposer.tsx +32 -3
- package/corpus/core/src/client/dynamic-suggestions.ts +3 -3
- package/corpus/core/src/client/index.ts +16 -1
- package/corpus/core/src/client/resources/ResourceTree.tsx +249 -38
- package/corpus/core/src/client/resources/ResourcesPanel.tsx +307 -140
- package/corpus/core/src/client/session-replay.ts +158 -5
- package/corpus/core/src/client/settings/AutomationsSection.tsx +30 -10
- package/corpus/core/src/client/settings/SettingsPanel.tsx +3 -2
- package/corpus/core/src/client/settings/SettingsTabsPage.tsx +2 -0
- package/corpus/core/src/client/settings/agent-settings-search.ts +2 -2
- package/corpus/core/src/client/use-chat-threads.ts +2 -0
- package/corpus/core/src/connections/catalog.ts +49 -7
- package/corpus/core/src/db/index.ts +6 -1
- package/corpus/core/src/extensions/actions.ts +106 -16
- package/corpus/core/src/extensions/content-patch.ts +22 -0
- package/corpus/core/src/extensions/routes.ts +18 -0
- package/corpus/core/src/extensions/store.ts +8 -0
- package/corpus/core/src/index.ts +3 -0
- package/corpus/core/src/ingestion/docx.ts +158 -0
- package/corpus/core/src/ingestion/figma-node-to-html.ts +1860 -0
- package/corpus/core/src/ingestion/figma.ts +548 -0
- package/corpus/core/src/ingestion/index.ts +107 -0
- package/corpus/core/src/ingestion/media.ts +264 -0
- package/corpus/core/src/ingestion/notion.ts +121 -0
- package/corpus/core/src/ingestion/office.ts +214 -0
- package/corpus/core/src/ingestion/orchestration.ts +160 -0
- package/corpus/core/src/ingestion/pptx.ts +333 -0
- package/corpus/core/src/ingestion/selection.ts +81 -0
- package/corpus/core/src/ingestion/website.ts +151 -0
- package/corpus/core/src/integrations/plugin.ts +45 -37
- package/corpus/core/src/localization/default-messages.ts +35 -12
- package/corpus/core/src/observability/hosted-model-experiment.ts +118 -0
- package/corpus/core/src/observability/traces.ts +5 -3
- package/corpus/core/src/provider-api/index.ts +452 -8
- package/corpus/core/src/scripts/agent-engines/list-agent-engines.ts +18 -1
- package/corpus/core/src/search-utils/index.ts +112 -0
- package/corpus/core/src/secrets/register-framework-secrets.ts +61 -0
- package/corpus/core/src/server/action-discovery.ts +33 -8
- package/corpus/core/src/server/agent-chat/framework-prompts.ts +2 -2
- package/corpus/core/src/server/agent-chat/prompt-resources.ts +144 -0
- package/corpus/core/src/server/agent-chat-plugin.ts +6 -0
- package/corpus/core/src/server/core-routes-plugin.ts +12 -0
- package/corpus/core/src/server/index.ts +30 -0
- package/corpus/core/src/server/workspace-provider-oauth.ts +583 -0
- package/corpus/core/src/styles/agent-native.css +9 -0
- package/corpus/core/src/templates/default/app/i18n/en-US.ts +3 -3
- package/corpus/core/src/templates/workspace-core/.agents/skills/extensions/SKILL.md +14 -5
- package/corpus/core/src/templates/workspace-root/.env.example +12 -0
- package/corpus/core/src/vite/client.ts +2 -0
- package/corpus/core/src/workspace-connections/index.ts +6 -0
- package/corpus/core/src/workspace-connections/lifecycle.ts +43 -0
- package/corpus/core/src/workspace-connections/store.ts +16 -0
- package/corpus/templates/analytics/.agents/skills/dashboard-management/SKILL.md +46 -3
- package/corpus/templates/analytics/AGENTS.md +9 -0
- package/corpus/templates/analytics/actions/dashboard-mutation-api.ts +120 -6
- package/corpus/templates/analytics/actions/mutate-dashboard.ts +92 -30
- package/corpus/templates/analytics/actions/update-dashboard.ts +5 -5
- package/corpus/templates/analytics/app/components/dashboard/SqlChart.tsx +313 -220
- package/corpus/templates/analytics/app/components/layout/CommandPalette.tsx +2 -2
- package/corpus/templates/analytics/app/components/layout/Layout.tsx +9 -6
- package/corpus/templates/analytics/app/components/layout/Sidebar.tsx +90 -64
- package/corpus/templates/analytics/app/i18n-data.ts +3 -3
- package/corpus/templates/analytics/app/lib/dashboard-list-loading.ts +25 -0
- package/corpus/templates/analytics/app/lib/item-popularity.ts +13 -4
- package/corpus/templates/analytics/app/pages/adhoc/sql-dashboard/DashboardFilterBar.tsx +1 -1
- package/corpus/templates/analytics/app/pages/adhoc/sql-dashboard/pivot.ts +8 -3
- package/corpus/templates/analytics/app/pages/adhoc/sql-dashboard/types.ts +1 -0
- package/corpus/templates/analytics/app/pages/sessions/SessionDetailPage.tsx +15 -3
- package/corpus/templates/analytics/changelog/2026-07-16-dashboard-filter-defaults-can-now-be-changed-reliably-withou.md +6 -0
- package/corpus/templates/analytics/changelog/2026-07-16-dashboard-lists-load-in-one-stable-order-without-popping-bet.md +6 -0
- package/corpus/templates/analytics/changelog/2026-07-16-fixed-dashboard-filter-dropdown-text-alignment.md +6 -0
- package/corpus/templates/analytics/changelog/2026-07-16-recurring-signed-in-users-can-now-be-viewed-as-weekly-bars-b.md +6 -0
- package/corpus/templates/analytics/changelog/2026-07-16-the-analytics-agent-can-now-duplicate-a-chart-and-place-the-.md +6 -0
- package/corpus/templates/analytics/seeds/dashboards/agent-native-templates-first-party.json +41 -1
- package/corpus/templates/analytics/server/lib/dashboard-catalog.ts +1 -1
- package/corpus/templates/analytics/server/lib/first-party-metric-catalog.ts +47 -1
- package/corpus/templates/analytics/server/lib/session-replay.ts +68 -0
- package/corpus/templates/analytics/server/plugins/agent-chat.ts +1 -0
- package/corpus/templates/analytics/server/routes/sessions/lookup.get.ts +47 -0
- package/corpus/templates/assets/.agents/skills/asset-generation/SKILL.md +16 -9
- package/corpus/templates/assets/.agents/skills/creative-context/SKILL.md +86 -0
- package/corpus/templates/assets/AGENTS.md +10 -0
- package/corpus/templates/assets/actions/create-generation-session.ts +59 -1
- package/corpus/templates/assets/actions/edit-image.ts +2 -0
- package/corpus/templates/assets/actions/generate-asset.ts +52 -0
- package/corpus/templates/assets/actions/generate-image-batch.ts +55 -0
- package/corpus/templates/assets/actions/generate-image.ts +219 -1
- package/corpus/templates/assets/actions/open-asset-picker.ts +14 -0
- package/corpus/templates/assets/actions/refine-image.ts +3 -0
- package/corpus/templates/assets/actions/restyle-image.ts +2 -0
- package/corpus/templates/assets/agent-native.app-skill.json +4 -0
- package/corpus/templates/assets/app/components/layout/Layout.tsx +2 -0
- package/corpus/templates/assets/app/i18n/zh-TW.ts +3 -0
- package/corpus/templates/assets/app/i18n-data.ts +29 -13
- package/corpus/templates/assets/app/routes/agent.tsx +7 -1
- package/corpus/templates/assets/app/routes/library.tsx +9 -0
- package/corpus/templates/assets/app/routes/settings.tsx +3 -0
- package/corpus/templates/assets/changelog/2026-07-16-creative-context-library.md +6 -0
- package/corpus/templates/assets/package.json +1 -0
- package/corpus/templates/assets/server/lib/image-processing.ts +1 -22
- package/corpus/templates/assets/server/plugins/creative-context.ts +205 -0
- package/corpus/templates/brain/app/i18n-data.ts +3 -3
- package/corpus/templates/brain/app/lib/brain.ts +1 -1
- package/corpus/templates/brain/server/lib/search.ts +17 -67
- package/corpus/templates/calendar/app/i18n-data.ts +3 -3
- package/corpus/templates/calendar/app/pages/BookingLinksPage.tsx +19 -18
- package/corpus/templates/chat/app/i18n/en-US.ts +3 -3
- package/corpus/templates/chat/app/lib/agent-page.tsx +10 -1
- package/corpus/templates/clips/.agents/skills/meetings/SKILL.md +1 -1
- package/corpus/templates/clips/AGENTS.md +4 -0
- package/corpus/templates/clips/actions/cleanup-transcript.ts +35 -4
- package/corpus/templates/clips/actions/create-meeting.ts +6 -2
- package/corpus/templates/clips/actions/create-organization.ts +3 -2
- package/corpus/templates/clips/actions/create-recording.ts +4 -1
- package/corpus/templates/clips/actions/finalize-recording.ts +44 -7
- package/corpus/templates/clips/actions/import-loom-recording.ts +4 -1
- package/corpus/templates/clips/actions/lib/create-recording-schema.ts +2 -2
- package/corpus/templates/clips/actions/list-meetings.ts +23 -5
- package/corpus/templates/clips/actions/list-organization-state.ts +1 -1
- package/corpus/templates/clips/actions/remove-silences.ts +10 -1
- package/corpus/templates/clips/actions/request-transcript.ts +53 -11
- package/corpus/templates/clips/actions/search-recordings-utils.ts +7 -0
- package/corpus/templates/clips/actions/search-recordings.ts +5 -8
- package/corpus/templates/clips/actions/set-organization-branding.ts +2 -2
- package/corpus/templates/clips/actions/stitch-recordings.ts +10 -5
- package/corpus/templates/clips/actions/update-ai-request-status.ts +38 -0
- package/corpus/templates/clips/app/components/editor/editor-layout.tsx +3 -4
- package/corpus/templates/clips/app/components/editor/editor-selection.ts +19 -0
- package/corpus/templates/clips/app/components/editor/stitch-manager.tsx +10 -10
- package/corpus/templates/clips/app/components/library/bulk-action-toolbar.tsx +1 -2
- package/corpus/templates/clips/app/components/library/library-grid.tsx +101 -93
- package/corpus/templates/clips/app/components/player/video-player.tsx +11 -0
- package/corpus/templates/clips/app/components/workspace/branding-editor.tsx +53 -1
- package/corpus/templates/clips/app/i18n/ar-SA.ts +7 -1
- package/corpus/templates/clips/app/i18n/de-DE.ts +7 -1
- package/corpus/templates/clips/app/i18n/en-US.ts +10 -4
- package/corpus/templates/clips/app/i18n/es-ES.ts +7 -1
- package/corpus/templates/clips/app/i18n/fr-FR.ts +7 -1
- package/corpus/templates/clips/app/i18n/hi-IN.ts +7 -1
- package/corpus/templates/clips/app/i18n/ja-JP.ts +7 -1
- package/corpus/templates/clips/app/i18n/ko-KR.ts +7 -1
- package/corpus/templates/clips/app/i18n/pt-BR.ts +7 -1
- package/corpus/templates/clips/app/i18n/zh-CN.ts +6 -1
- package/corpus/templates/clips/app/i18n/zh-TW.ts +6 -1
- package/corpus/templates/clips/app/routes/_app.settings._index.tsx +5 -9
- package/corpus/templates/clips/app/routes/_app.settings.organization.tsx +6 -2
- package/corpus/templates/clips/app/routes/r.$recordingId.tsx +129 -27
- package/corpus/templates/clips/app/routes/record.tsx +23 -2
- package/corpus/templates/clips/app/routes/share.$shareId.tsx +6 -2
- package/corpus/templates/clips/changelog/2026-07-16-authorized-viewers-can-open-shared-private-clips-without-a-m.md +6 -0
- package/corpus/templates/clips/changelog/2026-07-16-camera-bubble-hover-controls-appear-above-the-face.md +6 -0
- package/corpus/templates/clips/changelog/2026-07-16-chrome-extension-recovers-stale-recorder-state.md +6 -0
- package/corpus/templates/clips/changelog/2026-07-16-clips-agent-chat-no-longer-shows-a-separate-workspace-header.md +6 -0
- package/corpus/templates/clips/changelog/2026-07-16-clips-search-now-matches-recording-content-without-requiring.md +6 -0
- package/corpus/templates/clips/changelog/2026-07-16-declined-meetings-no-longer-show-desktop-reminders.md +6 -0
- package/corpus/templates/clips/changelog/2026-07-16-failed-desktop-saves-now-show-their-local-recovery-copy.md +6 -0
- package/corpus/templates/clips/changelog/2026-07-16-long-desktop-clips-now-preserve-complete-playback-synced-aud.md +6 -0
- package/corpus/templates/clips/changelog/2026-07-16-long-recording-lists-keep-stitch-and-library-actions-visible.md +6 -0
- package/corpus/templates/clips/changelog/2026-07-16-organization-admins-can-choose-new-recording-visibility.md +6 -0
- package/corpus/templates/clips/changelog/2026-07-16-remove-silences-now-shows-queued-active-completed-and-failed.md +6 -0
- package/corpus/templates/clips/changelog/2026-07-16-settings-no-longer-repeats-the-builder-connection-status-in-.md +6 -0
- package/corpus/templates/clips/changelog/2026-07-16-transcripts-now-appear-from-native-browser-speech-sooner-wit.md +6 -0
- package/corpus/templates/clips/chrome-extension/public/manifest.json +1 -1
- package/corpus/templates/clips/chrome-extension/src/background.ts +73 -1
- package/corpus/templates/clips/chrome-extension/src/native-recording-state.ts +32 -0
- package/corpus/templates/clips/chrome-extension/src/native-transcription.ts +248 -0
- package/corpus/templates/clips/chrome-extension/src/offscreen.ts +106 -0
- package/corpus/templates/clips/desktop/src/app.tsx +66 -28
- package/corpus/templates/clips/desktop/src/lib/recorder.ts +335 -285
- package/corpus/templates/clips/desktop/src/lib/single-flight.ts +7 -0
- package/corpus/templates/clips/desktop/src/lib/upload-verification.ts +51 -0
- package/corpus/templates/clips/desktop/src/overlays/bubble.tsx +2 -2
- package/corpus/templates/clips/desktop/src/overlays/finalizing.tsx +10 -2
- package/corpus/templates/clips/desktop/src/styles.css +13 -11
- package/corpus/templates/clips/desktop/src-tauri/src/clips/mod.rs +8 -9
- package/corpus/templates/clips/desktop/src-tauri/src/meetings_watcher.rs +1 -0
- package/corpus/templates/clips/desktop/src-tauri/src/native_screen/custom_capture.rs +88 -13
- package/corpus/templates/clips/desktop/src-tauri/src/native_screen/live_upload.rs +13 -2
- package/corpus/templates/clips/desktop/src-tauri/src/native_screen.rs +241 -6
- package/corpus/templates/clips/server/db/schema.ts +2 -2
- package/corpus/templates/clips/server/lib/builder-media-compression.ts +64 -67
- package/corpus/templates/clips/server/lib/calendar-event-classification.ts +19 -0
- package/corpus/templates/clips/server/lib/google-calendar-client.ts +1 -0
- package/corpus/templates/clips/server/lib/recordings.ts +40 -1
- package/corpus/templates/clips/server/plugins/agent-chat.ts +1 -0
- package/corpus/templates/clips/server/plugins/db.ts +2 -2
- package/corpus/templates/clips/server/routes/api/auth/google-calendar.get.ts +1 -1
- package/corpus/templates/clips/server/routes/api/public-recording.get.ts +14 -5
- package/corpus/templates/clips/server/routes/api/uploads/[recordingId]/chunk.post.ts +51 -1
- package/corpus/templates/clips/server/routes/api/video/[recordingId].get.ts +1 -64
- package/corpus/templates/clips/shared/media-worker-contract.ts +32 -15
- package/corpus/templates/content/.agents/skills/content/SKILL.md +16 -0
- package/corpus/templates/content/.agents/skills/creative-context/SKILL.md +85 -0
- package/corpus/templates/content/.agents/skills/notion-integration/SKILL.md +8 -0
- package/corpus/templates/content/AGENTS.md +9 -0
- package/corpus/templates/content/actions/create-document.ts +94 -0
- package/corpus/templates/content/actions/edit-document.ts +144 -4
- package/corpus/templates/content/actions/update-document.ts +138 -0
- package/corpus/templates/content/agent-native.app-skill.json +4 -0
- package/corpus/templates/content/app/components/layout/Layout.tsx +2 -0
- package/corpus/templates/content/app/i18n/zh-TW.ts +3 -0
- package/corpus/templates/content/app/i18n-data.ts +13 -4
- package/corpus/templates/content/app/routes/_app.agent.tsx +2 -1
- package/corpus/templates/content/app/routes/_app.settings.tsx +3 -0
- package/corpus/templates/content/changelog/2026-07-16-creative-context-library.md +6 -0
- package/corpus/templates/content/package.json +1 -0
- package/corpus/templates/content/server/plugins/creative-context.ts +31 -0
- package/corpus/templates/design/.agents/skills/creative-context/SKILL.md +116 -0
- package/corpus/templates/design/.agents/skills/design-generation/SKILL.md +16 -0
- package/corpus/templates/design/.agents/skills/design-systems/SKILL.md +8 -0
- package/corpus/templates/design/AGENTS.md +6 -0
- package/corpus/templates/design/actions/clone-creative-context-design.ts +176 -0
- package/corpus/templates/design/actions/edit-design.ts +128 -0
- package/corpus/templates/design/actions/generate-design.ts +278 -14
- package/corpus/templates/design/actions/generate-screens.ts +42 -1
- package/corpus/templates/design/agent-native.app-skill.json +4 -0
- package/corpus/templates/design/app/components/layout/Layout.tsx +7 -3
- package/corpus/templates/design/app/i18n/zh-TW.ts +3 -0
- package/corpus/templates/design/app/i18n-data.ts +10 -4
- package/corpus/templates/design/app/routes/agent.tsx +2 -1
- package/corpus/templates/design/app/routes/settings.tsx +3 -0
- package/corpus/templates/design/changelog/2026-07-16-creative-context-library.md +6 -0
- package/corpus/templates/design/changelog/2026-07-16-design-agent-chat-no-longer-shows-a-separate-workspace-header.md +6 -0
- package/corpus/templates/design/package.json +1 -0
- package/corpus/templates/design/server/lib/figma-design-context.ts +5 -335
- package/corpus/templates/design/server/lib/figma-node-to-html.ts +1 -1859
- package/corpus/templates/design/server/lib/import-design-files.ts +6 -8
- package/corpus/templates/design/server/plugins/creative-context.ts +31 -0
- package/corpus/templates/design/shared/generation-session.ts +7 -0
- package/corpus/templates/dispatch/app/i18n-data.ts +3 -3
- package/corpus/templates/forms/app/i18n/en-US.ts +3 -3
- package/corpus/templates/macros/app/i18n/en-US.ts +3 -3
- package/corpus/templates/mail/app/components/email/EmailThread.tsx +35 -5
- package/corpus/templates/mail/app/i18n/en-US.ts +3 -3
- package/corpus/templates/mail/changelog/2026-07-16-mail-previews-now-expand-to-show-the-full-message-without-an.md +6 -0
- package/corpus/templates/plan/.agents/skills/visual-plan/SKILL.md +30 -11
- package/corpus/templates/plan/AGENTS.md +21 -1
- package/corpus/templates/plan/actions/get-visual-plan.ts +1 -1
- package/corpus/templates/plan/actions/patch-visual-plan-source.ts +161 -0
- package/corpus/templates/plan/actions/read-visual-plan-source.ts +1 -1
- package/corpus/templates/plan/actions/update-visual-plan.ts +126 -10
- package/corpus/templates/plan/app/hooks/use-plans.ts +2 -0
- package/corpus/templates/plan/app/i18n/en-US.ts +3 -3
- package/corpus/templates/plan/app/pages/PlansPage.tsx +65 -62
- package/corpus/templates/plan/changelog/2026-07-16-local-plan-previews-now-load-annotations-containing-html-lik.md +6 -0
- package/corpus/templates/plan/changelog/2026-07-16-plan-agents-now-prevent-stale-edits-from-overwriting-newer-p.md +6 -0
- package/corpus/templates/plan/server/plan-mdx.ts +75 -2
- package/corpus/templates/slides/.agents/skills/create-deck/SKILL.md +21 -4
- package/corpus/templates/slides/.agents/skills/creative-context/SKILL.md +122 -0
- package/corpus/templates/slides/.agents/skills/design-systems/SKILL.md +11 -0
- package/corpus/templates/slides/.agents/skills/slide-editing/SKILL.md +12 -3
- package/corpus/templates/slides/AGENTS.md +6 -0
- package/corpus/templates/slides/actions/add-slide.ts +230 -14
- package/corpus/templates/slides/actions/clone-context-slide.ts +302 -0
- package/corpus/templates/slides/actions/create-deck.ts +130 -0
- package/corpus/templates/slides/actions/extract-pdf.ts +6 -2
- package/corpus/templates/slides/actions/import-file.ts +5 -4
- package/corpus/templates/slides/actions/patch-deck.ts +200 -10
- package/corpus/templates/slides/actions/update-slide.ts +208 -15
- package/corpus/templates/slides/app/components/layout/Layout.tsx +2 -0
- package/corpus/templates/slides/app/components/visual-editor/CanvasCommentPins.tsx +16 -1
- package/corpus/templates/slides/app/i18n/ar-SA.ts +3 -0
- package/corpus/templates/slides/app/i18n/de-DE.ts +3 -0
- package/corpus/templates/slides/app/i18n/en-US.ts +6 -3
- package/corpus/templates/slides/app/i18n/es-ES.ts +3 -0
- package/corpus/templates/slides/app/i18n/fr-FR.ts +3 -0
- package/corpus/templates/slides/app/i18n/hi-IN.ts +3 -0
- package/corpus/templates/slides/app/i18n/ja-JP.ts +3 -0
- package/corpus/templates/slides/app/i18n/ko-KR.ts +3 -0
- package/corpus/templates/slides/app/i18n/pt-BR.ts +3 -0
- package/corpus/templates/slides/app/i18n/zh-CN.ts +3 -0
- package/corpus/templates/slides/app/i18n/zh-TW.ts +3 -0
- package/corpus/templates/slides/app/lib/validate-native-slide-html.ts +176 -0
- package/corpus/templates/slides/app/routes/agent.tsx +7 -1
- package/corpus/templates/slides/app/routes/settings.tsx +3 -0
- package/corpus/templates/slides/changelog/2026-07-16-creative-context-library.md +6 -0
- package/corpus/templates/slides/changelog/2026-07-16-google-slides-native-cloning.md +6 -0
- package/corpus/templates/slides/package.json +1 -0
- package/corpus/templates/slides/server/handlers/import/docx-parser.ts +4 -85
- package/corpus/templates/slides/server/handlers/import/pptx-parser.ts +7 -421
- package/corpus/templates/slides/server/plugins/creative-context.ts +166 -0
- package/dist/agent/engine/credential-errors.d.ts +1 -1
- package/dist/agent/engine/credential-errors.d.ts.map +1 -1
- package/dist/agent/engine/credential-errors.js +2 -2
- package/dist/agent/engine/credential-errors.js.map +1 -1
- package/dist/agent/production-agent.d.ts.map +1 -1
- package/dist/agent/production-agent.js +25 -0
- package/dist/agent/production-agent.js.map +1 -1
- package/dist/agent/run-store.d.ts.map +1 -1
- package/dist/agent/run-store.js +12 -2
- package/dist/agent/run-store.js.map +1 -1
- package/dist/cli/create.d.ts.map +1 -1
- package/dist/cli/create.js +1 -0
- package/dist/cli/create.js.map +1 -1
- package/dist/cli/skills-content/visual-plan-skill.d.ts +1 -1
- package/dist/cli/skills-content/visual-plan-skill.d.ts.map +1 -1
- package/dist/cli/skills-content/visual-plan-skill.js +30 -11
- package/dist/cli/skills-content/visual-plan-skill.js.map +1 -1
- package/dist/cli/templates-meta.d.ts.map +1 -1
- package/dist/cli/templates-meta.js +4 -3
- package/dist/cli/templates-meta.js.map +1 -1
- package/dist/client/AgentAskPopover.d.ts +11 -0
- package/dist/client/AgentAskPopover.d.ts.map +1 -0
- package/dist/client/AgentAskPopover.js +30 -0
- package/dist/client/AgentAskPopover.js.map +1 -0
- package/dist/client/AgentChatHome.d.ts +1 -1
- package/dist/client/AgentChatHome.d.ts.map +1 -1
- package/dist/client/AgentChatHome.js +2 -2
- package/dist/client/AgentChatHome.js.map +1 -1
- package/dist/client/AgentPanel.d.ts +9 -19
- package/dist/client/AgentPanel.d.ts.map +1 -1
- package/dist/client/AgentPanel.js +119 -80
- package/dist/client/AgentPanel.js.map +1 -1
- package/dist/client/AssistantChat.d.ts.map +1 -1
- package/dist/client/AssistantChat.js +4 -4
- package/dist/client/AssistantChat.js.map +1 -1
- package/dist/client/MultiTabAssistantChat.d.ts +3 -9
- package/dist/client/MultiTabAssistantChat.d.ts.map +1 -1
- package/dist/client/MultiTabAssistantChat.js +49 -189
- package/dist/client/MultiTabAssistantChat.js.map +1 -1
- package/dist/client/agent-chat-adapter.d.ts.map +1 -1
- package/dist/client/agent-chat-adapter.js +12 -1
- package/dist/client/agent-chat-adapter.js.map +1 -1
- package/dist/client/agent-page/AgentContextTab.d.ts.map +1 -1
- package/dist/client/agent-page/AgentContextTab.js +26 -28
- package/dist/client/agent-page/AgentContextTab.js.map +1 -1
- package/dist/client/agent-page/AgentEmptyState.d.ts +13 -0
- package/dist/client/agent-page/AgentEmptyState.d.ts.map +1 -0
- package/dist/client/agent-page/AgentEmptyState.js +6 -0
- package/dist/client/agent-page/AgentEmptyState.js.map +1 -0
- package/dist/client/agent-page/AgentJobsTab.d.ts +1 -1
- package/dist/client/agent-page/AgentJobsTab.d.ts.map +1 -1
- package/dist/client/agent-page/AgentJobsTab.js +90 -58
- package/dist/client/agent-page/AgentJobsTab.js.map +1 -1
- package/dist/client/agent-page/AgentTabFrame.d.ts +12 -0
- package/dist/client/agent-page/AgentTabFrame.d.ts.map +1 -0
- package/dist/client/agent-page/AgentTabFrame.js +7 -0
- package/dist/client/agent-page/AgentTabFrame.js.map +1 -0
- package/dist/client/agent-page/AgentTabsPage.d.ts +9 -1
- package/dist/client/agent-page/AgentTabsPage.d.ts.map +1 -1
- package/dist/client/agent-page/AgentTabsPage.js +135 -99
- package/dist/client/agent-page/AgentTabsPage.js.map +1 -1
- package/dist/client/agent-page/types.d.ts +1 -1
- package/dist/client/agent-page/types.d.ts.map +1 -1
- package/dist/client/agent-page/types.js.map +1 -1
- package/dist/client/analytics.d.ts +10 -3
- package/dist/client/analytics.d.ts.map +1 -1
- package/dist/client/analytics.js +37 -2
- package/dist/client/analytics.js.map +1 -1
- package/dist/client/chat/run-recovery.d.ts.map +1 -1
- package/dist/client/chat/run-recovery.js +10 -3
- package/dist/client/chat/run-recovery.js.map +1 -1
- package/dist/client/composer/PromptComposer.d.ts.map +1 -1
- package/dist/client/composer/PromptComposer.js +2 -2
- package/dist/client/composer/PromptComposer.js.map +1 -1
- package/dist/client/composer/TiptapComposer.d.ts.map +1 -1
- package/dist/client/composer/TiptapComposer.js +15 -3
- package/dist/client/composer/TiptapComposer.js.map +1 -1
- package/dist/client/dynamic-suggestions.js +3 -3
- package/dist/client/dynamic-suggestions.js.map +1 -1
- package/dist/client/index.d.ts +4 -3
- package/dist/client/index.d.ts.map +1 -1
- package/dist/client/index.js +3 -2
- package/dist/client/index.js.map +1 -1
- package/dist/client/resources/ResourceTree.d.ts +5 -1
- package/dist/client/resources/ResourceTree.d.ts.map +1 -1
- package/dist/client/resources/ResourceTree.js +74 -5
- package/dist/client/resources/ResourceTree.js.map +1 -1
- package/dist/client/resources/ResourcesPanel.d.ts +11 -2
- package/dist/client/resources/ResourcesPanel.d.ts.map +1 -1
- package/dist/client/resources/ResourcesPanel.js +105 -31
- package/dist/client/resources/ResourcesPanel.js.map +1 -1
- package/dist/client/session-replay.d.ts +28 -0
- package/dist/client/session-replay.d.ts.map +1 -1
- package/dist/client/session-replay.js +122 -8
- package/dist/client/session-replay.js.map +1 -1
- package/dist/client/settings/AutomationsSection.d.ts +3 -1
- package/dist/client/settings/AutomationsSection.d.ts.map +1 -1
- package/dist/client/settings/AutomationsSection.js +16 -6
- package/dist/client/settings/AutomationsSection.js.map +1 -1
- package/dist/client/settings/SettingsPanel.d.ts.map +1 -1
- package/dist/client/settings/SettingsPanel.js +3 -3
- package/dist/client/settings/SettingsPanel.js.map +1 -1
- package/dist/client/settings/SettingsTabsPage.d.ts +2 -0
- package/dist/client/settings/SettingsTabsPage.d.ts.map +1 -1
- package/dist/client/settings/SettingsTabsPage.js.map +1 -1
- package/dist/client/settings/agent-settings-search.js +2 -2
- package/dist/client/settings/agent-settings-search.js.map +1 -1
- package/dist/client/use-chat-threads.d.ts +2 -0
- package/dist/client/use-chat-threads.d.ts.map +1 -1
- package/dist/client/use-chat-threads.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/connections/catalog.d.ts +41 -7
- package/dist/connections/catalog.d.ts.map +1 -1
- package/dist/connections/catalog.js +40 -7
- package/dist/connections/catalog.js.map +1 -1
- package/dist/db/index.d.ts +2 -2
- package/dist/db/index.d.ts.map +1 -1
- package/dist/db/index.js +2 -2
- package/dist/db/index.js.map +1 -1
- package/dist/extensions/actions.d.ts.map +1 -1
- package/dist/extensions/actions.js +85 -15
- package/dist/extensions/actions.js.map +1 -1
- package/dist/extensions/content-patch.d.ts +4 -0
- package/dist/extensions/content-patch.d.ts.map +1 -1
- package/dist/extensions/content-patch.js +18 -0
- package/dist/extensions/content-patch.js.map +1 -1
- package/dist/extensions/routes.d.ts.map +1 -1
- package/dist/extensions/routes.js +14 -0
- package/dist/extensions/routes.js.map +1 -1
- package/dist/extensions/store.d.ts +1 -0
- package/dist/extensions/store.d.ts.map +1 -1
- package/dist/extensions/store.js +4 -1
- package/dist/extensions/store.js.map +1 -1
- package/dist/file-upload/actions/upload-image.d.ts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/ingestion/docx.d.ts +16 -0
- package/dist/ingestion/docx.d.ts.map +1 -0
- package/dist/ingestion/docx.js +129 -0
- package/dist/ingestion/docx.js.map +1 -0
- package/dist/ingestion/figma-node-to-html.d.ts +304 -0
- package/dist/ingestion/figma-node-to-html.d.ts.map +1 -0
- package/dist/ingestion/figma-node-to-html.js +1292 -0
- package/dist/ingestion/figma-node-to-html.js.map +1 -0
- package/dist/ingestion/figma.d.ts +115 -0
- package/dist/ingestion/figma.d.ts.map +1 -0
- package/dist/ingestion/figma.js +399 -0
- package/dist/ingestion/figma.js.map +1 -0
- package/dist/ingestion/index.d.ts +11 -0
- package/dist/ingestion/index.d.ts.map +1 -0
- package/dist/ingestion/index.js +11 -0
- package/dist/ingestion/index.js.map +1 -0
- package/dist/ingestion/media.d.ts +36 -0
- package/dist/ingestion/media.d.ts.map +1 -0
- package/dist/ingestion/media.js +178 -0
- package/dist/ingestion/media.js.map +1 -0
- package/dist/ingestion/notion.d.ts +12 -0
- package/dist/ingestion/notion.d.ts.map +1 -0
- package/dist/ingestion/notion.js +104 -0
- package/dist/ingestion/notion.js.map +1 -0
- package/dist/ingestion/office.d.ts +45 -0
- package/dist/ingestion/office.d.ts.map +1 -0
- package/dist/ingestion/office.js +141 -0
- package/dist/ingestion/office.js.map +1 -0
- package/dist/ingestion/orchestration.d.ts +52 -0
- package/dist/ingestion/orchestration.d.ts.map +1 -0
- package/dist/ingestion/orchestration.js +89 -0
- package/dist/ingestion/orchestration.js.map +1 -0
- package/dist/ingestion/pptx.d.ts +28 -0
- package/dist/ingestion/pptx.d.ts.map +1 -0
- package/dist/ingestion/pptx.js +255 -0
- package/dist/ingestion/pptx.js.map +1 -0
- package/dist/ingestion/selection.d.ts +20 -0
- package/dist/ingestion/selection.d.ts.map +1 -0
- package/dist/ingestion/selection.js +52 -0
- package/dist/ingestion/selection.js.map +1 -0
- package/dist/ingestion/website.d.ts +27 -0
- package/dist/ingestion/website.d.ts.map +1 -0
- package/dist/ingestion/website.js +100 -0
- package/dist/ingestion/website.js.map +1 -0
- package/dist/integrations/plugin.d.ts.map +1 -1
- package/dist/integrations/plugin.js +32 -27
- package/dist/integrations/plugin.js.map +1 -1
- package/dist/localization/default-messages.d.ts +22 -0
- package/dist/localization/default-messages.d.ts.map +1 -1
- package/dist/localization/default-messages.js +31 -9
- package/dist/localization/default-messages.js.map +1 -1
- package/dist/observability/hosted-model-experiment.d.ts +39 -0
- package/dist/observability/hosted-model-experiment.d.ts.map +1 -0
- package/dist/observability/hosted-model-experiment.js +90 -0
- package/dist/observability/hosted-model-experiment.js.map +1 -0
- package/dist/observability/routes.d.ts +5 -5
- package/dist/observability/traces.d.ts.map +1 -1
- package/dist/observability/traces.js +5 -3
- package/dist/observability/traces.js.map +1 -1
- package/dist/progress/routes.d.ts +1 -1
- package/dist/provider-api/index.d.ts +35 -4
- package/dist/provider-api/index.d.ts.map +1 -1
- package/dist/provider-api/index.js +339 -8
- package/dist/provider-api/index.js.map +1 -1
- package/dist/resources/handlers.d.ts +1 -1
- package/dist/scripts/agent-engines/list-agent-engines.d.ts.map +1 -1
- package/dist/scripts/agent-engines/list-agent-engines.js +18 -1
- package/dist/scripts/agent-engines/list-agent-engines.js.map +1 -1
- package/dist/search-utils/index.d.ts +12 -0
- package/dist/search-utils/index.d.ts.map +1 -0
- package/dist/search-utils/index.js +95 -0
- package/dist/search-utils/index.js.map +1 -0
- package/dist/secrets/register-framework-secrets.d.ts.map +1 -1
- package/dist/secrets/register-framework-secrets.js +57 -0
- package/dist/secrets/register-framework-secrets.js.map +1 -1
- package/dist/secrets/routes.d.ts +9 -9
- package/dist/server/action-discovery.d.ts +8 -0
- package/dist/server/action-discovery.d.ts.map +1 -1
- package/dist/server/action-discovery.js +26 -9
- package/dist/server/action-discovery.js.map +1 -1
- package/dist/server/agent-chat/framework-prompts.js +2 -2
- package/dist/server/agent-chat/framework-prompts.js.map +1 -1
- package/dist/server/agent-chat/prompt-resources.d.ts +19 -0
- package/dist/server/agent-chat/prompt-resources.d.ts.map +1 -1
- package/dist/server/agent-chat/prompt-resources.js +95 -0
- package/dist/server/agent-chat/prompt-resources.js.map +1 -1
- package/dist/server/agent-chat-plugin.d.ts.map +1 -1
- package/dist/server/agent-chat-plugin.js +7 -0
- package/dist/server/agent-chat-plugin.js.map +1 -1
- package/dist/server/core-routes-plugin.d.ts.map +1 -1
- package/dist/server/core-routes-plugin.js +5 -0
- package/dist/server/core-routes-plugin.js.map +1 -1
- package/dist/server/index.d.ts +5 -1
- package/dist/server/index.d.ts.map +1 -1
- package/dist/server/index.js +5 -1
- package/dist/server/index.js.map +1 -1
- package/dist/server/workspace-provider-oauth.d.ts +48 -0
- package/dist/server/workspace-provider-oauth.d.ts.map +1 -0
- package/dist/server/workspace-provider-oauth.js +415 -0
- package/dist/server/workspace-provider-oauth.js.map +1 -0
- package/dist/styles/agent-native.css +9 -0
- package/dist/templates/chat/app/i18n/en-US.ts +3 -3
- package/dist/templates/chat/app/lib/agent-page.tsx +10 -1
- package/dist/templates/default/app/i18n/en-US.ts +3 -3
- package/dist/templates/workspace-core/.agents/skills/extensions/SKILL.md +14 -5
- package/dist/templates/workspace-root/.env.example +12 -0
- package/dist/vite/client.d.ts.map +1 -1
- package/dist/vite/client.js +2 -0
- package/dist/vite/client.js.map +1 -1
- package/dist/workspace-connections/index.d.ts +1 -0
- package/dist/workspace-connections/index.d.ts.map +1 -1
- package/dist/workspace-connections/index.js +1 -0
- package/dist/workspace-connections/index.js.map +1 -1
- package/dist/workspace-connections/lifecycle.d.ts +16 -0
- package/dist/workspace-connections/lifecycle.d.ts.map +1 -0
- package/dist/workspace-connections/lifecycle.js +14 -0
- package/dist/workspace-connections/lifecycle.js.map +1 -0
- package/dist/workspace-connections/store.d.ts.map +1 -1
- package/dist/workspace-connections/store.js +16 -0
- package/dist/workspace-connections/store.js.map +1 -1
- package/package.json +10 -3
- package/src/templates/chat/app/i18n/en-US.ts +3 -3
- package/src/templates/chat/app/lib/agent-page.spec.tsx +10 -1
- package/src/templates/chat/app/lib/agent-page.tsx +10 -1
- package/src/templates/default/app/i18n/en-US.ts +3 -3
- package/src/templates/workspace-core/.agents/skills/extensions/SKILL.md +14 -5
- package/src/templates/workspace-root/.env.example +12 -0
|
@@ -9,6 +9,13 @@ import {
|
|
|
9
9
|
getRequestOrgId,
|
|
10
10
|
} from "@agent-native/core/server/request-context";
|
|
11
11
|
import { assertAccess } from "@agent-native/core/sharing";
|
|
12
|
+
import {
|
|
13
|
+
delimitUntrustedReference,
|
|
14
|
+
getGenerationCreativeContext,
|
|
15
|
+
recordGenerationCreativeContext,
|
|
16
|
+
resolveGenerationCreativeContext,
|
|
17
|
+
} from "@agent-native/creative-context/server";
|
|
18
|
+
import type { CreativeContextReuseLabel } from "@agent-native/creative-context/types";
|
|
12
19
|
import { eq, inArray } from "drizzle-orm";
|
|
13
20
|
import { nanoid } from "nanoid";
|
|
14
21
|
import { z } from "zod";
|
|
@@ -179,6 +186,18 @@ export default defineAction({
|
|
|
179
186
|
.describe(
|
|
180
187
|
"Set by A2A callers (e.g. 'slides', 'design'). Audit log filters on this.",
|
|
181
188
|
),
|
|
189
|
+
creativeContextRequestId: z
|
|
190
|
+
.string()
|
|
191
|
+
.optional()
|
|
192
|
+
.describe(
|
|
193
|
+
"Internal immutable creative-context request ID supplied by the Assets picker.",
|
|
194
|
+
),
|
|
195
|
+
contextModeOverride: z
|
|
196
|
+
.literal("off")
|
|
197
|
+
.optional()
|
|
198
|
+
.describe(
|
|
199
|
+
"Disable Creative Context for this image generation only without changing the saved preference.",
|
|
200
|
+
),
|
|
182
201
|
activateSessionAsset: z.coerce
|
|
183
202
|
.boolean()
|
|
184
203
|
.default(true)
|
|
@@ -211,6 +230,165 @@ export default defineAction({
|
|
|
211
230
|
const session = args.sessionId
|
|
212
231
|
? await requireGenerationSessionInLibrary(args.sessionId, args.libraryId)
|
|
213
232
|
: null;
|
|
233
|
+
const contextOff = args.contextModeOverride === "off";
|
|
234
|
+
const lineageAssetId = args.sourceAssetId ?? args.subjectAssetId;
|
|
235
|
+
const [lineageAsset] = lineageAssetId
|
|
236
|
+
? await db
|
|
237
|
+
.select({
|
|
238
|
+
id: schema.assets.id,
|
|
239
|
+
libraryId: schema.assets.libraryId,
|
|
240
|
+
})
|
|
241
|
+
.from(schema.assets)
|
|
242
|
+
.where(eq(schema.assets.id, lineageAssetId))
|
|
243
|
+
.limit(1)
|
|
244
|
+
: [null];
|
|
245
|
+
if (
|
|
246
|
+
lineageAssetId &&
|
|
247
|
+
(!lineageAsset || lineageAsset.libraryId !== args.libraryId)
|
|
248
|
+
) {
|
|
249
|
+
throw new Error("Source asset must belong to this asset library.");
|
|
250
|
+
}
|
|
251
|
+
const sessionCreativeContext =
|
|
252
|
+
session && !contextOff
|
|
253
|
+
? await getGenerationCreativeContext(
|
|
254
|
+
{
|
|
255
|
+
appId: "assets",
|
|
256
|
+
artifactType: "generation-session",
|
|
257
|
+
artifactId: session.id,
|
|
258
|
+
},
|
|
259
|
+
{
|
|
260
|
+
artifactAccess: {
|
|
261
|
+
resourceType: "asset-library",
|
|
262
|
+
resourceId: args.libraryId,
|
|
263
|
+
},
|
|
264
|
+
},
|
|
265
|
+
)
|
|
266
|
+
: null;
|
|
267
|
+
const pickerCreativeContext =
|
|
268
|
+
args.creativeContextRequestId && !contextOff
|
|
269
|
+
? await getGenerationCreativeContext({
|
|
270
|
+
appId: "assets",
|
|
271
|
+
artifactType: "generation-request",
|
|
272
|
+
artifactId: args.creativeContextRequestId,
|
|
273
|
+
})
|
|
274
|
+
: null;
|
|
275
|
+
const lineageCreativeContext =
|
|
276
|
+
lineageAsset && !contextOff
|
|
277
|
+
? await getGenerationCreativeContext(
|
|
278
|
+
{
|
|
279
|
+
appId: "assets",
|
|
280
|
+
artifactType: "asset",
|
|
281
|
+
artifactId: lineageAsset.id,
|
|
282
|
+
},
|
|
283
|
+
{
|
|
284
|
+
artifactAccess: {
|
|
285
|
+
resourceType: "asset-library",
|
|
286
|
+
resourceId: args.libraryId,
|
|
287
|
+
},
|
|
288
|
+
},
|
|
289
|
+
)
|
|
290
|
+
: null;
|
|
291
|
+
if (
|
|
292
|
+
args.creativeContextRequestId &&
|
|
293
|
+
!contextOff &&
|
|
294
|
+
!pickerCreativeContext
|
|
295
|
+
) {
|
|
296
|
+
throw new Error(
|
|
297
|
+
"The creative-context picker request is missing or inaccessible. Reopen the picker to preserve its generation context.",
|
|
298
|
+
);
|
|
299
|
+
}
|
|
300
|
+
if (session && !contextOff && !sessionCreativeContext) {
|
|
301
|
+
throw new Error(
|
|
302
|
+
"The generation session has no immutable creative-context snapshot. Create a new session before generating more images.",
|
|
303
|
+
);
|
|
304
|
+
}
|
|
305
|
+
if (
|
|
306
|
+
sessionCreativeContext &&
|
|
307
|
+
pickerCreativeContext &&
|
|
308
|
+
sessionCreativeContext.contextPackId !==
|
|
309
|
+
pickerCreativeContext.contextPackId
|
|
310
|
+
) {
|
|
311
|
+
throw new Error(
|
|
312
|
+
"The picker and generation session use different creative-context snapshots.",
|
|
313
|
+
);
|
|
314
|
+
}
|
|
315
|
+
const immutableContexts = [
|
|
316
|
+
sessionCreativeContext,
|
|
317
|
+
pickerCreativeContext,
|
|
318
|
+
lineageCreativeContext,
|
|
319
|
+
].filter((value) => value !== null);
|
|
320
|
+
if (
|
|
321
|
+
immutableContexts.some(
|
|
322
|
+
(value) => value.contextPackId !== immutableContexts[0]?.contextPackId,
|
|
323
|
+
)
|
|
324
|
+
) {
|
|
325
|
+
throw new Error(
|
|
326
|
+
"The generation session, picker, and source asset use different creative-context snapshots.",
|
|
327
|
+
);
|
|
328
|
+
}
|
|
329
|
+
const storedCreativeContext =
|
|
330
|
+
sessionCreativeContext ??
|
|
331
|
+
pickerCreativeContext ??
|
|
332
|
+
lineageCreativeContext ??
|
|
333
|
+
null;
|
|
334
|
+
const creativeContext = contextOff
|
|
335
|
+
? await resolveGenerationCreativeContext({
|
|
336
|
+
role: "assets",
|
|
337
|
+
contextModeOverride: "off",
|
|
338
|
+
})
|
|
339
|
+
: storedCreativeContext?.contextPackId
|
|
340
|
+
? await resolveGenerationCreativeContext({
|
|
341
|
+
role: "assets",
|
|
342
|
+
contextPackId: storedCreativeContext.contextPackId,
|
|
343
|
+
contextPackSource: "inherited",
|
|
344
|
+
})
|
|
345
|
+
: storedCreativeContext
|
|
346
|
+
? {
|
|
347
|
+
contextMode: storedCreativeContext.contextMode,
|
|
348
|
+
contextPackId: null,
|
|
349
|
+
reuseLabels: [],
|
|
350
|
+
results: [],
|
|
351
|
+
}
|
|
352
|
+
: await resolveGenerationCreativeContext({
|
|
353
|
+
query: args.prompt,
|
|
354
|
+
role: "assets",
|
|
355
|
+
});
|
|
356
|
+
const creativeContextText = creativeContext.results
|
|
357
|
+
.map((result) => `${result.kind}: ${result.title}\n${result.excerpt}`)
|
|
358
|
+
.join("\n\n")
|
|
359
|
+
.split("<<<UNTRUSTED_REFERENCE>>>")
|
|
360
|
+
.join("")
|
|
361
|
+
.split("<<<END_UNTRUSTED_REFERENCE>>>")
|
|
362
|
+
.join("")
|
|
363
|
+
.trim();
|
|
364
|
+
const creativeContextInstructions = creativeContextText
|
|
365
|
+
? delimitUntrustedReference(creativeContextText)
|
|
366
|
+
: "";
|
|
367
|
+
const creativeContextReuseLabels =
|
|
368
|
+
creativeContext.reuseLabels as CreativeContextReuseLabel[];
|
|
369
|
+
const creativeContextProvenance = {
|
|
370
|
+
contextMode: creativeContext.contextMode,
|
|
371
|
+
contextPackId: creativeContext.contextPackId,
|
|
372
|
+
reuseLabels: creativeContextReuseLabels,
|
|
373
|
+
};
|
|
374
|
+
const elementProvenanceFor = (elementId: string) =>
|
|
375
|
+
creativeContextProvenance.reuseLabels.length
|
|
376
|
+
? creativeContextProvenance.reuseLabels.map((label) => ({
|
|
377
|
+
elementId: label.elementId ?? elementId,
|
|
378
|
+
influence: label.influence ?? ("reference-conditioned" as const),
|
|
379
|
+
...(label.itemId ? { itemId: label.itemId } : {}),
|
|
380
|
+
...(label.itemVersionId
|
|
381
|
+
? { itemVersionId: label.itemVersionId }
|
|
382
|
+
: {}),
|
|
383
|
+
label: label.label,
|
|
384
|
+
}))
|
|
385
|
+
: [
|
|
386
|
+
{
|
|
387
|
+
elementId,
|
|
388
|
+
influence: "generated" as const,
|
|
389
|
+
label: "Net-new image",
|
|
390
|
+
},
|
|
391
|
+
];
|
|
214
392
|
if (
|
|
215
393
|
session?.presetId &&
|
|
216
394
|
args.presetId &&
|
|
@@ -516,7 +694,11 @@ export default defineAction({
|
|
|
516
694
|
const compiledPrompt = compilePrompt({
|
|
517
695
|
libraryTitle: library.title,
|
|
518
696
|
styleBrief,
|
|
519
|
-
customInstructions: [
|
|
697
|
+
customInstructions: [
|
|
698
|
+
library.customInstructions,
|
|
699
|
+
presetInstructions,
|
|
700
|
+
creativeContextInstructions,
|
|
701
|
+
]
|
|
520
702
|
.filter((item) => item?.trim())
|
|
521
703
|
.join("\n\n"),
|
|
522
704
|
prompt: promptForRun,
|
|
@@ -618,6 +800,7 @@ export default defineAction({
|
|
|
618
800
|
sessionId: session?.id,
|
|
619
801
|
referenceSelection,
|
|
620
802
|
settingsUsed,
|
|
803
|
+
creativeContext: creativeContextProvenance,
|
|
621
804
|
};
|
|
622
805
|
await db.insert(schema.assetGenerationRuns).values({
|
|
623
806
|
id: runId,
|
|
@@ -640,6 +823,21 @@ export default defineAction({
|
|
|
640
823
|
metadata: stringifyJson(baseMetadata),
|
|
641
824
|
createdAt: now,
|
|
642
825
|
});
|
|
826
|
+
await recordGenerationCreativeContext(
|
|
827
|
+
{
|
|
828
|
+
appId: "assets",
|
|
829
|
+
artifactType: "generation-run",
|
|
830
|
+
artifactId: runId,
|
|
831
|
+
...creativeContextProvenance,
|
|
832
|
+
elementProvenance: elementProvenanceFor(runId),
|
|
833
|
+
},
|
|
834
|
+
{
|
|
835
|
+
artifactAccess: {
|
|
836
|
+
resourceType: "asset-library",
|
|
837
|
+
resourceId: args.libraryId,
|
|
838
|
+
},
|
|
839
|
+
},
|
|
840
|
+
);
|
|
643
841
|
|
|
644
842
|
await upsertVariantSlot({
|
|
645
843
|
runId,
|
|
@@ -740,6 +938,7 @@ export default defineAction({
|
|
|
740
938
|
provider: generated.provider,
|
|
741
939
|
providerGenerationId: generated.providerGenerationId,
|
|
742
940
|
creditsCharged: generated.creditsCharged,
|
|
941
|
+
creativeContext: creativeContextProvenance,
|
|
743
942
|
}),
|
|
744
943
|
})
|
|
745
944
|
.where(eq(schema.assetGenerationRuns.id, runId));
|
|
@@ -748,6 +947,7 @@ export default defineAction({
|
|
|
748
947
|
dismissed: true,
|
|
749
948
|
artifactType: "image",
|
|
750
949
|
Artifacts: [],
|
|
950
|
+
...creativeContextProvenance,
|
|
751
951
|
};
|
|
752
952
|
}
|
|
753
953
|
const asset = await withToolActivity(
|
|
@@ -792,10 +992,26 @@ export default defineAction({
|
|
|
792
992
|
sourceUrl: generated.sourceUrl,
|
|
793
993
|
providerGenerationId: generated.providerGenerationId,
|
|
794
994
|
creditsCharged: generated.creditsCharged,
|
|
995
|
+
creativeContext: creativeContextProvenance,
|
|
795
996
|
},
|
|
796
997
|
category,
|
|
797
998
|
}),
|
|
798
999
|
);
|
|
1000
|
+
await recordGenerationCreativeContext(
|
|
1001
|
+
{
|
|
1002
|
+
appId: "assets",
|
|
1003
|
+
artifactType: "asset",
|
|
1004
|
+
artifactId: asset.id,
|
|
1005
|
+
...creativeContextProvenance,
|
|
1006
|
+
elementProvenance: elementProvenanceFor(asset.id),
|
|
1007
|
+
},
|
|
1008
|
+
{
|
|
1009
|
+
artifactAccess: {
|
|
1010
|
+
resourceType: "asset-library",
|
|
1011
|
+
resourceId: args.libraryId,
|
|
1012
|
+
},
|
|
1013
|
+
},
|
|
1014
|
+
);
|
|
799
1015
|
if (session) {
|
|
800
1016
|
const itemCreatedAt = nowIso();
|
|
801
1017
|
await db.insert(schema.assetGenerationSessionItems).values({
|
|
@@ -841,6 +1057,7 @@ export default defineAction({
|
|
|
841
1057
|
provider: generated.provider,
|
|
842
1058
|
providerGenerationId: generated.providerGenerationId,
|
|
843
1059
|
creditsCharged: generated.creditsCharged,
|
|
1060
|
+
creativeContext: creativeContextProvenance,
|
|
844
1061
|
}),
|
|
845
1062
|
})
|
|
846
1063
|
.where(eq(schema.assetGenerationRuns.id, runId));
|
|
@@ -868,6 +1085,7 @@ export default defineAction({
|
|
|
868
1085
|
Artifacts: [
|
|
869
1086
|
`Image: ${serialized.url} (ID: ${asset.id}, Run: ${runId})`,
|
|
870
1087
|
],
|
|
1088
|
+
...creativeContextProvenance,
|
|
871
1089
|
};
|
|
872
1090
|
} catch (err) {
|
|
873
1091
|
const message =
|
|
@@ -80,6 +80,12 @@ const schema = z.object({
|
|
|
80
80
|
.string()
|
|
81
81
|
.optional()
|
|
82
82
|
.describe("Calling app id, for audit grouping, e.g. design."),
|
|
83
|
+
creativeContextRequestId: z
|
|
84
|
+
.string()
|
|
85
|
+
.optional()
|
|
86
|
+
.describe(
|
|
87
|
+
"Internal immutable creative-context request ID. Preserve this value when the picker starts generation.",
|
|
88
|
+
),
|
|
83
89
|
layout: layoutSchema
|
|
84
90
|
.default("default")
|
|
85
91
|
.describe(
|
|
@@ -140,6 +146,12 @@ function pickerPath(args: Partial<OpenAssetPickerArgs>): string {
|
|
|
140
146
|
}
|
|
141
147
|
if (args.includeLogo) params.set("includeLogo", "1");
|
|
142
148
|
if (args.callerAppId?.trim()) params.set("callerAppId", args.callerAppId);
|
|
149
|
+
if (args.creativeContextRequestId?.trim()) {
|
|
150
|
+
params.set(
|
|
151
|
+
"creativeContextRequestId",
|
|
152
|
+
args.creativeContextRequestId.trim(),
|
|
153
|
+
);
|
|
154
|
+
}
|
|
143
155
|
if (args.layout === "vertical") params.set("layout", "vertical");
|
|
144
156
|
for (const runId of args.candidateRunIds ?? []) {
|
|
145
157
|
if (runId.trim()) params.append("candidateRunIds", runId.trim());
|
|
@@ -215,6 +227,7 @@ const action = defineAction({
|
|
|
215
227
|
prompt: args.prompt ?? null,
|
|
216
228
|
aspectRatio: args.aspectRatio ?? null,
|
|
217
229
|
presetId: args.presetId ?? null,
|
|
230
|
+
creativeContextRequestId: args.creativeContextRequestId ?? null,
|
|
218
231
|
layout: args.layout,
|
|
219
232
|
_writeId: `open-asset-picker-${Date.now()}-${Math.random()
|
|
220
233
|
.toString(36)
|
|
@@ -252,6 +265,7 @@ const action = defineAction({
|
|
|
252
265
|
styleStrength: args.styleStrength,
|
|
253
266
|
includeLogo: args.includeLogo,
|
|
254
267
|
callerAppId: args.callerAppId ?? null,
|
|
268
|
+
creativeContextRequestId: args.creativeContextRequestId ?? null,
|
|
255
269
|
candidateRunIds: args.candidateRunIds ?? [],
|
|
256
270
|
autoGenerate: args.autoGenerate,
|
|
257
271
|
};
|
|
@@ -28,6 +28,7 @@ export default defineAction({
|
|
|
28
28
|
.describe(
|
|
29
29
|
"Set by A2A callers (e.g. 'slides', 'design') so audit logs can filter by app.",
|
|
30
30
|
),
|
|
31
|
+
contextModeOverride: z.literal("off").optional(),
|
|
31
32
|
}),
|
|
32
33
|
parallelSafe: true,
|
|
33
34
|
run: async ({
|
|
@@ -41,6 +42,7 @@ export default defineAction({
|
|
|
41
42
|
slotId,
|
|
42
43
|
source,
|
|
43
44
|
callerAppId,
|
|
45
|
+
contextModeOverride,
|
|
44
46
|
}) => {
|
|
45
47
|
const asset = await getAssetOrThrow(assetId);
|
|
46
48
|
if (sessionId) {
|
|
@@ -71,6 +73,7 @@ export default defineAction({
|
|
|
71
73
|
slotId,
|
|
72
74
|
source,
|
|
73
75
|
callerAppId,
|
|
76
|
+
contextModeOverride,
|
|
74
77
|
});
|
|
75
78
|
},
|
|
76
79
|
});
|
|
@@ -35,6 +35,7 @@ export default defineAction({
|
|
|
35
35
|
.describe(
|
|
36
36
|
"Set by A2A callers (e.g. 'slides', 'design') so audit logs can filter by app.",
|
|
37
37
|
),
|
|
38
|
+
contextModeOverride: z.literal("off").optional(),
|
|
38
39
|
}),
|
|
39
40
|
parallelSafe: true,
|
|
40
41
|
run: async (args) => {
|
|
@@ -60,6 +61,7 @@ export default defineAction({
|
|
|
60
61
|
slotId: args.slotId,
|
|
61
62
|
source: args.source,
|
|
62
63
|
callerAppId: args.callerAppId,
|
|
64
|
+
contextModeOverride: args.contextModeOverride,
|
|
63
65
|
});
|
|
64
66
|
},
|
|
65
67
|
});
|
|
@@ -13,6 +13,7 @@ import {
|
|
|
13
13
|
EMBED_MODE_QUERY_PARAM,
|
|
14
14
|
EMBED_TOKEN_QUERY_PARAM,
|
|
15
15
|
} from "@agent-native/core/shared";
|
|
16
|
+
import { CreativeContextComposerChip } from "@agent-native/creative-context/client";
|
|
16
17
|
import { HeaderActionsProvider } from "@agent-native/toolkit/app-shell";
|
|
17
18
|
import { IconMenu2 } from "@tabler/icons-react";
|
|
18
19
|
import { useState, useEffect } from "react";
|
|
@@ -170,6 +171,7 @@ export function Layout({ children }: LayoutProps) {
|
|
|
170
171
|
<GenerationResults threadId={threadId} />
|
|
171
172
|
)}
|
|
172
173
|
imageModelMenu={imageModelMenu}
|
|
174
|
+
composerSlot={<CreativeContextComposerChip />}
|
|
173
175
|
>
|
|
174
176
|
{appFrame}
|
|
175
177
|
</AgentSidebar>
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { LocaleCode } from "@agent-native/core/client";
|
|
2
|
+
import { creativeContextMessagesByLocale } from "@agent-native/creative-context/messages";
|
|
2
3
|
|
|
3
4
|
import zhTW from "./i18n/zh-TW";
|
|
4
5
|
|
|
@@ -594,6 +595,7 @@ const auditEnUS = {
|
|
|
594
595
|
} satisfies Record<string, string>;
|
|
595
596
|
|
|
596
597
|
const enUS = {
|
|
598
|
+
creativeContext: creativeContextMessagesByLocale["en-US"],
|
|
597
599
|
root: {
|
|
598
600
|
commandActions: "Actions",
|
|
599
601
|
commandSearch: "Search",
|
|
@@ -613,10 +615,10 @@ const enUS = {
|
|
|
613
615
|
collapseSidebar: "Collapse sidebar",
|
|
614
616
|
},
|
|
615
617
|
settings: {
|
|
616
|
-
agentTitle: "Agent
|
|
618
|
+
agentTitle: "Agent workspace",
|
|
617
619
|
agentDescription:
|
|
618
|
-
"Open the agent
|
|
619
|
-
openAgentSettings: "Open agent
|
|
620
|
+
"Open the agent workspace for model, API keys, automations, voice, and other agent controls.",
|
|
621
|
+
openAgentSettings: "Open agent workspace",
|
|
620
622
|
title: "Settings",
|
|
621
623
|
description: "Asset generation, storage, and brand kit access.",
|
|
622
624
|
connections: "Connections",
|
|
@@ -3654,13 +3656,27 @@ function mergeMessages(overrides: PartialMessages): Messages {
|
|
|
3654
3656
|
},
|
|
3655
3657
|
brandKits: { ...enUS.brandKits, ...overrides.brandKits },
|
|
3656
3658
|
library: { ...enUS.library, ...overrides.library },
|
|
3659
|
+
creativeContext: {
|
|
3660
|
+
...enUS.creativeContext,
|
|
3661
|
+
...overrides.creativeContext,
|
|
3662
|
+
},
|
|
3657
3663
|
};
|
|
3658
3664
|
}
|
|
3659
3665
|
|
|
3666
|
+
function mergeLocalizedMessages(
|
|
3667
|
+
locale: Exclude<LocaleCode, "en-US">,
|
|
3668
|
+
overrides: PartialMessages,
|
|
3669
|
+
): Messages {
|
|
3670
|
+
return mergeMessages({
|
|
3671
|
+
...overrides,
|
|
3672
|
+
creativeContext: creativeContextMessagesByLocale[locale],
|
|
3673
|
+
});
|
|
3674
|
+
}
|
|
3675
|
+
|
|
3660
3676
|
export const messagesByLocale = {
|
|
3661
3677
|
"en-US": enUS,
|
|
3662
|
-
"zh-TW":
|
|
3663
|
-
"zh-CN":
|
|
3678
|
+
"zh-TW": mergeLocalizedMessages("zh-TW", zhTW),
|
|
3679
|
+
"zh-CN": mergeLocalizedMessages("zh-CN", {
|
|
3664
3680
|
library: {
|
|
3665
3681
|
allLibraries: "所有库",
|
|
3666
3682
|
noDrafts: "暂无草稿。",
|
|
@@ -4492,7 +4508,7 @@ export const messagesByLocale = {
|
|
|
4492
4508
|
yourBrandKits: "您的品牌套件",
|
|
4493
4509
|
},
|
|
4494
4510
|
}),
|
|
4495
|
-
"es-ES":
|
|
4511
|
+
"es-ES": mergeLocalizedMessages("es-ES", {
|
|
4496
4512
|
library: {
|
|
4497
4513
|
allLibraries: "Todas las bibliotecas",
|
|
4498
4514
|
noDrafts: "Aún no hay borradores.",
|
|
@@ -4962,7 +4978,7 @@ export const messagesByLocale = {
|
|
|
4962
4978
|
daysAgo: "hace {{count}} d",
|
|
4963
4979
|
},
|
|
4964
4980
|
}),
|
|
4965
|
-
"fr-FR":
|
|
4981
|
+
"fr-FR": mergeLocalizedMessages("fr-FR", {
|
|
4966
4982
|
library: {
|
|
4967
4983
|
allLibraries: "Toutes les bibliothèques",
|
|
4968
4984
|
noDrafts: "Aucun brouillon pour l'instant.",
|
|
@@ -5410,7 +5426,7 @@ export const messagesByLocale = {
|
|
|
5410
5426
|
daysAgo: "il y a {{count}} j",
|
|
5411
5427
|
},
|
|
5412
5428
|
}),
|
|
5413
|
-
"de-DE":
|
|
5429
|
+
"de-DE": mergeLocalizedMessages("de-DE", {
|
|
5414
5430
|
library: {
|
|
5415
5431
|
allLibraries: "Alle Bibliotheken",
|
|
5416
5432
|
noDrafts: "Noch keine Entwürfe.",
|
|
@@ -5766,7 +5782,7 @@ export const messagesByLocale = {
|
|
|
5766
5782
|
},
|
|
5767
5783
|
brandKits: brandKitsDeDE,
|
|
5768
5784
|
}),
|
|
5769
|
-
"ja-JP":
|
|
5785
|
+
"ja-JP": mergeLocalizedMessages("ja-JP", {
|
|
5770
5786
|
library: {
|
|
5771
5787
|
allLibraries: "すべてのライブラリ",
|
|
5772
5788
|
noDrafts: "下書きはまだありません。",
|
|
@@ -6112,7 +6128,7 @@ export const messagesByLocale = {
|
|
|
6112
6128
|
},
|
|
6113
6129
|
brandKits: brandKitsJaJP,
|
|
6114
6130
|
}),
|
|
6115
|
-
"ko-KR":
|
|
6131
|
+
"ko-KR": mergeLocalizedMessages("ko-KR", {
|
|
6116
6132
|
library: {
|
|
6117
6133
|
allLibraries: "모든 라이브러리",
|
|
6118
6134
|
noDrafts: "아직 초안이 없습니다.",
|
|
@@ -6457,7 +6473,7 @@ export const messagesByLocale = {
|
|
|
6457
6473
|
},
|
|
6458
6474
|
brandKits: brandKitsKoKR,
|
|
6459
6475
|
}),
|
|
6460
|
-
"pt-BR":
|
|
6476
|
+
"pt-BR": mergeLocalizedMessages("pt-BR", {
|
|
6461
6477
|
library: {
|
|
6462
6478
|
allLibraries: "Todas as bibliotecas",
|
|
6463
6479
|
noDrafts: "Ainda não há rascunhos.",
|
|
@@ -6904,7 +6920,7 @@ export const messagesByLocale = {
|
|
|
6904
6920
|
daysAgo: "há {{count}} d",
|
|
6905
6921
|
},
|
|
6906
6922
|
}),
|
|
6907
|
-
"hi-IN":
|
|
6923
|
+
"hi-IN": mergeLocalizedMessages("hi-IN", {
|
|
6908
6924
|
library: {
|
|
6909
6925
|
allLibraries: "सभी लाइब्रेरी",
|
|
6910
6926
|
noDrafts: "अभी तक कोई ड्राफ़्ट नहीं।",
|
|
@@ -7247,7 +7263,7 @@ export const messagesByLocale = {
|
|
|
7247
7263
|
},
|
|
7248
7264
|
brandKits: brandKitsHiIN,
|
|
7249
7265
|
}),
|
|
7250
|
-
"ar-SA":
|
|
7266
|
+
"ar-SA": mergeLocalizedMessages("ar-SA", {
|
|
7251
7267
|
library: {
|
|
7252
7268
|
allLibraries: "جميع المكتبات",
|
|
7253
7269
|
noDrafts: "لا توجد مسودات بعد.",
|
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
import { AgentTabsPage } from "@agent-native/core/client";
|
|
2
|
+
import { createCreativeContextAgentTab } from "@agent-native/creative-context/client";
|
|
2
3
|
|
|
3
4
|
export default function AgentRoute() {
|
|
4
|
-
return
|
|
5
|
+
return (
|
|
6
|
+
<AgentTabsPage
|
|
7
|
+
appName="Assets"
|
|
8
|
+
extraTabFactories={[createCreativeContextAgentTab]}
|
|
9
|
+
/>
|
|
10
|
+
);
|
|
5
11
|
}
|
|
@@ -206,6 +206,7 @@ type HostConfig = {
|
|
|
206
206
|
styleStrength?: StyleStrength;
|
|
207
207
|
includeLogo?: boolean;
|
|
208
208
|
callerAppId?: string;
|
|
209
|
+
creativeContextRequestId?: string;
|
|
209
210
|
layout?: PickerLayout;
|
|
210
211
|
autoGenerate?: boolean;
|
|
211
212
|
candidateRunIds?: string[];
|
|
@@ -363,6 +364,10 @@ function normalizeHostConfig(value: unknown): HostConfig {
|
|
|
363
364
|
includeLogo: normalizeBoolean(record.includeLogo),
|
|
364
365
|
callerAppId:
|
|
365
366
|
typeof record.callerAppId === "string" ? record.callerAppId : undefined,
|
|
367
|
+
creativeContextRequestId:
|
|
368
|
+
typeof record.creativeContextRequestId === "string"
|
|
369
|
+
? record.creativeContextRequestId
|
|
370
|
+
: undefined,
|
|
366
371
|
layout: normalizePickerLayout(record.layout),
|
|
367
372
|
candidateRunIds: normalizeCandidateRunIds(record.candidateRunIds),
|
|
368
373
|
};
|
|
@@ -2216,6 +2221,8 @@ export function AssetPickerSurface() {
|
|
|
2216
2221
|
styleStrength: normalizeStyleStrength(params.get("styleStrength")),
|
|
2217
2222
|
includeLogo: normalizeBoolean(params.get("includeLogo")),
|
|
2218
2223
|
callerAppId: params.get("callerAppId") ?? undefined,
|
|
2224
|
+
creativeContextRequestId:
|
|
2225
|
+
params.get("creativeContextRequestId") ?? undefined,
|
|
2219
2226
|
layout: normalizePickerLayout(params.get("layout")),
|
|
2220
2227
|
candidateRunIds: normalizeCandidateRunIds(
|
|
2221
2228
|
params.getAll("candidateRunIds").length > 0
|
|
@@ -2760,6 +2767,7 @@ export function AssetPickerSurface() {
|
|
|
2760
2767
|
includeLogo: hostConfig.includeLogo,
|
|
2761
2768
|
source: "ui",
|
|
2762
2769
|
callerAppId: hostConfig.callerAppId,
|
|
2770
|
+
creativeContextRequestId: hostConfig.creativeContextRequestId,
|
|
2763
2771
|
} as any);
|
|
2764
2772
|
}, [
|
|
2765
2773
|
count,
|
|
@@ -2768,6 +2776,7 @@ export function AssetPickerSurface() {
|
|
|
2768
2776
|
effectiveAspectRatio,
|
|
2769
2777
|
generateBatch,
|
|
2770
2778
|
hostConfig.callerAppId,
|
|
2779
|
+
hostConfig.creativeContextRequestId,
|
|
2771
2780
|
hostConfig.includeLogo,
|
|
2772
2781
|
hostConfig.styleStrength,
|
|
2773
2782
|
hostConfig.tier,
|
|
@@ -16,6 +16,7 @@ import {
|
|
|
16
16
|
type OnboardingStepStatus,
|
|
17
17
|
} from "@agent-native/core/client/onboarding";
|
|
18
18
|
import { TeamPage } from "@agent-native/core/client/org";
|
|
19
|
+
import { CreativeContextSettingsLink } from "@agent-native/creative-context/client";
|
|
19
20
|
import {
|
|
20
21
|
IconAlertCircle,
|
|
21
22
|
IconCheck,
|
|
@@ -112,6 +113,8 @@ export default function SettingsPage() {
|
|
|
112
113
|
generalSearchEntries={generalSearchEntries}
|
|
113
114
|
general={
|
|
114
115
|
<div className="mx-auto w-full max-w-2xl space-y-6">
|
|
116
|
+
<CreativeContextSettingsLink />
|
|
117
|
+
|
|
115
118
|
<div>
|
|
116
119
|
<h2 className="text-lg font-semibold tracking-tight">
|
|
117
120
|
{t("settings.connections")}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import sharp from "sharp";
|
|
2
|
+
export { extractDominantColors } from "@agent-native/core/ingestion";
|
|
2
3
|
|
|
3
4
|
import type {
|
|
4
5
|
AspectRatio,
|
|
@@ -44,28 +45,6 @@ export async function makeThumbnail(buffer: Buffer): Promise<{
|
|
|
44
45
|
};
|
|
45
46
|
}
|
|
46
47
|
|
|
47
|
-
export async function extractDominantColors(buffer: Buffer): Promise<string[]> {
|
|
48
|
-
const { data } = await sharp(buffer, { failOn: "none" })
|
|
49
|
-
.resize(64, 64, { fit: "inside" })
|
|
50
|
-
.removeAlpha()
|
|
51
|
-
.raw()
|
|
52
|
-
.toBuffer({ resolveWithObject: true });
|
|
53
|
-
const buckets = new Map<string, number>();
|
|
54
|
-
for (let i = 0; i < data.length; i += 3) {
|
|
55
|
-
const r = Math.round(data[i] / 32) * 32;
|
|
56
|
-
const g = Math.round(data[i + 1] / 32) * 32;
|
|
57
|
-
const b = Math.round(data[i + 2] / 32) * 32;
|
|
58
|
-
const key = [r, g, b]
|
|
59
|
-
.map((v) => Math.max(0, Math.min(255, v)).toString(16).padStart(2, "0"))
|
|
60
|
-
.join("");
|
|
61
|
-
buckets.set(key, (buckets.get(key) ?? 0) + 1);
|
|
62
|
-
}
|
|
63
|
-
return [...buckets.entries()]
|
|
64
|
-
.sort((a, b) => b[1] - a[1])
|
|
65
|
-
.slice(0, 6)
|
|
66
|
-
.map(([hex]) => `#${hex.toUpperCase()}`);
|
|
67
|
-
}
|
|
68
|
-
|
|
69
48
|
export async function compositeLogo(input: {
|
|
70
49
|
image: Buffer;
|
|
71
50
|
logo: Buffer;
|