@agent-native/core 0.103.1 → 0.105.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 +61 -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/deploy/build.ts +23 -0
- 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/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/app/routes.ts +3 -1
- 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/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/deploy/build.d.ts.map +1 -1
- package/dist/deploy/build.js +17 -0
- package/dist/deploy/build.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/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/notifications/routes.d.ts +2 -2
- 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/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/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/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
|
@@ -0,0 +1,399 @@
|
|
|
1
|
+
export function summarizeFigmaNode(value, options = {}) {
|
|
2
|
+
const root = asRecord(value);
|
|
3
|
+
if (!root)
|
|
4
|
+
throw new Error("Figma node must be an object.");
|
|
5
|
+
const maxDepth = options.maxDepth ?? 4;
|
|
6
|
+
const maxNodes = options.maxNodes ?? 300;
|
|
7
|
+
let nodeCount = 0;
|
|
8
|
+
let truncated = false;
|
|
9
|
+
const build = (node, depth) => {
|
|
10
|
+
nodeCount++;
|
|
11
|
+
const bounding = asRecord(node.absoluteBoundingBox);
|
|
12
|
+
const box = bounding
|
|
13
|
+
? {
|
|
14
|
+
x: round(numberValue(bounding.x) ?? 0),
|
|
15
|
+
y: round(numberValue(bounding.y) ?? 0),
|
|
16
|
+
width: round(numberValue(bounding.width) ?? 0),
|
|
17
|
+
height: round(numberValue(bounding.height) ?? 0),
|
|
18
|
+
}
|
|
19
|
+
: undefined;
|
|
20
|
+
const fills = array(node.fills).flatMap((paint) => {
|
|
21
|
+
const described = describeFigmaPaint(asRecord(paint), box);
|
|
22
|
+
return described ? [described] : [];
|
|
23
|
+
});
|
|
24
|
+
const strokePaints = array(node.strokes).flatMap((paint) => {
|
|
25
|
+
const described = describeFigmaPaint(asRecord(paint), box);
|
|
26
|
+
return described ? [described] : [];
|
|
27
|
+
});
|
|
28
|
+
const effects = array(node.effects).flatMap((effect) => {
|
|
29
|
+
const described = describeFigmaEffect(asRecord(effect));
|
|
30
|
+
return described ? [described] : [];
|
|
31
|
+
});
|
|
32
|
+
const characters = typeof node.characters === "string" ? node.characters : undefined;
|
|
33
|
+
const style = asRecord(node.style);
|
|
34
|
+
const children = array(node.children).flatMap((child) => {
|
|
35
|
+
const record = asRecord(child);
|
|
36
|
+
return record?.visible === false || !record ? [] : [record];
|
|
37
|
+
});
|
|
38
|
+
const summary = {
|
|
39
|
+
id: stringValue(node.id) ?? "",
|
|
40
|
+
name: stringValue(node.name) ?? stringValue(node.type) ?? "Untitled",
|
|
41
|
+
type: stringValue(node.type) ?? "UNKNOWN",
|
|
42
|
+
box,
|
|
43
|
+
opacity: numberValue(node.opacity) !== undefined &&
|
|
44
|
+
numberValue(node.opacity) < 1
|
|
45
|
+
? round(numberValue(node.opacity), 2)
|
|
46
|
+
: undefined,
|
|
47
|
+
blendMode: stringValue(node.blendMode) &&
|
|
48
|
+
node.blendMode !== "NORMAL" &&
|
|
49
|
+
node.blendMode !== "PASS_THROUGH"
|
|
50
|
+
? String(node.blendMode)
|
|
51
|
+
: undefined,
|
|
52
|
+
rotation: numberValue(node.rotation)
|
|
53
|
+
? round(numberValue(node.rotation), 2)
|
|
54
|
+
: undefined,
|
|
55
|
+
isMask: node.isMask === true ? true : undefined,
|
|
56
|
+
...(characters !== undefined
|
|
57
|
+
? {
|
|
58
|
+
text: {
|
|
59
|
+
characters: characters.length > 500
|
|
60
|
+
? `${characters.slice(0, 500)}…`
|
|
61
|
+
: characters,
|
|
62
|
+
truncated: characters.length > 500,
|
|
63
|
+
fontFamily: stringValue(style?.fontFamily),
|
|
64
|
+
fontWeight: numberValue(style?.fontWeight),
|
|
65
|
+
fontSize: numberValue(style?.fontSize),
|
|
66
|
+
lineHeightPx: numberValue(style?.lineHeightPx),
|
|
67
|
+
lineHeightPercent: numberValue(style?.lineHeightPercent),
|
|
68
|
+
letterSpacing: numberValue(style?.letterSpacing),
|
|
69
|
+
textAlignHorizontal: stringValue(style?.textAlignHorizontal),
|
|
70
|
+
textCase: stringValue(style?.textCase) && style?.textCase !== "ORIGINAL"
|
|
71
|
+
? String(style?.textCase)
|
|
72
|
+
: undefined,
|
|
73
|
+
textDecoration: stringValue(style?.textDecoration) &&
|
|
74
|
+
style?.textDecoration !== "NONE"
|
|
75
|
+
? String(style?.textDecoration)
|
|
76
|
+
: undefined,
|
|
77
|
+
},
|
|
78
|
+
}
|
|
79
|
+
: {}),
|
|
80
|
+
...(fills.length ? { fills } : {}),
|
|
81
|
+
...(strokePaints.length
|
|
82
|
+
? {
|
|
83
|
+
strokes: {
|
|
84
|
+
paints: strokePaints,
|
|
85
|
+
weight: numberValue(node.strokeWeight),
|
|
86
|
+
align: stringValue(node.strokeAlign),
|
|
87
|
+
},
|
|
88
|
+
}
|
|
89
|
+
: {}),
|
|
90
|
+
cornerRadius: figmaCornerRadius(node),
|
|
91
|
+
...(effects.length ? { effects } : {}),
|
|
92
|
+
...(node.layoutMode && node.layoutMode !== "NONE"
|
|
93
|
+
? {
|
|
94
|
+
layout: {
|
|
95
|
+
mode: String(node.layoutMode),
|
|
96
|
+
primaryAxisAlignItems: stringValue(node.primaryAxisAlignItems),
|
|
97
|
+
counterAxisAlignItems: stringValue(node.counterAxisAlignItems),
|
|
98
|
+
itemSpacing: numberValue(node.itemSpacing),
|
|
99
|
+
wrap: stringValue(node.layoutWrap),
|
|
100
|
+
padding: {
|
|
101
|
+
top: numberValue(node.paddingTop) ?? 0,
|
|
102
|
+
right: numberValue(node.paddingRight) ?? 0,
|
|
103
|
+
bottom: numberValue(node.paddingBottom) ?? 0,
|
|
104
|
+
left: numberValue(node.paddingLeft) ?? 0,
|
|
105
|
+
},
|
|
106
|
+
sizingHorizontal: stringValue(node.layoutSizingHorizontal),
|
|
107
|
+
sizingVertical: stringValue(node.layoutSizingVertical),
|
|
108
|
+
},
|
|
109
|
+
}
|
|
110
|
+
: {}),
|
|
111
|
+
componentId: stringValue(node.componentId),
|
|
112
|
+
isComponent: node.type === "COMPONENT" ? true : undefined,
|
|
113
|
+
isInstance: node.type === "INSTANCE" ? true : undefined,
|
|
114
|
+
styles: stringRecord(node.styles),
|
|
115
|
+
};
|
|
116
|
+
if (!children.length)
|
|
117
|
+
return summary;
|
|
118
|
+
if (depth >= maxDepth) {
|
|
119
|
+
summary.childCount = children.length;
|
|
120
|
+
summary.truncatedDepth = true;
|
|
121
|
+
truncated = true;
|
|
122
|
+
return summary;
|
|
123
|
+
}
|
|
124
|
+
const built = [];
|
|
125
|
+
for (const child of children) {
|
|
126
|
+
if (nodeCount >= maxNodes) {
|
|
127
|
+
summary.childCount = children.length - built.length;
|
|
128
|
+
summary.truncatedChildren = true;
|
|
129
|
+
truncated = true;
|
|
130
|
+
break;
|
|
131
|
+
}
|
|
132
|
+
built.push(build(child, depth + 1));
|
|
133
|
+
}
|
|
134
|
+
summary.children = built;
|
|
135
|
+
return summary;
|
|
136
|
+
};
|
|
137
|
+
return { node: build(root, 0), nodeCount, truncated };
|
|
138
|
+
}
|
|
139
|
+
export function extractFigmaTopLevelFrames(value) {
|
|
140
|
+
const document = asRecord(value);
|
|
141
|
+
const pages = array(document?.children);
|
|
142
|
+
const frames = pages
|
|
143
|
+
.flatMap((page) => array(asRecord(page)?.children))
|
|
144
|
+
.flatMap((child) => {
|
|
145
|
+
const record = asRecord(child);
|
|
146
|
+
return record ? [record] : [];
|
|
147
|
+
});
|
|
148
|
+
return frames.length > 0 ? frames : document ? [document] : [];
|
|
149
|
+
}
|
|
150
|
+
export function summarizeFigmaFrame(value) {
|
|
151
|
+
const frame = asRecord(value) ?? {};
|
|
152
|
+
const text = new Set();
|
|
153
|
+
const colors = new Set();
|
|
154
|
+
const typography = new Map();
|
|
155
|
+
const spacing = new Set();
|
|
156
|
+
const radii = new Set();
|
|
157
|
+
visitFigmaNode(frame, { text, colors, typography, spacing, radii });
|
|
158
|
+
return {
|
|
159
|
+
id: stringValue(frame.id) ?? "",
|
|
160
|
+
name: stringValue(frame.name) ?? "Untitled frame",
|
|
161
|
+
type: stringValue(frame.type) ?? "UNKNOWN",
|
|
162
|
+
text: [...text],
|
|
163
|
+
colors: [...colors],
|
|
164
|
+
typography: [...typography.values()],
|
|
165
|
+
spacing: [...spacing].sort(numberSort),
|
|
166
|
+
radii: [...radii].sort(numberSort),
|
|
167
|
+
};
|
|
168
|
+
}
|
|
169
|
+
export function figmaColorToHex(color, opacity = 1) {
|
|
170
|
+
const alpha = clamp(color.a ?? 1) * clamp(opacity);
|
|
171
|
+
const channels = [color.r, color.g, color.b].map((channel) => Math.round(clamp(channel) * 255)
|
|
172
|
+
.toString(16)
|
|
173
|
+
.padStart(2, "0"));
|
|
174
|
+
return `#${channels.join("")}${alpha < 1
|
|
175
|
+
? Math.round(alpha * 255)
|
|
176
|
+
.toString(16)
|
|
177
|
+
.padStart(2, "0")
|
|
178
|
+
: ""}`.toUpperCase();
|
|
179
|
+
}
|
|
180
|
+
export function compositeFigmaColors(foreground, background) {
|
|
181
|
+
const foregroundAlpha = clamp(foreground.a ?? 1);
|
|
182
|
+
const backgroundAlpha = clamp(background.a ?? 1);
|
|
183
|
+
const alpha = foregroundAlpha + backgroundAlpha * (1 - foregroundAlpha);
|
|
184
|
+
if (alpha === 0)
|
|
185
|
+
return { r: 0, g: 0, b: 0, a: 0 };
|
|
186
|
+
return {
|
|
187
|
+
r: (clamp(foreground.r) * foregroundAlpha +
|
|
188
|
+
clamp(background.r) * backgroundAlpha * (1 - foregroundAlpha)) /
|
|
189
|
+
alpha,
|
|
190
|
+
g: (clamp(foreground.g) * foregroundAlpha +
|
|
191
|
+
clamp(background.g) * backgroundAlpha * (1 - foregroundAlpha)) /
|
|
192
|
+
alpha,
|
|
193
|
+
b: (clamp(foreground.b) * foregroundAlpha +
|
|
194
|
+
clamp(background.b) * backgroundAlpha * (1 - foregroundAlpha)) /
|
|
195
|
+
alpha,
|
|
196
|
+
a: alpha,
|
|
197
|
+
};
|
|
198
|
+
}
|
|
199
|
+
export function figmaContrastRatio(a, b) {
|
|
200
|
+
const light = Math.max(relativeLuminance(a), relativeLuminance(b));
|
|
201
|
+
const dark = Math.min(relativeLuminance(a), relativeLuminance(b));
|
|
202
|
+
return (light + 0.05) / (dark + 0.05);
|
|
203
|
+
}
|
|
204
|
+
function visitFigmaNode(node, output) {
|
|
205
|
+
const characters = stringValue(node.characters);
|
|
206
|
+
if (characters)
|
|
207
|
+
output.text.add(characters);
|
|
208
|
+
for (const collection of [node.fills, node.strokes, node.background]) {
|
|
209
|
+
for (const value of array(collection)) {
|
|
210
|
+
const paint = asRecord(value);
|
|
211
|
+
const color = asColor(paint?.color);
|
|
212
|
+
if (color && paint?.visible !== false) {
|
|
213
|
+
output.colors.add(figmaColorToHex(color, numberValue(paint?.opacity) ?? 1));
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
}
|
|
217
|
+
const style = asRecord(node.style);
|
|
218
|
+
if (style) {
|
|
219
|
+
const typography = {
|
|
220
|
+
family: stringValue(style.fontFamily),
|
|
221
|
+
size: numberValue(style.fontSize),
|
|
222
|
+
weight: numberValue(style.fontWeight),
|
|
223
|
+
lineHeight: numberValue(style.lineHeightPx),
|
|
224
|
+
};
|
|
225
|
+
if (Object.values(typography).some((value) => value !== undefined)) {
|
|
226
|
+
output.typography.set(JSON.stringify(typography), typography);
|
|
227
|
+
}
|
|
228
|
+
}
|
|
229
|
+
for (const key of [
|
|
230
|
+
"itemSpacing",
|
|
231
|
+
"paddingLeft",
|
|
232
|
+
"paddingRight",
|
|
233
|
+
"paddingTop",
|
|
234
|
+
"paddingBottom",
|
|
235
|
+
]) {
|
|
236
|
+
const value = numberValue(node[key]);
|
|
237
|
+
if (value !== undefined)
|
|
238
|
+
output.spacing.add(value);
|
|
239
|
+
}
|
|
240
|
+
for (const value of [
|
|
241
|
+
node.cornerRadius,
|
|
242
|
+
...array(node.rectangleCornerRadii),
|
|
243
|
+
]) {
|
|
244
|
+
const radius = numberValue(value);
|
|
245
|
+
if (radius !== undefined)
|
|
246
|
+
output.radii.add(radius);
|
|
247
|
+
}
|
|
248
|
+
for (const child of array(node.children)) {
|
|
249
|
+
const record = asRecord(child);
|
|
250
|
+
if (record)
|
|
251
|
+
visitFigmaNode(record, output);
|
|
252
|
+
}
|
|
253
|
+
}
|
|
254
|
+
function relativeLuminance(color) {
|
|
255
|
+
const channels = [color.r, color.g, color.b].map((channel) => {
|
|
256
|
+
const value = clamp(channel);
|
|
257
|
+
return value <= 0.03928 ? value / 12.92 : ((value + 0.055) / 1.055) ** 2.4;
|
|
258
|
+
});
|
|
259
|
+
return 0.2126 * channels[0] + 0.7152 * channels[1] + 0.0722 * channels[2];
|
|
260
|
+
}
|
|
261
|
+
function describeFigmaPaint(paint, box) {
|
|
262
|
+
if (!paint || paint.visible === false)
|
|
263
|
+
return null;
|
|
264
|
+
const type = stringValue(paint.type) ?? "UNKNOWN";
|
|
265
|
+
const opacity = numberValue(paint.opacity);
|
|
266
|
+
if (type === "SOLID") {
|
|
267
|
+
const color = asColor(paint.color);
|
|
268
|
+
return {
|
|
269
|
+
type: "solid",
|
|
270
|
+
...(color ? { color: figmaColorToHex(color) } : {}),
|
|
271
|
+
...(opacity !== undefined && opacity < 1
|
|
272
|
+
? { opacity: round(opacity, 2) }
|
|
273
|
+
: {}),
|
|
274
|
+
};
|
|
275
|
+
}
|
|
276
|
+
if (type.startsWith("GRADIENT_")) {
|
|
277
|
+
const handles = array(paint.gradientHandlePositions)
|
|
278
|
+
.map(asRecord)
|
|
279
|
+
.filter(Boolean);
|
|
280
|
+
const figmaAngle = handles.length >= 2
|
|
281
|
+
? Math.atan2(((numberValue(handles[1].y) ?? 0) -
|
|
282
|
+
(numberValue(handles[0].y) ?? 0)) *
|
|
283
|
+
(box?.height ?? 1), ((numberValue(handles[1].x) ?? 0) -
|
|
284
|
+
(numberValue(handles[0].x) ?? 0)) *
|
|
285
|
+
(box?.width ?? 1)) *
|
|
286
|
+
(180 / Math.PI)
|
|
287
|
+
: undefined;
|
|
288
|
+
const angle = figmaAngle === undefined
|
|
289
|
+
? undefined
|
|
290
|
+
: (((figmaAngle + 90) % 360) + 360) % 360;
|
|
291
|
+
return {
|
|
292
|
+
type: `${type.replace("GRADIENT_", "").toLowerCase()}-gradient`,
|
|
293
|
+
...(opacity !== undefined && opacity < 1
|
|
294
|
+
? { opacity: round(opacity, 2) }
|
|
295
|
+
: {}),
|
|
296
|
+
...(angle !== undefined ? { angleDeg: round(angle) } : {}),
|
|
297
|
+
stops: array(paint.gradientStops).flatMap((value) => {
|
|
298
|
+
const stop = asRecord(value);
|
|
299
|
+
const color = asColor(stop?.color);
|
|
300
|
+
return color
|
|
301
|
+
? [
|
|
302
|
+
{
|
|
303
|
+
position: round(numberValue(stop?.position) ?? 0, 3),
|
|
304
|
+
color: figmaColorToHex(color),
|
|
305
|
+
},
|
|
306
|
+
]
|
|
307
|
+
: [];
|
|
308
|
+
}),
|
|
309
|
+
};
|
|
310
|
+
}
|
|
311
|
+
return {
|
|
312
|
+
type: type.toLowerCase(),
|
|
313
|
+
...(opacity !== undefined && opacity < 1
|
|
314
|
+
? { opacity: round(opacity, 2) }
|
|
315
|
+
: {}),
|
|
316
|
+
...(stringValue(paint.imageRef)
|
|
317
|
+
? { imageRef: stringValue(paint.imageRef) }
|
|
318
|
+
: {}),
|
|
319
|
+
...(stringValue(paint.scaleMode)
|
|
320
|
+
? { scaleMode: stringValue(paint.scaleMode) }
|
|
321
|
+
: {}),
|
|
322
|
+
};
|
|
323
|
+
}
|
|
324
|
+
function describeFigmaEffect(effect) {
|
|
325
|
+
if (!effect || effect.visible === false)
|
|
326
|
+
return null;
|
|
327
|
+
const offset = asRecord(effect.offset);
|
|
328
|
+
const color = asColor(effect.color);
|
|
329
|
+
return {
|
|
330
|
+
type: (stringValue(effect.type) ?? "unknown")
|
|
331
|
+
.toLowerCase()
|
|
332
|
+
.replace(/_/g, "-"),
|
|
333
|
+
...(color ? { color: figmaColorToHex(color) } : {}),
|
|
334
|
+
...(offset
|
|
335
|
+
? {
|
|
336
|
+
offset: {
|
|
337
|
+
x: round(numberValue(offset.x) ?? 0),
|
|
338
|
+
y: round(numberValue(offset.y) ?? 0),
|
|
339
|
+
},
|
|
340
|
+
}
|
|
341
|
+
: {}),
|
|
342
|
+
...(numberValue(effect.radius) !== undefined
|
|
343
|
+
? { radius: round(numberValue(effect.radius)) }
|
|
344
|
+
: {}),
|
|
345
|
+
...(numberValue(effect.spread) !== undefined
|
|
346
|
+
? { spread: round(numberValue(effect.spread)) }
|
|
347
|
+
: {}),
|
|
348
|
+
};
|
|
349
|
+
}
|
|
350
|
+
function figmaCornerRadius(node) {
|
|
351
|
+
const corners = array(node.rectangleCornerRadii).map(numberValue);
|
|
352
|
+
if (corners.length === 4 && corners.every((value) => value !== undefined)) {
|
|
353
|
+
return corners;
|
|
354
|
+
}
|
|
355
|
+
return numberValue(node.cornerRadius);
|
|
356
|
+
}
|
|
357
|
+
function asColor(value) {
|
|
358
|
+
const record = asRecord(value);
|
|
359
|
+
const r = numberValue(record?.r);
|
|
360
|
+
const g = numberValue(record?.g);
|
|
361
|
+
const b = numberValue(record?.b);
|
|
362
|
+
if (r === undefined || g === undefined || b === undefined)
|
|
363
|
+
return null;
|
|
364
|
+
return { r, g, b, a: numberValue(record?.a) };
|
|
365
|
+
}
|
|
366
|
+
function asRecord(value) {
|
|
367
|
+
return value && typeof value === "object" && !Array.isArray(value)
|
|
368
|
+
? value
|
|
369
|
+
: null;
|
|
370
|
+
}
|
|
371
|
+
function array(value) {
|
|
372
|
+
return Array.isArray(value) ? value : [];
|
|
373
|
+
}
|
|
374
|
+
function stringValue(value) {
|
|
375
|
+
return typeof value === "string" && value.trim() ? value.trim() : undefined;
|
|
376
|
+
}
|
|
377
|
+
function numberValue(value) {
|
|
378
|
+
return typeof value === "number" && Number.isFinite(value)
|
|
379
|
+
? value
|
|
380
|
+
: undefined;
|
|
381
|
+
}
|
|
382
|
+
function clamp(value) {
|
|
383
|
+
return Math.max(0, Math.min(1, value));
|
|
384
|
+
}
|
|
385
|
+
function numberSort(a, b) {
|
|
386
|
+
return a - b;
|
|
387
|
+
}
|
|
388
|
+
function round(value, decimals = 1) {
|
|
389
|
+
const factor = 10 ** decimals;
|
|
390
|
+
return Math.round(value * factor) / factor;
|
|
391
|
+
}
|
|
392
|
+
function stringRecord(value) {
|
|
393
|
+
const record = asRecord(value);
|
|
394
|
+
if (!record)
|
|
395
|
+
return undefined;
|
|
396
|
+
const entries = Object.entries(record).filter((entry) => typeof entry[1] === "string");
|
|
397
|
+
return entries.length ? Object.fromEntries(entries) : undefined;
|
|
398
|
+
}
|
|
399
|
+
//# sourceMappingURL=figma.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"figma.js","sourceRoot":"","sources":["../../src/ingestion/figma.ts"],"names":[],"mappings":"AA6FA,MAAM,UAAU,kBAAkB,CAChC,KAAc,EACd,OAAO,GAA6C,EAAE;IAEtD,MAAM,IAAI,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC;IAC7B,IAAI,CAAC,IAAI;QAAE,MAAM,IAAI,KAAK,CAAC,+BAA+B,CAAC,CAAC;IAC5D,MAAM,QAAQ,GAAG,OAAO,CAAC,QAAQ,IAAI,CAAC,CAAC;IACvC,MAAM,QAAQ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,QAAQ,CAAC,KAAK,CAAC,CAAC;IAC/B,IAAI,CAAC,MAAM;QAAE,OAAO,SAAS,CAAC;IAC9B,MAAM,OAAO,GAAG,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,MAAM,CAC3C,CAAC,KAAK,EAA6B,EAAE,CAAC,OAAO,KAAK,CAAC,CAAC,CAAC,KAAK,QAAQ,CACnE,CAAC;IACF,OAAO,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;AAClE,CAAC","sourcesContent":["export interface FigmaRgba {\n r: number;\n g: number;\n b: number;\n a?: number;\n}\n\nexport interface FigmaFrameSummary {\n id: string;\n name: string;\n type: string;\n text: string[];\n colors: string[];\n typography: Array<{\n family?: string;\n size?: number;\n weight?: number;\n lineHeight?: number;\n }>;\n spacing: number[];\n radii: number[];\n}\n\nexport interface FigmaContextNode {\n id: string;\n name: string;\n type: string;\n box?: { x: number; y: number; width: number; height: number };\n text?: {\n characters: string;\n truncated: boolean;\n fontFamily?: string;\n fontWeight?: number;\n fontSize?: number;\n lineHeightPx?: number;\n lineHeightPercent?: number;\n letterSpacing?: number;\n textAlignHorizontal?: string;\n textCase?: string;\n textDecoration?: string;\n };\n fills?: Array<{\n type: string;\n color?: string;\n opacity?: number;\n angleDeg?: number;\n stops?: Array<{ position: number; color: string }>;\n imageRef?: string;\n scaleMode?: string;\n }>;\n opacity?: number;\n blendMode?: string;\n rotation?: number;\n isMask?: boolean;\n strokes?: {\n paints: NonNullable<FigmaContextNode[\"fills\"]>;\n weight?: number;\n align?: string;\n };\n cornerRadius?: number | [number, number, number, number];\n effects?: Array<{\n type: string;\n color?: string;\n offset?: { x: number; y: number };\n radius?: number;\n spread?: number;\n }>;\n layout?: {\n mode: string;\n primaryAxisAlignItems?: string;\n counterAxisAlignItems?: string;\n itemSpacing?: number;\n wrap?: string;\n padding: { top: number; right: number; bottom: number; left: number };\n sizingHorizontal?: string;\n sizingVertical?: string;\n };\n componentId?: string;\n isComponent?: boolean;\n isInstance?: boolean;\n styles?: Record<string, string>;\n children?: FigmaContextNode[];\n childCount?: number;\n truncatedChildren?: boolean;\n truncatedDepth?: boolean;\n}\n\nexport interface SummarizeFigmaNodeResult {\n node: FigmaContextNode;\n nodeCount: number;\n truncated: boolean;\n}\n\nexport function summarizeFigmaNode(\n value: unknown,\n options: { maxDepth?: number; maxNodes?: number } = {},\n): SummarizeFigmaNodeResult {\n const root = asRecord(value);\n if (!root) throw new Error(\"Figma node must be an object.\");\n const maxDepth = options.maxDepth ?? 4;\n const maxNodes = options.maxNodes ?? 300;\n let nodeCount = 0;\n let truncated = false;\n const build = (\n node: Record<string, unknown>,\n depth: number,\n ): FigmaContextNode => {\n nodeCount++;\n const bounding = asRecord(node.absoluteBoundingBox);\n const box = bounding\n ? {\n x: round(numberValue(bounding.x) ?? 0),\n y: round(numberValue(bounding.y) ?? 0),\n width: round(numberValue(bounding.width) ?? 0),\n height: round(numberValue(bounding.height) ?? 0),\n }\n : undefined;\n const fills = array(node.fills).flatMap((paint) => {\n const described = describeFigmaPaint(asRecord(paint), box);\n return described ? [described] : [];\n });\n const strokePaints = array(node.strokes).flatMap((paint) => {\n const described = describeFigmaPaint(asRecord(paint), box);\n return described ? [described] : [];\n });\n const effects = array(node.effects).flatMap((effect) => {\n const described = describeFigmaEffect(asRecord(effect));\n return described ? [described] : [];\n });\n const characters =\n typeof node.characters === \"string\" ? node.characters : undefined;\n const style = asRecord(node.style);\n const children = array(node.children).flatMap((child) => {\n const record = asRecord(child);\n return record?.visible === false || !record ? [] : [record];\n });\n const summary: FigmaContextNode = {\n id: stringValue(node.id) ?? \"\",\n name: stringValue(node.name) ?? stringValue(node.type) ?? \"Untitled\",\n type: stringValue(node.type) ?? \"UNKNOWN\",\n box,\n opacity:\n numberValue(node.opacity) !== undefined &&\n numberValue(node.opacity)! < 1\n ? round(numberValue(node.opacity)!, 2)\n : undefined,\n blendMode:\n stringValue(node.blendMode) &&\n node.blendMode !== \"NORMAL\" &&\n node.blendMode !== \"PASS_THROUGH\"\n ? String(node.blendMode)\n : undefined,\n rotation: numberValue(node.rotation)\n ? round(numberValue(node.rotation)!, 2)\n : undefined,\n isMask: node.isMask === true ? true : undefined,\n ...(characters !== undefined\n ? {\n text: {\n characters:\n characters.length > 500\n ? `${characters.slice(0, 500)}…`\n : characters,\n truncated: characters.length > 500,\n fontFamily: stringValue(style?.fontFamily),\n fontWeight: numberValue(style?.fontWeight),\n fontSize: numberValue(style?.fontSize),\n lineHeightPx: numberValue(style?.lineHeightPx),\n lineHeightPercent: numberValue(style?.lineHeightPercent),\n letterSpacing: numberValue(style?.letterSpacing),\n textAlignHorizontal: stringValue(style?.textAlignHorizontal),\n textCase:\n stringValue(style?.textCase) && style?.textCase !== \"ORIGINAL\"\n ? String(style?.textCase)\n : undefined,\n textDecoration:\n stringValue(style?.textDecoration) &&\n style?.textDecoration !== \"NONE\"\n ? String(style?.textDecoration)\n : undefined,\n },\n }\n : {}),\n ...(fills.length ? { fills } : {}),\n ...(strokePaints.length\n ? {\n strokes: {\n paints: strokePaints,\n weight: numberValue(node.strokeWeight),\n align: stringValue(node.strokeAlign),\n },\n }\n : {}),\n cornerRadius: figmaCornerRadius(node),\n ...(effects.length ? { effects } : {}),\n ...(node.layoutMode && node.layoutMode !== \"NONE\"\n ? {\n layout: {\n mode: String(node.layoutMode),\n primaryAxisAlignItems: stringValue(node.primaryAxisAlignItems),\n counterAxisAlignItems: stringValue(node.counterAxisAlignItems),\n itemSpacing: numberValue(node.itemSpacing),\n wrap: stringValue(node.layoutWrap),\n padding: {\n top: numberValue(node.paddingTop) ?? 0,\n right: numberValue(node.paddingRight) ?? 0,\n bottom: numberValue(node.paddingBottom) ?? 0,\n left: numberValue(node.paddingLeft) ?? 0,\n },\n sizingHorizontal: stringValue(node.layoutSizingHorizontal),\n sizingVertical: stringValue(node.layoutSizingVertical),\n },\n }\n : {}),\n componentId: stringValue(node.componentId),\n isComponent: node.type === \"COMPONENT\" ? true : undefined,\n isInstance: node.type === \"INSTANCE\" ? true : undefined,\n styles: stringRecord(node.styles),\n };\n if (!children.length) return summary;\n if (depth >= maxDepth) {\n summary.childCount = children.length;\n summary.truncatedDepth = true;\n truncated = true;\n return summary;\n }\n const built: FigmaContextNode[] = [];\n for (const child of children) {\n if (nodeCount >= maxNodes) {\n summary.childCount = children.length - built.length;\n summary.truncatedChildren = true;\n truncated = true;\n break;\n }\n built.push(build(child, depth + 1));\n }\n summary.children = built;\n return summary;\n };\n return { node: build(root, 0), nodeCount, truncated };\n}\n\nexport function extractFigmaTopLevelFrames(\n value: unknown,\n): Record<string, unknown>[] {\n const document = asRecord(value);\n const pages = array(document?.children);\n const frames = pages\n .flatMap((page) => array(asRecord(page)?.children))\n .flatMap((child) => {\n const record = asRecord(child);\n return record ? [record] : [];\n });\n return frames.length > 0 ? frames : document ? [document] : [];\n}\n\nexport function summarizeFigmaFrame(value: unknown): FigmaFrameSummary {\n const frame = asRecord(value) ?? {};\n const text = new Set<string>();\n const colors = new Set<string>();\n const typography = new Map<string, FigmaFrameSummary[\"typography\"][number]>();\n const spacing = new Set<number>();\n const radii = new Set<number>();\n visitFigmaNode(frame, { text, colors, typography, spacing, radii });\n return {\n id: stringValue(frame.id) ?? \"\",\n name: stringValue(frame.name) ?? \"Untitled frame\",\n type: stringValue(frame.type) ?? \"UNKNOWN\",\n text: [...text],\n colors: [...colors],\n typography: [...typography.values()],\n spacing: [...spacing].sort(numberSort),\n radii: [...radii].sort(numberSort),\n };\n}\n\nexport function figmaColorToHex(color: FigmaRgba, opacity = 1): string {\n const alpha = clamp(color.a ?? 1) * clamp(opacity);\n const channels = [color.r, color.g, color.b].map((channel) =>\n Math.round(clamp(channel) * 255)\n .toString(16)\n .padStart(2, \"0\"),\n );\n return `#${channels.join(\"\")}${\n alpha < 1\n ? Math.round(alpha * 255)\n .toString(16)\n .padStart(2, \"0\")\n : \"\"\n }`.toUpperCase();\n}\n\nexport function compositeFigmaColors(\n foreground: FigmaRgba,\n background: FigmaRgba,\n): Required<FigmaRgba> {\n const foregroundAlpha = clamp(foreground.a ?? 1);\n const backgroundAlpha = clamp(background.a ?? 1);\n const alpha = foregroundAlpha + backgroundAlpha * (1 - foregroundAlpha);\n if (alpha === 0) return { r: 0, g: 0, b: 0, a: 0 };\n return {\n r:\n (clamp(foreground.r) * foregroundAlpha +\n clamp(background.r) * backgroundAlpha * (1 - foregroundAlpha)) /\n alpha,\n g:\n (clamp(foreground.g) * foregroundAlpha +\n clamp(background.g) * backgroundAlpha * (1 - foregroundAlpha)) /\n alpha,\n b:\n (clamp(foreground.b) * foregroundAlpha +\n clamp(background.b) * backgroundAlpha * (1 - foregroundAlpha)) /\n alpha,\n a: alpha,\n };\n}\n\nexport function figmaContrastRatio(a: FigmaRgba, b: FigmaRgba): number {\n const light = Math.max(relativeLuminance(a), relativeLuminance(b));\n const dark = Math.min(relativeLuminance(a), relativeLuminance(b));\n return (light + 0.05) / (dark + 0.05);\n}\n\nfunction visitFigmaNode(\n node: Record<string, unknown>,\n output: {\n text: Set<string>;\n colors: Set<string>;\n typography: Map<string, FigmaFrameSummary[\"typography\"][number]>;\n spacing: Set<number>;\n radii: Set<number>;\n },\n): void {\n const characters = stringValue(node.characters);\n if (characters) output.text.add(characters);\n for (const collection of [node.fills, node.strokes, node.background]) {\n for (const value of array(collection)) {\n const paint = asRecord(value);\n const color = asColor(paint?.color);\n if (color && paint?.visible !== false) {\n output.colors.add(\n figmaColorToHex(color, numberValue(paint?.opacity) ?? 1),\n );\n }\n }\n }\n const style = asRecord(node.style);\n if (style) {\n const typography = {\n family: stringValue(style.fontFamily),\n size: numberValue(style.fontSize),\n weight: numberValue(style.fontWeight),\n lineHeight: numberValue(style.lineHeightPx),\n };\n if (Object.values(typography).some((value) => value !== undefined)) {\n output.typography.set(JSON.stringify(typography), typography);\n }\n }\n for (const key of [\n \"itemSpacing\",\n \"paddingLeft\",\n \"paddingRight\",\n \"paddingTop\",\n \"paddingBottom\",\n ]) {\n const value = numberValue(node[key]);\n if (value !== undefined) output.spacing.add(value);\n }\n for (const value of [\n node.cornerRadius,\n ...array(node.rectangleCornerRadii),\n ]) {\n const radius = numberValue(value);\n if (radius !== undefined) output.radii.add(radius);\n }\n for (const child of array(node.children)) {\n const record = asRecord(child);\n if (record) visitFigmaNode(record, output);\n }\n}\n\nfunction relativeLuminance(color: FigmaRgba): number {\n const channels = [color.r, color.g, color.b].map((channel) => {\n const value = clamp(channel);\n return value <= 0.03928 ? value / 12.92 : ((value + 0.055) / 1.055) ** 2.4;\n });\n return 0.2126 * channels[0] + 0.7152 * channels[1] + 0.0722 * channels[2];\n}\n\nfunction describeFigmaPaint(\n paint: Record<string, unknown> | null,\n box: { width: number; height: number } | undefined,\n): NonNullable<FigmaContextNode[\"fills\"]>[number] | null {\n if (!paint || paint.visible === false) return null;\n const type = stringValue(paint.type) ?? \"UNKNOWN\";\n const opacity = numberValue(paint.opacity);\n if (type === \"SOLID\") {\n const color = asColor(paint.color);\n return {\n type: \"solid\",\n ...(color ? { color: figmaColorToHex(color) } : {}),\n ...(opacity !== undefined && opacity < 1\n ? { opacity: round(opacity, 2) }\n : {}),\n };\n }\n if (type.startsWith(\"GRADIENT_\")) {\n const handles = array(paint.gradientHandlePositions)\n .map(asRecord)\n .filter(Boolean) as Record<string, unknown>[];\n const figmaAngle =\n handles.length >= 2\n ? Math.atan2(\n ((numberValue(handles[1].y) ?? 0) -\n (numberValue(handles[0].y) ?? 0)) *\n (box?.height ?? 1),\n ((numberValue(handles[1].x) ?? 0) -\n (numberValue(handles[0].x) ?? 0)) *\n (box?.width ?? 1),\n ) *\n (180 / Math.PI)\n : undefined;\n const angle =\n figmaAngle === undefined\n ? undefined\n : (((figmaAngle + 90) % 360) + 360) % 360;\n return {\n type: `${type.replace(\"GRADIENT_\", \"\").toLowerCase()}-gradient`,\n ...(opacity !== undefined && opacity < 1\n ? { opacity: round(opacity, 2) }\n : {}),\n ...(angle !== undefined ? { angleDeg: round(angle) } : {}),\n stops: array(paint.gradientStops).flatMap((value) => {\n const stop = asRecord(value);\n const color = asColor(stop?.color);\n return color\n ? [\n {\n position: round(numberValue(stop?.position) ?? 0, 3),\n color: figmaColorToHex(color),\n },\n ]\n : [];\n }),\n };\n }\n return {\n type: type.toLowerCase(),\n ...(opacity !== undefined && opacity < 1\n ? { opacity: round(opacity, 2) }\n : {}),\n ...(stringValue(paint.imageRef)\n ? { imageRef: stringValue(paint.imageRef) }\n : {}),\n ...(stringValue(paint.scaleMode)\n ? { scaleMode: stringValue(paint.scaleMode) }\n : {}),\n };\n}\n\nfunction describeFigmaEffect(\n effect: Record<string, unknown> | null,\n): NonNullable<FigmaContextNode[\"effects\"]>[number] | null {\n if (!effect || effect.visible === false) return null;\n const offset = asRecord(effect.offset);\n const color = asColor(effect.color);\n return {\n type: (stringValue(effect.type) ?? \"unknown\")\n .toLowerCase()\n .replace(/_/g, \"-\"),\n ...(color ? { color: figmaColorToHex(color) } : {}),\n ...(offset\n ? {\n offset: {\n x: round(numberValue(offset.x) ?? 0),\n y: round(numberValue(offset.y) ?? 0),\n },\n }\n : {}),\n ...(numberValue(effect.radius) !== undefined\n ? { radius: round(numberValue(effect.radius)!) }\n : {}),\n ...(numberValue(effect.spread) !== undefined\n ? { spread: round(numberValue(effect.spread)!) }\n : {}),\n };\n}\n\nfunction figmaCornerRadius(\n node: Record<string, unknown>,\n): FigmaContextNode[\"cornerRadius\"] {\n const corners = array(node.rectangleCornerRadii).map(numberValue);\n if (corners.length === 4 && corners.every((value) => value !== undefined)) {\n return corners as [number, number, number, number];\n }\n return numberValue(node.cornerRadius);\n}\n\nfunction asColor(value: unknown): FigmaRgba | null {\n const record = asRecord(value);\n const r = numberValue(record?.r);\n const g = numberValue(record?.g);\n const b = numberValue(record?.b);\n if (r === undefined || g === undefined || b === undefined) return null;\n return { r, g, b, a: numberValue(record?.a) };\n}\n\nfunction asRecord(value: unknown): Record<string, unknown> | null {\n return value && typeof value === \"object\" && !Array.isArray(value)\n ? (value as Record<string, unknown>)\n : null;\n}\n\nfunction array(value: unknown): unknown[] {\n return Array.isArray(value) ? value : [];\n}\n\nfunction stringValue(value: unknown): string | undefined {\n return typeof value === \"string\" && value.trim() ? value.trim() : undefined;\n}\n\nfunction numberValue(value: unknown): number | undefined {\n return typeof value === \"number\" && Number.isFinite(value)\n ? value\n : undefined;\n}\n\nfunction clamp(value: number): number {\n return Math.max(0, Math.min(1, value));\n}\n\nfunction numberSort(a: number, b: number): number {\n return a - b;\n}\n\nfunction round(value: number, decimals = 1): number {\n const factor = 10 ** decimals;\n return Math.round(value * factor) / factor;\n}\n\nfunction stringRecord(value: unknown): Record<string, string> | undefined {\n const record = asRecord(value);\n if (!record) return undefined;\n const entries = Object.entries(record).filter(\n (entry): entry is [string, string] => typeof entry[1] === \"string\",\n );\n return entries.length ? Object.fromEntries(entries) : undefined;\n}\n"]}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export { acquireIngestionLease, assertInventoryComplete, consumeIngestionBudget, createIngestionBudgetState, createIngestionCheckpoint, ingestionBudgetStopReason, releaseIngestionLease, renewIngestionLease, type AcquireIngestionLeaseInput, type AcquireIngestionLeaseResult, type IngestionBudgetLimits, type IngestionBudgetState, type IngestionBudgetStopReason, type IngestionCheckpoint, type IngestionLease, type IngestionPhase, } from "./orchestration.js";
|
|
2
|
+
export { detectOfficeDocumentType, normalizeDocumentText, parseOfficeDocument, type OfficeDocumentAst, type OfficeDocumentParser, type OfficeDocumentPart, type OfficeDocumentType, type ParsedOfficeDocument, type ParseOfficeDocumentInput, } from "./office.js";
|
|
3
|
+
export { parsePptxPresentation, type ParsedPptxImage, type ParsedPptxPresentation, type ParsedPptxSlide, type ParsedPptxTextRun, } from "./pptx.js";
|
|
4
|
+
export { extractDocxSections, parseDocxDocument, sanitizeInertDocumentHtml, type ParsedDocxDocument, type ParsedDocxSection, } from "./docx.js";
|
|
5
|
+
export { compositeFigmaColors, extractFigmaTopLevelFrames, figmaColorToHex, figmaContrastRatio, summarizeFigmaFrame, summarizeFigmaNode, type FigmaContextNode, type FigmaFrameSummary, type FigmaRgba, type SummarizeFigmaNodeResult, } from "./figma.js";
|
|
6
|
+
export { assertFigmaNodeTreeComplexity, collectFallbackNodeIds, collectFontUsage, collectImageFillRefs, gradientAngleDegrees, mapFigmaNodeToHtml, type FidelityEntry, type FidelityLevel, type FidelityReport, type FigmaBoundingBox, type FigmaColor, type FigmaColorStop, type FigmaEffect, type FigmaFontUsage, type FigmaImageFilter, type FigmaIndividualStrokeWeights, type FigmaNode, type FigmaPaint, type FigmaTypeStyle, type MapFigmaNodeOptions, type MapFigmaNodeResult, } from "./figma-node-to-html.js";
|
|
7
|
+
export { notionBlocksToMarkdown, notionBlockToMarkdown, type NotionMarkdownResult, type NotionMarkdownSection, } from "./notion.js";
|
|
8
|
+
export { compareRasterImages, cropImageRegion, extractCssColors, extractDominantColors, fingerprintMedia, rankColorSamples, readBoundedResponseBytes, type CroppedImageRegion, type MediaFingerprint, } from "./media.js";
|
|
9
|
+
export { extractStaticWebsiteContext, type WebsiteAsset, type WebsiteDesignTokens, type WebsiteExtraction, } from "./website.js";
|
|
10
|
+
export { selectInventoryForHydration, type IngestionHydrationPolicy, type IngestionHydrationSelection, type IngestionInventoryCandidate, } from "./selection.js";
|
|
11
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/ingestion/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,qBAAqB,EACrB,uBAAuB,EACvB,sBAAsB,EACtB,0BAA0B,EAC1B,yBAAyB,EACzB,yBAAyB,EACzB,qBAAqB,EACrB,mBAAmB,EACnB,KAAK,0BAA0B,EAC/B,KAAK,2BAA2B,EAChC,KAAK,qBAAqB,EAC1B,KAAK,oBAAoB,EACzB,KAAK,yBAAyB,EAC9B,KAAK,mBAAmB,EACxB,KAAK,cAA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ACnB,eAAe,EACf,gBAAgB,EAChB,qBAAqB,EACrB,gBAAgB,EAChB,gBAAgB,EAChB,wBAAwB,EACxB,KAAK,kBAAkB,EACvB,KAAK,gBAAgB,GACtB,MAAM,YAAY,CAAC;AACpB,OAAO,EACL,2BAA2B,EAC3B,KAAK,YAAY,EACjB,KAAK,mBAAmB,EACxB,KAAK,iBAAiB,GACvB,MAAM,cAAc,CAAC;AACtB,OAAO,EACL,2BAA2B,EAC3B,KAAK,wBAAwB,EAC7B,KAAK,2BAA2B,EAChC,KAAK,2BAA2B,GACjC,MAAM,gBAAgB,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export { acquireIngestionLease, assertInventoryComplete, consumeIngestionBudget, createIngestionBudgetState, createIngestionCheckpoint, ingestionBudgetStopReason, releaseIngestionLease, renewIngestionLease, } from "./orchestration.js";
|
|
2
|
+
export { detectOfficeDocumentType, normalizeDocumentText, parseOfficeDocument, } from "./office.js";
|
|
3
|
+
export { parsePptxPresentation, } from "./pptx.js";
|
|
4
|
+
export { extractDocxSections, parseDocxDocument, sanitizeInertDocumentHtml, } from "./docx.js";
|
|
5
|
+
export { compositeFigmaColors, extractFigmaTopLevelFrames, figmaColorToHex, figmaContrastRatio, summarizeFigmaFrame, summarizeFigmaNode, } from "./figma.js";
|
|
6
|
+
export { assertFigmaNodeTreeComplexity, collectFallbackNodeIds, collectFontUsage, collectImageFillRefs, gradientAngleDegrees, mapFigmaNodeToHtml, } from "./figma-node-to-html.js";
|
|
7
|
+
export { notionBlocksToMarkdown, notionBlockToMarkdown, } from "./notion.js";
|
|
8
|
+
export { compareRasterImages, cropImageRegion, extractCssColors, extractDominantColors, fingerprintMedia, rankColorSamples, readBoundedResponseBytes, } from "./media.js";
|
|
9
|
+
export { extractStaticWebsiteContext, } from "./website.js";
|
|
10
|
+
export { selectInventoryForHydration, } from "./selection.js";
|
|
11
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/ingestion/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,qBAAqB,EACrB,uBAAuB,EACvB,sBAAsB,EACtB,0BAA0B,EAC1B,yBAAyB,EACzB,yBAAyB,EACzB,qBAAqB,EACrB,mBAAmB,GASpB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EACL,wBAAwB,EACxB,qBAAqB,EACrB,mBAAmB,GAOpB,MAAM,aAAa,CAAC;AACrB,OAAO,EACL,qBAAqB,GAKtB,MAAM,WAAW,CAAC;AACnB,OAAO,EACL,mBAAmB,EACnB,iBAAiB,EACjB,yBAAyB,GAG1B,MAAM,WAAW,CAAC;AACnB,OAAO,EACL,oBAAoB,EACpB,0BAA0B,EAC1B,eAAe,EACf,kBAAkB,EAClB,mBAAmB,EACnB,kBAAkB,GAKnB,MAAM,YAAY,CAAC;AACpB,OAAO,EACL,6BAA6B,EAC7B,sBAAsB,EACtB,gBAAgB,EAChB,oBAAoB,EACpB,oBAAoB,EACpB,kBAAkB,GAgBnB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EACL,sBAAsB,EACtB,qBAAqB,GAGtB,MAAM,aAAa,CAAC;AACrB,OAAO,EACL,mBAAmB,EACnB,eAAe,EACf,gBAAgB,EAChB,qBAAqB,EACrB,gBAAgB,EAChB,gBAAgB,EAChB,wBAAwB,GAGzB,MAAM,YAAY,CAAC;AACpB,OAAO,EACL,2BAA2B,GAI5B,MAAM,cAAc,CAAC;AACtB,OAAO,EACL,2BAA2B,GAI5B,MAAM,gBAAgB,CAAC","sourcesContent":["export {\n acquireIngestionLease,\n assertInventoryComplete,\n consumeIngestionBudget,\n createIngestionBudgetState,\n createIngestionCheckpoint,\n ingestionBudgetStopReason,\n releaseIngestionLease,\n renewIngestionLease,\n type AcquireIngestionLeaseInput,\n type AcquireIngestionLeaseResult,\n type IngestionBudgetLimits,\n type IngestionBudgetState,\n type IngestionBudgetStopReason,\n type IngestionCheckpoint,\n type IngestionLease,\n type IngestionPhase,\n} from \"./orchestration.js\";\nexport {\n detectOfficeDocumentType,\n normalizeDocumentText,\n parseOfficeDocument,\n type OfficeDocumentAst,\n type OfficeDocumentParser,\n type OfficeDocumentPart,\n type OfficeDocumentType,\n type ParsedOfficeDocument,\n type ParseOfficeDocumentInput,\n} from \"./office.js\";\nexport {\n parsePptxPresentation,\n type ParsedPptxImage,\n type ParsedPptxPresentation,\n type ParsedPptxSlide,\n type ParsedPptxTextRun,\n} from \"./pptx.js\";\nexport {\n extractDocxSections,\n parseDocxDocument,\n sanitizeInertDocumentHtml,\n type ParsedDocxDocument,\n type ParsedDocxSection,\n} from \"./docx.js\";\nexport {\n compositeFigmaColors,\n extractFigmaTopLevelFrames,\n figmaColorToHex,\n figmaContrastRatio,\n summarizeFigmaFrame,\n summarizeFigmaNode,\n type FigmaContextNode,\n type FigmaFrameSummary,\n type FigmaRgba,\n type SummarizeFigmaNodeResult,\n} from \"./figma.js\";\nexport {\n assertFigmaNodeTreeComplexity,\n collectFallbackNodeIds,\n collectFontUsage,\n collectImageFillRefs,\n gradientAngleDegrees,\n mapFigmaNodeToHtml,\n type FidelityEntry,\n type FidelityLevel,\n type FidelityReport,\n type FigmaBoundingBox,\n type FigmaColor,\n type FigmaColorStop,\n type FigmaEffect,\n type FigmaFontUsage,\n type FigmaImageFilter,\n type FigmaIndividualStrokeWeights,\n type FigmaNode,\n type FigmaPaint,\n type FigmaTypeStyle,\n type MapFigmaNodeOptions,\n type MapFigmaNodeResult,\n} from \"./figma-node-to-html.js\";\nexport {\n notionBlocksToMarkdown,\n notionBlockToMarkdown,\n type NotionMarkdownResult,\n type NotionMarkdownSection,\n} from \"./notion.js\";\nexport {\n compareRasterImages,\n cropImageRegion,\n extractCssColors,\n extractDominantColors,\n fingerprintMedia,\n rankColorSamples,\n readBoundedResponseBytes,\n type CroppedImageRegion,\n type MediaFingerprint,\n} from \"./media.js\";\nexport {\n extractStaticWebsiteContext,\n type WebsiteAsset,\n type WebsiteDesignTokens,\n type WebsiteExtraction,\n} from \"./website.js\";\nexport {\n selectInventoryForHydration,\n type IngestionHydrationPolicy,\n type IngestionHydrationSelection,\n type IngestionInventoryCandidate,\n} from \"./selection.js\";\n"]}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
export interface MediaFingerprint {
|
|
2
|
+
sha256: string;
|
|
3
|
+
byteLength: number;
|
|
4
|
+
mimeType?: string;
|
|
5
|
+
}
|
|
6
|
+
export declare function fingerprintMedia(data: Uint8Array, mimeType?: string): MediaFingerprint;
|
|
7
|
+
export declare function extractCssColors(value: string): string[];
|
|
8
|
+
export declare function rankColorSamples(samples: readonly string[], limit?: number): string[];
|
|
9
|
+
export declare function extractDominantColors(data: Uint8Array, limit?: number): Promise<string[]>;
|
|
10
|
+
export interface CroppedImageRegion {
|
|
11
|
+
data: Uint8Array;
|
|
12
|
+
mimeType: "image/png";
|
|
13
|
+
width: number;
|
|
14
|
+
height: number;
|
|
15
|
+
}
|
|
16
|
+
export declare function compareRasterImages(input: {
|
|
17
|
+
source: Uint8Array;
|
|
18
|
+
rendered: Uint8Array;
|
|
19
|
+
maxInputBytes?: number;
|
|
20
|
+
}): Promise<{
|
|
21
|
+
meanAbsoluteDifference: number;
|
|
22
|
+
width: number;
|
|
23
|
+
height: number;
|
|
24
|
+
}>;
|
|
25
|
+
/** Crops a bounded raster region without retaining the source image. */
|
|
26
|
+
export declare function cropImageRegion(input: {
|
|
27
|
+
data: Uint8Array;
|
|
28
|
+
left: number;
|
|
29
|
+
top: number;
|
|
30
|
+
width: number;
|
|
31
|
+
height: number;
|
|
32
|
+
maxInputBytes?: number;
|
|
33
|
+
maxOutputPixels?: number;
|
|
34
|
+
}): Promise<CroppedImageRegion>;
|
|
35
|
+
export declare function readBoundedResponseBytes(response: Response, maxBytes: number): Promise<Uint8Array>;
|
|
36
|
+
//# sourceMappingURL=media.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"media.d.ts","sourceRo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