@agent-native/core 0.92.10 → 0.92.12
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 +1 -1
- package/corpus/core/CHANGELOG.md +29 -0
- package/corpus/core/package.json +1 -1
- package/corpus/core/src/agent/production-agent.ts +214 -17
- package/corpus/core/src/agent/run-manager.ts +72 -14
- package/corpus/core/src/agent/run-store.ts +152 -27
- package/corpus/core/src/cli/design-connect.ts +433 -151
- package/corpus/core/src/cli/skills.ts +14 -0
- package/corpus/core/src/client/AssistantChat.tsx +25 -0
- package/corpus/core/src/client/MultiTabAssistantChat.tsx +40 -6
- package/corpus/core/src/client/agent-chat-adapter.ts +56 -12
- package/corpus/core/src/client/agent-chat.ts +165 -1
- package/corpus/core/src/client/chat/index.ts +9 -1
- package/corpus/core/src/client/extensions/EmbeddedExtension.tsx +38 -2
- package/corpus/core/src/client/index.ts +5 -0
- package/corpus/core/src/client/rich-markdown-editor/useCollabReconcile.ts +18 -7
- package/corpus/core/src/collab/awareness-store.ts +23 -12
- package/corpus/core/src/collab/client.ts +16 -5
- package/corpus/core/src/collab/index.ts +4 -0
- package/corpus/core/src/collab/recent-edits.ts +65 -2
- package/corpus/core/src/index.browser.ts +1 -0
- package/corpus/core/src/server/agent-chat-plugin.ts +98 -11
- package/corpus/core/src/server/builder-design-systems.ts +30 -4
- package/corpus/templates/clips/.agents/skills/ai-video-tools/SKILL.md +1 -1
- package/corpus/templates/clips/.agents/skills/video-sharing/SKILL.md +12 -6
- package/corpus/templates/clips/AGENTS.md +4 -0
- package/corpus/templates/clips/actions/create-recording.ts +2 -0
- package/corpus/templates/clips/actions/lib/create-recording-schema.ts +5 -3
- package/corpus/templates/clips/actions/request-transcript.ts +102 -33
- package/corpus/templates/clips/app/components/library/library-grid.tsx +1 -0
- package/corpus/templates/clips/app/components/player/share-dialog.tsx +59 -19
- package/corpus/templates/clips/app/components/player/transcript-panel.tsx +75 -9
- package/corpus/templates/clips/app/components/player/video-player.tsx +17 -12
- package/corpus/templates/clips/app/hooks/use-player-shortcuts.ts +1 -0
- package/corpus/templates/clips/app/i18n/ar-SA.ts +1 -0
- package/corpus/templates/clips/app/i18n/de-DE.ts +1 -0
- package/corpus/templates/clips/app/i18n/en-US.ts +1 -0
- package/corpus/templates/clips/app/i18n/es-ES.ts +1 -0
- package/corpus/templates/clips/app/i18n/fr-FR.ts +1 -0
- package/corpus/templates/clips/app/i18n/hi-IN.ts +1 -0
- package/corpus/templates/clips/app/i18n/ja-JP.ts +1 -0
- package/corpus/templates/clips/app/i18n/ko-KR.ts +1 -0
- package/corpus/templates/clips/app/i18n/pt-BR.ts +1 -0
- package/corpus/templates/clips/app/i18n/zh-CN.ts +1 -0
- package/corpus/templates/clips/app/i18n/zh-TW.ts +1 -0
- package/corpus/templates/clips/app/routes/r.$recordingId.tsx +70 -37
- package/corpus/templates/clips/app/routes/record.tsx +17 -4
- package/corpus/templates/clips/app/routes/share.$shareId.tsx +2 -0
- package/corpus/templates/clips/changelog/2026-07-09-desktop-popover-sits-closer-to-the-menu-bar.md +6 -0
- package/corpus/templates/clips/changelog/2026-07-09-desktop-recording-optimization-progress-stays-visible-until-the-clip-opens.md +6 -0
- package/corpus/templates/clips/changelog/2026-07-09-fixed-large-video-file-uploads-failing-before-their-resumabl.md +6 -0
- package/corpus/templates/clips/changelog/2026-07-09-fixed-new-video-uploads-defaulting-to-private.md +6 -0
- package/corpus/templates/clips/changelog/2026-07-09-long-recordings-now-get-enough-time-to-download-their-media-.md +6 -0
- package/corpus/templates/clips/changelog/2026-07-09-meeting-notes-no-longer-lowers-your-microphone-volume-for-ot.md +6 -0
- package/corpus/templates/clips/changelog/2026-07-09-on-mobile-tapping-a-playing-clip-reveals-playback-controls-w.md +6 -0
- package/corpus/templates/clips/changelog/2026-07-09-regenerate-any-clip-transcript-from-its-saved-recording-or-r.md +6 -0
- package/corpus/templates/clips/changelog/2026-07-09-slack-previews-now-show-the-clip-length-alongside-its-descri.md +6 -0
- package/corpus/templates/clips/changelog/2026-07-10-fixed-copying-agent-responses-and-transcript-text-from-recor.md +6 -0
- package/corpus/templates/clips/desktop/src/app.tsx +12 -2
- package/corpus/templates/clips/desktop/src/hooks/useMeetingTranscription.ts +8 -1
- package/corpus/templates/clips/desktop/src/lib/recorder.ts +8 -5
- package/corpus/templates/clips/desktop/src/lib/transcription-engine.ts +5 -5
- package/corpus/templates/clips/desktop/src/lib/voice-dictation.ts +3 -0
- package/corpus/templates/clips/desktop/src/styles.css +6 -3
- package/corpus/templates/clips/desktop/src-tauri/src/clips/mod.rs +29 -11
- package/corpus/templates/clips/desktop/src-tauri/src/native_screen.rs +1 -1
- package/corpus/templates/clips/desktop/src-tauri/src/system_audio.rs +103 -21
- package/corpus/templates/clips/desktop/src-tauri/src/whisper_speech.rs +117 -39
- package/corpus/templates/clips/server/lib/slack-unfurls.ts +20 -1
- package/corpus/templates/clips/server/lib/streaming-upload-mode.ts +10 -4
- package/corpus/templates/clips/shared/recording-core.ts +12 -0
- package/corpus/templates/content/AGENTS.md +7 -6
- package/corpus/templates/content/actions/_builder-cms-read-client.ts +82 -7
- package/corpus/templates/content/actions/_database-source-utils.ts +149 -30
- package/corpus/templates/content/actions/_document-flush.ts +132 -17
- package/corpus/templates/content/actions/_notion-action-utils.ts +15 -0
- package/corpus/templates/content/actions/add-content-database-source-field-property.ts +4 -7
- package/corpus/templates/content/actions/attach-content-database-source.ts +41 -17
- package/corpus/templates/content/actions/change-content-database-source-role.ts +46 -8
- package/corpus/templates/content/actions/create-and-link-notion-page.ts +2 -0
- package/corpus/templates/content/actions/link-notion-page.ts +2 -0
- package/corpus/templates/content/actions/pull-document.ts +5 -7
- package/corpus/templates/content/actions/pull-notion-page.ts +2 -0
- package/corpus/templates/content/actions/push-notion-page.ts +10 -0
- package/corpus/templates/content/actions/resolve-notion-sync-conflict.ts +2 -0
- package/corpus/templates/content/actions/suggest-source-join-key.ts +8 -1
- package/corpus/templates/content/app/components/editor/DocumentEditor.tsx +88 -23
- package/corpus/templates/content/app/components/editor/VisualEditor.tsx +32 -2
- package/corpus/templates/content/app/hooks/use-notion.ts +6 -6
- package/corpus/templates/content/app/i18n/zh-TW.ts +1 -0
- package/corpus/templates/content/app/i18n-data.ts +18 -0
- package/corpus/templates/content/changelog/2026-07-09-builder-source-refreshes-now-keep-mapped-fields-such-as-topi.md +6 -0
- package/corpus/templates/content/changelog/2026-07-09-notion-conflict-choices-and-version-restores-preserve-docume.md +6 -0
- package/corpus/templates/content/server/lib/notion-sync.ts +80 -64
- package/corpus/templates/content/shared/api.ts +1 -0
- package/corpus/templates/design/.agents/skills/design-generation/SKILL.md +29 -2
- package/corpus/templates/design/.agents/skills/design-systems/SKILL.md +86 -0
- package/corpus/templates/design/.agents/skills/export-handoff/SKILL.md +57 -0
- package/corpus/templates/design/.agents/skills/visual-edit/SKILL.md +11 -0
- package/corpus/templates/design/AGENTS.md +45 -10
- package/corpus/templates/design/actions/add-localhost-screens.ts +66 -13
- package/corpus/templates/design/actions/apply-component-prop-edit.ts +45 -36
- package/corpus/templates/design/actions/apply-motion-edit.ts +25 -31
- package/corpus/templates/design/actions/apply-shader-fill.ts +29 -42
- package/corpus/templates/design/actions/detach-component-instance.ts +337 -0
- package/corpus/templates/design/actions/export-design-as-figma-svg.ts +219 -0
- package/corpus/templates/design/actions/generate-design.ts +79 -12
- package/corpus/templates/design/actions/generate-screens.ts +57 -12
- package/corpus/templates/design/actions/get-figma-styles.ts +115 -0
- package/corpus/templates/design/actions/go-to-main-component.ts +254 -0
- package/corpus/templates/design/actions/grant-localhost-write-consent.ts +4 -3
- package/corpus/templates/design/actions/import-design-source.ts +4 -31
- package/corpus/templates/design/actions/import-figma-clipboard.ts +134 -0
- package/corpus/templates/design/actions/import-figma-frame.ts +95 -0
- package/corpus/templates/design/actions/index-design-system-with-builder.ts +16 -1
- package/corpus/templates/design/actions/list-design-components.ts +104 -0
- package/corpus/templates/design/actions/list-figma-library-assets.ts +1 -24
- package/corpus/templates/design/actions/open-component-source.ts +2 -4
- package/corpus/templates/design/actions/present-design-variants.ts +412 -16
- package/corpus/templates/design/actions/preview-source-edit.ts +14 -1
- package/corpus/templates/design/actions/run-design-audit.ts +25 -3
- package/corpus/templates/design/actions/show-design-questions.ts +10 -0
- package/corpus/templates/design/actions/swap-component-instance.ts +544 -0
- package/corpus/templates/design/actions/take-design-screenshot.ts +45 -60
- package/corpus/templates/design/actions/write-local-file.ts +25 -1
- package/corpus/templates/design/app/components/design/CanvasContextMenu.tsx +152 -0
- package/corpus/templates/design/app/components/design/DesignCanvas.tsx +1077 -58
- package/corpus/templates/design/app/components/design/DesignEditorSkeleton.tsx +5 -5
- package/corpus/templates/design/app/components/design/DesignExtensionsPanel.tsx +73 -21
- package/corpus/templates/design/app/components/design/EditPanel.tsx +16 -11
- package/corpus/templates/design/app/components/design/KeyboardShortcutsPanel.tsx +364 -0
- package/corpus/templates/design/app/components/design/LayersPanel.tsx +180 -53
- package/corpus/templates/design/app/components/design/LocalhostWriteConsentDialog.tsx +0 -2
- package/corpus/templates/design/app/components/design/MotionDock.tsx +144 -21
- package/corpus/templates/design/app/components/design/MultiScreenCanvas.tsx +1152 -167
- package/corpus/templates/design/app/components/design/QuestionFlow.tsx +27 -5
- package/corpus/templates/design/app/components/design/ReviewPanel.tsx +23 -2
- package/corpus/templates/design/app/components/design/TokensPanel.tsx +63 -49
- package/corpus/templates/design/app/components/design/bridge/editor-chrome.bridge.ts +1293 -54
- package/corpus/templates/design/app/components/design/bridge/embedded-wheel.bridge.ts +7 -0
- package/corpus/templates/design/app/components/design/bridge/hit-test.bridge.ts +6 -1
- package/corpus/templates/design/app/components/design/bridge/motion-preview.bridge.ts +23 -6
- package/corpus/templates/design/app/components/design/bridge/sample.bridge.ts +7 -0
- package/corpus/templates/design/app/components/design/code-workbench/CodeWorkbench.tsx +5 -0
- package/corpus/templates/design/app/components/design/code-workbench/editor/MonacoHost.tsx +14 -2
- package/corpus/templates/design/app/components/design/code-workbench/explorer/FileTree.tsx +37 -2
- package/corpus/templates/design/app/components/design/code-workbench/format/format-on-open-guard.ts +25 -0
- package/corpus/templates/design/app/components/design/code-workbench/format/format-on-open.ts +19 -1
- package/corpus/templates/design/app/components/design/code-workbench/model-registry.ts +43 -5
- package/corpus/templates/design/app/components/design/code-workbench/search/SearchView.tsx +27 -2
- package/corpus/templates/design/app/components/design/code-workbench/search/search-engine.ts +10 -1
- package/corpus/templates/design/app/components/design/code-workbench/store.tsx +19 -2
- package/corpus/templates/design/app/components/design/design-canvas/annotation-snapshot.ts +265 -0
- package/corpus/templates/design/app/components/design/design-canvas/annotation-submit.ts +16 -5
- package/corpus/templates/design/app/components/design/design-canvas/coordinate-transforms.ts +16 -2
- package/corpus/templates/design/app/components/design/design-canvas/embedded-frame.ts +7 -2
- package/corpus/templates/design/app/components/design/design-canvas/iframe-events.ts +3 -1
- package/corpus/templates/design/app/components/design/edit-panel/code-inspect-helpers.tsx +78 -8
- package/corpus/templates/design/app/components/design/edit-panel/component-section.tsx +451 -73
- package/corpus/templates/design/app/components/design/edit-panel/document-colors.ts +12 -4
- package/corpus/templates/design/app/components/design/edit-panel/effects-properties.tsx +398 -272
- package/corpus/templates/design/app/components/design/edit-panel/element-classification.ts +41 -7
- package/corpus/templates/design/app/components/design/edit-panel/element-identity.ts +16 -3
- package/corpus/templates/design/app/components/design/edit-panel/field-primitives.tsx +24 -4
- package/corpus/templates/design/app/components/design/edit-panel/fill-gradient-helpers.ts +222 -4
- package/corpus/templates/design/app/components/design/edit-panel/fill-properties.tsx +171 -78
- package/corpus/templates/design/app/components/design/edit-panel/inspector-controls.tsx +45 -5
- package/corpus/templates/design/app/components/design/edit-panel/layout-properties.tsx +299 -28
- package/corpus/templates/design/app/components/design/edit-panel/panel-primitives.tsx +120 -150
- package/corpus/templates/design/app/components/design/edit-panel/position-helpers.ts +53 -1
- package/corpus/templates/design/app/components/design/edit-panel/position-layout-properties.tsx +284 -117
- package/corpus/templates/design/app/components/design/edit-panel/selection-helpers.ts +81 -0
- package/corpus/templates/design/app/components/design/edit-panel/stroke-properties.tsx +19 -14
- package/corpus/templates/design/app/components/design/edit-panel/style-options.ts +7 -0
- package/corpus/templates/design/app/components/design/edit-panel/typography-helpers.ts +155 -0
- package/corpus/templates/design/app/components/design/edit-panel/typography-properties.tsx +268 -46
- package/corpus/templates/design/app/components/design/inspector/AutoLayoutMatrix.tsx +350 -31
- package/corpus/templates/design/app/components/design/inspector/ConstraintsWidget.tsx +13 -4
- package/corpus/templates/design/app/components/design/inspector/DesignColorPicker.tsx +233 -23
- package/corpus/templates/design/app/components/design/inspector/GradientEditor.tsx +72 -2
- package/corpus/templates/design/app/components/design/inspector/ScrubInput.tsx +51 -11
- package/corpus/templates/design/app/components/design/inspector/ShaderFillsPanel.tsx +84 -11
- package/corpus/templates/design/app/components/design/inspector/index.ts +3 -0
- package/corpus/templates/design/app/components/design/keyboard-shortcuts.ts +552 -0
- package/corpus/templates/design/app/components/design/multi-screen/board-surface-html.ts +157 -0
- package/corpus/templates/design/app/components/design/multi-screen/frame-geometry.ts +53 -0
- package/corpus/templates/design/app/components/design/multi-screen/overview-layout.ts +184 -0
- package/corpus/templates/design/app/components/design/multi-screen/primitive-drop-target.ts +403 -26
- package/corpus/templates/design/app/components/design/multi-screen/types.ts +20 -1
- package/corpus/templates/design/app/components/design/types.ts +33 -0
- package/corpus/templates/design/app/components/editor/PromptDialog.tsx +59 -7
- package/corpus/templates/design/app/components/visual-editor/CanvasCommentPins.tsx +119 -17
- package/corpus/templates/design/app/components/visual-editor/DrawOverlay.tsx +275 -63
- package/corpus/templates/design/app/hooks/use-question-flow.ts +14 -3
- package/corpus/templates/design/app/hooks/useDesignHotkeys.ts +67 -10
- package/corpus/templates/design/app/i18n/zh-TW.ts +91 -1
- package/corpus/templates/design/app/i18n-data.ts +1217 -10
- package/corpus/templates/design/app/i18n-keyboard-shortcuts.ts +577 -0
- package/corpus/templates/design/app/lib/agent-chat.ts +23 -0
- package/corpus/templates/design/app/lib/design-import.ts +24 -0
- package/corpus/templates/design/app/lib/figma-clipboard.ts +157 -0
- package/corpus/templates/design/app/lib/figma-svg-copy.ts +221 -0
- package/corpus/templates/design/app/pages/design-editor/code-layer-state.ts +143 -30
- package/corpus/templates/design/app/pages/design-editor/collab-sync.ts +15 -0
- package/corpus/templates/design/app/pages/design-editor/editor-session.ts +33 -0
- package/corpus/templates/design/app/pages/design-editor/editor-state.ts +38 -0
- package/corpus/templates/design/app/pages/design-editor/overview-annotation-context.ts +157 -0
- package/corpus/templates/design/app/pages/design-editor/overview-camera.ts +62 -6
- package/corpus/templates/design/app/pages/design-editor/pending-edits.ts +245 -0
- package/corpus/templates/design/app/pages/design-editor/react-semantic-handoff.ts +586 -0
- package/corpus/templates/design/app/pages/design-editor/screen-auto-layout.ts +169 -0
- package/corpus/templates/design/app/pages/design-editor/selection-state.ts +201 -1
- package/corpus/templates/design/changelog/2026-07-09-added-underline-strikethrough-and-text-case-uppercase-lowerc.md +6 -0
- package/corpus/templates/design/changelog/2026-07-09-annotate-now-draws-across-the-all-screens-canvas-without-swi.md +6 -0
- package/corpus/templates/design/changelog/2026-07-09-auto-layout-children-can-now-be-dragged-into-freeform-screen.md +6 -0
- package/corpus/templates/design/changelog/2026-07-09-board-shapes-now-stay-visible-and-nest-correctly-across-the-.md +6 -0
- package/corpus/templates/design/changelog/2026-07-09-component-source-navigation-now-opens-reliably-from-the-insp.md +6 -0
- package/corpus/templates/design/changelog/2026-07-09-cross-screen-local-react-layer-moves-now-hand-off-exact-sour.md +6 -0
- package/corpus/templates/design/changelog/2026-07-09-cross-screen-moves-undo-and-redo-now-keep-both-screens-stabl.md +6 -0
- package/corpus/templates/design/changelog/2026-07-09-detach-a-component-instance-into-plain-editable-eleme.md +6 -0
- package/corpus/templates/design/changelog/2026-07-09-dragging-layers-into-auto-layout-now-respects-ignore-auto-la.md +6 -0
- package/corpus/templates/design/changelog/2026-07-09-drawing-annotations-sent-to-the-agent-now-include-a-rendered.md +6 -0
- package/corpus/templates/design/changelog/2026-07-09-editor-sidebars-now-use-figma-matched-default-widths-for-a-r.md +6 -0
- package/corpus/templates/design/changelog/2026-07-09-empty-frames-and-rectangles-now-expose-full-auto-layout-cont.md +6 -0
- package/corpus/templates/design/changelog/2026-07-09-export-any-design-screen-as-a-real-vector-svg-for-figma-with.md +6 -0
- package/corpus/templates/design/changelog/2026-07-09-grid-auto-layout-now-uses-true-responsive-rows-and-columns-w.md +6 -0
- package/corpus/templates/design/changelog/2026-07-09-hidden-and-locked-screens-now-behave-consistently-between-la.md +6 -0
- package/corpus/templates/design/changelog/2026-07-09-image-fills-now-preserve-valid-urls-and-layered-fit-settings.md +6 -0
- package/corpus/templates/design/changelog/2026-07-09-import-figma-frames-as-pixel-accurate-design-screens-via-a-s.md +6 -0
- package/corpus/templates/design/changelog/2026-07-09-inspect-code-now-hides-internal-styling-metadata-and-wraps-l.md +6 -0
- package/corpus/templates/design/changelog/2026-07-09-inspector-blur-and-shadow-effects-now-preserve-other-effects.md +6 -0
- package/corpus/templates/design/changelog/2026-07-09-jump-to-a-components-other-instances-from-the-inspecto.md +6 -0
- package/corpus/templates/design/changelog/2026-07-09-keyboard-shortcuts-are-now-discoverable-in-a-figma-style-bot.md +6 -0
- package/corpus/templates/design/changelog/2026-07-09-layer-selection-now-keeps-cmd-or-ctrl-toggles-and-shift-rang.md +6 -0
- package/corpus/templates/design/changelog/2026-07-09-layers-dropped-into-auto-layout-now-participate-correctly-in.md +6 -0
- package/corpus/templates/design/changelog/2026-07-09-local-live-edit-screens-now-enter-and-leave-full-view-withou.md +6 -0
- package/corpus/templates/design/changelog/2026-07-09-local-preview-urls-now-live-in-the-inspector-instead-of-taki.md +6 -0
- package/corpus/templates/design/changelog/2026-07-09-local-react-layers-can-now-be-hidden-and-locked-from-layers-.md +6 -0
- package/corpus/templates/design/changelog/2026-07-09-local-react-layers-now-keep-exact-source-provenance-and-supp.md +6 -0
- package/corpus/templates/design/changelog/2026-07-09-local-react-visual-editing-now-loads-reliably-and-shows-live.md +6 -0
- package/corpus/templates/design/changelog/2026-07-09-paste-from-figma-cmd-v-now-imports-exact-editable-nodes-when.md +6 -0
- package/corpus/templates/design/changelog/2026-07-09-pressing-escape-after-selecting-a-screen-now-reveals-page-pr.md +6 -0
- package/corpus/templates/design/changelog/2026-07-09-right-click-overlapping-or-nested-objects-to-choose-the-exac.md +6 -0
- package/corpus/templates/design/changelog/2026-07-09-scale-edge-stretch-and-center-constraints-now-preserve-layer.md +6 -0
- package/corpus/templates/design/changelog/2026-07-09-screen-rows-can-now-be-reordered-in-layers-with-matching-can.md +6 -0
- package/corpus/templates/design/changelog/2026-07-09-screen-selection-stays-responsive-in-designs-with-hundreds-o.md +6 -0
- package/corpus/templates/design/changelog/2026-07-09-shift-a-now-enables-auto-layout-on-a-selected-screen-with-fl.md +6 -0
- package/corpus/templates/design/changelog/2026-07-09-swap-a-component-instance-for-another-from-the-libra.md +6 -0
- package/corpus/templates/design/changelog/2026-07-10-drawing-annotations-now-stay-available-to-retry-when-the.md +6 -0
- package/corpus/templates/design/e2e/global-setup.ts +3 -6
- package/corpus/templates/design/e2e/helpers.ts +27 -6
- package/corpus/templates/design/server/lib/design-to-figma-svg.ts +1412 -0
- package/corpus/templates/design/server/lib/figma-clipboard-match.ts +196 -0
- package/corpus/templates/design/server/lib/figma-node-import.ts +311 -0
- package/corpus/templates/design/server/lib/figma-node-to-html.ts +1334 -0
- package/corpus/templates/design/server/lib/figma-paste-fallback.ts +64 -0
- package/corpus/templates/design/server/lib/playwright-runtime.ts +78 -0
- package/corpus/templates/design/server/plugins/db.ts +41 -0
- package/corpus/templates/design/server/source-workspace.ts +64 -0
- package/corpus/templates/design/shared/board-file.ts +13 -2
- package/corpus/templates/design/shared/canvas-math.ts +231 -33
- package/corpus/templates/design/shared/code-layer.ts +122 -8
- package/corpus/templates/design/shared/component-library.ts +161 -0
- package/corpus/templates/design/shared/db-conflict.ts +27 -0
- package/corpus/templates/design/shared/design-source-capabilities.ts +2 -1
- package/corpus/templates/design/shared/figma-url.ts +149 -0
- package/corpus/templates/design/shared/pen-path.ts +16 -7
- package/corpus/templates/design/shared/source-mode.ts +1 -0
- package/corpus/templates/plan/app/components/plan/CanvasArea.tsx +7 -19
- package/corpus/templates/plan/changelog/2026-07-09-canvas-panning-now-keeps-zoom-fixed-even-at-the-edges.md +6 -0
- package/corpus/templates/slides/actions/index-design-system-with-builder.ts +16 -1
- package/corpus/templates/slides/app/context/DeckContext.tsx +311 -70
- package/corpus/templates/slides/changelog/2026-07-09-fixed-the-slide-rail-going-permanently-stale-during-a-long-a.md +6 -0
- package/dist/agent/production-agent.d.ts +82 -7
- package/dist/agent/production-agent.d.ts.map +1 -1
- package/dist/agent/production-agent.js +180 -17
- package/dist/agent/production-agent.js.map +1 -1
- package/dist/agent/run-manager.d.ts.map +1 -1
- package/dist/agent/run-manager.js +63 -14
- package/dist/agent/run-manager.js.map +1 -1
- package/dist/agent/run-store.d.ts +46 -0
- package/dist/agent/run-store.d.ts.map +1 -1
- package/dist/agent/run-store.js +129 -22
- package/dist/agent/run-store.js.map +1 -1
- package/dist/cli/design-connect.d.ts +6 -0
- package/dist/cli/design-connect.d.ts.map +1 -1
- package/dist/cli/design-connect.js +336 -139
- package/dist/cli/design-connect.js.map +1 -1
- package/dist/cli/skills.d.ts.map +1 -1
- package/dist/cli/skills.js +14 -0
- package/dist/cli/skills.js.map +1 -1
- package/dist/client/AssistantChat.d.ts +2 -0
- package/dist/client/AssistantChat.d.ts.map +1 -1
- package/dist/client/AssistantChat.js +19 -3
- package/dist/client/AssistantChat.js.map +1 -1
- package/dist/client/MultiTabAssistantChat.d.ts.map +1 -1
- package/dist/client/MultiTabAssistantChat.js +38 -18
- 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 +48 -12
- package/dist/client/agent-chat-adapter.js.map +1 -1
- package/dist/client/agent-chat.d.ts +60 -0
- package/dist/client/agent-chat.d.ts.map +1 -1
- package/dist/client/agent-chat.js +122 -1
- package/dist/client/agent-chat.js.map +1 -1
- package/dist/client/chat/index.d.ts +1 -1
- package/dist/client/chat/index.d.ts.map +1 -1
- package/dist/client/chat/index.js +1 -1
- package/dist/client/chat/index.js.map +1 -1
- package/dist/client/extensions/EmbeddedExtension.d.ts +12 -0
- package/dist/client/extensions/EmbeddedExtension.d.ts.map +1 -1
- package/dist/client/extensions/EmbeddedExtension.js +36 -2
- package/dist/client/extensions/EmbeddedExtension.js.map +1 -1
- package/dist/client/index.d.ts +1 -1
- package/dist/client/index.d.ts.map +1 -1
- package/dist/client/index.js +1 -1
- package/dist/client/index.js.map +1 -1
- package/dist/client/rich-markdown-editor/useCollabReconcile.d.ts.map +1 -1
- package/dist/client/rich-markdown-editor/useCollabReconcile.js +18 -6
- package/dist/client/rich-markdown-editor/useCollabReconcile.js.map +1 -1
- package/dist/collab/awareness-store.d.ts +5 -0
- package/dist/collab/awareness-store.d.ts.map +1 -1
- package/dist/collab/awareness-store.js +19 -12
- package/dist/collab/awareness-store.js.map +1 -1
- package/dist/collab/awareness.d.ts +2 -2
- package/dist/collab/awareness.d.ts.map +1 -1
- package/dist/collab/client.d.ts.map +1 -1
- package/dist/collab/client.js +13 -5
- package/dist/collab/client.js.map +1 -1
- package/dist/collab/index.d.ts +1 -0
- package/dist/collab/index.d.ts.map +1 -1
- package/dist/collab/index.js +1 -0
- package/dist/collab/index.js.map +1 -1
- package/dist/collab/recent-edits.d.ts +3 -1
- package/dist/collab/recent-edits.d.ts.map +1 -1
- package/dist/collab/recent-edits.js +57 -2
- package/dist/collab/recent-edits.js.map +1 -1
- package/dist/collab/struct-routes.d.ts +1 -1
- package/dist/index.browser.d.ts +1 -1
- package/dist/index.browser.d.ts.map +1 -1
- package/dist/index.browser.js +1 -1
- package/dist/index.browser.js.map +1 -1
- package/dist/observability/routes.d.ts +5 -5
- package/dist/progress/routes.d.ts +1 -1
- package/dist/resources/handlers.d.ts +3 -3
- package/dist/server/agent-chat-plugin.d.ts.map +1 -1
- package/dist/server/agent-chat-plugin.js +87 -10
- package/dist/server/agent-chat-plugin.js.map +1 -1
- package/dist/server/agent-engine-api-key-route.d.ts +1 -1
- package/dist/server/builder-design-systems.d.ts +15 -0
- package/dist/server/builder-design-systems.d.ts.map +1 -1
- package/dist/server/builder-design-systems.js +9 -4
- package/dist/server/builder-design-systems.js.map +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
import { defineAction } from "@agent-native/core";
|
|
2
|
+
import { z } from "zod";
|
|
3
|
+
|
|
4
|
+
import {
|
|
5
|
+
buildFigmaNodeCandidates,
|
|
6
|
+
extractVisibleTexts,
|
|
7
|
+
matchFigmaClipboardNodes,
|
|
8
|
+
} from "../server/lib/figma-clipboard-match.js";
|
|
9
|
+
import {
|
|
10
|
+
buildScreenFilesFromFigmaNodes,
|
|
11
|
+
fetchFileStructure,
|
|
12
|
+
fetchFigmaNodes,
|
|
13
|
+
summarizeFidelity,
|
|
14
|
+
} from "../server/lib/figma-node-import.js";
|
|
15
|
+
import { saveFigmaPasteHtmlFallback } from "../server/lib/figma-paste-fallback.js";
|
|
16
|
+
import { saveImportedDesignFiles } from "../server/lib/import-design-files.js";
|
|
17
|
+
import { parseVisibleClipboardHtml } from "../server/lib/visible-clipboard-html.js";
|
|
18
|
+
import { parseFigmaFileKey } from "../shared/figma-url.js";
|
|
19
|
+
|
|
20
|
+
const NODE_STRUCTURE_DEPTH = 3;
|
|
21
|
+
|
|
22
|
+
const CREDENTIAL_MISSING_RE = /credential not configured/i;
|
|
23
|
+
|
|
24
|
+
const AMBIGUOUS_GUIDANCE =
|
|
25
|
+
'Couldn\'t confidently match this paste to specific Figma nodes, so nothing was imported from the API. Paste a frame LINK instead (copy the frame in Figma, then "Copy link to selection") for an exact node import — or continue with the clipboard preview below.';
|
|
26
|
+
|
|
27
|
+
const KEY_MISSING_GUIDANCE =
|
|
28
|
+
"Connect your Figma access token (Settings > Secrets > Figma access token) to import this paste as exact, editable Figma nodes. Imported from the clipboard preview instead.";
|
|
29
|
+
|
|
30
|
+
export default defineAction({
|
|
31
|
+
description:
|
|
32
|
+
"Import a plain clipboard paste copied from Figma (Cmd+C in Figma, Cmd+V here). Figma's clipboard marker only carries a file key, not node ids, so this heuristically matches the pasted content against the file's top-level frames by name/text and imports exact REST nodes only on a confident match; otherwise it falls back to the lossy visible-HTML preview and reports why. For a guaranteed exact import, use import-figma-frame with a copied frame LINK (which does carry a node id) instead.",
|
|
33
|
+
schema: z.object({
|
|
34
|
+
designId: z
|
|
35
|
+
.string()
|
|
36
|
+
.optional()
|
|
37
|
+
.describe("Design id. Defaults to the active editor navigation state."),
|
|
38
|
+
figmetaFileKey: z
|
|
39
|
+
.string()
|
|
40
|
+
.trim()
|
|
41
|
+
.min(1)
|
|
42
|
+
.describe(
|
|
43
|
+
"The fileKey decoded from the clipboard's figmeta marker (see app/lib/figma-clipboard.ts's extractFigmeta).",
|
|
44
|
+
),
|
|
45
|
+
clipboardHtml: z
|
|
46
|
+
.string()
|
|
47
|
+
.describe(
|
|
48
|
+
"The raw clipboard HTML (still containing the hidden figmeta/figbuffer markers) — used both for the legacy visible-HTML fallback and for node-matching against visible text.",
|
|
49
|
+
),
|
|
50
|
+
originalName: z.string().optional(),
|
|
51
|
+
}),
|
|
52
|
+
run: async ({ designId, figmetaFileKey, clipboardHtml, originalName }) => {
|
|
53
|
+
const fileKey = parseFigmaFileKey(figmetaFileKey);
|
|
54
|
+
if (!fileKey) {
|
|
55
|
+
throw new Error("The clipboard's Figma file key could not be parsed.");
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
// Legacy fallback text is needed either way: as the actual save payload
|
|
59
|
+
// when we fall back, and as the "visible text" signal the matcher scores
|
|
60
|
+
// candidate frames against.
|
|
61
|
+
const parsedClipboard = parseVisibleClipboardHtml(clipboardHtml);
|
|
62
|
+
if (!parsedClipboard.fallbackHtml) {
|
|
63
|
+
throw new Error(
|
|
64
|
+
"No visible HTML was found in the clipboard. Copy a frame, then paste into the canvas.",
|
|
65
|
+
);
|
|
66
|
+
}
|
|
67
|
+
const clipboardTexts = extractVisibleTexts(parsedClipboard.fallbackHtml);
|
|
68
|
+
|
|
69
|
+
let figmaApiKeyMissing = false;
|
|
70
|
+
let matchStatus: "matched" | "ambiguous" | "none" | "error" = "error";
|
|
71
|
+
|
|
72
|
+
try {
|
|
73
|
+
const document = await fetchFileStructure(fileKey, NODE_STRUCTURE_DEPTH);
|
|
74
|
+
const candidates = buildFigmaNodeCandidates(document);
|
|
75
|
+
const matchResult = matchFigmaClipboardNodes(candidates, clipboardTexts);
|
|
76
|
+
matchStatus = matchResult.status;
|
|
77
|
+
|
|
78
|
+
if (matchResult.status === "matched") {
|
|
79
|
+
const nodeIds = matchResult.matches.map((match) => match.id);
|
|
80
|
+
const nodesById = await fetchFigmaNodes(fileKey, nodeIds);
|
|
81
|
+
const { files, fidelityEntries } = await buildScreenFilesFromFigmaNodes(
|
|
82
|
+
fileKey,
|
|
83
|
+
nodesById,
|
|
84
|
+
);
|
|
85
|
+
const saved = await saveImportedDesignFiles({
|
|
86
|
+
designId,
|
|
87
|
+
sourceType: "figma-clipboard-rest",
|
|
88
|
+
files,
|
|
89
|
+
});
|
|
90
|
+
return {
|
|
91
|
+
...saved,
|
|
92
|
+
strategy: "restNodes" as const,
|
|
93
|
+
figma: {
|
|
94
|
+
fileKey,
|
|
95
|
+
nodeIds,
|
|
96
|
+
matched: matchResult.matches,
|
|
97
|
+
},
|
|
98
|
+
fidelityReport: summarizeFidelity(fidelityEntries),
|
|
99
|
+
guidance:
|
|
100
|
+
"Review fidelityReport.imageFallbacks for subtrees rendered as PNG and fidelityReport.approximated for properties CSS cannot express exactly.",
|
|
101
|
+
};
|
|
102
|
+
}
|
|
103
|
+
} catch (error) {
|
|
104
|
+
figmaApiKeyMissing = CREDENTIAL_MISSING_RE.test(
|
|
105
|
+
error instanceof Error ? error.message : String(error),
|
|
106
|
+
);
|
|
107
|
+
if (!figmaApiKeyMissing) {
|
|
108
|
+
// A real (non-credential) REST failure — network error, revoked
|
|
109
|
+
// token, file access issue, etc. Still fall back to the honest
|
|
110
|
+
// clipboard preview rather than losing the paste entirely, but this
|
|
111
|
+
// isn't a "no confident match" case, so don't claim ambiguity.
|
|
112
|
+
matchStatus = "error";
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
const saved = await saveFigmaPasteHtmlFallback({
|
|
117
|
+
designId,
|
|
118
|
+
clipboardHtml,
|
|
119
|
+
originalName,
|
|
120
|
+
});
|
|
121
|
+
return {
|
|
122
|
+
...saved,
|
|
123
|
+
strategy: "htmlFallback" as const,
|
|
124
|
+
figmaApiKeyMissing,
|
|
125
|
+
matchStatus,
|
|
126
|
+
figma: { fileKey },
|
|
127
|
+
guidance: figmaApiKeyMissing
|
|
128
|
+
? KEY_MISSING_GUIDANCE
|
|
129
|
+
: matchStatus === "ambiguous" || matchStatus === "none"
|
|
130
|
+
? AMBIGUOUS_GUIDANCE
|
|
131
|
+
: "Imported the clipboard's visible-HTML preview after a Figma API error. Paste a frame link for an exact import.",
|
|
132
|
+
};
|
|
133
|
+
},
|
|
134
|
+
});
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
import { defineAction } from "@agent-native/core";
|
|
2
|
+
import { z } from "zod";
|
|
3
|
+
|
|
4
|
+
import {
|
|
5
|
+
buildScreenFilesFromFigmaNodes,
|
|
6
|
+
fetchFigmaNode,
|
|
7
|
+
resolveTargetNodeId,
|
|
8
|
+
summarizeFidelity,
|
|
9
|
+
} from "../server/lib/figma-node-import.js";
|
|
10
|
+
import { saveImportedDesignFiles } from "../server/lib/import-design-files.js";
|
|
11
|
+
import { parseFigmaFileKey, parseFigmaNodeId } from "../shared/figma-url.js";
|
|
12
|
+
|
|
13
|
+
const schemaInput = z
|
|
14
|
+
.object({
|
|
15
|
+
figmaUrl: z
|
|
16
|
+
.string()
|
|
17
|
+
.trim()
|
|
18
|
+
.optional()
|
|
19
|
+
.describe(
|
|
20
|
+
"Figma file/frame URL, e.g. https://www.figma.com/design/<fileKey>/<name>?node-id=<id>. A branch URL (/branch/<key>/) resolves to the branch's own file.",
|
|
21
|
+
),
|
|
22
|
+
fileKey: z
|
|
23
|
+
.string()
|
|
24
|
+
.trim()
|
|
25
|
+
.optional()
|
|
26
|
+
.describe("Figma file key. Used when figmaUrl is omitted or has no key."),
|
|
27
|
+
nodeId: z
|
|
28
|
+
.string()
|
|
29
|
+
.trim()
|
|
30
|
+
.optional()
|
|
31
|
+
.describe(
|
|
32
|
+
"Figma node id (colon or dash form, e.g. '12:34' or '12-34'). Used when figmaUrl has no node-id. Defaults to the file's first top-level frame when omitted.",
|
|
33
|
+
),
|
|
34
|
+
designId: z
|
|
35
|
+
.string()
|
|
36
|
+
.optional()
|
|
37
|
+
.describe("Design id. Defaults to the active editor navigation state."),
|
|
38
|
+
asNewScreen: z
|
|
39
|
+
.boolean()
|
|
40
|
+
.default(true)
|
|
41
|
+
.describe(
|
|
42
|
+
"Must be true today: the imported frame is always saved as a new screen. Reserved for a future 'replace existing screen' mode.",
|
|
43
|
+
),
|
|
44
|
+
})
|
|
45
|
+
.refine((value) => value.figmaUrl || value.fileKey, {
|
|
46
|
+
message: "Pass figmaUrl or fileKey.",
|
|
47
|
+
path: ["figmaUrl"],
|
|
48
|
+
});
|
|
49
|
+
|
|
50
|
+
export default defineAction({
|
|
51
|
+
description:
|
|
52
|
+
"Import a Figma frame/component by URL or file key + node id, mapping it to pixel-accurate HTML (position, auto-layout as flexbox, text, fills/gradients, strokes, corner radii, effects) and saving it as a new Design screen. Unsupported node types (vector networks, boolean ops) render as exact PNG fallbacks instead of approximated shapes. Returns a fidelity report of which properties were exact, approximated, or image-fallback. Requires the saved FIGMA_ACCESS_TOKEN secret.",
|
|
53
|
+
schema: schemaInput,
|
|
54
|
+
publicAgent: { expose: true, readOnly: false, requiresAuth: true },
|
|
55
|
+
run: async (args) => {
|
|
56
|
+
if (args.asNewScreen === false) {
|
|
57
|
+
throw new Error(
|
|
58
|
+
"asNewScreen: false is not supported yet. Omit it or pass true — the imported frame is always saved as a new screen.",
|
|
59
|
+
);
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
const fileKey =
|
|
63
|
+
parseFigmaFileKey(args.fileKey) ?? parseFigmaFileKey(args.figmaUrl);
|
|
64
|
+
if (!fileKey) {
|
|
65
|
+
throw new Error("Could not find a Figma file key in the provided URL.");
|
|
66
|
+
}
|
|
67
|
+
const requestedNodeId =
|
|
68
|
+
parseFigmaNodeId(args.nodeId) ?? parseFigmaNodeId(args.figmaUrl);
|
|
69
|
+
|
|
70
|
+
const nodeId = await resolveTargetNodeId(fileKey, requestedNodeId);
|
|
71
|
+
const rootNode = await fetchFigmaNode(fileKey, nodeId);
|
|
72
|
+
|
|
73
|
+
const { files, fidelityEntries } = await buildScreenFilesFromFigmaNodes(
|
|
74
|
+
fileKey,
|
|
75
|
+
{ [nodeId]: rootNode },
|
|
76
|
+
{
|
|
77
|
+
source: () => ({ figmaUrl: args.figmaUrl ?? null }),
|
|
78
|
+
},
|
|
79
|
+
);
|
|
80
|
+
|
|
81
|
+
const saved = await saveImportedDesignFiles({
|
|
82
|
+
designId: args.designId,
|
|
83
|
+
sourceType: "figma-import",
|
|
84
|
+
files,
|
|
85
|
+
});
|
|
86
|
+
|
|
87
|
+
return {
|
|
88
|
+
...saved,
|
|
89
|
+
figma: { fileKey, nodeId, nodeName: rootNode.name ?? null },
|
|
90
|
+
fidelityReport: summarizeFidelity(fidelityEntries),
|
|
91
|
+
guidance:
|
|
92
|
+
"Review fidelityReport.imageFallbacks for subtrees rendered as PNG (vector networks, boolean ops, unsupported node types) and fidelityReport.approximated for properties CSS cannot express exactly (rotation, per-side strokes, radial/angular/diamond gradients, blur radius scale).",
|
|
93
|
+
};
|
|
94
|
+
},
|
|
95
|
+
});
|
|
@@ -13,8 +13,23 @@ import { upsertBuilderProxyDesignSystem } from "../server/lib/builder-design-sys
|
|
|
13
13
|
|
|
14
14
|
const codeFileSchema = z.object({
|
|
15
15
|
filename: z.string().trim().min(1).describe("File name or relative path"),
|
|
16
|
-
content: z
|
|
16
|
+
content: z
|
|
17
|
+
.string()
|
|
18
|
+
.describe(
|
|
19
|
+
"File content. Text files (code, CSS, markdown, JSON, SVG): raw text. " +
|
|
20
|
+
"Binary files -- most importantly `.fig` (a zip/kiwi binary container, " +
|
|
21
|
+
'never valid text) -- MUST be base64-encoded with encoding: "base64"; ' +
|
|
22
|
+
"sending raw/binary-as-string content with the default utf8 encoding " +
|
|
23
|
+
"corrupts the file before it reaches Builder.",
|
|
24
|
+
),
|
|
17
25
|
mimeType: z.string().trim().optional().describe("Optional MIME type"),
|
|
26
|
+
encoding: z
|
|
27
|
+
.enum(["utf8", "base64"])
|
|
28
|
+
.optional()
|
|
29
|
+
.describe(
|
|
30
|
+
"Encoding of `content`. Defaults to utf8. Set to base64 for `.fig` and " +
|
|
31
|
+
"other binary files.",
|
|
32
|
+
),
|
|
18
33
|
});
|
|
19
34
|
|
|
20
35
|
export default defineAction({
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* list-design-components — read action.
|
|
3
|
+
*
|
|
4
|
+
* Scans every HTML file in a design for `data-agent-native-component`
|
|
5
|
+
* annotations and returns one summary row per distinct component name
|
|
6
|
+
* (instance count + a representative instance to preview/source from).
|
|
7
|
+
*
|
|
8
|
+
* Unlike `index-components` (which only scans one file at a time and persists
|
|
9
|
+
* metadata into `component_index`), this action is a lightweight, read-only,
|
|
10
|
+
* cross-file scan purpose-built for the Swap Instance component picker — the
|
|
11
|
+
* caller needs to know every component name that exists ANYWHERE in the
|
|
12
|
+
* design, not just on the active screen.
|
|
13
|
+
*
|
|
14
|
+
* Inline/Alpine designs only; real-app sources return an empty list with a
|
|
15
|
+
* CTA (matches `index-components`' real-app posture).
|
|
16
|
+
*/
|
|
17
|
+
|
|
18
|
+
import { defineAction } from "@agent-native/core/action";
|
|
19
|
+
import { accessFilter, resolveAccess } from "@agent-native/core/sharing";
|
|
20
|
+
import { and, eq } from "drizzle-orm";
|
|
21
|
+
import { z } from "zod";
|
|
22
|
+
|
|
23
|
+
import { getDb, schema } from "../server/db/index.js";
|
|
24
|
+
import "../server/db/index.js"; // ensure registerShareableResource runs
|
|
25
|
+
import {
|
|
26
|
+
scanComponentLibrary,
|
|
27
|
+
summarizeComponentLibrary,
|
|
28
|
+
} from "../shared/component-library.js";
|
|
29
|
+
import { designSourceTypeFromData } from "../shared/source-mode.js";
|
|
30
|
+
|
|
31
|
+
export default defineAction({
|
|
32
|
+
description:
|
|
33
|
+
"List every distinct component (by data-agent-native-component name) " +
|
|
34
|
+
"found across ALL html files in a design, with instance counts, for the " +
|
|
35
|
+
"Swap Instance component picker. Inline/Alpine designs only.",
|
|
36
|
+
schema: z.object({
|
|
37
|
+
designId: z.string().describe("Design project ID"),
|
|
38
|
+
excludeName: z
|
|
39
|
+
.string()
|
|
40
|
+
.optional()
|
|
41
|
+
.describe(
|
|
42
|
+
"Component name to omit from the results, e.g. the currently " +
|
|
43
|
+
"selected instance's own component so it isn't offered as a swap target.",
|
|
44
|
+
),
|
|
45
|
+
}),
|
|
46
|
+
readOnly: true,
|
|
47
|
+
http: { method: "GET" },
|
|
48
|
+
run: async ({ designId, excludeName }) => {
|
|
49
|
+
const access = await resolveAccess("design", designId);
|
|
50
|
+
if (!access) throw new Error("Design not found");
|
|
51
|
+
|
|
52
|
+
const rawData = (access.resource as { data?: unknown }).data;
|
|
53
|
+
const sourceType = designSourceTypeFromData(rawData);
|
|
54
|
+
|
|
55
|
+
if (sourceType !== "inline") {
|
|
56
|
+
return {
|
|
57
|
+
designId,
|
|
58
|
+
sourceType,
|
|
59
|
+
ctaRequired: true,
|
|
60
|
+
ctaMessage:
|
|
61
|
+
"Listing components across the design library requires a " +
|
|
62
|
+
"connected Builder app for real-app sources. Not yet available.",
|
|
63
|
+
components: [],
|
|
64
|
+
totalComponents: 0,
|
|
65
|
+
};
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
const db = getDb();
|
|
69
|
+
|
|
70
|
+
const files = await db
|
|
71
|
+
.select({
|
|
72
|
+
id: schema.designFiles.id,
|
|
73
|
+
designId: schema.designFiles.designId,
|
|
74
|
+
filename: schema.designFiles.filename,
|
|
75
|
+
content: schema.designFiles.content,
|
|
76
|
+
})
|
|
77
|
+
.from(schema.designFiles)
|
|
78
|
+
.innerJoin(
|
|
79
|
+
schema.designs,
|
|
80
|
+
eq(schema.designFiles.designId, schema.designs.id),
|
|
81
|
+
)
|
|
82
|
+
.where(
|
|
83
|
+
and(
|
|
84
|
+
accessFilter(schema.designs, schema.designShares),
|
|
85
|
+
eq(schema.designFiles.designId, designId),
|
|
86
|
+
eq(schema.designFiles.fileType, "html"),
|
|
87
|
+
),
|
|
88
|
+
)
|
|
89
|
+
.orderBy(schema.designFiles.createdAt);
|
|
90
|
+
|
|
91
|
+
const entries = scanComponentLibrary(files);
|
|
92
|
+
const components = summarizeComponentLibrary(entries).filter(
|
|
93
|
+
(component) => component.name !== excludeName,
|
|
94
|
+
);
|
|
95
|
+
|
|
96
|
+
return {
|
|
97
|
+
designId,
|
|
98
|
+
sourceType,
|
|
99
|
+
ctaRequired: false,
|
|
100
|
+
components,
|
|
101
|
+
totalComponents: components.length,
|
|
102
|
+
};
|
|
103
|
+
},
|
|
104
|
+
});
|
|
@@ -2,8 +2,7 @@ import { defineAction } from "@agent-native/core";
|
|
|
2
2
|
import { z } from "zod";
|
|
3
3
|
|
|
4
4
|
import { executeProviderApiRequest } from "../server/lib/provider-api.js";
|
|
5
|
-
|
|
6
|
-
const FIGMA_FILE_KEY_RE = /^[A-Za-z0-9_-]{8,}$/;
|
|
5
|
+
import { parseFigmaFileKey } from "../shared/figma-url.js";
|
|
7
6
|
|
|
8
7
|
const FigmaRenderFormatSchema = z.enum(["svg", "png"]).default("svg");
|
|
9
8
|
|
|
@@ -79,28 +78,6 @@ function numberOrDefault(value: number | undefined, fallback: number): number {
|
|
|
79
78
|
return typeof value === "number" && Number.isFinite(value) ? value : fallback;
|
|
80
79
|
}
|
|
81
80
|
|
|
82
|
-
export function parseFigmaFileKey(input: string | undefined): string | null {
|
|
83
|
-
const value = input?.trim();
|
|
84
|
-
if (!value) return null;
|
|
85
|
-
if (FIGMA_FILE_KEY_RE.test(value)) return value;
|
|
86
|
-
|
|
87
|
-
try {
|
|
88
|
-
const url = new URL(value);
|
|
89
|
-
const parts = url.pathname.split("/").filter(Boolean);
|
|
90
|
-
for (const segment of ["design", "file", "proto"]) {
|
|
91
|
-
const index = parts.indexOf(segment);
|
|
92
|
-
if (index >= 0) {
|
|
93
|
-
const candidate = parts[index + 1];
|
|
94
|
-
if (candidate && FIGMA_FILE_KEY_RE.test(candidate)) return candidate;
|
|
95
|
-
}
|
|
96
|
-
}
|
|
97
|
-
} catch {
|
|
98
|
-
return null;
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
return null;
|
|
102
|
-
}
|
|
103
|
-
|
|
104
81
|
function figmaNodeUrl(
|
|
105
82
|
fileKey: string,
|
|
106
83
|
nodeId: string,
|
|
@@ -18,8 +18,8 @@
|
|
|
18
18
|
* to open.
|
|
19
19
|
*
|
|
20
20
|
* Navigation is written via `writeAppState("navigate", ...)` — the same
|
|
21
|
-
* mechanism used by the `navigate` action
|
|
22
|
-
*
|
|
21
|
+
* mechanism used by the `navigate` action. Because this writes transient
|
|
22
|
+
* application state, the action uses the default POST mutation transport.
|
|
23
23
|
*
|
|
24
24
|
* See DESIGN-STUDIO-PLAN.md §6.1 (jump-to-source) and §7 (action surface).
|
|
25
25
|
*/
|
|
@@ -80,8 +80,6 @@ export default defineAction({
|
|
|
80
80
|
.optional()
|
|
81
81
|
.describe("Design file id; defaults to index.html"),
|
|
82
82
|
}),
|
|
83
|
-
readOnly: true,
|
|
84
|
-
http: { method: "GET" },
|
|
85
83
|
run: async ({ designId, nodeId, fileId }) => {
|
|
86
84
|
const db = getDb();
|
|
87
85
|
|