@volter/game-editor 0.5.68 → 0.5.69

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.
Files changed (548) hide show
  1. package/BUNDLED_NOTICES +10954 -5077
  2. package/LICENSE +1 -1
  3. package/LICENSE-BLENDER +2 -2
  4. package/NOTICE +2 -2
  5. package/additions/canvas/package.json +8 -0
  6. package/additions/canvas/src/canvas-mount.ts +46 -0
  7. package/additions/canvas/src/scene2d.tsx +18 -0
  8. package/catalog/entries/bake.json +1 -1
  9. package/catalog/entries/blender.json +3 -3
  10. package/catalog/entries/music.json +5 -5
  11. package/catalog/project-source/LICENSE +1 -1
  12. package/catalog/project-source/src/contributions/bake.kind.ts +2 -2
  13. package/catalog/project-source/src/contributions/builder-document.tsx +1 -1
  14. package/catalog/project-source/src/contributions/builder-ui.tsx +3 -3
  15. package/catalog/project-source/src/contributions/module-source.ts +4 -4
  16. package/catalog/project-source/src/lib/reflections/volume-reflection-material.ts +59 -59
  17. package/catalog/project-source/src/lib/static-batch/Frozen.tsx +1 -1
  18. package/catalog/project-source/src/lib/static-batch/mutation-watch.ts +1 -1
  19. package/catalog/project-source/src/tools/bake-preview.tool.ts +9 -9
  20. package/dist/.vite/manifest.json +3999 -3999
  21. package/dist/assets/{AssetBudgetPanel-P2PeL_X5.js → AssetBudgetPanel-BMR3AQhc.js} +4 -4
  22. package/dist/assets/AudioViewer-DESxi7pU.js +1 -0
  23. package/dist/assets/{CanvasBoardDocument-BFJdTVGp.js → CanvasBoardDocument-Q_nrYFlB.js} +1 -1
  24. package/dist/assets/CanvasSceneViewport-WZMoKy_F.js +1 -0
  25. package/dist/assets/ColorInput-C2EK-OnD.js +1 -0
  26. package/dist/assets/{EntityModelDocument-Du8wIbyK.js → EntityModelDocument-B_4ENTCq.js} +1 -1
  27. package/dist/assets/{EnvironmentAssetDocument-_SttfMY_.js → EnvironmentAssetDocument-BZBp6OFJ.js} +1 -1
  28. package/dist/assets/{GameplaySessionTimeline-CWudWnfd.js → GameplaySessionTimeline-1ivaucpv.js} +1 -1
  29. package/dist/assets/ImageViewer-D16OExYu.js +1 -0
  30. package/dist/assets/{InspectorCanvasPreview-CEr_Kxna.js → InspectorCanvasPreview-BrFjhoiD.js} +1 -1
  31. package/dist/assets/InspectorObjectPreview-CY5xVsPR.js +1 -0
  32. package/dist/assets/JsonAssetDocument-CvjTlcdr.js +2 -0
  33. package/dist/assets/{LiveModuleDocument-BWjOzO_6.js → LiveModuleDocument-ne1o9giX.js} +1 -1
  34. package/dist/assets/{LutAssetDocument-DIc6nsht.js → LutAssetDocument-Cp0v-O7q.js} +1 -1
  35. package/dist/assets/{ModelAssetDocument-_CqTsX_A.js → ModelAssetDocument-Ceu7OIN9.js} +1 -1
  36. package/dist/assets/{NonThreeAuthoringBootstrap-C-V23E1e.js → NonThreeAuthoringBootstrap-DiElZf-e.js} +1 -1
  37. package/dist/assets/Object3DDocumentToolbar-BLNamqii.js +1 -0
  38. package/dist/assets/Object3DDocumentViewport-D6QoHfa_.js +2 -0
  39. package/dist/assets/{Object3DPreview-BPHEr3vI.js → Object3DPreview-ZVokr044.js} +1 -1
  40. package/dist/assets/OnlineAssetDetail-Dnckd7zB.js +1 -0
  41. package/dist/assets/PlayBar-DsMitSgy.js +1 -0
  42. package/dist/assets/{QuarksAssetDocument-4Dne3EHx.js → QuarksAssetDocument-B5J8uHFM.js} +1 -1
  43. package/dist/assets/ReactCanvasControls-CmfvxJYY.js +1 -0
  44. package/dist/assets/RootSelectionOverlay-BWsNiSuM.js +1 -0
  45. package/dist/assets/{ShaderAssetDocument-W3ZjLCkt.js → ShaderAssetDocument-CT7XzsZq.js} +4 -4
  46. package/dist/assets/ShadowEditor-YO5KEfnz.js +1 -0
  47. package/dist/assets/{SourceAssetViewer-BGUeDAEv.js → SourceAssetViewer-FSLup2km.js} +1 -1
  48. package/dist/assets/StageHost-DYfGYwvq.js +2 -0
  49. package/dist/assets/{StoryPreviewMount-Di8uMovM.js → StoryPreviewMount-BhvT5QlB.js} +1 -1
  50. package/dist/assets/ThreeBoardDocument-B-z2nwnH.js +2 -0
  51. package/dist/assets/{ThreeIsolationSceneContent-BAKurKW5.js → ThreeIsolationSceneContent-B5pU4Y6k.js} +1 -1
  52. package/dist/assets/{ToolObject3DPreview-CffvGJ1h.js → ToolObject3DPreview-VtraiQ4Q.js} +1 -1
  53. package/dist/assets/Toolbar-M62Gob9T.js +1 -0
  54. package/dist/assets/{TransientHint-CgmkrmKF.js → TransientHint-Cc40mHWE.js} +1 -1
  55. package/dist/assets/VideoViewer-BxcUwXQm.js +1 -0
  56. package/dist/assets/ViewportShadingMenu-BoMPnTVh.js +1 -0
  57. package/dist/assets/active-ingest-0QjJWb7i.js +3 -0
  58. package/dist/assets/{animation-clock-fLmY_3--.js → animation-clock-BXEwUJtz.js} +1 -1
  59. package/dist/assets/animation-mixers.service-C-Ko4KzM.js +1 -0
  60. package/dist/assets/animation-timeline.utility-Bl15-rYb.js +1 -0
  61. package/dist/assets/{asset-budget-asset.menu-BDRDWrvx.js → asset-budget-asset.menu-BUa3g0Wy.js} +1 -1
  62. package/dist/assets/{asset-budget.action-tQmNGQHC.js → asset-budget.action-Dl5eVPIo.js} +1 -1
  63. package/dist/assets/{asset-budget.document-BthgX37Z.js → asset-budget.document-DJylQ-0h.js} +1 -1
  64. package/dist/assets/{asset-budget.menu-DfyWVH6p.js → asset-budget.menu-BJtvNMLj.js} +1 -1
  65. package/dist/assets/asset-editor-persistence-BIbf5u0Q.js +1 -0
  66. package/dist/assets/asset-loaders-DoNflsHL.js +2 -0
  67. package/dist/assets/{asset-preview-Cv7tfD98.js → asset-preview-DxlSdRZn.js} +1 -1
  68. package/dist/assets/{audio-unlock.service-BvHvZjzx.js → audio-unlock.service-CTaiyXF9.js} +1 -1
  69. package/dist/assets/audio.utility-CEmNc68t.js +1 -0
  70. package/dist/assets/autoplay.service-BZLSUyL8.js +1 -0
  71. package/dist/assets/{babylon-authoring-adapter-Cg5ALSpr.js → babylon-authoring-adapter-BZvV2bz_.js} +1 -1
  72. package/dist/assets/binding-resolver-DGbk9_XR.js +2 -0
  73. package/dist/assets/blender-emscripten-engine-B7lfg-RX.js +2 -0
  74. package/dist/assets/{blender-node-editor.document-B92MO51u.js → blender-node-editor.document-wXJobGNH.js} +1 -1
  75. package/dist/assets/{blender-properties-tab-CDVyDAbf.js → blender-properties-tab-7GFf80ev.js} +1 -1
  76. package/dist/assets/{blender-runtime-host-CuniE0sy.js → blender-runtime-host-CILxrx5T.js} +2 -2
  77. package/dist/assets/{blender-runtime-skin-B_tOz5j5.js → blender-runtime-skin-Cd5lQYsC.js} +7 -7
  78. package/dist/assets/{blender-runtime.document-DxUwLiEW.js → blender-runtime.document-C0r_R49S.js} +7 -7
  79. package/dist/assets/{blender-timeline.document-BdEEoQbK.js → blender-timeline.document-BaISZMBc.js} +1 -1
  80. package/dist/assets/{blender-uv-editor.document-EMSUlRh4.js → blender-uv-editor.document-CT_fsyyA.js} +1 -1
  81. package/dist/assets/blender-version.status-DzEx7u7k.js +1 -0
  82. package/dist/assets/blender-wali-engine-DOiQCBXH.js +2 -0
  83. package/dist/assets/{blender.command-BkBML2SY.js → blender.command-DdiKd8mZ.js} +1 -1
  84. package/dist/assets/blender.status-BMETIbb2.js +1 -0
  85. package/dist/assets/board-guides-CjHQ9Ynm.js +1 -0
  86. package/dist/assets/body-marks-C1LxJtQb.js +1 -0
  87. package/dist/assets/{bridge.command-VnplZ81v.js → bridge.command-DXUeavn5.js} +3 -3
  88. package/dist/assets/{browserAll-BCmkqg8n.js → browserAll-Dg46xT22.js} +1 -1
  89. package/dist/assets/{build-player.document-DV7YcJQt.js → build-player.document-BHwVV3K0.js} +1 -1
  90. package/dist/assets/build-profiles.document-HkpS-Kxa.js +2 -0
  91. package/dist/assets/build-progress.status-u1J0Rm1D.js +1 -0
  92. package/dist/assets/{build-session-BGe0eGrQ.js → build-session-BLboUUbw.js} +2 -2
  93. package/dist/assets/{build.action-Bdj4ZEL_.js → build.action-C00DL83N.js} +1 -1
  94. package/dist/assets/{build.command-DAWiYvPa.js → build.command-Cjk_NY75.js} +1 -1
  95. package/dist/assets/build.header-BWNmNWFT.js +1 -0
  96. package/dist/assets/{build.menu-BiRNC_xc.js → build.menu-BBYtqCIq.js} +1 -1
  97. package/dist/assets/{build.service-Dw9K6VSF.js → build.service-DOU15tKN.js} +1 -1
  98. package/dist/assets/{camera-C-qXzXFf.js → camera-7DGyYW7Y.js} +1 -1
  99. package/dist/assets/{camera-runtime.inspector-BDrwWRlU.js → camera-runtime.inspector-n-jiOR-3.js} +1 -1
  100. package/dist/assets/{canvas-design-mount-DLn49Zle.js → canvas-design-mount-CSRHU-ag.js} +4 -4
  101. package/dist/assets/canvas-entry-runtime-BST8yRuK.js +2 -0
  102. package/dist/assets/{canvas-preview-frames-B5xFRjhQ.js → canvas-preview-frames-Cja32aW2.js} +1 -1
  103. package/dist/assets/{canvas-story-capture.service-DQ_leYyi.js → canvas-story-capture.service-D5R5HJ8n.js} +2 -2
  104. package/dist/assets/capability-coverage-ByWftxk4.js +7 -0
  105. package/dist/assets/{collaboration-presence-BOS1t8wI.js → collaboration-presence-D6MC9xJN.js} +1 -1
  106. package/dist/assets/{collider-Bf4Uk6LW.js → collider-B78EcUc9.js} +1 -1
  107. package/dist/assets/{component-board.service-DFSSCaCf.js → component-board.service-BaQI5Oas.js} +2 -2
  108. package/dist/assets/component-board.service-CkjrsD8x.js +2 -0
  109. package/dist/assets/{component-board.service-CpVXGhz5.js → component-board.service-Dvjz_g-x.js} +2 -2
  110. package/dist/assets/component-contracts.service-C3-AXQp7.js +1 -0
  111. package/dist/assets/component-instance-root-DLI40MiB.js +1 -0
  112. package/dist/assets/{component-verbs.command-DGzZAV_Z.js → component-verbs.command-Brr_WcaR.js} +1 -1
  113. package/dist/assets/{component-verbs.service-D1rVRogp.js → component-verbs.service-DC2sC3j3.js} +1 -1
  114. package/dist/assets/{config-D-EAAhqP.js → config-BI_7osdR.js} +4 -4
  115. package/dist/assets/{configurations-_HZOWZPy.js → configurations-XP9YLkrt.js} +1 -1
  116. package/dist/assets/connection.status-BhRwcFx0.js +1 -0
  117. package/dist/assets/{constraint-5KLYpGm7.js → constraint-Bp1l8hY-.js} +1 -1
  118. package/dist/assets/constraints.inspector-Dm1cycK3.js +1 -0
  119. package/dist/assets/{content-bounds-DKBD7nsv.js → content-bounds-DROIchTa.js} +1 -1
  120. package/dist/assets/{contract-system-adapters-h6OUBRYA.js → contract-system-adapters-Cn7OW_ay.js} +1 -1
  121. package/dist/assets/coverage.service-l42ty7lr.js +3 -0
  122. package/dist/assets/{create-runtime-Bg2uYMfh.js → create-runtime-B_uTwsmi.js} +2 -2
  123. package/dist/assets/curve-THOUsg-j.js +1 -0
  124. package/dist/assets/{data-asset-7Nfmx-28.js → data-asset-DAANayR6.js} +1 -1
  125. package/dist/assets/data-check-core-CHqar_E8.js +1 -0
  126. package/dist/assets/data-ref-CN34UeVw.js +1 -0
  127. package/dist/assets/debug-bridge-BD1XVAIB.js +1 -0
  128. package/dist/assets/debug-registry-ggQWxtu-.js +1 -0
  129. package/dist/assets/{deferred-ingest-play-Bej67_y9.js → deferred-ingest-play-B2JUlwlT.js} +2 -2
  130. package/dist/assets/{design-time-canvas-mount-CFW9ZWuk.js → design-time-canvas-mount-as9cN9I6.js} +2 -2
  131. package/dist/assets/design-time-layers-BRseeSmV.js +1 -0
  132. package/dist/assets/{design-time-mount.service-DJeAPUB_.js → design-time-mount.service-BTVu3yKo.js} +2 -2
  133. package/dist/assets/{design-time-mount.service-_R1UDCw3.js → design-time-mount.service-DKvc7lVK.js} +2 -2
  134. package/dist/assets/design-time-react-mount-C7rB56QD.js +1 -0
  135. package/dist/assets/{document-preview-three-5cbuuJMH.js → document-preview-three-CxmRhCcV.js} +1 -1
  136. package/dist/assets/{dom-authoring-adapter-CoESNvrM.js → dom-authoring-adapter-L8OzXfmE.js} +1 -1
  137. package/dist/assets/{draco3d-Sk9K4AUT.js → draco3d-BjNuXv66.js} +1 -1
  138. package/dist/assets/{edit-mode-audio.service-CH6J-8N7.js → edit-mode-audio.service-BwI5u845.js} +1 -1
  139. package/dist/assets/edit-mode-authoring-D5f7aHHl.js +1 -0
  140. package/dist/assets/{edit-mode-networking.service-C4o2pGHX.js → edit-mode-networking.service-DqP_4lbI.js} +1 -1
  141. package/dist/assets/editor-api-BM7H_F4G.js +1 -0
  142. package/dist/assets/{editor-layers-B4oYfpj8.js → editor-layers-D-CTUqco.js} +1 -1
  143. package/dist/assets/editor-presentation-activity-CqJH4G9t.js +1 -0
  144. package/dist/assets/{editor-shell-store-Bh1S7M54.js → editor-shell-store-DHVWS8cE.js} +1 -1
  145. package/dist/assets/{entity-object-B_5Gc0Ky.js → entity-object-MKYemTFM.js} +1 -1
  146. package/dist/assets/{extend-DcEyE5jI.js → extend-BrgqZiMY.js} +1 -1
  147. package/dist/assets/{fork-menu-CKjNh3MO.js → fork-menu-DE2MK3Nq.js} +1 -1
  148. package/dist/assets/{frame-debugger-store-D5YViF_8.js → frame-debugger-store-BXoLKTdZ.js} +1 -1
  149. package/dist/assets/game-audio-BeCyd0Ha.js +1 -0
  150. package/dist/assets/{game-contract-seams-C0AVYwvO.js → game-contract-seams-tyKDsfaP.js} +1 -1
  151. package/dist/assets/{game-css-scope-transform-8GOvVu1s.js → game-css-scope-transform-DcjrwtVc.js} +2 -2
  152. package/dist/assets/game-document.service-CTb2itHQ.js +1 -0
  153. package/dist/assets/{game-eval.command-4wa9vqWE.js → game-eval.command-CpDKXOQU.js} +2 -2
  154. package/dist/assets/game-module-access-BTInp2NG.js +1 -0
  155. package/dist/assets/game-network-DW5ARz4R.js +22 -0
  156. package/dist/assets/{gameplay-export-K5AcStVC.js → gameplay-export-cHk3v9y-.js} +1 -1
  157. package/dist/assets/gameplay-replay-HRenPTtU.js +1 -0
  158. package/dist/assets/{gameplay.command-DoWqBWhH.js → gameplay.command-DcY2lKKX.js} +1 -1
  159. package/dist/assets/generation-CdOATubd.css +1 -0
  160. package/dist/assets/{generation-jobs-CiabIfR0.js → generation-jobs-CJBehuUp.js} +1 -1
  161. package/dist/assets/generation.service-BMOc-C9i.js +1 -0
  162. package/dist/assets/{generations-DU9rCeQR.js → generations-ssgVOe_6.js} +1 -1
  163. package/dist/assets/generations.status-B_SmPReI.js +1 -0
  164. package/dist/assets/hierarchy-marks-BuCO8Ke-.js +1 -0
  165. package/dist/assets/hierarchy-marks-CsTaTkc7.js +1 -0
  166. package/dist/assets/hosted-asset-materialization-CiXZI85V.js +2 -0
  167. package/dist/assets/{ibl-override-material-CiKkaOTW.js → ibl-override-material-CMo_a49U.js} +1 -1
  168. package/dist/assets/index-B0S4fQQV.js +1 -0
  169. package/dist/assets/{index-Kb9_s5aP.js → index-B9bd4k-t.js} +1 -1
  170. package/dist/assets/index-BMxv2MNV.js +1 -0
  171. package/dist/assets/{index-CC1puVjo.js → index-Bm4_DmRO.js} +1 -1
  172. package/dist/assets/{index-BsYc2Oyj.js → index-BvBlIRwM.js} +1 -1
  173. package/dist/assets/{index-C4AUQbmq.js → index-BweKDdi_.js} +1 -1
  174. package/dist/assets/{index-CaG87ZF-.js → index-C5ZAyrKq.js} +271 -270
  175. package/dist/assets/index-CPiRKiDC.css +1 -0
  176. package/dist/assets/index-CfpGZrbC.js +1 -0
  177. package/dist/assets/index-Czvj6whv.js +1 -0
  178. package/dist/assets/{index-C20Flc1s.js → index-DgPDGGSV.js} +2 -2
  179. package/dist/assets/{inference-diagnostics-MGcIHEX6.js → inference-diagnostics-DLt9ql9I.js} +1 -1
  180. package/dist/assets/{ingest-boot-viewport-D2okO6JI.js → ingest-boot-viewport-BXVXjYpG.js} +1 -1
  181. package/dist/assets/ingest-siblings-DWJ7OGB_.js +1 -0
  182. package/dist/assets/ingest-source-persistence-6ShMoSCa.js +1 -0
  183. package/dist/assets/ingest.service-BBbX8ibg.js +1 -0
  184. package/dist/assets/{inspect-C8RP8G5F.js → inspect-Cz3Zyx_1.js} +1 -1
  185. package/dist/assets/inspection-D8fZOHCM.js +1 -0
  186. package/dist/assets/instances.command-BrdlngrL.js +1 -0
  187. package/dist/assets/{json-history-resource-CTXRV4GD.js → json-history-resource-Uqrihfc8.js} +1 -1
  188. package/dist/assets/{layered-pick-B_-BRrRD.js → layered-pick-CAVQMPI7.js} +1 -1
  189. package/dist/assets/{light-CskDQ8gF.js → light-CqzsCWeJ.js} +1 -1
  190. package/dist/assets/{live-project-verbs-BOAQN3ME.js → live-project-verbs-CdFmLYOo.js} +1 -1
  191. package/dist/assets/{machine.document-BxOoCOo9.js → machine.document-DRIFOVaa.js} +1 -1
  192. package/dist/assets/{machines.finder-CqEceWzS.js → machines.finder-DPCT6few.js} +1 -1
  193. package/dist/assets/material-BVApn1V_.js +1 -0
  194. package/dist/assets/{material-factory-qB9pzcQf.js → material-factory-B_75xxFD.js} +1 -1
  195. package/dist/assets/{mesh-5--4qA-C.js → mesh-DdA3mExo.js} +1 -1
  196. package/dist/assets/model-asset-sections-D1uxOu2v.css +1 -0
  197. package/dist/assets/model-asset-sections.service-CJnSIckZ.js +1 -0
  198. package/dist/assets/{model-inspection-MrJY0U_-.js → model-inspection-DvspbmJl.js} +1 -1
  199. package/dist/assets/{model-thumbnail-uk-2sblh.js → model-thumbnail-BmQs-h6t.js} +1 -1
  200. package/dist/assets/{models.finder-rk8dhgO8.js → models.finder-Qv_Hsccy.js} +1 -1
  201. package/dist/assets/module-mode-MJ4Gbsry.js +2 -0
  202. package/dist/assets/mount-canvas-ingest-root-BxtM8OaB.js +2 -0
  203. package/dist/assets/mount-dom-ingest-root-pGatqO46.js +2 -0
  204. package/dist/assets/{mount-ingest-root-BC3-1Cw1.js → mount-ingest-root-C7jb-mCl.js} +2 -2
  205. package/dist/assets/{mount-manifest-QJOB11Kv.js → mount-manifest-BfoHBuzn.js} +1 -1
  206. package/dist/assets/mount-readiness-DyAd17pe.js +4 -0
  207. package/dist/assets/mount-three-ingest-root-Boa5mcaF.js +1 -0
  208. package/dist/assets/{mounted-authoring-B7RL_V28.js → mounted-authoring-DxMISwvR.js} +1 -1
  209. package/dist/assets/{mounted-story-viewport-source-CnYhX3vW.js → mounted-story-viewport-source-DfnLxI1f.js} +1 -1
  210. package/dist/assets/{native-debug-module-B-rWJfWE.js → native-debug-module-BlrALjM3.js} +1 -1
  211. package/dist/assets/{navigation-BVu-aVmF.js → navigation-CqG5o5AR.js} +1 -1
  212. package/dist/assets/{navmesh.menu-C3M63eR4.js → navmesh.menu-D4TdVDhe.js} +1 -1
  213. package/dist/assets/{navmesh.service-B0H1fUfn.js → navmesh.service-DWKT5ruQ.js} +1 -1
  214. package/dist/assets/network-observer.service-ZRAquNq4.js +1 -0
  215. package/dist/assets/network.utility-DjeOEvAY.js +1 -0
  216. package/dist/assets/object-marks-BnvSuCTt.js +1 -0
  217. package/dist/assets/{object3d-authoring-subject-BDrxd1GA.js → object3d-authoring-subject-XccsO0xG.js} +1 -1
  218. package/dist/assets/{object3d-document-session-registry-OjqzJ86S.js → object3d-document-session-registry-CMRJdFp6.js} +2 -2
  219. package/dist/assets/{oid-transform-Bzc2ZJSH.js → oid-transform-DaA6yW6o.js} +1 -1
  220. package/dist/assets/{particles-Be7AvO4c.js → particles-DsQRcDBY.js} +1 -1
  221. package/dist/assets/{performance-profiler-OwnXQX0M.js → performance-profiler-CMbwGBuk.js} +1 -1
  222. package/dist/assets/pixi-authoring-adapter-BoBt8bB5.js +1 -0
  223. package/dist/assets/pixi-live-write-target-CYZgvC6U.js +1 -0
  224. package/dist/assets/{play.command-CIGRq8ow.js → play.command-D9JGJP-e.js} +2 -2
  225. package/dist/assets/pose-guard-CLabLSzf.js +1 -0
  226. package/dist/assets/presentation-COhHQdmR.js +1 -0
  227. package/dist/assets/{product-BN31wSnB.js → product-CaRGoiIH.js} +1 -1
  228. package/dist/assets/{profiler.action-D57Kj9ym.js → profiler.action-Cz7HYWjh.js} +1 -1
  229. package/dist/assets/{profiler.menu-Dh9Q5DDx.js → profiler.menu-D5aR_FBy.js} +1 -1
  230. package/dist/assets/profiler.utility-KwxlIPKb.js +1 -0
  231. package/dist/assets/{project-authoring-session-LCJAwGrD.js → project-authoring-session-DKXHVwxO.js} +2 -2
  232. package/dist/assets/project-provenance-BGnJXJwa.js +1 -0
  233. package/dist/assets/{properties-bone-constraints.inspector-CaIDq5nN.js → properties-bone-constraints.inspector-Bo-sU8eR.js} +1 -1
  234. package/dist/assets/{properties-bone.inspector-D2fcQGMF.js → properties-bone.inspector-BQiWplQv.js} +1 -1
  235. package/dist/assets/{properties-collection.inspector-CF5AtTAd.js → properties-collection.inspector-C5BnR-GE.js} +1 -1
  236. package/dist/assets/{properties-constraints.inspector-Bj2itDrS.js → properties-constraints.inspector-CyheU12R.js} +1 -1
  237. package/dist/assets/{properties-data.inspector-BfRqk0Xo.js → properties-data.inspector-CkycARja.js} +1 -1
  238. package/dist/assets/{properties-material.inspector-Bf8H0mvu.js → properties-material.inspector-Bl_PUmY-.js} +1 -1
  239. package/dist/assets/{properties-modifiers.inspector-BKShc1TH.js → properties-modifiers.inspector-j7SnOxQq.js} +1 -1
  240. package/dist/assets/{properties-object.inspector-YBh8ABnN.js → properties-object.inspector-DcR3MGLK.js} +1 -1
  241. package/dist/assets/{properties-output.inspector-CVkzfs-l.js → properties-output.inspector-BLjw6K4b.js} +1 -1
  242. package/dist/assets/{properties-particles.inspector-ChDpAq-2.js → properties-particles.inspector-BUIm2-Jf.js} +1 -1
  243. package/dist/assets/{properties-physics.inspector-BLEM7aMj.js → properties-physics.inspector-DNvRcxb6.js} +1 -1
  244. package/dist/assets/{properties-render.inspector-vU4D9xLL.js → properties-render.inspector-8FMZ-qoZ.js} +1 -1
  245. package/dist/assets/{properties-scene.inspector-C-DoN-kL.js → properties-scene.inspector-Dx7_z75k.js} +1 -1
  246. package/dist/assets/{properties-texture.inspector-DySxy1oU.js → properties-texture.inspector-WT15951-.js} +1 -1
  247. package/dist/assets/{properties-view-layer.inspector-DEKxMahJ.js → properties-view-layer.inspector-P7VNTdqr.js} +1 -1
  248. package/dist/assets/{properties-world.inspector-m5qL_TQV.js → properties-world.inspector-B3t1q8TF.js} +1 -1
  249. package/dist/assets/r3f-design-session-lsbFnoWH.js +2 -0
  250. package/dist/assets/{r3f-physics-binding-Bgzzd4ol.js → r3f-physics-binding-Cx8yhuwt.js} +1 -1
  251. package/dist/assets/{r3f-source-authoring-adapter-C8oMjdTL.js → r3f-source-authoring-adapter-jH3G0TeH.js} +1 -1
  252. package/dist/assets/react-canvas-navigation-B_gOe3CI.js +1 -0
  253. package/dist/assets/react-inspector.service-CZf1vfdX.js +1 -0
  254. package/dist/assets/react-story-board-CCm2Opwn.js +1 -0
  255. package/dist/assets/{react-three-rapier.esm-BR2ttgLS.js → react-three-rapier.esm-CHXGG51p.js} +1 -1
  256. package/dist/assets/react-world-authoring-adapter-CnzxMtYz.js +1 -0
  257. package/dist/assets/{realm-services-DefTrXnY.js → realm-services-Do9J6nsb.js} +1 -1
  258. package/dist/assets/reflection-probe-capture.inspector-BAjjIybz.js +1 -0
  259. package/dist/assets/{reflection-probe-BHNGwVyz.js → reflection-probe-sIto9mh0.js} +1 -1
  260. package/dist/assets/registry-Xnduk02T.js +1 -0
  261. package/dist/assets/{relative-import-specifier-DQzkawgj.js → relative-import-specifier-CPFTrxi4.js} +1 -1
  262. package/dist/assets/{render-env-BZ7LsGfk.js → render-env-YJlI8K0i.js} +1 -1
  263. package/dist/assets/{render-features-C7QwmhCo.js → render-features-DMSV2qKJ.js} +1 -1
  264. package/dist/assets/{render-settings-BBvkacR3.js → render-settings-CRyDhHyz.js} +1 -1
  265. package/dist/assets/resolve-three-D27rMc37.js +702 -0
  266. package/dist/assets/root-seam-contract-gjWUd5uu.js +1 -0
  267. package/dist/assets/{run-selection-BUeubtHj.js → run-selection-B0jOdyYt.js} +1 -1
  268. package/dist/assets/scene-capture-Di9cM1p4.js +1 -0
  269. package/dist/assets/scene-document.service-XxGs4HHE.js +2 -0
  270. package/dist/assets/{scene-framing-PVMqGU8h.js → scene-framing-DkZKDwH3.js} +1 -1
  271. package/dist/assets/{scene-index--lRWLEmW.js → scene-index-DHeKmalD.js} +1 -1
  272. package/dist/assets/{scene-query-s1y04OVB.js → scene-query-ByZtXA2m.js} +1 -1
  273. package/dist/assets/seeded-random-BJthDRMu.js +1 -0
  274. package/dist/assets/{session-CTXsU1lK.js → session-x8E_NJk2.js} +34 -34
  275. package/dist/assets/{setup-renderer-OOw1SykJ.js → setup-renderer-F9mG7t6r.js} +1 -1
  276. package/dist/assets/{source-object3d-authoring-adapter-RmutT5Dt.js → source-object3d-authoring-adapter-CvmFpSUj.js} +1 -1
  277. package/dist/assets/{source-persistence-backend-HviqjKZ2.js → source-persistence-backend-au3WtEn6.js} +1 -1
  278. package/dist/assets/{spark-renderer-lifecycle-DfYpvEJa.js → spark-renderer-lifecycle-B6Axb6jm.js} +1 -1
  279. package/dist/assets/{stage-keyboard-DDi7S27C.js → stage-keyboard-BQkndG_D.js} +1 -1
  280. package/dist/assets/stage-overlay-set-g6eWhuRv.js +1 -0
  281. package/dist/assets/stage-presence-markers-0CDfO5f4.js +1 -0
  282. package/dist/assets/stage-transform-tools-BzPl7OIo.js +1 -0
  283. package/dist/assets/standard-viewport-dressing-BW-dM_1h.js +24 -0
  284. package/dist/assets/{state-watch.action-DEdb1mNa.js → state-watch.action-Z1nQ5awu.js} +1 -1
  285. package/dist/assets/{state-watch.menu-jWbUM3kw.js → state-watch.menu-CQHGUF3W.js} +1 -1
  286. package/dist/assets/state-watch.utility-DCIg2i79.js +1 -0
  287. package/dist/assets/{story-capture-Dj1xkeKH.js → story-capture-BIrjDKeY.js} +1 -1
  288. package/dist/assets/story-documents-BvG2xeaR.js +3 -0
  289. package/dist/assets/{story-documents.service-iNP-ORNr.js → story-documents.service-DOSEa3ja.js} +1 -1
  290. package/dist/assets/{story-documents.service-BzQCuNBu.js → story-documents.service-y1m7XGMJ.js} +1 -1
  291. package/dist/assets/{story-media-presence-zTPlU9HR.js → story-media-presence-HLV-KaMj.js} +1 -1
  292. package/dist/assets/{story-pixi-preview-B7THvSl7.js → story-pixi-preview-CMhho2gG.js} +1 -1
  293. package/dist/assets/{story-presentation-BLXYPadR.js → story-presentation-CYhVv8Ku.js} +1 -1
  294. package/dist/assets/story-three-preview-CgcLF5lE.js +2 -0
  295. package/dist/assets/{structural-ids-Br2zjINh.js → structural-ids-BOo2BRoY.js} +1 -1
  296. package/dist/assets/studio-environment-R9qXUUcC.js +2 -0
  297. package/dist/assets/{surface-state-D9j6qNu8.js → surface-state-D8Qnowo6.js} +1 -1
  298. package/dist/assets/{syntactic-prop-specs-BTnsMOvH.js → syntactic-prop-specs-8gkBuc5j.js} +1 -1
  299. package/dist/assets/team-playtest.service-BBMZ2iyk.js +1 -0
  300. package/dist/assets/{three-oYrcK5SQ.js → three-DiL6vMXq.js} +1 -1
  301. package/dist/assets/three-authoring-adapter-CkLR2zGf.js +1 -0
  302. package/dist/assets/three-authoring.service-CovhlCGx.js +2 -0
  303. package/dist/assets/{three-ingest-runtime-CXKjNysA.js → three-ingest-runtime-CwTqAHgX.js} +1 -1
  304. package/dist/assets/{three-integration-CuAnYaTW.js → three-integration-DXOFI88n.js} +2 -2
  305. package/dist/assets/three-integration.service-rCAqpqSp.js +1 -0
  306. package/dist/assets/three-projection-core-B7Lf8tOp.js +1 -0
  307. package/dist/assets/{three-state-wXRU3rLr.js → three-state-BCACvUtm.js} +1 -1
  308. package/dist/assets/{three-story-capture.service-DMJRcqjr.js → three-story-capture.service-rTFKNtHA.js} +2 -2
  309. package/dist/assets/{three-story-model-DgiAP-oQ.js → three-story-model-BjKr7OMn.js} +1 -1
  310. package/dist/assets/three-viewport-presentation-CBzvc2v2.js +141 -0
  311. package/dist/assets/tools-DfctM216.js +1 -0
  312. package/dist/assets/transform-mode-request-DlEApNrA.js +1 -0
  313. package/dist/assets/transport-strip-xCg94CuI.js +1 -0
  314. package/dist/assets/transport.header-BRtdky0x.js +1 -0
  315. package/dist/assets/{trigger-volume-DP0G1VBe.js → trigger-volume-BLkHmfm9.js} +1 -1
  316. package/dist/assets/tuples-BDz3wbQL.js +1 -0
  317. package/dist/assets/ui-board-document-DvbK_HVN.js +2 -0
  318. package/dist/assets/{user-data-CqOoAowZ.js → user-data-C84W0V47.js} +1 -1
  319. package/dist/assets/user-data-CODoGZqA.js +1 -0
  320. package/dist/assets/{utility-view-state-Db97zwDz.js → utility-view-state-CDRxZSo-.js} +1 -1
  321. package/dist/assets/viewport-door-BARIpMu-.js +1 -0
  322. package/dist/assets/{viewport-root-presentation-B35t51xX.js → viewport-root-presentation-hRLF0BeO.js} +1 -1
  323. package/dist/assets/{viewport-surface-status-D5kZtFW5.js → viewport-surface-status-TUfhXKR9.js} +1 -1
  324. package/dist/assets/{webworkerAll-CfKEb4Ao.js → webworkerAll-PJtcQ1FD.js} +1 -1
  325. package/dist/assets/worker-BtXrsgFy.js +2 -0
  326. package/dist/assets/workspace-arrangement-DqG5sUns.js +1 -0
  327. package/dist/assets/world-documents-D69XaqUX.js +1 -0
  328. package/dist/assets/world-root-stage-binding-BgZWZEuD.js +1 -0
  329. package/dist/assets/{xstate-animation-binding-aQEmNSpm.js → xstate-animation-binding-CIyLzGHs.js} +1 -1
  330. package/dist/assets/{xstate-animation-meta-CnMX1Sc1.js → xstate-animation-meta-CbYWup3R.js} +1 -1
  331. package/dist/volter-shared-react.json +10 -0
  332. package/dist/volter-shared-three.json +3 -0
  333. package/dist-node/cli.js +239 -201
  334. package/dist-node/create.js +89 -73
  335. package/package.json +20 -19
  336. package/src/contributions.d.ts +1 -1
  337. package/src/index.ts +10 -10
  338. package/starter/cube.py +1 -1
  339. package/template/.agents/references/project-manual.md +17 -17
  340. package/template/.agents/skills/editor/SKILL.md +6 -6
  341. package/template/.agents/skills/editor/agents/openai.yaml +3 -3
  342. package/template/.agents/skills/editor/references/editor-control.md +62 -62
  343. package/template/.agents/skills/{vgai-3d-models → volter-3d-models}/SKILL.md +3 -3
  344. package/template/.agents/skills/{vgai-ingest-existing-game → volter-ingest-existing-game}/SKILL.md +2 -2
  345. package/template/.agents/skills/{vgai-music → volter-music}/SKILL.md +7 -7
  346. package/template/{.github/skills/vgai-threejs-authoring → .agents/skills/volter-threejs-authoring}/SKILL.md +9 -9
  347. package/template/.agents/skills/volter-threejs-authoring/agents/openai.yaml +4 -0
  348. package/template/{.claude/skills/vgai-threejs-authoring → .agents/skills/volter-threejs-authoring}/references/helper-catalog.md +1 -1
  349. package/template/.claude/skills/editor/SKILL.md +6 -6
  350. package/template/.claude/skills/editor/agents/openai.yaml +3 -3
  351. package/template/.claude/skills/editor/references/editor-control.md +62 -62
  352. package/template/{.github/skills/vgai-3d-models → .claude/skills/volter-3d-models}/SKILL.md +3 -3
  353. package/template/{.github/skills/vgai-ingest-existing-game → .claude/skills/volter-ingest-existing-game}/SKILL.md +2 -2
  354. package/template/.claude/skills/{vgai-threejs-authoring → volter-threejs-authoring}/SKILL.md +9 -9
  355. package/template/.claude/skills/volter-threejs-authoring/agents/openai.yaml +4 -0
  356. package/template/{.agents/skills/vgai-threejs-authoring → .claude/skills/volter-threejs-authoring}/references/helper-catalog.md +1 -1
  357. package/template/.github/copilot-instructions.md +1 -1
  358. package/template/.github/skills/editor/SKILL.md +6 -6
  359. package/template/.github/skills/editor/agents/openai.yaml +3 -3
  360. package/template/.github/skills/editor/references/editor-control.md +62 -62
  361. package/template/{.claude/skills/vgai-3d-models → .github/skills/volter-3d-models}/SKILL.md +3 -3
  362. package/template/{.claude/skills/vgai-ingest-existing-game → .github/skills/volter-ingest-existing-game}/SKILL.md +2 -2
  363. package/template/{.agents/skills/vgai-threejs-authoring → .github/skills/volter-threejs-authoring}/SKILL.md +9 -9
  364. package/template/.github/skills/volter-threejs-authoring/agents/openai.yaml +4 -0
  365. package/template/.github/skills/{vgai-threejs-authoring → volter-threejs-authoring}/references/helper-catalog.md +1 -1
  366. package/template/.mcp.json +3 -3
  367. package/template/AGENTS.md +24 -23
  368. package/template/DEVLOG.md +1 -1
  369. package/template/IDIOMS.md +3 -3
  370. package/template/LICENSE +3 -3
  371. package/template/README.md +12 -12
  372. package/template/check-idioms.ts +51 -51
  373. package/template/manifest-entry-modules-plugin.ts +17 -4
  374. package/template/package.json +13 -15
  375. package/template/server/loopback.ts +1 -1
  376. package/template/server/main.ts +4 -4
  377. package/template/server/rooms/arena-room.ts +8 -8
  378. package/template/server/rooms/game-room.ts +8 -8
  379. package/template/server/rooms.ts +2 -2
  380. package/template/src/bot/QaTester.tsx +1 -1
  381. package/template/src/bot/bot-station.ts +2 -2
  382. package/template/src/bot/tester-station.ts +1 -1
  383. package/template/src/contributions/README.md +1 -1
  384. package/template/src/contributions/analytics.analytics.tsx +1 -1
  385. package/template/src/contributions/data.document.tsx +2 -2
  386. package/template/src/contributions/pages.finder.ts +1 -1
  387. package/template/src/contributions/tester.inspector.tsx +2 -2
  388. package/template/src/contributions/use-game-modules.ts +1 -1
  389. package/template/src/input.ts +1 -1
  390. package/template/src/lib/reflections/volume-reflection-material.ts +59 -59
  391. package/template/src/lib/static-batch/Frozen.tsx +1 -1
  392. package/template/src/lib/static-batch/mutation-watch.ts +1 -1
  393. package/template/src/main.ts +19 -38
  394. package/template/src/manifest-entry-modules.d.ts +12 -1
  395. package/template/src/prefabs/HeroBox.stories.tsx +1 -1
  396. package/template/src/world.tsx +1 -1
  397. package/template/tsconfig.json +1 -1
  398. package/template/validate-manifest.ts +3 -3
  399. package/template/vite.config.ts +11 -11
  400. package/template/{vgai.adapter.ts → volter.adapter.ts} +1 -1
  401. package/template/{vgai.project.json → volter.project.json} +2 -2
  402. package/template-dotfiles/gitignore +27 -27
  403. package/workbench/src/media/game-cover.css +11 -11
  404. package/workbench/src/product.contribution.ts +28 -28
  405. package/workbench/src/{vgaiGameSkew.ts → volterGameSkew.ts} +16 -16
  406. package/dist/assets/AudioViewer-xFb5Wv7A.js +0 -1
  407. package/dist/assets/CanvasSceneViewport-vqBlOz8P.js +0 -1
  408. package/dist/assets/ColorInput-CX1UZjYO.js +0 -1
  409. package/dist/assets/ImageViewer-shZzMd91.js +0 -1
  410. package/dist/assets/InspectorObjectPreview-BMOvJaOw.js +0 -1
  411. package/dist/assets/JsonAssetDocument-D_HXneWE.js +0 -2
  412. package/dist/assets/Object3DDocumentToolbar-BfPH9jz5.js +0 -1
  413. package/dist/assets/Object3DDocumentViewport-BaXWtATg.js +0 -2
  414. package/dist/assets/OnlineAssetDetail-BxibUH6K.js +0 -1
  415. package/dist/assets/PlayBar-DRANyO01.js +0 -1
  416. package/dist/assets/ReactCanvasControls-K98jOX9b.js +0 -1
  417. package/dist/assets/RootSelectionOverlay-BQC12Gdd.js +0 -1
  418. package/dist/assets/ShadowEditor-DP1LWynl.js +0 -1
  419. package/dist/assets/StageHost-V_0opXFt.js +0 -2
  420. package/dist/assets/ThreeBoardDocument-tgcaZDqQ.js +0 -2
  421. package/dist/assets/Toolbar-uLgsrB2z.js +0 -1
  422. package/dist/assets/VideoViewer-ClUJ6_uy.js +0 -1
  423. package/dist/assets/ViewportShadingMenu-Bdkc6jcd.js +0 -1
  424. package/dist/assets/active-ingest-CnAeQcuQ.js +0 -3
  425. package/dist/assets/animation-mixers.service-DiecMX_A.js +0 -1
  426. package/dist/assets/animation-timeline.utility-C71vPJgs.js +0 -1
  427. package/dist/assets/asset-editor-persistence-BQgjOCrm.js +0 -1
  428. package/dist/assets/asset-loaders-5PIUVvmH.js +0 -2
  429. package/dist/assets/audio.utility-D9Vk_WYS.js +0 -1
  430. package/dist/assets/autoplay.service-CFJoLPLw.js +0 -1
  431. package/dist/assets/binding-resolver-C_9MBSMa.js +0 -2
  432. package/dist/assets/blender-emscripten-engine-BeWFjMn-.js +0 -2
  433. package/dist/assets/blender-version.status-DtfwUahB.js +0 -1
  434. package/dist/assets/blender-wali-engine-da698rDf.js +0 -2
  435. package/dist/assets/blender.status-ujwGU6dU.js +0 -1
  436. package/dist/assets/board-guides-_3R1t_-2.js +0 -1
  437. package/dist/assets/body-marks-RKb_LTwL.js +0 -1
  438. package/dist/assets/build-profiles.document-CZxDuhzz.js +0 -2
  439. package/dist/assets/build-progress.status-Dk5u3C67.js +0 -1
  440. package/dist/assets/build.header--xqH6uTP.js +0 -1
  441. package/dist/assets/canvas-entry-runtime-DVeh71nC.js +0 -2
  442. package/dist/assets/capability-coverage-DQgg6UJe.js +0 -7
  443. package/dist/assets/component-board.service-DgujG90T.js +0 -2
  444. package/dist/assets/component-contracts.service-Bc_2Xxh_.js +0 -1
  445. package/dist/assets/component-instance-root-df4ofoOR.js +0 -1
  446. package/dist/assets/connection.status-CCX-mgmr.js +0 -1
  447. package/dist/assets/constraints.inspector-CwEEREsf.js +0 -1
  448. package/dist/assets/coverage.service-CV7b5Sqn.js +0 -3
  449. package/dist/assets/curve-BKuiAPpj.js +0 -1
  450. package/dist/assets/data-check-core-CQEjuFyt.js +0 -1
  451. package/dist/assets/data-ref-DyFQqqX6.js +0 -1
  452. package/dist/assets/debug-bridge-CESAxmlz.js +0 -1
  453. package/dist/assets/debug-registry-l7k5Hjc8.js +0 -1
  454. package/dist/assets/design-time-layers-CQgnmqc8.js +0 -1
  455. package/dist/assets/design-time-react-mount-CFvIk_rV.js +0 -1
  456. package/dist/assets/edit-mode-authoring-DBjaBTxM.js +0 -1
  457. package/dist/assets/editor-api-D2azVray.js +0 -1
  458. package/dist/assets/editor-presentation-activity-C7SNSmTd.js +0 -1
  459. package/dist/assets/game-audio-CaGKzia4.js +0 -1
  460. package/dist/assets/game-document.service-FdG_gFPU.js +0 -1
  461. package/dist/assets/game-module-access-DulnT3NH.js +0 -1
  462. package/dist/assets/game-network-Bo_nlDR5.js +0 -22
  463. package/dist/assets/gameplay-replay-CnWnlogY.js +0 -1
  464. package/dist/assets/generation-DhwCUHPf.css +0 -1
  465. package/dist/assets/generation.service-D2yeZaJu.js +0 -1
  466. package/dist/assets/generations.status-3CrPw_n5.js +0 -1
  467. package/dist/assets/hierarchy-marks-BLPfSIym.js +0 -1
  468. package/dist/assets/hierarchy-marks-C25dY2fR.js +0 -1
  469. package/dist/assets/hosted-asset-materialization-DYdcFlDf.js +0 -2
  470. package/dist/assets/index-B5WjeCHm.css +0 -1
  471. package/dist/assets/index-BcH5GC3b.js +0 -1
  472. package/dist/assets/index-CwCDkEl1.js +0 -1
  473. package/dist/assets/index-n3QdTv-T.js +0 -1
  474. package/dist/assets/index.module-Ycad3DJq.js +0 -1
  475. package/dist/assets/ingest-siblings-CkxW__go.js +0 -1
  476. package/dist/assets/ingest-source-persistence-6peGfPAS.js +0 -1
  477. package/dist/assets/ingest.service-Cc73WMIW.js +0 -1
  478. package/dist/assets/inspection-CObLhnrs.js +0 -1
  479. package/dist/assets/instances.command-CxKGnrNl.js +0 -1
  480. package/dist/assets/material-BwFzKPi0.js +0 -1
  481. package/dist/assets/model-asset-sections-CFvvihfx.css +0 -1
  482. package/dist/assets/model-asset-sections.service-TZ2SaBmH.js +0 -1
  483. package/dist/assets/module-mode-B79jV5tQ.js +0 -2
  484. package/dist/assets/mount-canvas-ingest-root-BhaYNuhY.js +0 -2
  485. package/dist/assets/mount-dom-ingest-root-BQb1u0LX.js +0 -2
  486. package/dist/assets/mount-readiness-Ds0HvvLH.js +0 -4
  487. package/dist/assets/mount-three-ingest-root-DIDBfvIH.js +0 -1
  488. package/dist/assets/network-observer.service-CiR4Q9Q0.js +0 -1
  489. package/dist/assets/network.utility-CNG3eJ0E.js +0 -1
  490. package/dist/assets/object-marks-DwvIEBOK.js +0 -1
  491. package/dist/assets/pixi-authoring-adapter-B42K4md-.js +0 -1
  492. package/dist/assets/pixi-live-write-target-D56tQEe_.js +0 -1
  493. package/dist/assets/pose-guard-DILO6gGq.js +0 -1
  494. package/dist/assets/presentation-DGBuGP6i.js +0 -1
  495. package/dist/assets/profiler.utility-DLNySW3w.js +0 -1
  496. package/dist/assets/project-provenance-4ldz-EOG.js +0 -1
  497. package/dist/assets/r3f-design-session-C0DPEChS.js +0 -2
  498. package/dist/assets/react-canvas-navigation-Jowa_lJq.js +0 -1
  499. package/dist/assets/react-inspector.service-TfTdj_Qk.js +0 -1
  500. package/dist/assets/react-story-board-Bx7qYytV.js +0 -1
  501. package/dist/assets/react-world-authoring-adapter-C1jPW_cN.js +0 -1
  502. package/dist/assets/reflection-probe-capture.inspector-C-6zrzZb.js +0 -1
  503. package/dist/assets/registry-Z28XSZHF.js +0 -1
  504. package/dist/assets/resolve-three-C7zDbK29.js +0 -702
  505. package/dist/assets/root-seam-contract-rGNbiX6q.js +0 -1
  506. package/dist/assets/scene-capture-BTWgUzhI.js +0 -1
  507. package/dist/assets/scene-document.service-DJJp-la1.js +0 -2
  508. package/dist/assets/seeded-random-38To73fI.js +0 -1
  509. package/dist/assets/stage-overlay-set-olkNSZmq.js +0 -1
  510. package/dist/assets/stage-presence-markers-cznMN_qq.js +0 -1
  511. package/dist/assets/stage-transform-tools-BDUZqRIR.js +0 -1
  512. package/dist/assets/standard-viewport-dressing-BZyuxyVl.js +0 -24
  513. package/dist/assets/state-watch.utility-DDmn3G25.js +0 -1
  514. package/dist/assets/story-documents-8ehMyYHo.js +0 -3
  515. package/dist/assets/story-three-preview-B1nNiPwP.js +0 -2
  516. package/dist/assets/studio-environment-yaKaHPxH.js +0 -2
  517. package/dist/assets/team-playtest.service-Ds9tkO4q.js +0 -1
  518. package/dist/assets/three-authoring-adapter-BrkGH4cd.js +0 -1
  519. package/dist/assets/three-authoring.service-DoamZDMx.js +0 -2
  520. package/dist/assets/three-integration.service-Db-VabIm.js +0 -1
  521. package/dist/assets/three-projection-core-jBJVt6O0.js +0 -1
  522. package/dist/assets/three-viewport-presentation-CgO3eWJ-.js +0 -141
  523. package/dist/assets/tools-B_NJsk05.js +0 -1
  524. package/dist/assets/transform-mode-request-BnKpgRUW.js +0 -1
  525. package/dist/assets/transport-strip-a9yLoPsI.js +0 -1
  526. package/dist/assets/transport.header-CpfoppXc.js +0 -1
  527. package/dist/assets/tuples-CKsHOV9T.js +0 -1
  528. package/dist/assets/ui-board-document-DtTR_mBr.js +0 -2
  529. package/dist/assets/user-data-dHvLdpwM.js +0 -1
  530. package/dist/assets/viewport-door-DVkMQazS.js +0 -1
  531. package/dist/assets/worker-CC9Ug5Ei.js +0 -2
  532. package/dist/assets/workspace-arrangement-DIMM7ska.js +0 -1
  533. package/dist/assets/world-documents-C4t3iOD-.js +0 -1
  534. package/dist/assets/world-root-stage-binding-ydl3JN1a.js +0 -1
  535. package/dist/vgai-shared-react.json +0 -10
  536. package/dist/vgai-shared-three.json +0 -3
  537. package/template/.agents/skills/vgai-threejs-authoring/agents/openai.yaml +0 -4
  538. package/template/.claude/skills/vgai-threejs-authoring/agents/openai.yaml +0 -4
  539. package/template/.github/skills/vgai-threejs-authoring/agents/openai.yaml +0 -4
  540. /package/dist/assets/{vgai-shared-fontawesome-CU65D4Ij.js → volter-shared-fontawesome-CU65D4Ij.js} +0 -0
  541. /package/dist/assets/{vgai-shared-jsx-dev-runtime-DFDKL7fx.js → volter-shared-jsx-dev-runtime-DFDKL7fx.js} +0 -0
  542. /package/dist/assets/{vgai-shared-jsx-runtime-DIqBpTut.js → volter-shared-jsx-runtime-DIqBpTut.js} +0 -0
  543. /package/dist/assets/{vgai-shared-react-BT7rMc2H.js → volter-shared-react-BT7rMc2H.js} +0 -0
  544. /package/dist/assets/{vgai-shared-react-dom-DFajMqMT.js → volter-shared-react-dom-DFajMqMT.js} +0 -0
  545. /package/dist/assets/{vgai-shared-react-dom-client-S0ozfl6_.js → volter-shared-react-dom-client-S0ozfl6_.js} +0 -0
  546. /package/dist/assets/{vgai-shared-three-DH4yxKwt.js → volter-shared-three-DH4yxKwt.js} +0 -0
  547. /package/template/{.vgai → .volter}/assets.json +0 -0
  548. /package/template/{.vgai → .volter}/provenance.json +0 -0
@@ -1 +0,0 @@
1
- import{M as m,e6 as f,e7 as g,b1 as S,e8 as b,e9 as w}from"./index-CaG87ZF-.js";const $="vgaiRecordIndex";function R(i){const e=i?.userData;if(e===null||typeof e!="object")return null;const t=e[$];return typeof t=="number"&&Number.isInteger(t)&&t>=0?t:null}let d={state:"absent"},h=0;function j(i,e){const t=i;if(t===null||typeof t!="object")throw new Error(`the data writer "${e}" did not export a module object`);if(typeof t.dataFile!="string"||t.dataFile.length===0)throw new Error(`the data writer "${e}" exports no \`dataFile\` string — a writer must name the one project-relative file it edits`);if(typeof t.planDataEdit!="function")throw new Error(`the data writer "${e}" exports no \`planDataEdit\` function — that is the whole contract: (bytes, request) => {changed, bytes} | {changed, reason}`);return{dataFile:t.dataFile,...typeof t.canPlace=="function"?{canPlace:t.canPlace.bind(t)}:{},planDataEdit:t.planDataEdit.bind(t)}}function x(i){const e=++h;if(i===null){d={state:"absent"};return}d={state:"loading"},i.load().then(t=>{h===e&&(d={state:"ready",writer:j(t,i.specifier)})}).catch(t=>{h===e&&(d={state:"failed",reason:`this game's declared data writer (${i.specifier}) could not be loaded: ${t instanceof Error?t.message:String(t)}`})})}function k(){return d}function I(i){const e=d;if(e.state!=="ready"||!e.writer.canPlace)return null;const t=e.writer.canPlace(i);return t===!0?null:t}function _(i){const e=d;switch(e.state){case"ready":return{anchored:!0,kind:"data",file:e.writer.dataFile,record:i,display:`${e.writer.dataFile} record ${i}`};case"loading":return{anchored:!1,reason:`this object is record ${i} of its game's own level data; the game's data writer is still loading`};case"failed":return{anchored:!1,reason:`this object is record ${i}, but ${e.reason}`};default:return{anchored:!1,reason:`this object is record ${i} of its game's own level data, and this game declares no data writer (\`ingest.dataWriter\`) that could write that record back`}}}const u=new TextEncoder,E=new TextDecoder;let l=null,p=null;function D(){return l}async function y(i=fetch){return l||p||(p=(async()=>{try{const e=await i("/__ingest-source/ownership");if(!e.ok)throw new Error(`HTTP ${e.status}`);l=await e.json()}catch(e){l={writable:!1,reason:`the editor could not reach its dev server to check who owns this game's source (${e instanceof Error?e.message:String(e)})`,projectRoot:null}}return l})(),p)}function T(i){const e=async(r,s)=>{const n=await i(r,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(s)}),o=await n.json();if(!n.ok&&r.endsWith("/read"))throw new Error(`Reading ingested game source failed with HTTP ${n.status}: ${JSON.stringify(o)}`);return o},t=new Map,a=r=>{throw new Error(`The creation-site source backend has no "${r}" — an ingested game has no JSX oids; ingest edits are anchored by creation site.`)};return{historyIdentity:P,readSource:async r=>{const s=await e("/__ingest-source/read",{file:r}),n=s.encoding==="base64";return t.set(r,n?"base64":"utf8"),n?{...s,bytes:w(s.source)}:s},applySource:(r,s,n)=>e("/__ingest-source/apply",{file:r,source:typeof s=="string"?s:b(s),ifMatchSha:n,encoding:typeof s=="string"?t.get(r)??"utf8":"base64"}),writeStyle:()=>a("writeStyle"),removeStyle:()=>a("removeStyle"),writeStruct:()=>a("writeStruct")}}const P={};class N{backend;fetchImpl;history;live;liveResourceKey=null;unregisterLive=null;constructor(e){this.history=e.history,this.live=e.live,this.fetchImpl=e.fetchImpl??fetch.bind(globalThis),this.backend=T(this.fetchImpl),y(this.fetchImpl)}dispose(){this.unregisterLive?.(),this.unregisterLive=null}gate(e,t,a,r="instance"){if(!e.anchored)return{ok:!1,reason:e.reason};const s=e.kind==="data"?`held at ${e.display}`:`created at ${e.display}`;if(e.kind==="data"){const o=I(a);if(o)return{ok:!1,reason:`${s}, but ${o}`}}const n=l;return n?n.writable?e.kind==="source"&&t!==1&&r!=="creation-site"?{ok:!1,reason:t===0?`${s}, but nothing was recorded as constructed there — the editor cannot tell whether that line builds this object alone`:`${s}, but that creation site constructs ${t} objects; a per-object edit cannot be written there`}:f()?{ok:!0}:{ok:!1,reason:`${s}, but this game is playing — hold it to author, or the edit stays live-only`}:{ok:!1,reason:`${s}; ${n.reason??"this game’s source is not writable"}`}:{ok:!1,reason:`${s}; still checking who owns this game's source`}}canAttempt(e,t,a){return this.gate(e,t,a).ok}describe(e,t,a,r="instance"){const s=this.gate(e,t,a,r);return s.ok?`Persisting to ${e.display}.`:`Live-only edit — ${s.reason}.`}async inspect(e){const t=e.anchor;if(!t.anchored||t.kind!=="source")return{};if(e.properties.length===0)return{};try{return(await this.post("/__ingest-source/inspect",{site:{file:t.file,line:t.line,col:t.col},instances:e.instances,...e.writeScope?{writeScope:e.writeScope}:{},...e.surface?{surface:e.surface}:{},properties:e.properties})).properties??{}}catch{return{}}}async persist(e){if(!f())return{persisted:!1,reason:"this game is playing — a play-time edit lives on the running object only"};const t=e.anchor;if(!t.anchored)return{persisted:!1,reason:t.reason};const a=await y(this.fetchImpl);if(!a.writable)return{persisted:!1,reason:a.reason??"this game’s source is not writable"};if(!this.history)return{persisted:!1,reason:"this session has no project history to record into"};if(t.kind==="data")return this.persistData(e,t);const r=await this.post("/__ingest-source/prepare",{site:{file:t.file,line:t.line,col:t.col},instances:e.instances,...e.writeScope?{writeScope:e.writeScope}:{},property:e.property,...e.surface?{surface:e.surface}:{},baseline:e.baseline,next:e.next});if(!r.changed||!r.file||!r.resourcePath||r.prevSource===void 0||r.newSource===void 0||!r.prevSha)return{persisted:!1,reason:r.reason??"the edit was refused"};const s=await this.post("/__ingest-source/apply",{file:r.file,source:r.newSource,ifMatchSha:r.prevSha,note:`${e.property} at ${t.display}`});return s.applied?(await this.recordEdit(e,{file:r.file,resourcePath:r.resourcePath,before:r.prevSource,after:r.newSource}),{persisted:!0,file:r.file,detail:`${e.property} → ${r.file}:${t.line}`}):{persisted:!1,reason:s.error??"the write was refused"}}async remove(e){if(!f())return{persisted:!1,reason:"this game is playing — a play-time edit lives on the running object only"};const t=e.anchor;if(!t.anchored)return{persisted:!1,reason:t.reason};const a=await y(this.fetchImpl);if(!a.writable)return{persisted:!1,reason:a.reason??"this game’s source is not writable"};if(!this.history)return{persisted:!1,reason:"this session has no project history to record into"};if(t.kind==="data")return{persisted:!1,reason:"a level-data record has no removable source statement — its property is the record's own field, not an authored override"};const r=await this.post("/__ingest-source/prepare",{site:{file:t.file,line:t.line,col:t.col},instances:e.instances,...e.writeScope?{writeScope:e.writeScope}:{},property:e.property,...e.surface?{surface:e.surface}:{},remove:!0});if(!r.changed||!r.file||!r.resourcePath||r.prevSource===void 0||r.newSource===void 0||!r.prevSha)return{persisted:!1,reason:r.reason??"the removal was refused"};const s=await this.post("/__ingest-source/apply",{file:r.file,source:r.newSource,ifMatchSha:r.prevSha,note:`${e.property} removed at ${t.display}`});if(!s.applied)return{persisted:!1,reason:s.error??"the removal was refused"};const n=g(this.backend,this.history,{file:r.file,resourcePath:r.resourcePath,before:r.prevSource,after:r.newSource});return await this.history.recordAppliedTransaction({label:e.label,resources:[n.resource],scope:"project"},[n]),{persisted:!0,file:r.file,detail:`${e.property} dropped from ${r.file}:${t.line}`}}async persistData(e,t){const a=k();if(a.state!=="ready"){const c=_(t.record);return{persisted:!1,reason:c.anchored?"this game's data writer changed mid-gesture":c.reason}}const r=await this.post("/__ingest-source/read",{file:t.file});if(typeof r.source!="string"||!r.sha||!r.resourcePath)return{persisted:!1,reason:r.error??`this game's data file ${t.file} could not be read`};if(r.encoding!=="base64")return{persisted:!1,reason:`${t.file} came back as ${r.encoding??"utf8"} text, not bytes — a data writer edits binary game data, and writing text back through it would change the file`};let s;try{s=await a.writer.planDataEdit(w(r.source),{record:t.record,property:e.property,baseline:e.baseline,next:e.next})}catch(c){return{persisted:!1,reason:`this game's data writer refused: ${c instanceof Error?c.message:String(c)}`}}if(!s.changed)return{persisted:!1,reason:s.reason};const n=b(s.bytes),o=await this.post("/__ingest-source/apply",{file:t.file,source:n,encoding:"base64",ifMatchSha:r.sha,note:`${e.property} at ${t.display}`});return o.applied?(await this.recordEdit(e,{file:t.file,resourcePath:r.resourcePath,before:w(r.source),after:s.bytes}),{persisted:!0,file:t.file,detail:`${e.property} → ${t.display}`}):{persisted:!1,reason:o.error??"the write was refused"}}async recordEdit(e,t){const a=this.history,r=this.ensureLiveResource(),s=g(this.backend,a,t),n={objects:{[e.entityId]:{[e.property]:e.baseline}}},o={objects:{[e.entityId]:{[e.property]:e.next}}};await a.recordAppliedTransaction({label:e.label,resources:[s.resource,r],scope:"project"},[s,{resource:r,beforeBytes:u.encode(JSON.stringify(n)),afterBytes:u.encode(JSON.stringify(o)),contentType:"application/json"}])}async post(e,t){return await(await this.fetchImpl(e,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)})).json()}ensureLiveResource(){if(this.liveResourceKey)return this.liveResourceKey;const e=this.history,t=e.registry.registerProject("overlay",".vgai/ingest-live-objects","Ingested game objects"),a={descriptor:t,capture:async()=>{const r=u.encode(JSON.stringify({objects:{}}));return{revision:0,contentType:"application/json",bytes:r,sha256:await S(r)}},preflight:async()=>({ok:!0}),restore:async r=>{const s=JSON.parse(E.decode(e.snapshots.read(r).bytes));for(const[n,o]of Object.entries(s.objects))for(const[c,v]of Object.entries(o))this.live.apply(n,c,v)},estimateBytes:r=>r.byteLength};return this.unregisterLive=e.registerDriver(a),this.liveResourceKey=t.key,t.key}}function A(i,e){m.warn(`[ingest] ${i} stayed live-only — ${e}.`)}export{N as I,_ as a,k as b,R as d,D as i,y as l,A as r,x as s};
@@ -1 +0,0 @@
1
- import{a7 as i,q as e,M as p}from"./index-CaG87ZF-.js";import{i as s,a as m}from"./registry-Z28XSZHF.js";import{a}from"./mount-ingest-root-BC3-1Cw1.js";import{t as n}from"./three-state-wXRU3rLr.js";import"./index-nmcBqr7Y.js";import"./_commonjsHelpers-D6-XlEtG.js";import"./index-D_NuPfjr.js";import"./jsx-runtime-DPjLkJKQ.js";import"./index-CtzuWnCS.js";import"./index-CinJrH5C.js";import"./index-FUuS4qwW.js";import"./client-DNXj_opT.js";import"./active-ingest-CnAeQcuQ.js";import"./game-contract-seams-C0AVYwvO.js";import"./capability-coverage-DQgg6UJe.js";import"./ingest-source-persistence-6peGfPAS.js";import"./contract-system-adapters-h6OUBRYA.js";import"./editor-shell-store-Bh1S7M54.js";import"./output-pass-HurwNl0G.js";import"./three.module-BLhyNg0e.js";import"./three.core-3arARmh6.js";import"./Pass-D1MRT672.js";import"./editor-layers-B4oYfpj8.js";import"./workspace-arrangement-DIMM7ska.js";import"./user-data-CqOoAowZ.js";import"./entity-object-B_5Gc0Ky.js";import"./three-contract-Dkt6PmWY.js";const B="workspace.service";function E(){const o=i({id:"in-tree-ingest-registry",owner:"@volter/editor-game/contributions/ingest.service.ts",modulePathFor:t=>m(t),importModule:async t=>await s(t)}),r=e().project.onReady(async()=>{const t=n();if(!t){p.error("Ingest auto-launch skipped: the editor shell store had not arrived at project ready.","ingest");return}await a(t)});return()=>{r(),o()}}export{B as point,E as start};
@@ -1 +0,0 @@
1
- const h=new Set([".git",".vgai","build","coverage","dist","node_modules","out"]),l=new Set([".js",".jsx",".mjs",".ts",".tsx"]),p=500,f=4;function u(t){const s=t.lastIndexOf(".");return s<0?"":t.slice(s).toLowerCase()}function m(t){if(!t||typeof t!="object")return new Set;const s=t,a=new Set;for(const n of["dependencies","devDependencies","peerDependencies"]){const e=s[n];if(!(!e||typeof e!="object"))for(const r of Object.keys(e))a.add(r)}return a}async function g(t){if(!await t.exists("package.json"))return new Set;try{return m(JSON.parse(await t.read("package.json")))}catch{return new Set}}async function y(t){const s=[],a=[{path:"",depth:0}];for(;a.length>0&&s.length<p;){const n=a.shift();if(!n)break;let e;try{e=await t.list(n.path)}catch{continue}for(const r of e)if(r.type==="dir")n.depth<f&&!h.has(r.name)&&a.push({path:r.path,depth:n.depth+1});else if((l.has(u(r.path))||r.path==="index.html")&&(s.push(r.path),s.length>=p))break}return s}function w(t){const s=["src/vgai-entry.tsx","src/vgai-entry.ts","src/vgai-host.tsx","src/vgai-host.ts","src/adapter.tsx","src/adapter.ts","src/main.tsx","src/main.ts","src/index.tsx","src/index.ts","src/main.jsx","src/main.js","src/index.jsx","src/index.js","index.html"],a=new Set(t),n=s.filter(e=>a.has(e));return[...n,...t.filter(e=>!n.includes(e))].slice(0,8)}async function x(t){if(await t.exists("vgai.project.json"))return{workspaceState:"vgai-project",detectedTechnologies:["Volter Editor"],suggestedSurface:null,entryCandidates:[],adaptationBlockers:[],hasManifest:!0,writesPerformed:!1,summary:"This folder is already a Volter Editor project.",nextAction:"Open it in the editor."};if((await t.list("")).length===0)return{workspaceState:"empty-folder",detectedTechnologies:[],suggestedSurface:null,entryCandidates:[],adaptationBlockers:[],hasManifest:!1,writesPerformed:!1,summary:"This folder is empty.",nextAction:"Create a new Volter Editor project here."};const a=await g(t),n=await y(t),e=[];a.has("@react-three/fiber")&&e.push("React Three Fiber"),a.has("three")&&e.push("three.js"),(a.has("pixi.js")||[...a].some(i=>i.startsWith("@pixi/")))&&e.push("PixiJS"),a.has("react")&&e.push("React"),a.has("vite")&&e.push("Vite");const r=e.some(i=>i==="three.js"||i==="React Three Fiber")?"three":e.includes("PixiJS")?"canvas":e.includes("React")?"dom":null,o=w(n),c=[];if(r&&o.length===0&&c.push("No JavaScript or TypeScript entry candidate was found."),r==="dom"&&o[0]){let i="";try{i=await t.read(o[0])}catch{c.push(`The suggested React entry ${o[0]} could not be read.`)}/\b(?:ReactDOM\s*\.\s*render|createRoot|hydrateRoot)\s*\(/.test(i)?c.push(`The React app mounts itself in ${o[0]}; Volter Editor ingest requires a host-shim module that default-exports the mounted component and preserves the app's providers.`):/\bexport\s+default\b/.test(i)||c.push(`The React entry ${o[0]} does not default-export a component; create a host-shim module that does before adding Volter Editor metadata.`)}const d=r!==null&&c.length===0;return{workspaceState:d?"adaptable-project":"unknown-project",detectedTechnologies:e,suggestedSurface:r,entryCandidates:o,adaptationBlockers:c,hasManifest:!1,writesPerformed:!1,summary:d?`This looks like an existing ${e.join(" + ")||"web"} project.`:r?`This ${e.join(" + ")||"web"} project needs an adapter step before Volter Editor metadata can be added safely.`:"This folder is not empty, but its game framework could not be identified.",nextAction:d?"Review the detected entry and adapter, then add Volter Editor metadata without rewriting the game source.":c[0]??"Choose the entry point and adapter explicitly before adding Volter Editor metadata."}}function j(t,s){const a=s.surface??t.suggestedSurface,n=s.entry??t.entryCandidates[0],e=n?.replace(/\\/g,"/"),r=e!==void 0&&(e.startsWith("/")||e.startsWith("//")||/^[A-Za-z]:\//.test(e)||e.split("/").includes("..")),o=t.workspaceState==="unknown-project"&&s.surface!==void 0&&s.entry!==void 0;if(t.workspaceState!=="adaptable-project"&&!o||!a||!n||r)throw new Error(r?"Adapter entry must be a project-relative path that stays inside the selected folder.":t.adaptationBlockers[0]??"Choose a supported adapter surface and source entry before adapting this folder.");return{manifestVersion:2,name:s.name,version:"0.1.0",engine:{version:s.engineVersion},roots:[{id:"game",adapter:{surface:a,ingest:{}},entry:n}]}}export{j as createIngestManifest,x as inspectProject};
@@ -1 +0,0 @@
1
- import{aa as m}from"./index-CaG87ZF-.js";import{b as p,a as e,c as n,s}from"./game-network-Bo_nlDR5.js";import"./index-nmcBqr7Y.js";import"./_commonjsHelpers-D6-XlEtG.js";import"./index-D_NuPfjr.js";import"./jsx-runtime-DPjLkJKQ.js";import"./index-CtzuWnCS.js";import"./index-CinJrH5C.js";import"./index-FUuS4qwW.js";import"./client-DNXj_opT.js";import"./index-OZVqp6xS.js";import"./index-Da9JhEvW.js";import"./native-debug-module-B-rWJfWE.js";import"./native-entry-surface-BE8LJNdu.js";import"./debug-registry-l7k5Hjc8.js";import"./contract-system-adapters-h6OUBRYA.js";import"./game-contract-seams-C0AVYwvO.js";import"./seeded-random-38To73fI.js";import"./game-audio-CaGKzia4.js";import"./rapier-physics-adapter-CaZqWLu0.js";import"./events-156d8d12.esm-CYeuVCYr.js";import"./three.module-BLhyNg0e.js";import"./three.core-3arARmh6.js";import"./index-bQE2NA0D.js";import"./live-project-verbs-BOAQN3ME.js";import"./capability-coverage-DQgg6UJe.js";import"./edit-mode-authoring-DBjaBTxM.js";import"./json-history-resource-CTXRV4GD.js";import"./binding-resolver-C_9MBSMa.js";import"./adapter-surface-Y37Nzcyw.js";import"./structural-signature-Dc7skRiy.js";import"./webgl-frame-capture-DdJkM2mi.js";import"./realm-services-DefTrXnY.js";import"./canvas-entry-runtime-DVeh71nC.js";import"./three-ingest-runtime-CXKjNysA.js";import"./EffectComposer-BEAt0PtQ.js";import"./CopyShader-BzTUYzf6.js";import"./ShaderPass-DTnDQXm0.js";import"./Pass-D1MRT672.js";import"./CSS3DRenderer-BsAqfavI.js";import"./relative-path-guard-GiM7Lsz8.js";import"./react-root-BHA-cdrW.js";import"./editor-presentation-activity-C7SNSmTd.js";import"./active-ingest-CnAeQcuQ.js";import"./ingest-source-persistence-6peGfPAS.js";import"./pixi-story-model-DNkfnWUV.js";import"./surface-content-Dg9Kkazf.js";import"./viewport-root-presentation-B35t51xX.js";import"./mounted-authoring-B7RL_V28.js";import"./entity-object-B_5Gc0Ky.js";import"./user-data-CqOoAowZ.js";import"./workspace-arrangement-DIMM7ska.js";import"./three-contract-Dkt6PmWY.js";import"./three-oYrcK5SQ.js";import"./editor-layers-B4oYfpj8.js";import"./component-instance-root-df4ofoOR.js";import"./viewport-editor-controls-BYaAZ_Ku.js";import"./three-authoring-adapter-BrkGH4cd.js";import"./source-persistence-backend-HviqjKZ2.js";import"./three-projection-core-jBJVt6O0.js";import"./body-marks-RKb_LTwL.js";import"./user-data-dHvLdpwM.js";import"./object-marks-DwvIEBOK.js";import"./structural-ids-Br2zjINh.js";import"./object3d-authoring-subject-BDrxd1GA.js";import"./r3f-physics-binding-Bgzzd4ol.js";import"./deferred-ingest-play-Bej67_y9.js";import"./rrweb-Cd2ifIRP.js";import"./react-world-authoring-adapter-C1jPW_cN.js";import"./board-guides-_3R1t_-2.js";import"./relative-import-specifier-DQzkawgj.js";import"./story-arg-descriptors-Ek86ExX7.js";import"./inspect-C8RP8G5F.js";import"./inference-diagnostics-MGcIHEX6.js";import"./writer-tw6EcuVO.js";import"./three-state-wXRU3rLr.js";import"./editor-shell-store-Bh1S7M54.js";import"./output-pass-HurwNl0G.js";import"./viewport-door-DVkMQazS.js";const jt="workspace.command",a=()=>({ok:!1,error:"not in play mode — start play before using the debug seam"}),zt={"set-instance-count":{derivedRefresh:"always",handle:o=>{if(!e())return a();const r=o.names;if(Array.isArray(r)&&r.every(i=>typeof i=="string"))return r.length<1?{ok:!1,error:'set-instance-count "names" must have at least one entry.'}:(n(r),{ok:!0});const t=o.count;return typeof t!="number"||!Number.isFinite(t)||t<1?{ok:!1,error:`set-instance-count requires a whole "count" >= 1 (or a "names" array), got ${String(t)}.`}:(s(Math.floor(t)-1),{ok:!0})}},"list-instances":{derivedRefresh:"if-content-changed",handle:()=>({ok:!0,data:{instances:m(),named:p()}})}};export{zt as commands,jt as point};
@@ -1 +0,0 @@
1
- import{r as t,bz as e,u as i,e0 as o,by as a,bx as s}from"./index-CaG87ZF-.js";import"./index-nmcBqr7Y.js";import"./_commonjsHelpers-D6-XlEtG.js";import"./index-D_NuPfjr.js";import"./jsx-runtime-DPjLkJKQ.js";import"./index-CtzuWnCS.js";import"./index-CinJrH5C.js";import"./index-FUuS4qwW.js";import"./client-DNXj_opT.js";const n=t({type:s(["standard","physical","basic","toon"]).describe("Material shading model"),color:i().optional().describe('Base color as CSS hex string (e.g. "#ff0000")'),metalness:e().optional().describe("Metalness factor 0–1 (standard/physical only)"),roughness:e().optional().describe("Roughness factor 0–1 (standard/physical only)"),map:i().optional().describe("Path to albedo/diffuse texture image"),normalMap:i().optional().describe("Path to normal map texture image"),emissive:i().optional().describe("Emissive color as CSS hex string"),emissiveIntensity:e().optional().describe("Emissive light intensity multiplier"),emissiveMap:i().optional().describe("Path to emissive map texture image"),aoMap:i().optional().describe("Path to ambient occlusion map texture image"),lightMap:i().optional().describe("Path to a baked lightmap texture (uses the mesh's second UV set). Applies the pre-baked GI/shadow result on top of the material."),lightMapIntensity:e().optional().describe("Lightmap intensity multiplier (default 1)."),roughnessMap:i().optional().describe("Path to roughness map texture image"),metalnessMap:i().optional().describe("Path to metalness map texture image"),opacity:e().optional().describe("Opacity 0–1. Set transparent: true to enable"),transparent:a().optional().describe("Enable alpha blending for this material"),side:s(["front","back","double"]).optional().describe("Which face sides to render"),flatShading:a().optional().describe("Use flat (faceted) shading instead of smooth"),clearcoat:t({clearcoat:e().describe("Clearcoat layer intensity 0–1"),clearcoatRoughness:e().optional().describe("Clearcoat roughness 0–1"),clearcoatMap:i().optional().describe("Path to clearcoat intensity map"),clearcoatRoughnessMap:i().optional().describe("Path to clearcoat roughness map")}).optional().describe("Clearcoat layer (physical only)"),transmission:t({transmission:e().describe("Transmission intensity 0–1 (glass, liquid)"),ior:e().optional().describe("Index of refraction (default 1.5)"),thickness:e().optional().describe("Volume thickness for refraction"),attenuationColor:i().optional().describe("Color absorbed over distance"),attenuationDistance:e().optional().describe("Distance at which attenuation color takes full effect"),transmissionMap:i().optional().describe("Path to transmission map")}).optional().describe("Light transmission (physical only)"),sheen:t({sheen:e().describe("Sheen intensity 0–1 (fabric, velvet)"),sheenColor:i().optional().describe("Sheen tint color"),sheenRoughness:e().optional().describe("Sheen roughness 0–1"),sheenColorMap:i().optional().describe("Path to sheen color map"),sheenRoughnessMap:i().optional().describe("Path to sheen roughness map")}).optional().describe("Sheen layer (physical only)"),iridescence:t({iridescence:e().describe("Iridescence intensity 0–1 (soap bubbles, oil slick)"),iridescenceIOR:e().optional().describe("Thin-film IOR (default 1.3)"),iridescenceThicknessRange:o([e(),e()]).optional().describe("Min/max thin-film thickness in nm"),iridescenceMap:i().optional().describe("Path to iridescence intensity map"),iridescenceThicknessMap:i().optional().describe("Path to iridescence thickness map")}).optional().describe("Iridescence thin-film (physical only)"),displacementMap:i().optional().describe("Path to displacement/height map"),displacementScale:e().optional().describe("Displacement height multiplier"),displacementBias:e().optional().describe("Displacement offset")}).strict(),g=n.describe("Material appearance properties");export{g as MaterialDescriptorSchema};
@@ -1 +0,0 @@
1
- .vgai-model-inspector-actions{display:flex;justify-content:flex-end;padding:var(--vgai-space-2) var(--vgai-space-3) 0}.vgai-model-inspector-row>div{display:grid;min-width:0}.vgai-model-inspector-list{display:grid;max-height:360px;gap:var(--vgai-space-2);overflow:auto}.vgai-model-inspector-row{display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:center;gap:var(--vgai-space-3);padding:var(--vgai-space-3)}.vgai-model-inspector-row:has(.vgai-model-material-swatch){grid-template-columns:auto minmax(0,1fr) auto}.vgai-model-material-swatch{width:var(--vgai-control-default-height);height:var(--vgai-control-default-height);border:var(--vgai-stroke-resting) solid var(--vgai-boundary-strong);border-radius:var(--vgai-radius-sm);background-color:var(--vgai-surface-inset)}
@@ -1 +0,0 @@
1
- import{a as e}from"./jsx-runtime-DPjLkJKQ.js";import{a as D}from"./three-contract-Dkt6PmWY.js";import{i as N,a as I,b as A,m as P}from"./model-inspection-MrJY0U_-.js";import{eH as y,eJ as V,cP as B,eI as p,gW as F,eN as w,gX as E,gY as G,dK as z,dv as m,ew as M,dU as v,a0 as O,a1 as L,fa as j,fb as t,aJ as x,aL as U,gZ as R,$ as T,eT as _,dp as q,g_ as W,g$ as Z,h0 as J,h1 as H}from"./index-CaG87ZF-.js";import{S as $}from"./source-object3d-authoring-adapter-RmutT5Dt.js";import{a as K}from"./project-provenance-4ldz-EOG.js";import{object3DAuthoringSubjectOf as Y}from"./object3d-authoring-subject-BDrxd1GA.js";import{getUserData as S}from"./user-data-dHvLdpwM.js";import{r as b}from"./index-nmcBqr7Y.js";import"./index-CtzuWnCS.js";import{fo as Q}from"./three.core-3arARmh6.js";import"./_commonjsHelpers-D6-XlEtG.js";import"./user-data-CqOoAowZ.js";import"./workspace-arrangement-DIMM7ska.js";import"./index-FUuS4qwW.js";import"./client-DNXj_opT.js";import"./index-D_NuPfjr.js";import"./index-CinJrH5C.js";import"./editor-layers-B4oYfpj8.js";import"./three-oYrcK5SQ.js";import"./component-instance-root-df4ofoOR.js";import"./entity-object-B_5Gc0Ky.js";import"./viewport-editor-controls-BYaAZ_Ku.js";import"./three-projection-core-jBJVt6O0.js";import"./object-marks-DwvIEBOK.js";function X(n,s){return s instanceof $&&n?.id===s.documentId}function ee(n,s){return s instanceof $&&n!==null&&n.id!==s.documentId}function r({children:n,code:s=!1}){return e.jsx(x,{variant:s?"code":"body",selectable:!0,truncate:!0,title:typeof n=="string"?n:void 0,children:n})}function C(n){let s=null;return n?.traverse(i=>{!s&&S(i,"gaussianSplat")&&(s=i)}),s}function ne({splat:n}){const s=S(n,"gaussianSplat"),i=n.getBoundingBox().getSize(new Q);return e.jsxs(j,{children:[e.jsx(t,{label:"Gaussians",children:e.jsx(r,{children:s.numSplats.toLocaleString()})}),e.jsx(t,{label:"Format",children:e.jsx(r,{children:"SPZ"})}),e.jsx(t,{label:"Bounds",children:e.jsx(r,{children:`${i.x.toFixed(2)} × ${i.y.toFixed(2)} × ${i.z.toFixed(2)}`})}),e.jsx(t,{label:"Level of detail",children:e.jsx(r,{children:"Full source"})}),e.jsx(t,{label:"Picking",children:e.jsx(r,{children:"Gaussian raycast"})}),e.jsx(t,{label:"Collision",hint:"Gaussian splats are visual environment data; use a separate mesh collider.",children:e.jsx(r,{children:"Separate collider required"})})]})}function te({inspection:n,rig:s}){if(!n)return e.jsx(M,{compact:!0,tone:"error",title:"Model unavailable",description:"The native Object3D graph could not be inspected."});const i=[...n.meshes===0?["The asset has no renderable geometry."]:[],...n.geometry.nonFiniteAttributeValues>0?[`${n.geometry.nonFiniteAttributeValues.toLocaleString()} non-finite geometry values can break bounds and selection.`]:[],...s&&!s.valid?["Rig or animation bindings require attention."]:[]];return e.jsxs(e.Fragment,{children:[i.length>0&&e.jsx(v,{tone:"warning",icon:e.jsx(O,{icon:L.status.warning}),children:e.jsx("div",{children:i.map(o=>e.jsx("div",{children:o},o))})}),e.jsxs(j,{children:[e.jsx(t,{label:"Meshes",children:e.jsx(r,{children:n.meshes.toLocaleString()})}),e.jsx(t,{label:"Primitives",children:e.jsx(r,{children:n.primitives.toLocaleString()})}),e.jsx(t,{label:"Vertices",children:e.jsx(r,{children:n.vertices.toLocaleString()})}),e.jsx(t,{label:"Triangles",children:e.jsx(r,{children:n.triangles.toLocaleString()})}),e.jsx(t,{label:"Indexing",children:e.jsxs(r,{children:[n.geometry.indexedMeshes," indexed · ",n.geometry.nonIndexedMeshes," ","non-indexed"]})}),e.jsx(t,{label:"Attributes",children:e.jsx(r,{children:n.geometry.attributes.map(o=>o.name).join(", ")||"None"})}),e.jsx(t,{label:"UV channels",children:e.jsx(r,{children:n.geometry.uvChannels.join(", ")||"None"})}),e.jsx(t,{label:"Morph targets",children:e.jsx(r,{children:n.morphTargets})}),e.jsx(t,{label:"Bounds",children:e.jsx(r,{children:n.bounds?`${n.bounds.x.toFixed(2)} × ${n.bounds.y.toFixed(2)} × ${n.bounds.z.toFixed(2)}`:"None"})}),e.jsx(t,{label:"GPU estimate",children:e.jsxs(r,{children:[(n.memoryBytes/1048576).toFixed(2)," MiB"]})}),e.jsx(t,{label:"Invalid values",children:e.jsx(x,{tone:n.geometry.nonFiniteAttributeValues?"warning":"muted",children:n.geometry.nonFiniteAttributeValues.toLocaleString()})}),e.jsx(t,{label:"LODs",children:e.jsx(r,{children:n.geometry.lodGroups?`${n.geometry.lodLevels} levels`:"Not authored"})}),e.jsx(t,{label:"Collision",hint:"Collision remains a source/import operation when no model metadata exists.",children:e.jsx(r,{children:"Not authored"})})]})]})}function se({rig:n}){const s=[["Non-normalized weights",n.nonNormalizedVertices],["Zero-weight vertices",n.zeroWeightVertices],["Invalid joint indices",n.invalidJointIndices],["Inverse-bind mismatches",n.inverseBindMismatches],["External bones",n.externalBones],["Non-finite animation values",n.nonFiniteAnimationValues],["Unresolved track targets",n.unresolvedTrackTargets.length]];return e.jsxs(e.Fragment,{children:[!n.valid&&e.jsx(v,{tone:"warning",icon:e.jsx(O,{icon:L.status.warning}),children:"Review the non-zero integrity checks below."}),e.jsxs(j,{children:[e.jsx(t,{label:"Deformation",children:e.jsx(r,{children:n.kind==="skinned"?"Skinned mesh":"Rigid attachments"})}),e.jsx(t,{label:"Bones",children:e.jsx(r,{children:n.uniqueBones})}),e.jsx(t,{label:"Root bones",children:e.jsx(r,{children:n.rootBones.join(", ")||"None"})}),n.kind==="skinned"?e.jsxs(e.Fragment,{children:[e.jsx(t,{label:"Skeletons",children:e.jsx(r,{children:n.skeletons})}),e.jsx(t,{label:"Bind mode",children:e.jsx(r,{children:n.bindModes.join(", ")||"None"})}),e.jsx(t,{label:"Weighted vertices",children:e.jsx(r,{children:n.weightedVertices.toLocaleString()})})]}):null,s.filter(([,i])=>i>0).map(([i,o])=>e.jsx(t,{label:i,children:e.jsx(x,{tone:"warning",children:o.toLocaleString()})},i)),n.unresolvedTrackTargets.length?e.jsx(t,{label:"Missing targets",children:e.jsx(r,{children:n.unresolvedTrackTargets.join(", ")})}):null]})]})}function re({adapter:n,inspection:s}){const[i,o]=b.useState(""),a=n.documentRootObject,d=(s?.materialSlots??[]).map((l,u)=>({material:l,rowKey:`${l.id}:${u}`})).filter(({material:l})=>`${l.name} ${l.type} ${l.textureSlots.join(" ")}`.toLowerCase().includes(i.trim().toLowerCase())),c=l=>{if(!a)return;const u=P(a,{id:l})[0],g=u?n.hierarchy.idForObject3D?.(u):null;g&&_(n,[g])};return e.jsxs(e.Fragment,{children:[e.jsx(j,{children:e.jsx(t,{label:"Filter",htmlFor:"model-material-filter",children:e.jsx(U,{id:"model-material-filter",type:"search",value:i,placeholder:"Name, type, or map",onChange:l=>o(l.target.value)})})}),e.jsxs("div",{className:"vgai-model-inspector-list",children:[d.map(({material:l,rowKey:u})=>e.jsxs(R,{variant:"raised",border:!0,className:"vgai-model-inspector-row",children:[e.jsx("span",{className:"vgai-model-material-swatch",style:{background:l.color??void 0},"aria-hidden":"true"}),e.jsxs("div",{children:[e.jsx(x,{as:"strong",variant:"label",truncate:!0,children:l.name}),e.jsxs(x,{variant:"caption",tone:"muted",truncate:!0,children:[l.type," · ",l.usageCount," object",l.usageCount===1?"":"s"," ","· ",l.textureSlots.join(", ")||"no maps",l.transparent?" · transparent":""]})]}),e.jsx(T,{type:"button",variant:"ghost",size:"compact",onClick:()=>c(l.id),children:"Inspect"})]},u)),d.length===0?e.jsx(M,{compact:!0,title:"No matching materials"}):null]})]})}function ie({adapter:n,provenance:s,provenanceLoaded:i}){b.useSyncExternalStore(q,W);const o=s?Z().find(a=>a.tool?.name===s.operationName):void 0;return e.jsxs(e.Fragment,{children:[o?e.jsx("div",{className:"vgai-model-inspector-actions",children:e.jsx(T,{type:"button",variant:"ghost",size:"compact",onClick:()=>J(o.id),children:"Open Source"})}):null,e.jsxs(j,{children:[e.jsx(t,{label:"Path",children:e.jsx(r,{code:!0,children:n.options.sourcePath})}),e.jsx(t,{label:"Truth",children:e.jsx(r,{children:n.provenance.label})}),e.jsx(t,{label:"Ownership",hint:n.provenance.detail,children:e.jsx(r,{children:n.provenance.source})}),i?null:e.jsx(t,{label:"Provenance",children:e.jsx(r,{children:"Loading…"})}),s?e.jsxs(e.Fragment,{children:[e.jsx(t,{label:"Generated by",children:e.jsx(r,{children:s.operationName})}),e.jsx(t,{label:"Tool",children:e.jsx(r,{code:!0,children:s.operationSource??"Not recorded"})}),e.jsx(t,{label:"Generated",children:e.jsx(r,{children:new Date(s.createdAt).toLocaleString()})}),e.jsx(t,{label:"Output hash",children:e.jsx(r,{code:!0,children:s.output.sha256})})]}):i?e.jsx(t,{label:"Provenance",children:e.jsx(r,{children:"Not recorded"})}):null]})]})}const k=new WeakMap;function oe(n){const s=n.documentRootObject??null;if(!s)return;const i=k.get(s);if(i!==void 0)return i??void 0;const o=C(s)?null:N(s),a=o?`${o.meshes} meshes · ${o.triangles.toLocaleString()} triangles`:null;return k.set(s,a),a??void 0}function le({adapter:n}){const s=n,[i,o]=b.useState(null),[a,d]=b.useState(!1),c=s.options.modelSource,l=c?.kind==="project-file"?c.path:null;return b.useEffect(()=>{let u=!1;if(d(!1),!l){o(null),d(!0);return}return K(l).then(g=>{u||(o(g),d(!0))},()=>{u||(o(null),d(!0))}),()=>{u=!0}},[l]),e.jsx("div",{"data-testid":"model-asset-inspector",children:e.jsx(ie,{adapter:s,provenance:i,provenanceLoaded:a})})}function ae({inspection:n}){return e.jsxs(j,{children:[e.jsx(t,{label:"Native type",children:e.jsx(r,{children:n.type})}),e.jsx(t,{label:"Visible",children:e.jsx(r,{children:n.visible?"Yes":"No"})}),e.jsx(t,{label:"Children",children:e.jsx(r,{children:n.children})}),e.jsx(t,{label:"Descendants",children:e.jsx(r,{children:n.descendants})}),e.jsx(t,{label:"Render order",children:e.jsx(r,{children:n.renderOrder})}),e.jsx(t,{label:"Layer mask",children:e.jsxs(r,{code:!0,children:["0x",n.layers.toString(16)]})})]})}function de({geometry:n}){return e.jsxs(e.Fragment,{children:[n.nonFiniteAttributeValues?e.jsxs(v,{tone:"warning",children:[n.nonFiniteAttributeValues.toLocaleString()," non-finite buffer values can break bounds, picking, and selection outlines."]}):null,e.jsxs(j,{children:[e.jsx(t,{label:"Vertices",children:e.jsx(r,{children:n.vertices.toLocaleString()})}),e.jsx(t,{label:"Triangles",children:e.jsx(r,{children:n.triangles.toLocaleString()})}),e.jsx(t,{label:"Index buffer",children:e.jsx(r,{children:n.indexed?"Indexed":"Non-indexed"})}),e.jsx(t,{label:"Attributes",children:e.jsx(r,{children:n.attributes.join(", ")})}),e.jsx(t,{label:"UV channels",children:e.jsx(r,{children:n.uvChannels.join(", ")||"None"})}),e.jsx(t,{label:"Morph targets",children:e.jsx(r,{children:n.morphTargets})}),e.jsx(t,{label:"Invalid values",children:e.jsx(x,{tone:n.nonFiniteAttributeValues?"warning":"muted",children:n.nonFiniteAttributeValues.toLocaleString()})})]})]})}function ce({materials:n}){return e.jsx("div",{className:"vgai-model-inspector-list",children:n.map(s=>e.jsxs(R,{variant:"raised",border:!0,className:"vgai-model-inspector-row",children:[e.jsx("span",{className:"vgai-model-material-swatch",style:{background:s.color??void 0},"aria-hidden":"true"}),e.jsxs("div",{children:[e.jsx(x,{as:"strong",variant:"label",truncate:!0,children:s.name}),e.jsxs(x,{variant:"caption",tone:"muted",truncate:!0,children:[s.type," · ",s.textureSlots.join(", ")||"no maps"]})]})]},s.id))})}function ue({skin:n}){return e.jsxs(j,{children:[e.jsx(t,{label:"Bones",children:e.jsx(r,{children:n.bones})}),e.jsx(t,{label:"Root bones",children:e.jsx(r,{children:n.rootBones.join(", ")||"None"})}),e.jsx(t,{label:"Bind mode",children:e.jsx(r,{children:n.bindMode})})]})}function he({bone:n}){return e.jsxs(j,{children:[e.jsx(t,{label:"Parent",children:e.jsx(r,{children:n.parent??"Skeleton root"})}),e.jsx(t,{label:"Children",children:e.jsx(r,{children:n.children.join(", ")||"None"})})]})}const h={splat:m,geometry:m+10,rig:m+20,materials:m+40,source:m+50},je=new WeakMap,xe=new WeakMap,me=new WeakMap;function f(n,s,i){const o=n.get(s);if(o!==void 0)return o;const a=i();return n.set(s,a),a}function be(n){const s=n,i=s.documentRootObject,o=[],a=C(i);if(i&&a){const d=S(a,"gaussianSplat");o.push({id:"splat",title:"Gaussian Splat",icon:H,order:h.splat,description:`${d.numSplats.toLocaleString()} Gaussians · native SPZ`,body:{kind:"custom",render:()=>e.jsx(ne,{splat:a})}})}else if(i){const d=f(je,i,()=>N(i)),c=f(xe,i,()=>I(i)),l=oe(n);o.push({id:p,title:"Geometry",icon:B,order:h.geometry,...l?{description:l}:{},body:{kind:"custom",render:()=>e.jsx(te,{inspection:d,rig:c})}}),(c.skinnedMeshes>0||c.uniqueBones>0)&&o.push({id:"rig",title:"Rig",icon:F,order:h.rig,description:c.kind==="skinned"?`${c.uniqueBones} bones · ${c.skinnedMeshes} skinned meshes`:`${c.uniqueBones} bones · rigid hierarchy`,body:{kind:"custom",render:()=>e.jsx(se,{rig:c})}}),o.push({id:"materials",title:"Materials",icon:w,order:h.materials,description:`${d.materials} materials`,body:{kind:"custom",render:()=>e.jsx(re,{adapter:s,inspection:d})}})}return o.push({id:"source",title:"Source",icon:E,order:h.source,description:s.provenance.label,defaultOpen:!1,body:{kind:"custom",render:()=>e.jsx(le,{adapter:n})}}),s.options.audit===!1?o.filter(d=>d.id!==p&&d.id!=="source"):o}function ge(n,s){const i=n?D(s.hierarchy,n.id):null;if(!i)return[];if(Y(i))return[];const o=f(me,i,()=>A(i)),a=[{id:p,title:"Object",icon:G,order:h.geometry,description:o.type,body:{kind:"custom",render:()=>e.jsx(ae,{inspection:o})}}],d=o.geometry;d&&a.push({id:"geometry",title:"Geometry",icon:B,order:h.geometry+1,description:`${d.triangles.toLocaleString()} triangles`,body:{kind:"custom",render:()=>e.jsx(de,{geometry:d})}}),o.materials.length>0&&a.push({id:"materials",title:"Materials",icon:w,order:h.materials,description:`${o.materials.length} slots`,body:{kind:"custom",render:()=>e.jsx(ce,{materials:o.materials})}});const c=o.skin;c&&a.push({id:"skin",title:"Skin",icon:F,order:h.rig,description:`${c.bones} bones`,body:{kind:"custom",render:()=>e.jsx(ue,{skin:c})}});const l=o.bone;return l&&a.push({id:"bone",title:"Bone",icon:z,order:h.rig+1,description:l.parent??"Skeleton root",body:{kind:"custom",render:()=>e.jsx(he,{bone:l})}}),a}const pe=V();function fe(){pe.ensure(n=>{n(y({match:X,sections:(s,i)=>be(i)})),n(y({match:ee,sections:ge}))})}const qe="workspace.service";function We(){return fe(),()=>{}}export{qe as point,We as start};
@@ -1,2 +0,0 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/create-runtime-Bg2uYMfh.js","assets/adapter-surface-Y37Nzcyw.js","assets/binding-Bmxqznjk.js","assets/root-stacking-BEd9ZvxC.js","assets/assets-BcrMQHRv.js","assets/loader-BTUKnX5Q.js","assets/KTX2Loader-CaqVE6nY.js","assets/three.module-BLhyNg0e.js","assets/three.core-3arARmh6.js","assets/GLTFLoader-KeoruJgS.js","assets/BufferGeometryUtils-B22h7jo4.js","assets/setup-renderer-OOw1SykJ.js","assets/index-DHhMOs_s.js","assets/defaults-DKiBJCPN.js","assets/render-settings-BBvkacR3.js","assets/render-features-C7QwmhCo.js","assets/index-CaG87ZF-.js","assets/index-nmcBqr7Y.js","assets/_commonjsHelpers-D6-XlEtG.js","assets/index-D_NuPfjr.js","assets/jsx-runtime-DPjLkJKQ.js","assets/index-CtzuWnCS.js","assets/index-CinJrH5C.js","assets/index-FUuS4qwW.js","assets/client-DNXj_opT.js","assets/index-B5WjeCHm.css","assets/seeded-random-38To73fI.js","assets/debug-registry-l7k5Hjc8.js","assets/loop-gate-report-N52EWFGD.js","assets/system-slot-E2mEdiih.js","assets/user-data-dHvLdpwM.js","assets/object-marks-DwvIEBOK.js","assets/performance-profiler-OwnXQX0M.js"])))=>i.map(i=>d[i]);
2
- import{x as v,y as R,a9 as _,M as s,bo as b,bp as A,av as I,bq as P,br as S,bs as M,bt as g,bu as y,bv as C,_ as E,bw as F}from"./index-CaG87ZF-.js";import{m as G}from"./capability-coverage-DQgg6UJe.js";import{r as $}from"./binding-resolver-C_9MBSMa.js";import"./index-nmcBqr7Y.js";import"./_commonjsHelpers-D6-XlEtG.js";import"./index-D_NuPfjr.js";import"./jsx-runtime-DPjLkJKQ.js";import"./index-CtzuWnCS.js";import"./index-CinJrH5C.js";import"./index-FUuS4qwW.js";import"./client-DNXj_opT.js";import"./game-contract-seams-C0AVYwvO.js";import"./native-debug-module-B-rWJfWE.js";import"./native-entry-surface-BE8LJNdu.js";import"./debug-registry-l7k5Hjc8.js";import"./contract-system-adapters-h6OUBRYA.js";import"./adapter-surface-Y37Nzcyw.js";import"./structural-signature-Dc7skRiy.js";import"./three.core-3arARmh6.js";import"./webgl-frame-capture-DdJkM2mi.js";import"./events-156d8d12.esm-CYeuVCYr.js";import"./three.module-BLhyNg0e.js";import"./index-bQE2NA0D.js";import"./realm-services-DefTrXnY.js";import"./canvas-entry-runtime-DVeh71nC.js";import"./three-ingest-runtime-CXKjNysA.js";import"./EffectComposer-BEAt0PtQ.js";import"./CopyShader-BzTUYzf6.js";import"./ShaderPass-DTnDQXm0.js";import"./Pass-D1MRT672.js";import"./CSS3DRenderer-BsAqfavI.js";import"./relative-path-guard-GiM7Lsz8.js";import"./react-root-BHA-cdrW.js";let u=null;function h(){return u!==null}function j(t,o){return t.selection?t:{...t,selection:{get:()=>[...o.shell.selectedEntityIds],set:e=>o.shell.selectMultiple(e)}}}function k(){const t=u;if(t){u=null,M(null),g(null),y(),t.store.shell.setPlayState("stopped");try{t.stop()}catch{}delete window.__vgaiModule,s.log("Module adapter mode stopped","adapter")}}async function x(t,o,e,i,r,l){const{createGameRuntime:m}=await E(async()=>{const{createGameRuntime:c}=await import("./create-runtime-Bg2uYMfh.js").then(a=>a.e);return{createGameRuntime:c}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32])),n=await $({...t,roots:[o]},e);return{session:await m({container:i,roots:n,width:r,height:l}),specs:n}}async function D(t,o,e,i){await P();const r=C();if(!r){s.error("Game container not mounted — cannot auto-mount module adapter","adapter");return}t.shell.setPlayState("playing"),s.log(`Mounting custom adapter module for world "${e.id}" (kind: ${e.surface})`,"adapter");const l=r.clientWidth||800,m=r.clientHeight||600,{session:n,specs:p}=await x(o,e,i,r,l,m),a=n.game.roots[0].mounted,f=p[0].adapter.id;u={store:t,stop:()=>n.stop()};let d;a.authoring?d=j(a.authoring,t):d=S(t.shell,`${f} (no authoring surface)`),M(d),g(a.systems??{}),t.shell.notifyIngestEdit(),y();const w=G(a);window.__vgaiModule={worldId:e.id,adapterId:f,reach:w}}async function Mt(t){const o=await v().catch(()=>null);if(o&&R(o).length>0)return!1;const e=o?_(o)[0]:void 0;if(e===void 0||e.adapter.type!=="module")return!1;const i=I();if(!i)return s.error("Manifest declares a { module } world but no project is open — cannot auto-mount","adapter"),!0;try{await D(t,o,e,i.rootPath)}catch(r){s.error(`Manifest { module } auto-mount failed: ${r}`,"adapter"),b({worldId:e.id,kind:e.surface,identity:e.adapter.identity,message:A(r)})}return!0}F({id:"module",priority:2,mounted:h,playing:h,stop:k,instanceContainer:()=>null});export{D as enterModuleModeFromManifestRoot,k as exitModuleMode,h as isModuleModeActive,x as mountModuleRootRuntime,Mt as tryManifestModuleRoute,j as withStoreSelection};
@@ -1,2 +0,0 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-CaG87ZF-.js","assets/index-nmcBqr7Y.js","assets/_commonjsHelpers-D6-XlEtG.js","assets/index-D_NuPfjr.js","assets/jsx-runtime-DPjLkJKQ.js","assets/index-CtzuWnCS.js","assets/index-CinJrH5C.js","assets/index-FUuS4qwW.js","assets/client-DNXj_opT.js","assets/index-B5WjeCHm.css"])))=>i.map(i=>d[i]);
2
- import{B as z,ey as me,f8 as he,cw as I,cx as fe,fT as ge,fk as ye,fY as ve,fZ as be,f_ as we,f$ as Se,g0 as Ce,fQ as xe,bv as X,M as g,bq as Ee,kn as _,_ as N,bs as J,bu as K,av as Ae,j as Ie,bt as Pe}from"./index-CaG87ZF-.js";import{m as P}from"./capability-coverage-DQgg6UJe.js";import{n as ke}from"./after-paint-CB4bz1-e.js";import{BabylonAuthoringAdapter as Re}from"./babylon-authoring-adapter-Cg5ALSpr.js";import{a as k,S as Y,s as Me,c as De,C as $e,D as R,G as je,B as _e,H as T,E as L,T as Te,j as q,k as Q,l as Z,r as ee,p as te,o as ne,U as Ge,K as se,u as Oe}from"./active-ingest-CnAeQcuQ.js";import{c as Le,a as Be}from"./json-history-resource-CTXRV4GD.js";import{P as Fe}from"./pixi-authoring-adapter-B42K4md-.js";import{createLiveCanvasWriteTarget as We}from"./pixi-live-write-target-D56tQEe_.js";import{a as Ne}from"./source-persistence-backend-HviqjKZ2.js";import{resolveCanvasPixiForEditor as He}from"./canvas-entry-runtime-DVeh71nC.js";import{registerPresentedPixiApps as Ve,capturePixiDisplayObjectThumbnail as Ue}from"./canvas-preview-frames-B5xFRjhQ.js";import{p as ze}from"./contract-system-adapters-h6OUBRYA.js";import{s as Xe,d as Je,f as Ke,b as re,g as Ye,e as ie,w as qe,j as Qe}from"./resolve-three-C7zDbK29.js";import{createPhysics2DRegistry as Ze}from"./physics-registry-B2Jkp8e6.js";import{composePhysicsAdapters2D as et,createPhysicsAdapter2D as tt}from"./system-adapters-rIC8FSGP.js";import{s as nt}from"./mount-ingest-root-BC3-1Cw1.js";import{landIngestBootInEdit as ae}from"./ingest-boot-viewport-D2okO6JI.js";import{a as C}from"./jsx-runtime-DPjLkJKQ.js";import{b as st}from"./react-canvas-navigation-Jowa_lJq.js";import{C as H,a as rt,b as it}from"./CanvasSceneViewport-vqBlOz8P.js";import{R as at}from"./RootSelectionOverlay-BQC12Gdd.js";import{e as ot,S as ct}from"./surface-state-D9j6qNu8.js";import{r as w}from"./index-nmcBqr7Y.js";import{b as dt,e as lt,g as ut}from"./registry-Z28XSZHF.js";import"./index-CtzuWnCS.js";import"./_commonjsHelpers-D6-XlEtG.js";import"./index-CinJrH5C.js";import"./index-D_NuPfjr.js";import"./index-FUuS4qwW.js";import"./client-DNXj_opT.js";import"./game-contract-seams-C0AVYwvO.js";import"./ingest-source-persistence-6peGfPAS.js";import"./index-C20Flc1s.js";import"./component-instance-root-df4ofoOR.js";import"./user-data-CqOoAowZ.js";import"./workspace-arrangement-DIMM7ska.js";import"./pixi-transform-channels-P4rvmusc.js";import"./debug-registry-l7k5Hjc8.js";import"./dom-authoring-adapter-CoESNvrM.js";import"./react-world-authoring-adapter-C1jPW_cN.js";import"./board-guides-_3R1t_-2.js";import"./relative-import-specifier-DQzkawgj.js";import"./story-arg-descriptors-Ek86ExX7.js";import"./inspect-C8RP8G5F.js";import"./inference-diagnostics-MGcIHEX6.js";import"./writer-tw6EcuVO.js";import"./webgl-frame-capture-DdJkM2mi.js";import"./three.core-3arARmh6.js";import"./three-state-wXRU3rLr.js";import"./editor-shell-store-Bh1S7M54.js";import"./output-pass-HurwNl0G.js";import"./three.module-BLhyNg0e.js";import"./Pass-D1MRT672.js";import"./editor-layers-B4oYfpj8.js";import"./entity-object-B_5Gc0Ky.js";import"./three-contract-Dkt6PmWY.js";import"./Toolbar-uLgsrB2z.js";import"./transform-mode-request-BnKpgRUW.js";import"./TransientHint-CgmkrmKF.js";import"./layered-pick-B_-BRrRD.js";import"./root-stacking-BEd9ZvxC.js";import"./eyedropper-session-bjPXnfeX.js";import"./react-story-board-Bx7qYytV.js";import"./viewport-editor-controls-BYaAZ_Ku.js";function pt(n){if(typeof n?.game?.scene?.getScenes=="function")return n.game;const e=n?.Phaser?.GAMES;return Array.isArray(e)?e.find(t=>typeof t?.scene?.getScenes=="function")??null:null}function mt(n){const e=n?.__vgaiBabylon?.engines,t=Array.isArray(e)?e:n?.BABYLON?.Engine?.Instances;return Array.isArray(t)?[...t].reverse().find(s=>Array.isArray(s?.scenes)&&s.scenes.length>0)??null:null}function ht(n){return[0,0,Math.sin(n/2),Math.cos(n/2)]}function ft(n){return 2*Math.atan2(n[2],n[3])}function gt(n){return encodeURIComponent(n||"unnamed")}function yt(n){return Array.isArray(n.list)?n.list:[]}class vt{constructor(e,t){this.game=e,this.store=t}capabilities={transform:!0,inspectorFields:!0,persist:!1};provenance={source:"foreign",label:"live-only",detail:"Live Phaser scene/display lists projected directly — edits apply to native game objects for this session only."};persistence={...Le(),destination:"live-only (not saved)"};indexed=new Map;listeners=new Set;refresh(){this.reindex();let e=0,t=0;for(const s of this.indexed.values())s.kind==="scene"?e++:t++;return{scenes:e,objects:t}}scenes(){const e=this.game.scene?.getScenes;if(typeof e!="function")return[];const t=e.call(this.game.scene,!0);return Array.isArray(t)?t:[]}reindex(){this.indexed.clear();for(const[e,t]of this.scenes().entries()){const s=t.sys?.settings?.key||`Scene ${e+1}`,r=`phaser:scene:${e}:${gt(s)}`,o=Array.isArray(t.children?.list)?t.children.list:[],a={id:r,label:s,role:"root",kind:"phaser-scene",typeLabel:"Phaser.Scene",parentId:null,childIds:[]};this.indexed.set(r,{kind:"scene",scene:t,node:a}),a.childIds=o.map((i,c)=>this.indexObject(i,r,`${e}/${c}`))}}indexObject(e,t,s){const r=e.type||e.constructor?.name||"GameObject",o=e.name||r,a=`phaser:object:${s}`,i={id:a,label:o,role:"entity",kind:`phaser-${r.toLowerCase()}`,typeLabel:r,parentId:t,childIds:[]};return this.indexed.set(a,{kind:"object",object:e,node:i}),i.childIds=yt(e).map((c,d)=>this.indexObject(c,a,`${s}/${d}`)),a}hierarchy={roots:()=>(this.reindex(),[...this.indexed.values()].filter(e=>e.kind==="scene").map(e=>e.node)),node:e=>(this.reindex(),this.indexed.get(e)?.node??null)};selection={get:()=>[...this.store.shell.selectedEntityIds],set:e=>{this.store.shell.selectMultiple(e),this.notify()}};transforms={dimensions:e=>(this.reindex(),this.indexed.get(e)?.kind==="object"?"2d":null),get:e=>{this.reindex();const t=this.indexed.get(e);if(!t||t.kind!=="object")return{position:[0,0,0],rotation:[0,0,0,1],scale:[1,1,1]};const s=t.object;return{position:[s.x??0,s.y??0,s.depth??0],rotation:ht(s.rotation??0),scale:[s.scaleX??1,s.scaleY??1,1]}},beginEdit:e=>{},apply:(e,t)=>{this.reindex();const s=this.indexed.get(e);!s||s.kind!=="object"||(s.object.x=t.position[0],s.object.y=t.position[1],s.object.depth=t.position[2],s.object.rotation=ft(t.rotation),s.object.scaleX=t.scale[0],s.object.scaleY=t.scale[1],this.notify())},endEdit:e=>{}};inspector={properties:e=>{this.reindex();const t=this.indexed.get(e);return t?t.kind==="scene"?[{path:"key",label:"Scene key",type:"string",readonly:!0}]:[{path:"type",label:"Type",type:"string",readonly:!0},{path:"name",label:"Name",type:"string"},{path:"active",label:"Active",type:"boolean"},{path:"visible",label:"Visible",type:"boolean"},{path:"alpha",label:"Alpha",type:"number"},{path:"depth",label:"Depth",type:"number"}]:[]},get:(e,t)=>{this.reindex();const s=this.indexed.get(e);if(s)return s.kind==="scene"?t==="key"?s.scene.sys?.settings?.key:void 0:t==="type"?s.object.type||s.object.constructor?.name:s.object[t]},set:(e,t,s)=>{this.reindex();const r=this.indexed.get(e);!r||r.kind!=="object"||t==="type"||(r.object[t]=s,this.notify())}};subscribe(e){return this.listeners.add(e),()=>this.listeners.delete(e)}dispose(){this.listeners.clear(),this.indexed.clear()}notify(){for(const e of this.listeners)e();this.store.shell.notifyIngestEdit()}}function bt(n){return We({physics:n.physics,persistence:Ne({history:n.history,writer:n.writer})})}function wt(n,e={}){const s=n.Application.prototype;let r=null,o=0;const a=[],i=Object.getOwnPropertyDescriptor(s,"render"),c=s.render;return Object.defineProperty(s,"render",{configurable:!0,writable:!0,value:function(...d){o++;const u=this.stage;if(!r&&u){const p={stage:u,renderer:this.renderer,app:this};if(e.accept?.(p)??!0){r=p;for(const f of a.splice(0))f(r)}}return c?.apply(this,d)}}),{get captured(){return r},getDrawCount(){return o},setPaused(d){const u=r?.app;u?.ticker&&(d?u.ticker.stop():u.ticker.start())},waitForCapture(d){const u=typeof d=="number"?{timeoutMs:d}:d??{},p=u.timeoutMs??1e4;return r?Promise.resolve(r):new Promise((f,x)=>{const y=Xe({budgetMs:p,clock:u.visibility??Je(),onExpire:()=>{const l=a.indexOf(S);l>=0&&a.splice(l,1),u.onWait?.(null),x(new Error(`pixi scene capture timed out after ${p}ms of VISIBLE time (${Math.round(y.elapsedHiddenMs())}ms browser-suspended, which is not counted because no frame can be presented) — the game never rendered, or it bundles its own (un-shared) copy of pixi.js.`))}}),S=l=>{y.cancel(),u.onWait?.(null),f(l)};a.push(S),u.onWait?.(y)})},uninstall(){i?Object.defineProperty(s,"render",i):c&&Object.defineProperty(s,"render",{configurable:!0,writable:!0,value:c})}}}const oe="IngestGame2DLoadError";class St extends Error{constructor(e,t){super(`pixi ingest: game "${e}" failed to load: ${t}`,{cause:t}),this.name=oe}}async function Ct(n,e,t={}){const s=wt(n,{...t.acceptCapture?{accept:t.acceptCapture}:{}});try{if(await e.load(),await t.preferStructuralRuntime?.())return s.uninstall(),null}catch(o){throw s.uninstall(),new St(e.id,o)}const r=t.captureTimeoutMs??e.captureTimeoutMs??8e3;try{return{stage:(await s.waitForCapture({timeoutMs:r,...t.onWait?{onWait:t.onWait}:{}})).stage,capture:s,setPaused:a=>s.setPaused(a),dispose:()=>s.uninstall()}}catch(o){throw s.uninstall(),new Error(`pixi ingest: game "${e.id}" rendered no capturable frame within ${r}ms: ${o}`)}}const xt=1500,Et=1e4;function At(n,e){const t=e.settleGraceMs??xt,s=e.deadlineMs??Et;let r=null,o=null;const a=i=>{e.isHeld()&&(r??=i,o===null&&e.currentScene()===n&&(o=i),e.render(),!(o!==null&&i-o>=t)&&(o===null&&i-r>=s||e.schedule(a)))};e.schedule(a)}function It(n){const e=k();if(e?.kind!=="canvas"||!e.session.adapter)return()=>{};const t=z()?.scenes;if(t&&me(t))return()=>{};const s=e.worldId;he({id:I,title:"Scene",kind:"world",workspaceRole:"authored-subject",provenance:{rootId:s},Content:n,closeable:!1,presentation:()=>({kind:"world",id:s})}),fe(I);const r=ge(s,I);return()=>{r(),ye(I,{discardDirty:!0})}}function Pt(){const n=z()?.scenes;if(!n?.default)return;const e=n.entries.find(r=>r.id===n.default),t=e?.source?.export??e?.id;return t?(Y()?.storiesFor("")??[]).find(r=>r.label===t||r.id===t)?.id:void 0}function kt({active:n,adapter:e,documentId:t,store:s,worldId:r,contractSceneId:o}){const a=w.useRef(null),c=w.useRef(ve()).current;w.useSyncExternalStore(s.shell.subscribe,s.shell.getSnapshot);const d=w.useSyncExternalStore(be,we),u=w.useSyncExternalStore(Se,Ce),p=k(),f=e.hierarchy.roots(),x=new Set(e.rects?.emptyContainers?.().map(l=>l.id)??[]),y=f.some(l=>!x.has(l.id)),S=ot({surface:"Ingest scene",rootIds:[r],phase:p?.kind==="canvas"&&p.worldId===r&&p.session.hostEl?"ready":"loading",content:p?.kind!=="canvas"||p.worldId!==r||!p.session.hostEl?"unknown":y?"present":"empty",readiness:d,failures:u});return w.useEffect(()=>xe(t,()=>({adapter:e,nodeId:[...s.shell.selectedEntityIds].find(l=>e.hierarchy.node(l))??null})),[e,t,s]),w.useEffect(()=>{const l=a.current;if(l)return st(l,c)},[c]),w.useEffect(()=>{if(!n)return;const l=a.current,v=k(),b=v?.kind==="canvas"?v.session.hostEl:void 0;if(!(!l||!b))return l.appendChild(b),()=>{const E=X();E&&b.parentElement===l&&E.appendChild(b)}},[n]),w.useEffect(()=>{if(!n)return;const l=o??Pt();if(!l)return;const v=Y();v&&v.goToScene(l)},[n,o]),C.jsxs("div",{ref:a,"data-testid":"world-document:ingest-canvas-scene","data-vgai-backdrop-color":n?H:void 0,"data-vgai-backdrop-policy":n?"dark-frost":void 0,style:{position:"absolute",inset:0,overflow:"hidden",pointerEvents:"auto",backgroundColor:H,touchAction:"none"},children:[C.jsx(rt,{view:c,documentId:t}),C.jsx(at,{adapter:e,view:c,transformModeAware:!0,presentationId:t}),C.jsx(ct,{explanation:S,testId:"ingest-canvas-surface-status",style:{zIndex:20}}),C.jsx(it,{active:n,adapter:e,containerRef:a,view:c,documentId:t})]})}function ce(n){const e=k();if(e?.kind!=="canvas"||!e.session.adapter)return()=>{};const t=e.session.adapter,s=e.worldId;return It(o=>C.jsx(kt,{...o,adapter:t,store:n,worldId:s}))}function Rt(n,e){const{adapter:t}=n;if(t.type!=="ingest")throw new Error(`resolveIngest2DDescriptor: world "${n.id}" is not an { ingest } world.`);if(!n.entry)throw new Error(`resolveIngest2DDescriptor: world "${n.id}" has no \`entry\` — an ingest root mounts the game's own entry module.`);const s=Ke(e);return{id:n.id,name:n.id,description:n.description??"",...t.captureTimeoutMs!==void 0?{captureTimeoutMs:t.captureTimeoutMs}:{},load:re(s.entry(n.entry),t.contractShim===void 0?void 0:s.module(t.contractShim))}}function V(n,e){const t=ut(n,e),s=lt[t];if(!s)throw new Error(`canvas ingest discovery: "${n}"'s module "${e}" did not match any game module (looked for glob key "${t}").`);return s}function Mt({folderId:n,manifest:e,root:t}){const{adapter:s}=t;if(!t.entry)throw new Error(`canvas ingest discovery: "${n}" has no \`entry\` — an ingest root mounts the game's own entry module.`);return{...{id:t.id,name:e.name,description:t.description??"",...s.captureTimeoutMs!==void 0?{captureTimeoutMs:s.captureTimeoutMs}:{}},load:re(V(n,t.entry),s.contractShim===void 0?void 0:V(n,s.contractShim))}}let G=null;function Dt(){return G||(G=dt("canvas").map(Mt).sort((n,e)=>n.id.localeCompare(e.id))),G}function $t(n){return Dt().find(e=>e.id===n)}const jt="this game imports the host's pixi directly, in the editor's own realm";function de(n,e,t){const s=R()?.systems;let r=null;const{systems:o,renderDebug:a,debugCollisions:i}=qe({contractSystems:s,surface:"canvas",...t?{physics:t}:{},...e?{canvasRuntime:{renderer:e}}:{},setRenderPassHooks:c=>{r?.(),r=c?Qe(e,c):null}});Pe(o),g.log(s?`canvas ingest: "${n}" declares the vgai game contract — ${s.commands?.length??0} commands, ${s.state?.length??0} state providers`:`canvas ingest: "${n}" declares no vgai game contract — game.commands()/game.state() have nothing to answer and will refuse by naming that`,"ingest");for(const c of i)g.error(`canvas ingest: "${n}" — ${c}; it will refuse`,"ingest");return e&&g.log(a?`canvas ingest: "${n}" render debugging is live — the Frame debugger captures through the game's own Pixi renderer (draws are unattributed: Pixi's batcher merges display objects, so no display object is the author of a draw)`:`canvas ingest: "${n}" has no render-debug capability — its renderer exposes no real WebGL2 context, or no prerender/postrender runners to bracket`,"ingest"),{wiring:a,uninstall:()=>r?.()}}function _t(n,e){return e instanceof Error&&e.name===oe?`canvas ingest: game "${n}" never ran — its own modules failed to load, so nothing could render and there is no canvas runtime in the realm to recognize (${e})`:`canvas ingest: game "${n}" mounted no recognized canvas runtime — the host's pixi captured no frame, and the realm holds no Phaser game or Babylon.js engine on their own public registries either (${e})`}function Tt(n,e){const t=n?.canvas;return t instanceof Node&&e.contains(t)}function le(){return Ie(ze(R()?.systems,"canvas").bound.physics)}function O(n,e){const t=pt(e);if(t)return{runtime:"phaser",adapter:new vt(t,n),mechanism:"this game runs its own Phaser instance in the editor's own realm; the host reads that live game’s active scenes and display lists"};const s=mt(e);return s?{runtime:"babylon",adapter:new Re(s,n),mechanism:"this game runs its own Babylon.js engine in the editor's own realm; the host reads that live engine’s scenes and root nodes"}:null}function U(n,e,t,s,r){const o=r.adapter;o.refresh();const a=ie({primary:o,worldId:t,hostEl:s,store:n}),i=se(),c=()=>i?{loop:null,reason:"the same-realm loop gate holds this game’s scheduling, but no probe has measured that control on this route"}:{loop:null,reason:Ge},d=q(i?{setPaused:p=>{p?i.hold():i.release()}}:{pauseGap:`${r.runtime} exposes no host-controlled loop gate`});let u=()=>{};Q({kind:"canvas",session:{store:n,adapter:o,hostEl:s,lifecycle:d,loop:c,dispose:()=>{u(),o.dispose(),L(),s.remove()}},siblings:[],worldId:t}),u=ce(n),Z(()=>n.shell.playState==="playing"&&n.shell.activeViewportTab==="play"),J(a),de(e.name,void 0,le()),ae(),n.shell.notifyIngestEdit(),K(),ee({reach:P({authoring:a}),reachMechanism:r.mechanism,loop:c}),g.log(`canvas ingest: recognized ${r.runtime} in the realm and captured "${e.name}"`,"ingest"),te("__vgaiIngest2D",{gameId:t,...ne(a),runtime:r.runtime,get reflected(){return o.refresh()},...d.setPaused?{setPaused:d.setPaused}:{},reach:P({authoring:a}),adapter:a,store:n})}async function Gt(n,e,t){De(),await Ee();const s=X();if(!s){g.error("Game container not mounted — cannot ingest (canvas)","ingest");return}n.shell.setPlayState("playing"),g.log(`Ingesting unmodified PixiJS game: ${e.name}`,"ingest");const r=$e(R());r.malformed!==null&&g.error(`Ingest game "${e.id}" ${r.malformed} — the host is measuring readiness instead.`,"ingest");const o=r.ready===null?"measured-wait":"contract-ready",a=r.ready===null?"measured":"declared";_({rootId:e.id,mechanism:o,source:a,state:"waiting"});const i=document.createElement("div");i.id="container",i.style.cssText=`position:absolute;inset:0;width:100%;height:100%;overflow:hidden;background:#000;${je}`,s.appendChild(i),_e(i);{const{markGameCssScope:h}=await N(async()=>{const{markGameCssScope:$}=await import("./index-CaG87ZF-.js").then(j=>j.tW);return{markGameCssScope:$}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9]));h(i);const m=Ae();if(m){const{ensureScopedGameStyles:$}=await N(async()=>{const{ensureScopedGameStyles:j}=await import("./index-CaG87ZF-.js").then(pe=>pe.tX);return{ensureScopedGameStyles:j}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9]));await $(m.rootPath)}}window.__vgaiMountCold=!0;const c=await He();let d;try{const h=await Ct(c,e,{...e.captureTimeoutMs!==void 0?{captureTimeoutMs:e.captureTimeoutMs}:{},acceptCapture:({renderer:m})=>Tt(m,i),onWait:m=>nt(e.id,m),preferStructuralRuntime:async()=>{const m=T();return await m.__vgaiBabylon?.ready,O(n,m)!==null}});if(h===null){const m=O(n,T());if(m){U(n,e,t,i,m);return}throw new Error(`canvas ingest: game "${e.id}" reported a structural runtime, but it disappeared before dispatch`)}d=h}catch(h){const m=O(n,T());if(m){U(n,e,t,i,m);return}throw L(),i.remove(),_({rootId:e.id,mechanism:o,source:a,state:"failed",failure:r.ready===null?"no-readiness-declaration":"declared-ready-never-resolved"}),new Error(_t(e.id,h))}const u=d.stage;for(let h=0;h<90&&(u.children?.length??0)===0;h++)await ke();const p=d.capture.captured?.app,f=p?.canvas;f&&(Ye(f),f.parentElement!==i&&i.appendChild(f));const x=Ve(p?[p]:[]),y=le(),S=tt(Ze()),l=y?et([y,S]):S,v=Te(R(),{onSwitchAccepted:h=>At(h,{isHeld:()=>!Oe(),currentScene:()=>v?.active("")??null,render:()=>p?.render(),schedule:m=>requestAnimationFrame(m)})}),b=new Fe(u,n,{pixi:c,journal:Be(t),target:bt({physics:l,history:n.shell.projectHistory}),...v?{stories:v}:{},surface:()=>p?.canvas??null,capturePreview:(h,m)=>Ue(h,{...m,pixi:c})}),E=b.refresh(),A=ie({primary:b,worldId:t,hostEl:i,store:n});let M=null,B=()=>{};const F=se(),W=q({setPaused:h=>{d.setPaused(h),h?F?.hold():F?.release()}});Q({kind:"canvas",session:{store:n,adapter:b,hostEl:i,lifecycle:W,dispose:()=>{B(),M?.uninstall(),M?.wiring?.dispose(),x(),d.dispose(),L(),i.remove()}},siblings:[],worldId:t}),B=ce(n),Z(()=>n.shell.playState==="playing"&&n.shell.activeViewportTab==="play"),J(A),M=de(e.name,d.capture.captured?.renderer,y?l:null),ae(),n.shell.notifyIngestEdit(),K();let D="measured";if(r.ready)try{await r.ready(),D="declared"}catch(h){g.error(`Ingest game "${e.id}" declared \`window.vgaiGame.ready\` and it REJECTED (${String(h)}) — the frame was already captured, so the host fell back to the measured settle wait. This root now reports readiness as measured.`,"ingest")}_({rootId:e.id,mechanism:D==="declared"?"contract-ready":"measured-wait",source:D,state:"ready"}),ee({reach:P({authoring:A}),reachMechanism:jt,loop:()=>({loop:null,reason:"the host stops and starts the captured PixiJS Application ticker directly, but no probe has measured whether that holds everything this game schedules"})}),g.log(`pixi ingest: captured "${e.name}" (${E.count} nodes, ${E.sprites} sprites)`,"ingest"),te("__vgaiIngest2D",{gameId:t,...ne(A),drawCount:()=>d.capture.getDrawCount(),get reflected(){return b.refresh()},setPaused:W.setPaused,reach:P({authoring:A}),adapter:A,store:n})}function ue(n,e,t){return Me(()=>Gt(n,e,t))}async function Jn(n,e,t){const s=Rt(e,t);return ue(n,s,e.id)}async function Kn(n,e){const t=$t(e);if(!t){g.error(`Unknown pixi ingest game: ${e}`,"ingest");return}return ue(n,t,e)}export{ue as mountCanvasIngestRoot,Kn as mountCanvasIngestRootById,Jn as mountCanvasIngestRootFromManifest};
@@ -1,2 +0,0 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/create-runtime-Bg2uYMfh.js","assets/adapter-surface-Y37Nzcyw.js","assets/binding-Bmxqznjk.js","assets/root-stacking-BEd9ZvxC.js","assets/assets-BcrMQHRv.js","assets/loader-BTUKnX5Q.js","assets/KTX2Loader-CaqVE6nY.js","assets/three.module-BLhyNg0e.js","assets/three.core-3arARmh6.js","assets/GLTFLoader-KeoruJgS.js","assets/BufferGeometryUtils-B22h7jo4.js","assets/setup-renderer-OOw1SykJ.js","assets/index-DHhMOs_s.js","assets/defaults-DKiBJCPN.js","assets/render-settings-BBvkacR3.js","assets/render-features-C7QwmhCo.js","assets/index-CaG87ZF-.js","assets/index-nmcBqr7Y.js","assets/_commonjsHelpers-D6-XlEtG.js","assets/index-D_NuPfjr.js","assets/jsx-runtime-DPjLkJKQ.js","assets/index-CtzuWnCS.js","assets/index-CinJrH5C.js","assets/index-FUuS4qwW.js","assets/client-DNXj_opT.js","assets/index-B5WjeCHm.css","assets/seeded-random-38To73fI.js","assets/debug-registry-l7k5Hjc8.js","assets/loop-gate-report-N52EWFGD.js","assets/system-slot-E2mEdiih.js","assets/user-data-dHvLdpwM.js","assets/object-marks-DwvIEBOK.js","assets/performance-profiler-OwnXQX0M.js"])))=>i.map(i=>d[i]);
2
- import{bq as I,M as s,_ as y,bs as v,bt as w,bu as R,bv as E}from"./index-CaG87ZF-.js";import{m as j}from"./capability-coverage-DQgg6UJe.js";import{r as G}from"./binding-resolver-C_9MBSMa.js";import{s as H,j as A,k as P,l as b,p as D,m as L,c as O,r as N,n as C,o as M}from"./active-ingest-CnAeQcuQ.js";import{a as T}from"./json-history-resource-CTXRV4GD.js";import{D as V}from"./dom-authoring-adapter-CoESNvrM.js";import{landIngestBootInEdit as k}from"./ingest-boot-viewport-D2okO6JI.js";import{b as x}from"./registry-Z28XSZHF.js";import"./index-nmcBqr7Y.js";import"./_commonjsHelpers-D6-XlEtG.js";import"./index-D_NuPfjr.js";import"./jsx-runtime-DPjLkJKQ.js";import"./index-CtzuWnCS.js";import"./index-CinJrH5C.js";import"./index-FUuS4qwW.js";import"./client-DNXj_opT.js";import"./game-contract-seams-C0AVYwvO.js";import"./native-debug-module-B-rWJfWE.js";import"./native-entry-surface-BE8LJNdu.js";import"./debug-registry-l7k5Hjc8.js";import"./contract-system-adapters-h6OUBRYA.js";import"./adapter-surface-Y37Nzcyw.js";import"./structural-signature-Dc7skRiy.js";import"./three.core-3arARmh6.js";import"./webgl-frame-capture-DdJkM2mi.js";import"./events-156d8d12.esm-CYeuVCYr.js";import"./three.module-BLhyNg0e.js";import"./index-bQE2NA0D.js";import"./realm-services-DefTrXnY.js";import"./canvas-entry-runtime-DVeh71nC.js";import"./three-ingest-runtime-CXKjNysA.js";import"./EffectComposer-BEAt0PtQ.js";import"./CopyShader-BzTUYzf6.js";import"./ShaderPass-DTnDQXm0.js";import"./Pass-D1MRT672.js";import"./CSS3DRenderer-BsAqfavI.js";import"./relative-path-guard-GiM7Lsz8.js";import"./react-root-BHA-cdrW.js";import"./ingest-source-persistence-6peGfPAS.js";import"./react-world-authoring-adapter-C1jPW_cN.js";import"./board-guides-_3R1t_-2.js";import"./relative-import-specifier-DQzkawgj.js";import"./story-arg-descriptors-Ek86ExX7.js";import"./inspect-C8RP8G5F.js";import"./inference-diagnostics-MGcIHEX6.js";import"./writer-tw6EcuVO.js";function F({folderId:t,manifest:e,root:o}){if(!o.entry)throw new Error(`dom ingest discovery: "${t}" has no \`entry\` — a dom ingest root's \`entry\` must point at the host-shim module in the same folder (D-N2).`);return{folderId:t,manifest:e,worldId:o.id}}let f=null;function W(){return f||(f=x("dom").map(F).sort((t,e)=>t.folderId.localeCompare(e.folderId))),f}function q(t){return W().find(e=>e.folderId===t)}function z(t){return typeof __VGAI_ENGINE_ROOT__!="string"||!__VGAI_ENGINE_ROOT__?void 0:`${__VGAI_ENGINE_ROOT__.endsWith("/")?__VGAI_ENGINE_ROOT__.slice(0,-1):__VGAI_ENGINE_ROOT__}/packages/editor/src/ingest/games/${t}`}const B="this world mounts in the host's native React runtime, so the editor is limited only by what its authoring adapter provides";function S(t){return{reach:j({authoring:t}),reachMechanism:B,loop:L}}async function J(t,e){const o=q(e);if(!o){s.error(`Unknown react ingest game: ${e}`,"ingest");return}const u=z(e);if(!u){s.error(`React ingest "${e}": no __VGAI_ENGINE_ROOT__ available to resolve its entry`,"ingest");return}await I();const i=E();if(!i){s.error("Game container not mounted — cannot ingest (react)","ingest");return}O(),t.shell.setPlayState("playing"),s.log(`Ingesting unmodified native-React game: ${o.manifest.name}`,"ingest"),window.__vgaiMountCold=!0;const{createGameRuntime:g}=await y(async()=>{const{createGameRuntime:r}=await import("./create-runtime-Bg2uYMfh.js").then(h=>h.e);return{createGameRuntime:r}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32])),l=await G(o.manifest,u),d=i.clientWidth,_=i.clientHeight,a=await g({container:i,roots:l,width:d,height:_}),m=a.game.roots[0].reactRoot(),n=new V(m,t,{journal:T(e)}),c=A({setPaused:r=>r?a.game.play.pause():a.game.play.resume()});P({kind:"dom",session:{store:t,lifecycle:c,stop:()=>a.stop(),adapter:n},siblings:[],worldId:e}),b(()=>t.shell.playState==="playing"&&t.shell.activeViewportTab==="play"),v(n),w({}),k(),t.shell.notifyIngestEdit(),R();const p=S(n);N(p),D("__vgaiIngestReact",{gameId:e,worldId:o.worldId,...M(n),noAuthoring:!1,reach:p.reach,domEvidence:()=>C(m,n),setPausedPresent:typeof c.setPaused=="function"})}async function Lt(t,e,o,u){await I();const i=E();if(!i){s.error("Game container not mounted — cannot ingest (react)","ingest");return}O(),t.shell.setPlayState("playing"),s.log(`Ingesting unmodified native-React game (external folder): ${o.id}`,"ingest"),window.__vgaiMountCold=!0;const{createGameRuntime:g}=await y(async()=>{const{createGameRuntime:r}=await import("./create-runtime-Bg2uYMfh.js").then(h=>h.e);return{createGameRuntime:r}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32])),l=await G({...e,roots:[o]},u),d=i.clientWidth,_=i.clientHeight,a=await g({container:i,roots:l,width:d,height:_}),m=a.game.roots[0].reactRoot(),n=new V(m,t,{journal:T(o.id)}),c=A({setPaused:r=>r?a.game.play.pause():a.game.play.resume()});P({kind:"dom",session:{store:t,lifecycle:c,stop:()=>a.stop(),adapter:n},siblings:[],worldId:o.id}),b(()=>t.shell.playState==="playing"&&t.shell.activeViewportTab==="play"),v(n),w({}),k(),t.shell.notifyIngestEdit(),R();const p=S(n);N(p),D("__vgaiIngestReact",{worldId:o.id,...M(n),noAuthoring:!1,reach:p.reach,domEvidence:()=>C(m,n),setPausedPresent:typeof c.setPaused=="function"})}function xt(t,e){return H(()=>J(t,e))}export{xt as mountDomIngestRoot,Lt as mountDomIngestRootFromManifest};
@@ -1,4 +0,0 @@
1
- const s="Time the tab spent hidden was NOT counted against it, so this is not a backgrounded-tab failure.";function g(n){const{gameId:t,timeoutMs:o,readinessSource:i,pageErrors:e,cause:r}=n,a=`${o}ms of VISIBLE time`;if(e.length>0){const d=e.map(h=>` · ${h}`).join(`
2
- `);return{kind:"crashed-before-ready",pageErrors:[...e],message:`Ingest game "${t}" CRASHED BEFORE IT BECAME READY: ${e.length} error(s) were thrown while it was booting, and the capture window (${a}) then expired. The expiry is a CONSEQUENCE of the crash, not the blocker — fix these first:
3
- ${d}
4
- ${s} Underlying wait: ${r}`}}return i==="declared"?{kind:"declared-ready-never-resolved",pageErrors:[],message:`Ingest game "${t}" DECLARED A READINESS SIGNAL AND STILL PRODUCED NO CAPTURABLE RENDER: it stated \`window.vgaiGame.ready\`, but the capture window (${a}) expired before the editor's three saw a render, and nothing was thrown. (The host awaits \`ready\` only after the first captured render, so whether it resolved was not observed.) Nothing is wrong with the host's wait — the likely blocker is whatever the game's own boot is waiting on (an asset fetch, a socket, a user gesture the editor never makes), or a game that draws through a renderer the capture trap cannot see. ${s} Underlying wait: ${r}`}:{kind:"no-readiness-declaration",pageErrors:[],message:`Ingest game "${t}" DECLARED NO READINESS SIGNAL, and the MEASURED fallback wait expired: the editor's three saw no render within ${a} and nothing was thrown, so the host has no way to tell a slow boot from a stopped one. Recovery: declare \`window.vgaiGame.ready\` (a promise resolved when the game has built its world) so this question stops being measured — or, if the game genuinely needs longer on screen, raise "captureTimeoutMs" in the root's ingest block. ${s} Underlying wait: ${r}`}}export{g as describeMountFailure};
@@ -1 +0,0 @@
1
- import{m as X}from"./capability-coverage-DQgg6UJe.js";import{M as h,as as Y,au as Z,km as ee,kn as E,ko as D,kp as te,av as O,kq as re,kr as oe,ks as ne,kt as se,bq as ie,bv as ae,bs as ce,bt as de,bu as ue}from"./index-CaG87ZF-.js";import{A as le,G as me,B as pe,C as fe,D as v,E as W,F as he,H as ge,I as ye,J as we,K as M,L as be,s as ve,c as Se,M as Ie,j as Re,k as ke,l as Ee,N as $e,u as Ce,y as Me,z as Pe,O as Le,r as Ge,P as Ae,Q as Te,p as De,o as Oe}from"./active-ingest-CnAeQcuQ.js";import{p as We}from"./scene-framing-PVMqGU8h.js";import{w as je,c as H,h as _e,i as ze,a as Fe,b as He,r as Ue,e as xe}from"./resolve-three-C7zDbK29.js";import{b as Ve}from"./component-instance-root-df4ofoOR.js";import{s as Ne}from"./ingest-source-persistence-6peGfPAS.js";import{a as j}from"./json-history-resource-CTXRV4GD.js";import{r as Be}from"./three-ingest-runtime-CXKjNysA.js";import{describeMountFailure as qe}from"./mount-readiness-Ds0HvvLH.js";import{formatLoopGateMessage as Je}from"./loop-gate-report-N52EWFGD.js";import{a as Ke,s as Qe}from"./three-authoring-adapter-BrkGH4cd.js";import{i as Xe}from"./renderer-ownership-BovSEcLv.js";import{installSceneCapture as Ye}from"./scene-capture-BTWgUzhI.js";import{s as Ze}from"./mount-ingest-root-BC3-1Cw1.js";import{landIngestBootInEdit as et}from"./ingest-boot-viewport-D2okO6JI.js";import{b as tt,c as _,e as rt,g as U}from"./registry-Z28XSZHF.js";import"./game-contract-seams-C0AVYwvO.js";import"./index-nmcBqr7Y.js";import"./_commonjsHelpers-D6-XlEtG.js";import"./index-D_NuPfjr.js";import"./jsx-runtime-DPjLkJKQ.js";import"./index-CtzuWnCS.js";import"./index-CinJrH5C.js";import"./index-FUuS4qwW.js";import"./client-DNXj_opT.js";import"./contract-system-adapters-h6OUBRYA.js";import"./editor-layers-B4oYfpj8.js";import"./workspace-arrangement-DIMM7ska.js";import"./three.core-3arARmh6.js";import"./dom-authoring-adapter-CoESNvrM.js";import"./react-world-authoring-adapter-C1jPW_cN.js";import"./board-guides-_3R1t_-2.js";import"./relative-import-specifier-DQzkawgj.js";import"./story-arg-descriptors-Ek86ExX7.js";import"./inspect-C8RP8G5F.js";import"./inference-diagnostics-MGcIHEX6.js";import"./writer-tw6EcuVO.js";import"./debug-registry-l7k5Hjc8.js";import"./webgl-frame-capture-DdJkM2mi.js";import"./user-data-CqOoAowZ.js";import"./three.module-BLhyNg0e.js";import"./EffectComposer-BEAt0PtQ.js";import"./CopyShader-BzTUYzf6.js";import"./ShaderPass-DTnDQXm0.js";import"./Pass-D1MRT672.js";import"./CSS3DRenderer-BsAqfavI.js";import"./source-persistence-backend-HviqjKZ2.js";import"./three-projection-core-jBJVt6O0.js";import"./three-oYrcK5SQ.js";import"./entity-object-B_5Gc0Ky.js";import"./three-contract-Dkt6PmWY.js";import"./viewport-editor-controls-BYaAZ_Ku.js";import"./body-marks-RKb_LTwL.js";import"./user-data-dHvLdpwM.js";import"./object-marks-DwvIEBOK.js";import"./structural-ids-Br2zjINh.js";import"./object3d-authoring-subject-BDrxd1GA.js";import"./rapier-physics-adapter-CaZqWLu0.js";import"./r3f-physics-binding-Bgzzd4ol.js";import"./three-state-wXRU3rLr.js";import"./editor-shell-store-Bh1S7M54.js";import"./output-pass-HurwNl0G.js";const ot="contract-hierarchy:group:",I="contract-hierarchy:render-tree";function x(t){return`${ot}${encodeURIComponent(t)}`}function z(t){return{id:x(t.id),label:t.label,secondaryLabel:`${t.count} ${t.count===1?"item":"items"}`,role:"folder",kind:"group",parentId:null,childIds:[]}}function nt(t){if(!Array.isArray(t))throw new Error("hierarchy() did not return an array");const e=new Set;for(const r of t){if(typeof r!="object"||r===null||typeof r.id!="string"||r.id.trim().length===0||typeof r.label!="string"||r.label.trim().length===0||typeof r.count!="number"||!Number.isInteger(r.count)||r.count<0)throw new Error("hierarchy() returned an invalid { id, label, count } group");if(e.has(r.id))throw new Error(`hierarchy() returned duplicate id "${r.id}"`);e.add(r.id)}return t}function st(t,e){if(!e)return t;let r=!1;const n=()=>{try{return nt(e())}catch(i){return r||(r=!0,h.warn(`Ignored invalid game-contract hierarchy: ${i instanceof Error?i.message:String(i)}`,"ingest")),[]}},o=()=>{const i=n(),a=t.hierarchy.roots();return i.length===0?a:[...i.map(z),{id:I,label:"Rendered objects",secondaryLabel:"live tree",role:"folder",kind:"group",parentId:null,childIds:a.map(d=>d.id)}]},s=i=>{const a=n(),d=a.find(w=>x(w.id)===i);if(d)return z(d);if(a.length>0&&i===I){const w=t.hierarchy.roots();return{id:I,label:"Rendered objects",secondaryLabel:"live tree",role:"folder",kind:"group",parentId:null,childIds:w.map(g=>g.id)}}const f=t.hierarchy.node(i);return a.length>0&&f?.parentId===null?{...f,parentId:I}:f},l=new Proxy(t.hierarchy,{get(i,a){if(a==="roots")return o;if(a==="node")return s;const d=Reflect.get(i,a,i);return typeof d=="function"?d.bind(i):d}}),m=i=>{const a=t.subscribe?.(i),d=e.subscribe?.(i);return()=>{a?.(),d?.()}};return new Proxy(t,{get(i,a){if(a==="hierarchy")return l;if(a==="subscribe")return m;const d=Reflect.get(i,a,i);return typeof d=="function"?d.bind(i):d}})}const it="vgaiDomStub";let F=null;function V(t){for(const e of le())if(e.surface.contains(t))return e;return null}function at(){if(F!==null||typeof Element>"u")return;const t=Element.prototype,e=t.requestPointerLock;typeof e=="function"&&(F=e,t.requestPointerLock=function(r){const n=V(this);return n&&!n.gate()?(console.error("Ingested game requested pointer lock while its input gate is closed — refused. A game only captures the mouse while play is running AND the Game tab is active (the same predicate that gates its keyboard listeners); the editor viewport owns pointer lock otherwise. See packages/editor/src/ingest/game-pointer-lock.ts."),Promise.reject(new Error("pointer lock refused: game input gate is closed"))):e.call(this,r)})}function N(){if(typeof document>"u")return;const t=document.pointerLockElement;t&&V(t)&&document.exitPointerLock()}function ct(t,e,r,n,o={}){let s=null;return{setPaused(l){if(!l){n.resume(),o.realmGate?.release();return}n.pause(),o.realmGate?.hold(),ye({gate:o.realmGate??null,progress:()=>e.info?.render.frame??t.getDrawCount(),...o.verifyWindowMs!==void 0?{windowMs:o.verifyWindowMs}:{},...o.sleep!==void 0?{sleep:o.sleep}:{}}).then(m=>{s=m,o.onVerdict?.(m),m.loop!=="gated"&&console.warn(Je({worldId:r,reason:t.getAnimationLoop(e)?m.reason:`${m.reason} (this game also never called renderer.setAnimationLoop)`}))})},lastVerdict:()=>s}}function dt(t){let e=0;return t.traverse(r=>{Ve(r)!==void 0&&e++}),e}async function ut(t,e=2500,r=n=>new Promise(o=>setTimeout(o,n))){const n=performance.now();for(;;){const o=dt(t);if(o>0)return o;if(performance.now()-n>=e)return 0;await r(100)}}function lt(t,e){const r=e.replace(/\\/g,"/"),n=r.startsWith("/")?"":t.replace(/\\/g,"/"),o=[];for(const s of`${n}/${r}`.split("/"))s===""||s==="."||(s===".."?o.pop():o.push(s));return`/${o.join("/")}`}function mt(t,e){if(!t)return[];const r=t.replace(/\\/g,"/").replace(/\/+$/,""),n=new Set([r]);for(const o of e??[]){const s=lt(r,o),l=s.slice(0,s.lastIndexOf("/"));l&&n.add(l)}return[...n]}function pt(t,e){if(!t||e.length===0)return!1;for(const r of Object.values(t)){const n=r?.file;if(typeof n!="string")continue;const o=n.replace(/\\/g,"/");if(e.some(s=>o===s||o.startsWith(`${s}/`)))return!0}return!1}function ft(t){return t.servedStampedSource||t.graphStamps>0?"oid-source":"structural"}async function ht(){if(!await re())return null;try{return await oe().index?.()??null}catch{return null}}function gt(t){return h.getEntries().filter(e=>e.level==="error"&&e.source==="runtime"&&e.timestamp>=t).slice(-10).map(e=>e.count>1?`${e.message} (×${e.count})`:e.message)}async function yt(t,e,r){if(r)try{return await r(),"declared"}catch(n){h.error(`Ingest game "${t}" declared \`window.vgaiGame.ready\` and it REJECTED (${String(n)}) — the world was already captured, so the host fell back to the measured settle wait. This root now reports readiness as measured.`,"ingest")}return await wt(e),"measured"}async function wt(t,e=5e3){const r=performance.now();let n=-1,o=0;return new Promise(s=>{const l=()=>{const m=t.children.length;if(o=m===n?o+1:0,n=m,o>=3||performance.now()-r>e)return s();setTimeout(l,120)};l()})}function bt(t,e){const r=ge(),n=v()?.root??r.__vgaiGameRoot,o=n instanceof HTMLElement&&n.contains(e)?n:e;return o.contains(t)?t:(o.parentElement!==t&&t.contains(o)||(H(o),o.parentElement!==t&&t.appendChild(o)),o)}async function vt(t,e,r,n={}){const o=document.createElement("div");o.id="container",o.style.cssText=`position:absolute;inset:0;width:100%;height:100%;overflow:hidden;${me}`,r.appendChild(o);const s=pe(o);Y(o);const l=O();l&&await Z(l.rootPath);const m=[];for(const c of e.domStubs??[]){if(document.getElementById(c))continue;const p=document.createElement("div");p.id=c,p.style.display="none",p.dataset[it]="",o.appendChild(p),m.push(p)}const i=await Be(),a=i.three,d=Ye(a,i.EffectComposer,{isHostRenderer:Xe,additionalRendererCtors:[i.CSS3DRenderer],declaredScene:()=>{const c=be(v());return c.malformed!==null&&h.error(`Ingest game "${e.id}" ${c.malformed} — falling back to the MEASURED first-render adoption.`,"ingest"),c.world},onWorldAdoption:ee(e.id)});if(e.assets){const c=e.assets;a.DefaultLoadingManager.setURLModifier(p=>{for(const y of Object.keys(c))if(p.includes(y))return c[y];return p})}window.__vgaiMountCold=!0;const f=Date.now();await e.load();const w=n.captureTimeoutMs??1e4,g=fe(v());g.malformed!==null&&h.error(`Ingest game "${e.id}" ${g.malformed} — the host is measuring readiness instead.`,"ingest");const b=g.ready===null?"measured":"declared";E({rootId:e.id,mechanism:g.ready===null?"measured-wait":"contract-ready",source:b,state:"waiting"});let u;try{u=await d.waitForCapture({timeoutMs:w,onWait:c=>Ze(e.id,c)})}catch(c){d.uninstall(),a.DefaultLoadingManager.setURLModifier(y=>y);for(const y of m)y.remove();W(),o.remove(),D(e.id);const p=qe({gameId:e.id,timeoutMs:w,readinessSource:b,pageErrors:gt(f),cause:String(c)});throw E({rootId:e.id,mechanism:g.ready===null?"measured-wait":"contract-ready",source:b,state:"failed",failure:p.kind}),new Error(p.message)}const R=bt(o,u.renderer.domElement),S=he(v());S.malformed!==null&&h.error(`Ingest game "${e.id}" ${S.malformed} — the host is using the captured renderer’s canvas instead.`,"ingest"),te(e.id,S.canvas??u.renderer.domElement,S.canvas?"declared":"measured"),at();const P=await yt(e.id,u.scene,g.ready);E({rootId:e.id,mechanism:P==="declared"?"contract-ready":"measured-wait",source:P,state:"ready"});const k={pause:()=>u.renderer.setAnimationLoop?.(null),resume:()=>{const c=d.getAnimationLoop(u.renderer);c&&u.renderer.setAnimationLoop?.(c)}};Ne(e.dataWriter??null);const q=mt(O()?.rootPath,e.sourceModules),L=pt(await ht(),q),J=L?0:await ut(u.scene),G=ft({servedStampedSource:L,graphStamps:J})==="oid-source"?Ke(t,u.scene,{worldId:e.id,loop:k,camera:u.camera,journal:j(e.id)}):Qe(t,u.scene,{loop:k,camera:u.camera,journal:j(e.id)}),A=ct(d,u.renderer,e.id,k,{realmGate:M(),onVerdict:()=>t.shell.notifyIngestEdit()}),{systems:T,renderDebug:K,debugCollisions:Q}=je({contractSystems:v()?.systems,surface:"three",runtime:u,setRenderPassHooks:c=>d.setRenderPassHooks(c)});for(const c of Q)h.error(`Ingest game "${e.id}" — ${c}; it will refuse`,"ingest");return{game:{kind:"three",scene:u.scene,camera:u.camera,drivesOwnLoop:!0,...Object.keys(T).length>0?{systems:T}:{},setPaused:c=>A.setPaused(c),resize:(c,p)=>{if(s.gameResizesItself){s.dispatchResize();return}const y=_e(c,p);u.renderer.setSize(y.width,y.height,!1),d.resizeComposers(y.width,y.height),H(R)},dispose:()=>{d.setRenderPassHooks(null),we(),K?.dispose();try{u.renderer.setAnimationLoop?.(null),u.renderer.dispose?.()}catch{}d.uninstall(),a.DefaultLoadingManager.setURLModifier(c=>c);for(const c of m)c.remove();N(),W(),ne(e.id),se(e.id),D(e.id),o.remove()},authoring:G},authoring:G,hostEl:o,capture:d,scene:u.scene,realmLoopVerdict:()=>A.lastVerdict()}}function St(t,e){const r={};for(const[n,o]of Object.entries(e)){const s=U(t,o),l=_[s];if(!l)throw new Error(`ingest discovery: "${t}"'s asset "${o}" did not match any served asset (looked for glob key "${s}" — available: ${Object.keys(_).join(", ")})`);r[n]=l}return r}function $(t,e){const r=U(t,e),n=rt[r];if(!n)throw new Error(`ingest discovery: "${t}"'s module "${e}" did not match any game module (looked for glob key "${r}").`);return n}function It({folderId:t,manifest:e,root:r}){const{adapter:n}=r;if(!r.entry)throw new Error(`ingest discovery: "${t}" has no \`entry\` — an ingest root mounts the game's own entry module.`);return{...{id:r.id,name:e.name,description:r.description??"",gameVersion:e.version,sourceModules:Fe(r.entry,r.world?.entry),...ze(n.dataWriter,s=>$(t,s)),...n.assets!==void 0?{assets:St(t,n.assets)}:{},...n.domStubs!==void 0?{domStubs:n.domStubs}:{},...n.captureTimeoutMs!==void 0?{captureTimeoutMs:n.captureTimeoutMs}:{}},load:He($(t,r.entry),n.contractShim===void 0?void 0:$(t,n.contractShim))}}let C=null;function Rt(){return C||(C=tt("three").map(It).sort((t,e)=>t.id.localeCompare(e.id))),C}function kt(t){return Rt().find(e=>e.id===t)}function Et(t){return t==="devtools-observer"?"this game runs its OWN copy of three; the host reached its renderer through three's `__THREE_DEVTOOLS__` observation seam":"this game imports the host's three directly, in the editor's own realm"}function $t(t){const{store:e,session:r,sessionId:n}=t,o=r.mount;if(!o)return;const s=o.authoring,l=Pe(),m=st(s,l?.systems?.hierarchy),i=xe({primary:m,worldId:n,hostEl:o.hostEl,...l?.root?{declaredRoot:l.root}:{},store:e}),a=o.scene,d=new ResizeObserver(()=>{const u=t.gameContainer.getBoundingClientRect();u.width>0&&u.height>0&&o.game.resize?.(u.width,u.height)});d.observe(t.gameContainer),r.resizeObserver=d;const f=s.refresh(),w=s.measureWriteReach();h.log(`Captured live scene (${a.children.length} top-level children, ${o.capture.getDrawCount()} draws); ingested ${f.count} objects (${f.meshes} meshes, ${f.lights} lights`+(f.instancedMeshes>0?`, incl. ${f.instancedMeshes} InstancedMesh drawing ${f.instances} units`:"")+`); ${w.addressable} of ${w.total} have a source address — edits go to ${w.destination}`,"ingest"),Le(n,o.realmLoopVerdict?.()??void 0),ce(i),de(o.game.systems??{}),e.enterPlayScene(a,void 0,s.objectMapSnapshot()),e.focusOnScene(()=>We(o.capture.captured?.camera,a)),et(),e.shell.notifyIngestEdit(),ue();const g=X({authoring:i});Ge({reach:g,reachMechanism:Et(o.capture.capturedVia),loop:()=>Ae(o),writeReach:()=>s.measureWriteReach()});const b={gameId:n,...Oe(i),drawCount:()=>o.capture.getDrawCount(),get reflected(){return s.refresh()},get sceneChildren(){return a.children.length},reach:g,resize:(u,R)=>o.game.resize?.(u,R),...r.lifecycle.setPaused?{setPaused:r.lifecycle.setPaused}:{}};Te(b,o),De("__vgaiIngest",b)}async function Ct(t,e,r){Se(),Ie(r),await ie();const n=ae();if(!n){h.error("Game container not mounted — cannot ingest","ingest");return}t.shell.setPlayState("playing"),h.log(`Ingesting unmodified game: ${e.name}`,"ingest");const o=()=>t.shell.playState==="playing"&&t.shell.activeViewportTab==="play";try{const s={captureTimeoutMs:e.captureTimeoutMs},l=await vt(t,e,n,s),m=l.game.setPaused,i={store:t,mount:l,lifecycle:Re(m?{setPaused:a=>m(a),step:()=>M()?.step(1),canStep:()=>l.realmLoopVerdict?.()?.loop==="gated"&&M()!==null}:{pauseGap:"the captured Three root exposes no mounted setPaused capability"})};ke({kind:"three",session:i,siblings:[],worldId:r}),Ee(o),i.inputGateUnsubscribe=t.shell.subscribe(()=>{o()||N()}),$e(Ce()),$t({store:t,session:i,gameContainer:n,sessionId:r})}catch(s){throw h.error(`Ingest failed: ${s}`,"ingest"),Me(),s}}function B(t,e,r){return ve(()=>Ct(t,e,r))}async function _r(t,e){const r=kt(e);if(!r){h.error(`Unknown ingest game: ${e}`,"ingest");return}return B(t,r,e)}async function zr(t,e,r){const n=Ue(e,r);return B(t,n,e.id)}export{B as mountThreeIngestRoot,_r as mountThreeIngestRootById,zr as mountThreeIngestRootFromManifest};
@@ -1 +0,0 @@
1
- import{i as t}from"./game-network-Bo_nlDR5.js";import"./index-OZVqp6xS.js";import"./index-Da9JhEvW.js";import"./_commonjsHelpers-D6-XlEtG.js";import"./index-CaG87ZF-.js";import"./index-nmcBqr7Y.js";import"./index-D_NuPfjr.js";import"./jsx-runtime-DPjLkJKQ.js";import"./index-CtzuWnCS.js";import"./index-CinJrH5C.js";import"./index-FUuS4qwW.js";import"./client-DNXj_opT.js";import"./native-debug-module-B-rWJfWE.js";import"./native-entry-surface-BE8LJNdu.js";import"./debug-registry-l7k5Hjc8.js";import"./contract-system-adapters-h6OUBRYA.js";import"./game-contract-seams-C0AVYwvO.js";import"./seeded-random-38To73fI.js";import"./game-audio-CaGKzia4.js";import"./rapier-physics-adapter-CaZqWLu0.js";import"./events-156d8d12.esm-CYeuVCYr.js";import"./three.module-BLhyNg0e.js";import"./three.core-3arARmh6.js";import"./index-bQE2NA0D.js";import"./live-project-verbs-BOAQN3ME.js";import"./capability-coverage-DQgg6UJe.js";import"./edit-mode-authoring-DBjaBTxM.js";import"./json-history-resource-CTXRV4GD.js";import"./binding-resolver-C_9MBSMa.js";import"./adapter-surface-Y37Nzcyw.js";import"./structural-signature-Dc7skRiy.js";import"./webgl-frame-capture-DdJkM2mi.js";import"./realm-services-DefTrXnY.js";import"./canvas-entry-runtime-DVeh71nC.js";import"./three-ingest-runtime-CXKjNysA.js";import"./EffectComposer-BEAt0PtQ.js";import"./CopyShader-BzTUYzf6.js";import"./ShaderPass-DTnDQXm0.js";import"./Pass-D1MRT672.js";import"./CSS3DRenderer-BsAqfavI.js";import"./relative-path-guard-GiM7Lsz8.js";import"./react-root-BHA-cdrW.js";import"./editor-presentation-activity-C7SNSmTd.js";import"./active-ingest-CnAeQcuQ.js";import"./ingest-source-persistence-6peGfPAS.js";import"./pixi-story-model-DNkfnWUV.js";import"./surface-content-Dg9Kkazf.js";import"./viewport-root-presentation-B35t51xX.js";import"./mounted-authoring-B7RL_V28.js";import"./entity-object-B_5Gc0Ky.js";import"./user-data-CqOoAowZ.js";import"./workspace-arrangement-DIMM7ska.js";import"./three-contract-Dkt6PmWY.js";import"./three-oYrcK5SQ.js";import"./editor-layers-B4oYfpj8.js";import"./component-instance-root-df4ofoOR.js";import"./viewport-editor-controls-BYaAZ_Ku.js";import"./three-authoring-adapter-BrkGH4cd.js";import"./source-persistence-backend-HviqjKZ2.js";import"./three-projection-core-jBJVt6O0.js";import"./body-marks-RKb_LTwL.js";import"./user-data-dHvLdpwM.js";import"./object-marks-DwvIEBOK.js";import"./structural-ids-Br2zjINh.js";import"./object3d-authoring-subject-BDrxd1GA.js";import"./r3f-physics-binding-Bgzzd4ol.js";import"./deferred-ingest-play-Bej67_y9.js";import"./rrweb-Cd2ifIRP.js";import"./react-world-authoring-adapter-C1jPW_cN.js";import"./board-guides-_3R1t_-2.js";import"./relative-import-specifier-DQzkawgj.js";import"./story-arg-descriptors-Ek86ExX7.js";import"./inspect-C8RP8G5F.js";import"./inference-diagnostics-MGcIHEX6.js";import"./writer-tw6EcuVO.js";import"./three-state-wXRU3rLr.js";import"./editor-shell-store-Bh1S7M54.js";import"./output-pass-HurwNl0G.js";import"./viewport-door-DVkMQazS.js";const yt="workspace.service";function zt(){t()}export{yt as point,zt as start};
@@ -1 +0,0 @@
1
- import{a as t}from"./jsx-runtime-DPjLkJKQ.js";import{q as B,eo as C,ae as o,em as c,$ as k,aQ as Y,aL as O,dx as D,eE as Z,eX as tt}from"./index-CaG87ZF-.js";import{N as et}from"./game-network-Bo_nlDR5.js";import{r as f}from"./index-nmcBqr7Y.js";import"./index-CtzuWnCS.js";import"./_commonjsHelpers-D6-XlEtG.js";import"./index-FUuS4qwW.js";import"./client-DNXj_opT.js";import"./index-D_NuPfjr.js";import"./index-CinJrH5C.js";import"./index-OZVqp6xS.js";import"./index-Da9JhEvW.js";import"./native-debug-module-B-rWJfWE.js";import"./native-entry-surface-BE8LJNdu.js";import"./debug-registry-l7k5Hjc8.js";import"./contract-system-adapters-h6OUBRYA.js";import"./game-contract-seams-C0AVYwvO.js";import"./seeded-random-38To73fI.js";import"./game-audio-CaGKzia4.js";import"./rapier-physics-adapter-CaZqWLu0.js";import"./events-156d8d12.esm-CYeuVCYr.js";import"./three.module-BLhyNg0e.js";import"./three.core-3arARmh6.js";import"./index-bQE2NA0D.js";import"./live-project-verbs-BOAQN3ME.js";import"./capability-coverage-DQgg6UJe.js";import"./edit-mode-authoring-DBjaBTxM.js";import"./json-history-resource-CTXRV4GD.js";import"./binding-resolver-C_9MBSMa.js";import"./adapter-surface-Y37Nzcyw.js";import"./structural-signature-Dc7skRiy.js";import"./webgl-frame-capture-DdJkM2mi.js";import"./realm-services-DefTrXnY.js";import"./canvas-entry-runtime-DVeh71nC.js";import"./three-ingest-runtime-CXKjNysA.js";import"./EffectComposer-BEAt0PtQ.js";import"./CopyShader-BzTUYzf6.js";import"./ShaderPass-DTnDQXm0.js";import"./Pass-D1MRT672.js";import"./CSS3DRenderer-BsAqfavI.js";import"./relative-path-guard-GiM7Lsz8.js";import"./react-root-BHA-cdrW.js";import"./editor-presentation-activity-C7SNSmTd.js";import"./active-ingest-CnAeQcuQ.js";import"./ingest-source-persistence-6peGfPAS.js";import"./pixi-story-model-DNkfnWUV.js";import"./surface-content-Dg9Kkazf.js";import"./viewport-root-presentation-B35t51xX.js";import"./mounted-authoring-B7RL_V28.js";import"./entity-object-B_5Gc0Ky.js";import"./user-data-CqOoAowZ.js";import"./workspace-arrangement-DIMM7ska.js";import"./three-contract-Dkt6PmWY.js";import"./three-oYrcK5SQ.js";import"./editor-layers-B4oYfpj8.js";import"./component-instance-root-df4ofoOR.js";import"./viewport-editor-controls-BYaAZ_Ku.js";import"./three-authoring-adapter-BrkGH4cd.js";import"./source-persistence-backend-HviqjKZ2.js";import"./three-projection-core-jBJVt6O0.js";import"./body-marks-RKb_LTwL.js";import"./user-data-dHvLdpwM.js";import"./object-marks-DwvIEBOK.js";import"./structural-ids-Br2zjINh.js";import"./object3d-authoring-subject-BDrxd1GA.js";import"./r3f-physics-binding-Bgzzd4ol.js";import"./deferred-ingest-play-Bej67_y9.js";import"./rrweb-Cd2ifIRP.js";import"./react-world-authoring-adapter-C1jPW_cN.js";import"./board-guides-_3R1t_-2.js";import"./relative-import-specifier-DQzkawgj.js";import"./story-arg-descriptors-Ek86ExX7.js";import"./inspect-C8RP8G5F.js";import"./inference-diagnostics-MGcIHEX6.js";import"./writer-tw6EcuVO.js";import"./three-state-wXRU3rLr.js";import"./editor-shell-store-Bh1S7M54.js";import"./output-pass-HurwNl0G.js";import"./viewport-door-DVkMQazS.js";function nt(e){return e?{connectionState:e.getConnectionState?.(),roomInfo:e.getRoomInfo?.(),stats:e.getReplicationStats?.()}:null}function st(e){return e?{stateTree:typeof e.getStateSnapshot=="function",messageLog:typeof e.messageEvents=="function",rates:typeof e.getRates=="function",conditioning:typeof e.getConditioning=="function"&&typeof e.setConditioning=="function",connection:typeof e.getConnectionState=="function",room:typeof e.getRoomInfo=="function",stats:typeof e.getReplicationStats=="function",identity:typeof e.getPlayerIdentity=="function",identitySettable:typeof e.setPlayerIdentity=="function",traffic:typeof e.getTrafficByType=="function",send:typeof e.sendMessage=="function",ping:typeof e.ping=="function",server:typeof e.inspectServer=="function",entityTraffic:typeof e.getTrafficByEntity=="function",recording:typeof e.isRecording=="function"&&typeof e.setRecording=="function"}:null}class _{constructor(n=500){this.capacity=n}entries=[];lastSeq=0;paused=!1;pull(n){if(this.paused||!n?.messageEvents)return 0;const s=n.messageEvents(this.lastSeq);if(s.length===0)return 0;for(const i of s)this.entries.push(i),i.seq>this.lastSeq&&(this.lastSeq=i.seq);return this.entries.length>this.capacity&&this.entries.splice(0,this.entries.length-this.capacity),s.length}get all(){return this.entries}clear(){this.entries=[]}}function it(e,n){const s=n.trim().toLowerCase();return s?e.filter(i=>i.type.toLowerCase().includes(s)):[...e]}class P{constructor(n=60){this.capacity=n}values=[];push(n){this.values.push(n),this.values.length>this.capacity&&this.values.shift()}get data(){return this.values}get latest(){return this.values.length>0?this.values[this.values.length-1]:null}}class V{msgsIn=new P;msgsOut=new P;bytesIn=new P;bytesOut=new P;sample(n){this.msgsIn.push(n.msgsInPerSec),this.msgsOut.push(n.msgsOutPerSec),n.bytesInPerSec!==void 0&&this.bytesIn.push(n.bytesInPerSec),n.bytesOutPerSec!==void 0&&this.bytesOut.push(n.bytesOutPerSec)}}function ot(e,n,s,i=1){if(e.length<2)return"";const a=Math.max(1,...e),l=s-i*2,u=n/(e.length-1);return e.map((y,S)=>{const v=S*u,h=i+l*(1-y/a);return`${v.toFixed(1)},${h.toFixed(1)}`}).join(" ")}const rt={disconnected:o.content.muted,connecting:o.semantic.warning,connected:o.semantic.success,error:o.semantic.danger},N={fontFamily:o.typography.mono,fontSize:C.base};function $({children:e,testId:n}){return t.jsx("div",{"data-testid":n,style:{padding:c[4],color:o.content.muted,fontSize:C.base,fontStyle:"italic"},children:e})}function lt(e){return e!==null&&typeof e=="object"}function at(e){return typeof e=="string"?`"${e}"`:typeof e=="number"?Number.isInteger(e)?String(e):e.toFixed(3):String(e)}function K({type:e}){return e?t.jsx("span",{"data-testid":"net-tree-type",style:{color:o.content.dim,marginLeft:6},children:e}):null}function H({name:e,value:n,depth:s,path:i=[],edit:a,remove:l,typeOf:u}){const[y,S]=f.useState(s===0),[v,h]=f.useState(null),[x,m]=f.useState(null),d={...N,paddingLeft:8+s*14,lineHeight:"18px",whiteSpace:"nowrap"};if(!lt(n)){const j=a&&(typeof n=="number"||typeof n=="string"||typeof n=="boolean"),T=p=>{h(null),a?.(i,p).then(()=>m(null),I=>m(I instanceof Error?I.message:String(I)))},E=p=>{if(typeof n=="number"){const I=Number(p);return Number.isFinite(I)?I:n}return p};return t.jsxs("div",{style:d,"data-testid":"net-tree-leaf","data-path":i.join("."),children:[t.jsx("span",{style:{color:o.content.primary},children:e}),t.jsx("span",{style:{color:o.content.muted},children:": "}),v!==null?t.jsx(O,{"data-testid":"net-tree-edit",autoFocus:!0,value:v,onChange:p=>h(p.target.value),onKeyDown:p=>{p.key==="Enter"&&T(E(v)),p.key==="Escape"&&h(null)},onBlur:()=>h(null),style:{width:120}}):t.jsx("span",{"data-testid":j?"net-tree-value":void 0,title:j?typeof n=="boolean"?"Click to toggle on the server":"Click to edit on the server":void 0,style:{color:o.content.primary,cursor:j?"text":void 0},onClick:j?()=>typeof n=="boolean"?T(!n):h(String(n)):void 0,children:at(n)}),t.jsx(K,{type:i.length>0?u?.(i):null}),l&&i.length>0?t.jsx("button",{type:"button","data-testid":"net-tree-delete",title:"Delete this key on the server","aria-label":`Delete ${i.join(".")} on the server`,onClick:()=>l(i).then(()=>m(null),p=>m(p instanceof Error?p.message:String(p))),style:{marginLeft:8,border:0,background:"transparent",color:o.content.muted,cursor:"pointer"},children:"×"}):null,x?t.jsxs("span",{style:{color:o.semantic.danger},children:[" ",x]}):null]})}const g=Object.entries(n);return t.jsxs("div",{children:[t.jsxs("div",{style:{...d,cursor:"pointer",userSelect:"none"},"data-testid":"net-tree-branch","data-expanded":y||void 0,onClick:()=>S(j=>!j),children:[t.jsx("span",{style:{color:o.content.muted,display:"inline-block",width:12},children:t.jsx(Z,{direction:y?"down":"right"})}),t.jsx("span",{style:{color:o.content.primary},children:e}),t.jsxs("span",{style:{color:o.content.dim},children:[" ",Array.isArray(n)?`[${g.length}]`:`{${g.length}}`]}),t.jsx(K,{type:i.length>0?u?.(i):null}),x?t.jsxs("span",{style:{color:o.semantic.danger},children:[" ",x]}):null,l&&i.length>0?t.jsx("button",{type:"button","data-testid":"net-tree-delete",title:"Delete this key on the server","aria-label":`Delete ${i.join(".")} on the server`,onClick:j=>{j.stopPropagation(),l(i).then(()=>m(null),T=>m(T instanceof Error?T.message:String(T)))},style:{marginLeft:8,border:0,background:"transparent",color:o.content.muted,cursor:"pointer"},children:"×"}):null]}),y&&g.map(([j,T])=>t.jsx(H,{name:j,value:T,depth:s+1,path:s===0?[j]:[...i,j],edit:a,remove:l,typeOf:u},j))]})}const U=96,G=22,dt=f.memo(function({points:n,color:s}){return t.jsx("svg",{width:U,height:G,style:{display:"block",background:o.surface.inset,borderRadius:o.shape.small},role:"img","aria-label":"rate sparkline",children:n&&t.jsx("polyline",{points:n,fill:"none",stroke:s,strokeWidth:1.2})})});function F({label:e,series:n,unit:s,color:i,testId:a}){const l=n.latest;return t.jsxs("div",{"data-testid":a,style:{display:"flex",flexDirection:"column",gap:c[1]},children:[t.jsxs("div",{style:{fontSize:C.sm,color:o.content.muted},children:[e," ",t.jsx("span",{style:{color:o.content.primary,fontFamily:o.typography.mono},children:l===null?"n/a":`${l}${s}`})]}),t.jsx(dt,{points:ot(n.data,U,G),color:i})]})}function ct({event:e}){const n=e.direction==="in"?o.semantic.success:o.accent.default;return t.jsxs("div",{"data-testid":"net-log-row","data-direction":e.direction,style:{...N,display:"grid",gridTemplateColumns:"64px 24px 1fr 56px",gap:c[2],lineHeight:"17px",padding:`0 ${c[4]}`,opacity:e.dropped?.55:1},children:[t.jsxs("span",{style:{color:o.content.dim},children:[(e.time/1e3).toFixed(2),"s"]}),t.jsx("span",{style:{color:n},children:e.direction==="in"?"↓in":"↑out"}),t.jsxs("span",{style:{color:o.content.primary,textDecoration:e.dropped?"line-through":"none",overflow:"hidden",textOverflow:"ellipsis"},children:[e.type,e.dropped?" (dropped)":""]}),t.jsx("span",{style:{color:o.content.muted,textAlign:"right"},children:e.size!==void 0?`${e.size} B`:"—"})]})}function pt({adapter:e}){const[n,s]=f.useState(()=>e.getConditioning?.()??{latencyMs:0,jitterMs:0,packetLoss:0}),i=e.getConditioningLimits?.()??{},a=l=>{s(l),e.setConditioning?.(l)};return t.jsxs("div",{"data-testid":"net-conditioner",style:{display:"flex",gap:c[4],alignItems:"center",padding:`${c[2]} ${c[4]}`},children:[t.jsx("span",{style:{fontSize:C.sm,color:o.content.muted},children:"Conditioner"}),t.jsx(D,{label:"latency ms",value:n.latencyMs,step:10,testId:"net-cond-latency",onChange:l=>a({...n,latencyMs:Math.max(0,l)})}),t.jsx(D,{label:"jitter ms",value:n.jitterMs,step:5,testId:"net-cond-jitter",onChange:l=>a({...n,jitterMs:Math.max(0,l)})}),i.packetLoss?t.jsx("span",{"data-testid":"net-cond-loss-absent",title:i.packetLoss,style:{fontSize:C.sm,color:o.content.muted},children:"loss: not simulated"}):t.jsx(D,{label:"loss %",value:n.packetLoss*100,step:5,testId:"net-cond-loss",onChange:l=>a({...n,packetLoss:Math.min(1,Math.max(0,l/100))})})]})}function ut({adapter:e,settable:n}){const[s,i]=f.useState(()=>e.getPlayerIdentity?.()?.name??""),a=()=>{const l=s.trim();l&&e.setPlayerIdentity?.({name:l})};return t.jsxs("div",{"data-testid":"net-identity",style:{display:"flex",gap:c[4],alignItems:"center",padding:`${c[2]} ${c[4]}`},children:[t.jsx("span",{style:{fontSize:C.sm,color:o.content.muted},children:"Player name"}),n?t.jsx(O,{"data-testid":"net-identity-name",value:s,onChange:l=>i(l.target.value),onBlur:a,onKeyDown:l=>{l.key==="Enter"&&l.currentTarget.blur()},style:{width:140}}):t.jsx("span",{"data-testid":"net-identity-name",style:{...N,color:o.content.primary},children:s||"—"})]})}function yt({view:e,caps:n,rates:s}){return t.jsxs("div",{style:{display:"flex",flexWrap:"wrap",gap:c[6],alignItems:"center",padding:`${c[2]} ${c[4]}`,borderBottom:`1px solid ${o.boundary.default}`},children:[e.connectionState!==void 0?t.jsxs("span",{"data-testid":"net-connection-state",style:{color:rt[e.connectionState]},children:["● ",e.connectionState]}):t.jsx($,{testId:"net-connection-state-absent",children:"Connection state not provided by this adapter."}),e.roomInfo===void 0?t.jsx($,{testId:"net-room-absent",children:"Room info not provided by this adapter."}):e.roomInfo?t.jsxs("span",{style:{...N,color:o.content.primary},children:[e.roomInfo.roomName," · ",e.roomInfo.roomId," · session ",e.roomInfo.sessionId]}):t.jsx("span",{style:{color:o.content.muted},children:"no room"}),e.stats?t.jsxs("span",{style:{color:o.content.muted},children:["entities ",t.jsx("span",{style:{color:o.content.primary},children:e.stats.entities})]}):t.jsx($,{testId:"net-stats-absent",children:"Replication stats not provided by this adapter."}),n.rates?t.jsxs("div",{"data-testid":"net-sparklines",style:{display:"flex",gap:c[5]},children:[t.jsx(F,{label:"msgs in",unit:"/s",series:s.msgsIn,color:o.semantic.success,testId:"net-rate-msgs-in"}),t.jsx(F,{label:"msgs out",unit:"/s",series:s.msgsOut,color:o.accent.default,testId:"net-rate-msgs-out"}),t.jsx(F,{label:"bytes in",unit:" B/s",series:s.bytesIn,color:o.semantic.success,testId:"net-rate-bytes-in"}),t.jsx(F,{label:"bytes out",unit:" B/s",series:s.bytesOut,color:o.accent.default,testId:"net-rate-bytes-out"})]}):t.jsx($,{testId:"net-rates-absent",children:"Rates not provided by this adapter."})]})}const W=et,q="networkMessageDraft";function mt(){const[,e]=f.useReducer(p=>p+1,0),n=f.useRef(new _),s=f.useRef(new V),i=f.useRef(null),[a,l]=f.useState(!1),[u,y]=f.useState(""),[S,v]=f.useState(()=>B().projectLocalState.read(W)??!1),[h,x]=f.useState(()=>B().projectLocalState.read(q)??{type:"message_type",payload:"{}"}),m=p=>{B().projectLocalState.write(q,p),x(p)};f.useEffect(()=>{const p=()=>{const M=B().systems.inspectedNetworking()??null;return M!==i.current&&(i.current=M,n.current=new _,n.current.paused=a,s.current=new V),M},I=()=>{const M=p();n.current.pull(M),e()};I();const L=setInterval(I,250),w=setInterval(()=>{const r=p()?.getRates?.();r&&s.current.sample(r)},1e3),R=B().systems.inspectedNetworking()?.subscribe(()=>e());return()=>{clearInterval(L),clearInterval(w),R?.()}},[a]);const d=i.current??B().systems.inspectedNetworking()??null,g=st(d);if(!d||!g)return t.jsxs("div",{"data-testid":"network-inspector-empty",style:{padding:c[8],color:o.content.muted,fontSize:C.md,lineHeight:"18px"},children:[t.jsx("div",{style:{color:o.content.primary,marginBottom:c[2]},children:"No networking adapter is registered."}),"Games expose replication state to this inspector by registering a"," ",t.jsx("code",{style:N,children:"NetworkingAdapter"})," during setup:"," ",t.jsx("code",{style:N,children:"ctx.registerSystemAdapter?.('networking', adapter)"})," — see the third-person-arena example. Single-player games register none; there is nothing to inspect."]});const j=nt(d),T=g.stateTree?d.getStateSnapshot?.():void 0,E=it(n.current.all,u);return t.jsxs("div",{"data-testid":"network-inspector",className:"vgai-content-frost",style:{flex:1,minHeight:0,display:"flex",flexDirection:"column",fontSize:C.md},children:[t.jsx(yt,{view:j,caps:g,rates:s.current}),g.identity?t.jsx(ut,{adapter:d,settable:g.identitySettable},d.getPlayerIdentity?.()?.name??""):null,g.conditioning?t.jsx(pt,{adapter:d}):t.jsx($,{testId:"net-conditioner-absent",children:"Link conditioning not provided by this adapter."}),g.server?t.jsx(vt,{adapter:d,ownSession:j.roomInfo?.sessionId??null,ownRoom:j.roomInfo?.roomId??null,draft:h,setDraft:m}):null,g.recording||g.traffic?t.jsxs("div",{"data-testid":"net-profiler-bar",style:{display:"flex",gap:c[3],alignItems:"center",padding:c[2],borderBottom:`1px solid ${o.boundary.default}`},children:[g.recording?t.jsx(t.Fragment,{children:t.jsx(k,{type:"button",variant:"ghost","data-testid":"net-recording","aria-pressed":d.isRecording?.()===!0,onClick:()=>{d.setRecording?.(!d.isRecording?.()),e()},children:d.isRecording?.()?"Stop":"Start"})}):null,t.jsx(k,{type:"button",variant:"ghost","data-testid":"net-log-clear",onClick:()=>{n.current.clear(),d.clearTraffic?.(),e()},children:"Clear"}),g.recording?t.jsxs("label",{style:{display:"flex",gap:c[1],alignItems:"center",whiteSpace:"nowrap"},children:[t.jsx(Y,{"data-testid":"net-autostart",checked:S,onChange:p=>{const I=p.currentTarget.checked;B().projectLocalState.write(W,I),v(I)}}),"Autostart"]}):null]}):null,g.traffic?t.jsx(bt,{rows:d.getTrafficByType?.()??[]}):null,g.entityTraffic?t.jsx(ht,{rows:d.getTrafficByEntity?.()??[]}):null,g.send?t.jsx(St,{adapter:d,ping:g.ping,draft:h,setDraft:m}):null,t.jsxs("div",{style:{flex:1,minHeight:0,display:"flex"},children:[t.jsx("div",{"data-testid":"net-state-tree",style:{flex:1,minWidth:0,overflow:"auto",borderRight:`1px solid ${o.boundary.default}`,padding:`${c[2]} 0`},children:g.stateTree?T!=null?t.jsx(H,{name:"state",value:T,depth:0,edit:d.editServerState?(p,I)=>d.editServerState(p,I):void 0,remove:d.deleteServerState?p=>d.deleteServerState(p):void 0,typeOf:d.stateFieldType?p=>d.stateFieldType(p):void 0}):t.jsx($,{children:"Not connected — no replicated state to show."}):t.jsx($,{testId:"net-tree-absent",children:"Replicated-state snapshot not provided by this adapter."})}),t.jsx("div",{"data-testid":"net-message-log",style:{flex:1,minWidth:0,display:"flex",flexDirection:"column"},children:g.messageLog?t.jsxs(t.Fragment,{children:[t.jsxs("div",{style:{display:"flex",gap:c[3],alignItems:"center",padding:c[2]},children:[g.recording?null:t.jsx(k,{type:"button",variant:"ghost","data-testid":"net-log-pause",onClick:()=>{const p=!a;n.current.paused=p,l(p)},children:a?"Resume":"Pause"}),t.jsx(O,{"data-testid":"net-log-filter",placeholder:"Filter by type",value:u,onChange:p=>y(p.target.value),style:{flex:1,minWidth:60}}),t.jsxs("span",{style:{fontSize:C.sm,color:o.content.muted},children:[E.length,"/",n.current.all.length]})]}),t.jsx("div",{style:{flex:1,minHeight:0,overflow:"auto"},children:E.length===0?t.jsx($,{children:"No messages captured yet."}):E.map(p=>t.jsx(ct,{event:p},p.seq))})]}):t.jsx($,{testId:"net-log-absent",children:"Message log not provided by this adapter."})})]})]})}function ht({rows:e}){const n={padding:`0 ${c[3]}`,textAlign:"right",whiteSpace:"nowrap"};return t.jsx("div",{"data-testid":"net-entity-traffic",style:{maxHeight:132,overflow:"auto",borderBottom:`1px solid ${o.boundary.default}`},children:e.length===0?t.jsx($,{children:"No state patches yet."}):t.jsxs("table",{style:{width:"100%",borderCollapse:"collapse",fontSize:C.sm,...N},children:[t.jsx("thead",{children:t.jsxs("tr",{style:{color:o.content.muted},children:[t.jsx("th",{style:{...n,textAlign:"left"},children:"Entity"}),t.jsx("th",{style:n,title:"Syncs in - out, as Godot pairs them: the state patches that changed it, and none out, because a Colyseus client sends no state",children:"Count"}),t.jsx("th",{style:n,title:"Field changes those patches carried",children:"Changes"}),t.jsx("th",{style:n,title:"Size in - out: the size range of the patches that carried it (they carried other entities too), and none out",children:"Size"})]})}),t.jsx("tbody",{children:e.map(s=>t.jsxs("tr",{"data-testid":"net-entity-traffic-row",children:[t.jsx("td",{style:{...n,textAlign:"left"},children:s.path}),t.jsx("td",{style:n,children:`${s.syncs} - 0`}),t.jsx("td",{style:n,children:s.changes}),t.jsx("td",{style:n,children:`${s.patchBytesMin===s.patchBytesMax?`${s.patchBytesMin} B`:`${s.patchBytesMin}…${s.patchBytesMax} B`} - 0 B`})]},s.path))})]})})}function gt(e){try{return JSON.parse(e)}catch{return e}}function xt({text:e,onChange:n}){const[s,i]=f.useState("tree");let a;try{a=e.trim()===""?{}:JSON.parse(e)}catch{a=void 0}const l=u=>n(JSON.stringify(u));return t.jsxs("div",{"data-testid":"net-payload-editor",style:{display:"flex",flexDirection:"column",gap:c[1]},children:[t.jsx("div",{style:{display:"flex",gap:c[1]},children:["tree","text"].map(u=>t.jsx(k,{type:"button",variant:"ghost","aria-pressed":s===u,"data-testid":`net-payload-view-${u}`,onClick:()=>i(u),children:u==="tree"?"Tree":"Text"},u))}),s==="text"||a===void 0?t.jsxs(t.Fragment,{children:[t.jsx(tt,{"data-testid":"net-send-dialog-payload",rows:6,value:e,onChange:u=>n(u.target.value),style:N}),a===void 0?t.jsx("span",{style:{color:o.content.muted},children:"Not JSON yet, so the tree cannot show it."}):null]}):t.jsx("div",{style:{...N,fontSize:C.sm},children:t.jsx(X,{value:a,onChange:l,depth:0})})]})}function X({value:e,onChange:n,depth:s}){const[i,a]=f.useState(""),[l,u]=f.useState(""),y={paddingLeft:s*12};if(e!==null&&typeof e=="object"){const S=Array.isArray(e),v=S?e.map((m,d)=>[String(d),m]):Object.entries(e),h=(m,d)=>{n(S?e.map((g,j)=>String(j)===m?d:g):{...e,[m]:d})},x=m=>{n(S?e.filter((d,g)=>String(g)!==m):Object.fromEntries(Object.entries(e).filter(([d])=>d!==m)))};return t.jsxs("div",{"data-testid":"net-payload-branch",children:[v.map(([m,d])=>t.jsxs("div",{style:y,children:[t.jsxs("span",{style:{color:o.content.muted},children:[m,": "]}),d!==null&&typeof d=="object"?t.jsx("span",{style:{color:o.content.muted},children:Array.isArray(d)?"[":"{"}):null,t.jsx("button",{type:"button","data-testid":"net-payload-remove",title:`Remove ${m}`,onClick:()=>x(m),style:{background:"none",border:0,color:o.content.muted,cursor:"pointer"},children:"×"}),d!==null&&typeof d=="object"?t.jsx(X,{value:d,onChange:g=>h(m,g),depth:s+1}):t.jsx(J,{value:d,onChange:g=>h(m,g)})]},m)),t.jsxs("div",{style:{...y,display:"flex",gap:c[1]},children:[S?null:t.jsx(O,{"data-testid":"net-payload-new-key",placeholder:"key",value:i,onChange:m=>a(m.target.value),style:{width:90}}),t.jsx(O,{"data-testid":"net-payload-new-value",placeholder:"value",value:l,onChange:m=>u(m.target.value),style:{width:110}}),t.jsx(k,{type:"button",variant:"ghost","data-testid":"net-payload-add",disabled:!S&&i.trim()==="",onClick:()=>{const m=gt(l);n(S?[...e,m]:{...e,[i.trim()]:m}),a(""),u("")},children:"Add"})]})]})}return t.jsx(J,{value:e,onChange:n})}function J({value:e,onChange:n}){const s=e===null?"null":typeof e=="number"?"number":typeof e=="boolean"?"boolean":"string",i=s==="string"?String(e):JSON.stringify(e),[a,l]=f.useState(i);f.useEffect(()=>l(i),[i]);const u=(y,S)=>{if(y==="null")return null;if(y==="boolean")return S.trim()==="true";if(y==="number"){const v=Number(S);return Number.isFinite(v)?v:0}return S};return t.jsxs("span",{style:{display:"inline-flex",gap:4},children:[s==="boolean"?t.jsx("input",{type:"checkbox","data-testid":"net-payload-leaf-boolean",checked:e===!0,onChange:y=>n(y.currentTarget.checked)}):s==="null"?t.jsx("span",{style:{color:o.content.muted},children:"null"}):t.jsx(O,{"data-testid":"net-payload-leaf",value:a,onChange:y=>l(y.target.value),onBlur:()=>n(u(s,a)),onKeyDown:y=>{y.key==="Enter"&&n(u(s,a))},style:{width:120}}),t.jsx("select",{"data-testid":"net-payload-leaf-type","aria-label":"Value type",value:s,onChange:y=>n(u(y.currentTarget.value,a)),children:["string","number","boolean","null"].map(y=>t.jsx("option",{value:y,children:y},y))})]})}const ft=[["name","Name"],["roomId","Room"],["clients","Clients"],["locked","Locked"],["elapsedMs","Elapsed"]];function jt(e,n){const s=i=>{const a=i[n.key];return typeof a=="number"?a:typeof a=="boolean"?Number(a):String(a)};return[...e].sort((i,a)=>{const l=s(i),u=s(a),y=l<u?-1:l>u?1:0;return n.descending?-y:y})}function bt({rows:e}){const n={padding:`0 ${c[3]}`,textAlign:"right",whiteSpace:"nowrap"},s=i=>i>=1024?`${(i/1024).toFixed(1)} KiB`:`${i} B`;return t.jsx("div",{"data-testid":"net-traffic",style:{maxHeight:132,overflow:"auto",borderBottom:`1px solid ${o.boundary.default}`},children:e.length===0?t.jsx($,{children:"No traffic yet."}):t.jsxs("table",{style:{width:"100%",borderCollapse:"collapse",fontSize:C.sm,...N},children:[t.jsx("thead",{children:t.jsxs("tr",{style:{color:o.content.muted},children:[t.jsx("th",{style:{...n,textAlign:"left"},children:"Type"}),t.jsx("th",{style:n,children:"In"}),t.jsx("th",{style:n,children:"Bytes in"}),t.jsx("th",{style:n,children:"Out"}),t.jsx("th",{style:n,children:"Bytes out"})]})}),t.jsx("tbody",{children:e.map(i=>t.jsxs("tr",{"data-testid":"net-traffic-row",children:[t.jsx("td",{style:{...n,textAlign:"left"},children:i.type}),t.jsx("td",{style:n,children:i.countIn||"-"}),t.jsx("td",{style:n,children:i.countIn?s(i.bytesIn):"-"}),t.jsx("td",{style:n,children:i.countOut||"-"}),t.jsx("td",{style:n,children:i.countOut?s(i.bytesOut):"-"})]},i.type))})]})})}function Q(e){if(e.type.trim()==="")throw new Error("Name the message type first.");return{type:e.type,payload:e.payload.trim()===""?void 0:JSON.parse(e.payload)}}function St({adapter:e,ping:n,draft:s,setDraft:i}){const[a,l]=f.useState(null),u=()=>{l("…"),e.ping?.().then(h=>l(`${h} ms`),h=>l(h instanceof Error?h.message:String(h)))},[y,S]=f.useState(null),v=()=>{try{const h=Q(s);e.sendMessage?.(h.type,h.payload),S(null)}catch(h){S(h instanceof Error?h.message:String(h))}};return t.jsxs("div",{"data-testid":"net-send",style:{display:"flex",gap:c[2],alignItems:"center",padding:c[2]},children:[t.jsx(O,{"data-testid":"net-send-type",placeholder:"Message type",value:s.type,onChange:h=>i({...s,type:h.target.value}),style:{width:140}}),t.jsx(O,{"data-testid":"net-send-payload",placeholder:'Payload (JSON), e.g. {"x": 1}',value:s.payload,onChange:h=>i({...s,payload:h.target.value}),style:{flex:1,minWidth:80}}),t.jsx(k,{type:"button",variant:"ghost","data-testid":"net-send-button",disabled:s.type.trim()==="",onClick:v,children:"Send as this client"}),n?t.jsxs(t.Fragment,{children:[t.jsx(k,{type:"button",variant:"ghost","data-testid":"net-ping",onClick:u,children:"Ping"}),a?t.jsx("span",{"data-testid":"net-rtt",style:{fontSize:C.sm,...N},children:a}):null]}):null,y?t.jsx("span",{"data-testid":"net-send-error",style:{color:o.semantic.danger,fontSize:C.sm},children:y}):null]})}function vt({adapter:e,ownSession:n,ownRoom:s,draft:i,setDraft:a}){const[l,u]=f.useState(null),[y,S]=f.useState(null),[v,h]=f.useState("clients"),[x,m]=f.useState(void 0),[d,g]=f.useState(void 0),[j,T]=f.useState({key:"elapsedMs",descending:!0}),[E,p]=f.useState(null);f.useEffect(()=>{let r=!0;const b=()=>{e.inspectServer?.(d).then(A=>{r&&m(A)},A=>{r&&p(A instanceof Error?A.message:String(A))})};b();const z=setInterval(b,2e3);return()=>{r=!1,clearInterval(z)}},[e,d]);const I=r=>{try{r()?.then(()=>p(null),b=>p(b instanceof Error?b.message:String(b)))}catch(b){p(b instanceof Error?b.message:String(b))}},L=r=>`${Math.round(r/1e3)} s`,w={padding:`0 ${c[3]}`,whiteSpace:"nowrap"};if(x===void 0)return null;if(x===null)return t.jsx($,{testId:"net-server-absent",children:"The room server serves no Monitor view (its `server` configuration sets VGAI_ROOM_MONITOR=1)."});const R=x.room?.roomId,M=(r,b,z)=>t.jsx(k,{type:"button",variant:"ghost","data-testid":r,onClick:()=>I(z),children:b});return t.jsxs("div",{"data-testid":"net-server",style:{padding:`${c[2]} 0`,borderBottom:`1px solid ${o.boundary.default}`,fontSize:C.sm},children:[t.jsxs("div",{"data-testid":"net-server-summary",style:{padding:`0 ${c[3]}`,color:o.content.muted},children:["Server · ",x.rooms.length," room",x.rooms.length===1?"":"s"," · ",x.connections," ","connection",x.connections===1?"":"s",x.cpuPercent!==null?` · CPU ${x.cpuPercent.toFixed(0)}%`:"",x.memory?` · memory ${Math.round(x.memory.usedMb)} / ${Math.round(x.memory.totalMb)} MB`:"",x.room?` · state ${x.room.stateBytes} B`:""]}),t.jsxs("table",{style:{borderCollapse:"collapse",...N},children:[t.jsx("thead",{children:t.jsxs("tr",{style:{color:o.content.muted},children:[ft.map(([r,b])=>t.jsxs("th",{"data-testid":`net-server-sort-${r}`,"aria-sort":j.key===r?j.descending?"descending":"ascending":"none",style:{...w,textAlign:"left",cursor:"pointer",fontWeight:"normal"},onClick:()=>T({key:r,descending:j.key===r?!j.descending:!1}),children:[b,j.key===r?j.descending?" ▾":" ▴":""]},r)),t.jsx("th",{style:w})]})}),t.jsx("tbody",{children:jt(x.rooms,j).map(r=>t.jsxs("tr",{"data-testid":"net-server-room","data-inspected":r.roomId===R||void 0,children:[t.jsx("td",{style:w,children:r.name}),t.jsx("td",{style:w,children:r.roomId}),t.jsxs("td",{style:w,children:[r.clients,r.maxClients!==null?` / ${r.maxClients}`:""," clients"]}),t.jsx("td",{style:w,children:r.locked?"locked":"open"}),t.jsx("td",{style:w,children:L(r.elapsedMs)}),t.jsxs("td",{style:w,children:[r.roomId===R?t.jsx(k,{type:"button",variant:"ghost","data-testid":"net-server-broadcast",onClick:()=>{S(null),u({sessionId:null})},children:"Broadcast"}):t.jsx(k,{type:"button",variant:"ghost","data-testid":"net-server-inspect",onClick:()=>g(r.roomId),children:"Inspect"}),M("net-server-dispose","Dispose",()=>e.disposeRoom?.(r.roomId))]})]},r.roomId))})]}),l?t.jsxs("div",{"data-testid":"net-send-dialog",role:"group","aria-labelledby":"net-send-dialog-title",style:{margin:c[2],padding:c[3],border:`1px solid ${o.boundary.default}`,borderRadius:4},children:[t.jsx("div",{id:"net-send-dialog-title",style:{color:o.content.primary,marginBottom:c[2]},children:l.sessionId?`Send message to client (${l.sessionId})`:"Broadcast message to all clients"}),t.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:c[2]},children:[t.jsxs("label",{style:{display:"flex",flexDirection:"column",gap:c[1]},children:[t.jsx("span",{style:{color:o.content.muted},children:"Message type"}),t.jsx(O,{"data-testid":"net-send-dialog-type",value:i.type,onChange:r=>a({...i,type:r.target.value})})]}),t.jsxs("label",{style:{display:"flex",flexDirection:"column",gap:c[1]},children:[t.jsx("span",{style:{color:o.content.muted},children:"Message payload (JSON)"}),t.jsx(xt,{text:i.payload,onChange:r=>a({...i,payload:r})})]}),y?t.jsx("span",{"data-testid":"net-send-dialog-error",children:y}):null]}),t.jsxs("div",{style:{display:"flex",gap:c[2],justifyContent:"flex-end",marginTop:c[2]},children:[t.jsx(k,{type:"button",variant:"ghost",onClick:()=>u(null),children:"Cancel"}),t.jsx(k,{type:"button","data-testid":"net-send-dialog-send",onClick:()=>{const r=l;(async()=>{try{const b=Q(i);await(r.sessionId?e.sendToClient?.(r.sessionId,b.type,b.payload,R):e.broadcast?.(b.type,b.payload,R)),S(null),u(null)}catch(b){S(b instanceof Error?b.message:String(b))}})()},children:"Send"})]})]}):null,x.room?t.jsxs("div",{"data-testid":"net-server-room-view",style:{padding:`${c[2]} 0`},children:[t.jsx("div",{role:"tablist",style:{display:"flex",gap:c[2],padding:`0 ${c[3]}`},children:[["clients",`Clients (${x.room.clients.length})`],["state","State"]].map(([r,b])=>t.jsx(k,{type:"button",variant:"ghost",role:"tab","aria-selected":v===r,"data-testid":`net-server-tab-${r}`,onClick:()=>h(r),children:b},r))}),v==="clients"?t.jsx("table",{style:{borderCollapse:"collapse",...N},children:t.jsx("tbody",{children:x.room.clients.map(r=>t.jsxs("tr",{"data-testid":"net-server-client",children:[t.jsx("td",{style:w,children:"client"}),t.jsxs("td",{style:w,children:[r.sessionId,r.sessionId===n?" (this client)":""]}),t.jsx("td",{style:w,children:L(r.elapsedMs)}),t.jsxs("td",{style:w,colSpan:3,children:[t.jsx(k,{type:"button",variant:"ghost","data-testid":"net-server-send",onClick:()=>{S(null),u({sessionId:r.sessionId})},children:"Send"}),M("net-server-disconnect","Disconnect",()=>e.disconnectClient?.(r.sessionId,R))]})]},r.sessionId))})}):x.room.state!==void 0?t.jsx("div",{"data-testid":"net-server-room-state",children:t.jsx(H,{name:`room ${x.room.roomId}${x.room.roomId===s?" (this client’s room)":""}`,value:x.room.state,depth:0,edit:e.editServerState?(r,b)=>e.editServerState(r,b,R):void 0,remove:e.deleteServerState?r=>e.deleteServerState(r,R):void 0})}):t.jsx($,{children:"The server sent no state for this room."})]}):null,E?t.jsx($,{children:E}):null]})}const Ue="workspace.utility",Ge="Network",Xe=25,Qe=()=>B().systems.inspectedNetworking()!==null;function Ye(){return t.jsx(mt,{})}export{Qe as available,Ye as default,Xe as order,Ue as point,Ge as title};
@@ -1 +0,0 @@
1
- const n={editorHelperType:"editorHelperType",skeletonVisible:"skeletonVisible",skeletonEnabled:"skeletonEnabled",engineInternal:"engineInternal",editorHelper:"editorHelper",vgaiComponentRoot:"vgaiComponentRoot",vgaiBuiltInternal:"vgaiBuiltInternal"};function r(e,t){return e?e.userData[n[t]]:void 0}function i(e,t,o){e.userData[n[t]]=o}export{n as ObjectMarkKeys,r as getObjectMark,i as setObjectMark};
@@ -1 +0,0 @@
1
- import{s as z}from"./index-C20Flc1s.js";import{M as b,gy as G,bl as k,bm as j,q as A}from"./index-CaG87ZF-.js";import{c as X}from"./source-persistence-backend-HviqjKZ2.js";import{c as Y}from"./component-instance-root-df4ofoOR.js";import{J as V}from"./json-history-resource-CTXRV4GD.js";import{a as Z,b as q}from"./pixi-transform-channels-P4rvmusc.js";function m(i){const t=i.constructor?.name?.toLowerCase()??"container";return t.includes("animatedsprite")?"animatedsprite":t.includes("nineslice")?"nineslicesprite":t.includes("tiling")?"tilingsprite":t.includes("sprite")?"sprite":t.includes("text")?"text":t.includes("graphics")?"graphics":"container"}function Q(i){const t=J(i);if(t)return t;const e=rt(i);if(e)return e;const r=et(i);if(r)return r;const n=y(i);if(n)return n;const o=m(i),s=i.children?.length??0;return s>0?`${o} (${s})`:o}function J(i){const t=i.label?.trim();if(t){if(M(t)&&t!==i.constructor?.name)return t;if(!P(t))return t}}function M(i){return i.length<=2&&i===i.toLowerCase()}const tt=new Set(["container","displayobject","sprite","animatedsprite","nineslicesprite","tilingsprite","text","bitmaptext","htmltext","graphics","mesh"]);function P(i){return M(i)||i==="Object"||i==="Function"?!0:tt.has(i.replace(/^_+/,"").toLowerCase())}function et(i){const e=i.texture?.label?.trim();return!e||/^(_?texture)?(empty|white)$/i.test(e)?void 0:(e.split("/").pop()??e).replace(/\.[a-z0-9]+$/i,"")||void 0}function y(i){const t=i.constructor?.name;if(!(!t||P(t)))return t.replace(/^_+/,"")||void 0}function x(i){const t=i.replace(/^_+/,"");return t.length>0?t:void 0}function N(i){return"addChild"in i&&typeof i.addChild=="function"&&"children"in i}function rt(i){const t={seen:new WeakSet,budget:it};let e=i.parent;for(let r=0;r<8&&e&&typeof e=="object";r++){if(t.budget<=0)return;const n=I(e,i,t)??F(e,i,2,t);if(n)return n;e=e.parent}}const it=2e3;function w(i){return i.budget<=0?!1:(i.budget-=1,!0)}function S(i){return/^_?[A-Za-z][A-Za-zA-Z0-9]*$/.test(i)?!nt.has(i.replace(/^_+/,"")):!1}const nt=new Set(["parent","children","transform","position","origin","scale","pivot","skew","anchor","worldTransform","localTransform","groupTransform","relativeGroupTransform","renderGroup","parentRenderGroup","parentRenderGroupIndex","parentRenderLayer","relativeRenderGroupDepth","renderPipeId","instructionSet","childrenToUpdate","childrenRenderablesToUpdate","effects","filters","mask","bounds","boundsArea","visualBounds","gpuData","texture","events","eventsCount","updateFlags"]);function I(i,t,e){if(e.seen.has(i))return;e.seen.add(i);const r=C(i,t,void 0,e);if(r)return r;for(const[n,o]of Object.entries(i)){if(!w(e))return;if(!S(n))continue;const s=$(i,n,o,t);if(s)return s;const a=C(o,t,n,e);if(a)return a}}function C(i,t,e,r){const n=ut(i);if(n)for(const[o,s]of n){if(!w(r))return;const a=ot(i,s,st(o)??e,t,r);if(a)return a}}function ot(i,t,e,r,n){if(e){const o=$(t&&typeof t=="object"?t:i,e,t,r);if(o)return o}else if(t&&typeof t=="object"&&t.view===r){const o=y(t);if(o)return o}if(t&&typeof t=="object"&&!N(t))return I(t,r,n)}function st(i){if(!(!i||/^\d+$/.test(i)))return S(i)||i.includes("-")?x(i)??i:void 0}function*at(i){for(let t=0;t<i.length;t++)yield[String(t),i[t]]}function*ct(i){for(const[t,e]of i.entries())yield[String(t),e]}function*lt(i){let t=0;for(const e of i)yield[String(t),e],t+=1}function ut(i){if(!(!i||typeof i!="object")){if(Array.isArray(i))return at(i);if(i instanceof Map)return ct(i);if(i instanceof Set)return lt(i);if(Object.getPrototypeOf(i)===Object.prototype)return Object.entries(i)}}function $(i,t,e,r){if(e===r){const n=x(t);return n&&n.toLowerCase()!=="view"?y(e)??n:y(e)??y(i)??n}if(e&&typeof e=="object"&&e.view===r)return y(e)??x(t)}function F(i,t,e,r){const n=I(i,t,r);if(n)return n;if(!(e<=0))for(const[o,s]of Object.entries(i)){if(!w(r))return;if(!S(o)||!s||typeof s!="object"||N(s))continue;const a=F(s,t,e-1,r);if(a)return a}}const dt={idFor:(i,t)=>`w2d:${t.join("/")}:${m(i)}:${i.label??""}`};class ht{constructor(t,e={}){this.root=t,e.overlay&&(this.overlay=e.overlay),this.identity=e.identity??dt,this.refresh()}byId=new Map;overlay={};dirty=!1;identity;names=new WeakMap;reindex(){this.byId.clear(),this.identity.beginWalk?.();let t=0,e=0;const r=(n,o)=>{const s=this.identity.idFor(n,o);n.__authId=s,this.byId.set(s,n),t++,m(n).includes("sprite")&&e++,n.children.forEach((a,u)=>{r(a,[...o,u])})};return this.root.children.forEach((n,o)=>{r(n,[o])}),{count:t,sprites:e}}refresh(){const t=this.reindex();for(const[e,r]of Object.entries(this.overlay))this.applyOverride(e,r);return t}roots(){return this.root.children.map(t=>this.toNode(t))}node(t){const e=this.byId.get(t);return e?this.toNode(e):null}displayObject(t){return this.byId.get(t)??null}nameOf(t){const e=this.names.get(t),r=t.parent??null,n=t.constructor,o=t.label??null,s=t.texture??null,a=t.children?.length??0;if(e&&e.parent===r&&e.type===n&&e.own===o&&e.texture===s&&e.childCount===a)return e;const u={label:Q(t),kind:m(t),parent:r,type:n,own:o,texture:s,childCount:a};return this.names.set(t,u),u}toNode(t){const e=t,{label:r,kind:n}=this.nameOf(t);return{id:e.__authId??"",label:r,kind:n,parentId:t.parent?.__authId??null,childIds:t.children.map(o=>o.__authId??"")}}getTransform(t){const e=this.byId.get(t);return!e||!e.position||!e.scale?null:{position:[e.position.x,e.position.y],rotation:e.rotation,scale:[e.scale.x,e.scale.y]}}setTransform(t,e){const r=this.byId.get(t);if(!r)return;e.position&&r.position.set(e.position[0],e.position[1]),e.rotation!==void 0&&(r.rotation=e.rotation),e.scale&&r.scale.set(e.scale[0],e.scale[1]),this.overlay[t]??={};const n=this.overlay[t];e.position&&(n.position=e.position),e.rotation!==void 0&&(n.rotation=e.rotation),e.scale&&(n.scale=e.scale),this.dirty=!0}properties(t){const e=this.byId.get(t);if(!e)return[];const r=[{path:"label",label:"Name",type:"string",value:e.label??""},{path:"visible",label:"Visible",type:"boolean",value:e.visible},{path:"alpha",label:"Alpha",type:"number",value:e.alpha}];return"tint"in e&&r.push({path:"tint",label:"Tint",type:"color",value:e.tint}),r}set(t,e,r){const n=this.byId.get(t);n&&(n[e]=r,this.overlay[t]??={},e==="label"&&(this.overlay[t].label=r),e==="alpha"&&(this.overlay[t].alpha=r),e==="tint"&&(this.overlay[t].tint=r),e==="visible"&&(this.overlay[t].visible=r),this.dirty=!0)}applyOverride(t,e){const r=this.byId.get(t);r&&(e.label!==void 0&&(r.label=e.label),e.alpha!==void 0&&(r.alpha=e.alpha),e.position&&r.position.set(e.position[0],e.position[1]),e.rotation!==void 0&&(r.rotation=e.rotation),e.scale&&r.scale.set(e.scale[0],e.scale[1]),e.tint!==void 0&&"tint"in r&&(r.tint=e.tint),e.visible!==void 0&&(r.visible=e.visible))}applyOverlay(t){let e=0,r=0;for(const[n,o]of Object.entries(t)){if(!this.byId.has(n)){r++;continue}this.applyOverride(n,o),this.overlay[n]={...this.overlay[n],...o},e++}return{applied:e,orphaned:r}}isDirty(){return this.dirty}serializeOverlay(){return this.overlay}replaceOverlay(t){this.overlay=structuredClone(t);for(const[e,r]of Object.entries(this.overlay))this.applyOverride(e,r);this.dirty=!0}markClean(){this.dirty=!1}}const ft={count:0,sprites:0};class pt{constructor(t,e,r,n=o=>queueMicrotask(o)){this.root=t,this.index=e,this.mapping=r,this.scheduleWindowClose=n,this.refresh()}current={nodes:new Map,rootIds:[],stats:ft};projectionFresh=!1;refresh(){const t=this.index.refresh();return this.current=this.readProjection(t),this.openProjectionWindow(),t}project(){return this.projectionFresh?this.current:this.reproject()}reproject(){const t=this.index.reindex();return this.current=this.readProjection(t),this.openProjectionWindow(),this.current}invalidate(){this.projectionFresh=!1}openProjectionWindow(){this.projectionFresh||(this.projectionFresh=!0,this.scheduleWindowClose(()=>{this.projectionFresh=!1}))}projection(){return this.current}object(t){const e=this.current.nodes.get(t)?.object??null;return e===null||e.destroyed?null:e}node(t){const e=this.current.nodes.get(t);if(!e)return null;const r=this.index.node(t);return r?{...r,parentId:e.parentId,childIds:[...e.childIds]}:null}roots(){return this.current.rootIds.map(t=>this.node(t)).filter(t=>t!==null)}pick(t,e,r){return this.candidates(t,e,r)[0]??null}candidates(t,e,r){const n=this.pointFromClient(t,e);return n?(this.project(),this.hitIds(n,r)):[]}pointFromClient(t,e){const r=this.mapping?.surface()??null;if(!r)return null;const n=r.getBoundingClientRect();if(n.width<=0||n.height<=0)return null;const o=this.mapping?.pointFromClient?.(t,e,n)??null;if(this.mapping?.pointFromClient)return o;const s=Number(r.dataset?.vgaiStageWidth??n.width),a=Number(r.dataset?.vgaiStageHeight??n.height);return!(s>0)||!(a>0)?null:{x:(t-n.left)*(s/n.width),y:(e-n.top)*(a/n.height)}}hitIds(t,e){const r=[],n=[];this.collectHits(this.root,t,"visual",r),this.collectHits(this.root,t,"hitArea",n);const o=[],s=new Set;for(const a of[...r,...n]){const u=a.__authId;u&&!e(u)&&!s.has(u)&&(s.add(u),o.push(u))}return o}rect(t){const e=this.object(t);if(!e||typeof e.getBounds!="function")return null;const r=e.getBounds();return!(r.width>0)||!(r.height>0)?null:{x:r.x,y:r.y,width:r.width,height:r.height}}frame(t){const e=this.object(t);if(!e||typeof e.getLocalBounds!="function")return null;const r=e.getLocalBounds();if(!(r.width>0)||!(r.height>0))return null;const n=(o,s)=>{const a=e.toGlobal({x:o,y:s});return{x:a.x,y:a.y}};return{tl:n(r.x,r.y),tr:n(r.x+r.width,r.y),br:n(r.x+r.width,r.y+r.height),bl:n(r.x,r.y+r.height)}}contextRects(t){const e=this.node(t);if(!e)return{siblings:[]};const r=e.parentId?this.node(e.parentId)?.childIds??[]:this.current.rootIds,n=e.parentId?this.rect(e.parentId):null;return{...n?{parent:n}:{},siblings:r.filter(o=>o!==t).map(o=>this.rect(o)).filter(o=>o!==null)}}readProjection(t){const e=new Map,r=[],n=o=>{const s=this.index.displayObject(o.id);if(!s)return;const a={object:s,id:o.id,parentId:o.parentId,childIds:[...o.childIds]};e.set(o.id,a);for(const u of o.childIds){const d=this.index.node(u);d&&n(d)}};for(const o of this.index.roots())r.push(o.id),n(o);return{nodes:e,rootIds:r,stats:t}}collectHits(t,e,r,n){const o=t.children??[];for(let s=o.length-1;s>=0;s--){const a=o[s];if(!a.visible||!a.renderable)continue;a.updateLocalTransform();const u={x:0,y:0};a.localTransform.applyInverse(e,u),this.collectHits(a,u,r,n),this.contains(a,u,r)&&n.push(a)}}contains(t,e,r){if(!t.__authId)return!1;const n=t;return r==="hitArea"?n.hitArea?n.hitArea.contains(e.x,e.y):!1:typeof n.containsPoint=="function"?n.containsPoint(e):!1}}const O="pixi",yt="data-oid",gt="data-authoring-instance",mt="data-authoring-label",bt="data-authoring-component";function xt(i){if(!i||typeof i!="object")return;const t=i[yt];return typeof t=="string"&&t.length>0?t:void 0}function T(i,t){if(!i||typeof i!="object")return;const e=i[t];return typeof e=="string"&&e.length>0?e:void 0}function v(i){return T(i,gt)}function vt(i){return T(i,mt)}function wt(i){return T(i,bt)}function H(i){const t=v(i);return t?v(i.parent)!==t:!1}function St(i){return H(i)?v(i):xt(i)}function It(i,t,e=0){return Y(`${O}:${i}:${t}`,e)}function Ot(i,t){return`${O}:${i}:@${t.join(".")}`}function Zt(i,t){const e=`${O}:${i}:`;if(!t.startsWith(e))return null;const r=t.slice(e.length);if(r.startsWith("@"))return null;const n=r.indexOf("#"),o=n<0?r:r.slice(0,n);return o.length>0?o:null}function qt(i){let t=new Map;return{beginWalk:()=>{t=new Map},idFor:(e,r)=>{const n=St(e);if(n===void 0)return Ot(i,r);const o=t.get(n)??0;return t.set(n,o+1),It(i,n,o)}}}const E="#root";function Tt(i){if(!(!i.position||!i.scale||!i.pivot||!i.skew))return{x:i.position.x,y:i.position.y,rotation:i.rotation,scaleX:i.scale.x,scaleY:i.scale.y,pivotX:i.pivot.x,pivotY:i.pivot.y,skewX:i.skew.x,skewY:i.skew.y}}function kt(i,t){!i.position||!i.scale||!i.pivot||!i.skew||(i.position.set(t.x,t.y),i.scale.set(t.scaleX,t.scaleY),i.pivot.set(t.pivotX,t.pivotY),i.skew.set(t.skewX,t.skewY),i.rotation=t.rotation)}class jt{constructor(t,e,r,n){this.root=t,this.onRestored=n;const o=e.shell.projectHistory;this.resource=o?new V({history:o,kind:"session-state",scope:"session",subject:{...r,id:`${r.id}/world-2d-structure`},displayName:"World 2D structure",capture:()=>this.capture(),conflictIdentity:s=>Object.fromEntries(Object.entries(s.placements).map(([a,u])=>[a,u.parent])),restore:async s=>{this.restore(s)}}):null}byUid=new Map;resource;track(t){return this.uidOf(t)}run(t,e){this.resource?.assertCanMutate();const r=this.capture(),n=e();return this.resource&&this.resource.record(t,r,this.capture()).catch(o=>{b.error(`[canvas] failed to journal "${t}" into project history — the structural edit is applied but has no history entry (it cannot be undone): ${o instanceof Error?o.message:String(o)}`,"authoring")}),n}dispose(){this.resource?.dispose(),this.byUid.clear()}uidOf(t){if(t===this.root)return E;const e=t,r=e.__vgaiStructUid;if(r&&this.byUid.get(r)===t)return r;const n=r??`s${crypto.randomUUID()}`;return e.__vgaiStructUid=n,this.byUid.set(n,t),n}capture(){const t={};for(const[e,r]of this.byUid){const n=r.parent??null,o=Tt(r);t[e]={parent:n?this.uidOf(n):null,index:n?n.children?.indexOf(r)??-1:-1,...o?{pose:o}:{}}}return{placements:t}}restore(t){const e=Object.entries(t.placements);for(const[r,n]of e){if(n.parent!==null)continue;const o=this.byUid.get(r);o?.parent?.removeChild(o)}for(const[r,n]of e.filter(([,o])=>o.parent!==null).sort((o,s)=>o[1].index-s[1].index)){const o=this.byUid.get(r);if(!o)continue;const s=n.parent===E?this.root:this.byUid.get(n.parent);if(!s||typeof s.addChildAt!="function")continue;const a=s.children.length-(o.parent===s?1:0);s.addChildAt(o,Math.max(0,Math.min(n.index,a))),n.pose&&kt(o,n.pose)}this.onRestored()}}const Ct=[{kind:"container",label:"Container",description:"A general-purpose display object that holds children, and transforms and draws them together."},{kind:"sprite",label:"Sprite",extends:"container",description:"Draws one texture: an image, or a frame of a spritesheet."},{kind:"animatedSprite",label:"AnimatedSprite",extends:"sprite",description:"Plays a list of textures as frames at an animation speed."},{kind:"tilingSprite",label:"TilingSprite",extends:"container",description:"Repeats one texture across its width and height, scrollable by its tile position."},{kind:"nineSliceSprite",label:"NineSliceSprite",extends:"container",description:"Stretches a texture without stretching its corners: the nine-slice panel of a UI."},{kind:"text",label:"Text",extends:"container",description:"Draws a string with a text style (font, size, fill, wrapping)."},{kind:"bitmapText",label:"BitmapText",extends:"container",description:"Draws a string from a bitmap font: fast to change every frame."},{kind:"htmlText",label:"HTMLText",extends:"container",description:"Draws a string of HTML and CSS markup."},{kind:"graphics",label:"Graphics",extends:"container",description:"Draws vector shapes (rectangles, circles, paths) from its draw callback."}],R="canvasEditLocks";function D(){return A().projectLocalState.read(R)??{}}function Et(i,t){A().projectLocalState.write(R,{...D(),[i]:t})}const B=Ct,L=/\.(png|jpe?g|webp|gif|svg)(\?.*)?$/i,Lt="a canvas structural edit would have to add, delete or move a construction statement in the world's own source, and this lane plans property writes only — an editor-created node has no construction site there at all",_="origin",_t="#ff2d92",At="this world's write target has no origin write, so the pivot/anchor can be seen here but not dragged";function W(i){const t=i,e=t.anchor,r=t.texture;return e&&r?.orig?{anchor:e,texture:r}:null}function Mt(i){const t=W(i);if(!t)return null;const e=i.bounds;return typeof e?.width=="number"&&typeof e.height=="number"?{x:e.width,y:e.height}:{x:t.texture.orig.width,y:t.texture.orig.height}}function Pt(i){return B.find(e=>e.kind===i)?.label??i}function Nt(i,t){switch(t){case"container":return new i.Container;case"sprite":{const e=new i.Sprite(i.Texture.WHITE);return e.setSize(64,64),e}case"text":return new i.Text({text:"Text",style:{fill:16777215,fontSize:24}});case"graphics":return new i.Graphics().rect(0,0,100,100).fill(16777215);case"animatedSprite":{const e=new i.AnimatedSprite([i.Texture.WHITE]);return e.setSize(64,64),e}case"tilingSprite":return new i.TilingSprite({texture:i.Texture.WHITE,width:100,height:100});case"nineSliceSprite":return new i.NineSliceSprite({texture:i.Texture.WHITE,width:100,height:100});case"bitmapText":return new i.BitmapText({text:"BitmapText",style:{fill:16777215,fontSize:24}});case"htmlText":return new i.HTMLText({text:"HTMLText",style:{fill:16777215,fontSize:24}});default:return null}}function K(i,t){const e=$t(i,t);Ft(t,e);for(const r of t.children??[])e.addChild(K(i,r));return e}function $t(i,t){if(t.constructor===i.Container)return new i.Container;if(t.constructor===i.Sprite){const e=t,r=new i.Sprite(e.texture);return r.anchor.set(e.anchor.x,e.anchor.y),r}if(t.constructor===i.Text){const e=t,r=new i.Text({text:e.text,style:e.style.clone()});return r.anchor.set(e.anchor.x,e.anchor.y),r}if(t.constructor===i.Graphics)return t.clone(!0);throw new Error(`"${t.label??t.constructor?.name??"this node"}" cannot be duplicated: a ${t.constructor?.name??"custom"} is constructed by the game's own code, and copying only its display half would put a lookalike with no behaviour into the world.`)}function Ft(i,t){t.label=i.label,t.position.set(i.position.x,i.position.y),t.scale.set(i.scale.x,i.scale.y),t.pivot.set(i.pivot.x,i.pivot.y),t.skew.set(i.skew.x,i.skew.y),t.rotation=i.rotation,t.alpha=i.alpha,t.visible=i.visible,"tint"in i&&"tint"in t&&(t.tint=i.tint)}function Ht(i,t){const e=i.parentLinear;if(!e)return t;const r=e.a*e.d-e.b*e.c;if(Math.abs(r)<1e-9)return t;const[,,n,o]=i.transform.rotation,s=2*Math.atan2(n,o),a=e.a*Math.cos(s)+e.c*Math.sin(s),u=e.b*Math.cos(s)+e.d*Math.sin(s),d=t*Math.PI/180,c=a*Math.cos(d)-u*Math.sin(d),l=a*Math.sin(d)+u*Math.cos(d),h=(e.d*c-e.c*l)/r,f=(-e.b*c+e.a*l)/r,p=r<0?-d:d,g=Math.atan2(f,h)-s-p,U=Math.atan2(Math.sin(g),Math.cos(g));return(p+U)*180/Math.PI}function Rt(i){const t=new Set;return(i.x!==void 0||i.y!==void 0||i.originX!==void 0||i.originY!==void 0)&&t.add("position"),(i.width!==void 0||i.height!==void 0||i.scaleXFactor!==void 0||i.scaleYFactor!==void 0)&&(t.add("scale"),(i.width!==void 0||i.height!==void 0)&&t.add("position")),i.rotate!==void 0&&t.add("rotation"),[...t]}function Dt(i,t){const e=t*Math.PI/180/2,r=Math.sin(e),n=Math.cos(e),[o,s,a,u]=i.rotation;return[o*n+s*r,s*n-o*r,a*n+u*r,u*n-a*r]}function Bt(i,t){const e={position:[...i.transform.position],rotation:[...i.transform.rotation],scale:[...i.transform.scale]},r=t.rotate;r!==void 0&&(e.rotation=Dt(i.transform,Ht(i,r)));const n=t.width;n!==void 0&&i.rect.width>0&&(e.scale[0]=i.transform.scale[0]*Math.max(1e-4,n/i.rect.width));const o=t.height;o!==void 0&&i.rect.height>0&&(e.scale[1]=i.transform.scale[1]*Math.max(1e-4,o/i.rect.height));const s=t.scaleStep,a=l=>s!==void 0&&s>0?Math.round(l/s)*s:l,u=l=>Math.abs(l)>=1e-4?l:l<0?-1e-4:1e-4,d=t.scaleXFactor;d!==void 0&&(e.scale[0]=u(a(i.transform.scale[0]*d)));const c=t.scaleYFactor;return c!==void 0&&(e.scale[1]=u(a(i.transform.scale[1]*c))),e}function Wt(i,t,e,r){return r.originX!==void 0||r.originY!==void 0?{dx:r.originX!==void 0&&i?r.originX-i.x:0,dy:r.originY!==void 0&&i?r.originY-i.y:0}:{dx:t?(r.x??e.x)-t.x:0,dy:t?(r.y??e.y)-t.y:0}}class Kt{constructor(t,e,r){this.root=t,this.store=e,this.target=r.target,this.pixi=r.pixi??z,this.transforms={dimensions:()=>"2d",get:c=>{const l=this.a2d.getTransform(c);return l?q(l):{position:[0,0,0],rotation:[0,0,0,1],scale:[1,1,1]}},editability:(c,l)=>this.target.transformEditability(c,l),beginEdit:c=>this.target.beginTransformEdit(c),apply:(c,l)=>{this.target.writeTransform(c,Z(l)),this.notify()},endEdit:c=>this.target.endTransformEdit(c),...this.target.removeTransform?{remove:(c,l)=>this.target.removeTransform?.(c,l)}:{}},this.loadTexture=r.loadTexture??(c=>this.pixi.Assets.load(c)),this.capturePreview=r.capturePreview,this.structureHistory=new jt(t,e,r.journal,()=>this.afterStructuralChange()),this.a2d=new ht(t,{...r.identity?{identity:r.identity}:{}}),this.projector=new pt(t,this.a2d,{surface:r.surface??(()=>null),...r.pointFromClient?{pointFromClient:r.pointFromClient}:{}}),this.provenance=this.target.provenance,r.surface&&(this.pickable={pick:(c,l)=>{const h=this.projector.pick(c,l,f=>this.isPickLocked(f));return h&&this.groupOf(h)},candidates:(c,l,h)=>this.projector.candidates(c,l,f=>h?.includeLocked?!1:this.isPickLocked(f))},this.rects={rect:c=>this.projector.rect(c),frame:c=>this.projector.frame(c),contextRects:c=>this.projector.contextRects(c)}),r.stories&&(this.stories=r.stories),this.watchStructure(t),this.capabilities={transform:!0,inspectorFields:!0,persist:this.target.provenance.source==="source-code"&&this.target.persistence!==void 0},this.target.bind({a2d:this.a2d,store:e,journal:r.journal,notify:()=>this.notify()}),this.editLockWorld=r.journal.id;const o=D()[this.editLockWorld];this.lockedPaths=new Set(o?.locked??[]),this.groupedPaths=new Set(o?.grouped??[]);const s=this.target.structure??this.liveStructure;this.structure={...s,create:(c,l,h)=>s.create(c,l,h?this.pointInParent(l??null,h):void 0)},this.assetDrop=this.target.assetDrop??{accepts:(c,l)=>L.test(l)&&this.containerFor(c||null)!==null,drop:(c,l,h)=>this.dropAsset(c,l,h)};const a=this.target.persistence;a&&(this.persistence=a);const u=this.target.truth?.bind(this.target);u&&(this.truth={resolve:(c,l)=>u(c,l)},this.related=X(c=>u(c,"position").site)),!r.stories&&this.target.componentIdentity&&(this.stories=G("canvas",e.shell,c=>this.target.componentIdentity?.(c)??null));const d=this.target.instances?.();d&&(this.instances={describe:c=>d.describe(c),...d.openComponent?{openComponent:c=>d.openComponent?.(c)}:{},revert:(c,l)=>d.revert(c,l),applyToComponent:(c,l)=>d.applyToComponent(c,l)})}capabilities;provenance;pickable;rects;persistence;truth;related;structure;stories;instances;transforms;a2d;projector;target;pixi;structureHistory;loadTexture;capturePreview;listeners=new Set;boxEditSessions=new Map;lockedPaths=new Set;groupedPaths=new Set;editLockWorld;pathKeys=new Map;refresh(){return this.projector.refresh()}previewImage(t,e,r){const n=this.projector.object(t);return n&&this.capturePreview?this.capturePreview(n,{width:e,height:r}):Promise.resolve(null)}notify(){for(const t of this.listeners)t()}watchedForStructure=[];structureNotifyQueued=!1;onStructureChanged=()=>{this.projector.invalidate(),!this.structureNotifyQueued&&(this.structureNotifyQueued=!0,queueMicrotask(()=>{this.structureNotifyQueued=!1,this.projector.reproject(),this.pathKeys.clear(),this.watchStructure(this.root),this.target.onReindex(),this.notify(),this.store.shell.notifyIngestEdit()}))};watchStructure(t){for(const r of this.watchedForStructure)r.off("childAdded",this.onStructureChanged),r.off("childRemoved",this.onStructureChanged);this.watchedForStructure=[];const e=r=>{typeof r.on=="function"&&typeof r.off=="function"&&(r.on("childAdded",this.onStructureChanged),r.on("childRemoved",this.onStructureChanged),this.watchedForStructure.push(r));for(const n of r.children??[])e(n)};e(t)}hierarchy={roots:()=>(this.projector.project(),this.projector.roots().map(t=>this.toEditorNode(t.id)).filter(t=>t!==null)),node:t=>this.toEditorNode(t)};toEditorNode(t){const e=this.projector.node(t);if(!e)return null;const r=this.projector.object(t),n=r?H(r):!1,o=n?wt(r):void 0;return{id:e.id,label:(n&&r?vt(r):void 0)??e.label,role:n?"component":"entity",kind:e.kind,...o?{typeLabel:o}:{},parentId:e.parentId,childIds:e.childIds}}selection={get:()=>[...this.store.shell.selectedEntityIds],set:t=>{this.store.shell.selectMultiple(t),this.notify()}};liveStructure={create:(t,e,r)=>this.createStructuralNode(t,e??null,r),remove:t=>this.removeStructuralNodes([t]),removeMany:t=>this.removeStructuralNodes(t),duplicate:t=>this.duplicateStructuralNode(t),reparent:(t,e)=>this.reparentStructuralNode(t,e),reorder:(t,e)=>this.reorderStructuralNode(t,e),creatableKinds:()=>B.map(t=>({...t}))};containerFor(t){if(!t)return this.root;const e=this.projector.object(t);return!e||typeof e.addChild!="function"?null:e}refuseStructure(t){return k({resolve:()=>j(t),record:()=>{},report:e=>b.warn(`[canvas] structural edit refused — ${e}`,"authoring")})}reportStructureLiveOnly(t){return k({resolve:()=>j(Lt),record:()=>{},report:e=>{if(this.target.reportStructureLiveOnly){this.target.reportStructureLiveOnly(t,e);return}b.log(`[canvas] ${t} is live-only — ${e}.`,"authoring")}})}afterStructuralChange(){this.projector.reproject(),this.pathKeys.clear(),this.watchStructure(this.root),this.target.onReindex(),this.notify(),this.store.shell.notifyIngestEdit()}idOf(t){return t.__authId??""}pointInParent(t,e){const r=this.containerFor(t);if(!r||typeof r.updateLocalTransform!="function")return;const n=this.localToRootMatrix(r).clone().invert().apply({x:e.x,y:e.y});return{x:n.x,y:n.y}}createStructuralNode(t,e,r){const n=this.containerFor(e);if(!n)return{id:"",ack:this.refuseStructure(`no node with id "${e}" can hold children.`)};const o=Nt(this.pixi,t);if(!o)return{id:"",ack:this.refuseStructure(`"${t}" is not a kind this canvas surface can construct.`)};o.label=Pt(t),r&&o.position.set(r.x,r.y);const s=`Create ${o.label}`;return this.structureHistory.track(n),this.structureHistory.track(o),this.structureHistory.run(s,()=>{n.addChild(o)}),this.afterStructuralChange(),{id:this.idOf(o),ack:this.reportStructureLiveOnly(s)}}removeStructuralNodes(t){const e=[];let r=null;for(const o of t){const s=this.projector.object(o);if(!s?.parent){r=this.refuseStructure(`"${o}" is not a removable node in this tree.`);continue}e.push(s)}if(e.length===0)return r??this.refuseStructure("the selection held no removable node.");const n=e.length===1?`Delete ${e[0].label??"node"}`:`Delete ${e.length} nodes`;for(const o of e)this.structureHistory.track(o),o.parent&&this.structureHistory.track(o.parent);return this.structureHistory.run(n,()=>{for(const o of e)o.parent?.removeChild(o)}),this.afterStructuralChange(),this.reportStructureLiveOnly(n)}duplicateStructuralNode(t){const e=this.projector.object(t),r=e?.parent??null;if(!e||!r)throw new Error(`"${t}" is not a duplicable node in this tree.`);const n=K(this.pixi,e);n.label=`${e.label||"node"} copy`;const o=`Duplicate ${e.label??"node"}`,s=r.children.indexOf(e);return this.structureHistory.track(r),this.structureHistory.track(n),this.structureHistory.run(o,()=>{r.addChildAt(n,s+1)}),this.afterStructuralChange(),{id:this.idOf(n),ack:this.reportStructureLiveOnly(o)}}reparentStructuralNode(t,e){const r=this.projector.object(t);if(!r)return this.refuseStructure(`"${t}" is not a node in this tree.`);const n=this.containerFor(e);if(!n)return this.refuseStructure(`no node with id "${e}" can hold children.`);if(n===r||this.isAncestorOf(r,n))return this.refuseStructure("a node cannot be reparented into itself or its own descendant.");const o=this.localToRootMatrix(r),s=this.localToRootMatrix(n),a=`Move ${r.label??"node"}`;return this.structureHistory.track(r),r.parent&&this.structureHistory.track(r.parent),this.structureHistory.track(n),this.structureHistory.run(a,()=>{n.addChild(r),r.setFromMatrix(s.clone().invert().append(o))}),this.afterStructuralChange(),this.reportStructureLiveOnly(a)}reorderStructuralNode(t,e){const r=this.projector.object(t),n=r?.parent??null;if(!r||!n)return this.refuseStructure(`"${t}" is not a reorderable node in this tree.`);const o=e?this.projector.object(e):null;if(e&&(!o||o.parent!==n))return this.refuseStructure(`"${e}" is not a sibling of "${t}".`);const s=`Reorder ${r.label??"node"}`;return this.structureHistory.track(n),this.structureHistory.track(r),this.structureHistory.run(s,()=>{const a=n.children.indexOf(r),u=o?n.children.indexOf(o):n.children.length;n.addChildAt(r,Math.max(0,a<u?u-1:u))}),this.afterStructuralChange(),this.reportStructureLiveOnly(s)}isAncestorOf(t,e){let r=e.parent;for(;r;){if(r===t)return!0;r=r.parent}return!1}localToRootMatrix(t){const e=[];let r=t;for(;r&&r!==this.root;)e.push(r),r=r.parent;const n=new this.pixi.Matrix;for(let o=e.length-1;o>=0;o--){const s=e[o];s.updateLocalTransform(),n.append(s.localTransform)}return n}assetDrop;async dropAsset(t,e,r){if(!L.test(e))return this.refuseStructure(`${e} is not an image. A canvas world mounts an image as a Sprite; a model or an audio file has no display object to become here.`);const n=this.containerFor(t||null);if(!n)return this.refuseStructure(`no node with id "${t}" can hold a dropped asset.`);let o;try{o=await this.loadTexture(e)}catch(d){return this.refuseStructure(`${e} could not be loaded as a texture: ${d instanceof Error?d.message:String(d)}`)}const s=new this.pixi.Sprite(o);s.anchor.set(.5,.5),s.label=e.split("/").pop()??"Sprite";const a=r?.position;if(a){const d=this.localToRootMatrix(n).clone().invert().apply({x:a[0],y:a[1]});s.position.set(d.x,d.y)}const u=`Add ${s.label}`;return this.structureHistory.track(n),this.structureHistory.track(s),this.structureHistory.run(u,()=>{n.addChild(s)}),this.afterStructuralChange(),this.reportStructureLiveOnly(u)}boxEdit={begin:t=>{const e=this.projector.rect(t);if(!e){this.boxEditSessions.delete(t);return}const r=this.projector.object(t)?.parent?.worldTransform;this.boxEditSessions.set(t,{id:t,rect:e,transform:this.transforms.get(t),...r?{parentLinear:{a:r.a,b:r.b,c:r.c,d:r.d}}:{}}),this.transforms.beginEdit?.(t)},apply:(t,e)=>this.applyBoxEdit(t,e),end:t=>{const e=this.boxEditSessions.get(t);this.boxEditSessions.delete(t),e&&this.transforms.endEdit?.(t)},gizmoOrigin:t=>this.gizmoOriginOf(t)};gizmoOriginOf(t){const e=this.projector.object(t);if(!e||typeof e.getGlobalPosition!="function")return null;const r=e.getGlobalPosition();return{x:r.x,y:r.y}}applyBoxEdit(t,e){const r=this.boxEditSessions.get(t);if(!r||Rt(e).some(o=>this.transforms.editability?.(t,o).writable===!1))return;const n=Bt(r,e);this.transforms.apply(t,n),!(e.x===void 0&&e.y===void 0&&e.originX===void 0&&e.originY===void 0&&e.width===void 0&&e.height===void 0)&&this.repositionBoxEditBounds(t,r,e,n)}repositionBoxEditBounds(t,e,r,n){const o=this.projector.object(t);if(!o)return;const s=this.gizmoOriginOf(t),a=this.projector.rect(t),{dx:u,dy:d}=Wt(s,a,e.rect,r),c=o.parent;if(c&&typeof c.toLocal=="function"){const l=c.toLocal({x:0,y:0}),h=c.toLocal({x:u,y:d});n.position[0]+=h.x-l.x,n.position[1]+=h.y-l.y}else n.position[0]+=u,n.position[1]+=d;this.transforms.apply(t,n)}spatialHandles={layers:t=>{const e=this.originOf(t);if(!e)return[];const r=this.target.transformEditability(t,"position"),n=!!this.target.writeOrigin&&r.writable;return[{id:`origin:${t}`,category:"origin",guides:[],handles:[{id:_,label:e.kind==="anchor"?"Sprite anchor":"Pivot",position:[e.world.x,e.world.y,0],color:_t,writable:n,...n?{}:{reason:this.target.writeOrigin&&r.reason?r.reason:At}}]}]},preview:(t,e,r)=>{this.moveOrigin(t,e,r,"preview")},commit:(t,e,r)=>this.moveOrigin(t,e,r,"commit")};originEditId=null;originOf(t){const e=this.projector.object(t);if(!e||typeof e.updateLocalTransform!="function")return null;const r=W(e),n=r?"anchor":"pivot",o=r?{x:r.anchor.x,y:r.anchor.y}:{x:e.pivot.x,y:e.pivot.y},s=r?{x:0,y:0}:o,a=this.localToRootMatrix(e).apply({x:s.x,y:s.y});return{kind:n,value:o,world:{x:a.x,y:a.y}}}moveOrigin(t,e,r,n){if(e!==_)return;const o=this.originOf(t),s=this.projector.object(t),a=this.target.writeOrigin;if(!o||!s||!a||!this.target.transformEditability(t,"position").writable)return;this.originEditId!==t&&(this.target.beginTransformEdit(t),this.originEditId=t),s.updateLocalTransform();const u=this.localToRootMatrix(s).clone().invert().apply({x:r[0],y:r[1]}),d=o.kind==="anchor"?{x:0,y:0}:o.value,c={x:u.x-d.x,y:u.y-d.y},l=o.kind==="anchor"?Mt(s):null;if(o.kind==="anchor"&&(!l||l.x===0||l.y===0))return;const h=l?[o.value.x+c.x/l.x,o.value.y+c.y/l.y]:[u.x,u.y],f=s.localTransform,p=this.a2d.getTransform(t);if(a(t,o.kind,h),p&&this.target.writeTransform(t,{...p,position:[p.position[0]+f.a*c.x+f.c*c.y,p.position[1]+f.b*c.x+f.d*c.y]}),this.notify(),n==="commit"){const g=this.target.endTransformEdit(t);return this.originEditId=null,g}}inspector={properties:t=>[...this.target.properties(t),{path:"locked",label:"Locked",type:"boolean",group:"Visibility"},{path:"grouped",label:"Grouped",type:"boolean",group:"Visibility"}],get:(t,e)=>e==="locked"?this.lockedPaths.has(this.pathKeyOf(t)):e==="grouped"?this.groupedPaths.has(this.pathKeyOf(t)):this.target.get(t,e),set:(t,e,r)=>{if(e==="locked"||e==="grouped"){const n=e==="locked"?this.lockedPaths:this.groupedPaths;r===!0?n.add(this.pathKeyOf(t)):n.delete(this.pathKeyOf(t)),Et(this.editLockWorld,{locked:[...this.lockedPaths],grouped:[...this.groupedPaths]}),this.notify();return}return this.target.set(t,e,r)},remove:(t,e)=>this.target.remove?.(t,e)};pathKeyOf(t){const e=this.pathKeys.get(t);if(e!==void 0)return e;const r=a=>this.projector.object(a)?.label??"",n=[];let o=t;for(;o;){const a=this.projector.node(o);if(!a)break;const u=a.parentId?this.projector.node(a.parentId)?.childIds??[]:this.projector.roots().map(l=>l.id),d=r(o),c=u.filter(l=>r(l)===d).indexOf(o);n.unshift(`${d}#${Math.max(0,c)}`),o=a.parentId??null}const s=n.join("/");return this.pathKeys.set(t,s),s}groupOf(t){let e=t,r=t;for(;r;)this.groupedPaths.has(this.pathKeyOf(r))&&(e=r),r=this.projector.node(r)?.parentId??null;return e}isPickLocked(t){let e=t;for(;e;){if(this.lockedPaths.has(this.pathKeyOf(e)))return!0;e=this.projector.node(e)?.parentId??null}return!1}subscribe(t){return this.listeners.add(t),()=>this.listeners.delete(t)}dispose(){this.boxEditSessions.clear(),this.pathKeys.clear();for(const t of this.watchedForStructure)t.off("childAdded",this.onStructureChanged),t.off("childRemoved",this.onStructureChanged);this.watchedForStructure=[],this.structureHistory.dispose(),this.target.dispose(),this.listeners.clear()}}const Qt=Object.freeze(Object.defineProperty({__proto__:null,PixiAuthoringAdapter:Kt},Symbol.toStringTag,{value:"Module"}));export{Kt as P,Ct as a,St as b,qt as c,H as i,Zt as o,Qt as p,xt as r};
@@ -1 +0,0 @@
1
- import{M as N,bl as G,bm as Q,ar as X,bn as Z,bj as ee,bk as te}from"./index-CaG87ZF-.js";import{J as ne,c as D}from"./json-history-resource-CTXRV4GD.js";import{m as re,p as ie}from"./source-persistence-backend-HviqjKZ2.js";import{t as oe}from"./pixi-transform-channels-P4rvmusc.js";import"./index-nmcBqr7Y.js";import"./_commonjsHelpers-D6-XlEtG.js";import"./index-D_NuPfjr.js";import"./jsx-runtime-DPjLkJKQ.js";import"./index-CtzuWnCS.js";import"./index-CinJrH5C.js";import"./index-FUuS4qwW.js";import"./client-DNXj_opT.js";import"./ingest-source-persistence-6peGfPAS.js";function $(u){if(!u||typeof u!="object")return;const c=u;return typeof c.x=="number"&&typeof c.y=="number"?[c.x,c.y]:void 0}function _(u,c,l){const s=u;!l||!$(s[c])||(s[c]={x:l[0],y:l[1]})}function se(u){return`#${(u&16777215).toString(16).padStart(6,"0")}`}function ae(u){return Number.parseInt(u.replace("#",""),16)}const le=["position","rotation","scale"];function je(u){const{physics:c}=u,l=u.persistence??null;let s,p=()=>{},h=null,S,T,w=!1,L=!1;const m=()=>{const t={},n=e=>{const r=s.node(e),i=s.displayObject(e);if(!r||!i)return;let o=null;try{o=s.getTransform(e)}catch{}const a=$(i.pivot),f=$(i.anchor);t[e]={label:i.label??"",alpha:i.alpha,visible:i.visible,..."tint"in i?{tint:i.tint}:{},...o?{transform:o}:{},...a?{pivot:a}:{},...f?{anchor:f}:{}};for(const d of r.childIds)n(d)};for(const e of s.roots())n(e.id);return{overlay:structuredClone(s.serializeOverlay()),nodes:t}},V=t=>{for(const[n,e]of Object.entries(t.nodes)){const r=s.displayObject(n);r&&(r.label=e.label,r.alpha=e.alpha,r.visible=e.visible,e.tint!==void 0&&"tint"in r&&(r.tint=e.tint),_(r,"pivot",e.pivot),_(r,"anchor",e.anchor),e.transform&&s.setTransform(n,e.transform))}s.replaceOverlay(t.overlay),p()},v=(t,n)=>{h&&n&&h.record(t,n,m()).catch(e=>{N.error(`[canvas] failed to journal "${t}" into project history — the edit is applied but has no history entry (it cannot be undone): ${e instanceof Error?e.message:String(e)}`,"authoring")})},A=(t,n,e)=>{const r=s.displayObject(t);r&&(n==="name"?s.set(t,"label",e):n==="tint"?s.set(t,"tint",ae(e)):n==="visible"?s.set(t,"visible",e):n==="alpha"?s.set(t,"alpha",e):r[n]=e,p())},x=(t,n)=>{const e=s.displayObject(t);if(e)return n==="name"?e.label:n==="tint"?se(e.tint??16777215):e[n]},b=(t,n)=>{const e=s.getTransform(t);return n==="position"?e?[...e.position]:void 0:n==="rotation"?e?e.rotation:void 0:n==="scale"?e?[...e.scale]:void 0:x(t,n)},P=(t,n,e)=>{if(n==="position"&&Array.isArray(e))s.setTransform(t,{position:[e[0]??0,e[1]??0]});else if(n==="rotation"&&typeof e=="number")s.setTransform(t,{rotation:e});else if(n==="scale"&&Array.isArray(e))s.setTransform(t,{scale:[e[0]??1,e[1]??1]});else{A(t,n,e);return}p()},y=(t,n)=>{const e=ee(s.displayObject(t)??null);return{entityId:t,property:n,surface:"pixi",anchor:e,anchorKind:e.anchored?"construction-literal":"live-only",instances:e.anchored&&e.kind==="source"?te(e):0}},g=t=>s.node(t)?.label??"2D Object",I=(t,n,e,r,i,o)=>{if(l){if(r===null||i===void 0||o===void 0){v(n,e);return}return ie({backend:l,subject:()=>y(t,r),baseline:i,next:o,label:n,journal:()=>v(n,e)})}},K=t=>{const n=[{path:"name",label:"Name",type:"string"},{path:"visible",label:"Visible",type:"boolean"},{path:"alpha",label:"Alpha",type:"number"}],e=s.displayObject(t);return e&&"tint"in e&&n.push({path:"tint",label:"Tint",type:"color"}),n},O=new Map,R=new Map,j=t=>t.anchored&&t.kind==="source"?`${t.file}:${t.line}:${t.col}`:null,E=t=>[{path:"position",label:"Position"},{path:"rotation",label:"Rotation"},{path:"scale",label:"Scale"},...K(t).map(n=>({path:n.path,label:n.label}))],k=(t,n,e,r)=>{const i=R.get(n);if(i)return i;const o=l?.readSiteLiterals,a=E(t).map(d=>({property:d.path,live:b(t,d.path)})).filter(d=>d.live!==void 0);if(!o||a.length===0)return Promise.resolve({});const f=o({anchor:e,instances:r,writeScope:"creation-site",surface:"pixi",properties:a}).then(d=>(O.set(n,d),p(),d));return R.set(n,f),f},W=(t,n,e,r)=>{const i=O.get(n);return i||(k(t,n,e,r),null)},z=1e-6,M=(t,n)=>Array.isArray(t)&&Array.isArray(n)?t.length===n.length&&t.every((e,r)=>M(e,n[r])):typeof t=="number"&&typeof n=="number"?Math.abs(t-n)<=z:t===n,C=t=>s.displayObject(t)?.constructor?.name||(s.node(t)?.kind??"2D Object"),H=t=>`${t} ${t===1?"instance":"instances"}`,q=(t,n,e,r)=>{const i=b(t,n.path);if(!e||e.literal===null||i===void 0||M(e.literal,i))return null;const o=l?.gate({...r,property:n.path,writeScope:"creation-site"}),a=e.writable?o?.ok?void 0:o?.reason:e.reason;return{path:n.path,label:n.label,value:i,...e.text?{defaultText:e.text}:{},canApplyToComponent:a===void 0,...a===void 0?{}:{applyUnavailableReason:a},affectedInstanceCount:r.instances}},B=(t,n,e,r)=>{if(!l||!e||e.literal===null||r===void 0)return{ok:!1,message:e?.reason??`The construction site names no ${n} for this object, so there is no default to change.`};if(!e.writable)return{ok:!1,message:e.reason??`The construction site's ${n} cannot be rewritten.`};const i=l.gate({...t,writeScope:"creation-site"});return i.ok?{ok:!0,backend:l,baseline:e.literal,next:r}:{ok:!1,message:i.reason}},J=async t=>{const n=y(t,"position"),e=j(n.anchor);return e?O.get(e)??await k(t,e,n.anchor,n.instances):null},Y={describe:t=>{const n=y(t,"position"),e=j(n.anchor);if(!e||!s.displayObject(t))return null;const r=W(t,e,n.anchor,n.instances);if(!r||Object.keys(r).length===0)return null;const i=E(t).map(o=>q(t,o,r[o.path],n)).filter(o=>o!==null);return{componentName:C(t),...n.anchor.anchored?{sourcePath:n.anchor.display}:{},overrides:i}},revert:async(t,n)=>{const e=await J(t);if(!e)return;const r=m(),i=[];for(const o of n){const a=e[o]?.literal;a!=null&&(P(t,o,a),i.push(o))}if(i.length!==0)return v(i.length===1?`Revert ${g(t)} ${i[0]}`:`Revert ${i.length} ${g(t)} overrides`,r),p(),Z},applyToComponent:async(t,n)=>{const e={...y(t,n),writeScope:"creation-site"},r=j(e.anchor),i=(await J(t))?.[n],o=b(t,n),a=B(e,n,i,o);if(!a.ok)return{changed:!1,message:a.message};const f=`Apply ${n} to ${C(t)} default (${H(e.instances)})`;return await a.backend.write({...e,baseline:a.baseline,next:a.next,label:f})?(r&&O.delete(r),p(),{changed:!0,message:`${n} now reads ${JSON.stringify(o)} for all ${H(e.instances)} at ${e.anchor.anchored?e.anchor.display:"its creation site"}.`,write:{destination:e.anchor.anchored?e.anchor.display:"creation site",persisted:!0}}):{changed:!1,message:`${f} did not land — the editor console names why.`}}};return{provenance:l?{source:"foreign",label:"creation-site",detail:"Live 2D (PixiJS) tree projected directly — an edit is written into the game’s own source at the line that constructed the object, and says why whenever it cannot be."}:{source:"foreign",label:"live-only",detail:"Live 2D (PixiJS) tree projected directly — edits apply for this session only and are never saved."},get persistence(){const t=l;return t?{...D(),get destination(){return t.destination()}}:{...D(),destination:X}},truth:(t,n)=>{const e=y(t,n);if(e.anchorKind==="live-only")return{site:e.anchor,writeAnchorKind:"live-only"};const r=j(e.anchor);if(!r)return{site:e.anchor,writeAnchorKind:"live-only"};const i=O.get(r);if(!i)return k(t,r,e.anchor,e.instances),{site:e.anchor,writeAnchorKind:void 0};const o=i[n];return{site:e.anchor,writeAnchorKind:o?.writable?"construction-literal":"live-only"}},componentIdentity:t=>s.displayObject(t)?{name:C(t)}:null,...l?.readSiteLiterals?{instances:()=>Y}:{},writeOrigin(t,n,e){h?.assertCanMutate();const r=s.displayObject(t);!r||!$(r[n])||(r[n]={x:e[0],y:e[1]},w=!0,p())},bind(t){s=t.a2d,p=t.notify;const n=t.store.shell.projectHistory;h=n?new ne({history:n,kind:"session-state",scope:"session",subject:{...t.journal,id:`${t.journal.id}/world-2d-edits`},displayName:"World 2D edits",capture:m,conflictIdentity:e=>e.overlay,restore:async e=>{V(e)}}):null,l?.attach({read:b,apply:P})},onReindex(){},transformEditability(t,n){if(!l)return{writable:!0};const e=y(t,n),r=e.anchorKind!=="live-only"&&l.removal?.available(e)?{removable:!0}:{};return{writable:!0,reason:l.describe(e),...r}},beginTransformEdit(t){h?.assertCanMutate();const n=s.displayObject(t);n&&c.ownerOf(n)==="physics"&&c.freeze(n),S=m(),T=l?s.getTransform(t)??void 0:void 0,w=!1},writeTransform(t,n){h?.assertCanMutate();const e=s.displayObject(t);e&&c.ownerOf(e)==="physics"&&c.commit(e,n.position,n.rotation),s.setTransform(t,n),p()},endTransformEdit(t){const n=s.displayObject(t);n&&c.ownerOf(n)==="physics"&&c.unfreeze(n);const e=`Transform ${g(t)}`,r=S,i=T,o=w;if(S=void 0,T=void 0,w=!1,!l){v(e,r);return}const a=s.getTransform(t)??void 0,f=o?["origin"]:[];i&&a&&f.push(...le.filter(U=>oe(U,i,a))),f.length>1&&l.report(e,re(f));const d=f.length===1&&f[0]!=="origin"?f[0]:null;return I(t,e,r,d,d?F(i,d):void 0,d?F(a,d):void 0)},removeTransform(t,n){const e=l,r=e?.removal;if(!e||!r)return;const i=`Remove ${g(t)} ${n}`;return G({resolve:()=>{const o=y(t,n);return o.anchorKind==="live-only"||!r.available(o)?Q(e.describe(o)):{reaches:"writer",anchorKind:o.anchorKind,destination:e.destination(),write:()=>r.perform({...o,label:i})}},record:()=>{},report:o=>{e.armed()&&e.report(i,o)}})},reportStructureLiveOnly(t,n){if(l?.armed()){l.report(t,n);return}if(!L){L=!0,N.warn(`[canvas] structural edits in this world are live-only — ${n}. First one: ${t}.`,"authoring");return}N.log(`[canvas] ${t} is live-only — ${n}.`,"authoring")},properties:K,get(t,n){return x(t,n)},set(t,n,e){h?.assertCanMutate();const r=m(),i=`Set ${g(t)} ${n}`;if(!l){A(t,n,e),v(i,r);return}const o=b(t,n);A(t,n,e);const a=b(t,n),f=o!==void 0&&a!==void 0&&JSON.stringify(o)!==JSON.stringify(a);return I(t,i,r,f?n:null,o,a)},dispose(){h?.dispose(),h=null,l?.dispose()}}}function F(u,c){if(u){if(c==="position")return[...u.position];if(c==="rotation")return u.rotation;if(c==="scale")return[...u.scale]}}export{je as createLiveCanvasWriteTarget};
@@ -1 +0,0 @@
1
- import{x as u,dj as l,cW as c}from"./three.core-3arARmh6.js";const a=Symbol.for("vgai.audio-pose-guard");function p(t){return t.elements.every(Number.isFinite)}function r(t,i){const s=t[a];if(s){i&&(s.report=i);return}const e={dropped:0,...i?{report:i}:{}};Object.defineProperty(t,a,{value:e});const n=new WeakSet,d=t.updateMatrixWorld;t.updateMatrixWorld=function(o){if(c.prototype.updateMatrixWorld.call(this,o),this.context.state!=="running"){this._clock&&(this.timeDelta=0,n.add(this));return}if(p(this.matrixWorld)){n.delete(this)&&this._clock?.getDelta(),d.call(this,o);return}e.dropped++,e.report?.(this.type)}}function x(t){r(u.prototype,t),r(l.prototype,t)}export{x as i};
@@ -1 +0,0 @@
1
- import{a as h}from"./jsx-runtime-DPjLkJKQ.js";import{$ as p,a0 as w,ev as m,aJ as d,cQ as b,cR as v}from"./index-CaG87ZF-.js";import{r as g}from"./index-nmcBqr7Y.js";import"./index-CtzuWnCS.js";const x=[{label:"Fill",width:null,height:null},{label:"iPhone SE — 375×667",width:375,height:667},{label:"iPhone 14 — 390×844",width:390,height:844},{label:"iPhone 14 Pro Max — 430×932",width:430,height:932},{label:"iPad Mini — 768×1024",width:768,height:1024},{label:"iPad Pro 11″ — 834×1194",width:834,height:1194},{label:"Laptop — 1366×768",width:1366,height:768},{label:"Desktop — 1920×1080",width:1920,height:1080}];function M({resolution:e,onResolutionChange:i,scale:u,title:l="Change preview resolution",options:r=x}){const[n,o]=g.useState(!1),c=g.useRef(null),s=e.width===null,f=s?"Fill":`${e.width}×${e.height}`;return h.jsxs("div",{className:"vgai-playbar-popover-anchor",children:[h.jsxs(p,{ref:c,variant:"ghost",size:"comfortable","aria-haspopup":"menu","aria-expanded":n,"aria-controls":n?"vgai-resolution-picker-menu":void 0,onClick:()=>o(t=>!t),title:l,children:[h.jsx(w,{icon:m,size:"md"}),h.jsx(d,{variant:"code",children:f}),!s&&u<1&&h.jsxs(d,{variant:"caption",tone:"dim",children:[Math.round(u*100),"%"]})]}),n&&h.jsx(b,{id:"vgai-resolution-picker-menu",anchorRef:c,className:"vgai-resolution-menu",gap:4,onDismiss:()=>o(!1),children:r.map(t=>h.jsx(v,{role:"menuitemradio","aria-checked":t.label===e.label,onSelect:()=>{i(t),o(!1)},children:t.label},t.label))})]})}function a(e){return Number.isFinite(e)&&e>0?e:0}function S(e,i,u={}){const l=a(e.width),r=a(e.height),n=a(i.width),o=a(i.height);if(l===0||r===0||n===0||o===0)return{scale:1,width:n,height:o,offsetX:0,offsetY:0};const c=Math.min(l/n,r/o),s=u.allowUpscale===!0?c:Math.min(c,1),f=n*s,t=o*s;return{scale:s,width:f,height:t,offsetX:(l-f)/2,offsetY:(r-t)/2}}const P={kind:"fill"};function N(e,i){return e.width!==null&&e.height!==null?{kind:"logical",width:e.width,height:e.height,source:"device",allowUpscale:!1}:i!==void 0&&a(i.width)>0&&a(i.height)>0?{kind:"logical",width:i.width,height:i.height,source:"manifest",allowUpscale:!0}:P}export{M as R,x as a,S as f,N as r};