@agent-native/core 0.92.9 → 0.92.11
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 +181 -15
- package/corpus/core/src/agent/run-manager.ts +31 -4
- package/corpus/core/src/agent/run-store.ts +80 -0
- 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.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/deploy/build.ts +133 -5
- 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 +48 -4
- package/corpus/templates/clips/app/components/player/video-player.tsx +17 -12
- 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/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/_document-flush.ts +132 -17
- package/corpus/templates/content/actions/_notion-action-utils.ts +15 -0
- 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/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-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/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 +79 -6
- package/dist/agent/production-agent.d.ts.map +1 -1
- package/dist/agent/production-agent.js +161 -14
- 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 +29 -5
- 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 +61 -0
- 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.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/routes.d.ts +1 -1
- package/dist/deploy/build.d.ts +24 -0
- package/dist/deploy/build.d.ts.map +1 -1
- package/dist/deploy/build.js +102 -5
- package/dist/deploy/build.js.map +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/notifications/routes.d.ts +1 -1
- package/dist/observability/routes.d.ts +5 -5
- package/dist/progress/routes.d.ts +1 -1
- 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
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"recent-edits.js","sourceRoot":"","sources":["../../src/collab/recent-edits.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,EACL,gBAAgB,EAChB,kBAAkB,GAGnB,MAAM,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AK,CAAC,CAAC;QACjC,CAAC,CAAC;IACJ,CAAC,EAAE,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC,CAAC;IAEpB,OAAO,KAAK,CAAC;AACf,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,iBAAiB,CAC/B,SAGC,EACD,IAA8C;IAE9C,MAAM,KAAK,GAAG,SAAS,CAAC,aAAa,EAAE,CAAC;IACxC,MAAM,QAAQ,GAAG,KAAK,EAAE,CAAC,aAAa,CAA6B,CAAC;IACpE,SAAS,CAAC,kBAAkB,CAC1B,aAAa,EACb,gBAAgB,CAAC,QAAQ,EAAE,EAAE,GAAG,IAAI,EAAE,EAAE,EAAE,IAAI,CAAC,EAAE,IAAI,IAAI,CAAC,GAAG,EAAE,EAAE,CAAC,CACnE,CAAC;AACJ,CAAC;AAED,SAAS,gBAAgB,CACvB,CAAyB,EACzB,CAAyB;IAEzB,IAAI,CAAC,CAAC,MAAM,KAAK,CAAC,CAAC,MAAM;QAAE,OAAO,KAAK,CAAC;IACxC,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;QAClC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,QAAQ,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,QAAQ,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE;YAAE,OAAO,KAAK,CAAC;IAC3E,CAAC;IACD,OAAO,IAAI,CAAC;AACd,CAAC","sourcesContent":["/**\n * Recent-edit attribution for collaborative documents.\n *\n * Every participant (human or agent) may publish a short ring of recent edits\n * in its awareness state under the `recentEdits` key. Clients render these as\n * lingering, fading highlights (\"Google Docs / Figma collaborator just edited\n * this\") for a few seconds after the edit lands, with the editor's name and\n * color next to the highlighted region.\n *\n * The descriptor is intentionally open-ended — each app publishes whatever its\n * surfaces can resolve back to a DOM rect:\n * - `{ kind: \"text\", quote }` rich-text apps resolve by text search\n * - `{ kind: \"selector\", selector }` canvas/DOM apps resolve by querySelector\n * - `{ kind: \"paths\", paths }` structured apps resolve JSON paths\n * (e.g. `slides.3.content`) to their rendered element\n * - `{ kind: \"doc\" }` whole-document change (no region)\n */\n\nimport {\n RECENT_EDITS_MAX,\n RECENT_EDIT_TTL_MS,\n type AttributedRecentEdit,\n type RecentEdit,\n} from \"@agent-native/toolkit/collab-ui\";\nimport { useEffect, useRef, useState } from \"react\";\n\nimport type { OtherPresence } from \"./presence.js\";\n\nexport {\n RECENT_EDITS_MAX,\n RECENT_EDIT_TTL_MS,\n type AttributedRecentEdit,\n type RecentEdit,\n type RecentEditDescriptor,\n} from \"@agent-native/toolkit/collab-ui\";\n\n/**\n * Append an edit to a recentEdits ring, keeping the newest\n * {@link RECENT_EDITS_MAX} entries. Pure — returns a new array.\n */\nexport function appendRecentEdit(\n existing: RecentEdit[] | undefined,\n edit: RecentEdit,\n): RecentEdit[] {\n const ring = Array.isArray(existing) ? existing.slice() : [];\n ring.push(edit);\n if (ring.length > RECENT_EDITS_MAX) {\n ring.splice(0, ring.length - RECENT_EDITS_MAX);\n }\n return ring;\n}\n\n/**\n * Flatten non-expired recent edits from remote participants, newest last.\n * Pure — exported for tests and non-React consumers.\n */\nexport function collectRecentEdits(\n others: OtherPresence[],\n ttlMs: number,\n now: number,\n): AttributedRecentEdit[] {\n const result: AttributedRecentEdit[] = [];\n for (const other of others) {\n const ring = other.presence[\"recentEdits\"];\n if (!Array.isArray(ring)) continue;\n for (const raw of ring) {\n const edit = raw as RecentEdit;\n if (!edit || typeof edit.at !== \"number\" || !edit.descriptor) continue;\n if (now - edit.at > ttlMs) continue;\n result.push({\n ...edit,\n clientId: other.clientId,\n user: other.user,\n isAgent: other.isAgent,\n });\n }\n }\n result.sort((a, b) => a.at - b.at);\n return result;\n}\n\nexport interface UseRecentEditsOptions {\n /** How long a highlight lingers after the edit. Default 6000ms. */\n ttlMs?: number;\n}\n\n/**\n * Reactive list of remote participants' recent edits that haven't expired.\n * Ticks internally (~500ms) while any highlight is visible so consumers can\n * render a smooth fade-out without wiring their own timers.\n */\nexport function useRecentEdits(\n others: OtherPresence[],\n options?: UseRecentEditsOptions,\n): AttributedRecentEdit[] {\n const ttlMs = options?.ttlMs ?? RECENT_EDIT_TTL_MS;\n const [edits, setEdits] = useState<AttributedRecentEdit[]>([]);\n const othersRef = useRef(others);\n othersRef.current = others;\n\n useEffect(() => {\n let timer: ReturnType<typeof setTimeout> | null = null;\n\n function tick() {\n const next = collectRecentEdits(othersRef.current, ttlMs, Date.now());\n setEdits((prev) => (recentEditsEqual(prev, next) ? prev : next));\n if (next.length > 0) {\n timer = setTimeout(tick, 500);\n } else {\n timer = null;\n }\n }\n\n tick();\n return () => {\n if (timer) clearTimeout(timer);\n };\n }, [others, ttlMs]);\n\n return edits;\n}\n\n/**\n * Publish a local edit into this client's awareness ring so peers render a\n * lingering highlight for it. Call from app mutation paths (throttled by the\n * ring size + TTL; safe to call per committed edit, not per keystroke).\n */\nexport function publishRecentEdit(\n awareness: {\n getLocalState: () => Record<string, unknown> | null;\n setLocalStateField: (field: string, value: unknown) => void;\n },\n edit: Omit<RecentEdit, \"at\"> & { at?: number },\n): void {\n const local = awareness.getLocalState();\n const existing = local?.[\"recentEdits\"] as RecentEdit[] | undefined;\n awareness.setLocalStateField(\n \"recentEdits\",\n appendRecentEdit(existing, { ...edit, at: edit.at ?? Date.now() }),\n );\n}\n\nfunction recentEditsEqual(\n a: AttributedRecentEdit[],\n b: AttributedRecentEdit[],\n): boolean {\n if (a.length !== b.length) return false;\n for (let i = 0; i < a.length; i++) {\n if (a[i].clientId !== b[i].clientId || a[i].at !== b[i].at) return false;\n }\n return true;\n}\n"]}
|
|
1
|
+
{"version":3,"file":"recent-edits.js","sourceRoot":"","sources":["../../src/collab/recent-edits.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,EACL,gBAAgB,EACh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xC,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;QAClC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,QAAQ,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,QAAQ,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE;YAAE,OAAO,KAAK,CAAC;IAC3E,CAAC;IACD,OAAO,IAAI,CAAC;AACd,CAAC","sourcesContent":["/**\n * Recent-edit attribution for collaborative documents.\n *\n * Every participant (human or agent) may publish a short ring of recent edits\n * in its awareness state under the `recentEdits` key. Clients render these as\n * lingering, fading highlights (\"Google Docs / Figma collaborator just edited\n * this\") for a few seconds after the edit lands, with the editor's name and\n * color next to the highlighted region.\n *\n * The descriptor is intentionally open-ended — each app publishes whatever its\n * surfaces can resolve back to a DOM rect:\n * - `{ kind: \"text\", quote }` rich-text apps resolve by text search\n * - `{ kind: \"selector\", selector }` canvas/DOM apps resolve by querySelector\n * - `{ kind: \"paths\", paths }` structured apps resolve JSON paths\n * (e.g. `slides.3.content`) to their rendered element\n * - `{ kind: \"doc\" }` whole-document change (no region)\n */\n\nimport {\n RECENT_EDITS_MAX,\n RECENT_EDIT_TTL_MS,\n type AttributedRecentEdit,\n type RecentEdit,\n type RecentEditDescriptor,\n} from \"@agent-native/toolkit/collab-ui\";\nimport { useEffect, useRef, useState } from \"react\";\n\nimport type { OtherPresence } from \"./presence.js\";\n\nexport {\n RECENT_EDITS_MAX,\n RECENT_EDIT_TTL_MS,\n type AttributedRecentEdit,\n type RecentEdit,\n type RecentEditDescriptor,\n} from \"@agent-native/toolkit/collab-ui\";\n\n/**\n * Hard cap on any single string carried in a recentEdits entry (quote,\n * selector, path segment, label). Callers are expected to pass short\n * excerpts already (existing call sites trim to 80–120 chars for a \"what\n * changed\" snippet), but this is the ring's own size ceiling — a caller that\n * forgets to trim (e.g. passing a whole paragraph/document as `quote`) must\n * not blow up the awareness payload every connected client receives on the\n * fast-push path, nor the `_collab_awareness` SQL row it gets mirrored into.\n */\nconst RECENT_EDIT_STRING_MAX = 500;\n\nfunction truncateString(value: string): string {\n return value.length > RECENT_EDIT_STRING_MAX\n ? value.slice(0, RECENT_EDIT_STRING_MAX)\n : value;\n}\n\nfunction truncateDescriptor(\n descriptor: RecentEditDescriptor,\n): RecentEditDescriptor {\n // The union's last member (`{ kind: string; [key: string]: unknown }`) is an\n // open-ended catch-all whose `kind` is a plain `string`, so a `switch` on\n // `descriptor.kind` can't discriminate it away from the literal-kind\n // members for the compiler — every property still type-checks as\n // `unknown`. Read/write through an untyped view instead and lean on\n // runtime checks; the return value is cast back to the real type below.\n const d = descriptor as Record<string, unknown> & { kind: string };\n if (d.kind === \"text\" && typeof d.quote === \"string\") {\n return { ...d, quote: truncateString(d.quote) } as RecentEditDescriptor;\n }\n if (d.kind === \"selector\" && typeof d.selector === \"string\") {\n return {\n ...d,\n selector: truncateString(d.selector),\n } as RecentEditDescriptor;\n }\n if (d.kind === \"paths\" && Array.isArray(d.paths)) {\n return {\n ...d,\n paths: d.paths.map((p) =>\n typeof p === \"string\" ? truncateString(p) : p,\n ),\n } as RecentEditDescriptor;\n }\n if (d.kind === \"doc\") {\n return descriptor;\n }\n // Open-ended shape — trim any string-valued fields defensively without\n // knowing their names.\n const trimmed: Record<string, unknown> = {};\n for (const [key, value] of Object.entries(d)) {\n trimmed[key] = typeof value === \"string\" ? truncateString(value) : value;\n }\n return trimmed as RecentEditDescriptor;\n}\n\n/**\n * Append an edit to a recentEdits ring, keeping the newest\n * {@link RECENT_EDITS_MAX} entries. Pure — returns a new array. Descriptor\n * strings and the label are truncated to {@link RECENT_EDIT_STRING_MAX}\n * characters as a defensive cap on the awareness payload size.\n */\nexport function appendRecentEdit(\n existing: RecentEdit[] | undefined,\n edit: RecentEdit,\n): RecentEdit[] {\n const ring = Array.isArray(existing) ? existing.slice() : [];\n ring.push({\n ...edit,\n descriptor: truncateDescriptor(edit.descriptor),\n label: edit.label ? truncateString(edit.label) : edit.label,\n });\n if (ring.length > RECENT_EDITS_MAX) {\n ring.splice(0, ring.length - RECENT_EDITS_MAX);\n }\n return ring;\n}\n\n/**\n * Flatten non-expired recent edits from remote participants, newest last.\n * Pure — exported for tests and non-React consumers.\n */\nexport function collectRecentEdits(\n others: OtherPresence[],\n ttlMs: number,\n now: number,\n): AttributedRecentEdit[] {\n const result: AttributedRecentEdit[] = [];\n for (const other of others) {\n const ring = other.presence[\"recentEdits\"];\n if (!Array.isArray(ring)) continue;\n for (const raw of ring) {\n const edit = raw as RecentEdit;\n if (!edit || typeof edit.at !== \"number\" || !edit.descriptor) continue;\n if (now - edit.at > ttlMs) continue;\n result.push({\n ...edit,\n clientId: other.clientId,\n user: other.user,\n isAgent: other.isAgent,\n });\n }\n }\n result.sort((a, b) => a.at - b.at);\n return result;\n}\n\nexport interface UseRecentEditsOptions {\n /** How long a highlight lingers after the edit. Default 6000ms. */\n ttlMs?: number;\n}\n\n/**\n * Reactive list of remote participants' recent edits that haven't expired.\n * Ticks internally (~500ms) while any highlight is visible so consumers can\n * render a smooth fade-out without wiring their own timers.\n */\nexport function useRecentEdits(\n others: OtherPresence[],\n options?: UseRecentEditsOptions,\n): AttributedRecentEdit[] {\n const ttlMs = options?.ttlMs ?? RECENT_EDIT_TTL_MS;\n const [edits, setEdits] = useState<AttributedRecentEdit[]>([]);\n const othersRef = useRef(others);\n othersRef.current = others;\n\n useEffect(() => {\n let timer: ReturnType<typeof setTimeout> | null = null;\n\n function tick() {\n const next = collectRecentEdits(othersRef.current, ttlMs, Date.now());\n setEdits((prev) => (recentEditsEqual(prev, next) ? prev : next));\n if (next.length > 0) {\n timer = setTimeout(tick, 500);\n } else {\n timer = null;\n }\n }\n\n tick();\n return () => {\n if (timer) clearTimeout(timer);\n };\n }, [others, ttlMs]);\n\n return edits;\n}\n\n/**\n * Publish a local edit into this client's awareness ring so peers render a\n * lingering highlight for it. Call from app mutation paths (throttled by the\n * ring size + TTL; safe to call per committed edit, not per keystroke).\n */\nexport function publishRecentEdit(\n awareness: {\n getLocalState: () => Record<string, unknown> | null;\n setLocalStateField: (field: string, value: unknown) => void;\n },\n edit: Omit<RecentEdit, \"at\"> & { at?: number },\n): void {\n const local = awareness.getLocalState();\n const existing = local?.[\"recentEdits\"] as RecentEdit[] | undefined;\n awareness.setLocalStateField(\n \"recentEdits\",\n appendRecentEdit(existing, { ...edit, at: edit.at ?? Date.now() }),\n );\n}\n\nfunction recentEditsEqual(\n a: AttributedRecentEdit[],\n b: AttributedRecentEdit[],\n): boolean {\n if (a.length !== b.length) return false;\n for (let i = 0; i < a.length; i++) {\n if (a[i].clientId !== b[i].clientId || a[i].at !== b[i].at) return false;\n }\n return true;\n}\n"]}
|
package/dist/collab/routes.d.ts
CHANGED
|
@@ -26,8 +26,8 @@ export declare const getCollabState: import("h3").EventHandlerWithFetch<import("
|
|
|
26
26
|
* Body: { update: string (base64), requestSource?: string }
|
|
27
27
|
*/
|
|
28
28
|
export declare const postCollabUpdate: import("h3").EventHandlerWithFetch<import("h3").EventHandlerRequest, Promise<{
|
|
29
|
-
ok?: undefined;
|
|
30
29
|
error: string;
|
|
30
|
+
ok?: undefined;
|
|
31
31
|
} | {
|
|
32
32
|
error?: undefined;
|
|
33
33
|
ok: boolean;
|
package/dist/deploy/build.d.ts
CHANGED
|
@@ -150,6 +150,13 @@ export declare function isDurableBackgroundDeployEnabled(): boolean;
|
|
|
150
150
|
* inline 40s synchronous run (see production-agent.ts).
|
|
151
151
|
*/
|
|
152
152
|
export declare function emitSingleTemplateNetlifyBackgroundFunction(projectCwd: string): void;
|
|
153
|
+
/**
|
|
154
|
+
* Nitro can preserve Vite's `yjs` external in a split server chunk even when
|
|
155
|
+
* its own server build has emitted `_libs/yjs.mjs`. Netlify does not install
|
|
156
|
+
* that bare package at runtime, so make every emitted server chunk use the
|
|
157
|
+
* bundled copy before its function is packaged.
|
|
158
|
+
*/
|
|
159
|
+
export declare function rewriteBareYjsImportsForServerlessOutput(serverDir: string): string[];
|
|
153
160
|
export declare function assertSingleTemplateNetlifyBuildOutput(projectCwd: string): void;
|
|
154
161
|
/**
|
|
155
162
|
* Strip the harmful single-template catch-all rewrite that points at
|
|
@@ -196,5 +203,22 @@ export interface NitroBuildPipelineOptions {
|
|
|
196
203
|
* anything with a file extension.
|
|
197
204
|
*/
|
|
198
205
|
export declare function runNitroBuildPipeline(opts: NitroBuildPipelineOptions): Promise<void>;
|
|
206
|
+
/**
|
|
207
|
+
* Dependencies that must be bundled into every Nitro server output instead of
|
|
208
|
+
* being left as runtime package imports.
|
|
209
|
+
*
|
|
210
|
+
* `yjs` is a direct core dependency, but it is deliberately externalized from
|
|
211
|
+
* the intermediate Vite SSR graph so that Vite and Nitro do not create two
|
|
212
|
+
* incompatible Yjs constructors. On file-traced serverless presets, leaving it
|
|
213
|
+
* external at Nitro's final build can emit `import "yjs"` into a function
|
|
214
|
+
* chunk without placing the package in that function's `node_modules`. Bundle
|
|
215
|
+
* it in Nitro's final output so every template receives the one portable copy.
|
|
216
|
+
*/
|
|
217
|
+
export declare const NITRO_SERVER_RUNTIME_BUNDLED_DEPS: readonly ["yjs"];
|
|
218
|
+
/**
|
|
219
|
+
* Edge runtimes have no node_modules, while Node/serverless outputs only need
|
|
220
|
+
* the small set above bundled to keep their package manifests traceable.
|
|
221
|
+
*/
|
|
222
|
+
export declare function nitroNoExternalsForPreset(targetPreset: string): true | readonly string[];
|
|
199
223
|
export {};
|
|
200
224
|
//# sourceMappingURL=build.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"build.d.ts","sourceRoot":"","sources":["../../src/deploy/build.ts"],"names":[],"mappings":";AAEA;;;;;;;;;;;;GAYG;AAmCH,OAAO,EAML,KAAK,eAAe,EACpB,KAAK,gBAAgB,EACtB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAEL,KAAK,oBAAoB,EAC1B,MAA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CAAC,IAAI,CAAC,CA+Bf;AAkBD;;;;;;;;;;GAUG;AACH,eAAO,MAAM,iCAAiC,YAAI,KAAK,CAAU,CAAC;AAElE;;;GAGG;AACH,wBAAgB,yBAAyB,CACvC,YAAY,EAAE,MAAM,GACnB,IAAI,GAAG,SAAS,MAAM,EAAE,CAK1B"}
|
package/dist/deploy/build.js
CHANGED
|
@@ -2021,6 +2021,66 @@ export const config = {
|
|
|
2021
2021
|
* the SSR catch-all runs.
|
|
2022
2022
|
*/
|
|
2023
2023
|
const NETLIFY_DEFAULT_FUNCTION_URL_REDIRECT = "/* /.netlify/functions/server 200";
|
|
2024
|
+
function hasBareYjsRuntimeImport(source) {
|
|
2025
|
+
return /\b(?:from\s*|import\s*\(\s*|import\s*)["']yjs(?:\/[^"']*)?["']/.test(source);
|
|
2026
|
+
}
|
|
2027
|
+
function hasUnsupportedYjsSubpathImport(source) {
|
|
2028
|
+
return /\b(?:from\s*|import\s*\(\s*|import\s*)["']yjs\/[^"']*["']/.test(source);
|
|
2029
|
+
}
|
|
2030
|
+
function walkServerJavaScriptFiles(dir, onFile) {
|
|
2031
|
+
if (!fs.existsSync(dir))
|
|
2032
|
+
return;
|
|
2033
|
+
for (const entry of fs.readdirSync(dir, { withFileTypes: true })) {
|
|
2034
|
+
const entryPath = path.join(dir, entry.name);
|
|
2035
|
+
if (entry.isDirectory()) {
|
|
2036
|
+
walkServerJavaScriptFiles(entryPath, onFile);
|
|
2037
|
+
continue;
|
|
2038
|
+
}
|
|
2039
|
+
if (/\.(?:[cm]?js)$/.test(entry.name))
|
|
2040
|
+
onFile(entryPath);
|
|
2041
|
+
}
|
|
2042
|
+
}
|
|
2043
|
+
/**
|
|
2044
|
+
* Nitro can preserve Vite's `yjs` external in a split server chunk even when
|
|
2045
|
+
* its own server build has emitted `_libs/yjs.mjs`. Netlify does not install
|
|
2046
|
+
* that bare package at runtime, so make every emitted server chunk use the
|
|
2047
|
+
* bundled copy before its function is packaged.
|
|
2048
|
+
*/
|
|
2049
|
+
export function rewriteBareYjsImportsForServerlessOutput(serverDir) {
|
|
2050
|
+
const bareImports = [];
|
|
2051
|
+
const unsupportedSubpathImports = [];
|
|
2052
|
+
const bundledYjsPath = path.join(serverDir, "_libs", "yjs.mjs");
|
|
2053
|
+
walkServerJavaScriptFiles(serverDir, (filePath) => {
|
|
2054
|
+
const source = fs.readFileSync(filePath, "utf-8");
|
|
2055
|
+
if (!hasBareYjsRuntimeImport(source))
|
|
2056
|
+
return;
|
|
2057
|
+
if (hasUnsupportedYjsSubpathImport(source)) {
|
|
2058
|
+
unsupportedSubpathImports.push(filePath);
|
|
2059
|
+
return;
|
|
2060
|
+
}
|
|
2061
|
+
bareImports.push(filePath);
|
|
2062
|
+
});
|
|
2063
|
+
if (unsupportedSubpathImports.length > 0) {
|
|
2064
|
+
throw new Error(`[deploy] Serverless output left unsupported yjs subpath imports in ${unsupportedSubpathImports.join(", ")}`);
|
|
2065
|
+
}
|
|
2066
|
+
if (bareImports.length === 0)
|
|
2067
|
+
return [];
|
|
2068
|
+
if (!fs.existsSync(bundledYjsPath)) {
|
|
2069
|
+
throw new Error(`[deploy] Serverless output left yjs as a runtime import but did not emit ${bundledYjsPath}`);
|
|
2070
|
+
}
|
|
2071
|
+
for (const filePath of bareImports) {
|
|
2072
|
+
const bundledImport = path
|
|
2073
|
+
.relative(path.dirname(filePath), bundledYjsPath)
|
|
2074
|
+
.split(path.sep)
|
|
2075
|
+
.join("/");
|
|
2076
|
+
const relativeBundledImport = bundledImport.startsWith(".")
|
|
2077
|
+
? bundledImport
|
|
2078
|
+
: `./${bundledImport}`;
|
|
2079
|
+
const source = fs.readFileSync(filePath, "utf-8");
|
|
2080
|
+
fs.writeFileSync(filePath, source.replace(/(\b(?:from\s*|import\s*\(\s*|import\s*))(["'])yjs\2/g, (_match, importPrefix, quote) => `${importPrefix}${quote}${relativeBundledImport}${quote}`));
|
|
2081
|
+
}
|
|
2082
|
+
return bareImports;
|
|
2083
|
+
}
|
|
2024
2084
|
export function assertSingleTemplateNetlifyBuildOutput(projectCwd) {
|
|
2025
2085
|
const failures = [];
|
|
2026
2086
|
const publishDir = path.join(projectCwd, "dist");
|
|
@@ -2072,6 +2132,20 @@ export function assertSingleTemplateNetlifyBuildOutput(projectCwd) {
|
|
|
2072
2132
|
failures.push("Netlify server entry must keep preferStatic: true so /assets/* is served from dist before the SSR catch-all");
|
|
2073
2133
|
}
|
|
2074
2134
|
}
|
|
2135
|
+
// Netlify's function packager does not install arbitrary runtime package
|
|
2136
|
+
// imports left in Nitro chunks. A bare Yjs import here would deploy
|
|
2137
|
+
// successfully but fail on the first SSR request with ERR_MODULE_NOT_FOUND.
|
|
2138
|
+
// Keep this check adjacent to the output guard so both local builds and CI
|
|
2139
|
+
// reject that artifact before it reaches Netlify.
|
|
2140
|
+
const bareYjsImports = [];
|
|
2141
|
+
walkServerJavaScriptFiles(serverDir, (filePath) => {
|
|
2142
|
+
if (hasBareYjsRuntimeImport(fs.readFileSync(filePath, "utf-8"))) {
|
|
2143
|
+
bareYjsImports.push(path.relative(projectCwd, filePath));
|
|
2144
|
+
}
|
|
2145
|
+
});
|
|
2146
|
+
if (bareYjsImports.length > 0) {
|
|
2147
|
+
failures.push(`Netlify server bundle leaves yjs as a runtime import: ${bareYjsImports.join(", ")}`);
|
|
2148
|
+
}
|
|
2075
2149
|
if (isDurableBackgroundDeployEnabled()) {
|
|
2076
2150
|
const backgroundDir = path.join(internalDir, AGENT_BACKGROUND_FUNCTION_NAME);
|
|
2077
2151
|
const backgroundEntryPath = path.join(backgroundDir, `${AGENT_BACKGROUND_FUNCTION_NAME}.mjs`);
|
|
@@ -2421,6 +2495,28 @@ const BROWSER_ONLY_SERVER_LIBS = [
|
|
|
2421
2495
|
"@excalidraw/mermaid-to-excalidraw",
|
|
2422
2496
|
"mermaid",
|
|
2423
2497
|
];
|
|
2498
|
+
/**
|
|
2499
|
+
* Dependencies that must be bundled into every Nitro server output instead of
|
|
2500
|
+
* being left as runtime package imports.
|
|
2501
|
+
*
|
|
2502
|
+
* `yjs` is a direct core dependency, but it is deliberately externalized from
|
|
2503
|
+
* the intermediate Vite SSR graph so that Vite and Nitro do not create two
|
|
2504
|
+
* incompatible Yjs constructors. On file-traced serverless presets, leaving it
|
|
2505
|
+
* external at Nitro's final build can emit `import "yjs"` into a function
|
|
2506
|
+
* chunk without placing the package in that function's `node_modules`. Bundle
|
|
2507
|
+
* it in Nitro's final output so every template receives the one portable copy.
|
|
2508
|
+
*/
|
|
2509
|
+
export const NITRO_SERVER_RUNTIME_BUNDLED_DEPS = ["yjs"];
|
|
2510
|
+
/**
|
|
2511
|
+
* Edge runtimes have no node_modules, while Node/serverless outputs only need
|
|
2512
|
+
* the small set above bundled to keep their package manifests traceable.
|
|
2513
|
+
*/
|
|
2514
|
+
export function nitroNoExternalsForPreset(targetPreset) {
|
|
2515
|
+
return targetPreset.startsWith("cloudflare") ||
|
|
2516
|
+
targetPreset.startsWith("deno")
|
|
2517
|
+
? true
|
|
2518
|
+
: NITRO_SERVER_RUNTIME_BUNDLED_DEPS;
|
|
2519
|
+
}
|
|
2424
2520
|
/**
|
|
2425
2521
|
* Rolldown plugin for the Nitro server bundle that replaces the browser-only
|
|
2426
2522
|
* renderers above with an inert proxy module.
|
|
@@ -2561,11 +2657,11 @@ export default bundle;
|
|
|
2561
2657
|
? { plugins: [providedPluginsNitroPlugin] }
|
|
2562
2658
|
: {}),
|
|
2563
2659
|
routeRules: mcpEmbedStaticAssetRouteRules(appBasePath),
|
|
2564
|
-
//
|
|
2565
|
-
//
|
|
2566
|
-
|
|
2567
|
-
|
|
2568
|
-
|
|
2660
|
+
// Edge presets (cloudflare, deno) bundle all deps because node_modules are
|
|
2661
|
+
// unavailable at runtime. Node/serverless presets also bundle Yjs: Nitro's
|
|
2662
|
+
// file tracer otherwise leaves a bare import that Netlify function bundles
|
|
2663
|
+
// cannot resolve under pnpm.
|
|
2664
|
+
noExternals: nitroNoExternalsForPreset(preset),
|
|
2569
2665
|
});
|
|
2570
2666
|
await runNitroBuildPipeline({
|
|
2571
2667
|
nitro,
|
|
@@ -2580,6 +2676,7 @@ export default bundle;
|
|
|
2580
2676
|
copyInstalledResvgPackages(nitro.options.output.serverDir);
|
|
2581
2677
|
copyInstalledFfmpegStaticPackage(nitro.options.output.serverDir);
|
|
2582
2678
|
sanitizeServerlessFunctionPackageManifest(nitro.options.output.serverDir);
|
|
2679
|
+
rewriteBareYjsImportsForServerlessOutput(nitro.options.output.serverDir);
|
|
2583
2680
|
}
|
|
2584
2681
|
// Durable background agent runs (default-OFF / opt-in; enable with a truthy
|
|
2585
2682
|
// AGENT_CHAT_DURABLE_BACKGROUND). Additive ONLY: emits a SECOND Netlify
|