@agent-native/core 0.80.8 → 0.80.10
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 +19 -0
- package/corpus/core/docs/content/locales/ar-SA/template-design.mdx +6 -0
- package/corpus/core/docs/content/locales/de-DE/template-design.mdx +8 -0
- package/corpus/core/docs/content/locales/es-ES/template-design.mdx +10 -2
- package/corpus/core/docs/content/locales/fr-FR/template-design.mdx +10 -2
- package/corpus/core/docs/content/locales/hi-IN/template-design.mdx +7 -0
- package/corpus/core/docs/content/locales/ja-JP/template-design.mdx +7 -0
- package/corpus/core/docs/content/locales/ko-KR/template-design.mdx +7 -0
- package/corpus/core/docs/content/locales/pt-BR/template-design.mdx +9 -2
- package/corpus/core/docs/content/locales/zh-CN/template-design.mdx +6 -0
- package/corpus/core/docs/content/locales/zh-TW/template-design.mdx +6 -0
- package/corpus/core/docs/content/template-design.mdx +9 -2
- package/corpus/core/package.json +1 -1
- package/corpus/core/src/cli/design-connect.ts +28 -2
- package/corpus/core/src/cli/mcp.ts +10 -0
- package/corpus/core/src/cli/skills.ts +103 -36
- package/corpus/core/src/client/error-format.ts +25 -0
- package/corpus/core/src/client/extensions/ExtensionViewer.tsx +13 -11
- package/corpus/core/src/client/guided-questions.tsx +32 -4
- package/corpus/core/src/client/onboarding/OnboardingPanel.tsx +33 -1
- package/corpus/core/src/client/resources/BuiltinCapabilityDetail.tsx +8 -0
- package/corpus/core/src/client/resources/use-builtin-capabilities.ts +4 -2
- package/corpus/core/src/client/session-replay.ts +34 -0
- package/corpus/core/src/client/sharing/ShareButton.tsx +106 -21
- package/corpus/core/src/coding-tools/index.ts +1 -1
- package/corpus/core/src/mcp/index.ts +2 -0
- package/corpus/core/src/mcp/screen-memory-stdio.ts +290 -0
- package/corpus/core/src/mcp-client/builtin-capabilities.ts +13 -1
- package/corpus/core/src/mcp-client/index.ts +9 -0
- package/corpus/core/src/mcp-client/screen-memory-local.ts +461 -0
- package/corpus/core/src/onboarding/types.ts +7 -0
- package/corpus/core/src/server/agent-chat-plugin.ts +25 -0
- package/corpus/core/src/server/agents-bundle.ts +35 -7
- package/corpus/core/src/styles/agent-native.css +5 -0
- package/corpus/core/src/templates/default/app/global.css +35 -35
- package/corpus/templates/analytics/AGENTS.md +6 -0
- package/corpus/templates/analytics/actions/github-repo-files.ts +9 -0
- package/corpus/templates/analytics/app/components/layout/Layout.tsx +4 -4
- package/corpus/templates/analytics/app/global.css +144 -40
- package/corpus/templates/analytics/app/pages/adhoc/explorer/index.tsx +1 -1
- package/corpus/templates/analytics/app/pages/adhoc/explorer-dashboard/ChartCard.tsx +1 -1
- package/corpus/templates/analytics/app/pages/adhoc/explorer-dashboard/index.tsx +1 -1
- package/corpus/templates/analytics/app/pages/sessions/SessionDetailPage.tsx +4 -4
- package/corpus/templates/analytics/app/pages/sessions/SessionsPage.tsx +9 -9
- package/corpus/templates/analytics/changelog/2026-06-29-agents-can-search-and-read-connected-github-repositories-whe.md +6 -0
- package/corpus/templates/analytics/changelog/2026-06-29-sessions-and-explorer-layouts-adapt-when-the-agent-sidebar-is.md +6 -0
- package/corpus/templates/assets/app/components/layout/Layout.tsx +3 -1
- package/corpus/templates/assets/app/components/library/LibraryPresetGrid.tsx +1 -1
- package/corpus/templates/assets/app/global.css +99 -35
- package/corpus/templates/assets/app/routes/asset.$id.tsx +2 -2
- package/corpus/templates/assets/app/routes/brand-kits.$id.tsx +4 -4
- package/corpus/templates/assets/app/routes/library.tsx +4 -4
- package/corpus/templates/assets/changelog/2026-06-29-asset-library-and-detail-layouts-adapt-when-the-agent-sidebar.md +6 -0
- package/corpus/templates/brain/app/components/layout/Layout.tsx +1 -1
- package/corpus/templates/brain/app/global.css +63 -35
- package/corpus/templates/brain/app/routes/search.tsx +1 -1
- package/corpus/templates/brain/app/routes/settings.tsx +1 -1
- package/corpus/templates/brain/app/routes/sources.tsx +2 -2
- package/corpus/templates/brain/changelog/2026-06-29-search-settings-and-source-layouts-adapt-when-the-agent-sidebar.md +6 -0
- package/corpus/templates/calendar/app/components/calendar/EventDetailPanel.tsx +4 -4
- package/corpus/templates/calendar/app/components/calendar/FindTimePanel.tsx +3 -2
- package/corpus/templates/calendar/app/components/layout/AppLayout.tsx +4 -2
- package/corpus/templates/calendar/app/global.css +69 -35
- package/corpus/templates/calendar/changelog/2026-06-29-event-and-find-time-layouts-adapt-when-the-agent-sidebar-is.md +6 -0
- package/corpus/templates/chat/app/components/layout/Layout.tsx +1 -1
- package/corpus/templates/chat/app/global.css +35 -35
- package/corpus/templates/chat/changelog/2026-06-29-chat-layouts-adapt-when-the-agent-sidebar-is-open.md +6 -0
- package/corpus/templates/clips/AGENTS.md +13 -0
- package/corpus/templates/clips/actions/get-screen-memory-status.ts +12 -0
- package/corpus/templates/clips/actions/query-screen-memory-context.ts +29 -0
- package/corpus/templates/clips/actions/view-screen.ts +2 -2
- package/corpus/templates/clips/app/components/library/library-layout.tsx +1 -1
- package/corpus/templates/clips/app/global.css +47 -35
- package/corpus/templates/clips/app/routes/_app.meetings.$meetingId.tsx +3 -3
- package/corpus/templates/clips/app/routes/r.$recordingId.tsx +45 -18
- package/corpus/templates/clips/changelog/2026-06-29-meeting-detail-layouts-adapt-when-the-agent-sidebar-is-open.md +6 -0
- package/corpus/templates/clips/changelog/2026-06-29-screen-memory-keeps-a-local-rolling-screen-buffer-for-agent-context.md +5 -0
- package/corpus/templates/clips/changelog/2026-06-29-video-chat-is-easier-to-find-on-recording-pages-and-s3-setup.md +6 -0
- package/corpus/templates/clips/chrome-extension/src/styles.css +39 -39
- package/corpus/templates/clips/desktop/src/app.tsx +290 -1
- package/corpus/templates/clips/desktop/src/shared/config.ts +83 -0
- package/corpus/templates/clips/desktop/src/styles.css +67 -52
- package/corpus/templates/clips/desktop/src-tauri/src/config.rs +50 -0
- package/corpus/templates/clips/desktop/src-tauri/src/lib.rs +17 -0
- package/corpus/templates/clips/desktop/src-tauri/src/native_screen.rs +13 -13
- package/corpus/templates/clips/desktop/src-tauri/src/screen_memory.rs +990 -0
- package/corpus/templates/clips/server/plugins/onboarding.ts +2 -0
- package/corpus/templates/content/app/components/editor/database/DatabaseView.tsx +3 -3
- package/corpus/templates/content/app/components/layout/Layout.tsx +1 -1
- package/corpus/templates/content/app/global.css +29 -15
- package/corpus/templates/content/changelog/2026-06-29-database-gallery-layouts-adapt-when-the-agent-sidebar-is-open.md +6 -0
- package/corpus/templates/design/.agents/skills/design-generation/SKILL.md +25 -20
- package/corpus/templates/design/.agents/skills/design-systems/SKILL.md +8 -0
- package/corpus/templates/design/.agents/skills/export-handoff/SKILL.md +8 -0
- package/corpus/templates/design/.agents/skills/visual-edit/SKILL.md +13 -0
- package/corpus/templates/design/AGENTS.md +20 -12
- package/corpus/templates/design/CODE_NATIVE_DESIGN_STUDIO_IMPLEMENTATION_PLAN.md +1054 -0
- package/corpus/templates/design/DESIGN-STUDIO-PLAN.md +717 -0
- package/corpus/templates/design/actions/add-breakpoint.ts +143 -0
- package/corpus/templates/design/actions/add-localhost-screens.ts +5 -0
- package/corpus/templates/design/actions/apply-a11y-fix.ts +317 -0
- package/corpus/templates/design/actions/apply-component-prop-edit.ts +433 -0
- package/corpus/templates/design/actions/apply-design-state.ts +200 -0
- package/corpus/templates/design/actions/apply-design-token-edit.ts +202 -0
- package/corpus/templates/design/actions/apply-motion-edit.ts +450 -0
- package/corpus/templates/design/actions/apply-shader-fill.ts +404 -0
- package/corpus/templates/design/actions/apply-visual-edit.ts +214 -8
- package/corpus/templates/design/actions/capture-design-state.ts +224 -0
- package/corpus/templates/design/actions/connect-builder-app.ts +162 -0
- package/corpus/templates/design/actions/create-component.ts +447 -0
- package/corpus/templates/design/actions/create-design-branch.ts +263 -0
- package/corpus/templates/design/actions/create-design-state.ts +162 -0
- package/corpus/templates/design/actions/delete-design-state.ts +55 -0
- package/corpus/templates/design/actions/deploy-design-preview.ts +275 -0
- package/corpus/templates/design/actions/export-coding-handoff.ts +12 -4
- package/corpus/templates/design/actions/generate-design.ts +6 -21
- package/corpus/templates/design/actions/generate-screens.ts +43 -2
- package/corpus/templates/design/actions/get-component-details.ts +242 -0
- package/corpus/templates/design/actions/get-design-branch-diff.ts +362 -0
- package/corpus/templates/design/actions/get-design-review.ts +314 -0
- package/corpus/templates/design/actions/get-design-surface-index.ts +582 -0
- package/corpus/templates/design/actions/get-design.ts +1 -0
- package/corpus/templates/design/actions/get-motion-timeline.ts +99 -0
- package/corpus/templates/design/actions/index-components.ts +258 -0
- package/corpus/templates/design/actions/index-design-tokens.ts +273 -0
- package/corpus/templates/design/actions/list-design-extensions.ts +309 -0
- package/corpus/templates/design/actions/list-design-source-capabilities.ts +153 -0
- package/corpus/templates/design/actions/list-design-states.ts +72 -0
- package/corpus/templates/design/actions/migrate-inline-design-to-app.ts +298 -0
- package/corpus/templates/design/actions/open-component-source.ts +237 -0
- package/corpus/templates/design/actions/present-design-variants.ts +355 -30
- package/corpus/templates/design/actions/preview-component-prop-edit.ts +254 -0
- package/corpus/templates/design/actions/preview-design-token-edit.ts +113 -0
- package/corpus/templates/design/actions/preview-shader-fill.ts +189 -0
- package/corpus/templates/design/actions/remove-breakpoint.ts +103 -0
- package/corpus/templates/design/actions/remove-motion-timeline.ts +196 -0
- package/corpus/templates/design/actions/run-design-audit.ts +421 -0
- package/corpus/templates/design/actions/run-design-extension-action.ts +284 -0
- package/corpus/templates/design/actions/set-active-breakpoint.ts +39 -0
- package/corpus/templates/design/actions/view-screen.ts +75 -31
- package/corpus/templates/design/app/components/design/DesignCanvas.tsx +1738 -135
- package/corpus/templates/design/app/components/design/DesignEditorSkeleton.tsx +1 -1
- package/corpus/templates/design/app/components/design/DesignExtensionsPanel.tsx +632 -43
- package/corpus/templates/design/app/components/design/DrawOverlay.tsx +1 -1
- package/corpus/templates/design/app/components/design/EditPanel.tsx +1873 -132
- package/corpus/templates/design/app/components/design/LayersPanel.tsx +384 -219
- package/corpus/templates/design/app/components/design/LocalSourceEditBanner.tsx +157 -0
- package/corpus/templates/design/app/components/design/MotionDock.tsx +1062 -0
- package/corpus/templates/design/app/components/design/MultiScreenCanvas.tsx +2103 -295
- package/corpus/templates/design/app/components/design/QuestionFlow.tsx +83 -206
- package/corpus/templates/design/app/components/design/ReviewPanel.tsx +759 -0
- package/corpus/templates/design/app/components/design/StatesPanel.tsx +579 -0
- package/corpus/templates/design/app/components/design/TokensPanel.tsx +573 -0
- package/corpus/templates/design/app/components/design/TweaksPanel.tsx +1 -1
- package/corpus/templates/design/app/components/design/canvas-primitive-style.ts +241 -0
- package/corpus/templates/design/app/components/design/index.ts +16 -1
- package/corpus/templates/design/app/components/design/inspector/AutoLayoutMatrix.tsx +238 -137
- package/corpus/templates/design/app/components/design/inspector/DesignColorPicker.tsx +188 -14
- package/corpus/templates/design/app/components/design/inspector/ExportSettingsPanel.tsx +24 -5
- package/corpus/templates/design/app/components/design/inspector/ImageFillControls.tsx +57 -1
- package/corpus/templates/design/app/components/design/inspector/InspectorAiActions.tsx +145 -0
- package/corpus/templates/design/app/components/design/inspector/SHADER_INTEGRATION.md +42 -12
- package/corpus/templates/design/app/components/design/inspector/ScrubInput.tsx +37 -12
- package/corpus/templates/design/app/components/design/inspector/index.ts +1 -0
- package/corpus/templates/design/app/components/design/inspector/scrub-input-utils.ts +12 -5
- package/corpus/templates/design/app/components/design/types.ts +9 -0
- package/corpus/templates/design/app/components/layout/Layout.tsx +23 -5
- package/corpus/templates/design/app/components/visual-editor/DrawOverlay.tsx +1 -1
- package/corpus/templates/design/app/global.css +77 -49
- package/corpus/templates/design/app/hooks/use-question-flow.ts +2 -2
- package/corpus/templates/design/app/hooks/useAgentEditRequest.ts +131 -0
- package/corpus/templates/design/app/hooks/useDesignHotkeys.ts +11 -2
- package/corpus/templates/design/app/i18n/zh-TW.ts +34 -0
- package/corpus/templates/design/app/i18n-data.ts +314 -3
- package/corpus/templates/design/app/pages/DesignEditor.tsx +4929 -892
- package/corpus/templates/design/app/root.tsx +1 -1
- package/corpus/templates/design/changelog/2026-06-29-added-a-review-panel-in-the-design-editor-s-inspector-with-a.md +6 -0
- package/corpus/templates/design/changelog/2026-06-29-containers-no-longer-block-selecting-nested-elements-and-nor.md +6 -0
- package/corpus/templates/design/changelog/2026-06-29-copying-and-pasting-layers-no-longer-shows-success-notificat.md +6 -0
- package/corpus/templates/design/changelog/2026-06-29-design-agents-now-generate-and-refine-variants-from-stronger.md +6 -0
- package/corpus/templates/design/changelog/2026-06-29-design-inspector-controls-now-match-figmas-softer-dark-chrome.md +6 -0
- package/corpus/templates/design/changelog/2026-06-29-design-questions-now-appear-as-a-cleaner-canvas-intake-with-.md +6 -0
- package/corpus/templates/design/changelog/2026-06-29-design-variant-directions-now-appear-as-board-screens-with-chat-buttons.md +5 -0
- package/corpus/templates/design/changelog/2026-06-29-device-presets-in-all-screens-view-resize-the-selected-previ.md +6 -0
- package/corpus/templates/design/changelog/2026-06-29-element-selection-no-longer-snaps-back-to-the-previous-layer.md +6 -0
- package/corpus/templates/design/changelog/2026-06-29-frame-resize-measurements-now-stay-beside-the-cursor-while-d.md +6 -0
- package/corpus/templates/design/changelog/2026-06-29-inspector-number-fields-have-cleaner-tooltips-and-draggable-.md +6 -0
- package/corpus/templates/design/changelog/2026-06-29-layer-and-canvas-drags-keep-the-layer-list-stable-while-chan.md +6 -0
- package/corpus/templates/design/changelog/2026-06-29-layer-locking-layer-nesting-generated-question-intake-and-im.md +6 -0
- package/corpus/templates/design/changelog/2026-06-29-layer-moves-can-be-undone-and-redone-without-flashing-the-ca.md +6 -0
- package/corpus/templates/design/changelog/2026-06-29-layer-names-in-the-sidebar-can-scroll-horizontally-instead-o.md +6 -0
- package/corpus/templates/design/changelog/2026-06-29-layer-nesting-in-the-sidebar-now-uses-tighter-spacing-so-nam.md +6 -0
- package/corpus/templates/design/changelog/2026-06-29-layers-no-longer-repeat-document-wrapper-rows-when-a-screen-.md +6 -0
- package/corpus/templates/design/changelog/2026-06-29-overview-previews-now-keep-element-hover-and-selection-tied-.md +6 -0
- package/corpus/templates/design/changelog/2026-06-29-pressing-escape-now-cancels-a-stuck-screen-drag-in-the-overv.md +6 -0
- package/corpus/templates/design/changelog/2026-06-29-screen-overview-is-easier-to-find-and-named-screens-open-dir.md +6 -0
- package/corpus/templates/design/changelog/2026-06-29-screen-overview-only-highlights-screens-when-the-frame-or-ti.md +6 -0
- package/corpus/templates/design/changelog/2026-06-29-screen-overview-previews-now-resize-to-match-the-selected-de.md +6 -0
- package/corpus/templates/design/changelog/2026-06-29-screen-overview-selection-now-uses-a-pointer-cursor-instead-.md +6 -0
- package/corpus/templates/design/changelog/2026-06-29-screen-overview-selection-outlines-now-stay-locked-to-the-se.md +6 -0
- package/corpus/templates/design/changelog/2026-06-29-screen-overview-zoom-now-reports-real-screen-scale-separatel.md +6 -0
- package/corpus/templates/design/changelog/2026-06-29-screen-overview-zooming-feels-smoother-and-selection-outline.md +6 -0
- package/corpus/templates/design/changelog/2026-06-29-screen-overview-zooming-now-stays-on-the-overview-canvas-ins.md +6 -0
- package/corpus/templates/design/changelog/2026-06-29-screen-previews-use-a-single-blue-hover-border-in-all-screen.md +6 -0
- package/corpus/templates/design/changelog/2026-06-29-selected-containers-show-draggable-padding-and-gap-guides-on.md +6 -0
- package/corpus/templates/design/changelog/2026-06-29-selecting-a-nested-layer-from-all-screens-now-keeps-you-in-a.md +6 -0
- package/corpus/templates/design/changelog/2026-06-29-share-now-groups-link-sharing-exports-and-agent-handoff.md +6 -0
- package/corpus/templates/design/changelog/2026-06-29-the-design-editor-adds-a-studio-layer-with-tokens-respon.md +6 -0
- package/corpus/templates/design/changelog/2026-06-29-the-design-editor-loading-skeleton-now-uses-a-softer-charcoa.md +6 -0
- package/corpus/templates/design/changelog/2026-06-29-the-device-preview-menu-now-sits-next-to-the-preview-button-.md +6 -0
- package/corpus/templates/design/changelog/2026-06-29-the-inspector-stays-read-only-while-an-empty-design-is-still.md +6 -0
- package/corpus/templates/design/changelog/2026-06-29-the-missing-design-view-now-matches-the-rest-of-the-editor-c.md +6 -0
- package/corpus/templates/design/changelog/2026-06-29-the-pen-tool-icon-and-tool-option-menus-better-match-the-edi.md +6 -0
- package/corpus/templates/design/changelog/2026-06-29-typography-controls-now-keep-the-font-name-visible-and-move-.md +6 -0
- package/corpus/templates/design/changelog/2026-06-30-accessibility-findings-now-offer-a-one-click-fix.md +6 -0
- package/corpus/templates/design/changelog/2026-06-30-component-instances-now-have-editable-props-in-the-inspe.md +6 -0
- package/corpus/templates/design/changelog/2026-06-30-inspect-code-now-shows-the-elements-opening-tag-at-a-gla.md +6 -0
- package/corpus/templates/design/changelog/2026-06-30-shader-fill-presets-can-now-be-applied-to-an-element.md +6 -0
- package/corpus/templates/design/changelog/2026-06-30-the-motion-timeline-can-now-add-a-track-to-any-element-a.md +6 -0
- package/corpus/templates/design/changelog/2026-06-30-visual-editor-selection-layer-paint-and-drawing-controls-are-more-reliable.md +6 -0
- package/corpus/templates/design/e2e/README.md +3 -3
- package/corpus/templates/design/e2e/global-setup.ts +11 -22
- package/corpus/templates/design/e2e/helpers.ts +128 -11
- package/corpus/templates/design/playwright.config.ts +9 -3
- package/corpus/templates/design/server/db/schema.ts +123 -0
- package/corpus/templates/design/server/lib/coding-handoff.ts +126 -2
- package/corpus/templates/design/server/plugins/core-routes.ts +1 -2
- package/corpus/templates/design/server/plugins/db.ts +90 -0
- package/corpus/templates/design/server/routes/api/design-handoff/[id].zip.get.ts +86 -0
- package/corpus/templates/design/shared/builder-app.ts +297 -0
- package/corpus/templates/design/shared/capability-resolver.ts +123 -0
- package/corpus/templates/design/shared/capture-sanitize.ts +70 -0
- package/corpus/templates/design/shared/code-layer.ts +1141 -93
- package/corpus/templates/design/shared/component-model.ts +239 -0
- package/corpus/templates/design/shared/design-review.ts +275 -0
- package/corpus/templates/design/shared/design-source-capabilities.ts +286 -0
- package/corpus/templates/design/shared/design-state.ts +112 -0
- package/corpus/templates/design/shared/design-surface-index.ts +258 -0
- package/corpus/templates/design/shared/generation-session.ts +41 -0
- package/corpus/templates/design/shared/motion-compiler.ts +278 -0
- package/corpus/templates/design/shared/motion-timeline.ts +193 -0
- package/corpus/templates/design/shared/responsive-classes.ts +452 -0
- package/corpus/templates/design/shared/shader-fill.ts +323 -0
- package/corpus/templates/design/shared/source-mode.ts +245 -0
- package/corpus/templates/dispatch/app/global.css +79 -35
- package/corpus/templates/dispatch/app/routes/integrations.tsx +8 -7
- package/corpus/templates/dispatch/changelog/2026-06-29-integration-layouts-adapt-when-the-agent-sidebar-is-open.md +6 -0
- package/corpus/templates/forms/app/components/layout/Layout.tsx +6 -2
- package/corpus/templates/forms/app/global.css +64 -35
- package/corpus/templates/forms/app/pages/FormsListPage.tsx +2 -2
- package/corpus/templates/forms/app/pages/ResponseInsightsPage.tsx +3 -3
- package/corpus/templates/forms/changelog/2026-06-29-form-list-and-insight-layouts-adapt-when-the-agent-sidebar.md +6 -0
- package/corpus/templates/macros/app/components/layout/AppLayout.tsx +3 -1
- package/corpus/templates/macros/app/global.css +25 -9
- package/corpus/templates/macros/changelog/2026-06-29-macro-layouts-adapt-when-the-agent-sidebar-is-open.md +6 -0
- package/corpus/templates/mail/app/components/layout/AppLayout.tsx +6 -2
- package/corpus/templates/mail/app/global.css +42 -36
- package/corpus/templates/mail/app/pages/InboxPage.tsx +1 -1
- package/corpus/templates/mail/changelog/2026-06-29-the-contact-panel-now-adapts-to-the-available-mail-pane-width.md +6 -0
- package/corpus/templates/plan/app/components/layout/Layout.tsx +3 -1
- package/corpus/templates/plan/app/components/plan/CanvasArea.tsx +6 -2
- package/corpus/templates/plan/app/components/plan/DocumentArea.tsx +6 -7
- package/corpus/templates/plan/app/global.css +74 -42
- package/corpus/templates/plan/changelog/2026-06-29-plan-canvases-open-without-an-initial-pan-and-zoom-flicker.md +6 -0
- package/corpus/templates/plan/changelog/2026-06-29-plan-document-blocks-adapt-to-the-available-document-width.md +6 -0
- package/corpus/templates/plan/changelog/2026-06-29-plan-titles-and-summaries-can-be-edited-inline-without-focus.md +6 -0
- package/corpus/templates/slides/app/components/layout/Layout.tsx +3 -1
- package/corpus/templates/slides/app/global.css +49 -33
- package/corpus/templates/slides/changelog/2026-06-29-slide-layouts-adapt-when-the-agent-sidebar-is-open.md +6 -0
- package/corpus/templates/videos/app/components/layout/Layout.tsx +3 -1
- package/corpus/templates/videos/app/global.css +35 -35
- package/corpus/templates/videos/changelog/2026-06-29-video-layouts-adapt-when-the-agent-sidebar-is-open.md +6 -0
- package/dist/cli/design-connect.d.ts.map +1 -1
- package/dist/cli/design-connect.js +28 -2
- package/dist/cli/design-connect.js.map +1 -1
- package/dist/cli/mcp.d.ts.map +1 -1
- package/dist/cli/mcp.js +10 -0
- package/dist/cli/mcp.js.map +1 -1
- package/dist/cli/skills.d.ts.map +1 -1
- package/dist/cli/skills.js +95 -33
- package/dist/cli/skills.js.map +1 -1
- package/dist/client/error-format.d.ts.map +1 -1
- package/dist/client/error-format.js +17 -0
- package/dist/client/error-format.js.map +1 -1
- package/dist/client/extensions/ExtensionViewer.d.ts.map +1 -1
- package/dist/client/extensions/ExtensionViewer.js +3 -4
- package/dist/client/extensions/ExtensionViewer.js.map +1 -1
- package/dist/client/guided-questions.d.ts +4 -0
- package/dist/client/guided-questions.d.ts.map +1 -1
- package/dist/client/guided-questions.js +16 -7
- package/dist/client/guided-questions.js.map +1 -1
- package/dist/client/onboarding/OnboardingPanel.js +26 -1
- package/dist/client/onboarding/OnboardingPanel.js.map +1 -1
- package/dist/client/resources/BuiltinCapabilityDetail.d.ts.map +1 -1
- package/dist/client/resources/BuiltinCapabilityDetail.js +1 -1
- package/dist/client/resources/BuiltinCapabilityDetail.js.map +1 -1
- package/dist/client/resources/use-builtin-capabilities.d.ts +1 -1
- package/dist/client/resources/use-builtin-capabilities.d.ts.map +1 -1
- package/dist/client/resources/use-builtin-capabilities.js +2 -1
- package/dist/client/resources/use-builtin-capabilities.js.map +1 -1
- package/dist/client/session-replay.d.ts.map +1 -1
- package/dist/client/session-replay.js +31 -0
- package/dist/client/session-replay.js.map +1 -1
- package/dist/client/sharing/ShareButton.d.ts +14 -0
- package/dist/client/sharing/ShareButton.d.ts.map +1 -1
- package/dist/client/sharing/ShareButton.js +36 -7
- package/dist/client/sharing/ShareButton.js.map +1 -1
- package/dist/coding-tools/index.js +1 -1
- package/dist/coding-tools/index.js.map +1 -1
- package/dist/mcp/index.d.ts +2 -0
- package/dist/mcp/index.d.ts.map +1 -1
- package/dist/mcp/index.js +1 -0
- package/dist/mcp/index.js.map +1 -1
- package/dist/mcp/screen-memory-stdio.d.ts +6 -0
- package/dist/mcp/screen-memory-stdio.d.ts.map +1 -0
- package/dist/mcp/screen-memory-stdio.js +213 -0
- package/dist/mcp/screen-memory-stdio.js.map +1 -0
- package/dist/mcp-client/builtin-capabilities.d.ts +1 -1
- package/dist/mcp-client/builtin-capabilities.d.ts.map +1 -1
- package/dist/mcp-client/builtin-capabilities.js +10 -0
- package/dist/mcp-client/builtin-capabilities.js.map +1 -1
- package/dist/mcp-client/index.d.ts +1 -0
- package/dist/mcp-client/index.d.ts.map +1 -1
- package/dist/mcp-client/index.js +1 -0
- package/dist/mcp-client/index.js.map +1 -1
- package/dist/mcp-client/screen-memory-local.d.ts +61 -0
- package/dist/mcp-client/screen-memory-local.d.ts.map +1 -0
- package/dist/mcp-client/screen-memory-local.js +336 -0
- package/dist/mcp-client/screen-memory-local.js.map +1 -0
- package/dist/observability/routes.d.ts +3 -3
- package/dist/onboarding/types.d.ts +7 -0
- package/dist/onboarding/types.d.ts.map +1 -1
- package/dist/onboarding/types.js.map +1 -1
- package/dist/server/agent-chat-plugin.d.ts.map +1 -1
- package/dist/server/agent-chat-plugin.js +26 -0
- package/dist/server/agent-chat-plugin.js.map +1 -1
- package/dist/server/agent-engine-api-key-route.d.ts +1 -1
- package/dist/server/agents-bundle.d.ts.map +1 -1
- package/dist/server/agents-bundle.js +22 -7
- package/dist/server/agents-bundle.js.map +1 -1
- package/dist/styles/agent-native.css +5 -0
- package/dist/templates/default/app/global.css +35 -35
- package/docs/content/locales/ar-SA/template-design.mdx +6 -0
- package/docs/content/locales/de-DE/template-design.mdx +8 -0
- package/docs/content/locales/es-ES/template-design.mdx +10 -2
- package/docs/content/locales/fr-FR/template-design.mdx +10 -2
- package/docs/content/locales/hi-IN/template-design.mdx +7 -0
- package/docs/content/locales/ja-JP/template-design.mdx +7 -0
- package/docs/content/locales/ko-KR/template-design.mdx +7 -0
- package/docs/content/locales/pt-BR/template-design.mdx +9 -2
- package/docs/content/locales/zh-CN/template-design.mdx +6 -0
- package/docs/content/locales/zh-TW/template-design.mdx +6 -0
- package/docs/content/template-design.mdx +9 -2
- package/package.json +1 -1
- package/src/templates/default/app/global.css +35 -35
- package/corpus/templates/design/app/components/design/VariantGrid.tsx +0 -189
- package/corpus/templates/design/app/components/design/VariantHandoffCard.tsx +0 -115
- package/corpus/templates/design/app/hooks/use-variant-flow.ts +0 -342
|
@@ -15,6 +15,11 @@ import { defineConfig, devices } from "@playwright/test";
|
|
|
15
15
|
*/
|
|
16
16
|
const PORT = Number(process.env.E2E_PORT ?? 9333);
|
|
17
17
|
const BASE_URL = process.env.E2E_BASE_URL ?? `http://127.0.0.1:${PORT}`;
|
|
18
|
+
const E2E_DATABASE_URL = `file:${path.join(
|
|
19
|
+
import.meta.dirname,
|
|
20
|
+
"data",
|
|
21
|
+
"e2e.db",
|
|
22
|
+
)}`;
|
|
18
23
|
const BROWSER_CHANNEL = process.env.E2E_BROWSER_CHANNEL;
|
|
19
24
|
|
|
20
25
|
export default defineConfig({
|
|
@@ -47,9 +52,10 @@ export default defineConfig({
|
|
|
47
52
|
? undefined
|
|
48
53
|
: {
|
|
49
54
|
// APP_NAME + the app-prefixed DESIGN_DATABASE_URL is checked BEFORE the
|
|
50
|
-
// generic DATABASE_URL,
|
|
51
|
-
//
|
|
52
|
-
|
|
55
|
+
// generic DATABASE_URL, but set both to an absolute SQLite URL so a
|
|
56
|
+
// `.env` Postgres URL or a changed command cwd can never override this
|
|
57
|
+
// throwaway local db.
|
|
58
|
+
command: `APP_NAME=design DESIGN_DATABASE_URL=${JSON.stringify(E2E_DATABASE_URL)} DATABASE_URL=${JSON.stringify(E2E_DATABASE_URL)} PORT=${PORT} corepack pnpm dev`,
|
|
53
59
|
url: BASE_URL,
|
|
54
60
|
reuseExistingServer: !process.env.CI,
|
|
55
61
|
// Cold Vite dep-optimization on first boot can exceed two minutes.
|
|
@@ -81,3 +81,126 @@ export const designLocalhostConnections = table(
|
|
|
81
81
|
updatedAt: text("updated_at").default(now()),
|
|
82
82
|
},
|
|
83
83
|
);
|
|
84
|
+
|
|
85
|
+
// ---------------------------------------------------------------------------
|
|
86
|
+
// New tables — additive only; never alter existing tables.
|
|
87
|
+
// All ownable tables are read/written through accessFilter / assertAccess.
|
|
88
|
+
// ---------------------------------------------------------------------------
|
|
89
|
+
|
|
90
|
+
/**
|
|
91
|
+
* Real-app component metadata indexed from TS prop types, cva/tailwind-variants
|
|
92
|
+
* variants, and Storybook stories. Scoped to one design + source ref.
|
|
93
|
+
*/
|
|
94
|
+
export const componentIndex = table("component_index", {
|
|
95
|
+
id: text("id").primaryKey(),
|
|
96
|
+
designId: text("design_id").notNull(),
|
|
97
|
+
/** Opaque string identifying the source connection (localhost bridge id, fusion project id, etc.) */
|
|
98
|
+
sourceRef: text("source_ref"),
|
|
99
|
+
name: text("name").notNull(),
|
|
100
|
+
filePath: text("file_path"),
|
|
101
|
+
exportName: text("export_name"),
|
|
102
|
+
/** JSON: parsed prop types / cva variant definitions */
|
|
103
|
+
props: text("props"),
|
|
104
|
+
/** JSON: variant groups (size, color, state, …) */
|
|
105
|
+
variants: text("variants"),
|
|
106
|
+
/** JSON: Storybook stories referencing this component */
|
|
107
|
+
stories: text("stories"),
|
|
108
|
+
/** JSON: runtime CSS selectors used to outline instances on the canvas */
|
|
109
|
+
runtimeSelectors: text("runtime_selectors"),
|
|
110
|
+
createdAt: text("created_at").default(now()),
|
|
111
|
+
updatedAt: text("updated_at").default(now()),
|
|
112
|
+
...ownableColumns(),
|
|
113
|
+
});
|
|
114
|
+
|
|
115
|
+
/**
|
|
116
|
+
* Motion timeline — scoped to one design + source ref + screen/file.
|
|
117
|
+
* A design may have many timelines (one per screen or animation target).
|
|
118
|
+
* The compiled CSS is the runtime truth; tracks JSON aids editing only.
|
|
119
|
+
*/
|
|
120
|
+
export const motionTimeline = table("motion_timeline", {
|
|
121
|
+
id: text("id").primaryKey(),
|
|
122
|
+
designId: text("design_id").notNull(),
|
|
123
|
+
/** Opaque source connection ref; null for inline designs. */
|
|
124
|
+
sourceRef: text("source_ref"),
|
|
125
|
+
/** File path for real-app CSS modules; null for inline (managed <style> block). */
|
|
126
|
+
filePath: text("file_path"),
|
|
127
|
+
/**
|
|
128
|
+
* JSON array of track objects:
|
|
129
|
+
* [{ target_node_id, property, keyframes: [{ t, value, ease }] }]
|
|
130
|
+
*/
|
|
131
|
+
tracks: text("tracks").notNull().default("[]"),
|
|
132
|
+
/** Total animation duration in milliseconds. */
|
|
133
|
+
durationMs: integer("duration_ms").notNull().default(300),
|
|
134
|
+
/** Default easing function name (e.g. "ease", "ease-in-out", "linear"). */
|
|
135
|
+
defaultEase: text("default_ease").notNull().default("ease"),
|
|
136
|
+
/**
|
|
137
|
+
* Hash of the compiled CSS output; used to detect drift between the tracks
|
|
138
|
+
* JSON and the compiled CSS block. apply-motion-edit updates both atomically.
|
|
139
|
+
*/
|
|
140
|
+
compiledHash: text("compiled_hash"),
|
|
141
|
+
createdAt: text("created_at").default(now()),
|
|
142
|
+
updatedAt: text("updated_at").default(now()),
|
|
143
|
+
...ownableColumns(),
|
|
144
|
+
});
|
|
145
|
+
|
|
146
|
+
/**
|
|
147
|
+
* Design states, fixtures, and live captures.
|
|
148
|
+
* States are alternate x-data / DOM snapshots (e.g. Default, Loading, Empty).
|
|
149
|
+
* Fixtures hold static data payloads for real-app preview.
|
|
150
|
+
* Captures are live snapshots of a running app's route + props + API data.
|
|
151
|
+
*/
|
|
152
|
+
export const designState = table("design_state", {
|
|
153
|
+
id: text("id").primaryKey(),
|
|
154
|
+
designId: text("design_id").notNull(),
|
|
155
|
+
/** Opaque source connection ref. */
|
|
156
|
+
sourceRef: text("source_ref"),
|
|
157
|
+
name: text("name").notNull(),
|
|
158
|
+
/** 'state' | 'fixture' | 'capture' */
|
|
159
|
+
kind: text("kind", { enum: ["state", "fixture", "capture"] })
|
|
160
|
+
.notNull()
|
|
161
|
+
.default("state"),
|
|
162
|
+
/** Active breakpoint when this state was created: 'auto' | 'desktop' | 'tablet' | 'mobile' */
|
|
163
|
+
breakpoint: text("breakpoint", {
|
|
164
|
+
enum: ["auto", "desktop", "tablet", "mobile"],
|
|
165
|
+
})
|
|
166
|
+
.notNull()
|
|
167
|
+
.default("auto"),
|
|
168
|
+
/** Route path captured (real-app captures only). */
|
|
169
|
+
route: text("route"),
|
|
170
|
+
/** JSON: static data fixture payload (fixture kind). */
|
|
171
|
+
fixtureData: text("fixture_data"),
|
|
172
|
+
/** JSON: live-captured route props + API response (capture kind). */
|
|
173
|
+
captureData: text("capture_data"),
|
|
174
|
+
/** Opaque reference to a design_version snapshot or stored preview artifact. */
|
|
175
|
+
previewRef: text("preview_ref"),
|
|
176
|
+
createdAt: text("created_at").default(now()),
|
|
177
|
+
updatedAt: text("updated_at").default(now()),
|
|
178
|
+
...ownableColumns(),
|
|
179
|
+
});
|
|
180
|
+
|
|
181
|
+
/**
|
|
182
|
+
* Cached accessibility audit + visual diff results for a design.
|
|
183
|
+
* Keyed by design + optional base/compare design_versions pair + source ref.
|
|
184
|
+
* status: 'pending' | 'ready' | 'error'
|
|
185
|
+
*/
|
|
186
|
+
export const designReviewSnapshot = table("design_review_snapshot", {
|
|
187
|
+
id: text("id").primaryKey(),
|
|
188
|
+
designId: text("design_id").notNull(),
|
|
189
|
+
/** design_versions.id for the base (older) snapshot in a diff. */
|
|
190
|
+
baseVersionId: text("base_version_id"),
|
|
191
|
+
/** design_versions.id for the compare (newer) snapshot in a diff. */
|
|
192
|
+
compareVersionId: text("compare_version_id"),
|
|
193
|
+
/** Opaque source connection ref. */
|
|
194
|
+
sourceRef: text("source_ref"),
|
|
195
|
+
/** JSON: array of a11y findings (contrast, tap targets, roles, alt, focus). */
|
|
196
|
+
a11yFindings: text("a11y_findings"),
|
|
197
|
+
/** JSON: visual diff surface data (changed regions, before/after refs). */
|
|
198
|
+
visualDiff: text("visual_diff"),
|
|
199
|
+
/** 'pending' | 'ready' | 'error' */
|
|
200
|
+
status: text("status", { enum: ["pending", "ready", "error"] })
|
|
201
|
+
.notNull()
|
|
202
|
+
.default("pending"),
|
|
203
|
+
createdAt: text("created_at").default(now()),
|
|
204
|
+
updatedAt: text("updated_at").default(now()),
|
|
205
|
+
...ownableColumns(),
|
|
206
|
+
});
|
|
@@ -82,6 +82,23 @@ export function buildRawHandoffUrl({
|
|
|
82
82
|
return normalizedOrigin ? `${normalizedOrigin}${path}` : path;
|
|
83
83
|
}
|
|
84
84
|
|
|
85
|
+
export function buildHandoffZipUrl({
|
|
86
|
+
id,
|
|
87
|
+
token,
|
|
88
|
+
origin,
|
|
89
|
+
}: {
|
|
90
|
+
id: string;
|
|
91
|
+
token: string;
|
|
92
|
+
origin?: string | null;
|
|
93
|
+
}): string {
|
|
94
|
+
const params = new URLSearchParams({ token });
|
|
95
|
+
const path = appPath(
|
|
96
|
+
`/api/design-handoff/${encodeURIComponent(id)}.zip?${params.toString()}`,
|
|
97
|
+
);
|
|
98
|
+
const normalizedOrigin = normalizeHandoffOrigin(origin);
|
|
99
|
+
return normalizedOrigin ? `${normalizedOrigin}${path}` : path;
|
|
100
|
+
}
|
|
101
|
+
|
|
85
102
|
function parseDesignData(data?: string | null): Record<string, unknown> {
|
|
86
103
|
if (!data) return {};
|
|
87
104
|
try {
|
|
@@ -301,20 +318,127 @@ export function buildDesignHandoffMarkdown(
|
|
|
301
318
|
return `${lines.join("\n")}\n`;
|
|
302
319
|
}
|
|
303
320
|
|
|
321
|
+
function safeZipBaseName(title?: string | null): string {
|
|
322
|
+
const safe = (title || "design")
|
|
323
|
+
.replace(/[^a-zA-Z0-9_-]/g, "-")
|
|
324
|
+
.replace(/-+/g, "-")
|
|
325
|
+
.replace(/^-|-$/g, "");
|
|
326
|
+
return safe || "design";
|
|
327
|
+
}
|
|
328
|
+
|
|
329
|
+
export function buildHandoffZipFilename(title?: string | null): string {
|
|
330
|
+
return `${safeZipBaseName(title)}-agent-handoff.zip`;
|
|
331
|
+
}
|
|
332
|
+
|
|
333
|
+
function safeZipPath(filename: string, fallback: string): string {
|
|
334
|
+
const normalized = filename
|
|
335
|
+
.replace(/\\/g, "/")
|
|
336
|
+
.split("/")
|
|
337
|
+
.map((part) => part.trim())
|
|
338
|
+
.filter((part) => part && part !== "." && part !== "..")
|
|
339
|
+
.join("/");
|
|
340
|
+
const withoutControlCharacters = normalized.replace(/[\x00-\x1f\x7f]/g, "");
|
|
341
|
+
return withoutControlCharacters || fallback;
|
|
342
|
+
}
|
|
343
|
+
|
|
344
|
+
function uniqueZipPath(path: string, seen: Set<string>): string {
|
|
345
|
+
if (!seen.has(path)) {
|
|
346
|
+
seen.add(path);
|
|
347
|
+
return path;
|
|
348
|
+
}
|
|
349
|
+
const slash = path.lastIndexOf("/");
|
|
350
|
+
const dir = slash === -1 ? "" : `${path.slice(0, slash + 1)}`;
|
|
351
|
+
const base = slash === -1 ? path : path.slice(slash + 1);
|
|
352
|
+
const dot = base.lastIndexOf(".");
|
|
353
|
+
const name = dot === -1 ? base : base.slice(0, dot);
|
|
354
|
+
const ext = dot === -1 ? "" : base.slice(dot);
|
|
355
|
+
let index = 2;
|
|
356
|
+
while (seen.has(`${dir}${name}-${index}${ext}`)) index += 1;
|
|
357
|
+
const next = `${dir}${name}-${index}${ext}`;
|
|
358
|
+
seen.add(next);
|
|
359
|
+
return next;
|
|
360
|
+
}
|
|
361
|
+
|
|
362
|
+
export async function buildDesignHandoffZip(
|
|
363
|
+
payload: DesignHandoffPayload,
|
|
364
|
+
): Promise<Uint8Array> {
|
|
365
|
+
const JSZip = (await import("jszip")).default;
|
|
366
|
+
const zip = new JSZip();
|
|
367
|
+
const seenPaths = new Set<string>();
|
|
368
|
+
|
|
369
|
+
const readme = [
|
|
370
|
+
`# ${payload.design.title}`,
|
|
371
|
+
"",
|
|
372
|
+
"This archive contains the source files exported from Agent-Native Design.",
|
|
373
|
+
"Use the files as the source of truth for layout, typography, colors, spacing, copy, and interactions.",
|
|
374
|
+
"",
|
|
375
|
+
`Design ID: ${payload.design.id}`,
|
|
376
|
+
`Exported: ${payload.exportedAt}`,
|
|
377
|
+
payload.design.projectType
|
|
378
|
+
? `Project type: ${payload.design.projectType}`
|
|
379
|
+
: null,
|
|
380
|
+
"",
|
|
381
|
+
"## Files",
|
|
382
|
+
"",
|
|
383
|
+
...payload.files.map((file) => `- ${file.filename} (${file.fileType})`),
|
|
384
|
+
]
|
|
385
|
+
.filter((line): line is string => line !== null)
|
|
386
|
+
.join("\n");
|
|
387
|
+
|
|
388
|
+
zip.file(uniqueZipPath("README.md", seenPaths), readme);
|
|
389
|
+
zip.file(
|
|
390
|
+
uniqueZipPath("design-handoff.json", seenPaths),
|
|
391
|
+
JSON.stringify(
|
|
392
|
+
{
|
|
393
|
+
exportedAt: payload.exportedAt,
|
|
394
|
+
design: payload.design,
|
|
395
|
+
files: payload.files.map((file) => ({
|
|
396
|
+
filename: file.filename,
|
|
397
|
+
fileType: file.fileType,
|
|
398
|
+
})),
|
|
399
|
+
appliedDesignTokens: payload.appliedDesignTokens,
|
|
400
|
+
},
|
|
401
|
+
null,
|
|
402
|
+
2,
|
|
403
|
+
),
|
|
404
|
+
);
|
|
405
|
+
|
|
406
|
+
payload.files.forEach((file, index) => {
|
|
407
|
+
const path = uniqueZipPath(
|
|
408
|
+
safeZipPath(file.filename, `file-${index + 1}.${file.fileType || "txt"}`),
|
|
409
|
+
seenPaths,
|
|
410
|
+
);
|
|
411
|
+
zip.file(path, file.content);
|
|
412
|
+
});
|
|
413
|
+
|
|
414
|
+
return zip.generateAsync({ type: "uint8array" });
|
|
415
|
+
}
|
|
416
|
+
|
|
304
417
|
export function buildCodingHandoffPrompt({
|
|
305
418
|
rawUrl,
|
|
419
|
+
zipUrl,
|
|
306
420
|
title,
|
|
307
421
|
fileCount,
|
|
308
422
|
}: {
|
|
309
423
|
rawUrl: string;
|
|
424
|
+
zipUrl?: string;
|
|
310
425
|
title: string;
|
|
311
426
|
fileCount: number;
|
|
312
427
|
}): string {
|
|
313
|
-
|
|
428
|
+
const lines = [
|
|
314
429
|
`Build this design as production code: ${title}`,
|
|
315
430
|
"",
|
|
316
431
|
`Fetch the raw design bundle here: ${rawUrl}`,
|
|
432
|
+
];
|
|
433
|
+
if (zipUrl) {
|
|
434
|
+
lines.push(
|
|
435
|
+
"",
|
|
436
|
+
`If you prefer files, download the ZIP bundle here: ${zipUrl}`,
|
|
437
|
+
);
|
|
438
|
+
}
|
|
439
|
+
lines.push(
|
|
317
440
|
"",
|
|
318
441
|
`The bundle contains ${fileCount} file${fileCount === 1 ? "" : "s"} with the exact HTML/CSS/JSX source from the Design app. Use it as the source of truth for layout, typography, colors, spacing, responsive behavior, copy, and interactions. Convert it into the target project stack or Builder.io page/component while preserving the visual intent. If multiple screens are included, implement the primary page first and map the rest to routes, sections, or components as appropriate.`,
|
|
319
|
-
|
|
442
|
+
);
|
|
443
|
+
return lines.join("\n");
|
|
320
444
|
}
|
|
@@ -6,8 +6,7 @@ import { createCoreRoutesPlugin } from "@agent-native/core/server";
|
|
|
6
6
|
// a resolveOpenPath, `/_agent-native/open?app=design&view=editor&designId=…`
|
|
7
7
|
// falls back to `/<view>` = `/editor`, which has no matching route (the
|
|
8
8
|
// editor route is `design.$id.tsx` → `/design/:id`) and 404s — so an
|
|
9
|
-
// "Open in Design" link for a connected
|
|
10
|
-
// opened the design.
|
|
9
|
+
// "Open in Design" link for a connected external agent never opened the design.
|
|
11
10
|
export default createCoreRoutesPlugin({
|
|
12
11
|
resolveOpenPath: ({ view, params }) => {
|
|
13
12
|
if (params.designId) return `/design/${params.designId}`;
|
|
@@ -121,6 +121,96 @@ CREATE INDEX IF NOT EXISTS design_systems_owner_org_updated_idx ON design_system
|
|
|
121
121
|
CREATE INDEX IF NOT EXISTS design_shares_resource_principal_idx ON design_shares (resource_id, principal_type, principal_id);
|
|
122
122
|
CREATE INDEX IF NOT EXISTS design_system_shares_resource_principal_idx ON design_system_shares (resource_id, principal_type, principal_id)`,
|
|
123
123
|
},
|
|
124
|
+
// v12: component_index — real-app component metadata (name, file path,
|
|
125
|
+
// export name, parsed prop types, cva/tailwind-variants variants, Storybook
|
|
126
|
+
// stories, runtime selectors). Ownable; access-checked via accessFilter /
|
|
127
|
+
// assertAccess.
|
|
128
|
+
{
|
|
129
|
+
version: 12,
|
|
130
|
+
sql: `CREATE TABLE IF NOT EXISTS component_index (
|
|
131
|
+
id TEXT PRIMARY KEY,
|
|
132
|
+
design_id TEXT NOT NULL,
|
|
133
|
+
source_ref TEXT,
|
|
134
|
+
name TEXT NOT NULL,
|
|
135
|
+
file_path TEXT,
|
|
136
|
+
export_name TEXT,
|
|
137
|
+
props TEXT,
|
|
138
|
+
variants TEXT,
|
|
139
|
+
stories TEXT,
|
|
140
|
+
runtime_selectors TEXT,
|
|
141
|
+
created_at TEXT DEFAULT (datetime('now')),
|
|
142
|
+
updated_at TEXT DEFAULT (datetime('now')),
|
|
143
|
+
owner_email TEXT NOT NULL DEFAULT 'local@localhost',
|
|
144
|
+
org_id TEXT,
|
|
145
|
+
visibility TEXT NOT NULL DEFAULT 'private'
|
|
146
|
+
)`,
|
|
147
|
+
},
|
|
148
|
+
// v13: motion_timeline — CSS-first keyframe animation tracks scoped to one
|
|
149
|
+
// design + source + screen/file. tracks JSON is the editing representation;
|
|
150
|
+
// the compiled CSS block (managed <style data-agent-native-motion>) is the
|
|
151
|
+
// runtime truth. compiled_hash guards drift between the two. Ownable.
|
|
152
|
+
{
|
|
153
|
+
version: 13,
|
|
154
|
+
sql: `CREATE TABLE IF NOT EXISTS motion_timeline (
|
|
155
|
+
id TEXT PRIMARY KEY,
|
|
156
|
+
design_id TEXT NOT NULL,
|
|
157
|
+
source_ref TEXT,
|
|
158
|
+
file_path TEXT,
|
|
159
|
+
tracks TEXT NOT NULL DEFAULT '[]',
|
|
160
|
+
duration_ms INTEGER NOT NULL DEFAULT 300,
|
|
161
|
+
default_ease TEXT NOT NULL DEFAULT 'ease',
|
|
162
|
+
compiled_hash TEXT,
|
|
163
|
+
created_at TEXT DEFAULT (datetime('now')),
|
|
164
|
+
updated_at TEXT DEFAULT (datetime('now')),
|
|
165
|
+
owner_email TEXT NOT NULL DEFAULT 'local@localhost',
|
|
166
|
+
org_id TEXT,
|
|
167
|
+
visibility TEXT NOT NULL DEFAULT 'private'
|
|
168
|
+
)`,
|
|
169
|
+
},
|
|
170
|
+
// v14: design_state — design states (alternate x-data/DOM snapshots for
|
|
171
|
+
// Default / Loading / Empty / Error), static data fixtures, and live
|
|
172
|
+
// captures of running-app route + props + API data. Ownable.
|
|
173
|
+
{
|
|
174
|
+
version: 14,
|
|
175
|
+
sql: `CREATE TABLE IF NOT EXISTS design_state (
|
|
176
|
+
id TEXT PRIMARY KEY,
|
|
177
|
+
design_id TEXT NOT NULL,
|
|
178
|
+
source_ref TEXT,
|
|
179
|
+
name TEXT NOT NULL,
|
|
180
|
+
kind TEXT NOT NULL DEFAULT 'state',
|
|
181
|
+
breakpoint TEXT NOT NULL DEFAULT 'auto',
|
|
182
|
+
route TEXT,
|
|
183
|
+
fixture_data TEXT,
|
|
184
|
+
capture_data TEXT,
|
|
185
|
+
preview_ref TEXT,
|
|
186
|
+
created_at TEXT DEFAULT (datetime('now')),
|
|
187
|
+
updated_at TEXT DEFAULT (datetime('now')),
|
|
188
|
+
owner_email TEXT NOT NULL DEFAULT 'local@localhost',
|
|
189
|
+
org_id TEXT,
|
|
190
|
+
visibility TEXT NOT NULL DEFAULT 'private'
|
|
191
|
+
)`,
|
|
192
|
+
},
|
|
193
|
+
// v15: design_review_snapshot — cached a11y audit results and visual diff
|
|
194
|
+
// data keyed by design + optional base/compare design_versions pair.
|
|
195
|
+
// status: 'pending' | 'ready' | 'error'. Ownable.
|
|
196
|
+
{
|
|
197
|
+
version: 15,
|
|
198
|
+
sql: `CREATE TABLE IF NOT EXISTS design_review_snapshot (
|
|
199
|
+
id TEXT PRIMARY KEY,
|
|
200
|
+
design_id TEXT NOT NULL,
|
|
201
|
+
base_version_id TEXT,
|
|
202
|
+
compare_version_id TEXT,
|
|
203
|
+
source_ref TEXT,
|
|
204
|
+
a11y_findings TEXT,
|
|
205
|
+
visual_diff TEXT,
|
|
206
|
+
status TEXT NOT NULL DEFAULT 'pending',
|
|
207
|
+
created_at TEXT DEFAULT (datetime('now')),
|
|
208
|
+
updated_at TEXT DEFAULT (datetime('now')),
|
|
209
|
+
owner_email TEXT NOT NULL DEFAULT 'local@localhost',
|
|
210
|
+
org_id TEXT,
|
|
211
|
+
visibility TEXT NOT NULL DEFAULT 'private'
|
|
212
|
+
)`,
|
|
213
|
+
},
|
|
124
214
|
],
|
|
125
215
|
{ table: "design_migrations" },
|
|
126
216
|
);
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
import { verifyShortLivedToken } from "@agent-native/core/server";
|
|
2
|
+
import { eq } from "drizzle-orm";
|
|
3
|
+
import {
|
|
4
|
+
defineEventHandler,
|
|
5
|
+
getQuery,
|
|
6
|
+
getRouterParam,
|
|
7
|
+
setResponseHeader,
|
|
8
|
+
setResponseStatus,
|
|
9
|
+
type H3Event,
|
|
10
|
+
} from "h3";
|
|
11
|
+
|
|
12
|
+
import { getDb, schema } from "../../../db/index.js";
|
|
13
|
+
import {
|
|
14
|
+
buildDesignHandoffPayload,
|
|
15
|
+
buildDesignHandoffZip,
|
|
16
|
+
buildHandoffZipFilename,
|
|
17
|
+
} from "../../../lib/coding-handoff.js";
|
|
18
|
+
import { buildDesignSnapshot } from "../../../lib/design-snapshot.js";
|
|
19
|
+
|
|
20
|
+
function notFound(event: H3Event) {
|
|
21
|
+
setResponseStatus(event, 404);
|
|
22
|
+
return { error: "Not found" };
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
function normalizeRouteId(value: string | undefined): string | undefined {
|
|
26
|
+
if (!value) return value;
|
|
27
|
+
return value.endsWith(".zip") ? value.slice(0, -4) : value;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
export default defineEventHandler(async (event: H3Event) => {
|
|
31
|
+
const id = normalizeRouteId(getRouterParam(event, "id"));
|
|
32
|
+
if (!id) {
|
|
33
|
+
setResponseStatus(event, 400);
|
|
34
|
+
return { error: "Design ID is required" };
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
const q = getQuery(event) as {
|
|
38
|
+
token?: string;
|
|
39
|
+
t?: string;
|
|
40
|
+
};
|
|
41
|
+
const token =
|
|
42
|
+
typeof q.token === "string" ? q.token : typeof q.t === "string" ? q.t : "";
|
|
43
|
+
|
|
44
|
+
const verified = verifyShortLivedToken(token, id);
|
|
45
|
+
if (!verified.ok) {
|
|
46
|
+
setResponseStatus(event, 403);
|
|
47
|
+
return { error: "Invalid or expired handoff link" };
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
const db = getDb();
|
|
51
|
+
// guard:allow-unscoped — this unauthenticated endpoint is gated by a signed, expiring handoff token bound to the design id.
|
|
52
|
+
const [design] = await db
|
|
53
|
+
.select()
|
|
54
|
+
.from(schema.designs)
|
|
55
|
+
.where(eq(schema.designs.id, id))
|
|
56
|
+
.limit(1);
|
|
57
|
+
if (!design) return notFound(event);
|
|
58
|
+
|
|
59
|
+
const snapshot = await buildDesignSnapshot(id, design.data);
|
|
60
|
+
if (snapshot.files.length === 0) return notFound(event);
|
|
61
|
+
|
|
62
|
+
const payload = buildDesignHandoffPayload({
|
|
63
|
+
design,
|
|
64
|
+
files: snapshot.files.map((f) => ({
|
|
65
|
+
filename: f.filename,
|
|
66
|
+
fileType: f.fileType,
|
|
67
|
+
content: f.content,
|
|
68
|
+
})),
|
|
69
|
+
resolvedCssVars: snapshot.resolvedCssVars,
|
|
70
|
+
});
|
|
71
|
+
const zip = await buildDesignHandoffZip(payload);
|
|
72
|
+
const filename = buildHandoffZipFilename(design.title);
|
|
73
|
+
|
|
74
|
+
setResponseHeader(event, "Cache-Control", "no-store");
|
|
75
|
+
setResponseHeader(event, "Referrer-Policy", "no-referrer");
|
|
76
|
+
setResponseHeader(event, "X-Content-Type-Options", "nosniff");
|
|
77
|
+
setResponseHeader(event, "Access-Control-Allow-Origin", "*");
|
|
78
|
+
setResponseHeader(event, "Content-Type", "application/zip");
|
|
79
|
+
setResponseHeader(
|
|
80
|
+
event,
|
|
81
|
+
"Content-Disposition",
|
|
82
|
+
`attachment; filename="${filename}"; filename*=UTF-8''${encodeURIComponent(filename)}`,
|
|
83
|
+
);
|
|
84
|
+
|
|
85
|
+
return zip;
|
|
86
|
+
});
|