@volter/editor-core 0.5.57
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/BUNDLED_NOTICES +1527 -0
- package/LICENSE +686 -0
- package/LICENSE-APACHE +202 -0
- package/NOTICE +18 -0
- package/README.md +24 -0
- package/dist/build/chunk-JS4D4XZ3.js +175 -0
- package/dist/build/chunk-JS4D4XZ3.js.map +7 -0
- package/dist/build/vite-plugin-product-contributions.js +100 -0
- package/dist/build/vite-plugin-product-contributions.js.map +7 -0
- package/dist/build/vite-plugin-shared-react.js +25 -0
- package/dist/build/vite-plugin-shared-react.js.map +7 -0
- package/dist/build/vite-plugin-shared-three.js +86 -0
- package/dist/build/vite-plugin-shared-three.js.map +7 -0
- package/dist/server/chunk-KMJC7AGO.js +98 -0
- package/dist/server/chunk-KMJC7AGO.js.map +7 -0
- package/dist/server/chunk-PSILUMGS.js +46 -0
- package/dist/server/chunk-PSILUMGS.js.map +7 -0
- package/dist/server/frame-proxy.js +255 -0
- package/dist/server/frame-proxy.js.map +7 -0
- package/dist/server/open-browser.js +53 -0
- package/dist/server/open-browser.js.map +7 -0
- package/dist/server/process-shutdown.js +127 -0
- package/dist/server/process-shutdown.js.map +7 -0
- package/dist/server/session-registry.js +141 -0
- package/dist/server/session-registry.js.map +7 -0
- package/dist/server/spawn-opener.js +11 -0
- package/dist/server/spawn-opener.js.map +7 -0
- package/dist/server/worktree-identity.js +11 -0
- package/dist/server/worktree-identity.js.map +7 -0
- package/dist-server/packaged.mjs +88816 -0
- package/package.json +118 -0
- package/scripts/build-plugins.mjs +14 -0
- package/scripts/build-server.mjs +26 -0
- package/scripts/build-session.mjs +9 -0
- package/server/account-credentials.ts +60 -0
- package/server/account-service.ts +1434 -0
- package/server/adapter-region-includes.ts +47 -0
- package/server/asset-catalog-v2.ts +175 -0
- package/server/asset-history-snapshots.ts +196 -0
- package/server/asset-ledger-store.ts +195 -0
- package/server/asset-library-routes.ts +1595 -0
- package/server/blender-wasm-artifact.ts +430 -0
- package/server/boot-timings.ts +106 -0
- package/server/canonical-path.ts +50 -0
- package/server/checkout-workspace-preflight.ts +349 -0
- package/server/cloud-asset-catalog.ts +158 -0
- package/server/coding-inference-launch.ts +237 -0
- package/server/collaboration-account-client.ts +202 -0
- package/server/collaboration-attribution.ts +122 -0
- package/server/collaboration-session.ts +934 -0
- package/server/comfyui-bridge.ts +248 -0
- package/server/console-ledger.ts +499 -0
- package/server/creation-site-transform.ts +304 -0
- package/server/creation-site-write.ts +648 -0
- package/server/data-file-serialize.ts +158 -0
- package/server/editor-brand-html.ts +72 -0
- package/server/editor-control-socket.ts +366 -0
- package/server/editor-server-options.ts +190 -0
- package/server/editor-server.ts +1483 -0
- package/server/editor-sse.ts +352 -0
- package/server/engine-provenance.ts +169 -0
- package/server/engine-source-restart.ts +117 -0
- package/server/frame-bridge.ts +115 -0
- package/server/frame-proxy.ts +490 -0
- package/server/frame-workbench.ts +259 -0
- package/server/frontend-handoff.ts +229 -0
- package/server/game-globals-shadow.ts +113 -0
- package/server/gameplay-session-retention.ts +149 -0
- package/server/gameplay-sessions.ts +123 -0
- package/server/generation-jobs.ts +201 -0
- package/server/generation-reconciler.ts +137 -0
- package/server/generative-execution-context.ts +59 -0
- package/server/git-workflow.ts +612 -0
- package/server/harness-chat-caller.ts +36 -0
- package/server/harness-chat-service.ts +1681 -0
- package/server/idle-shutdown.ts +170 -0
- package/server/js-profiling-policy.ts +52 -0
- package/server/launcher-settings.ts +84 -0
- package/server/local-asset-catalog.ts +410 -0
- package/server/managed-account-defaults.ts +22 -0
- package/server/mock-control-plane.ts +540 -0
- package/server/model-import-conversion.ts +345 -0
- package/server/native-credential-store.ts +162 -0
- package/server/open-browser.ts +118 -0
- package/server/packaged.ts +1192 -0
- package/server/play-stall.ts +126 -0
- package/server/process-shutdown.ts +218 -0
- package/server/product-presets.ts +55 -0
- package/server/project-build-artifact.ts +95 -0
- package/server/project-components.ts +100 -0
- package/server/project-dependency-invalidation.ts +114 -0
- package/server/project-file-scan.ts +235 -0
- package/server/project-hmr-files.ts +215 -0
- package/server/project-install-roots.ts +210 -0
- package/server/project-kinds.ts +71 -0
- package/server/project-mcp-servers.ts +82 -0
- package/server/project-module-freshness.ts +109 -0
- package/server/project-module-instance.ts +375 -0
- package/server/project-optimize-deps-entries.ts +827 -0
- package/server/project-output-writer.ts +679 -0
- package/server/project-package-origin.ts +63 -0
- package/server/project-root-surface.ts +831 -0
- package/server/project-scratch-path.ts +47 -0
- package/server/project-script-hmr.ts +619 -0
- package/server/project-serving-plugins.ts +236 -0
- package/server/project-tools.ts +653 -0
- package/server/project-validation.ts +250 -0
- package/server/project-verbs.ts +127 -0
- package/server/project-view.ts +52 -0
- package/server/project-watch.ts +1134 -0
- package/server/project-work-coordinator.ts +288 -0
- package/server/provider-credentials.ts +331 -0
- package/server/recent-projects-store.ts +98 -0
- package/server/redact-secrets.ts +71 -0
- package/server/repository-presence.ts +267 -0
- package/server/routes/account.ts +357 -0
- package/server/routes/agents.ts +60 -0
- package/server/routes/assets.ts +154 -0
- package/server/routes/build.ts +13 -0
- package/server/routes/collaboration.ts +595 -0
- package/server/routes/configurations.ts +419 -0
- package/server/routes/context.ts +264 -0
- package/server/routes/control-plane.ts +1811 -0
- package/server/routes/logs.ts +272 -0
- package/server/routes/project-identity.ts +302 -0
- package/server/routes/project-open.ts +429 -0
- package/server/routes/project-source.ts +686 -0
- package/server/routes/project-state.ts +383 -0
- package/server/routes/relay.ts +1029 -0
- package/server/routes/route-helpers.ts +29 -0
- package/server/routes/served-modules.ts +138 -0
- package/server/routes/session-tabs.ts +196 -0
- package/server/routes/settings.ts +121 -0
- package/server/routes/share-control.ts +486 -0
- package/server/routes/themes.ts +116 -0
- package/server/routes/tools.ts +230 -0
- package/server/routes/worktrees.ts +595 -0
- package/server/scoped-game-css.ts +461 -0
- package/server/server-utils.ts +1194 -0
- package/server/session-product.ts +112 -0
- package/server/session-registry.ts +230 -0
- package/server/share-claims.ts +138 -0
- package/server/share-host.ts +526 -0
- package/server/share-session-gateway.ts +1362 -0
- package/server/share-tunnel.ts +123 -0
- package/server/spawn-opener.ts +74 -0
- package/server/support/play/log-format.ts +76 -0
- package/server/support/play/session-record.ts +199 -0
- package/server/support/project/build-discipline.ts +718 -0
- package/server/support/project/inspection-node.ts +119 -0
- package/server/support/project/log-naming.ts +54 -0
- package/server/support/project/provenance.ts +290 -0
- package/server/support/project/run-name.ts +18 -0
- package/server/support/project/session-journal.ts +830 -0
- package/server/support/project/shared.ts +327 -0
- package/server/tab-bootstrap.ts +62 -0
- package/server/tab-heartbeat.ts +477 -0
- package/server/tab-lifecycle.ts +550 -0
- package/server/tab-presence.ts +1508 -0
- package/server/team-agent-mirror.ts +95 -0
- package/server/twin-auth.ts +138 -0
- package/server/vendored-lock-recorder.ts +968 -0
- package/server/worktree-identity.ts +121 -0
- package/server/worktree-management.ts +398 -0
- package/server/worktree-retention.d.mts +13 -0
- package/server/worktree-retention.mjs +205 -0
- package/src/EditorContext.tsx +169 -0
- package/src/account.ts +333 -0
- package/src/action-registry.ts +532 -0
- package/src/active-product.ts +74 -0
- package/src/active-project.ts +155 -0
- package/src/adapter-editor-config.ts +25 -0
- package/src/adapter-observation.ts +49 -0
- package/src/animation/stage-transport.ts +379 -0
- package/src/animation/three-clips-subject.ts +172 -0
- package/src/api/asset-library-wire.ts +45 -0
- package/src/api/assets.ts +365 -0
- package/src/api/base.ts +10 -0
- package/src/api/build.ts +99 -0
- package/src/api/git-wire.ts +56 -0
- package/src/api/logs.ts +92 -0
- package/src/api/project-identity.ts +74 -0
- package/src/api/project-open.ts +355 -0
- package/src/api/project-source.ts +162 -0
- package/src/api/project-state.ts +107 -0
- package/src/api/relay.ts +268 -0
- package/src/api/settings.ts +36 -0
- package/src/api/themes.ts +45 -0
- package/src/api/worktrees.ts +257 -0
- package/src/asset-compare-core.ts +171 -0
- package/src/asset-compare.ts +294 -0
- package/src/asset-editor-context.tsx +100 -0
- package/src/asset-events.ts +97 -0
- package/src/asset-inspector-actions.ts +87 -0
- package/src/asset-preview-framing.ts +357 -0
- package/src/asset-preview.ts +2802 -0
- package/src/asset-selection-viewer-registry.ts +113 -0
- package/src/asset-selection.ts +133 -0
- package/src/asset-workflow/asset-capabilities.ts +344 -0
- package/src/asset-workflow/asset-import-jobs.ts +106 -0
- package/src/asset-workflow/asset-ledger-backend.ts +126 -0
- package/src/asset-workflow/asset-ledger.ts +156 -0
- package/src/asset-workflow/asset-materialization-report.ts +140 -0
- package/src/asset-workflow/asset-pack-manifest.ts +320 -0
- package/src/asset-workflow/asset-types.ts +142 -0
- package/src/asset-workflow/asset-workflow-quality.ts +61 -0
- package/src/asset-workflow/audio-preview-player.ts +193 -0
- package/src/asset-workflow/audio-waveform.ts +22 -0
- package/src/asset-workflow/cloud-asset-client.ts +263 -0
- package/src/asset-workflow/folder-preview.ts +345 -0
- package/src/asset-workflow/hosted-asset-materialization.ts +236 -0
- package/src/asset-workflow/image-view-scale.ts +32 -0
- package/src/asset-workflow/import-contract.ts +124 -0
- package/src/asset-workflow/ledger-write-lock.ts +244 -0
- package/src/asset-workflow/model-inspection.ts +818 -0
- package/src/asset-workflow/pixi-spritesheet.ts +197 -0
- package/src/asset-workflow/preview-resource-lifetime.ts +44 -0
- package/src/asset-workflow/project-asset-commands.ts +23 -0
- package/src/asset-workflow/project-asset-health.ts +139 -0
- package/src/asset-workflow/project-asset-operations.ts +154 -0
- package/src/asset-workflow/project-asset-roots.ts +68 -0
- package/src/asset-workflow/project-content.ts +288 -0
- package/src/asset-workflow/project-source-index.ts +550 -0
- package/src/asset-workflow/thumbnail-system.ts +256 -0
- package/src/authoring/active-adapter.ts +199 -0
- package/src/authoring/active-systems.ts +422 -0
- package/src/authoring/adapter-key.ts +18 -0
- package/src/authoring/authoring-asset-url.ts +27 -0
- package/src/authoring/bootstrap-state.ts +49 -0
- package/src/authoring/boundary-authoring-adapter.ts +184 -0
- package/src/authoring/breakpoint-state.ts +43 -0
- package/src/authoring/canvas-scene-guides.ts +76 -0
- package/src/authoring/component-instance-root.ts +171 -0
- package/src/authoring/composite-authoring-adapter.ts +2110 -0
- package/src/authoring/consumer-actions.ts +520 -0
- package/src/authoring/css-numeric-style.ts +97 -0
- package/src/authoring/design-time-layers.ts +849 -0
- package/src/authoring/design-time-mount-registry.ts +235 -0
- package/src/authoring/design-time-settle.ts +343 -0
- package/src/authoring/edit-mode-authoring.ts +619 -0
- package/src/authoring/eyedropper-session.ts +60 -0
- package/src/authoring/instance-source-menu-register.ts +13 -0
- package/src/authoring/instance-source-menu.ts +135 -0
- package/src/authoring/layered-pick.ts +183 -0
- package/src/authoring/live-gesture-lock.ts +50 -0
- package/src/authoring/live-object-transform.ts +62 -0
- package/src/authoring/mount-failure-report.ts +154 -0
- package/src/authoring/mounted-root-subjects.ts +144 -0
- package/src/authoring/no-authoring-adapter.ts +55 -0
- package/src/authoring/null-inspection-subjects.tsx +75 -0
- package/src/authoring/object3d-document-persistence.ts +106 -0
- package/src/authoring/object3d-document-session-registry.ts +120 -0
- package/src/authoring/object3d-document-session.ts +1326 -0
- package/src/authoring/object3d-gesture-controller.ts +113 -0
- package/src/authoring/panel-authoring.ts +121 -0
- package/src/authoring/prefab-instance-inspector-section.tsx +237 -0
- package/src/authoring/prefab-instance-section-model.ts +55 -0
- package/src/authoring/project-authoring-session.ts +105 -0
- package/src/authoring/provenance.ts +99 -0
- package/src/authoring/quarks-particle-systems.ts +19 -0
- package/src/authoring/react-canvas-navigation.ts +255 -0
- package/src/authoring/react-design-canvas-style.ts +20 -0
- package/src/authoring/react-story-board.ts +937 -0
- package/src/authoring/selection-scope.ts +195 -0
- package/src/authoring/shell-document-ops.ts +169 -0
- package/src/authoring/shell-object3d-document-write-policy.ts +108 -0
- package/src/authoring/shell-viewport-policy.ts +48 -0
- package/src/authoring/source-object3d-authoring-adapter.ts +526 -0
- package/src/authoring/stories-scope.ts +35 -0
- package/src/authoring/story-board-chrome-fit.ts +107 -0
- package/src/authoring/story-board-presentation.ts +111 -0
- package/src/authoring/three-projection-core.ts +226 -0
- package/src/authoring/viewport-pick-context.ts +40 -0
- package/src/authoring/viewport-raycast.ts +240 -0
- package/src/authoring/viewport-tool-context.ts +73 -0
- package/src/authoring/world-canvas-viewport-state.ts +35 -0
- package/src/authoring/world-hidden-viewport.ts +152 -0
- package/src/authoring/world-pan-state.ts +198 -0
- package/src/authoring/world-session-state.ts +101 -0
- package/src/authoring/write-pipe.ts +173 -0
- package/src/availability-tick.ts +66 -0
- package/src/bitmap-label.ts +120 -0
- package/src/blender-tab-metrics.ts +161 -0
- package/src/board-open-actions.ts +20 -0
- package/src/boot-routing.ts +391 -0
- package/src/build-identity.ts +15 -0
- package/src/bytes-codec.ts +62 -0
- package/src/camera-authoring.ts +175 -0
- package/src/cancellation-reason.ts +58 -0
- package/src/canvas-preview-frames.ts +482 -0
- package/src/capture-camera-pose.ts +77 -0
- package/src/chrome-registry.ts +159 -0
- package/src/chrome-slot-registry.ts +91 -0
- package/src/collaboration-client.ts +264 -0
- package/src/collaboration-presence.ts +41 -0
- package/src/command-dispatch.ts +19 -0
- package/src/command-listener.ts +2743 -0
- package/src/command-registry.ts +70 -0
- package/src/component-board-registry.ts +205 -0
- package/src/component-states-registry.ts +200 -0
- package/src/components/AgentPresentationNotice.tsx +75 -0
- package/src/components/AlignToolbar.tsx +204 -0
- package/src/components/AppRoot.tsx +394 -0
- package/src/components/ApplicationMenus.tsx +415 -0
- package/src/components/AssetBrowser.tsx +2843 -0
- package/src/components/AssetEditorShell.tsx +216 -0
- package/src/components/AssetInspectorToolSection.tsx +124 -0
- package/src/components/BoardRulers.tsx +354 -0
- package/src/components/CameraInfo.tsx +81 -0
- package/src/components/CanvasSceneViewport.tsx +556 -0
- package/src/components/CapabilityCoverageSection.tsx +185 -0
- package/src/components/CenterDocuments.tsx +22 -0
- package/src/components/ChromeSlot.tsx +20 -0
- package/src/components/CodeView.tsx +470 -0
- package/src/components/CollaborationHeaderControl.css +74 -0
- package/src/components/CompactInspectorCard.tsx +190 -0
- package/src/components/CompactInspectorShell.tsx +39 -0
- package/src/components/ConsolePanel.css +55 -0
- package/src/components/ConsolePanel.tsx +270 -0
- package/src/components/DefaultEditorLayout.tsx +106 -0
- package/src/components/DocumentHeaderStrip.tsx +96 -0
- package/src/components/DocumentShelfRail.tsx +45 -0
- package/src/components/DocumentThumbnail.tsx +345 -0
- package/src/components/EditorLeaseGuard.tsx +372 -0
- package/src/components/ErrorBanner.tsx +123 -0
- package/src/components/FolderPreviewTile.tsx +159 -0
- package/src/components/GameHierarchy.tsx +3842 -0
- package/src/components/GameplaySessionTimeline.tsx +295 -0
- package/src/components/InspectionProjection.tsx +968 -0
- package/src/components/Inspector.tsx +233 -0
- package/src/components/InspectorCanvasPreview.tsx +35 -0
- package/src/components/InspectorFieldsSection.tsx +290 -0
- package/src/components/InspectorObjectPreview.tsx +57 -0
- package/src/components/InspectorStoriesSection.tsx +92 -0
- package/src/components/InspectorToolSection.tsx +96 -0
- package/src/components/InspectorTransformSection.tsx +245 -0
- package/src/components/LightExplorerPanel.tsx +433 -0
- package/src/components/MediaProperties.tsx +145 -0
- package/src/components/NonThreeAuthoringBootstrap.tsx +19 -0
- package/src/components/Object3DDocumentToolbar.css +100 -0
- package/src/components/Object3DDocumentToolbar.tsx +454 -0
- package/src/components/Object3DDocumentViewport.tsx +58 -0
- package/src/components/ProjectHeader.css +617 -0
- package/src/components/ProjectHeader.tsx +328 -0
- package/src/components/ProjectLayout.tsx +249 -0
- package/src/components/ReactCanvasControls.tsx +284 -0
- package/src/components/RootSelectionOverlay.tsx +3162 -0
- package/src/components/RootTextEditor.tsx +79 -0
- package/src/components/SaveStatus.tsx +70 -0
- package/src/components/StageHost.tsx +1954 -0
- package/src/components/StageOverlays.tsx +21 -0
- package/src/components/StartupErrorScreen.tsx +76 -0
- package/src/components/StartupLoadingScreen.tsx +65 -0
- package/src/components/StatsOverlay.tsx +78 -0
- package/src/components/SurfaceStateOverlay.tsx +24 -0
- package/src/components/ToolContributionSurfaces.tsx +65 -0
- package/src/components/ToolHost.tsx +370 -0
- package/src/components/ToolObject3DPreview.tsx +39 -0
- package/src/components/Toolbar.tsx +595 -0
- package/src/components/TransientHint.tsx +44 -0
- package/src/components/TransportStrip.tsx +174 -0
- package/src/components/VersionControlSection.tsx +470 -0
- package/src/components/VgaiLogo.css +83 -0
- package/src/components/VgaiLogo.tsx +35 -0
- package/src/components/ViewportControlsHint.tsx +60 -0
- package/src/components/ViewportFurniture.tsx +401 -0
- package/src/components/ViewportOverlay.tsx +145 -0
- package/src/components/ViewportOverlaysMenu.tsx +153 -0
- package/src/components/ViewportShadingMenu.tsx +300 -0
- package/src/components/ViewportViewMenu.tsx +101 -0
- package/src/components/WorkspaceDocumentSurface.tsx +204 -0
- package/src/components/WorkspaceUtilitySurface.tsx +22 -0
- package/src/components/WorktreeSwitcher.css +239 -0
- package/src/components/WorktreeSwitcher.tsx +890 -0
- package/src/components/account-documents.tsx +1162 -0
- package/src/components/asset-documents.tsx +812 -0
- package/src/components/asset-editor-persistence.ts +216 -0
- package/src/components/asset-selection-section.tsx +535 -0
- package/src/components/asset-thumbnails.tsx +312 -0
- package/src/components/asset-viewers/AudioViewer.tsx +201 -0
- package/src/components/asset-viewers/EntityModelDocument.tsx +122 -0
- package/src/components/asset-viewers/EnvironmentAssetDocument.tsx +440 -0
- package/src/components/asset-viewers/GenericJsonViewer.tsx +102 -0
- package/src/components/asset-viewers/ImageViewer.tsx +300 -0
- package/src/components/asset-viewers/JsonAssetDocument.tsx +93 -0
- package/src/components/asset-viewers/LiveModuleDocument.tsx +417 -0
- package/src/components/asset-viewers/LutAssetDocument.tsx +444 -0
- package/src/components/asset-viewers/ModelAssetDocument.tsx +105 -0
- package/src/components/asset-viewers/Object3DPreview.tsx +359 -0
- package/src/components/asset-viewers/OnlineAssetDetail.tsx +421 -0
- package/src/components/asset-viewers/PasteboardModuleDocument.tsx +67 -0
- package/src/components/asset-viewers/QuarksAssetDocument.tsx +526 -0
- package/src/components/asset-viewers/ShaderAssetDocument.tsx +743 -0
- package/src/components/asset-viewers/SourceAssetViewer.tsx +281 -0
- package/src/components/asset-viewers/SpritesheetSpriteView.tsx +102 -0
- package/src/components/asset-viewers/VideoViewer.tsx +101 -0
- package/src/components/asset-viewers/shader-source.ts +144 -0
- package/src/components/asset-workflow.css +731 -0
- package/src/components/board-guides.ts +150 -0
- package/src/components/compact-inspector.css +539 -0
- package/src/components/core-utilities.tsx +90 -0
- package/src/components/editor-notifications.css +40 -0
- package/src/components/engine-workspace.css +274 -0
- package/src/components/inspector-preview-section.tsx +238 -0
- package/src/components/inspector-property-grouping.ts +64 -0
- package/src/components/inspector-revert-label.ts +20 -0
- package/src/components/inspector-selection.ts +42 -0
- package/src/components/inspector-stories-gating.ts +171 -0
- package/src/components/inspector-transform-subject.ts +11 -0
- package/src/components/inspector-transform.ts +75 -0
- package/src/components/kind-documents.tsx +500 -0
- package/src/components/palette-action-publisher.tsx +140 -0
- package/src/components/primitives/DraftColorInput.tsx +74 -0
- package/src/components/product-shell.css +1829 -0
- package/src/components/project-tool-documents.tsx +410 -0
- package/src/components/scene-documents.tsx +223 -0
- package/src/components/stage-keyboard.tsx +37 -0
- package/src/components/stage-overlay-set.tsx +107 -0
- package/src/components/stage-presence-markers.ts +478 -0
- package/src/components/standard-viewport-dressing.ts +417 -0
- package/src/components/status-contributions.tsx +403 -0
- package/src/components/tool-documents.tsx +309 -0
- package/src/components/tool-schema-form.tsx +262 -0
- package/src/components/use-after-paint.ts +41 -0
- package/src/components/use-project-image-assets.ts +86 -0
- package/src/components/viewport-header-controls.css +90 -0
- package/src/components/viewport-surface-status.tsx +55 -0
- package/src/components/workspace-history.ts +32 -0
- package/src/components/workspace-static-panel-registry.tsx +152 -0
- package/src/components/workspace-surfaces.css +621 -0
- package/src/components/world-documents.tsx +586 -0
- package/src/components/world-overlay-gestures.ts +1694 -0
- package/src/composite-screenshot.ts +1641 -0
- package/src/console-sync.ts +131 -0
- package/src/constraint-helper.ts +338 -0
- package/src/content-entry-source-registry.ts +184 -0
- package/src/coverage/authoring-seam-evidence.ts +300 -0
- package/src/coverage/canvas-reveal.ts +192 -0
- package/src/coverage/design-time-surfaces.ts +101 -0
- package/src/coverage/live-seam-evidence.ts +11 -0
- package/src/coverage/ontology-invariants.ts +466 -0
- package/src/coverage/session-vitals.ts +501 -0
- package/src/coverage/system-seam-evidence.ts +72 -0
- package/src/crash-null-boundary.ts +36 -0
- package/src/creation-site-edit.ts +1479 -0
- package/src/creation-site-registry.ts +160 -0
- package/src/delegate-harness-registry.ts +143 -0
- package/src/document-context-registry.ts +177 -0
- package/src/document-open-registry.ts +200 -0
- package/src/document-preview-source.ts +20 -0
- package/src/document-renderer-session.ts +138 -0
- package/src/editor-api.ts +46 -0
- package/src/editor-chrome-capture.ts +139 -0
- package/src/editor-commands.ts +164 -0
- package/src/editor-console.ts +563 -0
- package/src/editor-current-view.ts +82 -0
- package/src/editor-document-probe.ts +881 -0
- package/src/editor-git-client.ts +115 -0
- package/src/editor-host-door.ts +462 -0
- package/src/editor-hotkeys.ts +842 -0
- package/src/editor-lease-view.ts +39 -0
- package/src/editor-lease.ts +415 -0
- package/src/editor-mode.ts +19 -0
- package/src/editor-notifications.ts +140 -0
- package/src/editor-presence.ts +563 -0
- package/src/editor-presentation-activity.ts +50 -0
- package/src/editor-presentation-notice.ts +42 -0
- package/src/editor-runtime.tsx +145 -0
- package/src/editor-server-response.ts +86 -0
- package/src/editor-session-attribution.ts +75 -0
- package/src/editor-session-mode.ts +54 -0
- package/src/editor-shell-store.ts +1304 -0
- package/src/editor-state-facets.ts +74 -0
- package/src/editor-styles.css +33 -0
- package/src/editor-view-presentation.ts +810 -0
- package/src/editor-viewport.ts +5302 -0
- package/src/entity-lod.ts +31 -0
- package/src/entity-object.ts +91 -0
- package/src/files/file-provider.ts +62 -0
- package/src/files/project-files.ts +264 -0
- package/src/finders/index.ts +136 -0
- package/src/finders/scenes-from-entrypoint-selection.ts +387 -0
- package/src/frame/bridge.tsx +1408 -0
- package/src/frame/product.ts +77 -0
- package/src/gameplay-dom-recording.ts +319 -0
- package/src/gameplay-export-state.ts +14 -0
- package/src/gameplay-replay.ts +417 -0
- package/src/gameplay-session-time.ts +9 -0
- package/src/gameplay-sessions.ts +204 -0
- package/src/harness-chat-types.ts +253 -0
- package/src/hierarchy-component-marks.ts +298 -0
- package/src/hierarchy-drop.ts +91 -0
- package/src/hierarchy-expansion-state.ts +80 -0
- package/src/hierarchy-header-slot.ts +52 -0
- package/src/hierarchy-internals.ts +197 -0
- package/src/hierarchy-kind-icon.ts +217 -0
- package/src/hierarchy-mark-reader.ts +73 -0
- package/src/hierarchy-menu-registry.ts +67 -0
- package/src/hierarchy-node-rows.ts +307 -0
- package/src/hierarchy-panel-view.ts +280 -0
- package/src/hierarchy-projection.ts +76 -0
- package/src/hierarchy-row-cache.ts +243 -0
- package/src/hierarchy-row-model.ts +308 -0
- package/src/hierarchy-rows.ts +11 -0
- package/src/hierarchy-walk.ts +86 -0
- package/src/history/editor-session.ts +25 -0
- package/src/history/history-commands.ts +147 -0
- package/src/history/history-delegate.ts +163 -0
- package/src/history/history-limit-notices.ts +43 -0
- package/src/history/history-service.ts +1173 -0
- package/src/history/persistence-coordinator.ts +35 -0
- package/src/history/project-file-history.ts +386 -0
- package/src/history/project-root-history-backends.ts +139 -0
- package/src/history/resource-registry.ts +209 -0
- package/src/history/snapshot-store.ts +103 -0
- package/src/history/source-history-backend.ts +546 -0
- package/src/history/types.ts +124 -0
- package/src/hmr-registration-group.ts +67 -0
- package/src/hmr-stable-react-context.ts +23 -0
- package/src/hotkeys.ts +188 -0
- package/src/inference-diagnostics.ts +69 -0
- package/src/initial-project.ts +80 -0
- package/src/inspection/active-subject.ts +578 -0
- package/src/inspection/active-surface.ts +142 -0
- package/src/inspection/compose.ts +1064 -0
- package/src/inspection/display.ts +170 -0
- package/src/inspection/document-subject.ts +109 -0
- package/src/inspection/game-subject.ts +85 -0
- package/src/inspection/model.ts +542 -0
- package/src/inspection/null-subject.ts +115 -0
- package/src/inspection/serialize.ts +357 -0
- package/src/inspection/use-active-inspection.ts +180 -0
- package/src/inspector-presentation.ts +201 -0
- package/src/inspector-section-registry.ts +221 -0
- package/src/instance-source-actions.ts +163 -0
- package/src/instanced-presentation.ts +164 -0
- package/src/js-heap.ts +71 -0
- package/src/key-actions.ts +91 -0
- package/src/keymap-presets.ts +401 -0
- package/src/layout-policy.ts +31 -0
- package/src/learn-links.ts +73 -0
- package/src/light-explorer-model.ts +134 -0
- package/src/live-canvas-frame.ts +55 -0
- package/src/live-document.ts +279 -0
- package/src/live-module-source.ts +230 -0
- package/src/live-session-registry.ts +220 -0
- package/src/live-transition.ts +633 -0
- package/src/manifest-project.ts +107 -0
- package/src/model-thumbnail.ts +523 -0
- package/src/native-selection-style.ts +202 -0
- package/src/object3d-document-write-policy.ts +137 -0
- package/src/packaged-runtime.ts +108 -0
- package/src/palettes/maya.palette.json +57 -0
- package/src/palettes/substance.palette.json +57 -0
- package/src/pasteboard-module.ts +81 -0
- package/src/performance-profiler.ts +367 -0
- package/src/performance-sources.ts +69 -0
- package/src/play-boot-phase.ts +145 -0
- package/src/presentation-surface.ts +248 -0
- package/src/project-adapter.ts +1143 -0
- package/src/project-asset-refresh.ts +26 -0
- package/src/project-declaration-refresh.ts +31 -0
- package/src/project-local-state.ts +118 -0
- package/src/project-manager.ts +243 -0
- package/src/project-module-changes.ts +163 -0
- package/src/project-module-split.ts +266 -0
- package/src/project-provenance.ts +115 -0
- package/src/project-ready.ts +42 -0
- package/src/project-session-reset.ts +67 -0
- package/src/project-shape.ts +68 -0
- package/src/project-tool-discovery.ts +66 -0
- package/src/project-tools.ts +107 -0
- package/src/project-work-types.ts +149 -0
- package/src/projection/three.ts +898 -0
- package/src/projection/types.ts +44 -0
- package/src/readiness.ts +113 -0
- package/src/reflection-probe-helper.ts +142 -0
- package/src/reported-play-state.ts +90 -0
- package/src/resolve-relative-specifier.ts +33 -0
- package/src/scene-document-plan.ts +315 -0
- package/src/scene-framing.ts +315 -0
- package/src/scene-live-open.ts +210 -0
- package/src/scene-view-fog.ts +89 -0
- package/src/scoped-game-css.ts +152 -0
- package/src/session-orphan-record.ts +193 -0
- package/src/session-tombstone.ts +126 -0
- package/src/settings/settings-provider.ts +82 -0
- package/src/settings-store.ts +345 -0
- package/src/shared-view-restore.ts +42 -0
- package/src/shell-store-door.ts +45 -0
- package/src/source-conflict.ts +122 -0
- package/src/spatial-handle-visuals.ts +332 -0
- package/src/stage-context.ts +341 -0
- package/src/stage-store-registry.ts +63 -0
- package/src/stale-chunk-recovery.ts +34 -0
- package/src/state-report-deferral.ts +73 -0
- package/src/storage/host-files-storage.ts +97 -0
- package/src/storage/http-storage.ts +174 -0
- package/src/storage/index.ts +75 -0
- package/src/storage/mem-storage.ts +149 -0
- package/src/storage/path-lock.ts +44 -0
- package/src/storage/paths.ts +26 -0
- package/src/storage/types.ts +116 -0
- package/src/stories/StoryComponentThumbnail.tsx +184 -0
- package/src/stories/StoryPreviewMount.tsx +306 -0
- package/src/stories/component-content-source.tsx +106 -0
- package/src/stories/component-states-source.ts +78 -0
- package/src/stories/compose-project-stories.ts +255 -0
- package/src/stories/pixi-story-model.ts +30 -0
- package/src/stories/prefabs-finder.ts +54 -0
- package/src/stories/prefabs-from-stories.ts +182 -0
- package/src/stories/project-story-discovery.ts +78 -0
- package/src/stories/project-story-regions.ts +24 -0
- package/src/stories/story-actions.ts +54 -0
- package/src/stories/story-capture-command.ts +124 -0
- package/src/stories/story-capture.ts +584 -0
- package/src/stories/story-declared-medium.ts +126 -0
- package/src/stories/story-discovery.ts +176 -0
- package/src/stories/story-document-openers.ts +36 -0
- package/src/stories/story-dom-runtime.ts +78 -0
- package/src/stories/story-grouping.ts +111 -0
- package/src/stories/story-lane.ts +88 -0
- package/src/stories/story-mount-turn.ts +27 -0
- package/src/stories/story-opener.ts +260 -0
- package/src/stories/story-pixi-preview.ts +408 -0
- package/src/stories/story-presentation.ts +215 -0
- package/src/stories/story-registry.ts +517 -0
- package/src/stories/story-three-preview.ts +807 -0
- package/src/stories/three-story-model.ts +96 -0
- package/src/story-three-preview-runtime.ts +56 -0
- package/src/surface-keyboard.ts +112 -0
- package/src/surface-state.ts +124 -0
- package/src/tab-bootstrap.js +628 -0
- package/src/tab-census.ts +198 -0
- package/src/tab-lifecycle-client.ts +196 -0
- package/src/theme-library.ts +844 -0
- package/src/theme-preference.ts +378 -0
- package/src/theme.css +3437 -0
- package/src/three-viewport/bone-selection-highlight.ts +119 -0
- package/src/three-viewport/camera-fit.ts +41 -0
- package/src/three-viewport/interactive-renderer.ts +132 -0
- package/src/three-viewport/selection-brackets.ts +310 -0
- package/src/three-viewport/selection-outline.ts +183 -0
- package/src/three-viewport/skeleton-helper.ts +61 -0
- package/src/three-viewport/source-color.ts +167 -0
- package/src/three-viewport/studio-environment.ts +96 -0
- package/src/three-viewport-presentation.ts +23 -0
- package/src/tool-contribution-play.ts +74 -0
- package/src/tool-loader.ts +1798 -0
- package/src/transform-mode-request.ts +57 -0
- package/src/transient-hint.ts +78 -0
- package/src/trigger-volume-helper.ts +116 -0
- package/src/ui-source/adapter-region-includes.ts +241 -0
- package/src/ui-source/ensure-import.ts +132 -0
- package/src/ui-source/file-region-resolver.ts +302 -0
- package/src/ui-source/inspect.ts +775 -0
- package/src/ui-source/oid-transform.ts +1845 -0
- package/src/ui-source/plan-csf-story.ts +196 -0
- package/src/ui-source/plan-extract-component.ts +421 -0
- package/src/ui-source/plan-fork-component.ts +621 -0
- package/src/ui-source/plan-named-style.ts +95 -0
- package/src/ui-source/plan-source-edit.ts +353 -0
- package/src/ui-source/r3f-contract-resolver.ts +327 -0
- package/src/ui-source/r3f-diagnostic-index.ts +165 -0
- package/src/ui-source/r3f-environment-binding.ts +133 -0
- package/src/ui-source/r3f-joint-binding.ts +251 -0
- package/src/ui-source/r3f-lod-binding.ts +91 -0
- package/src/ui-source/r3f-particle-binding.ts +235 -0
- package/src/ui-source/r3f-physics-binding.ts +483 -0
- package/src/ui-source/r3f-project-contracts.ts +444 -0
- package/src/ui-source/relative-import-specifier.ts +34 -0
- package/src/ui-source/reparent-guard.ts +544 -0
- package/src/ui-source/source-edit-request.ts +97 -0
- package/src/ui-source/source-write-backend.ts +618 -0
- package/src/ui-source/syntactic-prop-specs.ts +296 -0
- package/src/ui-source/tier-source-write-backend.ts +279 -0
- package/src/ui-source/ts-ast.ts +171 -0
- package/src/ui-source/utility-class-support.ts +169 -0
- package/src/ui-source/write-component-default.ts +133 -0
- package/src/ui-source/writer.ts +1989 -0
- package/src/viewport-activation-timings.ts +840 -0
- package/src/viewport-authoring-policy.ts +186 -0
- package/src/viewport-controls-hint.ts +57 -0
- package/src/viewport-door.ts +237 -0
- package/src/viewport-shading-boundary.ts +12 -0
- package/src/vite-error-surface.ts +141 -0
- package/src/wait-until.ts +37 -0
- package/src/workspace-areas.ts +156 -0
- package/src/workspace-aux-commands.ts +11 -0
- package/src/workspace-available-documents.ts +127 -0
- package/src/workspace-core-utilities.ts +31 -0
- package/src/workspace-document-ids.ts +59 -0
- package/src/workspace-document-registry.ts +612 -0
- package/src/workspace-document-restore.ts +145 -0
- package/src/workspace-host-commands.ts +141 -0
- package/src/workspace-persistence-gate.ts +40 -0
- package/src/workspace-play-utilities.ts +44 -0
- package/src/workspace-presets.ts +425 -0
- package/src/workspace-regions.ts +294 -0
- package/src/workspace-state-persistence.ts +536 -0
- package/src/workspace-static-panels.ts +73 -0
- package/src/workspace-status-registry.ts +121 -0
- package/src/workspace-style.ts +239 -0
- package/src/workspace-utility-commands.ts +74 -0
- package/src/workspace-utility-registry.ts +263 -0
- package/src/workspace-viewport-rect.ts +97 -0
- package/src/world-adoption.ts +115 -0
- package/src/world-document-routing.ts +104 -0
- package/vite-plugin-creation-site-write.ts +184 -0
- package/vite-plugin-creation-site.ts +80 -0
- package/vite-plugin-game-static.ts +303 -0
- package/vite-plugin-module-doorways.ts +336 -0
- package/vite-plugin-product-contributions.ts +197 -0
- package/vite-plugin-project-game-static.ts +125 -0
- package/vite-plugin-project-jsx-js.ts +65 -0
- package/vite-plugin-project-root-absolute-assets.ts +359 -0
- package/vite-plugin-shared-react.ts +420 -0
- package/vite-plugin-shared-three.ts +203 -0
- package/vite-plugin-ui-oid.ts +2106 -0
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import {
|
|
2
|
+
EDITOR_TREE_QUERY,
|
|
3
|
+
SHARED_REACT_ENTRIES,
|
|
4
|
+
SHARED_REACT_MANIFEST_FILE,
|
|
5
|
+
SHARED_REACT_SPECIFIERS,
|
|
6
|
+
installedExportNames,
|
|
7
|
+
readSharedReactManifest,
|
|
8
|
+
sharedReactBuildPlugin,
|
|
9
|
+
sharedReactEntryModule,
|
|
10
|
+
sharedReactPlugin,
|
|
11
|
+
sharedReactUrls
|
|
12
|
+
} from "./chunk-JS4D4XZ3.js";
|
|
13
|
+
export {
|
|
14
|
+
EDITOR_TREE_QUERY,
|
|
15
|
+
SHARED_REACT_ENTRIES,
|
|
16
|
+
SHARED_REACT_MANIFEST_FILE,
|
|
17
|
+
SHARED_REACT_SPECIFIERS,
|
|
18
|
+
installedExportNames,
|
|
19
|
+
readSharedReactManifest,
|
|
20
|
+
sharedReactBuildPlugin,
|
|
21
|
+
sharedReactEntryModule,
|
|
22
|
+
sharedReactPlugin,
|
|
23
|
+
sharedReactUrls
|
|
24
|
+
};
|
|
25
|
+
//# sourceMappingURL=vite-plugin-shared-react.js.map
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
import {
|
|
2
|
+
installedExportNames,
|
|
3
|
+
sharedReactEntryModule
|
|
4
|
+
} from "./chunk-JS4D4XZ3.js";
|
|
5
|
+
|
|
6
|
+
// vite-plugin-shared-three.ts
|
|
7
|
+
import { existsSync, readFileSync } from "node:fs";
|
|
8
|
+
import path from "node:path";
|
|
9
|
+
var SHARED_THREE_SPECIFIER = "three";
|
|
10
|
+
var SHARED_THREE_ENTRY_NAME = "vgai-shared-three";
|
|
11
|
+
var SHARED_THREE_MANIFEST_FILE = "vgai-shared-three.json";
|
|
12
|
+
var VIRTUAL_PREFIX = "\0vgai-shared-three:";
|
|
13
|
+
function sharedThreeBuildPlugin(fromDir) {
|
|
14
|
+
let referenceId = null;
|
|
15
|
+
return {
|
|
16
|
+
name: "vgai-shared-three-build",
|
|
17
|
+
apply: "build",
|
|
18
|
+
buildStart() {
|
|
19
|
+
referenceId = this.emitFile({
|
|
20
|
+
type: "chunk",
|
|
21
|
+
id: `${VIRTUAL_PREFIX}${SHARED_THREE_SPECIFIER}`,
|
|
22
|
+
name: SHARED_THREE_ENTRY_NAME,
|
|
23
|
+
// Same reason as the shared-React entries: Vite's app build sets
|
|
24
|
+
// `preserveEntrySignatures: false`, which would mangle the entry's
|
|
25
|
+
// export names away — `strict` keeps `Mesh` spelled `Mesh`.
|
|
26
|
+
preserveSignature: "strict"
|
|
27
|
+
});
|
|
28
|
+
},
|
|
29
|
+
resolveId(id) {
|
|
30
|
+
return id.startsWith(VIRTUAL_PREFIX) ? id : void 0;
|
|
31
|
+
},
|
|
32
|
+
load(id) {
|
|
33
|
+
if (!id.startsWith(VIRTUAL_PREFIX)) return void 0;
|
|
34
|
+
const specifier = id.slice(VIRTUAL_PREFIX.length);
|
|
35
|
+
return sharedReactEntryModule(specifier, installedExportNames(fromDir, specifier));
|
|
36
|
+
},
|
|
37
|
+
generateBundle() {
|
|
38
|
+
if (!referenceId) return;
|
|
39
|
+
this.emitFile({
|
|
40
|
+
type: "asset",
|
|
41
|
+
fileName: SHARED_THREE_MANIFEST_FILE,
|
|
42
|
+
source: `${JSON.stringify(
|
|
43
|
+
{ file: this.getFileName(referenceId) },
|
|
44
|
+
null,
|
|
45
|
+
2
|
|
46
|
+
)}
|
|
47
|
+
`
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
};
|
|
51
|
+
}
|
|
52
|
+
function readSharedThreeManifest(distPath) {
|
|
53
|
+
const manifestPath = path.join(distPath, SHARED_THREE_MANIFEST_FILE);
|
|
54
|
+
if (!existsSync(manifestPath)) return null;
|
|
55
|
+
try {
|
|
56
|
+
const manifest = JSON.parse(readFileSync(manifestPath, "utf8"));
|
|
57
|
+
return manifest.file ? manifest : null;
|
|
58
|
+
} catch {
|
|
59
|
+
return null;
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
function sharedThreeUrl(manifest, base = "/") {
|
|
63
|
+
const prefix = base.endsWith("/") ? base : `${base}/`;
|
|
64
|
+
return `${prefix}${manifest.file}`;
|
|
65
|
+
}
|
|
66
|
+
function sharedThreePlugin(url) {
|
|
67
|
+
return {
|
|
68
|
+
name: "vgai-shared-three",
|
|
69
|
+
enforce: "pre",
|
|
70
|
+
resolveId(source, _importer, options) {
|
|
71
|
+
if (source !== SHARED_THREE_SPECIFIER) return void 0;
|
|
72
|
+
if (options?.scan) return void 0;
|
|
73
|
+
return url;
|
|
74
|
+
}
|
|
75
|
+
};
|
|
76
|
+
}
|
|
77
|
+
export {
|
|
78
|
+
SHARED_THREE_ENTRY_NAME,
|
|
79
|
+
SHARED_THREE_MANIFEST_FILE,
|
|
80
|
+
SHARED_THREE_SPECIFIER,
|
|
81
|
+
readSharedThreeManifest,
|
|
82
|
+
sharedThreeBuildPlugin,
|
|
83
|
+
sharedThreePlugin,
|
|
84
|
+
sharedThreeUrl
|
|
85
|
+
};
|
|
86
|
+
//# sourceMappingURL=vite-plugin-shared-three.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../vite-plugin-shared-three.ts"],
|
|
4
|
+
"sourcesContent": ["/**\n * ONE three.js for the whole page \u2014 the editor shell's.\n *\n * ## The defect this closes (WORK.md P2, \"Packaged shell loads three.js twice\")\n *\n * Under the PACKAGED runtime (`server/packaged.ts`: a `@vgai/editor` npm\n * package with no monorepo checkout) the page runs two module graphs at once:\n *\n * - the editor shell, a PREBUILT production bundle (`dist/assets/index-*.js`)\n * with its own `three` inlined \u2014 the viewport renderer, the gizmos, the\n * selection outline and ~100 other shell modules import it, so it evaluates\n * at boot; and\n * - the opened PROJECT's source, served fresh by a second, project-rooted\n * Vite instance, whose bare `three` resolves \u2014 correctly, for its root \u2014 to\n * the PROJECT's own `node_modules` (prebundled into `.vite/deps/three.js`).\n *\n * three's own module body runs `if (window.__THREE__) console.warn('WARNING:\n * Multiple instances of Three.js being imported.')` on evaluation, so the\n * SECOND graph's copy trips the guard. That warning is not cosmetic: it keeps\n * `vgai console` from reaching exit-0, a hard gate. `dev.ts` never sees it \u2014\n * one Vite instance, and the repo-root `vite.config.ts`'s\n * `resolve.dedupe: ['three', \u2026]` already collapses the project's copy onto the\n * editor's \u2014 so nothing in a checkout ever reproduced it.\n *\n * ## The mechanism: URL identity (the sibling of `vite-plugin-shared-react.ts`)\n *\n * The editor build emits one extra ENTRY chunk for `three`\n * ({@link sharedThreeBuildPlugin}) \u2014 the SHELL's own three. Because it is an\n * entry of the SAME build, rollup hoists the actual module into a chunk both it\n * and the shell import: it is not a copy of three, it is a doorway onto the\n * shell's instance. At serve time {@link sharedThreePlugin} resolves the bare\n * `three` specifier, for the whole PROJECT graph, to that built chunk's URL\n * (`/assets/vgai-shared-three-<hash>.js`) \u2014 the SAME absolute URL the shell's\n * own bundle imports, so the browser's module map hands both sides the one\n * instance and three's body evaluates exactly once.\n *\n * ## Why the scope is the WHOLE project graph \u2014 unlike shared-React\n *\n * `sharedReactPlugin` deliberately redirects react only for the EDITOR TREE and\n * leaves the GAME on the project's own (development) react, because React ships\n * distinct dev/prod builds and its prebundled DEVELOPMENT reconciler must not\n * run against the shell's PRODUCTION React (that broke Play mode, measured in\n * that plugin's header). three has NO such split \u2014 it is one build \u2014 and\n * `dev.ts`'s `resolve.dedupe` already proves the correct answer is ONE three\n * for editor AND game together (the R3F entry runtime already hands Fiber's\n * catalogue `host.three`, so a world's objects, Fiber's intrinsics and the\n * editor viewport that adopts them must all be the SAME three or `applyProps`\n * mis-types \u2014 see `r3f-entry-runtime.ts`). So this redirect is unscoped: every\n * project-graph `three` import becomes the shell's one instance.\n *\n * ## Ingest keeps its own three \u2014 for free, by construction\n *\n * An INGEST root's premise is a vendored game that brought its own three. Two\n * shapes, both preserved without a special case here:\n *\n * - a SOURCE game (its modules served by this same project-rooted Vite) has\n * its bare `three` DEDUPED to the editor's instance already under `dev.ts`\n * (see `ingest/resolve-three.ts`'s header, and the `cov-bundled-dedupe`\n * e2e). This redirect is the packaged analogue of that dedupe \u2014 the source\n * game lands on the shell's three exactly as it lands on the editor's in a\n * checkout, and the three-ingest doorway's `projectThree` (which goes\n * through this same resolver) lands there too, so the capture trap and the\n * game agree;\n * - a PRE-BUILT BUNDLE game inlines its own three into a blob/`public/` URL\n * that never passes through a bare-specifier resolve, so this plugin cannot\n * and does not touch it \u2014 it keeps its own copy, the case the doorway\n * header calls out as inherently un-shareable.\n *\n * For the redirect to reach `@react-three/fiber`'s OWN `import 'three'`,\n * `packaged.ts` also `optimizeDeps.exclude`s `three`: an excluded dep is\n * externalized out of every prebundled chunk and resolved at serve time, where\n * this plugin answers. Prebundling it instead would bake a second, un-\n * redirectable three chunk into `.vite/deps` \u2014 exactly the duplicate this\n * plugin removes.\n *\n * {@link sharedThreePlugin} is registered ONLY by `server/packaged.ts`.\n * `dev.ts` is untouched \u2014 it has one three already.\n */\nimport { existsSync, readFileSync } from 'node:fs';\nimport path from 'node:path';\nimport type { Plugin } from 'vite';\nimport { installedExportNames, sharedReactEntryModule } from './vite-plugin-shared-react.js';\n\n/** The bare specifier this plugin owns. three's `window.__THREE__` guard lives\n * in its main entry (`three/build/three.core.js`, re-exported by `three`), so\n * collapsing the main entry collapses the duplicate-instance warning; addons\n * (`three/addons/*`, `three/examples/jsm/*`) import bare `three` internally and\n * ride this same redirect. */\nexport const SHARED_THREE_SPECIFIER = 'three';\n\n/** The rollup chunk NAME the shell's three is emitted under. */\nexport const SHARED_THREE_ENTRY_NAME = 'vgai-shared-three';\n\n/**\n * The emitted map, written beside the built shell \u2014 the sibling of\n * `vgai-shared-react.json`, kept a SEPARATE file so an editor build that\n * predates one manifest but not the other degrades one lane at a time.\n */\nexport const SHARED_THREE_MANIFEST_FILE = 'vgai-shared-three.json';\n\nexport interface SharedThreeManifest {\n /** outDir-relative built chunk file (`assets/\u2026js`) for `three`. */\n file: string;\n}\n\nconst VIRTUAL_PREFIX = '\\0vgai-shared-three:';\n\n/**\n * BUILD side: emit the `three` entry chunk and the manifest naming it.\n *\n * `fromDir` is the directory whose `node_modules` the three being published\n * comes from \u2014 the repo root for this build, which is the same three the shell\n * itself bundles. The entry body is generated from the installed package's own\n * runtime key list ({@link sharedReactEntryModule} / {@link installedExportNames}\n * \u2014 generic over the specifier despite the React-shaped names), so it cannot\n * drift from the installed three and needs no hand-maintained export list.\n */\nexport function sharedThreeBuildPlugin(fromDir: string): Plugin {\n let referenceId: string | null = null;\n return {\n name: 'vgai-shared-three-build',\n apply: 'build',\n buildStart() {\n referenceId = this.emitFile({\n type: 'chunk',\n id: `${VIRTUAL_PREFIX}${SHARED_THREE_SPECIFIER}`,\n name: SHARED_THREE_ENTRY_NAME,\n // Same reason as the shared-React entries: Vite's app build sets\n // `preserveEntrySignatures: false`, which would mangle the entry's\n // export names away \u2014 `strict` keeps `Mesh` spelled `Mesh`.\n preserveSignature: 'strict',\n });\n },\n resolveId(id) {\n return id.startsWith(VIRTUAL_PREFIX) ? id : undefined;\n },\n load(id) {\n if (!id.startsWith(VIRTUAL_PREFIX)) return undefined;\n const specifier = id.slice(VIRTUAL_PREFIX.length);\n return sharedReactEntryModule(specifier, installedExportNames(fromDir, specifier));\n },\n generateBundle() {\n if (!referenceId) return;\n this.emitFile({\n type: 'asset',\n fileName: SHARED_THREE_MANIFEST_FILE,\n source: `${JSON.stringify(\n { file: this.getFileName(referenceId) } satisfies SharedThreeManifest,\n null,\n 2,\n )}\\n`,\n });\n },\n };\n}\n\n/** The manifest a built `dist/` carries, or `null` when it predates this build\n * step (an old tarball, or a checkout whose `dist/` was never rebuilt). */\nexport function readSharedThreeManifest(distPath: string): SharedThreeManifest | null {\n const manifestPath = path.join(distPath, SHARED_THREE_MANIFEST_FILE);\n if (!existsSync(manifestPath)) return null;\n try {\n const manifest = JSON.parse(readFileSync(manifestPath, 'utf8')) as SharedThreeManifest;\n return manifest.file ? manifest : null;\n } catch {\n return null;\n }\n}\n\n/**\n * The `three` chunk URL, from a manifest. `base` is the built shell's own base\n * (`/` for the packaged build), so this URL is byte-identical to the one the\n * shell's bundle imports. That identity IS the fix: a differently-spelled URL\n * for the same file is a second three.\n */\nexport function sharedThreeUrl(manifest: SharedThreeManifest, base = '/'): string {\n const prefix = base.endsWith('/') ? base : `${base}/`;\n return `${prefix}${manifest.file}`;\n}\n\n/**\n * SERVE side: point every project-graph `three` import at the shell's built\n * chunk URL. Registered ONLY on the packaged runtime's project-rooted Vite.\n */\nexport function sharedThreePlugin(url: string): Plugin {\n return {\n name: 'vgai-shared-three',\n enforce: 'pre',\n resolveId(source, _importer, options) {\n if (source !== SHARED_THREE_SPECIFIER) return undefined;\n // Never during dependency SCANNING \u2014 the scanner records whatever an id\n // resolves to as a file to prebundle, and handing it a `/assets/*` URL\n // makes the boot optimizer die on ENOENT (the exact failure\n // `sharedReactPlugin` documents). Returning undefined lets the scanner\n // resolve `three` normally; because `packaged.ts` `exclude`s it from\n // optimizeDeps, the scanner externalizes it rather than prebundling a\n // second copy. `scan` is Vite's own flag on the resolve options, not part\n // of rollup's published type \u2014 hence the cast.\n if ((options as { scan?: boolean } | undefined)?.scan) return undefined;\n return url;\n },\n };\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;AA8EA,SAAS,YAAY,oBAAoB;AACzC,OAAO,UAAU;AASV,IAAM,yBAAyB;AAG/B,IAAM,0BAA0B;AAOhC,IAAM,6BAA6B;AAO1C,IAAM,iBAAiB;AAYhB,SAAS,uBAAuB,SAAyB;AAC9D,MAAI,cAA6B;AACjC,SAAO;AAAA,IACL,MAAM;AAAA,IACN,OAAO;AAAA,IACP,aAAa;AACX,oBAAc,KAAK,SAAS;AAAA,QAC1B,MAAM;AAAA,QACN,IAAI,GAAG,cAAc,GAAG,sBAAsB;AAAA,QAC9C,MAAM;AAAA;AAAA;AAAA;AAAA,QAIN,mBAAmB;AAAA,MACrB,CAAC;AAAA,IACH;AAAA,IACA,UAAU,IAAI;AACZ,aAAO,GAAG,WAAW,cAAc,IAAI,KAAK;AAAA,IAC9C;AAAA,IACA,KAAK,IAAI;AACP,UAAI,CAAC,GAAG,WAAW,cAAc,EAAG,QAAO;AAC3C,YAAM,YAAY,GAAG,MAAM,eAAe,MAAM;AAChD,aAAO,uBAAuB,WAAW,qBAAqB,SAAS,SAAS,CAAC;AAAA,IACnF;AAAA,IACA,iBAAiB;AACf,UAAI,CAAC,YAAa;AAClB,WAAK,SAAS;AAAA,QACZ,MAAM;AAAA,QACN,UAAU;AAAA,QACV,QAAQ,GAAG,KAAK;AAAA,UACd,EAAE,MAAM,KAAK,YAAY,WAAW,EAAE;AAAA,UACtC;AAAA,UACA;AAAA,QACF,CAAC;AAAA;AAAA,MACH,CAAC;AAAA,IACH;AAAA,EACF;AACF;AAIO,SAAS,wBAAwB,UAA8C;AACpF,QAAM,eAAe,KAAK,KAAK,UAAU,0BAA0B;AACnE,MAAI,CAAC,WAAW,YAAY,EAAG,QAAO;AACtC,MAAI;AACF,UAAM,WAAW,KAAK,MAAM,aAAa,cAAc,MAAM,CAAC;AAC9D,WAAO,SAAS,OAAO,WAAW;AAAA,EACpC,QAAQ;AACN,WAAO;AAAA,EACT;AACF;AAQO,SAAS,eAAe,UAA+B,OAAO,KAAa;AAChF,QAAM,SAAS,KAAK,SAAS,GAAG,IAAI,OAAO,GAAG,IAAI;AAClD,SAAO,GAAG,MAAM,GAAG,SAAS,IAAI;AAClC;AAMO,SAAS,kBAAkB,KAAqB;AACrD,SAAO;AAAA,IACL,MAAM;AAAA,IACN,SAAS;AAAA,IACT,UAAU,QAAQ,WAAW,SAAS;AACpC,UAAI,WAAW,uBAAwB,QAAO;AAS9C,UAAK,SAA4C,KAAM,QAAO;AAC9D,aAAO;AAAA,IACT;AAAA,EACF;AACF;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
// server/worktree-identity.ts
|
|
2
|
+
import { execFileSync } from "node:child_process";
|
|
3
|
+
import { createHash } from "node:crypto";
|
|
4
|
+
import { realpathSync } from "node:fs";
|
|
5
|
+
import { basename, isAbsolute, relative, resolve } from "node:path";
|
|
6
|
+
function hash(value) {
|
|
7
|
+
return createHash("sha256").update(value).digest("hex").slice(0, 24);
|
|
8
|
+
}
|
|
9
|
+
function worktreeIdForRoot(repositoryId, worktreeRoot) {
|
|
10
|
+
return `worktree-${hash(`${repositoryId}\0${canonical(worktreeRoot)}`)}`;
|
|
11
|
+
}
|
|
12
|
+
function canonical(path) {
|
|
13
|
+
try {
|
|
14
|
+
return realpathSync(path);
|
|
15
|
+
} catch {
|
|
16
|
+
return resolve(path);
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
function git(cwd, args) {
|
|
20
|
+
try {
|
|
21
|
+
const output = execFileSync("git", ["-C", cwd, ...args], {
|
|
22
|
+
encoding: "utf8",
|
|
23
|
+
stdio: ["ignore", "pipe", "ignore"]
|
|
24
|
+
}).trim();
|
|
25
|
+
return output === "" ? null : output;
|
|
26
|
+
} catch {
|
|
27
|
+
return null;
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
function resolveGitPath(worktreeRoot, rawPath) {
|
|
31
|
+
if (!rawPath) return null;
|
|
32
|
+
return canonical(isAbsolute(rawPath) ? rawPath : resolve(worktreeRoot, rawPath));
|
|
33
|
+
}
|
|
34
|
+
function defaultBaseCommit(worktreeRoot, headCommit) {
|
|
35
|
+
if (!headCommit) return null;
|
|
36
|
+
const originHead = git(worktreeRoot, ["symbolic-ref", "--quiet", "refs/remotes/origin/HEAD"]);
|
|
37
|
+
const candidates = [
|
|
38
|
+
originHead,
|
|
39
|
+
"refs/remotes/origin/main",
|
|
40
|
+
"refs/heads/main",
|
|
41
|
+
"refs/heads/master"
|
|
42
|
+
];
|
|
43
|
+
for (const candidate of candidates) {
|
|
44
|
+
if (!candidate) continue;
|
|
45
|
+
const base = git(worktreeRoot, ["merge-base", "HEAD", candidate]);
|
|
46
|
+
if (base) return base;
|
|
47
|
+
}
|
|
48
|
+
return headCommit;
|
|
49
|
+
}
|
|
50
|
+
function resolveWorktreeIdentity(projectRoot) {
|
|
51
|
+
const project = canonical(projectRoot);
|
|
52
|
+
const discoveredRoot = git(project, ["rev-parse", "--show-toplevel"]);
|
|
53
|
+
if (!discoveredRoot) {
|
|
54
|
+
const repositoryId2 = `local-${hash(project)}`;
|
|
55
|
+
return {
|
|
56
|
+
repositoryId: repositoryId2,
|
|
57
|
+
worktreeId: `worktree-${hash(`${repositoryId2}\0${project}`)}`,
|
|
58
|
+
worktreeRoot: project,
|
|
59
|
+
projectRelativePath: ".",
|
|
60
|
+
branch: null,
|
|
61
|
+
headCommit: null,
|
|
62
|
+
baseCommit: null
|
|
63
|
+
};
|
|
64
|
+
}
|
|
65
|
+
const worktreeRoot = canonical(discoveredRoot);
|
|
66
|
+
const commonDir = resolveGitPath(
|
|
67
|
+
worktreeRoot,
|
|
68
|
+
git(worktreeRoot, ["rev-parse", "--git-common-dir"])
|
|
69
|
+
);
|
|
70
|
+
const remote = git(worktreeRoot, ["config", "--get", "remote.origin.url"]);
|
|
71
|
+
const repositoryKey = remote ?? commonDir ?? worktreeRoot;
|
|
72
|
+
const repositoryId = `repository-${hash(repositoryKey)}`;
|
|
73
|
+
const branch = git(worktreeRoot, ["symbolic-ref", "--quiet", "--short", "HEAD"]);
|
|
74
|
+
const headCommit = git(worktreeRoot, ["rev-parse", "--verify", "HEAD"]);
|
|
75
|
+
const projectRelativePath = relative(worktreeRoot, project) || ".";
|
|
76
|
+
if (projectRelativePath === ".." || projectRelativePath.startsWith(`..${process.platform === "win32" ? "\\" : "/"}`)) {
|
|
77
|
+
throw new Error(`Project ${project} is outside its reported Git worktree ${worktreeRoot}.`);
|
|
78
|
+
}
|
|
79
|
+
return {
|
|
80
|
+
repositoryId,
|
|
81
|
+
worktreeId: worktreeIdForRoot(repositoryId, worktreeRoot),
|
|
82
|
+
worktreeRoot,
|
|
83
|
+
projectRelativePath,
|
|
84
|
+
branch,
|
|
85
|
+
headCommit,
|
|
86
|
+
baseCommit: defaultBaseCommit(worktreeRoot, headCommit)
|
|
87
|
+
};
|
|
88
|
+
}
|
|
89
|
+
function worktreeName(identity) {
|
|
90
|
+
return identity.branch ?? (basename(identity.worktreeRoot) || "detached");
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
export {
|
|
94
|
+
worktreeIdForRoot,
|
|
95
|
+
resolveWorktreeIdentity,
|
|
96
|
+
worktreeName
|
|
97
|
+
};
|
|
98
|
+
//# sourceMappingURL=chunk-KMJC7AGO.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../server/worktree-identity.ts"],
|
|
4
|
+
"sourcesContent": ["import { execFileSync } from 'node:child_process';\nimport { createHash } from 'node:crypto';\nimport { realpathSync } from 'node:fs';\nimport { basename, isAbsolute, relative, resolve } from 'node:path';\n\nexport interface WorktreeIdentity {\n repositoryId: string;\n worktreeId: string;\n worktreeRoot: string;\n projectRelativePath: string;\n branch: string | null;\n headCommit: string | null;\n baseCommit: string | null;\n}\n\nfunction hash(value: string): string {\n return createHash('sha256').update(value).digest('hex').slice(0, 24);\n}\n\nexport function worktreeIdForRoot(repositoryId: string, worktreeRoot: string): string {\n return `worktree-${hash(`${repositoryId}\\0${canonical(worktreeRoot)}`)}`;\n}\n\nfunction canonical(path: string): string {\n try {\n return realpathSync(path);\n } catch {\n return resolve(path);\n }\n}\n\nfunction git(cwd: string, args: readonly string[]): string | null {\n try {\n const output = execFileSync('git', ['-C', cwd, ...args], {\n encoding: 'utf8',\n stdio: ['ignore', 'pipe', 'ignore'],\n }).trim();\n return output === '' ? null : output;\n } catch {\n return null;\n }\n}\n\nfunction resolveGitPath(worktreeRoot: string, rawPath: string | null): string | null {\n if (!rawPath) return null;\n return canonical(isAbsolute(rawPath) ? rawPath : resolve(worktreeRoot, rawPath));\n}\n\nfunction defaultBaseCommit(worktreeRoot: string, headCommit: string | null): string | null {\n if (!headCommit) return null;\n const originHead = git(worktreeRoot, ['symbolic-ref', '--quiet', 'refs/remotes/origin/HEAD']);\n const candidates = [\n originHead,\n 'refs/remotes/origin/main',\n 'refs/heads/main',\n 'refs/heads/master',\n ];\n for (const candidate of candidates) {\n if (!candidate) continue;\n const base = git(worktreeRoot, ['merge-base', 'HEAD', candidate]);\n if (base) return base;\n }\n return headCommit;\n}\n\n/**\n * Resolve the Git/materialization identity for a project. A project outside\n * Git still gets an honest local repository/worktree identity rooted at the\n * project, but carries no branch or commits.\n */\nexport function resolveWorktreeIdentity(projectRoot: string): WorktreeIdentity {\n const project = canonical(projectRoot);\n const discoveredRoot = git(project, ['rev-parse', '--show-toplevel']);\n if (!discoveredRoot) {\n const repositoryId = `local-${hash(project)}`;\n return {\n repositoryId,\n worktreeId: `worktree-${hash(`${repositoryId}\\0${project}`)}`,\n worktreeRoot: project,\n projectRelativePath: '.',\n branch: null,\n headCommit: null,\n baseCommit: null,\n };\n }\n\n const worktreeRoot = canonical(discoveredRoot);\n const commonDir = resolveGitPath(\n worktreeRoot,\n git(worktreeRoot, ['rev-parse', '--git-common-dir']),\n );\n const remote = git(worktreeRoot, ['config', '--get', 'remote.origin.url']);\n const repositoryKey = remote ?? commonDir ?? worktreeRoot;\n const repositoryId = `repository-${hash(repositoryKey)}`;\n const branch = git(worktreeRoot, ['symbolic-ref', '--quiet', '--short', 'HEAD']);\n const headCommit = git(worktreeRoot, ['rev-parse', '--verify', 'HEAD']);\n const projectRelativePath = relative(worktreeRoot, project) || '.';\n\n if (\n projectRelativePath === '..' ||\n projectRelativePath.startsWith(`..${process.platform === 'win32' ? '\\\\' : '/'}`)\n ) {\n throw new Error(`Project ${project} is outside its reported Git worktree ${worktreeRoot}.`);\n }\n\n return {\n repositoryId,\n worktreeId: worktreeIdForRoot(repositoryId, worktreeRoot),\n worktreeRoot,\n projectRelativePath,\n branch,\n headCommit,\n baseCommit: defaultBaseCommit(worktreeRoot, headCommit),\n };\n}\n\n/** Git's main-worktree `--git-dir` is `<root>/.git`; linked worktrees use a\n * common-dir child. Kept exported for focused identity tests. */\nexport function worktreeName(identity: WorktreeIdentity): string {\n return identity.branch ?? (basename(identity.worktreeRoot) || 'detached');\n}\n"],
|
|
5
|
+
"mappings": ";AAAA,SAAS,oBAAoB;AAC7B,SAAS,kBAAkB;AAC3B,SAAS,oBAAoB;AAC7B,SAAS,UAAU,YAAY,UAAU,eAAe;AAYxD,SAAS,KAAK,OAAuB;AACnC,SAAO,WAAW,QAAQ,EAAE,OAAO,KAAK,EAAE,OAAO,KAAK,EAAE,MAAM,GAAG,EAAE;AACrE;AAEO,SAAS,kBAAkB,cAAsB,cAA8B;AACpF,SAAO,YAAY,KAAK,GAAG,YAAY,KAAK,UAAU,YAAY,CAAC,EAAE,CAAC;AACxE;AAEA,SAAS,UAAU,MAAsB;AACvC,MAAI;AACF,WAAO,aAAa,IAAI;AAAA,EAC1B,QAAQ;AACN,WAAO,QAAQ,IAAI;AAAA,EACrB;AACF;AAEA,SAAS,IAAI,KAAa,MAAwC;AAChE,MAAI;AACF,UAAM,SAAS,aAAa,OAAO,CAAC,MAAM,KAAK,GAAG,IAAI,GAAG;AAAA,MACvD,UAAU;AAAA,MACV,OAAO,CAAC,UAAU,QAAQ,QAAQ;AAAA,IACpC,CAAC,EAAE,KAAK;AACR,WAAO,WAAW,KAAK,OAAO;AAAA,EAChC,QAAQ;AACN,WAAO;AAAA,EACT;AACF;AAEA,SAAS,eAAe,cAAsB,SAAuC;AACnF,MAAI,CAAC,QAAS,QAAO;AACrB,SAAO,UAAU,WAAW,OAAO,IAAI,UAAU,QAAQ,cAAc,OAAO,CAAC;AACjF;AAEA,SAAS,kBAAkB,cAAsB,YAA0C;AACzF,MAAI,CAAC,WAAY,QAAO;AACxB,QAAM,aAAa,IAAI,cAAc,CAAC,gBAAgB,WAAW,0BAA0B,CAAC;AAC5F,QAAM,aAAa;AAAA,IACjB;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF;AACA,aAAW,aAAa,YAAY;AAClC,QAAI,CAAC,UAAW;AAChB,UAAM,OAAO,IAAI,cAAc,CAAC,cAAc,QAAQ,SAAS,CAAC;AAChE,QAAI,KAAM,QAAO;AAAA,EACnB;AACA,SAAO;AACT;AAOO,SAAS,wBAAwB,aAAuC;AAC7E,QAAM,UAAU,UAAU,WAAW;AACrC,QAAM,iBAAiB,IAAI,SAAS,CAAC,aAAa,iBAAiB,CAAC;AACpE,MAAI,CAAC,gBAAgB;AACnB,UAAMA,gBAAe,SAAS,KAAK,OAAO,CAAC;AAC3C,WAAO;AAAA,MACL,cAAAA;AAAA,MACA,YAAY,YAAY,KAAK,GAAGA,aAAY,KAAK,OAAO,EAAE,CAAC;AAAA,MAC3D,cAAc;AAAA,MACd,qBAAqB;AAAA,MACrB,QAAQ;AAAA,MACR,YAAY;AAAA,MACZ,YAAY;AAAA,IACd;AAAA,EACF;AAEA,QAAM,eAAe,UAAU,cAAc;AAC7C,QAAM,YAAY;AAAA,IAChB;AAAA,IACA,IAAI,cAAc,CAAC,aAAa,kBAAkB,CAAC;AAAA,EACrD;AACA,QAAM,SAAS,IAAI,cAAc,CAAC,UAAU,SAAS,mBAAmB,CAAC;AACzE,QAAM,gBAAgB,UAAU,aAAa;AAC7C,QAAM,eAAe,cAAc,KAAK,aAAa,CAAC;AACtD,QAAM,SAAS,IAAI,cAAc,CAAC,gBAAgB,WAAW,WAAW,MAAM,CAAC;AAC/E,QAAM,aAAa,IAAI,cAAc,CAAC,aAAa,YAAY,MAAM,CAAC;AACtE,QAAM,sBAAsB,SAAS,cAAc,OAAO,KAAK;AAE/D,MACE,wBAAwB,QACxB,oBAAoB,WAAW,KAAK,QAAQ,aAAa,UAAU,OAAO,GAAG,EAAE,GAC/E;AACA,UAAM,IAAI,MAAM,WAAW,OAAO,yCAAyC,YAAY,GAAG;AAAA,EAC5F;AAEA,SAAO;AAAA,IACL;AAAA,IACA,YAAY,kBAAkB,cAAc,YAAY;AAAA,IACxD;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA,YAAY,kBAAkB,cAAc,UAAU;AAAA,EACxD;AACF;AAIO,SAAS,aAAa,UAAoC;AAC/D,SAAO,SAAS,WAAW,SAAS,SAAS,YAAY,KAAK;AAChE;",
|
|
6
|
+
"names": ["repositoryId"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
// server/spawn-opener.ts
|
|
2
|
+
import { spawn } from "node:child_process";
|
|
3
|
+
var OPENER_STDERR_CAP_BYTES = 2048;
|
|
4
|
+
var OPENER_EXIT_WATCH_TIMEOUT_MS = 2e4;
|
|
5
|
+
function spawnOpener(cmd, cmdArgs, fallback) {
|
|
6
|
+
let child;
|
|
7
|
+
try {
|
|
8
|
+
child = spawn(cmd, cmdArgs, { stdio: ["ignore", "ignore", "pipe"], detached: true });
|
|
9
|
+
} catch (err) {
|
|
10
|
+
console.error(`vgai: auto-open via ${cmd} failed: ${err.message}`);
|
|
11
|
+
fallback?.();
|
|
12
|
+
return;
|
|
13
|
+
}
|
|
14
|
+
const stderrChunks = [];
|
|
15
|
+
let stderrBytes = 0;
|
|
16
|
+
child.stderr?.on("data", (chunk) => {
|
|
17
|
+
if (stderrBytes >= OPENER_STDERR_CAP_BYTES) return;
|
|
18
|
+
const remaining = OPENER_STDERR_CAP_BYTES - stderrBytes;
|
|
19
|
+
const slice = chunk.length > remaining ? chunk.subarray(0, remaining) : chunk;
|
|
20
|
+
stderrChunks.push(slice);
|
|
21
|
+
stderrBytes += slice.length;
|
|
22
|
+
});
|
|
23
|
+
child.on("error", (err) => {
|
|
24
|
+
console.error(`vgai: auto-open via ${cmd} failed to launch: ${err.message}`);
|
|
25
|
+
fallback?.();
|
|
26
|
+
});
|
|
27
|
+
child.on("exit", (code) => {
|
|
28
|
+
if (code !== null && code !== 0) {
|
|
29
|
+
const stderr = Buffer.concat(stderrChunks).toString("utf8").trim();
|
|
30
|
+
console.error(`vgai: auto-open via ${cmd} exited ${code}: ${stderr}`);
|
|
31
|
+
fallback?.();
|
|
32
|
+
}
|
|
33
|
+
});
|
|
34
|
+
child.unref();
|
|
35
|
+
const pipeTimeout = setTimeout(() => {
|
|
36
|
+
child.stderr?.destroy();
|
|
37
|
+
}, OPENER_EXIT_WATCH_TIMEOUT_MS);
|
|
38
|
+
pipeTimeout.unref();
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
export {
|
|
42
|
+
OPENER_STDERR_CAP_BYTES,
|
|
43
|
+
OPENER_EXIT_WATCH_TIMEOUT_MS,
|
|
44
|
+
spawnOpener
|
|
45
|
+
};
|
|
46
|
+
//# sourceMappingURL=chunk-PSILUMGS.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../server/spawn-opener.ts"],
|
|
4
|
+
"sourcesContent": ["/**\n * Best-effort launch of an OS \"open a URL\" command (`open`, `cmd /c start`,\n * `powershell.exe Start-Process`, `xdg-open`, \u2026), extracted from\n * `index.ts`'s `openBrowser` into its own module so it's unit-testable\n * against a REAL spawned child (see `spawn-opener.test.ts`) without pulling\n * in the whole CLI entry point.\n */\n\nimport { type ChildProcess, spawn } from 'node:child_process';\n\n/** Cap on how much of a failed opener's stderr we buffer before printing \u2014\n * enough for a real error message, small enough to never matter for a\n * detached fire-and-forget child. */\nexport const OPENER_STDERR_CAP_BYTES = 2048;\n\n/** An unref'd child's piped stderr only stays readable for as long as THIS\n * process's event loop keeps ticking \u2014 normally guaranteed by the caller's\n * verified-open poll (>=15s, see waitForVerifiedEditorOpen). Belt-and-\n * suspenders bound so a genuinely long-lived/never-exiting opener can't\n * hold the pipe (and this process) open indefinitely if the parent exits\n * on its own first. */\nexport const OPENER_EXIT_WATCH_TIMEOUT_MS = 20_000;\n\n/** Fire one open attempt, NAMING the failure instead of swallowing it.\n * Two failure modes, both silent before this fix:\n * - meteor-dodge dry-run friction #1: the powershell.exe hand-off died\n * silently in a background shell \u2014 spawn launch failures arrive on the\n * child's 'error' event, which nothing listened to.\n * - run-3 dogfood friction #3: a child that LAUNCHES but exits nonzero\n * (e.g. Start-Process itself failing inside powershell) was silent too \u2014\n * stdio was fully 'ignore'd and nothing checked the exit code.\n * Still best-effort: a failure logs one line (stderr captured, capped, and\n * included when available) and runs `fallback`, if given \u2014 never throws,\n * never blocks. */\nexport function spawnOpener(cmd: string, cmdArgs: string[], fallback?: () => void): void {\n let child: ChildProcess;\n try {\n child = spawn(cmd, cmdArgs, { stdio: ['ignore', 'ignore', 'pipe'], detached: true });\n } catch (err) {\n console.error(`vgai: auto-open via ${cmd} failed: ${(err as Error).message}`);\n fallback?.();\n return;\n }\n\n const stderrChunks: Buffer[] = [];\n let stderrBytes = 0;\n child.stderr?.on('data', (chunk: Buffer) => {\n if (stderrBytes >= OPENER_STDERR_CAP_BYTES) return;\n const remaining = OPENER_STDERR_CAP_BYTES - stderrBytes;\n const slice = chunk.length > remaining ? chunk.subarray(0, remaining) : chunk;\n stderrChunks.push(slice);\n stderrBytes += slice.length;\n });\n\n child.on('error', (err) => {\n console.error(`vgai: auto-open via ${cmd} failed to launch: ${err.message}`);\n fallback?.();\n });\n\n child.on('exit', (code) => {\n if (code !== null && code !== 0) {\n const stderr = Buffer.concat(stderrChunks).toString('utf8').trim();\n console.error(`vgai: auto-open via ${cmd} exited ${code}: ${stderr}`);\n fallback?.();\n }\n });\n\n child.unref();\n\n const pipeTimeout = setTimeout(() => {\n child.stderr?.destroy();\n }, OPENER_EXIT_WATCH_TIMEOUT_MS);\n pipeTimeout.unref();\n}\n"],
|
|
5
|
+
"mappings": ";AAQA,SAA4B,aAAa;AAKlC,IAAM,0BAA0B;AAQhC,IAAM,+BAA+B;AAarC,SAAS,YAAY,KAAa,SAAmB,UAA6B;AACvF,MAAI;AACJ,MAAI;AACF,YAAQ,MAAM,KAAK,SAAS,EAAE,OAAO,CAAC,UAAU,UAAU,MAAM,GAAG,UAAU,KAAK,CAAC;AAAA,EACrF,SAAS,KAAK;AACZ,YAAQ,MAAM,uBAAuB,GAAG,YAAa,IAAc,OAAO,EAAE;AAC5E,eAAW;AACX;AAAA,EACF;AAEA,QAAM,eAAyB,CAAC;AAChC,MAAI,cAAc;AAClB,QAAM,QAAQ,GAAG,QAAQ,CAAC,UAAkB;AAC1C,QAAI,eAAe,wBAAyB;AAC5C,UAAM,YAAY,0BAA0B;AAC5C,UAAM,QAAQ,MAAM,SAAS,YAAY,MAAM,SAAS,GAAG,SAAS,IAAI;AACxE,iBAAa,KAAK,KAAK;AACvB,mBAAe,MAAM;AAAA,EACvB,CAAC;AAED,QAAM,GAAG,SAAS,CAAC,QAAQ;AACzB,YAAQ,MAAM,uBAAuB,GAAG,sBAAsB,IAAI,OAAO,EAAE;AAC3E,eAAW;AAAA,EACb,CAAC;AAED,QAAM,GAAG,QAAQ,CAAC,SAAS;AACzB,QAAI,SAAS,QAAQ,SAAS,GAAG;AAC/B,YAAM,SAAS,OAAO,OAAO,YAAY,EAAE,SAAS,MAAM,EAAE,KAAK;AACjE,cAAQ,MAAM,uBAAuB,GAAG,WAAW,IAAI,KAAK,MAAM,EAAE;AACpE,iBAAW;AAAA,IACb;AAAA,EACF,CAAC;AAED,QAAM,MAAM;AAEZ,QAAM,cAAc,WAAW,MAAM;AACnC,UAAM,QAAQ,QAAQ;AAAA,EACxB,GAAG,4BAA4B;AAC/B,cAAY,MAAM;AACpB;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,255 @@
|
|
|
1
|
+
// server/frame-proxy.ts
|
|
2
|
+
import {
|
|
3
|
+
createServer,
|
|
4
|
+
request as httpRequest
|
|
5
|
+
} from "node:http";
|
|
6
|
+
import { connect as netConnect } from "node:net";
|
|
7
|
+
import { basename } from "node:path";
|
|
8
|
+
import { pipeline } from "node:stream/promises";
|
|
9
|
+
import { createBrotliCompress, createGzip, constants as zlibConstants } from "node:zlib";
|
|
10
|
+
var VSCODE_PATH_BASE = "^\\/$|^\\/(static|favicon|manifest\\.json|code-192|code-512|callback|oauth|out|extensions|builtin|remote|vscode-remote|_static|web-extension|version|delay-shutdown)";
|
|
11
|
+
var COMPRESSIBLE = /^(?:text\/|application\/(?:javascript|json|wasm|manifest\+json)|image\/svg\+xml)/;
|
|
12
|
+
var decodeAttr = (value) => value.replaceAll(""", '"').replaceAll("'", "'").replaceAll("<", "<").replaceAll(">", ">").replaceAll("&", "&");
|
|
13
|
+
var encodeAttr = (value) => value.replaceAll("&", "&").replaceAll('"', """).replaceAll("'", "'").replaceAll("<", "<").replaceAll(">", ">");
|
|
14
|
+
function negotiateEncoding(header) {
|
|
15
|
+
const accepted = (Array.isArray(header) ? header.join(",") : header ?? "").toLowerCase();
|
|
16
|
+
if (accepted.includes("br")) return "br";
|
|
17
|
+
if (accepted.includes("gzip")) return "gzip";
|
|
18
|
+
return null;
|
|
19
|
+
}
|
|
20
|
+
function compressor(encoding) {
|
|
21
|
+
return encoding === "br" ? createBrotliCompress({ params: { [zlibConstants.BROTLI_PARAM_QUALITY]: 5 } }) : createGzip({ level: 6 });
|
|
22
|
+
}
|
|
23
|
+
async function startFrameProxy(options) {
|
|
24
|
+
const { port, upstreamPort, sessionPort, projectRoot, colorTheme, log } = options;
|
|
25
|
+
const upstream = { host: "127.0.0.1", port: upstreamPort };
|
|
26
|
+
const session = { host: "127.0.0.1", port: sessionPort };
|
|
27
|
+
const upstreamOrigin = `http://${upstream.host}:${upstream.port}`;
|
|
28
|
+
const selfOrigin = `http://127.0.0.1:${port}`;
|
|
29
|
+
const webviewOriginTemplate = `http://{{uuid}}.localhost:${port}`;
|
|
30
|
+
const webviewOriginPattern = `http://*.localhost:${port}`;
|
|
31
|
+
const projectId = basename(projectRoot);
|
|
32
|
+
const isolation = {
|
|
33
|
+
"Cross-Origin-Opener-Policy": "same-origin",
|
|
34
|
+
"Cross-Origin-Embedder-Policy": "credentialless",
|
|
35
|
+
"Cross-Origin-Resource-Policy": "cross-origin"
|
|
36
|
+
};
|
|
37
|
+
let vscodePath = new RegExp(VSCODE_PATH_BASE);
|
|
38
|
+
const colorSchemeMeta = (html) => colorTheme === null ? html : html.replace("<head>", `<head>
|
|
39
|
+
<meta name="color-scheme" content="${colorTheme}">`);
|
|
40
|
+
const patchWorkbenchConfig = (html) => {
|
|
41
|
+
const webBaseUrl = html.match(/id="vscode-workbench-web-base-url" data-settings="([^"]*)"/)?.[1] ?? "/static";
|
|
42
|
+
return html.replace(
|
|
43
|
+
/(id="vscode-workbench-web-configuration" data-settings=")([^"]*)(")/,
|
|
44
|
+
(_all, head, value, tail) => {
|
|
45
|
+
const config = JSON.parse(decodeAttr(value));
|
|
46
|
+
config["webviewEndpoint"] = `${webviewOriginTemplate}${decodeAttr(webBaseUrl)}/out/vs/workbench/contrib/webview/browser/pre/`;
|
|
47
|
+
if (colorTheme !== null) config["initialColorTheme"] = { themeType: colorTheme };
|
|
48
|
+
return head + encodeAttr(JSON.stringify(config)) + tail;
|
|
49
|
+
}
|
|
50
|
+
);
|
|
51
|
+
};
|
|
52
|
+
const sendText = (res, status, body, type) => {
|
|
53
|
+
res.writeHead(status, { ...isolation, "content-type": type, "cache-control": "no-store" });
|
|
54
|
+
res.end(body);
|
|
55
|
+
};
|
|
56
|
+
const refuseProject = (res, id) => {
|
|
57
|
+
sendText(
|
|
58
|
+
res,
|
|
59
|
+
404,
|
|
60
|
+
`<!doctype html><meta charset="utf-8"><title>no such project</title><body style="font:14px system-ui;padding:2rem"><h1>No project "${encodeAttr(id)}" is open here.</h1><p>This workbench is the session for <code>${encodeAttr(projectRoot)}</code>, whose id is <code>${encodeAttr(projectId)}</code>.</p>`,
|
|
61
|
+
"text/html; charset=utf-8"
|
|
62
|
+
);
|
|
63
|
+
};
|
|
64
|
+
const handleRequest = (req, res) => {
|
|
65
|
+
const url = new URL(req.url ?? "/", selfOrigin);
|
|
66
|
+
const pathname = url.pathname;
|
|
67
|
+
if (pathname === "/") {
|
|
68
|
+
const id = url.searchParams.get("project");
|
|
69
|
+
if (id && !url.searchParams.has("folder") && !url.searchParams.has("workspace")) {
|
|
70
|
+
if (id !== projectId) {
|
|
71
|
+
refuseProject(res, id);
|
|
72
|
+
return;
|
|
73
|
+
}
|
|
74
|
+
const next = new URL(url);
|
|
75
|
+
next.searchParams.delete("project");
|
|
76
|
+
next.searchParams.set("folder", projectRoot);
|
|
77
|
+
res.writeHead(302, {
|
|
78
|
+
...isolation,
|
|
79
|
+
location: `${next.pathname}${next.search}`,
|
|
80
|
+
"cache-control": "no-store"
|
|
81
|
+
});
|
|
82
|
+
res.end();
|
|
83
|
+
return;
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
const target = vscodePath.test(pathname) ? upstream : session;
|
|
87
|
+
const encoding = negotiateEncoding(req.headers["accept-encoding"]);
|
|
88
|
+
const forward = httpRequest(
|
|
89
|
+
{ ...target, method: req.method, path: req.url, headers: req.headers },
|
|
90
|
+
(answer) => {
|
|
91
|
+
const headers = {};
|
|
92
|
+
for (const [key, value] of Object.entries(answer.headers)) {
|
|
93
|
+
if (value !== void 0) headers[key] = value;
|
|
94
|
+
}
|
|
95
|
+
delete headers["cross-origin-opener-policy"];
|
|
96
|
+
delete headers["cross-origin-embedder-policy"];
|
|
97
|
+
delete headers["cross-origin-resource-policy"];
|
|
98
|
+
const csp = headers["content-security-policy"];
|
|
99
|
+
if (typeof csp === "string" && csp.includes("frame-src")) {
|
|
100
|
+
headers["content-security-policy"] = csp.replace(/frame-src([^;]*)/, `frame-src$1 ${webviewOriginPattern}`).replace(/connect-src([^;]*)/, "connect-src$1 blob:").replace(/media-src([^;]*)/, "media-src$1 blob:");
|
|
101
|
+
}
|
|
102
|
+
const type = String(headers["content-type"] ?? "");
|
|
103
|
+
const alreadyEncoded = headers["content-encoding"] !== void 0;
|
|
104
|
+
if (/text\/html|javascript|json/.test(type) && !alreadyEncoded) {
|
|
105
|
+
const chunks = [];
|
|
106
|
+
answer.on("data", (chunk) => chunks.push(chunk));
|
|
107
|
+
answer.on("end", () => {
|
|
108
|
+
let body = Buffer.concat(chunks).toString("utf8").replaceAll(upstreamOrigin, selfOrigin);
|
|
109
|
+
if (pathname === "/" && target === upstream && /text\/html/.test(type)) {
|
|
110
|
+
body = colorSchemeMeta(patchWorkbenchConfig(body));
|
|
111
|
+
}
|
|
112
|
+
delete headers["content-length"];
|
|
113
|
+
const raw = Buffer.from(body, "utf8");
|
|
114
|
+
if (encoding === null) {
|
|
115
|
+
res.writeHead(answer.statusCode ?? 502, {
|
|
116
|
+
...headers,
|
|
117
|
+
...isolation,
|
|
118
|
+
"content-length": raw.byteLength
|
|
119
|
+
});
|
|
120
|
+
res.end(raw);
|
|
121
|
+
return;
|
|
122
|
+
}
|
|
123
|
+
res.writeHead(answer.statusCode ?? 502, {
|
|
124
|
+
...headers,
|
|
125
|
+
...isolation,
|
|
126
|
+
"content-encoding": encoding,
|
|
127
|
+
vary: "accept-encoding"
|
|
128
|
+
});
|
|
129
|
+
const stream = compressor(encoding);
|
|
130
|
+
stream.pipe(res);
|
|
131
|
+
stream.end(raw);
|
|
132
|
+
});
|
|
133
|
+
return;
|
|
134
|
+
}
|
|
135
|
+
if (encoding !== null && !alreadyEncoded && COMPRESSIBLE.test(type)) {
|
|
136
|
+
delete headers["content-length"];
|
|
137
|
+
res.writeHead(answer.statusCode ?? 502, {
|
|
138
|
+
...headers,
|
|
139
|
+
...isolation,
|
|
140
|
+
"content-encoding": encoding,
|
|
141
|
+
vary: "accept-encoding"
|
|
142
|
+
});
|
|
143
|
+
void pipeline(answer, compressor(encoding), res).catch(() => res.destroy());
|
|
144
|
+
return;
|
|
145
|
+
}
|
|
146
|
+
res.writeHead(answer.statusCode ?? 502, { ...headers, ...isolation });
|
|
147
|
+
answer.pipe(res);
|
|
148
|
+
}
|
|
149
|
+
);
|
|
150
|
+
forward.on("error", (error) => {
|
|
151
|
+
if (!res.headersSent) {
|
|
152
|
+
sendText(
|
|
153
|
+
res,
|
|
154
|
+
502,
|
|
155
|
+
`upstream ${target.port}: ${error.message}`,
|
|
156
|
+
"text/plain; charset=utf-8"
|
|
157
|
+
);
|
|
158
|
+
} else res.destroy();
|
|
159
|
+
});
|
|
160
|
+
res.on("close", () => forward.destroy());
|
|
161
|
+
req.pipe(forward);
|
|
162
|
+
};
|
|
163
|
+
const handleUpgrade = (req, socket, head) => {
|
|
164
|
+
const target = vscodePath.test(new URL(req.url ?? "/", selfOrigin).pathname) ? upstream : session;
|
|
165
|
+
const proxied = netConnect(target.port, target.host, () => {
|
|
166
|
+
proxied.write(
|
|
167
|
+
`${req.method} ${req.url} HTTP/${req.httpVersion}\r
|
|
168
|
+
` + Object.entries(req.headers).map(([key, value]) => `${key}: ${Array.isArray(value) ? value.join(", ") : value}`).join("\r\n") + "\r\n\r\n"
|
|
169
|
+
);
|
|
170
|
+
if (head.length) proxied.write(head);
|
|
171
|
+
socket.pipe(proxied).pipe(socket);
|
|
172
|
+
});
|
|
173
|
+
proxied.on("error", () => socket.destroy());
|
|
174
|
+
socket.on("error", () => proxied.destroy());
|
|
175
|
+
};
|
|
176
|
+
const discoverUpstream = () => new Promise((done) => {
|
|
177
|
+
const probe = httpRequest({ ...upstream, path: "/" }, (answer) => {
|
|
178
|
+
const chunks = [];
|
|
179
|
+
answer.on("data", (chunk) => chunks.push(chunk));
|
|
180
|
+
answer.on("end", () => {
|
|
181
|
+
const html = Buffer.concat(chunks).toString("utf8");
|
|
182
|
+
const base = html.match(
|
|
183
|
+
/id="vscode-workbench-web-base-url" data-settings="([^"]*)"/
|
|
184
|
+
)?.[1];
|
|
185
|
+
done(answer.statusCode === 200 && base ? decodeAttr(base).replace(/\/static\/?$/, "") : null);
|
|
186
|
+
});
|
|
187
|
+
});
|
|
188
|
+
probe.on("error", () => done(null));
|
|
189
|
+
probe.setTimeout(3e3, () => {
|
|
190
|
+
probe.destroy();
|
|
191
|
+
done(null);
|
|
192
|
+
});
|
|
193
|
+
probe.end();
|
|
194
|
+
});
|
|
195
|
+
const discoveryDeadline = Date.now() + 3e4;
|
|
196
|
+
let segment = null;
|
|
197
|
+
do {
|
|
198
|
+
segment = await discoverUpstream();
|
|
199
|
+
if (segment !== null) break;
|
|
200
|
+
await new Promise((resolve) => setTimeout(resolve, 100));
|
|
201
|
+
} while (Date.now() < discoveryDeadline);
|
|
202
|
+
if (segment === null) throw new Error(
|
|
203
|
+
`Code-OSS on port ${upstream.port} did not report its workbench asset base within 30s; refusing to start an incorrectly routed proxy.`
|
|
204
|
+
);
|
|
205
|
+
if (segment) {
|
|
206
|
+
vscodePath = new RegExp(
|
|
207
|
+
`${VSCODE_PATH_BASE}|^${segment.replace(/[.*+?^${}()|[\]\\]/g, "\\$&")}(\\/|$)`
|
|
208
|
+
);
|
|
209
|
+
log(`frame: workbench product segment ${segment}`);
|
|
210
|
+
}
|
|
211
|
+
const servers = [];
|
|
212
|
+
await new Promise((ready, failed) => {
|
|
213
|
+
let settled = false;
|
|
214
|
+
for (const host of ["127.0.0.1", "::1"]) {
|
|
215
|
+
const one = createServer(handleRequest);
|
|
216
|
+
one.on("upgrade", handleUpgrade);
|
|
217
|
+
one.on("error", (error) => {
|
|
218
|
+
if (host === "::1") {
|
|
219
|
+
log(
|
|
220
|
+
`frame: no IPv6 loopback listener (${error.message}); webviews need one if the browser resolves *.localhost to ::1`
|
|
221
|
+
);
|
|
222
|
+
return;
|
|
223
|
+
}
|
|
224
|
+
if (!settled) {
|
|
225
|
+
settled = true;
|
|
226
|
+
failed(error);
|
|
227
|
+
}
|
|
228
|
+
});
|
|
229
|
+
servers.push(one);
|
|
230
|
+
one.listen(port, host, () => {
|
|
231
|
+
if (!settled) {
|
|
232
|
+
settled = true;
|
|
233
|
+
ready();
|
|
234
|
+
}
|
|
235
|
+
});
|
|
236
|
+
}
|
|
237
|
+
});
|
|
238
|
+
return {
|
|
239
|
+
url: `${selfOrigin}/?project=${encodeURIComponent(projectId)}`,
|
|
240
|
+
close: async () => {
|
|
241
|
+
await Promise.all(
|
|
242
|
+
servers.map(
|
|
243
|
+
(one) => new Promise((done) => {
|
|
244
|
+
one.close(() => done());
|
|
245
|
+
one.closeAllConnections?.();
|
|
246
|
+
})
|
|
247
|
+
)
|
|
248
|
+
);
|
|
249
|
+
}
|
|
250
|
+
};
|
|
251
|
+
}
|
|
252
|
+
export {
|
|
253
|
+
startFrameProxy
|
|
254
|
+
};
|
|
255
|
+
//# sourceMappingURL=frame-proxy.js.map
|