@volter/game-editor 0.5.65 → 0.5.66

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 (544) hide show
  1. package/BUNDLED_NOTICES +1962 -363
  2. package/catalog/entries/bake.json +0 -1
  3. package/catalog/entries/blender.json +2 -2
  4. package/catalog/entries/reflections.json +2 -4
  5. package/catalog/project-source/src/lib/bake/asset-seed.ts +1 -2
  6. package/catalog/project-source/src/lib/bake/clip-layering.ts +3 -4
  7. package/catalog/project-source/src/lib/bake/gltf-bake.ts +1 -1
  8. package/catalog/project-source/src/lib/bake/params.ts +3 -5
  9. package/catalog/project-source/src/lib/bake/rest-relative-animation.ts +2 -3
  10. package/dist/.vite/manifest.json +2406 -2182
  11. package/dist/assets/{AssetBudgetPanel-J9--TZPU.js → AssetBudgetPanel-csYWK2H4.js} +8 -8
  12. package/dist/assets/{AudioViewer-CR7333fe.js → AudioViewer-BH_LUYs5.js} +1 -1
  13. package/dist/assets/{BVHLoader-6bQIXhMX.js → BVHLoader-Jkzh8hMf.js} +1 -1
  14. package/dist/assets/BufferGeometryUtils-CAbuTPOA.js +1 -0
  15. package/dist/assets/{CCDIKSolver-CD7vLpsK.js → CCDIKSolver-D4NvkJ8d.js} +1 -1
  16. package/dist/assets/{CSS3DRenderer-CL7ABLVK.js → CSS3DRenderer-CAS2WZZy.js} +1 -1
  17. package/dist/assets/CanvasSceneViewport-BlsRTk-X.js +1 -0
  18. package/dist/assets/ColladaLoader-DxYB89DA.js +3 -0
  19. package/dist/assets/{ColorInput-DQBNrW-K.js → ColorInput-CPQNsDf1.js} +1 -1
  20. package/dist/assets/{ConvexGeometry-CAzXlPVG.js → ConvexGeometry-Dinf-sev.js} +1 -1
  21. package/dist/assets/{ConvexHull-BINCESFp.js → ConvexHull-CrJ8FY-w.js} +1 -1
  22. package/dist/assets/{DecalGeometry-160KRdfg.js → DecalGeometry-owkbefLa.js} +1 -1
  23. package/dist/assets/EffectComposer-BHDH-NLz.js +1 -0
  24. package/dist/assets/EntityModelDocument-DuQivdvc.js +1 -0
  25. package/dist/assets/EnvironmentAssetDocument-CnTEMn3A.js +1 -0
  26. package/dist/assets/FBXLoader-BMUbIhtE.js +1 -0
  27. package/dist/assets/Fbo-DrK7CWlB.js +1 -0
  28. package/dist/assets/{FontLoader-CvGoVI5a.js → FontLoader-BR_K6Baw.js} +2 -2
  29. package/dist/assets/GLTFExporter-BZqAQJbw.js +1 -0
  30. package/dist/assets/{GameplaySessionTimeline-B52W3FVZ.js → GameplaySessionTimeline-Crqwv2fP.js} +1 -1
  31. package/dist/assets/Gltf-7cVbZUzT.js +2 -0
  32. package/dist/assets/ImageViewer-BkFie7Hm.js +1 -0
  33. package/dist/assets/InspectorObjectPreview-Dl3tyJBn.js +1 -0
  34. package/dist/assets/JsonAssetDocument-BUFzubHM.js +2 -0
  35. package/dist/assets/{LineSegments2-CsOpKSiM.js → LineSegments2-Cicm_Hu1.js} +2 -2
  36. package/dist/assets/LiveModuleDocument-C3OQxiba.js +1 -0
  37. package/dist/assets/LutAssetDocument-DVzd1RZ9.js +1 -0
  38. package/dist/assets/{MTLLoader-_Xzd4_0p.js → MTLLoader-Bg_grNiT.js} +2 -2
  39. package/dist/assets/{MarchingCubes-Bsp4wrzd.js → MarchingCubes-a78AL3HB.js} +1 -1
  40. package/dist/assets/MeshBVH-BCSLNEeP.js +1 -0
  41. package/dist/assets/ModelAssetDocument-pN84goRT.js +1 -0
  42. package/dist/assets/{NonThreeAuthoringBootstrap-C3woOMxX.js → NonThreeAuthoringBootstrap-BKNejRiW.js} +1 -1
  43. package/dist/assets/{OBJLoader-BhIC6Hwo.js → OBJLoader-BiwzVj5b.js} +2 -2
  44. package/dist/assets/Object3DDocumentToolbar-D5Bg5FEf.js +1 -0
  45. package/dist/assets/Object3DDocumentViewport-DFHqru3a.js +2 -0
  46. package/dist/assets/Object3DPreview-BTtZ-41z.js +2 -0
  47. package/dist/assets/OnlineAssetDetail-BAqozdAp.js +1 -0
  48. package/dist/assets/{OrbitControls-DLpayAaK.js → OrbitControls-CzKVCORl.js} +1 -1
  49. package/dist/assets/{OrbitControls-CM3bPray.js → OrbitControls-CzTRRI7x.js} +1 -1
  50. package/dist/assets/{OrthographicCamera-bQozawrh.js → OrthographicCamera-CSDDsvu7.js} +1 -1
  51. package/dist/assets/{PLYLoader-DYQqs5Ik.js → PLYLoader-QxrxxMpE.js} +2 -2
  52. package/dist/assets/{PerspectiveCamera-CQ2lh01o.js → PerspectiveCamera-DzD_NfVh.js} +1 -1
  53. package/dist/assets/PlayBar-qVJpgwJt.js +2 -0
  54. package/dist/assets/QuarksAssetDocument-B4vBlUsS.js +2 -0
  55. package/dist/assets/RGBELoader-WQ7xZofE.js +1 -0
  56. package/dist/assets/RectAreaLightUniformsLib-CwcuoVqt.js +1 -0
  57. package/dist/assets/{RenderPass-DPrn-Uky.js → RenderPass-C_CeQNdh.js} +1 -1
  58. package/dist/assets/{ResolutionPicker-C67vs1F3.js → ResolutionPicker-DpHVJxn5.js} +1 -1
  59. package/dist/assets/RootSelectionOverlay-BxvsunO4.js +1 -0
  60. package/dist/assets/{RoundedBox-BDGBg6QZ.js → RoundedBox-B_cZ0NFy.js} +1 -1
  61. package/dist/assets/{RoundedBoxGeometry-CyUuYPfW.js → RoundedBoxGeometry-Y4rcSIvX.js} +1 -1
  62. package/dist/assets/STLLoader-Bej_Nkpr.js +1 -0
  63. package/dist/assets/{SelectionBox-D_75KrNW.js → SelectionBox-Cn9vm7f9.js} +1 -1
  64. package/dist/assets/ShaderAssetDocument-Dx2x8CLr.js +12 -0
  65. package/dist/assets/{ShaderPass-QYRpPuFJ.js → ShaderPass-qtkA7CQ8.js} +1 -1
  66. package/dist/assets/{ShadowEditor-DkImwu1Y.js → ShadowEditor-BEIUkrHL.js} +1 -1
  67. package/dist/assets/SimplifyModifier-D2EesGr2.js +1 -0
  68. package/dist/assets/{SkeletonUtils-Cps8GOC6.js → SkeletonUtils-C8ayciDc.js} +1 -1
  69. package/dist/assets/{Sky-CQKCgYDs.js → Sky-BBpnAJZV.js} +1 -1
  70. package/dist/assets/SourceAssetViewer-BpMbbuy6.js +1 -0
  71. package/dist/assets/StageHost-lB8f---y.js +2 -0
  72. package/dist/assets/{StoryPreviewMount-DjyxRCXu.js → StoryPreviewMount-BIfxmkYh.js} +1 -1
  73. package/dist/assets/{TDSLoader-D_T8XJ81.js → TDSLoader-rHl5Uwc0.js} +1 -1
  74. package/dist/assets/{TextGeometry-DOWAEUV0.js → TextGeometry-BRHSufuM.js} +1 -1
  75. package/dist/assets/ThreeBoardDocument-BHV92Ia3.js +2 -0
  76. package/dist/assets/{ThreeIsolationSceneContent-C8C8whSF.js → ThreeIsolationSceneContent-BqtgDHBK.js} +1 -1
  77. package/dist/assets/{ToolObject3DPreview-BRoDWe4Q.js → ToolObject3DPreview-CcaPJTyH.js} +1 -1
  78. package/dist/assets/Toolbar-keHcSvDD.js +1 -0
  79. package/dist/assets/{TrackballControls-DfznuQTh.js → TrackballControls-Cce-6Ff5.js} +1 -1
  80. package/dist/assets/{TransientHint-BB1fwrvK.js → TransientHint-Dlslh3oX.js} +1 -1
  81. package/dist/assets/{UnrealBloomPass-CR-cS_K5.js → UnrealBloomPass-DiseEiFK.js} +2 -2
  82. package/dist/assets/{VideoViewer-C6kocgIU.js → VideoViewer-naGSXHd6.js} +1 -1
  83. package/dist/assets/ViewportShadingMenu-C7Hdhtca.js +1 -0
  84. package/dist/assets/{active-ingest-CT6jSGhr.js → active-ingest-DEgq9JiA.js} +3 -3
  85. package/dist/assets/{animation-clock-CnjZqfJp.js → animation-clock-lTIb6nk3.js} +1 -1
  86. package/dist/assets/animation-mixers.service-2O2rVwQf.js +1 -0
  87. package/dist/assets/asset-budget-asset.menu-9NhdHAC9.js +1 -0
  88. package/dist/assets/asset-budget.action-yg6-luUJ.js +1 -0
  89. package/dist/assets/asset-budget.document-B46_VFqa.js +1 -0
  90. package/dist/assets/asset-budget.menu-DuH07N-e.js +1 -0
  91. package/dist/assets/{asset-editor-persistence-BBaONOJt.js → asset-editor-persistence-BVtzjadu.js} +1 -1
  92. package/dist/assets/{asset-loaders-BOy5Ss8k.js → asset-loaders-BxG1LykH.js} +2 -2
  93. package/dist/assets/{assets-BuSoGjBX.js → assets-Do88ZdV_.js} +1 -1
  94. package/dist/assets/{audio-unlock.service-CfUgUQVy.js → audio-unlock.service-BJH0mWvX.js} +1 -1
  95. package/dist/assets/{audio.utility-C6K6jem8.js → audio.utility-Cp4aVYFU.js} +1 -1
  96. package/dist/assets/autoplay.service-FxpRy7Ev.js +1 -0
  97. package/dist/assets/{babylon-authoring-adapter-CL02gWDn.js → babylon-authoring-adapter-B_8iE8fK.js} +1 -1
  98. package/dist/assets/{binding-resolver-Dsh-6Vor.js → binding-resolver-BWwG10zJ.js} +2 -2
  99. package/dist/assets/blender-emscripten-engine-CEsWgnR7.js +2 -0
  100. package/dist/assets/{blender-node-editor.document-iIDkB9sI.js → blender-node-editor.document-DTgwy8KC.js} +1 -1
  101. package/dist/assets/blender-properties-tab-DWSJpkxq.js +3 -0
  102. package/dist/assets/blender-runtime-host-OGjPjTrG.js +4 -0
  103. package/dist/assets/{blender-runtime-skin-DyQ9B6CR.js → blender-runtime-skin-DymtXlpt.js} +37 -39
  104. package/dist/assets/blender-runtime.document-CzH2ohHR.js +8 -0
  105. package/dist/assets/{blender-timeline.document-77fx96N7.js → blender-timeline.document-BRy_QPHt.js} +1 -1
  106. package/dist/assets/{blender-uv-editor.document-fsT7B4gV.js → blender-uv-editor.document-D-AbUCqz.js} +1 -1
  107. package/dist/assets/{blender-version.status-o6dBm3n6.js → blender-version.status-B7flzX_7.js} +1 -1
  108. package/dist/assets/{blender-wali-engine-wTOcrOMC.js → blender-wali-engine-D3iKpzn9.js} +1 -1
  109. package/dist/assets/blender.command-BVHtgTQy.js +1 -0
  110. package/dist/assets/blender.environment-CG-pC7sk.js +1 -0
  111. package/dist/assets/{blender.style-Dcem5f_T.js → blender.style-CxfbTFcE.js} +1 -1
  112. package/dist/assets/{board-guides-DziKSTss.js → board-guides-C3usUZZk.js} +1 -1
  113. package/dist/assets/body-marks-D8iaje6y.js +1 -0
  114. package/dist/assets/bridge.command-BF9u6r0A.js +3 -0
  115. package/dist/assets/browserAll-38aBu-cf.js +1 -0
  116. package/dist/assets/{build-profiles.document-kW8iw8Xj.js → build-profiles.document-DO7oNRuo.js} +2 -2
  117. package/dist/assets/{build-progress.status-BNRLytg2.js → build-progress.status-COeNVhYd.js} +1 -1
  118. package/dist/assets/{build-session-C_sg3CEn.js → build-session-IWIriS5P.js} +1 -1
  119. package/dist/assets/{build.action-lYjTLb7K.js → build.action-DlkFvZf6.js} +1 -1
  120. package/dist/assets/{build.command-DIGgUPU_.js → build.command-DPqQIYj_.js} +1 -1
  121. package/dist/assets/{build.header-CKajx5U3.js → build.header-CNLG-pV8.js} +1 -1
  122. package/dist/assets/{build.menu-BdU0QXny.js → build.menu-hUlH6loi.js} +1 -1
  123. package/dist/assets/{build.service-CbBAyeu3.js → build.service-C86Td3_9.js} +1 -1
  124. package/dist/assets/{camera-KEsKvOL7.js → camera-CKbyBXMe.js} +1 -1
  125. package/dist/assets/camera-authoring-Ci3KnE-W.js +1 -0
  126. package/dist/assets/{camera-runtime.inspector-B7unX4g1.js → camera-runtime.inspector-DdR3P2BF.js} +1 -1
  127. package/dist/assets/canvas-entry-runtime-E5YjSgre.js +2 -0
  128. package/dist/assets/canvas-preview-frames-CiAx7dpV.js +1 -0
  129. package/dist/assets/{capability-coverage-Czas4C18.js → capability-coverage-CfUeULDN.js} +5 -5
  130. package/dist/assets/city-EkhAOo5s.exr +0 -0
  131. package/dist/assets/{collaboration-presence-DLoZ7EA3.js → collaboration-presence-CSLFNT7m.js} +1 -1
  132. package/dist/assets/{collider-Bw0mXlsW.js → collider-DRSaLRM9.js} +1 -1
  133. package/dist/assets/{component-board.service-DCwcUssB.js → component-board.service-B7Sv8b7m.js} +2 -2
  134. package/dist/assets/component-board.service-B8UHw8dn.js +2 -0
  135. package/dist/assets/component-contracts.service-LFGekycZ.js +1 -0
  136. package/dist/assets/{component-verbs.command-7xzfjGMZ.js → component-verbs.command-D4SvFjfG.js} +1 -1
  137. package/dist/assets/component-verbs.service-TGvWxf2b.js +1 -0
  138. package/dist/assets/{config-CEZk921y.js → config-DB_RH-hO.js} +3 -3
  139. package/dist/assets/{configurations-DTBMdaTL.js → configurations-C2qgJNnW.js} +1 -1
  140. package/dist/assets/{connection.status-BifnQdOs.js → connection.status-CG7X2brL.js} +1 -1
  141. package/dist/assets/{console-bridge-CHcb-xk5.js → console-bridge-B5Ltae37.js} +1 -1
  142. package/dist/assets/{constraint-De8f1Uiq.js → constraint-C_Jj7dXy.js} +1 -1
  143. package/dist/assets/constraints.inspector-D6QZJS4b.js +1 -0
  144. package/dist/assets/courtyard-DqlebbpC.exr +0 -0
  145. package/dist/assets/coverage.service-Clo86874.js +3 -0
  146. package/dist/assets/{create-runtime-CVCc1BDx.js → create-runtime-lmA910XT.js} +1 -1
  147. package/dist/assets/{curve-7Q79VgU4.js → curve-6-TR6dNb.js} +1 -1
  148. package/dist/assets/{data-asset-4hjS642k.js → data-asset-BNbd309U.js} +1 -1
  149. package/dist/assets/{data-ref-CQI28C0D.js → data-ref-Dvmd7eb1.js} +1 -1
  150. package/dist/assets/{debug-bridge-CCohG-d-.js → debug-bridge-BUNhgyY6.js} +1 -1
  151. package/dist/assets/{debug-registry-Dgvitx8M.js → debug-registry-B3Cnne3x.js} +1 -1
  152. package/dist/assets/deferred-ingest-play-7V8OrW3e.js +2 -0
  153. package/dist/assets/design-time-layers-g9VS6amb.js +1 -0
  154. package/dist/assets/design-time-mount.service-HtMr_vBd.js +2 -0
  155. package/dist/assets/design-time-react-mount-Dx6fJ-Hg.js +1 -0
  156. package/dist/assets/{directional-shadow-fit-BVkOKAv2.js → directional-shadow-fit-Cjz_Eg2b.js} +1 -1
  157. package/dist/assets/{document-preview-three-Kbg2GCLm.js → document-preview-three-C3y0syYQ.js} +1 -1
  158. package/dist/assets/{dom-authoring-adapter-CY8C7f4T.js → dom-authoring-adapter-CEeFyatF.js} +1 -1
  159. package/dist/assets/{draco3d-BBUTcNkz.js → draco3d-FKy0apkb.js} +1 -1
  160. package/dist/assets/drei-asset-caches-jJoHXbTj.js +2 -0
  161. package/dist/assets/{edit-mode-audio.service-Bzetwd5B.js → edit-mode-audio.service-DZTnrW6t.js} +1 -1
  162. package/dist/assets/edit-mode-authoring-D_BiHCQj.js +1 -0
  163. package/dist/assets/{edit-mode-networking.service-YCX6RRb_.js → edit-mode-networking.service-BzMI2VxO.js} +1 -1
  164. package/dist/assets/editor-api-Bzmo0o8_.js +1 -0
  165. package/dist/assets/{entry-adjudication-Cq8Yeb74.js → entry-adjudication-BYy7TXOB.js} +1 -1
  166. package/dist/assets/{events-156d8d12.esm-ErOhDXXB.js → events-156d8d12.esm-C734MYnx.js} +7 -7
  167. package/dist/assets/{extend-B-eOccUm.js → extend-CLG0ymiX.js} +1 -1
  168. package/dist/assets/forest-P_CQY3b_.exr +0 -0
  169. package/dist/assets/fork-menu-De7HU6_H.js +1 -0
  170. package/dist/assets/{frame-debugger-store-D1Mf_5up.js → frame-debugger-store-BZgIOlU6.js} +1 -1
  171. package/dist/assets/{game-DHOZVb-7.js → game-D5EJoILQ.js} +1 -1
  172. package/dist/assets/{game-contract-seams-a5YXejOu.js → game-contract-seams-TCpIMmHP.js} +1 -1
  173. package/dist/assets/{game-css-scope-transform-Eng4wS8E.js → game-css-scope-transform-NbpajQr-.js} +1 -1
  174. package/dist/assets/game-document.service-6eRlrI-d.js +1 -0
  175. package/dist/assets/game-eval.command-hKnSMlX0.js +2 -0
  176. package/dist/assets/{game-input-seams-CIQdetRw.js → game-input-seams-BC6xhZy3.js} +1 -1
  177. package/dist/assets/{game-module-access-B2mFxv-i.js → game-module-access-ry3xb1Ix.js} +1 -1
  178. package/dist/assets/{gameplay-export-BoKXm51x.js → gameplay-export-DiLQuPpn.js} +1 -1
  179. package/dist/assets/gameplay-replay-Bsre-1K8.js +1 -0
  180. package/dist/assets/{gameplay-rng-trap-CTNhm-UW.js → gameplay-rng-trap-BhRx_CtU.js} +1 -1
  181. package/dist/assets/gameplay.command-BqiyGn-I.js +1 -0
  182. package/dist/assets/{generation-jobs-BQrXbGp_.js → generation-jobs-BYcpgeGk.js} +1 -1
  183. package/dist/assets/generation.service-O81IqA-6.js +1 -0
  184. package/dist/assets/{generations-DzUogZsM.js → generations-CsGQ3twi.js} +1 -1
  185. package/dist/assets/{generations.status-CgOUBCum.js → generations.status-C3YU0_ml.js} +1 -1
  186. package/dist/assets/godot.style-DxJaFWOP.js +1 -0
  187. package/dist/assets/godot.view-BFsHk8b2.js +1 -0
  188. package/dist/assets/{hosted-asset-materialization-CiIvWkGU.js → hosted-asset-materialization-Bk-plQF6.js} +2 -2
  189. package/dist/assets/{ibl-override-material-BlmCxFKq.js → ibl-override-material-BhbGwgS1.js} +1 -1
  190. package/dist/assets/{index-mjWQmGhM.js → index-0n9eSzwT.js} +1 -1
  191. package/dist/assets/index-B4bmKkgY.css +1 -0
  192. package/dist/assets/index-BLo2LE8C.js +3404 -0
  193. package/dist/assets/index-BWW4-DBH.js +1 -0
  194. package/dist/assets/index-CLcsjKUs.js +1 -0
  195. package/dist/assets/index-CU5YUq-x.js +134 -0
  196. package/dist/assets/{index-DUpHH6JR.js → index-Cb6o_Td_.js} +1 -1
  197. package/dist/assets/index-Ckxb31Yz.js +1500 -0
  198. package/dist/assets/index-CnpsJMao.js +1 -0
  199. package/dist/assets/index-Cr23XhNm.js +1 -0
  200. package/dist/assets/index-DO1rWQ_r.js +487 -0
  201. package/dist/assets/{index-BcCBqgM_.js → index-DUh02lTr.js} +1 -1
  202. package/dist/assets/index-DXEHfb0b.js +1 -0
  203. package/dist/assets/{index-V1R-e5Bd.js → index-wRCvCebM.js} +1 -1
  204. package/dist/assets/{inference-diagnostics-Dhmtfbq_.js → inference-diagnostics-YW0yJkKx.js} +1 -1
  205. package/dist/assets/{ingest-BbYMC2vQ.js → ingest-BlQnR7s3.js} +1 -1
  206. package/dist/assets/ingest-boot-viewport-uG9jQ1zm.js +1 -0
  207. package/dist/assets/ingest-siblings-DRQXSWax.js +1 -0
  208. package/dist/assets/{ingest-source-persistence-C_6Hiyra.js → ingest-source-persistence-DH6ioCOu.js} +1 -1
  209. package/dist/assets/{ingest.service-BTDnQfM1.js → ingest.service-GeaWMaZX.js} +1 -1
  210. package/dist/assets/{input-manager-DH_hGW6d.js → input-manager-Cxx3RJgG.js} +1 -1
  211. package/dist/assets/{input-router-BNQvtIqw.js → input-router-FzxO5ld6.js} +1 -1
  212. package/dist/assets/{inspect-BZfi3mmo.js → inspect-BRgDdtVk.js} +1 -1
  213. package/dist/assets/instances.command-CFOMPSj3.js +1 -0
  214. package/dist/assets/{instruments-CKR02Y8I.js → instruments-IKn-vvNb.js} +1 -1
  215. package/dist/assets/interior-Bo_lba15.exr +0 -0
  216. package/dist/assets/{json-history-resource-BbxllWfV.js → json-history-resource-r-9q_hxP.js} +1 -1
  217. package/dist/assets/{light-D-_wsKTq.js → light-CFAor97k.js} +1 -1
  218. package/dist/assets/light-camera-factory-D1sgz3YB.js +1 -0
  219. package/dist/assets/live-mixers-BRkRHd6g.js +1 -0
  220. package/dist/assets/{loader-CaF_I7Yt.js → loader-BbMsvIxP.js} +1 -1
  221. package/dist/assets/machine.document-CgmsOh-s.js +24 -0
  222. package/dist/assets/machines.finder-nxiCgQc2.js +1 -0
  223. package/dist/assets/matcap-texture-Dh65bX5V.js +1 -0
  224. package/dist/assets/{material-CpAdjDxn.js → material-D5kXEZWQ.js} +1 -1
  225. package/dist/assets/{material-factory-Bz6h__6g.js → material-factory-0Qb0VuZ5.js} +1 -1
  226. package/dist/assets/material-preview.view-DqNcpd_b.js +1 -0
  227. package/dist/assets/{mesh-B3WPtNKO.js → mesh-BKPgNTwh.js} +1 -1
  228. package/dist/assets/{mesh-shadow-CZnXrw_l.js → mesh-shadow-BDQP4mHs.js} +1 -1
  229. package/dist/assets/model-asset-sections.service-DWPLmkqa.js +1 -0
  230. package/dist/assets/model-inspection-Cxfg_Fei.js +1 -0
  231. package/dist/assets/model.layout-BpZE1W9V.js +1 -0
  232. package/dist/assets/{models.finder-G2jQgIRu.js → models.finder-DHW17ZEa.js} +1 -1
  233. package/dist/assets/module-mode-CRfHyIMS.js +2 -0
  234. package/dist/assets/mount-canvas-ingest-root-BZZ8M3Lu.js +2 -0
  235. package/dist/assets/mount-dom-ingest-root-D1GV6Jjt.js +2 -0
  236. package/dist/assets/{mount-game-6t9cKNo4.js → mount-game-F9e76auh.js} +1 -1
  237. package/dist/assets/mount-ingest-root-B5D-Lmmk.js +2 -0
  238. package/dist/assets/{mount-manifest-CGVxhmAw.js → mount-manifest-cYRhgHfo.js} +1 -1
  239. package/dist/assets/mount-three-ingest-root-BNnouaBn.js +1 -0
  240. package/dist/assets/{mounted-authoring-Dmg5xmhP.js → mounted-authoring-TIN5EnCb.js} +1 -1
  241. package/dist/assets/{mounted-story-viewport-source-DjP6RA9U.js → mounted-story-viewport-source-CAlEmE0_.js} +1 -1
  242. package/dist/assets/{native-debug-module-CWicoSGD.js → native-debug-module-j-MekcLS.js} +1 -1
  243. package/dist/assets/{navigation-CIiCx-SM.js → navigation-DmR1BDVo.js} +1 -1
  244. package/dist/assets/{navmesh.menu-CAKiH8PW.js → navmesh.menu-FhL1pGx1.js} +1 -1
  245. package/dist/assets/{navmesh.service-jgDWlgj1.js → navmesh.service-usyDeJlm.js} +1 -1
  246. package/dist/assets/{network.utility-CEu5nHf7.js → network.utility-BPh4hTmh.js} +1 -1
  247. package/dist/assets/night-CvV4Gybt.exr +0 -0
  248. package/dist/assets/{object3d-authoring-subject-CH5sI2oP.js → object3d-authoring-subject-CyE4rQ2A.js} +1 -1
  249. package/dist/assets/oid-transform-BOqL6YH6.js +2 -0
  250. package/dist/assets/{particles-Y626p22p.js → particles-C47L-dda.js} +1 -1
  251. package/dist/assets/particles-factory-CRqPLdS7.js +1 -0
  252. package/dist/assets/pixi-authoring-adapter-C5Ikqj5-.js +1 -0
  253. package/dist/assets/{pixi-live-write-target-DuWydlWb.js → pixi-live-write-target-OWBk79dp.js} +1 -1
  254. package/dist/assets/pixi-primitive-D5igywJ_.js +1 -0
  255. package/dist/assets/pixi-react-root-factory-9lZ0Yz-n.js +1 -0
  256. package/dist/assets/play-mode-DomOvQie.js +22 -0
  257. package/dist/assets/play.command-DoqjH-Pp.js +2 -0
  258. package/dist/assets/{playtest-BXIL1JEF.js → playtest-BnFenMBW.js} +1 -1
  259. package/dist/assets/{pose-guard-6Osb2cFu.js → pose-guard-Bb3gZOzk.js} +1 -1
  260. package/dist/assets/{product-DFhyARJj.js → product-CTDJoVo5.js} +1 -1
  261. package/dist/assets/{profiler.action-CaXJDp3t.js → profiler.action-C_OFGkDw.js} +1 -1
  262. package/dist/assets/{profiler.menu-BIMF6Bi4.js → profiler.menu-BJbnVoo4.js} +1 -1
  263. package/dist/assets/{profiler.utility-BExw9wBO.js → profiler.utility-qpfhuwRw.js} +1 -1
  264. package/dist/assets/project-authoring-session-BV-MM8Fl.js +2 -0
  265. package/dist/assets/{project-provenance-BoP3nrle.js → project-provenance-4ldz-EOG.js} +1 -1
  266. package/dist/assets/{properties-bone-constraints.inspector-ByT6p7S-.js → properties-bone-constraints.inspector-C-ByIdg1.js} +1 -1
  267. package/dist/assets/{properties-bone.inspector-z4qJwKO5.js → properties-bone.inspector-CXY0xCQB.js} +1 -1
  268. package/dist/assets/{properties-collection.inspector-D0_3ijWU.js → properties-collection.inspector-DIfkZAel.js} +1 -1
  269. package/dist/assets/{properties-constraints.inspector-CESzjuls.js → properties-constraints.inspector-BaunL5nT.js} +1 -1
  270. package/dist/assets/{properties-data.inspector-hG8Wgyzb.js → properties-data.inspector-DQD-jfO2.js} +1 -1
  271. package/dist/assets/{properties-material.inspector-CzY0JCQ6.js → properties-material.inspector-A0HZ4SX6.js} +1 -1
  272. package/dist/assets/{properties-modifiers.inspector-3dDhwf7g.js → properties-modifiers.inspector-GUnVhVwZ.js} +1 -1
  273. package/dist/assets/{properties-object.inspector-CiarfxkT.js → properties-object.inspector-Chsfa4Xa.js} +1 -1
  274. package/dist/assets/{properties-output.inspector-DKJxmKSD.js → properties-output.inspector-U7ZmD0Me.js} +1 -1
  275. package/dist/assets/{properties-particles.inspector-CCEdYWGm.js → properties-particles.inspector-umkW-OlI.js} +1 -1
  276. package/dist/assets/{properties-physics.inspector-B2c0KUyA.js → properties-physics.inspector-CLVBlWwL.js} +1 -1
  277. package/dist/assets/{properties-render.inspector-Bcm0HLRW.js → properties-render.inspector-D0u9taKy.js} +1 -1
  278. package/dist/assets/{properties-scene.inspector-PIM_eTb_.js → properties-scene.inspector-JwGCZQAx.js} +1 -1
  279. package/dist/assets/{properties-texture.inspector-CgFlnyr8.js → properties-texture.inspector-B1vC28pw.js} +1 -1
  280. package/dist/assets/{properties-view-layer.inspector-DGjF_Aqo.js → properties-view-layer.inspector-BuUKyBFp.js} +1 -1
  281. package/dist/assets/{properties-world.inspector-CrMvaRvB.js → properties-world.inspector-VXUj4dT4.js} +1 -1
  282. package/dist/assets/r3f-design-session-qJ2v5SrB.js +2 -0
  283. package/dist/assets/r3f-physics-binding-C8OqNRG2.js +1 -0
  284. package/dist/assets/{r3f-root-factory-z9llD1OU.js → r3f-root-factory-DjGnbU4n.js} +1 -1
  285. package/dist/assets/r3f-source-authoring-adapter-CG9heazM.js +12 -0
  286. package/dist/assets/{rapier-physics-bridge-CMoeVo3Y.js → rapier-physics-bridge-B-EK7KYV.js} +1 -1
  287. package/dist/assets/react-inspector.service-DWeXDHJq.js +1 -0
  288. package/dist/assets/{react-root-CEz5NTck.js → react-root-DGLRLr-F.js} +1 -1
  289. package/dist/assets/react-story-board-CSqHY0Cg.js +1 -0
  290. package/dist/assets/{react-three-fiber.esm-CycrbDlA.js → react-three-fiber.esm-BxIoqVh1.js} +1 -1
  291. package/dist/assets/{react-three-rapier.esm-CEfKpvxT.js → react-three-rapier.esm-BYzLhdSV.js} +1 -1
  292. package/dist/assets/react-world-authoring-adapter-BMT9kLWU.js +1 -0
  293. package/dist/assets/{realm-services-CobQsq_X.js → realm-services-D25JHoqD.js} +1 -1
  294. package/dist/assets/{reflection-probe-Don-M3Fj.js → reflection-probe-CqXWlicu.js} +1 -1
  295. package/dist/assets/{reflection-probe-capture.inspector-CmFUoJCx.js → reflection-probe-capture.inspector-B7Qa30vB.js} +1 -1
  296. package/dist/assets/regions-DWeEBnE2.js +1 -0
  297. package/dist/assets/{register-render-vitals-BiZk29b2.js → register-render-vitals-BO7x64kR.js} +1 -1
  298. package/dist/assets/{registry-02YZjMNp.js → registry-DlTluc4x.js} +1 -1
  299. package/dist/assets/{render-audio-control-vMRlePWb.js → render-audio-control-DCa_bOBI.js} +1 -1
  300. package/dist/assets/{render-batch-system-0vq7p0VC.js → render-batch-system-CzCp9YKM.js} +1 -1
  301. package/dist/assets/{render-control-Df3yTiyr.js → render-control-BNQr1eNO.js} +1 -1
  302. package/dist/assets/{render-env-D2IV2x5k.js → render-env-emvlfeTG.js} +1 -1
  303. package/dist/assets/{render-features-CPQ_e568.js → render-features-COF7MSQ9.js} +1 -1
  304. package/dist/assets/{render-settings-Bw4W9SYF.js → render-settings-C_kIMq8Y.js} +1 -1
  305. package/dist/assets/{resolve-three-SZE_WWUM.js → resolve-three-C-nx-QdA.js} +13 -13
  306. package/dist/assets/{root-seam-contract-Z0VWX3Bk.js → root-seam-contract-C7GOxf5x.js} +1 -1
  307. package/dist/assets/{run-ticks-settled-C4ksViyA.js → run-ticks-settled-B0cTtmhQ.js} +1 -1
  308. package/dist/assets/{scene-capture-CGYF-Viw.js → scene-capture-CLOc7GXc.js} +1 -1
  309. package/dist/assets/{scene-capture-BQKzU0NT.js → scene-capture-D10Nxkvp.js} +1 -1
  310. package/dist/assets/scene-document.service-B7kAVTko.js +2 -0
  311. package/dist/assets/{scene-framing-Cat0GtyJ.js → scene-framing-50N7SKuX.js} +1 -1
  312. package/dist/assets/{scene-index-B6BZOHMk.js → scene-index-Bce459yu.js} +1 -1
  313. package/dist/assets/{scene-query-C7_N-TpI.js → scene-query-IUZhw6pA.js} +1 -1
  314. package/dist/assets/{schema-kl9-2B_J.js → schema-Iy-mbzll.js} +1 -1
  315. package/dist/assets/sculpt.layout-D-K5cLw6.js +1 -0
  316. package/dist/assets/{seeded-random-i3mtgBKZ.js → seeded-random-CN0scLZj.js} +1 -1
  317. package/dist/assets/{session-CZ5JPg-z.js → session-CsR0lApe.js} +24 -15
  318. package/dist/assets/{setup-audio-S8GQF91f.js → setup-audio-BJ18gvXZ.js} +1 -1
  319. package/dist/assets/setup-particles-B6H-GbAA.js +1 -0
  320. package/dist/assets/{setup-physics-BeZ7-LKD.js → setup-physics-GugbTT0J.js} +1 -1
  321. package/dist/assets/{setup-renderer-DVXaSGin.js → setup-renderer-wt_a-p8r.js} +20 -20
  322. package/dist/assets/shading.layout-CZZHKBer.js +1 -0
  323. package/dist/assets/{sim-clock-CLflx7kg.js → sim-clock-DEfbb_-P.js} +1 -1
  324. package/dist/assets/{soft-particle-depth-DGvfQDi1.js → soft-particle-depth-CKUS1j0Y.js} +1 -1
  325. package/dist/assets/source-object3d-authoring-adapter-CfHQLFAL.js +1 -0
  326. package/dist/assets/{source-persistence-backend-C-aR-B_Y.js → source-persistence-backend-_-JMEXxE.js} +1 -1
  327. package/dist/assets/{spark-renderer-lifecycle-ynWESJcv.js → spark-renderer-lifecycle-9mnMW3Z4.js} +1 -1
  328. package/dist/assets/{spark.module-4pXQoz5d.js → spark.module-CXth-y_a.js} +1 -1
  329. package/dist/assets/stage-keyboard-C0FdDLOQ.js +1 -0
  330. package/dist/assets/stage-overlay-set-CwhCzbOy.js +1 -0
  331. package/dist/assets/stage-presence-markers-DVMDKiB-.js +1 -0
  332. package/dist/assets/stage-transform-tools-B09Z7v0o.js +1 -0
  333. package/dist/assets/standard-viewport-dressing-GUUr6GuK.js +20 -0
  334. package/dist/assets/{state-watch.action-BOvQR2qt.js → state-watch.action-CgF8qoFC.js} +1 -1
  335. package/dist/assets/{state-watch.menu-CNLvDeeY.js → state-watch.menu-CIMncESW.js} +1 -1
  336. package/dist/assets/{state-watch.utility-Bg1tTTQU.js → state-watch.utility-zTHkUALC.js} +1 -1
  337. package/dist/assets/static-batch-advisor-DqfXWRUq.js +1 -0
  338. package/dist/assets/story-capture-COQgezzl.js +1 -0
  339. package/dist/assets/story-documents-DQ0KORmd.js +3 -0
  340. package/dist/assets/story-documents.service-DOSaqPqv.js +1 -0
  341. package/dist/assets/story-documents.service-Gb7oUkbg.js +1 -0
  342. package/dist/assets/{story-media-presence-BHzk2IV5.js → story-media-presence-nW3zJqKv.js} +1 -1
  343. package/dist/assets/story-pixi-preview-COPTEsHo.js +1 -0
  344. package/dist/assets/story-presentation-CxADj5oz.js +1 -0
  345. package/dist/assets/{story-three-preview-BHEDZzcl.js → story-three-preview-C9W__8Or.js} +2 -2
  346. package/dist/assets/{structural-ids-Dc-7rEwi.js → structural-ids-CblajJQK.js} +1 -1
  347. package/dist/assets/studio-CysTBGIb.exr +0 -0
  348. package/dist/assets/sunrise-Dj0psFrf.exr +0 -0
  349. package/dist/assets/sunset-Bw3x2Bot.exr +0 -0
  350. package/dist/assets/{surface-state-DaxyruCj.js → surface-state-BAUJu6GY.js} +1 -1
  351. package/dist/assets/{system-runner-DkOjxEBt.js → system-runner-D_DtVrer.js} +1 -1
  352. package/dist/assets/team-playtest.service--79O6xkx.js +1 -0
  353. package/dist/assets/{three-CDSueJyJ.js → three-DSsr_Lvp.js} +1 -1
  354. package/dist/assets/{three-authoring-adapter-CmSQ3Vui.js → three-authoring-adapter-Yqsank46.js} +1 -1
  355. package/dist/assets/three-authoring.service-BDos-bRt.js +2 -0
  356. package/dist/assets/{three-ingest-runtime-QzDYk6tU.js → three-ingest-runtime-DWijtqQ8.js} +1 -1
  357. package/dist/assets/{three-projection-core-BmKMZ-nf.js → three-projection-core-kubBTx0s.js} +1 -1
  358. package/dist/assets/three-story-model-BraQFA9h.js +1 -0
  359. package/dist/assets/three-viewport-presentation-BL7Uc2i6.js +1 -0
  360. package/dist/assets/{three.module-D396a9Mn.js → three.module-IFn-4i31.js} +1 -1
  361. package/dist/assets/three.quarks.esm-CRKGjKAH.js +1039 -0
  362. package/dist/assets/transform-mode-request-Cu7ewbtr.js +1 -0
  363. package/dist/assets/{transform-writer-BhBBTx33.js → transform-writer-DXxrI4t7.js} +1 -1
  364. package/dist/assets/transport.header-CeND8Vzh.js +1 -0
  365. package/dist/assets/{trigger-volume-BNK2XzPL.js → trigger-volume-BCVRS3NM.js} +1 -1
  366. package/dist/assets/{tuples-CIQ4Bn1U.js → tuples-DKDGrN1t.js} +1 -1
  367. package/dist/assets/ui-board-document-DD2CAEAo.js +2 -0
  368. package/dist/assets/unity.style-vCmLw4gI.js +1 -0
  369. package/dist/assets/unity.view-DIn2S6Do.js +1 -0
  370. package/dist/assets/unreal.style-BQn-HhOX.js +1 -0
  371. package/dist/assets/unreal.view-adNBETZK.js +1 -0
  372. package/dist/assets/user-data-CZqsJDk-.js +1 -0
  373. package/dist/assets/{utility-view-state-BHypxA33.js → utility-view-state-DYJY8V8O.js} +1 -1
  374. package/dist/assets/uv-editing.layout-A8RA-cbM.js +1 -0
  375. package/dist/assets/{vgai-shared-three-Bc5PvpLM.js → vgai-shared-three-D_RAEumG.js} +1 -1
  376. package/dist/assets/{viewport-root-presentation-CWsE56K6.js → viewport-root-presentation-C9M98VNM.js} +1 -1
  377. package/dist/assets/{viewport-shading-BuA88e_A.js → viewport-shading-BzcvgJhK.js} +1 -1
  378. package/dist/assets/viewport-shading-boundary-CBvvzS-p.js +84 -0
  379. package/dist/assets/{viewport-surface-status-B3om4Kcf.js → viewport-surface-status-BFmnWp7z.js} +1 -1
  380. package/dist/assets/voxel-surface-ROWYug7H.js +1 -0
  381. package/dist/assets/webgl-frame-capture-CRKX73E9.js +1 -0
  382. package/dist/assets/webworkerAll-CehoCtFb.js +1 -0
  383. package/dist/assets/{worker-UrMcrc5_.js → worker-B7zhIsFh.js} +2 -2
  384. package/dist/assets/world-documents-DErHq15h.js +1 -0
  385. package/dist/assets/world-root-stage-binding-BIymcQ4K.js +1 -0
  386. package/dist/assets/{world-state-BWG-IcOd.js → world-state-ZGDGY_Xl.js} +1 -1
  387. package/dist/assets/{writer-B-KovzkA.js → writer-BPbm4_my.js} +5 -5
  388. package/dist/assets/xstate-animation-binding-Cvd4JbEY.js +1 -0
  389. package/dist/assets/{xstate-animation-meta-Q3u9zh_m.js → xstate-animation-meta-B3OZR8Q2.js} +1 -1
  390. package/dist/vgai-shared-three.json +1 -1
  391. package/dist-node/cli.js +317 -73
  392. package/dist-node/create.js +59 -19
  393. package/package.json +16 -13
  394. package/src/index.ts +6 -0
  395. package/template/.agents/skills/vgai-3d-models/SKILL.md +3 -3
  396. package/template/.agents/skills/vgai-threejs-authoring/SKILL.md +4 -9
  397. package/template/.claude/skills/vgai-3d-models/SKILL.md +3 -3
  398. package/template/.claude/skills/vgai-threejs-authoring/SKILL.md +4 -9
  399. package/template/.github/skills/vgai-3d-models/SKILL.md +3 -3
  400. package/template/.github/skills/vgai-threejs-authoring/SKILL.md +4 -9
  401. package/template/AGENTS.md +1 -1
  402. package/template/check-idioms.ts +4 -5
  403. package/template/package.json +9 -9
  404. package/template/tsconfig.json +1 -0
  405. package/template/vgai.adapter.ts +1 -0
  406. package/template-dotfiles/gitignore +2 -0
  407. package/workbench/src/media/game-cover.css +1 -1
  408. package/catalog/project-source/src/lib/bake/mesh-slice.ts +0 -157
  409. package/dist/assets/BufferGeometryUtils-Nz37EVXf.js +0 -1
  410. package/dist/assets/CanvasSceneViewport-Bpi6gVTC.js +0 -1
  411. package/dist/assets/ColladaLoader-aVOPIsCh.js +0 -3
  412. package/dist/assets/EXRLoader-Cdans_oJ.js +0 -1
  413. package/dist/assets/EffectComposer-DQxfsXBZ.js +0 -1
  414. package/dist/assets/EntityModelDocument-Ccvw66N9.js +0 -1
  415. package/dist/assets/EnvironmentAssetDocument-Dg-Qq6O6.js +0 -1
  416. package/dist/assets/FBXLoader-B4MoUtAn.js +0 -1
  417. package/dist/assets/Fbo-Dz-Soul3.js +0 -1
  418. package/dist/assets/GLTFExporter-HgrCle4L.js +0 -1
  419. package/dist/assets/Gltf-UHVWKz65.js +0 -2
  420. package/dist/assets/HDRLoader-THU88oVD.js +0 -5
  421. package/dist/assets/ImageViewer-Tn7s_MnW.js +0 -1
  422. package/dist/assets/InspectorObjectPreview-CVejvLRg.js +0 -1
  423. package/dist/assets/JsonAssetDocument-C7VGcLhu.js +0 -3
  424. package/dist/assets/MeshBVH-BiDHDcu-.js +0 -1
  425. package/dist/assets/ModelAssetDocument-F5GACirk.js +0 -1
  426. package/dist/assets/Object3DDocumentViewport-DB7T0NTl.js +0 -2
  427. package/dist/assets/Object3DPreview-DL8oi7Xs.js +0 -2
  428. package/dist/assets/OnlineAssetDetail-C6z9RvYK.js +0 -2
  429. package/dist/assets/PlayBar-BR-Vg3Jb.js +0 -2
  430. package/dist/assets/RGBELoader-BgBcQv8j.js +0 -1
  431. package/dist/assets/RectAreaLightUniformsLib-CMMoWfll.js +0 -1
  432. package/dist/assets/RootSelectionOverlay-BZPlxmXU.js +0 -1
  433. package/dist/assets/STLLoader-Dyv3lsxY.js +0 -1
  434. package/dist/assets/SimplifyModifier-C8ayvRzd.js +0 -1
  435. package/dist/assets/SourceAssetViewer-2SWQoUut.js +0 -12
  436. package/dist/assets/StageHost-BN-IoTef.js +0 -2
  437. package/dist/assets/ThreeBoardDocument-CVncZyIq.js +0 -2
  438. package/dist/assets/asset-budget-asset.menu-Di3KiQCd.js +0 -1
  439. package/dist/assets/asset-budget.action-DCzzcuTh.js +0 -1
  440. package/dist/assets/asset-budget.document-BWU8wnVW.js +0 -1
  441. package/dist/assets/asset-budget.menu-BGZpT_31.js +0 -1
  442. package/dist/assets/autoplay.service-BZBGNSvt.js +0 -1
  443. package/dist/assets/blender-emscripten-engine-9ZIRYNhe.js +0 -2
  444. package/dist/assets/blender-properties-tab-C5CyPydi.js +0 -3
  445. package/dist/assets/blender-runtime-host-BpBwGv7r.js +0 -4
  446. package/dist/assets/blender-runtime.document-lIYhhPtv.js +0 -8
  447. package/dist/assets/blender.command-BtJeWk-A.js +0 -1
  448. package/dist/assets/body-marks-h_xDxiDE.js +0 -1
  449. package/dist/assets/bridge.command-o5gDNEwa.js +0 -3
  450. package/dist/assets/browserAll-DeWblVez.js +0 -1
  451. package/dist/assets/canvas-entry-runtime-SfBxaR9M.js +0 -2
  452. package/dist/assets/component-board.service-DidCyM4O.js +0 -2
  453. package/dist/assets/component-verbs.service-Bv9jId3q.js +0 -1
  454. package/dist/assets/constraints.inspector-B9U9Yj-u.js +0 -1
  455. package/dist/assets/coverage.service-VTX5Mcsx.js +0 -3
  456. package/dist/assets/deferred-ingest-play-DCJi_Pgu.js +0 -2
  457. package/dist/assets/design-time-layers-wYgOTgni.js +0 -1
  458. package/dist/assets/design-time-mount.service-BzY21e1F.js +0 -2
  459. package/dist/assets/design-time-react-mount-DM9WLrF2.js +0 -1
  460. package/dist/assets/edit-mode-authoring-B47TfLqu.js +0 -1
  461. package/dist/assets/editor-api-BoJIcyZG.js +0 -1
  462. package/dist/assets/fflate.module-DPuTF8aG.js +0 -6
  463. package/dist/assets/fork-menu-BoVyw2Wu.js +0 -1
  464. package/dist/assets/game-document.service-DbRfx2V0.js +0 -1
  465. package/dist/assets/game-eval.command-D-7Dxbj_.js +0 -2
  466. package/dist/assets/gameplay-replay-e5umMlXv.js +0 -1
  467. package/dist/assets/gameplay.command-DxcVYX6F.js +0 -1
  468. package/dist/assets/generation.service-CDIgObuw.js +0 -1
  469. package/dist/assets/index-96FBF1Oj.js +0 -1
  470. package/dist/assets/index-BAWkB0dv.js +0 -1
  471. package/dist/assets/index-BDnS2b6S.js +0 -1
  472. package/dist/assets/index-BjTCPEQ7.js +0 -134
  473. package/dist/assets/index-CVCb_ImQ.js +0 -1
  474. package/dist/assets/index-CZd9o7Lu.js +0 -1
  475. package/dist/assets/index-D2fNXpHa.css +0 -1
  476. package/dist/assets/index-GIL7oGEO.js +0 -4894
  477. package/dist/assets/index-OrYXPk3Z.js +0 -487
  478. package/dist/assets/ingest-boot-viewport-D5rI_Kk_.js +0 -1
  479. package/dist/assets/ingest-siblings-Bop2kqVl.js +0 -1
  480. package/dist/assets/instances.command-D6UkZNO8.js +0 -1
  481. package/dist/assets/light-camera-factory-CWbbe9gI.js +0 -1
  482. package/dist/assets/live-behaviors-Bxq49Maz.js +0 -1
  483. package/dist/assets/matcap-texture-CVfalpWT.js +0 -1
  484. package/dist/assets/model-asset-sections.service-CHhFS3ZX.js +0 -1
  485. package/dist/assets/model.layout-BJUEQYUI.js +0 -1
  486. package/dist/assets/module-mode-DVBLT9d-.js +0 -2
  487. package/dist/assets/mount-canvas-ingest-root-DDuAWf_C.js +0 -2
  488. package/dist/assets/mount-dom-ingest-root-D_EiBgpn.js +0 -2
  489. package/dist/assets/mount-ingest-root-glv2SSWf.js +0 -2
  490. package/dist/assets/mount-three-ingest-root-hrUt9VVU.js +0 -1
  491. package/dist/assets/particles-factory-DnLOHXT8.js +0 -1
  492. package/dist/assets/pasteboard-materialize-BqSS4QzV.js +0 -20
  493. package/dist/assets/pasteboard.action-DU3UHtJG.js +0 -2
  494. package/dist/assets/pixi-authoring-adapter-CjibysC3.js +0 -1
  495. package/dist/assets/pixi-primitive-DlWbUPN9.js +0 -1
  496. package/dist/assets/pixi-react-root-factory-DYsznYRQ.js +0 -1
  497. package/dist/assets/play-mode-BFU2PCkG.js +0 -22
  498. package/dist/assets/play.command-BpqqLqkq.js +0 -2
  499. package/dist/assets/project-authoring-session-Bnt6icLr.js +0 -2
  500. package/dist/assets/r3f-design-session-D-4yyDO9.js +0 -2
  501. package/dist/assets/r3f-physics-binding-BBo8oma9.js +0 -1
  502. package/dist/assets/r3f-source-authoring-adapter-w6Bc60K-.js +0 -13
  503. package/dist/assets/react-inspector.service-B_neRnSK.js +0 -1
  504. package/dist/assets/react-story-board-BDDwiE2H.js +0 -1
  505. package/dist/assets/react-world-authoring-adapter-DmrwM3py.js +0 -1
  506. package/dist/assets/runtime-inspection-l2iFQSsg.js +0 -1
  507. package/dist/assets/scene-document.service-qkDjUrlP.js +0 -2
  508. package/dist/assets/sculpt.layout-zJF55yCR.js +0 -1
  509. package/dist/assets/setup-particles-GCXlnkj_.js +0 -1
  510. package/dist/assets/shading.layout-DULYZV6M.js +0 -1
  511. package/dist/assets/source-object3d-authoring-adapter-B-L6Ha6f.js +0 -1
  512. package/dist/assets/stage-invalidation-DBg3C3Ta.js +0 -1
  513. package/dist/assets/stage-keyboard-n-5kKH-m.js +0 -1
  514. package/dist/assets/stage-overlay-set-B9zp2sLB.js +0 -1
  515. package/dist/assets/stage-presence-markers-DiGI6A45.js +0 -1
  516. package/dist/assets/standard-viewport-dressing-CzjAe_0A.js +0 -7
  517. package/dist/assets/static-batch-advisor-B13QEH7d.js +0 -1
  518. package/dist/assets/story-capture-_gC8dXV-.js +0 -1
  519. package/dist/assets/story-documents--TDLaPeL.js +0 -3
  520. package/dist/assets/story-documents.service-BiS_YbNQ.js +0 -1
  521. package/dist/assets/story-documents.service-CxOPYJ2j.js +0 -1
  522. package/dist/assets/story-pixi-preview-BUrOJZXS.js +0 -1
  523. package/dist/assets/story-presentation-j2AVN-mK.js +0 -1
  524. package/dist/assets/team-playtest.service-DqOinFVA.js +0 -1
  525. package/dist/assets/three-authoring.service-iuHLwtf1.js +0 -2
  526. package/dist/assets/three-viewport-presentation-QBQpSdMh.js +0 -1
  527. package/dist/assets/three.quarks.esm-B1C61jGo.js +0 -1039
  528. package/dist/assets/transport.header-B-6HQlU2.js +0 -1
  529. package/dist/assets/ui-board-document-Bwtt--xp.js +0 -2
  530. package/dist/assets/use-live-actor-state-DErbWQWF.js +0 -1
  531. package/dist/assets/user-data-BB2Of6Ht.js +0 -1
  532. package/dist/assets/uv-editing.layout-BEKHxmHw.js +0 -1
  533. package/dist/assets/viewport-shading-boundary-B_-_gABg.js +0 -82
  534. package/dist/assets/voxel-surface-DtcsSWRL.js +0 -1
  535. package/dist/assets/webgl-frame-capture-FlF9zQmW.js +0 -1
  536. package/dist/assets/webworkerAll-CM2o_dnz.js +0 -1
  537. package/dist/assets/world-documents-147tiFZe.js +0 -1
  538. package/dist/assets/world-root-stage-binding-vwTrtBz6.js +0 -1
  539. package/dist/assets/xstate-animation-binding-Brd0NST6.js +0 -1
  540. package/dist/assets/xstate-behavior.action-B8UluFBK.js +0 -1
  541. package/dist/assets/xstate-behavior.document-CKAsE45I.js +0 -1
  542. package/dist/assets/xstate-behavior.inspector-vJJyuifc.js +0 -1
  543. package/dist/assets/xstate-behavior.menu-BXbPICIh.js +0 -1
  544. package/dist/assets/xstate-inspection-BsZv8LS9.js +0 -1
@@ -1,6 +1,6 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-GIL7oGEO.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/three.module-D396a9Mn.js","assets/index-D2fNXpHa.css"])))=>i.map(i=>d[i]);
2
- import{curve as C,sampleCurve as z}from"./curve-7Q79VgU4.js";import{dataRef as Q,getRef as V}from"./data-ref-CQI28C0D.js";import{_ as h}from"./index-GIL7oGEO.js";import{parseDataJson as g,toDataJsonSchema as y}from"./data-asset-4hjS642k.js";import{findDanglingDataRefs as S,collectDeclaredRefFields as j,findMissingRefTargets as $}from"./data-check-core-CQEjuFyt.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"./three.module-D396a9Mn.js";async function v(){const[e,s]=await Promise.all([h(()=>import("./index-GIL7oGEO.js").then(o=>o.tQ),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10])),h(()=>import("./index-GIL7oGEO.js").then(o=>o.tQ),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10]))]);return{readdirSync:e.readdirSync,readFileSync:e.readFileSync,statSync:e.statSync,join:s.join,relative:s.relative}}function u(e,s){let o;try{o=e.readdirSync(s)}catch{return[]}const a=[];for(const r of o){const n=e.join(s,r);e.statSync(n).isDirectory()?a.push(...u(e,n)):r.endsWith(".data.json")&&a.push(n)}return a}function p(e){const s=e.split("\\").join("/");return s.split("/").pop()?.replace(/\.data\.json$/,"")??s}function b(e,s,o,a,r){const n=new Map,c=new Map;for(const l of u(e,e.join(s,"src","data"))){const t=e.relative(s,l).split("\\").join("/"),i=p(t),d=c.get(i);d?d.push(t):c.set(i,[t]);try{n.set(i,JSON.parse(e.readFileSync(l,"utf-8")))}catch(f){a.push(`"${t}" is not valid JSON: ${f instanceof Error?f.message:String(f)}`);continue}o.has(t)||r.push(`"${t}" is not registered in the data-asset registry (src/data/assets.ts), so it gets no build-time schema check (runtime parse-on-load still applies). Register it there — the template ships the worked example.`)}const m=new Set;for(const[l,t]of c)t.length<2||(m.add(l),a.push(`asset stem "${l}" is claimed by ${t.length} files (${t.join(", ")}) — "file#key" refs and the data-asset registry address a file by its stem alone (§2.2), so this is an unresolvable identity collision. Rename one — asset stems must be unique across the whole project, not just per directory.`),n.delete(l));return{parsedByStem:n,ambiguousStems:m}}async function w(e){const s=await v(),o=e.root??process.cwd(),a=[],r=[],n=new Set(e.assets.map(t=>t.sourcePath.split("\\").join("/"))),{parsedByStem:c,ambiguousStems:m}=b(s,o,n,a,r);for(const t of e.assets){const i=t.sourcePath.split("\\").join("/");if(!c.has(p(i))){m.has(p(i))||a.push(`registered data asset "${i}" was not found on disk — fix the path in the registry (src/data/assets.ts) or restore the file.`);continue}try{g(t.schema,c.get(p(i)),i)}catch(d){a.push(d instanceof Error?d.message:String(d))}}for(const t of S(c))a.push(`dangling data ref in "src/data/${t.inAsset}.data.json" at ${t.atPath}: "${t.ref}" — "${t.missingSegment}" does not exist in src/data/${t.targetAsset}.data.json. Fix the key or remove the ref (refs are "file#key" strings).`);const l=new Set(c.keys());for(const t of e.assets){const i=t.sourcePath.split("\\").join("/"),d=j(y(t.schema));for(const f of $(d,l))a.push(`"${i}" declares field "${f.fieldPath}" as dataRef('${f.targetStem}'), but no "src/data/${f.targetStem}.data.json" exists. Restore/rename the target file, or update the dataRef('${f.targetStem}') call in the schema.`)}return{errors:a,warnings:r}}function _(e){const s=e.split("\\").join("/");return/\/src\/(?:tools|contributions)\//.test(s)||/\.tool\.[tj]sx?(\?|$)/.test(s)}function M(e){return{name:"vgai:data-check",apply:"build",async buildStart(){const{errors:s,warnings:o}=await w(e);for(const a of o)this.warn(a);s.length>0&&this.error(`data-asset validation failed (${s.length} problem${s.length===1?"":"s"}):
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-Ckxb31Yz.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/three.module-IFn-4i31.js","assets/index-B4bmKkgY.css"])))=>i.map(i=>d[i]);
2
+ import{curve as C,sampleCurve as z}from"./curve-6-TR6dNb.js";import{dataRef as V,getRef as q}from"./data-ref-Dvmd7eb1.js";import{_ as u}from"./index-Ckxb31Yz.js";import{parseDataJson as g,toDataJsonSchema as y}from"./data-asset-BNbd309U.js";import{findDanglingDataRefs as S,collectDeclaredRefFields as j,findMissingRefTargets as $}from"./data-check-core-CQEjuFyt.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"./three.module-IFn-4i31.js";async function v(){const[e,s]=await Promise.all([u(()=>import("./index-Ckxb31Yz.js").then(o=>o.u0),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10])),u(()=>import("./index-Ckxb31Yz.js").then(o=>o.u0),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10]))]);return{readdirSync:e.readdirSync,readFileSync:e.readFileSync,statSync:e.statSync,join:s.join,relative:s.relative}}function h(e,s){let o;try{o=e.readdirSync(s)}catch{return[]}const a=[];for(const r of o){const n=e.join(s,r);e.statSync(n).isDirectory()?a.push(...h(e,n)):r.endsWith(".data.json")&&a.push(n)}return a}function p(e){const s=e.split("\\").join("/");return s.split("/").pop()?.replace(/\.data\.json$/,"")??s}function b(e,s,o,a,r){const n=new Map,c=new Map;for(const l of h(e,e.join(s,"src","data"))){const t=e.relative(s,l).split("\\").join("/"),i=p(t),d=c.get(i);d?d.push(t):c.set(i,[t]);try{n.set(i,JSON.parse(e.readFileSync(l,"utf-8")))}catch(f){a.push(`"${t}" is not valid JSON: ${f instanceof Error?f.message:String(f)}`);continue}o.has(t)||r.push(`"${t}" is not registered in the data-asset registry (src/data/assets.ts), so it gets no build-time schema check (runtime parse-on-load still applies). Register it there — the template ships the worked example.`)}const m=new Set;for(const[l,t]of c)t.length<2||(m.add(l),a.push(`asset stem "${l}" is claimed by ${t.length} files (${t.join(", ")}) — "file#key" refs and the data-asset registry address a file by its stem alone (§2.2), so this is an unresolvable identity collision. Rename one — asset stems must be unique across the whole project, not just per directory.`),n.delete(l));return{parsedByStem:n,ambiguousStems:m}}async function w(e){const s=await v(),o=e.root??process.cwd(),a=[],r=[],n=new Set(e.assets.map(t=>t.sourcePath.split("\\").join("/"))),{parsedByStem:c,ambiguousStems:m}=b(s,o,n,a,r);for(const t of e.assets){const i=t.sourcePath.split("\\").join("/");if(!c.has(p(i))){m.has(p(i))||a.push(`registered data asset "${i}" was not found on disk — fix the path in the registry (src/data/assets.ts) or restore the file.`);continue}try{g(t.schema,c.get(p(i)),i)}catch(d){a.push(d instanceof Error?d.message:String(d))}}for(const t of S(c))a.push(`dangling data ref in "src/data/${t.inAsset}.data.json" at ${t.atPath}: "${t.ref}" — "${t.missingSegment}" does not exist in src/data/${t.targetAsset}.data.json. Fix the key or remove the ref (refs are "file#key" strings).`);const l=new Set(c.keys());for(const t of e.assets){const i=t.sourcePath.split("\\").join("/"),d=j(y(t.schema));for(const f of $(d,l))a.push(`"${i}" declares field "${f.fieldPath}" as dataRef('${f.targetStem}'), but no "src/data/${f.targetStem}.data.json" exists. Restore/rename the target file, or update the dataRef('${f.targetStem}') call in the schema.`)}return{errors:a,warnings:r}}function _(e){const s=e.split("\\").join("/");return/\/src\/(?:tools|contributions)\//.test(s)||/\.tool\.[tj]sx?(\?|$)/.test(s)}function M(e){return{name:"vgai:data-check",apply:"build",async buildStart(){const{errors:s,warnings:o}=await w(e);for(const a of o)this.warn(a);s.length>0&&this.error(`data-asset validation failed (${s.length} problem${s.length===1?"":"s"}):
3
3
  ${s.map(a=>` - ${a}`).join(`
4
4
  `)}`)},generateBundle(s,o){const a=new Set;for(const r of Object.values(o))if(r.type==="chunk")for(const n of Object.keys(r.modules))_(n)&&a.add(n.split("\\").join("/"));a.size>0&&this.error(`project tool code reached the game build — tools are editor-only and must never ship to players. Remove every game-code import of these modules (tools may import game code, never the reverse):
5
5
  ${[...a].map(r=>` - ${r}`).join(`
6
- `)}`)}}}export{C as curve,Q as dataRef,V as getRef,z as sampleCurve,M as vgaiDataCheck};
6
+ `)}`)}}}export{C as curve,V as dataRef,q as getRef,z as sampleCurve,M as vgaiDataCheck};
@@ -1 +1 @@
1
- import{Z as t,a2 as a,a3 as i}from"./index-GIL7oGEO.js";async function e(){const o=await fetch(`${t}/configurations`);return(await a(o,"Could not list run configurations")).configurations}async function c(o){const n=await fetch(`${t}/configurations/${encodeURIComponent(o)}/start`,{method:"POST"});return a(n,`Could not start run configuration "${o}"`)}async function u(o,n){const s={method:"POST"};return n&&(s.signal=n),fetch(`${t}/configurations/${encodeURIComponent(o)}/build`,s)}async function f(o){const n=await fetch(`${t}/configurations/${encodeURIComponent(o)}/stop`,{method:"POST"});i(n,`Could not stop run configuration "${o}"`)}export{f as a,c as b,e as l,u as s};
1
+ import{$ as t,a3 as a,a4 as i}from"./index-Ckxb31Yz.js";async function e(){const o=await fetch(`${t}/configurations`);return(await a(o,"Could not list run configurations")).configurations}async function c(o){const n=await fetch(`${t}/configurations/${encodeURIComponent(o)}/start`,{method:"POST"});return a(n,`Could not start run configuration "${o}"`)}async function u(o,n){const s={method:"POST"};return n&&(s.signal=n),fetch(`${t}/configurations/${encodeURIComponent(o)}/build`,s)}async function f(o){const n=await fetch(`${t}/configurations/${encodeURIComponent(o)}/stop`,{method:"POST"});i(n,`Could not stop run configuration "${o}"`)}export{f as a,c as b,e as l,u as s};
@@ -1 +1 @@
1
- import{a as n}from"./jsx-runtime-DPjLkJKQ.js";import{a7 as i,a4 as s,q as o}from"./index-GIL7oGEO.js";import"./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"./three.module-D396a9Mn.js";const f="workspace.status",g="Connection",y="left",N=20,e="tool:network.utility";function x(){const t=i(()=>o().systems.inspectedNetworking()?.getConnectionState?.()??null);return t===null?null:n.jsxs(s,{type:"button",variant:"ghost",size:"compact",className:"vgai-status-action","data-testid":"status-connection","data-connection-state":t,onClick:()=>o().workspace.showUtility(e),title:"Network connection state — open Network diagnostics",children:["net: ",t]})}export{y as align,x as default,N as order,f as point,g as title};
1
+ import{a as n}from"./jsx-runtime-DPjLkJKQ.js";import{a8 as i,a5 as s,q as o}from"./index-Ckxb31Yz.js";import"./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"./three.module-IFn-4i31.js";const f="workspace.status",g="Connection",y="left",N=20,e="tool:network.utility";function x(){const t=i(()=>o().systems.inspectedNetworking()?.getConnectionState?.()??null);return t===null?null:n.jsxs(s,{type:"button",variant:"ghost",size:"compact",className:"vgai-status-action","data-testid":"status-connection","data-connection-state":t,onClick:()=>o().workspace.showUtility(e),title:"Network connection state — open Network diagnostics",children:["net: ",t]})}export{y as align,x as default,N as order,f as point,g as title};
@@ -1 +1 @@
1
- import{_ as s}from"./index-GIL7oGEO.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"./three.module-D396a9Mn.js";const l=["log","warn","error"];function o(e,r){const t={type:"console-bridge",level:e,message:r,timestamp:Date.now()};window.postMessage(t,"*")}function p(e){return e.map(r=>{if(typeof r=="string")return r;try{return JSON.stringify(r)}catch{return String(r)}}).join(" ")}let i=!1;function E(){if(i)return;i=!0;let e=()=>!1;s(()=>import("./logger-Dqis-7W1.js"),[]).then(r=>{e=()=>r._engineLogActive}).catch(()=>{});for(const r of l){const t=console[r].bind(console);console[r]=(...n)=>{t(...n),e()||o(r,p(n))}}window.addEventListener("error",r=>{o("error",r.message||String(r.error))}),window.addEventListener("unhandledrejection",r=>{o("error",`Unhandled promise rejection: ${r.reason}`)})}export{E as installConsoleBridge};
1
+ import{_ as s}from"./index-Ckxb31Yz.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"./three.module-IFn-4i31.js";const l=["log","warn","error"];function o(e,r){const t={type:"console-bridge",level:e,message:r,timestamp:Date.now()};window.postMessage(t,"*")}function p(e){return e.map(r=>{if(typeof r=="string")return r;try{return JSON.stringify(r)}catch{return String(r)}}).join(" ")}let i=!1;function E(){if(i)return;i=!0;let e=()=>!1;s(()=>import("./logger-Dqis-7W1.js"),[]).then(r=>{e=()=>r._engineLogActive}).catch(()=>{});for(const r of l){const t=console[r].bind(console);console[r]=(...n)=>{t(...n),e()||o(r,p(n))}}window.addEventListener("error",r=>{o("error",r.message||String(r.error))}),window.addEventListener("unhandledrejection",r=>{o("error",`Unhandled promise rejection: ${r.reason}`)})}export{E as installConsoleBridge};
@@ -1 +1 @@
1
- import{getUserData as e,deleteUserData as r,setUserData as s}from"./user-data-BB2Of6Ht.js";import"./object-marks-DwvIEBOK.js";function a(t){const i=e(t,"constraints");return Array.isArray(i)?i.filter(n=>!!n&&typeof n=="object"&&typeof n.getSnapshot=="function"&&!!n.config):[]}function l(t,i){const n=a(t).filter(o=>o.config.id!==i.config.id);s(t,"constraints",[...n,i])}function g(t,i){if(i===void 0){r(t,"constraints");return}const n=a(t).filter(o=>o.config.id!==i);n.length===0?r(t,"constraints"):s(t,"constraints",n)}export{g as clearConstraintMark,a as constraintsOf,l as setConstraintMark};
1
+ import{getUserData as e,deleteUserData as r,setUserData as s}from"./user-data-CZqsJDk-.js";import"./object-marks-DwvIEBOK.js";function a(t){const i=e(t,"constraints");return Array.isArray(i)?i.filter(n=>!!n&&typeof n=="object"&&typeof n.getSnapshot=="function"&&!!n.config):[]}function l(t,i){const n=a(t).filter(o=>o.config.id!==i.config.id);s(t,"constraints",[...n,i])}function g(t,i){if(i===void 0){r(t,"constraints");return}const n=a(t).filter(o=>o.config.id!==i);n.length===0?r(t,"constraints"):s(t,"constraints",n)}export{g as clearConstraintMark,a as constraintsOf,l as setConstraintMark};
@@ -0,0 +1 @@
1
+ import{a as r}from"./jsx-runtime-DPjLkJKQ.js";import{fC as y,ap as x,aa as i,cc as v,fs as k,ft as c,a5 as m,fD as j,f9 as S}from"./index-Ckxb31Yz.js";import{constraintsOf as C}from"./constraint-C_Jj7dXy.js";import"./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"./three.module-IFn-4i31.js";import"./user-data-CZqsJDk-.js";import"./object-marks-DwvIEBOK.js";function g(t,n){return n?t.hierarchy.object3D?.(n)??null:null}function b(t){if(!t)return[];const n=j(t),u=new Set,h=a=>{const l=j(a);if(!(a!==t&&n!==void 0&&l!==void 0&&l!==n)){for(const o of C(a))u.add(o);for(const o of a.children)h(o)}};return h(t),[...u]}function F(t,n){return b(g(n,t?.id??null)).length>0}const D={ready:"Ready",disabled:"Disabled",unresolved:"Unresolved",error:"Error"};function w(t){return t==="two-bone-ik"?"Two Bone IK":t==="ccd-ik"?"CCD IK":t==="aim"?"Aim":t==="rotation"?"Rotation":t}function O({adapter:t,nodeId:n}){const u=y(),h=n?u.objectMap.get(n)??g(t,n)??null:null,a=b(h).sort((o,s)=>o.config.order-s.config.order),l=o=>{if(!o)return;const s=t.hierarchy.idForObject3D?.(o);s&&(S(t,[s],{intent:"exact"})||u.select(s))};return r.jsx("div",{style:{display:"grid",gap:10},children:a.map((o,s)=>{const d=o.config,e=o.getSnapshot(),f=d.type==="two-bone-ik"||d.type==="ccd-ik";return r.jsxs("div",{style:{border:`1px solid ${x.boundary.default}`,borderRadius:6,overflow:"hidden"},children:[r.jsxs("div",{style:{alignItems:"center",background:x.surface.raised,display:"flex",gap:8,justifyContent:"space-between",padding:"6px 8px"},children:[r.jsx(i,{children:`${s+1}. ${d.label}`}),r.jsx(i,{tone:"muted",children:w(d.type)})]}),e.message&&(e.status==="error"||e.status==="unresolved")?r.jsx(v,{tone:"error",children:e.message}):null,r.jsxs(k,{children:[r.jsx(c,{label:"Status",children:r.jsx(i,{tone:e.status==="error"||e.status==="unresolved"?"danger":e.status==="ready"?"success":"muted",children:D[e.status]})}),r.jsx(c,{label:"Weight",children:r.jsx(i,{tone:"muted",children:`${Math.round(d.weight*100)}%`})}),f?r.jsx(c,{label:"Chain",children:r.jsx(i,{tone:"muted",children:e.chain.map(p=>p.name||p.type).join(" → ")||"Unresolved"})}):r.jsx(c,{label:"Constrained",children:e.constrained&&t.hierarchy.idForObject3D?.(e.constrained)?r.jsx(m,{size:"compact",onClick:()=>l(e.constrained),children:e.constrained.name||"Select object"}):r.jsx(i,{tone:"muted",children:e.constrained?.name||"Unresolved"})}),e.error!==null?r.jsx(c,{label:e.error.unit==="degrees"?"Angular error":"Solve error",children:r.jsx(i,{tone:"muted",children:e.error.unit==="degrees"?`${e.error.value.toFixed(2)}°`:`${e.error.value.toFixed(3)} m`})}):null,r.jsx(c,{label:"Target",children:e.target&&t.hierarchy.idForObject3D?.(e.target)?r.jsx(m,{size:"compact",onClick:()=>l(e.target),children:e.target.name||"Select target"}):r.jsx(i,{tone:"muted",children:e.target?.name||"Dynamic target"})}),f?r.jsx(c,{label:"Pole",children:e.pole&&t.hierarchy.idForObject3D?.(e.pole)?r.jsx(m,{size:"compact",onClick:()=>l(e.pole),children:e.pole.name||"Select pole"}):r.jsx(i,{tone:"muted",children:e.pole?.name||"None"})}):null]})]},d.id)})})}const N="selection.inspector",P="Constraints",V="link",W=450;function _(t,n){return F(t,n)}function q({adapter:t,nodeId:n}){return r.jsx(O,{adapter:t,nodeId:n})}export{q as default,V as icon,_ as match,W as order,N as point,P as title};
@@ -0,0 +1,3 @@
1
+ import{E as k,fv as x,kW as A,aN as R,aO as P,aG as l,a3 as L,kX as _,kY as F,kZ as y,ae as N,k0 as M,k_ as O,X as D,q as V}from"./index-Ckxb31Yz.js";import{d as w,P as B,S as T,a as W,b as J,u as G}from"./capability-coverage-CfUeULDN.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"./three.module-IFn-4i31.js";import"./game-contract-seams-TCpIMmHP.js";function E(){const e=k();return!e||!x()?null:w({worldId:l()?.config.name??"project",authoringSurface:A(e.scenes,P().map(t=>t.descriptor.id),R().map(t=>t.descriptor.id))})}function Y(e,t){return{slot:e,state:"unanswered",evidence:`nobody has read this project's own files yet, so ${e} is unmeasured — `+(t??"the editor has not asked its dev server for them")}}function q(e){return e.length>0&&e.every(t=>t.type==="ingest")}function H(e){const{scripts:t,roots:o}=e;return t===null||o===null?Y("export",e.unavailable):t.includes("build")?{slot:"export",state:"present",evidence:`this project declares a \`build\` script, which is what the export path runs to emit the \`dist/\` it stages${q(o)?"; this ingest project ships the standalone bundle produced by its own build unchanged":""}`}:{slot:"export",state:"absent",evidence:e.hasPackageJson?"this project's package.json declares no `build` script, and the export path runs `npm run build` in the project and stages the `dist/` it emits":"this project has no package.json, so there is no `build` script for the export path to run",missing:"this project cannot produce a standalone build, so it runs NOWHERE but the editor — the dev-served standalone page refuses an unexported game outright",fix:"add the scaffold's `build` script (`build: tsc && vite build`), which is what the export path runs"}}function K(e){const t={export:H};return B.map(o=>t[o](e))}let u=null,m=null,p=null;function X(){u=null,m=null,p=null}async function z(e,t=fetch){return u&&p===e?u:(m&&p===e||(p=e,u=null,m=(async()=>{let o;try{const r=await t("/__editor/project-verbs");o=await L(r,"project-verbs did not answer")}catch(r){o={scripts:null,hasPackageJson:!1,dependencies:null,roots:null,unavailable:`the editor could not reach its dev server to read this project's own files (${r instanceof Error?r.message:String(r)})`}}return u=o,o})()),m)}function U(){const e=l();return e?(p===e.rootPath?u:null)?.dependencies??null:null}function Z(){const e=l();if(!e)return null;z(e.rootPath);const t=p===e.rootPath?u:null;return{scripts:t?.scripts??null,hasPackageJson:t?.hasPackageJson??!1,roots:t?.roots??null,unavailable:t?.unavailable??(t?null:"the editor has not finished reading this project’s own files yet")}}function $(){const e=Z();if(!e)return null;const t=l();return w({worldId:t?.config.name??"project",projectVerbs:K(e)})}const Q={physics:["@react-three/rapier","@dimforge/rapier3d-compat","@dimforge/rapier2d-compat"],networking:["colyseus.js"],navigation:["recast-navigation","@recast-navigation/core"],audio:["tone","howler"]};function ee(e,t){if(t.dependencies===null)return[];const o=Q[e];return o?o.filter(r=>t.dependencies?.includes(r)):[]}function te(e,t){return`this project depends on ${t.join(" + ")}, so "nothing built a ${e} world" is not a settled answer. Reach a terminal state either way: BIND it — declare a ${e} adapter in the root entry's \`systems\` table (the engine ships \`rapierPhysicsSystem()\` for the R3F Rapier bridge; other slots take the game's own adapter) — or DECLARE the absence with \`absent(reason)\` in that same table. The reason must NAME the dependency and say why it is there while the subsystem is not (a transitive pull, a leftover, a build-only use); a declared absence blind to the shipped dependency grades malformed, not terminal.`}function re(e,t){const o=t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");if(/^[a-z0-9]+$/i.test(t)){if(new RegExp(`\\b${o}\\b`,"i").test(e))return!0}else if(e.toLowerCase().includes(t.toLowerCase()))return!0;const r=new Set(["compat","core","client","server","node","react","three","libs","api","sdk","util","utils","plugin","plugins","tools","types","browser"]),n=c=>c.toLowerCase().split(/[.\-_/]+/).filter(j=>j.length>=4&&!r.has(j)),[a,d]=t.toLowerCase().startsWith("@")?[t.slice(1,t.indexOf("/")),t.slice(t.indexOf("/")+1)]:["",t];let s=n(d);s.length===0&&(s=n(a));const i=s.map(c=>c.replace(/\d+d?$/,"")).filter(c=>c.length>=4);return[...new Set([...s,...i])].some(c=>new RegExp(`\\b${c.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}\\b`,"i").test(e))}const ne="this project's vgai.project.json declares no `server` block, so there is no room for a NetworkingAdapter to describe",oe={physics:"no mounted root built a physics world — the engine seeds this slot from the root that creates one (a `setup` root, or an R3F tree using the Rapier bridge), so nothing in this game simulates bodies",navigation:"no mounted root registered a navigation adapter — the engine seeds this slot from a world's own NavMeshManager registration, so this game has no navmesh",audio:"no mounted root built an audio context — the engine seeds this slot from the root that creates one, so there is no audio graph for the host to mute, meter or graph",camera:"no mounted root registered a camera-ownership system — the engine ships `createCameraOwnershipSystem` for a game that takes camera control (a cutscene rig), so this game's camera is gameplay-owned throughout",renderDebug:"no mounted root captured a real WebGL2 render context to derive one from — the engine seeds this slot only where the root owns the capture wiring (`adapter/setup-three-root-adapter.ts`), so the Frame debugger and the render-memory view have nothing to show for this game"};function C(e,t){return e==="networking"?"register a NetworkingAdapter from the game's own code (`ctx.registerSystemAdapter('networking', …)`) — this project declares a `server` block, so the editor's Network panel is dark for a game that IS networked":`register a ${e} adapter from the game's own code (\`ctx.registerSystemAdapter('${e}', …)\`), or build the subsystem the engine seeds it from`}function se(e,t){const o=new Map(t.declaredAbsences.map(r=>[r.slot,r]));return T.map(r=>{const n=o.get(r);if(e[r]!=null)return n?{slot:r,state:"malformed",evidence:`root "${n.rootId}" declares this slot absent — "${n.reason}" — but a ${r} adapter is bound on the live mount. One of the two is wrong: either the declaration is stale (delete the \`absent()\` marker) or something registers an adapter the game does not mean to have.`}:{slot:r,state:"bound",proof:_({slot:r,adapter:e[r],subject:"game"})};const a=ee(r,t);if(n){const s=a.filter(c=>!re(n.reason,c));if(s.length>0)return{slot:r,state:"malformed",evidence:`root "${n.rootId}" declares this slot absent — "${n.reason}" — but this project depends on ${s.join(" + ")} and the reason does not mention it. Either the absence is stale, or it holds and the reason should say why that dependency is present without the subsystem (naming it).`};const i=t.absencesFromLastMount?" — the declaration read at this session’s last play mount; play to re-read it live":"";return{slot:r,state:"empty",attestedBy:"game",evidence:a.length>0?`declared absent by root "${n.rootId}": ${n.reason} (the project does depend on ${a.join(" + ")}; the reason engages with that)${i}`:`declared absent by root "${n.rootId}": ${n.reason}${i}`}}if(a.length>0)return{slot:r,state:"unanswered",fix:te(r,a)};if(r==="networking")return t.declaresServer?{slot:r,state:"unanswered",fix:C(r)}:{slot:r,state:"empty",attestedBy:"host",evidence:ne};const d=oe[r];return d?{slot:r,state:"empty",attestedBy:"host",evidence:d}:{slot:r,state:"unanswered",fix:C(r)}})}function ae(){const e=M()?.game,t=l()?.rootPath??null;return e?(t!==null&&(g={projectPath:t,absences:e.declaredSystemAbsences??[]}),{absences:e.declaredSystemAbsences??[],fromLastMount:!1}):g!==null&&g.projectPath===t?{absences:g.absences,fromLastMount:!0}:{absences:[],fromLastMount:!1}}let g=null;function I(){if(F()!==null)return null;const e=l();if(!e)return null;const t=y();if(t.length===0||t.every(r=>r.adapter.provenance?.source==="foreign"))return null;const o=ae();return w({worldId:e.config.name,systemAdapters:se(N(),{declaresServer:(e.config.configurations??[]).some(r=>r.kind==="process"&&typeof r.port=="number"),declaredAbsences:o.absences,absencesFromLastMount:o.fromLastMount,dependencies:U()})})}function ie(e){const t=w({worldId:e.worldId,reach:W(e.adapter,e.worldId),surface:e.surface,reachMechanism:null});return{worldId:e.worldId,surface:e.surface,report:t}}function v(){return y().map(ie)}function ce(e=v()){const t=e.map(a=>({label:a.worldId,report:a.report})),o=I();o&&t.push({label:null,report:o});const r=$();r&&t.push({label:null,report:r});const n=E();return n&&t.push({label:null,report:n}),t}function de(e){const t=ce(e??v());return t.length===0?null:G(l()?.config.name??"session",t)}const S=new Set;let b=null,f=0;function h(){b=null,f=0}function ue(){if(O()){h();return}const e=v(),t=de(e);if(!t||t.summary.gaps===0){h();return}const o=y();if(o.length===0){h();return}const r=k()?.regions??[];if(r.length>1){const s=new Set(o.map(i=>i.worldId));if(r.some(i=>!s.has(i.id))){h();return}}if(e.some(s=>s.report.rows.find(i=>i.seam==="editor.capture")?.status!=="ok")){h();return}const n=`session coverage "${t.summary.worldId}"`,a=J(t,n).filter(s=>s.level==="warn"),d=a.map(s=>s.message).join(`
2
+ ---
3
+ `);if(b===d?f++:(b=d,f=1),!(f<2))for(const s of a)S.has(s.message)||(S.add(s.message),D.warn(s.message,"coverage"))}const Ee="workspace.service",le=["rootCoverage","systemCoverage","projectCoverage","authoringCoverage"];function pe(e){if(e)return{rootCoverage:e.rootCoverage??[],systemCoverage:e.systemCoverage??null,projectCoverage:e.projectCoverage??null,authoringCoverage:e.authoringCoverage??null};const t=I(),o=$(),r=E();return{rootCoverage:v().map(n=>({worldId:n.worldId,surface:n.surface,summary:n.report.summary,rows:n.report.rows.map(a=>({...a}))})),systemCoverage:t?{summary:t.summary,rows:t.rows.map(n=>({...n}))}:null,projectCoverage:o?{summary:o.summary,rows:o.rows.map(n=>({...n}))}:null,authoringCoverage:r?{summary:r.summary,rows:r.rows.map(n=>({...n}))}:null}}function $e(){const e=V().session,t=e.reportFacet(pe,{reusableKeys:le}),o=e.onSample(ue),r=e.onCommandDispatched(n=>{n==="restart"&&X()});return()=>{t(),o(),r()}}export{Ee as point,$e as start};
@@ -1 +1 @@
1
- import{assertNever as W}from"./adapter-surface-Y37Nzcyw.js";import{createRootBinding as _}from"./binding-Bmxqznjk.js";import{br as j}from"./index-GIL7oGEO.js";import{createAssetCache as q}from"./assets-BuSoGjBX.js";import{createHostRenderer as J}from"./setup-renderer-DVXaSGin.js";import{T as K}from"./three.module-D396a9Mn.js";import{createGameLoop as Q}from"./game-loop-CZvXlY00.js";import{g as U}from"./debug-registry-Dgvitx8M.js";import{createRootInstance as S,createGame as V}from"./game-DHOZVb-7.js";import{createInputRouter as X}from"./input-router-BNQvtIqw.js";import{isRenderModeRequested as Y,installRenderControlHarness as Z}from"./render-control-Df3yTiyr.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"./loader-CaF_I7Yt.js";import"./index-BcCBqgM_.js";import"./defaults-DKiBJCPN.js";import"./render-settings-Bw4W9SYF.js";import"./render-features-CPQ_e568.js";import"./frame-pacing-D5acoOzO.js";import"./loop-gate-report-N52EWFGD.js";import"./system-slot-E2mEdiih.js";import"./user-data-BB2Of6Ht.js";import"./object-marks-DwvIEBOK.js";import"./seeded-random-i3mtgBKZ.js";import"./render-seed-DF4JHy7P.js";import"./sim-clock-CLflx7kg.js";import"./system-runner-DkOjxEBt.js";import"./performance-profiler-D_Jey87L.js";import"./input-manager-DH_hGW6d.js";import"./asset-parse-error-BHMwBRU3.js";import"./binding-identity-DcTpbvyg.js";import"./prompt-labels-DSMdM2_B.js";import"./schema-kl9-2B_J.js";import"./gameplay-rng-trap-CTNhm-UW.js";import"./state-bridge-DLP1jLRW.js";function ee(e,o,r,t){const i=t?.pausable??!0,a=S({id:t?.id??"main",kind:"three",pausable:i,adapter:o,mounted:r,scene:r.scene,binding:T(e,t?.declaration,{surface:"three",adapter:o},r,i)});return e.registerRoot(a),a}function T(e,o,r,t,i){return o?_({...o,adapter:r,mounted:t,pausable:i,debugRegistry:U(e)}):null}function te(e,o,r,t){const i=t?.id??"main",a=t?.pausable??!0,d=S({id:i,kind:"canvas",pausable:a,adapter:o,mounted:r,canvasRoot:r.substrate.root,binding:T(e,t?.declaration,{surface:"canvas",adapter:o},r,a)});return e.registerRoot(d),d}function oe(e,o,r,t,i){const a=i?.pausable??!0,d=S({id:i?.id??"main",kind:"dom",pausable:a,adapter:o,mounted:r,container:t,binding:T(e,i?.declaration,{surface:"dom",adapter:o},r,a)});return e.registerRoot(d),d}async function Ze(e){return le(e)}function re(e){return{domElement:e,render(){},setPixelRatio(){},setClearColor(){},setSize(){},dispose(){},forceContextLoss(){}}}function D(e,o){try{e.mounted.dispose()}finally{e.renderer?.dispose(),e.renderer?.forceContextLoss();try{(e.element.parentNode??o).removeChild(e.element)}catch{}}}async function ne(e,o){const{game:r,canvas:t,w:i,h:a,dpr:d,isBottom:g,headless:s,assets:l,antialias:m}=o,u=s?re(t):J(t,i,a,m===void 0?void 0:{antialias:m},{alpha:!g,preserveDrawingBuffer:!0});u.setSize(i,a,!1),t.style.width="100%",t.style.height="100%",u.setPixelRatio(d),g||u.setClearColor(0,0);const v={three:K,surface:{canvas:t,width:i,height:a},renderer:u,assets:l,headless:s,game:r},w=await e.adapter.mount(v);return ee(r,e.adapter,w,{id:e.id,pausable:e.pausable,declaration:e.declaration}),{mountedEntry:{id:e.id,kind:"three",element:t,mounted:w,renderer:u},routerEntry:{id:e.id,zOrder:e.zOrder??0,canvas:t,hitTest:e.hitTest}}}async function ie(e,o){const{game:r,canvas:t,w:i,h:a,dpr:d,headless:g,isBottom:s}=o,l={canvas:t,width:i,height:a,game:r,headless:g,dpr:d,transparent:!s,preserveDrawingBuffer:!0},m=await e.adapter.mount(l);return te(r,e.adapter,m,{id:e.id,pausable:e.pausable,declaration:e.declaration}),{mountedEntry:{id:e.id,kind:"canvas",element:t,mounted:m,renderer:void 0},routerEntry:{id:e.id,zOrder:e.zOrder??0,canvas:t,hitTest:e.hitTest}}}async function se(e,o,r){r.style.pointerEvents="none",r.style.width="100%",r.style.height="100%";const t={container:r,game:o},i=await e.adapter.mount(t);return oe(o,e.adapter,i,r,{id:e.id,pausable:e.pausable,declaration:e.declaration}),{mountedEntry:{id:e.id,kind:"dom",element:r,mounted:i,renderer:void 0}}}function ae(e){return()=>{}}async function de(e,o,r){const{surfacesById:t,container:i,...a}=r,d=[],g=[];try{for(const s of e){const l=s.id===o;if(s.kind==="dom"){const b=t.get(s.id),{mountedEntry:E}=await se(s,a.game,b);d.push(E);continue}const m=t.get(s.id),u={...a,canvas:m,isBottom:l};let v,w;s.kind==="three"?{mountedEntry:v,routerEntry:w}=await ne(s,u):s.kind==="canvas"?{mountedEntry:v,routerEntry:w}=await ie(s,u):W(s,"create-runtime mount loop"),d.push(v),g.push(w)}}catch(s){for(let l=d.length-1;l>=0;l--){const m=d[l];try{D(m,i)}catch(u){console.error(`createGameRuntime: rolling back root "${m.id}" after a mount failure threw:`,u)}}throw s}return{mountedEntries:d,routerEntries:g}}function ce(e,o,r){const t=r??(typeof window<"u"?window:void 0);if(t!==void 0)return Z({game:e,clock:{seek(){},seekFrame(){}},readiness:{scene(){}},location:o,target:t}),()=>{delete t.__vgaiRender}}function me(e,o,r){try{e.dispose()}catch(t){console.error("createGameRuntime: disposing the game after a mount failure threw:",t)}for(const t of o)try{(t.parentNode??r).removeChild(t)}catch{}}async function le(e){const{container:o,roots:r,width:t,height:i,headless:a=!1,seed:d,playtest:g}=e;if(r.length===0)throw new Error("createGameRuntime: `roots` must contain at least one root.");const s=r,l=Math.max(1,t??o.clientWidth??0),m=Math.max(1,i??o.clientHeight??0),u=a?1:Math.min(typeof window<"u"&&window.devicePixelRatio||1,2);o.style.position||(o.style.position="relative");const v=s.map(n=>({id:n.id,zOrder:n.zOrder??0,hitTest:n.hitTest})),w=j(v),b=w[0]?.id,E=new Map(s.map(n=>[n.id,n.kind])),C=new Map;w.forEach((n,p)=>{const c=E.get(n.id)==="dom",f=document.createElement(c?"div":"canvas");if(f.dataset.vgaiRootSurface="true",f.dataset.vgaiRootId=n.id,!c){const R=f;R.width=l,R.height=m}f.style.cssText=`position:absolute;top:0;left:0;width:100%;height:100%;z-index:${p+1};contain:layout paint;`,o.appendChild(f),C.set(n.id,f)});const G=q(),y=e.renderControl?.location??(typeof window<"u"?window.location:void 0),H=y!==void 0&&Y(y);let k=!1;const x=Q({fixedTimestep:1/60,maxSubSteps:8,externalDrive:H,update:n=>{k&&h.runFrame(n,{skipRenderPhases:!0})},render:(n,p)=>{k&&h.runRenderFrame(n,p)}}),h=V({loop:x,assets:G,seed:d,playtest:g});let O;try{O=await de(s,b,{game:h,surfacesById:C,container:o,w:l,h:m,dpr:u,headless:a,assets:G,antialias:e.antialias})}catch(n){throw me(h,C.values(),o),n}const{mountedEntries:z,routerEntries:I}=O,$=X(o,I);k=!0,x.start();const A=ae(),F=H&&y!==void 0?ce(h,y,e.renderControl?.target):void 0;let B;const L=new Promise(n=>{B=n});let P=!1;function N(){if(P)return;P=!0;const n=[],p=(c,f)=>{try{f()}catch(R){n.push({step:c,error:R})}};try{p("loop.stop",()=>x.stop()),p("router.dispose",()=>$.dispose());for(const c of z)p(`root "${c.id}"`,()=>D(c,o));p("game.dispose",()=>h.dispose()),p("dev globals",()=>A()),p("render harness",()=>F?.())}finally{Promise.allSettled(z.map(c=>c.mounted.disposeComplete??Promise.resolve())).then(()=>B())}if(n.length>0)throw new AggregateError(n.map(c=>c.error),`Game session teardown failed in ${n.length} step(s): ${n.map(c=>c.step).join(", ")}. Every other step still ran.`)}return{stop:N,stopComplete:L,pause(){h.play.pause()},resume(){h.play.resume()},step(){h.play.step()},resize(n,p,c){const f=Math.max(1,n),R=Math.max(1,p);for(const M of z)c!==void 0&&M.renderer?.setPixelRatio(c),M.renderer?.setSize(f,R,!1),M.mounted.resize?.(f,R)},game:h}}export{Ze as createGameRuntime,te as registerCanvasRoot,oe as registerReactRoot,ee as registerThreeRoot};
1
+ import{assertNever as W}from"./adapter-surface-Y37Nzcyw.js";import{createRootBinding as _}from"./binding-Bmxqznjk.js";import{cu as j}from"./index-Ckxb31Yz.js";import{createAssetCache as q}from"./assets-Do88ZdV_.js";import{createHostRenderer as J}from"./setup-renderer-wt_a-p8r.js";import{T as K}from"./three.module-IFn-4i31.js";import{createGameLoop as Q}from"./game-loop-CZvXlY00.js";import{g as U}from"./debug-registry-B3Cnne3x.js";import{createRootInstance as S,createGame as V}from"./game-D5EJoILQ.js";import{createInputRouter as X}from"./input-router-FzxO5ld6.js";import{isRenderModeRequested as Y,installRenderControlHarness as Z}from"./render-control-BNQr1eNO.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"./loader-BbMsvIxP.js";import"./index-DUh02lTr.js";import"./defaults-DKiBJCPN.js";import"./render-settings-C_kIMq8Y.js";import"./render-features-COF7MSQ9.js";import"./frame-pacing-D5acoOzO.js";import"./loop-gate-report-N52EWFGD.js";import"./system-slot-E2mEdiih.js";import"./user-data-CZqsJDk-.js";import"./object-marks-DwvIEBOK.js";import"./seeded-random-CN0scLZj.js";import"./render-seed-DF4JHy7P.js";import"./sim-clock-DEfbb_-P.js";import"./system-runner-D_DtVrer.js";import"./performance-profiler-D_Jey87L.js";import"./input-manager-Cxx3RJgG.js";import"./asset-parse-error-BHMwBRU3.js";import"./binding-identity-DcTpbvyg.js";import"./prompt-labels-DSMdM2_B.js";import"./schema-Iy-mbzll.js";import"./gameplay-rng-trap-BhRx_CtU.js";import"./state-bridge-DLP1jLRW.js";function ee(e,o,r,t){const i=t?.pausable??!0,a=S({id:t?.id??"main",kind:"three",pausable:i,adapter:o,mounted:r,scene:r.scene,binding:T(e,t?.declaration,{surface:"three",adapter:o},r,i)});return e.registerRoot(a),a}function T(e,o,r,t,i){return o?_({...o,adapter:r,mounted:t,pausable:i,debugRegistry:U(e)}):null}function te(e,o,r,t){const i=t?.id??"main",a=t?.pausable??!0,d=S({id:i,kind:"canvas",pausable:a,adapter:o,mounted:r,canvasRoot:r.substrate.root,binding:T(e,t?.declaration,{surface:"canvas",adapter:o},r,a)});return e.registerRoot(d),d}function oe(e,o,r,t,i){const a=i?.pausable??!0,d=S({id:i?.id??"main",kind:"dom",pausable:a,adapter:o,mounted:r,container:t,binding:T(e,i?.declaration,{surface:"dom",adapter:o},r,a)});return e.registerRoot(d),d}async function Ze(e){return le(e)}function re(e){return{domElement:e,render(){},setPixelRatio(){},setClearColor(){},setSize(){},dispose(){},forceContextLoss(){}}}function D(e,o){try{e.mounted.dispose()}finally{e.renderer?.dispose(),e.renderer?.forceContextLoss();try{(e.element.parentNode??o).removeChild(e.element)}catch{}}}async function ne(e,o){const{game:r,canvas:t,w:i,h:a,dpr:d,isBottom:g,headless:s,assets:l,antialias:m}=o,u=s?re(t):J(t,i,a,m===void 0?void 0:{antialias:m},{alpha:!g,preserveDrawingBuffer:!0});u.setSize(i,a,!1),t.style.width="100%",t.style.height="100%",u.setPixelRatio(d),g||u.setClearColor(0,0);const v={three:K,surface:{canvas:t,width:i,height:a},renderer:u,assets:l,headless:s,game:r},w=await e.adapter.mount(v);return ee(r,e.adapter,w,{id:e.id,pausable:e.pausable,declaration:e.declaration}),{mountedEntry:{id:e.id,kind:"three",element:t,mounted:w,renderer:u},routerEntry:{id:e.id,zOrder:e.zOrder??0,canvas:t,hitTest:e.hitTest}}}async function ie(e,o){const{game:r,canvas:t,w:i,h:a,dpr:d,headless:g,isBottom:s}=o,l={canvas:t,width:i,height:a,game:r,headless:g,dpr:d,transparent:!s,preserveDrawingBuffer:!0},m=await e.adapter.mount(l);return te(r,e.adapter,m,{id:e.id,pausable:e.pausable,declaration:e.declaration}),{mountedEntry:{id:e.id,kind:"canvas",element:t,mounted:m,renderer:void 0},routerEntry:{id:e.id,zOrder:e.zOrder??0,canvas:t,hitTest:e.hitTest}}}async function se(e,o,r){r.style.pointerEvents="none",r.style.width="100%",r.style.height="100%";const t={container:r,game:o},i=await e.adapter.mount(t);return oe(o,e.adapter,i,r,{id:e.id,pausable:e.pausable,declaration:e.declaration}),{mountedEntry:{id:e.id,kind:"dom",element:r,mounted:i,renderer:void 0}}}function ae(e){return()=>{}}async function de(e,o,r){const{surfacesById:t,container:i,...a}=r,d=[],g=[];try{for(const s of e){const l=s.id===o;if(s.kind==="dom"){const b=t.get(s.id),{mountedEntry:E}=await se(s,a.game,b);d.push(E);continue}const m=t.get(s.id),u={...a,canvas:m,isBottom:l};let v,w;s.kind==="three"?{mountedEntry:v,routerEntry:w}=await ne(s,u):s.kind==="canvas"?{mountedEntry:v,routerEntry:w}=await ie(s,u):W(s,"create-runtime mount loop"),d.push(v),g.push(w)}}catch(s){for(let l=d.length-1;l>=0;l--){const m=d[l];try{D(m,i)}catch(u){console.error(`createGameRuntime: rolling back root "${m.id}" after a mount failure threw:`,u)}}throw s}return{mountedEntries:d,routerEntries:g}}function ce(e,o,r){const t=r??(typeof window<"u"?window:void 0);if(t!==void 0)return Z({game:e,clock:{seek(){},seekFrame(){}},readiness:{scene(){}},location:o,target:t}),()=>{delete t.__vgaiRender}}function me(e,o,r){try{e.dispose()}catch(t){console.error("createGameRuntime: disposing the game after a mount failure threw:",t)}for(const t of o)try{(t.parentNode??r).removeChild(t)}catch{}}async function le(e){const{container:o,roots:r,width:t,height:i,headless:a=!1,seed:d,playtest:g}=e;if(r.length===0)throw new Error("createGameRuntime: `roots` must contain at least one root.");const s=r,l=Math.max(1,t??o.clientWidth??0),m=Math.max(1,i??o.clientHeight??0),u=a?1:Math.min(typeof window<"u"&&window.devicePixelRatio||1,2);o.style.position||(o.style.position="relative");const v=s.map(n=>({id:n.id,zOrder:n.zOrder??0,hitTest:n.hitTest})),w=j(v),b=w[0]?.id,E=new Map(s.map(n=>[n.id,n.kind])),C=new Map;w.forEach((n,p)=>{const c=E.get(n.id)==="dom",f=document.createElement(c?"div":"canvas");if(f.dataset.vgaiRootSurface="true",f.dataset.vgaiRootId=n.id,!c){const R=f;R.width=l,R.height=m}f.style.cssText=`position:absolute;top:0;left:0;width:100%;height:100%;z-index:${p+1};contain:layout paint;`,o.appendChild(f),C.set(n.id,f)});const G=q(),y=e.renderControl?.location??(typeof window<"u"?window.location:void 0),H=y!==void 0&&Y(y);let k=!1;const x=Q({fixedTimestep:1/60,maxSubSteps:8,externalDrive:H,update:n=>{k&&h.runFrame(n,{skipRenderPhases:!0})},render:(n,p)=>{k&&h.runRenderFrame(n,p)}}),h=V({loop:x,assets:G,seed:d,playtest:g});let O;try{O=await de(s,b,{game:h,surfacesById:C,container:o,w:l,h:m,dpr:u,headless:a,assets:G,antialias:e.antialias})}catch(n){throw me(h,C.values(),o),n}const{mountedEntries:z,routerEntries:I}=O,$=X(o,I);k=!0,x.start();const A=ae(),F=H&&y!==void 0?ce(h,y,e.renderControl?.target):void 0;let B;const L=new Promise(n=>{B=n});let P=!1;function N(){if(P)return;P=!0;const n=[],p=(c,f)=>{try{f()}catch(R){n.push({step:c,error:R})}};try{p("loop.stop",()=>x.stop()),p("router.dispose",()=>$.dispose());for(const c of z)p(`root "${c.id}"`,()=>D(c,o));p("game.dispose",()=>h.dispose()),p("dev globals",()=>A()),p("render harness",()=>F?.())}finally{Promise.allSettled(z.map(c=>c.mounted.disposeComplete??Promise.resolve())).then(()=>B())}if(n.length>0)throw new AggregateError(n.map(c=>c.error),`Game session teardown failed in ${n.length} step(s): ${n.map(c=>c.step).join(", ")}. Every other step still ran.`)}return{stop:N,stopComplete:L,pause(){h.play.pause()},resume(){h.play.resume()},step(){h.play.step()},resize(n,p,c){const f=Math.max(1,n),R=Math.max(1,p);for(const M of z)c!==void 0&&M.renderer?.setPixelRatio(c),M.renderer?.setSize(f,R,!1),M.mounted.resize?.(f,R)},game:h}}export{Ze as createGameRuntime,te as registerCanvasRoot,oe as registerReactRoot,ee as registerThreeRoot};
@@ -1 +1 @@
1
- import{dq as f,L as d,t as x,c4 as y}from"./index-GIL7oGEO.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"./three.module-D396a9Mn.js";const g="x-vgai-curve";function p(r,n){return r[n].label??n}function v(r,n,e){const s=r.points;for(let t=0;t<s.length;t++){const o=s[t];for(const a of["x","y"]){const{min:u,max:c}=n[a];(o[a]<u||o[a]>c)&&e.addIssue({code:"custom",path:["points",t,a],message:`${o[a]} is outside this curve's ${p(n,a)} domain [${u}, ${c}] — move the point inside the domain, or widen the axis in the schema (curve({ ${a}: { min, max } })).`})}if(t===0)continue;const i=s[t-1];o.x<=i.x&&e.addIssue({code:"custom",path:["points",t,"x"],message:`${o.x} must be strictly greater than the previous point's x (${i.x}) — curve points run left to right along x, with no duplicate x. Sort the points, or nudge this one.`})}}function K(r){const n=f({x:d().describe(`Position along ${p(r,"x")}.`),y:d().describe(`Value at that position, along ${p(r,"y")}.`)});return f({interpolation:y(["linear","smooth"]).describe('How the value moves between points: "linear" for straight segments, "smooth" for a monotone cubic that never overshoots them.'),points:x(n).min(2,{message:'a curve needs at least two points — add another { "x": …, "y": … } so the value has somewhere to travel between.'}).describe("Keys in increasing x order; the value is clamped outside the first/last x.")}).superRefine((e,s)=>v(e,r,s)).meta({[g]:r})}function L(r){let n=r;for(let e=0;e<5&&n;e++){const t=n.meta?.()?.[g];if(t&&typeof t=="object"&&"x"in t&&"y"in t)return t;n=n.def?.innerType}}function b(r){const n=r.length,e=[];for(let t=0;t<n-1;t++){const o=r[t],i=r[t+1];e.push((i.y-o.y)/(i.x-o.x))}const s=[e[0]];for(let t=1;t<n-1;t++)s.push((e[t-1]+e[t])/2);s.push(e[n-2]);for(let t=0;t<n-1;t++){const o=e[t];if(o===0){s[t]=0,s[t+1]=0;continue}let i=s[t]/o,a=s[t+1]/o;i<0&&(s[t]=0,i=0),a<0&&(s[t+1]=0,a=0);const u=i*i+a*a;if(u>9){const c=3/Math.sqrt(u);s[t]=c*i*o,s[t+1]=c*a*o}}return s}function M(r,n){const e=r.points;if(e.length===0)return 0;const s=e[0],t=e[e.length-1];if(e.length===1||n<=s.x)return s.y;if(n>=t.x)return t.y;let o=0;for(;o<e.length-2&&n>=e[o+1].x;)o++;const i=e[o],a=e[o+1],u=a.x-i.x;if(u<=0)return i.y;const c=(n-i.x)/u;if(r.interpolation==="linear")return i.y+(a.y-i.y)*c;const m=b(e),h=c*c,l=h*c;return(2*l-3*h+1)*i.y+(l-2*h+c)*u*m[o]+(-2*l+3*h)*a.y+(l-h)*u*m[o+1]}export{K as curve,L as curveAxesOf,M as sampleCurve};
1
+ import{eg as f,O as d,t as x,cy as y}from"./index-Ckxb31Yz.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"./three.module-IFn-4i31.js";const g="x-vgai-curve";function p(r,n){return r[n].label??n}function v(r,n,e){const s=r.points;for(let t=0;t<s.length;t++){const o=s[t];for(const a of["x","y"]){const{min:u,max:c}=n[a];(o[a]<u||o[a]>c)&&e.addIssue({code:"custom",path:["points",t,a],message:`${o[a]} is outside this curve's ${p(n,a)} domain [${u}, ${c}] — move the point inside the domain, or widen the axis in the schema (curve({ ${a}: { min, max } })).`})}if(t===0)continue;const i=s[t-1];o.x<=i.x&&e.addIssue({code:"custom",path:["points",t,"x"],message:`${o.x} must be strictly greater than the previous point's x (${i.x}) — curve points run left to right along x, with no duplicate x. Sort the points, or nudge this one.`})}}function K(r){const n=f({x:d().describe(`Position along ${p(r,"x")}.`),y:d().describe(`Value at that position, along ${p(r,"y")}.`)});return f({interpolation:y(["linear","smooth"]).describe('How the value moves between points: "linear" for straight segments, "smooth" for a monotone cubic that never overshoots them.'),points:x(n).min(2,{message:'a curve needs at least two points — add another { "x": …, "y": … } so the value has somewhere to travel between.'}).describe("Keys in increasing x order; the value is clamped outside the first/last x.")}).superRefine((e,s)=>v(e,r,s)).meta({[g]:r})}function M(r){let n=r;for(let e=0;e<5&&n;e++){const t=n.meta?.()?.[g];if(t&&typeof t=="object"&&"x"in t&&"y"in t)return t;n=n.def?.innerType}}function b(r){const n=r.length,e=[];for(let t=0;t<n-1;t++){const o=r[t],i=r[t+1];e.push((i.y-o.y)/(i.x-o.x))}const s=[e[0]];for(let t=1;t<n-1;t++)s.push((e[t-1]+e[t])/2);s.push(e[n-2]);for(let t=0;t<n-1;t++){const o=e[t];if(o===0){s[t]=0,s[t+1]=0;continue}let i=s[t]/o,a=s[t+1]/o;i<0&&(s[t]=0,i=0),a<0&&(s[t+1]=0,a=0);const u=i*i+a*a;if(u>9){const c=3/Math.sqrt(u);s[t]=c*i*o,s[t+1]=c*a*o}}return s}function P(r,n){const e=r.points;if(e.length===0)return 0;const s=e[0],t=e[e.length-1];if(e.length===1||n<=s.x)return s.y;if(n>=t.x)return t.y;let o=0;for(;o<e.length-2&&n>=e[o+1].x;)o++;const i=e[o],a=e[o+1],u=a.x-i.x;if(u<=0)return i.y;const c=(n-i.x)/u;if(r.interpolation==="linear")return i.y+(a.y-i.y)*c;const m=b(e),h=c*c,l=h*c;return(2*l-3*h+1)*i.y+(l-2*h+c)*u*m[o]+(-2*l+3*h)*a.y+(l-h)*u*m[o+1]}export{K as curve,M as curveAxesOf,P as sampleCurve};
@@ -1,4 +1,4 @@
1
- import{dr as p}from"./index-GIL7oGEO.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"./three.module-D396a9Mn.js";function S(s,e,t){let i=c(s,e,t);const o=new Set;return{get:()=>i,sourcePath:t,subscribe(r){return o.add(r),()=>o.delete(r)},hotSwap(r){let n;try{n=c(s,r,t)}catch(a){console.error(`[data] hot edit rejected, keeping previous values.
1
+ import{eh as p}from"./index-Ckxb31Yz.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"./three.module-IFn-4i31.js";function S(s,e,t){let i=c(s,e,t);const o=new Set;return{get:()=>i,sourcePath:t,subscribe(r){return o.add(r),()=>o.delete(r)},hotSwap(r){let n;try{n=c(s,r,t)}catch(a){console.error(`[data] hot edit rejected, keeping previous values.
2
2
  ${String(a)}`);return}i=n;for(const a of o)a(i)}}}function g(s){const e=p(s,{io:"input"});if(e.type==="object"){const t=e.properties??{};t.$schema??={type:"string"},e.properties=t}return e}function c(s,e,t){const i=e!==null&&typeof e=="object"&&!Array.isArray(e)&&"$schema"in e?Object.fromEntries(Object.entries(e).filter(([r])=>r!=="$schema")):e,o=s.safeParse(i);if(!o.success){const r=o.error.issues.map(n=>` - ${n.path.join(".")||"(root)"}: ${n.message}`).join(`
3
3
  `);throw new Error(`Data asset "${t}" failed its schema:
4
4
  ${r}
@@ -1 +1 @@
1
- import{DATA_REF_PATTERN as c}from"./data-check-core-CQEjuFyt.js";import{u as l}from"./index-GIL7oGEO.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"./three.module-D396a9Mn.js";function g(e){return new RegExp(`^${e}#[A-Za-z0-9_-]+(?:\\.[A-Za-z0-9_-]+)*$`)}function j(e){return l().regex(g(e),{message:`must be a "${e}#<key>" reference — expected the target asset stem "${e}", e.g. "${e}#some-key".`}).meta({"x-vgai-ref":e})}function u(e,o){let t=e;for(const r of o){if(t===null||typeof t!="object"||Array.isArray(t)||!(r in t))return r;t=t[r]}return null}function S(e,o){const t=c.exec(o);if(!t)throw new Error(`getRef: "${o}" is not a "file#key" reference — expected a string shaped like "some-file#some-key".`);const r=t[1],m=t[2],n=e.sourcePath?.split("\\").join("/").split("/").pop()?.replace(/\.data\.json$/,"");if(n!==void 0&&n!==r)throw new Error(`getRef: ref "${o}" names target asset "${r}", but the handle passed in is "${n}" (${e.sourcePath}). Pass the handle "${r}#..." actually names — getRef(${r}, ...), not getRef(${n}, ...).`);const i=m.split("."),a=e.get(),f=u(a,i);if(f!==null)throw new Error(`getRef: dangling ref "${o}" — "${f}" does not exist`+(n?` in ${n}.data.json`:"")+'. Fix the key or remove the ref (refs are "file#key" strings).');let s=a;for(const p of i)s=s[p];return s}export{j as dataRef,S as getRef};
1
+ import{DATA_REF_PATTERN as c}from"./data-check-core-CQEjuFyt.js";import{u as l}from"./index-Ckxb31Yz.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"./three.module-IFn-4i31.js";function g(e){return new RegExp(`^${e}#[A-Za-z0-9_-]+(?:\\.[A-Za-z0-9_-]+)*$`)}function j(e){return l().regex(g(e),{message:`must be a "${e}#<key>" reference — expected the target asset stem "${e}", e.g. "${e}#some-key".`}).meta({"x-vgai-ref":e})}function u(e,o){let t=e;for(const r of o){if(t===null||typeof t!="object"||Array.isArray(t)||!(r in t))return r;t=t[r]}return null}function S(e,o){const t=c.exec(o);if(!t)throw new Error(`getRef: "${o}" is not a "file#key" reference — expected a string shaped like "some-file#some-key".`);const r=t[1],m=t[2],n=e.sourcePath?.split("\\").join("/").split("/").pop()?.replace(/\.data\.json$/,"");if(n!==void 0&&n!==r)throw new Error(`getRef: ref "${o}" names target asset "${r}", but the handle passed in is "${n}" (${e.sourcePath}). Pass the handle "${r}#..." actually names — getRef(${r}, ...), not getRef(${n}, ...).`);const i=m.split("."),a=e.get(),f=u(a,i);if(f!==null)throw new Error(`getRef: dangling ref "${o}" — "${f}" does not exist`+(n?` in ${n}.data.json`:"")+'. Fix the key or remove the ref (refs are "file#key" strings).');let s=a;for(const p of i)s=s[p];return s}export{j as dataRef,S as getRef};
@@ -1 +1 @@
1
- import{D as m}from"./debug-registry-Dgvitx8M.js";import{runTicksWhenSettled as _}from"./run-ticks-settled-C4ksViyA.js";import"./index-GIL7oGEO.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"./three.module-D396a9Mn.js";const D="vgai-debug",T=100,E=50,k=100,P=60,b=2e3,V="the host loop reported liveness 'loop-starved' and this session has no way to drive ticks — no recent rAF progress was observed. Check `vgai status` for the separate visibility readings; foreground/reload the editor, or start play to wire the run-ticks target, then retry.";async function L(i,s,d){const n=()=>i.state("time"),c=n();let l=c.tick,u=0,g=0;for(;;){const r=n();if(r.simSeconds-c.simSeconds>=s)return{stalled:!1};if(r.loopLiveness==="loop-starved"){if(!d)return{stalled:!0,starvedWithoutDriver:!0};if(g>=b)return{stalled:!0};g+=1;const e=s-(r.simSeconds-c.simSeconds),t=r.fixedDt,o=t!==void 0&&Number.isFinite(t)&&t>0?Math.max(1,Math.ceil(e/t-1e-9)):1;d(Math.min(P,o));const a=n();if(a.tick===r.tick&&a.simSeconds===r.simSeconds)return{stalled:!0};l=a.tick,u=0,await Promise.resolve();continue}if(u=r.tick===l?u+1:0,l=r.tick,u>=k)return{stalled:!0};await new Promise(e=>setTimeout(e,E))}}function f(){return typeof window<"u"}function S(i){return new URLSearchParams(i.search).get(D)==="1"}function h(i){return i.debug?.allowInProduction===!0}function I(i){const{registry:s,manifest:d}=i,n=s.adapter,c=[];function l(e){c.push(e),c.length>T&&c.shift()}const u=e=>{l(e.message||String(e.error))},g=e=>{l(`Unhandled promise rejection: ${String(e.reason)}`)};i.window.addEventListener?.("error",u),i.window.addEventListener?.("unhandledrejection",g);function r(e,t){const o=s.getVirtualInputTarget(t);if(!o)throw new m("DEBUG_INPUT_UNAVAILABLE",`debug bridge: ${e}() has no virtual-input target wired — no default three world has mounted yet, or this project's mount path never wired one`);return o}return{version:1,providers:n.providers,state:n.state,stateAll:n.stateAll,commands:n.commands,events:n.events,async invoke(e,t){if(!h(d))throw new m("DEBUG_COMMANDS_UNSUPPORTED",`debug: command "${e}" invocation refused — production build without debug.allowInProduction (D18)`,{name:e});return n.invoke(e,t)},input:{setVirtualAction:(e,t,o)=>r("setVirtualAction",o).setVirtualAction(e,t),tapVirtualAction:(e,t)=>r("tapVirtualAction",t).tapVirtualAction(e),clearVirtualActions:e=>r("clearVirtualActions",e).clearVirtualActions(),scheduleActionAtTick:(e,t,o,a)=>r("scheduleActionAtTick",a).scheduleActionAtTick(e,t,o),startRecording:e=>r("startRecording",e).startInputRecording(),stopRecording:e=>r("stopRecording",e).stopInputRecording(),isRecording:e=>r("isRecording",e).isInputRecording(),injectPointerDelta:(e,t,o)=>r("injectPointerDelta",o).injectPointerDelta(e,t),injectPointerPosition:(e,t,o)=>r("injectPointerPosition",o).injectPointerPosition(e,t)},snapshot(e){return{time:n.state("time"),state:n.stateAll(),events:n.events(e),pageErrors:c.slice()}},runTicks(e,t){const o=s.getRunTicksTarget();if(!o)throw new m("DEBUG_RUN_TICKS_UNAVAILABLE","debug bridge: runTicks() has no run-ticks target wired — no Game has mounted yet");o.runTicks(e,t)},runTicksSettled(e,t){return _(s,e,t)},async holdFor(e,t,o){const a=r("holdFor",o),w=a.setVirtualAction(e,!0);if(!w.delivered)return a.clearVirtualActions(),w.reason!==void 0?{delivered:!1,reason:w.reason}:{delivered:!1};const v=s.getRunTicksTarget(),{stalled:p,starvedWithoutDriver:A}=await L(n,t,v?R=>v.runTicks(R,{render:"last"}):void 0);return a.clearVirtualActions(),p?{delivered:!1,reason:A?V:"play stopped during hold"}:{delivered:!0}},uninstall(){i.window.removeEventListener?.("error",u),i.window.removeEventListener?.("unhandledrejection",g),delete i.window.__vgai}}}function x(i){const s=i.url??(f()?window.location:void 0);if(!s||!S(s))return;const d=i.window??(f()?window:void 0);if(!d)return;if(!h(i.manifest)){console.warn("[debug] ?vgai-debug=1 ignored: production build without debug.allowInProduction (D18)");return}const n=I({registry:i.registry,manifest:i.manifest,window:d});return d.__vgai=n,n}export{D as DEBUG_MODE_QUERY_PARAM,V as HOLD_STARVED_NO_DRIVER_REASON,x as maybeInstallDebugBridge,L as waitForHoldBudget};
1
+ import{D as m}from"./debug-registry-B3Cnne3x.js";import{runTicksWhenSettled as _}from"./run-ticks-settled-B0cTtmhQ.js";import"./index-Ckxb31Yz.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"./three.module-IFn-4i31.js";const D="vgai-debug",T=100,E=50,k=100,P=60,b=2e3,V="the host loop reported liveness 'loop-starved' and this session has no way to drive ticks — no recent rAF progress was observed. Check `vgai status` for the separate visibility readings; foreground/reload the editor, or start play to wire the run-ticks target, then retry.";async function L(i,s,d){const n=()=>i.state("time"),c=n();let l=c.tick,u=0,g=0;for(;;){const r=n();if(r.simSeconds-c.simSeconds>=s)return{stalled:!1};if(r.loopLiveness==="loop-starved"){if(!d)return{stalled:!0,starvedWithoutDriver:!0};if(g>=b)return{stalled:!0};g+=1;const e=s-(r.simSeconds-c.simSeconds),t=r.fixedDt,o=t!==void 0&&Number.isFinite(t)&&t>0?Math.max(1,Math.ceil(e/t-1e-9)):1;d(Math.min(P,o));const a=n();if(a.tick===r.tick&&a.simSeconds===r.simSeconds)return{stalled:!0};l=a.tick,u=0,await Promise.resolve();continue}if(u=r.tick===l?u+1:0,l=r.tick,u>=k)return{stalled:!0};await new Promise(e=>setTimeout(e,E))}}function f(){return typeof window<"u"}function S(i){return new URLSearchParams(i.search).get(D)==="1"}function h(i){return i.debug?.allowInProduction===!0}function I(i){const{registry:s,manifest:d}=i,n=s.adapter,c=[];function l(e){c.push(e),c.length>T&&c.shift()}const u=e=>{l(e.message||String(e.error))},g=e=>{l(`Unhandled promise rejection: ${String(e.reason)}`)};i.window.addEventListener?.("error",u),i.window.addEventListener?.("unhandledrejection",g);function r(e,t){const o=s.getVirtualInputTarget(t);if(!o)throw new m("DEBUG_INPUT_UNAVAILABLE",`debug bridge: ${e}() has no virtual-input target wired — no default three world has mounted yet, or this project's mount path never wired one`);return o}return{version:1,providers:n.providers,state:n.state,stateAll:n.stateAll,commands:n.commands,events:n.events,async invoke(e,t){if(!h(d))throw new m("DEBUG_COMMANDS_UNSUPPORTED",`debug: command "${e}" invocation refused — production build without debug.allowInProduction (D18)`,{name:e});return n.invoke(e,t)},input:{setVirtualAction:(e,t,o)=>r("setVirtualAction",o).setVirtualAction(e,t),tapVirtualAction:(e,t)=>r("tapVirtualAction",t).tapVirtualAction(e),clearVirtualActions:e=>r("clearVirtualActions",e).clearVirtualActions(),scheduleActionAtTick:(e,t,o,a)=>r("scheduleActionAtTick",a).scheduleActionAtTick(e,t,o),startRecording:e=>r("startRecording",e).startInputRecording(),stopRecording:e=>r("stopRecording",e).stopInputRecording(),isRecording:e=>r("isRecording",e).isInputRecording(),injectPointerDelta:(e,t,o)=>r("injectPointerDelta",o).injectPointerDelta(e,t),injectPointerPosition:(e,t,o)=>r("injectPointerPosition",o).injectPointerPosition(e,t)},snapshot(e){return{time:n.state("time"),state:n.stateAll(),events:n.events(e),pageErrors:c.slice()}},runTicks(e,t){const o=s.getRunTicksTarget();if(!o)throw new m("DEBUG_RUN_TICKS_UNAVAILABLE","debug bridge: runTicks() has no run-ticks target wired — no Game has mounted yet");o.runTicks(e,t)},runTicksSettled(e,t){return _(s,e,t)},async holdFor(e,t,o){const a=r("holdFor",o),w=a.setVirtualAction(e,!0);if(!w.delivered)return a.clearVirtualActions(),w.reason!==void 0?{delivered:!1,reason:w.reason}:{delivered:!1};const v=s.getRunTicksTarget(),{stalled:p,starvedWithoutDriver:A}=await L(n,t,v?R=>v.runTicks(R,{render:"last"}):void 0);return a.clearVirtualActions(),p?{delivered:!1,reason:A?V:"play stopped during hold"}:{delivered:!0}},uninstall(){i.window.removeEventListener?.("error",u),i.window.removeEventListener?.("unhandledrejection",g),delete i.window.__vgai}}}function x(i){const s=i.url??(f()?window.location:void 0);if(!s||!S(s))return;const d=i.window??(f()?window:void 0);if(!d)return;if(!h(i.manifest)){console.warn("[debug] ?vgai-debug=1 ignored: production build without debug.allowInProduction (D18)");return}const n=I({registry:i.registry,manifest:i.manifest,window:d});return d.__vgai=n,n}export{D as DEBUG_MODE_QUERY_PARAM,V as HOLD_STARVED_NO_DRIVER_REASON,x as maybeInstallDebugBridge,L as waitForHoldBudget};
@@ -1 +1 @@
1
- import{dr as B}from"./index-GIL7oGEO.js";function C(o){const n=Symbol.for(`@vgai/game-runtime/game-scoped/${o}`);return{set(c,a){Object.defineProperty(c,n,{configurable:!0,enumerable:!1,value:a})},get(c){return c[n]??null}}}const W=Object.freeze(Object.defineProperty({__proto__:null,createGameScopedSlot:C},Symbol.toStringTag,{value:"Module"}));class d extends Error{code;data;constructor(n,c,a){super(c),this.name="DebugError",this.code=n,this.data=a}}const M="ctx.debug.registerStateProvider(name, fn) — see the template example component";function q(o){if(o instanceof Error){const n={causeName:o.name,causeMessage:o.message};return o.stack===void 0?n:{...n,causeStack:o.stack}}return{causeName:typeof o,causeMessage:String(o)}}const F=1e4,O="__react__";function k(o,n,c,a){o.has(n)||(o.add(n),console.warn(`[debug] ${c} "${n}" re-registered (world "${a}")`))}function j(o){const n=new Map,c=new Map,a=new Set,v=new Set,m=[],A=500;let p=0,y=!1;const w=new Map,S=new Map,l=new Map;let I=null;const D=new Set;let b=null;const g=new Map;let $=0;function G(e){if(e!==void 0){if(!l.has(e))throw new d("DEBUG_INPUT_WORLD_NOT_FOUND",`debug: no InputManager wired for world "${e}" — registered: `+(l.size?[...l.keys()].join(", "):"(none)"),{worldId:e,registered:[...l.keys()]});return e}return h(l.keys())}function h(e){const t=[...e];if(t.length===0)return null;const r=o.getDefaultRootId?.()??null;return r!==null&&t.includes(r)?r:t[0]}n.set("time",{fn:()=>({simSeconds:o.getSimT(),tick:o.getTick(),loopLiveness:o.getLoopLiveness?.()??null,...o.getFixedDt===void 0?{}:{fixedDt:o.getFixedDt()}}),tier:"observable",worldId:"__engine__",builtin:!0}),n.set("input.actions",{fn:()=>{const e=h(w.keys());return(e?w.get(e):void 0)?.()??[]},tier:"observable",worldId:"__engine__",builtin:!0}),n.set("input.trace",{fn:()=>{const e=h(S.keys());return(e?S.get(e):void 0)?.()??{version:1,seed:null,fixedDt:null,ticks:[]}},tier:"observable",worldId:"__engine__",builtin:!0});function E(e,t,r,s,i){const u=n.get(t);if(u?.builtin)throw new d("DEBUG_BUILTIN_RESERVED",`debug: "${t}" is a built-in state provider (registered by "${u.worldId}") — built-in names cannot be registered over, from a world or the react door`,{name:t,registered:u.worldId});if(u){if(u.worldId!==e)throw new d("DEBUG_NAME_COLLISION",`debug: state provider "${t}" is registered by both world "${u.worldId}" and world "${e}" — each provider name must be unique across live roots`,{name:t,roots:[u.worldId,e]});k(a,t,"provider",e)}n.set(t,{fn:r,tier:s,worldId:e,builtin:!1,token:i})}function R(e,t,r,s,i){if(r.locus===void 0&&y)throw new d("DEBUG_COMMAND_LOCUS_REQUIRED","this project declares a Colyseus room — declare locus: 'client' | 'server' so fixtures mutate authoritative state, not client prediction",{name:t,worldId:e});const u=c.get(t);if(u){if(u.worldId!==e)throw new d("DEBUG_NAME_COLLISION",`debug: command "${t}" is registered by both world "${u.worldId}" and world "${e}" — each command name must be unique across live roots`,{name:t,roots:[u.worldId,e]});k(v,t,"command",e)}c.set(t,{description:r.description,argsSchema:r.args,locus:r.locus,fn:s,worldId:e,token:i})}function T(e,t){p+=1,m.push({tick:o.getTick(),simT:o.getSimT(),event:e,detail:t,seq:p}),m.length>A&&m.shift()}function U(e){return e===void 0?m.slice():m.filter(t=>t.seq>e)}function L(e,t){if(!b)throw new d("DEBUG_COMMAND_FAILED",`debug: command "${e}" is locus:'server' but no Colyseus room is attached (call ctx.debug.attachRoom(room) once your game joins its room)`,{reason:"no room connection"});const r=`dbg-${++$}`,s=b;return new Promise((i,u)=>{const f=setTimeout(()=>{g.delete(r),u(new d("DEBUG_COMMAND_FAILED",`debug: command "${e}" (requestId "${r}") timed out waiting for the server`,{reason:"server timeout"}))},F);g.set(r,{resolve:i,reject:u,timer:f}),s.send("__vgai:debugCommand",{name:e,args:t,requestId:r})})}let _=null;function P(e){_?.(),b=e;const t=e.onMessage("__vgai:debugCommandResult",s=>{const i=s,u=i?.requestId;if(u===void 0)return;const f=g.get(u);f&&(g.delete(u),clearTimeout(f.timer),i?.ok?f.resolve(i.result):f.reject(new d("DEBUG_COMMAND_FAILED",`debug: server command failed: ${String(i?.error)}`,{cause:i?.error})))}),r=()=>{if(_===r){_=null,b===e&&(b=null),typeof t=="function"&&t();for(const[s,i]of g)clearTimeout(i.timer),i.reject(new d("DEBUG_COMMAND_FAILED",`debug: command (requestId "${s}") failed — its room was detached before a reply arrived`,{reason:"no room connection"}));g.clear()}};return _=r,r}return{adapter:{providers(){return[...n.entries()].map(([e,t])=>({name:e,tier:t.tier}))},state(e){const t=n.get(e);if(!t)throw new d("STATE_PROVIDER_NOT_FOUND",`debug: no state provider registered under "${e}"`,{registered:[...n.keys()],registrationHint:M});return t.fn()},stateAll(){const e={};for(const[t,r]of n)try{e[t]=r.fn()}catch(s){e[t]={__error:String(s)}}return e},commands(){return[...c.entries()].map(([e,t])=>({name:e,description:t.description,argsJsonSchema:t.argsSchema?B(t.argsSchema,{unrepresentable:"any"}):void 0,locus:t.locus??"client"}))},async invoke(e,t){const r=c.get(e);if(!r)throw new d("DEBUG_COMMAND_NOT_REGISTERED",`debug: no command registered under "${e}"`,{registered:[...c.keys()],registrationHint:M});let s=t;if(r.argsSchema){const i=r.argsSchema.safeParse(t);if(!i.success)throw new d("DEBUG_COMMAND_ARGS_INVALID",`debug: command "${e}" received invalid args`,{issues:i.error.issues});s=i.data}if((r.locus??"client")==="server")return L(e,s);try{return await r.fn(...s)}catch(i){const u=q(i);throw new d("DEBUG_COMMAND_FAILED",`debug: command "${e}" threw: ${u.causeMessage}`,{cause:i,...u})}},events(e){return U(e)}},forRoot(e){return{registerStateProvider(t,r,s){E(e,t,r,s?.tier??"observable")},registerCommand(t,r,s){R(e,t,r,s)},emit(t,r){T(t,r)},attachRoom(t){return P(t)}}},emitReact(e,t){T(e,t)},strip(e){for(const[t,r]of n)r.builtin||e!==void 0&&r.worldId!==e||(n.delete(t),a.delete(t));for(const[t,r]of c)e!==void 0&&r.worldId!==e||(c.delete(t),v.delete(t))},setRoomDeclared(e){y=e},setInputActionsSource(e,t){w.set(e,t)},setInputTraceSource(e,t){S.set(e,t)},setVirtualInputTarget(e,t){l.set(e,t)},getVirtualInputTarget(e){const t=G(e);return t!==null?l.get(t)??null:null},setRunTicksTarget(e){I=e},getRunTicksTarget(){return I},registerWorldSettledProbe(e){return D.add(e),()=>{D.delete(e)}},worldSettled(){for(const e of D)try{if(!e())return!1}catch{return!1}return!0},getGameTick(){return o.getTick()},registerReactProvider(e,t,r){const s=Symbol(e);return E(O,e,t,r?.tier??"observable",s),()=>{n.get(e)?.token===s&&(n.delete(e),a.delete(e))}},registerReactCommand(e,t,r){const s=Symbol(e);return R(O,e,t,r,s),()=>{c.get(e)?.token===s&&(c.delete(e),v.delete(e))}}}}const N=C("debug-registry");function x(o,n){N.set(o,n)}function V(o){return N.get(o)??null}const J=Object.freeze(Object.defineProperty({__proto__:null,DebugError:d,createDebugRegistry:j,getDebugRegistry:V,registerDebugRegistry:x},Symbol.toStringTag,{value:"Module"}));export{d as D,j as a,W as b,C as c,J as d,V as g,x as r};
1
+ import{eh as B}from"./index-Ckxb31Yz.js";function C(o){const n=Symbol.for(`@vgai/game-runtime/game-scoped/${o}`);return{set(c,a){Object.defineProperty(c,n,{configurable:!0,enumerable:!1,value:a})},get(c){return c[n]??null}}}const W=Object.freeze(Object.defineProperty({__proto__:null,createGameScopedSlot:C},Symbol.toStringTag,{value:"Module"}));class d extends Error{code;data;constructor(n,c,a){super(c),this.name="DebugError",this.code=n,this.data=a}}const M="ctx.debug.registerStateProvider(name, fn) — see the template example component";function q(o){if(o instanceof Error){const n={causeName:o.name,causeMessage:o.message};return o.stack===void 0?n:{...n,causeStack:o.stack}}return{causeName:typeof o,causeMessage:String(o)}}const F=1e4,O="__react__";function k(o,n,c,a){o.has(n)||(o.add(n),console.warn(`[debug] ${c} "${n}" re-registered (world "${a}")`))}function j(o){const n=new Map,c=new Map,a=new Set,v=new Set,m=[],A=500;let p=0,y=!1;const w=new Map,S=new Map,l=new Map;let I=null;const D=new Set;let b=null;const g=new Map;let $=0;function G(e){if(e!==void 0){if(!l.has(e))throw new d("DEBUG_INPUT_WORLD_NOT_FOUND",`debug: no InputManager wired for world "${e}" — registered: `+(l.size?[...l.keys()].join(", "):"(none)"),{worldId:e,registered:[...l.keys()]});return e}return h(l.keys())}function h(e){const t=[...e];if(t.length===0)return null;const r=o.getDefaultRootId?.()??null;return r!==null&&t.includes(r)?r:t[0]}n.set("time",{fn:()=>({simSeconds:o.getSimT(),tick:o.getTick(),loopLiveness:o.getLoopLiveness?.()??null,...o.getFixedDt===void 0?{}:{fixedDt:o.getFixedDt()}}),tier:"observable",worldId:"__engine__",builtin:!0}),n.set("input.actions",{fn:()=>{const e=h(w.keys());return(e?w.get(e):void 0)?.()??[]},tier:"observable",worldId:"__engine__",builtin:!0}),n.set("input.trace",{fn:()=>{const e=h(S.keys());return(e?S.get(e):void 0)?.()??{version:1,seed:null,fixedDt:null,ticks:[]}},tier:"observable",worldId:"__engine__",builtin:!0});function E(e,t,r,s,i){const u=n.get(t);if(u?.builtin)throw new d("DEBUG_BUILTIN_RESERVED",`debug: "${t}" is a built-in state provider (registered by "${u.worldId}") — built-in names cannot be registered over, from a world or the react door`,{name:t,registered:u.worldId});if(u){if(u.worldId!==e)throw new d("DEBUG_NAME_COLLISION",`debug: state provider "${t}" is registered by both world "${u.worldId}" and world "${e}" — each provider name must be unique across live roots`,{name:t,roots:[u.worldId,e]});k(a,t,"provider",e)}n.set(t,{fn:r,tier:s,worldId:e,builtin:!1,token:i})}function R(e,t,r,s,i){if(r.locus===void 0&&y)throw new d("DEBUG_COMMAND_LOCUS_REQUIRED","this project declares a Colyseus room — declare locus: 'client' | 'server' so fixtures mutate authoritative state, not client prediction",{name:t,worldId:e});const u=c.get(t);if(u){if(u.worldId!==e)throw new d("DEBUG_NAME_COLLISION",`debug: command "${t}" is registered by both world "${u.worldId}" and world "${e}" — each command name must be unique across live roots`,{name:t,roots:[u.worldId,e]});k(v,t,"command",e)}c.set(t,{description:r.description,argsSchema:r.args,locus:r.locus,fn:s,worldId:e,token:i})}function T(e,t){p+=1,m.push({tick:o.getTick(),simT:o.getSimT(),event:e,detail:t,seq:p}),m.length>A&&m.shift()}function U(e){return e===void 0?m.slice():m.filter(t=>t.seq>e)}function L(e,t){if(!b)throw new d("DEBUG_COMMAND_FAILED",`debug: command "${e}" is locus:'server' but no Colyseus room is attached (call ctx.debug.attachRoom(room) once your game joins its room)`,{reason:"no room connection"});const r=`dbg-${++$}`,s=b;return new Promise((i,u)=>{const f=setTimeout(()=>{g.delete(r),u(new d("DEBUG_COMMAND_FAILED",`debug: command "${e}" (requestId "${r}") timed out waiting for the server`,{reason:"server timeout"}))},F);g.set(r,{resolve:i,reject:u,timer:f}),s.send("__vgai:debugCommand",{name:e,args:t,requestId:r})})}let _=null;function P(e){_?.(),b=e;const t=e.onMessage("__vgai:debugCommandResult",s=>{const i=s,u=i?.requestId;if(u===void 0)return;const f=g.get(u);f&&(g.delete(u),clearTimeout(f.timer),i?.ok?f.resolve(i.result):f.reject(new d("DEBUG_COMMAND_FAILED",`debug: server command failed: ${String(i?.error)}`,{cause:i?.error})))}),r=()=>{if(_===r){_=null,b===e&&(b=null),typeof t=="function"&&t();for(const[s,i]of g)clearTimeout(i.timer),i.reject(new d("DEBUG_COMMAND_FAILED",`debug: command (requestId "${s}") failed — its room was detached before a reply arrived`,{reason:"no room connection"}));g.clear()}};return _=r,r}return{adapter:{providers(){return[...n.entries()].map(([e,t])=>({name:e,tier:t.tier}))},state(e){const t=n.get(e);if(!t)throw new d("STATE_PROVIDER_NOT_FOUND",`debug: no state provider registered under "${e}"`,{registered:[...n.keys()],registrationHint:M});return t.fn()},stateAll(){const e={};for(const[t,r]of n)try{e[t]=r.fn()}catch(s){e[t]={__error:String(s)}}return e},commands(){return[...c.entries()].map(([e,t])=>({name:e,description:t.description,argsJsonSchema:t.argsSchema?B(t.argsSchema,{unrepresentable:"any"}):void 0,locus:t.locus??"client"}))},async invoke(e,t){const r=c.get(e);if(!r)throw new d("DEBUG_COMMAND_NOT_REGISTERED",`debug: no command registered under "${e}"`,{registered:[...c.keys()],registrationHint:M});let s=t;if(r.argsSchema){const i=r.argsSchema.safeParse(t);if(!i.success)throw new d("DEBUG_COMMAND_ARGS_INVALID",`debug: command "${e}" received invalid args`,{issues:i.error.issues});s=i.data}if((r.locus??"client")==="server")return L(e,s);try{return await r.fn(...s)}catch(i){const u=q(i);throw new d("DEBUG_COMMAND_FAILED",`debug: command "${e}" threw: ${u.causeMessage}`,{cause:i,...u})}},events(e){return U(e)}},forRoot(e){return{registerStateProvider(t,r,s){E(e,t,r,s?.tier??"observable")},registerCommand(t,r,s){R(e,t,r,s)},emit(t,r){T(t,r)},attachRoom(t){return P(t)}}},emitReact(e,t){T(e,t)},strip(e){for(const[t,r]of n)r.builtin||e!==void 0&&r.worldId!==e||(n.delete(t),a.delete(t));for(const[t,r]of c)e!==void 0&&r.worldId!==e||(c.delete(t),v.delete(t))},setRoomDeclared(e){y=e},setInputActionsSource(e,t){w.set(e,t)},setInputTraceSource(e,t){S.set(e,t)},setVirtualInputTarget(e,t){l.set(e,t)},getVirtualInputTarget(e){const t=G(e);return t!==null?l.get(t)??null:null},setRunTicksTarget(e){I=e},getRunTicksTarget(){return I},registerWorldSettledProbe(e){return D.add(e),()=>{D.delete(e)}},worldSettled(){for(const e of D)try{if(!e())return!1}catch{return!1}return!0},getGameTick(){return o.getTick()},registerReactProvider(e,t,r){const s=Symbol(e);return E(O,e,t,r?.tier??"observable",s),()=>{n.get(e)?.token===s&&(n.delete(e),a.delete(e))}},registerReactCommand(e,t,r){const s=Symbol(e);return R(O,e,t,r,s),()=>{c.get(e)?.token===s&&(c.delete(e),v.delete(e))}}}}const N=C("debug-registry");function x(o,n){N.set(o,n)}function V(o){return N.get(o)??null}const J=Object.freeze(Object.defineProperty({__proto__:null,DebugError:d,createDebugRegistry:j,getDebugRegistry:V,registerDebugRegistry:x},Symbol.toStringTag,{value:"Module"}));export{d as D,j as a,W as b,C as c,J as d,V as g,x as r};
@@ -0,0 +1,2 @@
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/canvas-entry-runtime-E5YjSgre.js","assets/index-Ckxb31Yz.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/three.module-IFn-4i31.js","assets/index-B4bmKkgY.css","assets/mount-ingest-root-B5D-Lmmk.js","assets/active-ingest-DEgq9JiA.js","assets/game-contract-seams-TCpIMmHP.js","assets/capability-coverage-CfUeULDN.js","assets/ingest-source-persistence-DH6ioCOu.js","assets/playtest-BnFenMBW.js"])))=>i.map(i=>d[i]);
2
+ import{y as u,z as f,_ as i,B as d,E as n,F as l,I as p,J as g}from"./index-Ckxb31Yz.js";import{q as v}from"./edit-mode-authoring-D_BiHCQj.js";import{d as P,a as c,b as y,g as w,e as I,c as _}from"./active-ingest-DEgq9JiA.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"./three.module-IFn-4i31.js";import"./game-contract-seams-TCpIMmHP.js";import"./capability-coverage-CfUeULDN.js";import"./ingest-source-persistence-DH6ioCOu.js";import"./playtest-BnFenMBW.js";async function h(){const e=await u().catch(()=>null);if(!e)return!1;const t=f(e);if(t.length!==1)return!1;if(t[0].world!==void 0)return!0;const a=await E();return R(a)}const D=4e3;function E(){const e=n();return e?Promise.resolve(e):new Promise(t=>{const a=setTimeout(()=>{o(),t(n())},D),o=l(()=>{const r=n();r&&(clearTimeout(a),o(),t(r))})})}function R(e){return e?p(e.scenes).some(t=>t.plan.kind==="isolation-document"):!1}async function B(e){if(!await h())return!1;const t=await u().catch(()=>null);if((t?f(t).some(r=>r.adapter.surface==="canvas"):!1)&&!c()){const{resolveCanvasPixiForEditor:r}=await i(async()=>{const{resolveCanvasPixiForEditor:m}=await import("./canvas-entry-runtime-E5YjSgre.js");return{resolveCanvasPixiForEditor:m}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11]));(await r()).Assets.reset()}const{launchIngestRoutes:o}=await i(async()=>{const{launchIngestRoutes:r}=await import("./mount-ingest-root-B5D-Lmmk.js").then(s=>s.m);return{launchIngestRoutes:r}},__vite__mapDeps([12,1,2,3,4,5,6,7,8,9,10,11,13,14,15,16,17]));if(await o(e),!c())throw new Error(`Play could not start: this project's ingest root failed to mount — see the mount failure reported above (and in ${d("status")}).`);return y(),g(),w()?.play(),!0}function G(e){return P()?(I(),_(),e.setPlayState("stopped"),v(),!0):!1}export{P as deferredIngestPlayActive,G as exitDeferredIngestPlay,h as ingestMountIsDeferredToPlay,B as mountDeferredIngestForPlay};
@@ -0,0 +1 @@
1
+ import{e5 as te,cu as oe,e6 as re,e7 as ne,aG as se,e8 as W,cm as ie,X as E,cl as de,e9 as le,ea as ae,eb as ue,ec as fe}from"./index-Ckxb31Yz.js";import{B as S,q as F}from"./edit-mode-authoring-D_BiHCQj.js";import{s as ce,d as I,a as pe}from"./design-time-mount-registry-DUpXCg1U.js";import{s as we,a as he,g as ye,b as ge}from"./react-story-board-CSqHY0Cg.js";const _=new Map;function L(n,r){return`${n}\0${r}`}function Pe(n,r){return _.get(L(n,r))}function Ee(n,r,o){_.set(L(n,r),o)}const me=1;function q(n){const r=[];for(const{worldId:o,adapter:d}of n.childAdapters()){if(!(d instanceof S))continue;const a=d.inspector.get(o,"kind");if(a!=="dom"&&a!=="canvas"||d.inspector.get(o,"reason")!==void 0)continue;const b=d.inspector.get(o,"adapter");b?.startsWith("ingest")||b?.startsWith("module")||r.push({worldId:o,kind:a,path:d.inspector.get(o,"path"),zOrder:Number(d.inspector.get(o,"zOrder")??0),pausable:d.inspector.get(o,"pausable")!==!1})}return r}function Me(n){return q(n)}const Ie="ui-components-board";function x(n,r){return n.childAdapters().some(o=>o.worldId===r)}function ze(){return{worldId:Ie,kind:"dom",path:void 0,zOrder:0,pausable:!0}}function N(n,r,o="dom"){const d=le(r)?"none":"block";n.style.display=d,n.style.pointerEvents=I(o)?.alwaysInteractive||ae(r)?"auto":"none";for(const a of Array.from(n.parentElement?.children??[]))a instanceof HTMLElement&&a.dataset.vgaiStoryBoardChromeFor===r&&(a.style.display=d)}function be(n,r,o,d){const{worldId:a}=r,s=document.createElement("div");return s.dataset.worldId=a,s.dataset.vgaiRootSurface="true",d&&(s.dataset.vgaiCanvasScene="true"),s.style.position="absolute",s.style.top="0",s.style.left="0",s.style.width="100%",s.style.height="100%",s.style.zIndex=String(o),s.style.contain="layout paint",s.style.cssText+="font: initial; color: initial; letter-spacing: normal; word-spacing: normal; text-align: start; text-indent: 0; text-transform: none; white-space: normal; direction: ltr;",N(s,a,r.kind),$(s),n.appendChild(s),s}function $(n){if(n.dataset.vgaiCanvasScene==="true"){n.style.transform="",n.style.width="100%",n.style.height="100%";return}if(n.style.transform=ue(fe())??"",n.style.transformOrigin="0 0",n.dataset.vgaiReactStoryBoard==="true")return;const r=ye();n.style.width=r.width===null?"100%":`${r.width}px`,n.style.height=r.height===null?"100%":`${r.height}px`}function Te(n,r,o,d,a,s,b){s?s.canvasSceneView.reset():te(),ge();const k=se();if(!s&&k?.config.resolution&&we(k.config.resolution.width,k.config.resolution.height),o.playState!=="stopped"){let e=!1,t=!1;const i=o.subscribe(()=>{e||t||o.playState!=="stopped"||(t=!0,e||F())});return()=>{e=!0,i()}}const B=k?.rootPath,M=d?[...d]:q(r);if(M.length===0||!B)return()=>{};const H=B,y=oe(M.map(e=>({id:e.worldId,zOrder:e.zOrder}))).map(e=>M.find(t=>t.worldId===e.id)),j=new Map(y.map(e=>[e.worldId,e])),u=new Map,g=new Map,C=new Map,R=new Set,O=new Set,z=new Set;let h=!1,c=!1,D=!1;function V(){for(const e of g.values())try{e()}catch(t){E.error(`[design-time-layers] dispose failed: ${t}`,"authoring")}g.clear();for(const e of u.values())e.remove();u.clear();for(const e of y)a?.(e.worldId,null)}function X(){V();for(const e of R){const t=j.get(e);if(!t)continue;const i={id:t.worldId,kind:t.kind,entryOrScenePath:t.path,zOrder:t.zOrder,pausable:t.pausable};r.replaceChild(e,new S(o,i,"Design-time layer suspended by play mode — Stop restores it."))}R.clear(),o.notifyIngestEdit()}function P(e,t,i){const l=I(e.kind);if(!l){O.add(e.worldId);return}O.delete(e.worldId);const f=(C.get(e.worldId)??0)+1;C.set(e.worldId,f);const p=be(n,e,me+t,!!s);u.set(e.worldId,p);const T={projectRootPath:H,store:o,...s?{view:s.canvasSceneView}:{},...b?{activationDocumentId:b}:{}};(async()=>l.mount(e,p,T))().then(w=>{if(h||c||C.get(e.worldId)!==f){w.dispose();return}if(w.adapter)x(r,e.worldId)&&(r.replaceChild(e.worldId,w.adapter),R.add(e.worldId)),a?.(e.worldId,w.adapter);else if(w.pick){const v={id:e.worldId,kind:e.kind,entryOrScenePath:e.path,zOrder:e.zOrder,pausable:e.pausable};r.replaceChild(e.worldId,new S(o,v,void 0,w.pick)),R.add(e.worldId)}g.set(e.worldId,w.dispose),W(e.worldId),o.notifyIngestEdit(),i?.()}).catch(w=>{if(C.get(e.worldId)!==f||(i?.(),p.remove(),u.get(e.worldId)===p&&u.delete(e.worldId),h||c))return;const v=ie(w);E.error(`[design-time-layers] world "${e.worldId}" (${e.kind}) failed to mount: ${v}`,"authoring");const ee={id:e.worldId,kind:e.kind,entryOrScenePath:e.path,zOrder:e.zOrder,pausable:e.pausable};a?.(e.worldId,null),x(r,e.worldId)&&r.replaceChild(e.worldId,new S(o,ee,v)),de({worldId:e.worldId,kind:e.kind,identity:l.identity,message:v}),o.notifyIngestEdit()})}y.forEach((e,t)=>{P(e,t)});function G(e,t){const i=g.get(e.worldId);g.delete(e.worldId);const l=u.get(e.worldId);u.delete(e.worldId),P(e,t,()=>{const p=u.get(e.worldId);if(p&&(p.style.visibility=""),i)try{i()}catch(T){E.error(`[design-time-layers] re-projection dispose failed: ${T}`,"authoring")}l?.remove()});const f=u.get(e.worldId);f&&f!==l&&(f.style.visibility="hidden")}function J(e,t){const i=g.get(e.worldId);if(g.delete(e.worldId),i)try{i()}catch(f){E.error(`[design-time-layers] remount dispose failed: ${f}`,"authoring")}const l=u.get(e.worldId);l&&(l.remove(),u.delete(e.worldId)),P(e,t)}const m=new Map;function A(){for(const[e,t]of m)I(e.kind)!==e&&(t(),m.delete(e));for(const e of pe()){if(m.has(e)||I(e.kind)!==e||!y.some(l=>l.kind===e.kind))continue;const t=[],i=l=>()=>{h||c||o.playState!=="stopped"||y.forEach((f,p)=>{f.kind===e.kind&&l(f,p)})};e.remountWhen&&t.push(e.remountWhen(i(J))),e.reprojectWhen&&t.push(e.reprojectWhen(i(G))),m.set(e,()=>{for(const l of t)l()})}}A();const K=ce(()=>{h||c||o.playState!=="stopped"||(y.forEach((e,t)=>{O.has(e.worldId)&&I(e.kind)&&(z.delete(e.worldId),W(e.worldId),P(e,t))}),A())}),Y=re(()=>{if(h||c)return;let e=!1;for(const t of y){if(!O.has(t.worldId)||z.has(t.worldId)||I(t.kind)||(z.add(t.worldId),!x(r,t.worldId)))continue;const i={id:t.worldId,kind:t.kind,entryOrScenePath:t.path,zOrder:t.zOrder,pausable:t.pausable};r.replaceChild(t.worldId,new S(o,i,`No package in this editor registered a design-time mount for a "${t.kind}" world, so there is nothing here to author it with. A build ships the packages its own entry in \`builds/\` lists.`)),e=!0}e&&o.notifyIngestEdit()}),Z=ne(()=>{for(const e of u.values())$(e)}),Q=he(()=>{for(const e of u.values())$(e)}),U=o.subscribe(()=>{if(!c&&o.playState!=="stopped"){c=!0,X();return}if(c&&!D&&o.playState==="stopped"&&!h){D=!0,h||F();return}if(!c)for(const[e,t]of u)N(t,e,j.get(e)?.kind??"dom")});return()=>{h=!0;for(const e of m.values())e();m.clear(),K(),Y(),U(),Z(),Q(),V()}}export{Ee as a,Me as d,Te as m,ze as p,Pe as r};
@@ -0,0 +1,2 @@
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/design-time-react-mount-Dx6fJ-Hg.js","assets/design-time-layers-g9VS6amb.js","assets/index-Ckxb31Yz.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/three.module-IFn-4i31.js","assets/index-B4bmKkgY.css","assets/edit-mode-authoring-D_BiHCQj.js","assets/design-time-mount-registry-DUpXCg1U.js","assets/react-story-board-CSqHY0Cg.js","assets/crash-null-boundary-v3a0uEgw.js","assets/realm-services-D25JHoqD.js","assets/canvas-entry-runtime-E5YjSgre.js","assets/world-state-ZGDGY_Xl.js","assets/debug-registry-B3Cnne3x.js","assets/frame-selector-cache-cCeUbcjG.js","assets/three-ingest-runtime-DWijtqQ8.js","assets/EffectComposer-BHDH-NLz.js","assets/CopyShader-BzTUYzf6.js","assets/ShaderPass-qtkA7CQ8.js","assets/CSS3DRenderer-CAS2WZZy.js","assets/react-root-DGLRLr-F.js","assets/StoryPreviewMount-BIfxmkYh.js","assets/story-presentation-CxADj5oz.js","assets/three-story-model-BraQFA9h.js","assets/inspect-BRgDdtVk.js","assets/inference-diagnostics-YW0yJkKx.js","assets/assets-Do88ZdV_.js","assets/loader-BbMsvIxP.js","assets/game-loop-CZvXlY00.js","assets/frame-pacing-D5acoOzO.js","assets/game-D5EJoILQ.js","assets/loop-gate-report-N52EWFGD.js","assets/system-slot-E2mEdiih.js","assets/user-data-CZqsJDk-.js","assets/object-marks-DwvIEBOK.js","assets/seeded-random-CN0scLZj.js","assets/render-seed-DF4JHy7P.js","assets/sim-clock-DEfbb_-P.js","assets/system-runner-D_DtVrer.js","assets/performance-profiler-D_Jey87L.js","assets/input-manager-Cxx3RJgG.js","assets/asset-parse-error-BHMwBRU3.js","assets/binding-identity-DcTpbvyg.js","assets/prompt-labels-DSMdM2_B.js","assets/schema-Iy-mbzll.js","assets/gameplay-rng-trap-BhRx_CtU.js","assets/state-bridge-DLP1jLRW.js","assets/react-world-authoring-adapter-BMT9kLWU.js","assets/board-guides-C3usUZZk.js","assets/writer-BPbm4_my.js","assets/story-arg-descriptors-Ek86ExX7.js"])))=>i.map(i=>d[i]);
2
+ import{_ as i}from"./index-Ckxb31Yz.js";import{r as m}from"./design-time-mount-registry-DUpXCg1U.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"./three.module-IFn-4i31.js";const y="workspace.service";function D(){return m({kind:"dom",owner:"@volter/editor-game/react/design-time-mount",identity:"default-react",mount:async(e,r,t)=>{const{mountReactDesignLayer:o}=await i(async()=>{const{mountReactDesignLayer:n}=await import("./design-time-react-mount-Dx6fJ-Hg.js");return{mountReactDesignLayer:n}},__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,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57]));return o(e,r,t)},reprojectWhen:e=>{let r=!1,t=null;return i(()=>import("./design-time-react-mount-Dx6fJ-Hg.js"),__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,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57])).then(o=>{r||(t=o.reprojectWhenStoriesRepublish(e))}),()=>{r=!0,t?.(),t=null}}})}export{y as point,D as start};
@@ -0,0 +1 @@
1
+ import{r as st,a as lt}from"./design-time-layers-g9VS6amb.js";import{fp as mt,b9 as ut,gd as dt,ge as ct,X as x,gf as pt,gg as Y,cm as U,gh as X,aw as ft,fv as z,ax as j,dX as ht,di as gt,gi as H}from"./index-Ckxb31Yz.js";import{c as bt,s as wt,g as yt}from"./react-story-board-CSqHY0Cg.js";import{C as St}from"./crash-null-boundary-v3a0uEgw.js";import{r as vt,b as Pt,a as It}from"./realm-services-D25JHoqD.js";import{r as Rt}from"./react-root-DGLRLr-F.js";import{m as Mt}from"./StoryPreviewMount-BIfxmkYh.js";import{c as Ct,s as xt}from"./story-presentation-CxADj5oz.js";import{d as Et}from"./three-story-model-BraQFA9h.js";import{c as Nt}from"./inspect-BRgDdtVk.js";import{createAssetCache as Ft}from"./assets-Do88ZdV_.js";import{createGameLoop as Tt}from"./game-loop-CZvXlY00.js";import{createGame as kt}from"./game-D5EJoILQ.js";import{R as J}from"./react-world-authoring-adapter-BMT9kLWU.js";import"./edit-mode-authoring-D_BiHCQj.js";import"./design-time-mount-registry-DUpXCg1U.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"./three.module-IFn-4i31.js";import"./canvas-entry-runtime-E5YjSgre.js";import"./world-state-ZGDGY_Xl.js";import"./debug-registry-B3Cnne3x.js";import"./frame-selector-cache-cCeUbcjG.js";import"./three-ingest-runtime-DWijtqQ8.js";import"./EffectComposer-BHDH-NLz.js";import"./CopyShader-BzTUYzf6.js";import"./ShaderPass-qtkA7CQ8.js";import"./CSS3DRenderer-CAS2WZZy.js";import"./inference-diagnostics-YW0yJkKx.js";import"./loader-BbMsvIxP.js";import"./frame-pacing-D5acoOzO.js";import"./loop-gate-report-N52EWFGD.js";import"./system-slot-E2mEdiih.js";import"./user-data-CZqsJDk-.js";import"./object-marks-DwvIEBOK.js";import"./seeded-random-CN0scLZj.js";import"./render-seed-DF4JHy7P.js";import"./sim-clock-DEfbb_-P.js";import"./system-runner-D_DtVrer.js";import"./performance-profiler-D_Jey87L.js";import"./input-manager-Cxx3RJgG.js";import"./asset-parse-error-BHMwBRU3.js";import"./binding-identity-DcTpbvyg.js";import"./prompt-labels-DSMdM2_B.js";import"./schema-Iy-mbzll.js";import"./gameplay-rng-trap-BhRx_CtU.js";import"./state-bridge-DLP1jLRW.js";import"./board-guides-C3usUZZk.js";import"./writer-BPbm4_my.js";import"./story-arg-descriptors-Ek86ExX7.js";function At(e){const o=e.tagName;if(o==="IMG"||o==="VIDEO"||o==="CANVAS"||o==="svg"||o==="SVG"||o==="PICTURE")return!0;const r=getComputedStyle(e);if(r.visibility==="hidden"||r.display==="none")return!1;if($t(r.backgroundColor)||r.backgroundImage&&r.backgroundImage!=="none"||r.boxShadow&&r.boxShadow!=="none"||r.borderStyle!=="none"&&r.borderStyle!==""&&(parseFloat(r.borderTopWidth)>0||parseFloat(r.borderRightWidth)>0||parseFloat(r.borderBottomWidth)>0||parseFloat(r.borderLeftWidth)>0))return!0;for(const n of e.childNodes)if(n.nodeType===Node.TEXT_NODE&&(n.textContent??"").trim()!=="")return!0;return!1}function $t(e){if(!e||e==="transparent")return!1;const o=/^rgba\(\s*[\d.]+\s*,\s*[\d.]+\s*,\s*[\d.]+\s*,\s*([\d.]+)\s*\)$/.exec(e);return o?parseFloat(o[1])>0:!0}function jt(e,o=r=>r.getBoundingClientRect()){const r=o(e),n=e.offsetWidth;if(r.width<=0||n<=0)return null;const s=r.width/n;let u=Number.POSITIVE_INFINITY,c=Number.POSITIVE_INFINITY,i=Number.NEGATIVE_INFINITY,y=Number.NEGATIVE_INFINITY;for(const p of e.querySelectorAll("*")){if(!At(p))continue;const d=o(p);d.width<=0||d.height<=0||(u=Math.min(u,(d.left-r.left)/s),c=Math.min(c,(d.top-r.top)/s),i=Math.max(i,(d.right-r.left)/s),y=Math.max(y,(d.bottom-r.top)/s))}return i<=u||y<=c?null:{x:u,y:c,width:i-u,height:y-c}}let E=!1;function Bt(e,o){if(!e)return;H({adapter:e,seam:"editor.stories.apply",stage:"effect",detail:`the design board applied portable story ${o}`,run:()=>e.stories.apply(o,o)});const r=e.selection;r&&H({adapter:e,seam:"editor.selection.set",stage:"effect",detail:`the design board selected portable story ${o}`,run:()=>r.set([o])})}let K=!1;async function Vt(){if(K)return;K=!0;const e=yt();if(!(e.width!==null||e.height!==null))try{const o=await gt("vgai.project.json");if(!o)return;const r=JSON.parse(o),n=r.resolution?.width,s=r.resolution?.height;if(typeof n!="number"||typeof s!="number"||n<64||s<64||n>4096||s>4096)return;wt(n,s)}catch{}}function Wt(){const e=Tt({fixedTimestep:.016666666666666666,maxSubSteps:8,update:()=>{}});return kt({loop:e,assets:Ft()})}function Dt(e,o){return{id:e,surface:"dom",description:void 0,adapter:{type:"builtin",identity:"dom",surface:"dom"},entry:o,zOrder:0,pausable:!0,loop:"gated"}}async function Gt(e,o){try{const r=await It(o,ht());return{ok:!0,Entry:await Rt(e,r)}}catch(r){return{ok:!1,error:r}}}async function Oe(e,o,r){const{projectRootPath:n,store:s,activationDocumentId:u}=r;E?E=!1:await mt({rootPath:n});const c=ut(),i=Et(c),y=e.path,p=y?await Gt(Dt(e.worldId,y),n):{ok:!1,error:new Error(`design-time react layer "${e.worldId}": no \`entry\` declared — nothing to mount.`)},d=p.ok?dt(p.Entry):void 0,Z=d?ct(d,e.path):null,B=i.find(g=>g.id===Z?.id)??null;if(i.length>0){const g=st(n,e.worldId),P=i.find(t=>t.id===g)??B??i[0];e.path&&!B&&x.warn(`[design-time-layers] React root "${e.worldId}" has no story naming its entry component${d?` "${d}"`:""} — the board opens on "${P.label}". Give a *.stories.tsx a \`meta.component\` of this root's entry component to choose its default preview.`,"authoring");let T=!1,M=null,k=null;const A=new Map,G=Ct(i);await Vt();const l=bt(o,i.map(t=>({id:t.id,label:t.label,modulePath:t.modulePath,...t.title?{title:t.title}:{},parameters:t.parameters,...t.globals?{globals:t.globals}:{},...t.viewportLocked!==void 0?{viewportLocked:t.viewportLocked}:{}})),P.id,(t,m)=>{k=m,Bt(M,t)},xt(i,G)),_=t=>{if(T)return;const m=l.frames.get(t.id);if(!m)return;if(t.parameters?.layout==="fullscreen"){l.setMeasuredFrame(t.id,null);return}const a={width:m.content.offsetWidth,height:m.content.offsetHeight},h=a.width>0?jt(m.content):null;if(!h){l.setMeasuredFrame(t.id,null);return}const C=8,S=48;let b=Math.max(0,h.x-C),w=Math.max(0,h.y-C),I=Math.min(a.width,h.x+h.width+C),R=Math.min(a.height,h.y+h.height+C);if(I-b<S){const $=(S-(I-b))/2;b=Math.max(0,b-$),I=Math.min(a.width,b+S)}if(R-w<S){const $=(S-(R-w))/2;w=Math.max(0,w-$),R=Math.min(a.height,w+S)}if(I-b>=a.width*.9&&R-w>=a.height*.9){l.setMeasuredFrame(t.id,null);return}l.setMeasuredFrame(t.id,{frame:{width:Math.round(I-b),height:Math.round(R-w)},mount:a,offset:{x:Math.round(b),y:Math.round(w)}})},it=t=>{setTimeout(()=>_(t),0),setTimeout(()=>_(t),1e3)},L=async(t,m=t.args)=>{const f=l.frames.get(t.id)?.content;if(f){try{const a=await Mt(f,t.modulePath,t.name,t.Component,m);if(!a)return;if(T){a.unmount();return}A.set(t.id,a),l.clearError(t.id),it(t)}catch(a){const h=U(a);l.setError(t.id,h),x.error(`[design-time-layers] React root "${e.worldId}" failed mounting portable story "${t.name}": ${h}`,"authoring")}s.notifyIngestEdit()}};await Promise.all(i.map(t=>L(t))),l.setNote(pt().note),g&&l.activate(P.id,!0);const O=new Map(i.map(t=>[t.id,t])),at={tagName:"DIV",get children(){return l.activeContent().children},getAttribute:t=>o.getAttribute(t),getBoundingClientRect:()=>o.getBoundingClientRect(),get style(){return o.style},get textContent(){return l.activeContent().textContent}},q=await Y();return M=new J(at,s,{...q?{writeBackend:q}:{},designTokens:()=>{const t=l.activeContent(),m=t.closest?.("[data-vgai-game-styles]")??t.querySelector?.("[data-vgai-game-styles]")??t;return Nt(getComputedStyle(m))},assetRoot:o,portableStories:i.map(t=>({id:t.id,label:t.label,args:t.args,name:t.name,modulePath:t.modulePath})),portableHierarchy:G,activePortableStoryId:P.id,onPortableStoryApplied:t=>{const m=(t?O.get(t):null)??P;lt(n,e.worldId,m.id);const f=k;k=null,l.activate(m.id,f===null||f==="zoom")},onPortableStoryArgsChanged:(t,m)=>{const f=O.get(t);f&&L(f,m).catch(a=>{x.error(`[design-time-layers] React root "${e.worldId}" failed updating portable story "${f.name}" args: ${U(a)}`,"authoring")})}}),u&&requestAnimationFrame(()=>X(u)),{adapter:M,dispose:()=>{T=!0,M.disposeReactRootAdapter();for(const t of A.values())t.unmount();A.clear(),l.dispose()}}}if(!p.ok)throw p.error instanceof Error?p.error:new Error(String(p.error));x.warn(`[design-time-layers] React root "${e.worldId}" has no portable CSF preview — the project declares no UI stories. Add a *.stories.tsx; give it a \`meta.component\` of this root's entry component${d?` (${d}, ${e.path})`:""} to make it this root’s default preview. Falling back to the inert-Game preview.`,"authoring");const tt=p.Entry,et=await vt(),{createElement:N,createRoot:ot,flushSync:rt}=await Pt(),V=Wt(),F=ot(o),nt=g=>{F.render(N(St,{key:"__entry__",onCaught:g,children:N(et,{game:V},N(tt))}))};let v=null;if(rt(()=>{nt(g=>{v=g})}),v!==null)throw F.unmount(),v instanceof Error?v:new Error(String(v));const W=await Y(),D=new J(o,s,{...W?{writeBackend:W}:{}});return u&&requestAnimationFrame(()=>X(u)),{adapter:D,dispose:()=>{D.disposeReactRootAdapter(),F.unmount(),V.dispose()}}}function Q(){return j().map(e=>e.ok?e.stories.map(o=>o.id).join(","):`!${e.modulePath}`).join("|")}function qe(e){let o=z()?j():null,r=o===null?null:Q(),n=null;const s=ft(()=>{if(!z())return;const u=j(),c=Q();if(o===null){o=u,r=c;return}const i=c!==r;o=u,r=c,i&&(n!==null&&clearTimeout(n),n=setTimeout(()=>{n=null,E=!0,e(),setTimeout(()=>{E=!1},0)},250))});return()=>{n!==null&&clearTimeout(n),n=null,s()}}export{Oe as mountReactDesignLayer,qe as reprojectWhenStoriesRepublish};
@@ -1 +1 @@
1
- import{V as l,Q as v}from"./three.module-D396a9Mn.js";const Q=new v,h=new l,c=new l,j=new l,w=[[-1,-1],[-1,1],[1,-1],[1,1]];function N(t,a){return j.set(0,0,-a).applyMatrix4(t.projectionMatrix).z}function b(t,a,u,r){const s=t,x=typeof s.near=="number"?s.near:0,_=typeof s.far=="number"?s.far:u;let i=Math.min(u,_);i=Math.max(i,x+.001);const m=Math.min(x,i),y=N(t,m),M=N(t,i);c.set(0,0,0);for(const f of[y,M])for(const[p,d]of w)c.add(h.set(p,d,f).applyMatrix4(t.projectionMatrixInverse));c.multiplyScalar(1/8);let e=0;for(const f of[y,M])for(const[p,d]of w)e=Math.max(e,h.set(p,d,f).applyMatrix4(t.projectionMatrixInverse).distanceTo(c));r>2&&(e*=r/(r-2));const n=c.clone().applyMatrix4(t.matrixWorld),o=r>0?2*e/r:0;return o>0&&(n.applyQuaternion(Q.copy(a).invert()),n.x=Math.round(n.x/o)*o,n.y=Math.round(n.y/o)*o,n.applyQuaternion(a)),{center:n,radius:e,texelWorldSize:o}}export{b as fitDirectionalShadowToCamera};
1
+ import{V as l,Q as v}from"./three.module-IFn-4i31.js";const Q=new v,h=new l,c=new l,j=new l,w=[[-1,-1],[-1,1],[1,-1],[1,1]];function N(t,a){return j.set(0,0,-a).applyMatrix4(t.projectionMatrix).z}function b(t,a,u,r){const s=t,x=typeof s.near=="number"?s.near:0,_=typeof s.far=="number"?s.far:u;let i=Math.min(u,_);i=Math.max(i,x+.001);const m=Math.min(x,i),y=N(t,m),M=N(t,i);c.set(0,0,0);for(const f of[y,M])for(const[p,d]of w)c.add(h.set(p,d,f).applyMatrix4(t.projectionMatrixInverse));c.multiplyScalar(1/8);let e=0;for(const f of[y,M])for(const[p,d]of w)e=Math.max(e,h.set(p,d,f).applyMatrix4(t.projectionMatrixInverse).distanceTo(c));r>2&&(e*=r/(r-2));const n=c.clone().applyMatrix4(t.matrixWorld),o=r>0?2*e/r:0;return o>0&&(n.applyQuaternion(Q.copy(a).invert()),n.x=Math.round(n.x/o)*o,n.y=Math.round(n.y/o)*o,n.applyQuaternion(a)),{center:n,radius:e,texelWorldSize:o}}export{b as fitDirectionalShadowToCamera};
@@ -1 +1 @@
1
- import{dd as g,aH as u,de as x}from"./index-GIL7oGEO.js";import{W as w,j as C,v as y,x as d,V as m,s as M,r as v}from"./three.module-D396a9Mn.js";import{f as S}from"./scene-framing-Cat0GtyJ.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";function W(n){const a=[];return n.traverse(t=>{!u(t)&&t.isCamera&&a.push(t)}),a}function R(n,a){const t=[];n.traverse(r=>{r.parent&&u(r)&&t.push({object:r,parent:r.parent})});for(const{object:r}of t)r.removeFromParent();let e;try{e=x(n)}finally{for(const{object:r,parent:h}of t)h.add(r)}const o=e.filter(r=>!r.overlay&&!r.enclosure),c=S(o.map(r=>r.box)),i=new d(42,a,.01,1e5),f=c.isEmpty()?new m:c.getCenter(new m),s=c.isEmpty()?1:Math.max(.01,c.getBoundingSphere(new M).radius),p=s/Math.sin(v.degToRad(i.fov/2));return i.position.copy(f).addScaledVector(new m(1,.75,1).normalize(),p*1.15),i.lookAt(f),i.near=Math.max(.001,p-s*2.5),i.far=p+s*3,i.updateProjectionMatrix(),i.updateMatrixWorld(!0),i}function P(n,a){if(a.camera){const e=new d(a.camera.fov??42,a.width/a.height,.01,1e5);return e.position.set(a.camera.position.x,a.camera.position.y,a.camera.position.z),e.lookAt(a.camera.target.x,a.camera.target.y,a.camera.target.z),e.updateMatrixWorld(!0),e}const t=W(n);if(t.length===1){const e=t[0].clone();return e.matrixWorld.copy(t[0].matrixWorld),e.matrixWorld.decompose(e.position,e.quaternion,e.scale),e instanceof d&&(e.aspect=a.width/a.height,e.updateProjectionMatrix()),e}return R(n,a.width/a.height)}function G(n,a,t,e){a.updateMatrixWorld(!0);const l=P(n,t),o=g(new w({antialias:!0,alpha:!0,preserveDrawingBuffer:!0}));let c;try{return c=e?.(o),o.setPixelRatio(1),o.setSize(t.width,t.height,!1),o.outputColorSpace=C,o.toneMapping=y,o.setClearColor(2106411,a.background===null?0:1),o.render(a,l),o.domElement.toDataURL("image/png")}finally{c?.(),o.dispose(),o.forceContextLoss()}}export{G as captureAuthoredThreeScenePreview};
1
+ import{dZ as g,aJ as u,d_ as x}from"./index-Ckxb31Yz.js";import{W as w,r as C,s as y,u as d,V as m,p as M,o as v}from"./three.module-IFn-4i31.js";import{f as S}from"./scene-framing-50N7SKuX.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";function W(n){const a=[];return n.traverse(t=>{!u(t)&&t.isCamera&&a.push(t)}),a}function R(n,a){const t=[];n.traverse(r=>{r.parent&&u(r)&&t.push({object:r,parent:r.parent})});for(const{object:r}of t)r.removeFromParent();let e;try{e=x(n)}finally{for(const{object:r,parent:h}of t)h.add(r)}const o=e.filter(r=>!r.overlay&&!r.enclosure),c=S(o.map(r=>r.box)),i=new d(42,a,.01,1e5),f=c.isEmpty()?new m:c.getCenter(new m),s=c.isEmpty()?1:Math.max(.01,c.getBoundingSphere(new M).radius),p=s/Math.sin(v.degToRad(i.fov/2));return i.position.copy(f).addScaledVector(new m(1,.75,1).normalize(),p*1.15),i.lookAt(f),i.near=Math.max(.001,p-s*2.5),i.far=p+s*3,i.updateProjectionMatrix(),i.updateMatrixWorld(!0),i}function P(n,a){if(a.camera){const e=new d(a.camera.fov??42,a.width/a.height,.01,1e5);return e.position.set(a.camera.position.x,a.camera.position.y,a.camera.position.z),e.lookAt(a.camera.target.x,a.camera.target.y,a.camera.target.z),e.updateMatrixWorld(!0),e}const t=W(n);if(t.length===1){const e=t[0].clone();return e.matrixWorld.copy(t[0].matrixWorld),e.matrixWorld.decompose(e.position,e.quaternion,e.scale),e instanceof d&&(e.aspect=a.width/a.height,e.updateProjectionMatrix()),e}return R(n,a.width/a.height)}function G(n,a,t,e){a.updateMatrixWorld(!0);const l=P(n,t),o=g(new w({antialias:!0,alpha:!0,preserveDrawingBuffer:!0}));let c;try{return c=e?.(o),o.setPixelRatio(1),o.setSize(t.width,t.height,!1),o.outputColorSpace=C,o.toneMapping=y,o.setClearColor(2106411,a.background===null?0:1),o.render(a,l),o.domElement.toDataURL("image/png")}finally{c?.(),o.dispose(),o.forceContextLoss()}}export{G as captureAuthoredThreeScenePreview};
@@ -1 +1 @@
1
- import{aA as y,aB as v}from"./index-GIL7oGEO.js";import{J as R,c as x}from"./json-history-resource-BbxllWfV.js";import{D as C,s as w,a as b,c as k,m as T}from"./react-world-authoring-adapter-DmrwM3py.js";import{g as h,b as u}from"./inspect-BZfi3mmo.js";function H(a){const e=(typeof a=="string"?a:a?.baseVal)?.trim()??"";if(e)return e.split(/\s+/)[0]}function S(a,t){if(a.id)return`${t}#${a.id}`;const e=H(a.className??"");return e?`${t}.${e}`:t}function j(a){const t=new Map;for(const[e,s]of a.nodes)t.set(e,{id:e,tag:s.object.tagName.toLowerCase(),el:s.object,parentId:s.parentId,childIds:[...s.childIds]});return{nodes:t,rootIds:[...a.rootIds]}}const g=[{prop:"color",label:"Color",type:"color"},{prop:"backgroundColor",label:"Background",type:"color"},{prop:"borderColor",label:"Border Color",type:"color"},{prop:"fontSize",label:"Font Size",type:"number"},{prop:"width",label:"Width",type:"number"},{prop:"height",label:"Height",type:"number"},{prop:"padding",label:"Padding",type:"number"},{prop:"margin",label:"Margin",type:"number"},{prop:"borderRadius",label:"Border Radius",type:"number"},{prop:"gap",label:"Gap",type:"number"},{prop:"display",label:"Display",type:"enum",options:["flex","block","none","grid"]},{prop:"textAlign",label:"Text Align",type:"enum",options:["left","center","right"]},{prop:"flexDirection",label:"Flex Direction",type:"enum",options:["row","column"]}],f="style.",M=new Map(g.map(({prop:a,type:t})=>[a,t]));class A{constructor(t,e,s){this.root=t,this.store=e;const o=e.projectHistory;this.historyResource=o?new R({history:o,kind:"session-state",scope:"session",subject:{...s.journal,id:`${s.journal.id}/react-dom-edits`},displayName:"React DOM edits",capture:()=>this.captureHistoryState(),restore:async i=>{this.restoreHistoryState(i)}}):null}capabilities={transform:!1,inspectorFields:!0,persist:!1};provenance={source:"foreign",label:"live-only",detail:"Unmodified ingested React game — style edits apply for this session only and are never saved."};doc={};historyResource;projector=new C(w());snapCache=null;snapInvalidationScheduled=!1;boxEditSession=null;lockedIds=new Set;snapshot(){if(this.snapCache)return this.snapCache;this.projector.project(this.root);const t=j(this.projector);return this.snapCache=t,this.snapInvalidationScheduled||(this.snapInvalidationScheduled=!0,queueMicrotask(()=>{this.snapCache=null,this.snapInvalidationScheduled=!1})),t}nodeCount(){return this.snapshot().nodes.size}toEditorNode(t){return{id:t.id,label:S(t.el,t.tag),role:"element",kind:t.tag,parentId:t.parentId,childIds:t.childIds}}applyStyleToElement(t,e,s){t.style&&(t.style[e]=s)}recordStyleEdit(t,e,s){const o=this.doc[t]??{};o[e]=s,this.doc[t]=o}hierarchy={roots:()=>{const{nodes:t,rootIds:e}=this.snapshot();return e.map(s=>this.toEditorNode(t.get(s)))},node:t=>{const e=this.snapshot().nodes.get(t);return e?this.toEditorNode(e):null}};selection={get:()=>[...this.store.selectedEntityIds],set:t=>this.store.selectMultiple(t)};pickable={pick:(t,e)=>{const{nodes:s}=this.snapshot();let o=null,i=Number.POSITIVE_INFINITY,r=-1,l=-1;for(const c of s.values()){if(l++,this.lockedIds.has(c.id)||c.el.style?.pointerEvents==="none")continue;const n=c.el.getBoundingClientRect?.();if(!n||t<n.left||t>n.right||e<n.top||e>n.bottom)continue;const p=n.width*n.height;(p<i||p===i&&l>r)&&(o=c.id,i=p,r=l)}return o}};hostRect(){const t=this.root.getBoundingClientRect?.();return{left:t?.left??0,top:t?.top??0}}toHostRelative(t){const e=this.hostRect();return{x:t.left-e.left,y:t.top-e.top,width:t.width,height:t.height}}rects={rect:t=>{const s=this.snapshot().nodes.get(t)?.el.getBoundingClientRect?.();return s?this.toHostRelative(s):null},contextRects:t=>{const{nodes:e}=this.snapshot(),s=e.get(t);if(!s)return{};const o=s.parentId?e.get(s.parentId):void 0,i=o?.el.getBoundingClientRect?.(),l=(o?o.childIds:this.snapshot().rootIds).filter(d=>d!==t).map(d=>e.get(d)?.el.getBoundingClientRect?.()).filter(d=>d!=null).map(d=>this.toHostRelative(d)),c=s.el,n=c.getBoundingClientRect?.();let p;if(n){const d=y(h(c,"borderTopWidth",u))??0,I=y(h(c,"borderRightWidth",u))??0,E=y(h(c,"borderBottomWidth",u))??0,m=y(h(c,"borderLeftWidth",u))??0;p=this.toHostRelative({left:n.left+m,top:n.top+d,width:Math.max(0,n.width-m-I),height:Math.max(0,n.height-d-E)})}return{...i?{parent:this.toHostRelative(i)}:{},...l.length?{siblings:l}:{},...p?{paddingBox:p}:{}}}};colorSample={backgroundChainAt:(t,e)=>{const s=this.pickable.pick(t,e);if(!s)return null;const{nodes:o}=this.snapshot(),i=[];let r=o.get(s);for(;r;)i.push(h(r.el,"backgroundColor",u)),r=r.parentId?o.get(r.parentId):void 0;return i}};boxEdit={begin:t=>{this.historyResource?.assertCanMutate(),this.boxEditSession={id:t,touched:new Map,priorInline:new Map}},apply:(t,e)=>{this.historyResource?.assertCanMutate();const s=this.boxEditSession;if(!s||s.id!==t)return;const o=this.snapshot().nodes.get(t);if(!o)return;const i=h(o.el,"position",u),r=i==="absolute"||i==="fixed";for(const[l,c]of Object.entries(e)){const n=T(l,r);if(!n){console.warn(`[DomAuthoringAdapter] boxEdit: dropping patch key "${l}" for "${t}" — `+(l==="x"||l==="y"?`node is not absolutely/fixed positioned (computed position: "${i}"), no left/top to move`:"unrecognized box-edit patch key"));continue}if(!s.priorInline.has(n.prop)){const d=b(o.el.style,n.prop);s.priorInline.set(n.prop,d==null?"":String(d))}const p=n.cssValue(c);this.applyStyleToElement(o.el,n.prop,p),s.touched.set(n.prop,p)}},end:t=>{const e=this.boxEditSession;this.boxEditSession=null,!(!e||e.id!==t||e.touched.size===0)&&this.commitBoxEdit(t,e.touched,e.priorInline)}};commitBoxEdit(t,e,s){this.historyResource?.assertCanMutate();const o=this.captureHistoryState(),i=o.styles[t]??{};o.styles[t]=i;for(const[l,c]of s)i[l]=c;let r=!1;for(const[l,c]of e)r=this.writeStyleEntry(t,l,c)||r;r&&this.historyResource&&this.historyResource.record(`Edit ${e.size} Styles`,o,this.captureHistoryState()).catch(()=>{})}inspector={properties:()=>g.map(({prop:t,label:e,type:s,options:o})=>({path:`${f}${t}`,label:e,type:s,...o?{options:o}:{}})),get:(t,e)=>{if(e==="locked")return this.lockedIds.has(t);if(e==="visible"){const l=this.snapshot().nodes.get(t);return l?b(l.el.style,"visibility")!=="hidden":void 0}if(!e.startsWith(f))return;const s=e.slice(f.length),o=this.snapshot().nodes.get(t);if(!o)return;const i=b(o.el.style,s),r=M.get(s);return r==="number"?y(i):r==="color"?k(i):i},set:(t,e,s)=>{if(e==="locked"){s?this.lockedIds.add(t):this.lockedIds.delete(t),this.store.notifyIngestEdit();return}if(e==="visible"){this.writeStyle(t,"visibility",s?"visible":"hidden");return}if(!e.startsWith(f))return;const o=e.slice(f.length);this.writeStyle(t,o,String(s))}};assetSubject={get:t=>this.assetSubjectForNode(this.snapshot(),t),entries:()=>{const t=this.snapshot();return[...t.nodes.keys()].flatMap(e=>{const s=this.assetSubjectForNode(t,e);return s?[{id:e,subject:s}]:[]})}};assetSubjectForNode(t,e){const s=t.nodes.get(e);return!s||s.tag!=="svg"||!s.el.outerHTML?null:{kind:"image",name:S(s.el,s.tag),mediaType:"image/svg+xml",text:s.el.outerHTML}}writeStyleEntry(t,e,s){const o=this.snapshot().nodes.get(t);return o?(this.applyStyleToElement(o.el,e,s),this.recordStyleEdit(t,e,s),this.store.notifyIngestEdit(),!0):!1}writeStyle(t,e,s){this.historyResource?.assertCanMutate();const o=this.captureHistoryState();this.writeStyleEntry(t,e,s)&&this.historyResource&&this.historyResource.record(`Set ${e}`,o,this.captureHistoryState()).catch(()=>{})}dispose(){this.historyResource?.dispose()}captureHistoryState(){const t={};for(const[e,s]of this.snapshot().nodes){const o={};for(const{prop:i}of g){const r=b(s.el.style,i);r!==""&&(o[i]=String(r))}t[e]=o}return{edits:structuredClone(this.doc),styles:t}}restoreHistoryState(t){for(const s of Object.keys(this.doc))delete this.doc[s];Object.assign(this.doc,structuredClone(t.edits));const{nodes:e}=this.snapshot();for(const[s,o]of e){const i=t.styles[s]??{};for(const{prop:r}of g)this.applyStyleToElement(o.el,r,i[r]??"")}this.store.notifyIngestEdit()}subscribe(t){return this.store.subscribe(t)}get persistence(){return{...x(),destination:v}}}export{A as D};
1
+ import{aB as y,aC as v}from"./index-Ckxb31Yz.js";import{J as R,c as C}from"./json-history-resource-r-9q_hxP.js";import{D as x,s as w,a as b,c as k,m as T}from"./react-world-authoring-adapter-BMT9kLWU.js";import{g as h,b as u}from"./inspect-BRgDdtVk.js";function H(a){const e=(typeof a=="string"?a:a?.baseVal)?.trim()??"";if(e)return e.split(/\s+/)[0]}function S(a,t){if(a.id)return`${t}#${a.id}`;const e=H(a.className??"");return e?`${t}.${e}`:t}function j(a){const t=new Map;for(const[e,s]of a.nodes)t.set(e,{id:e,tag:s.object.tagName.toLowerCase(),el:s.object,parentId:s.parentId,childIds:[...s.childIds]});return{nodes:t,rootIds:[...a.rootIds]}}const g=[{prop:"color",label:"Color",type:"color"},{prop:"backgroundColor",label:"Background",type:"color"},{prop:"borderColor",label:"Border Color",type:"color"},{prop:"fontSize",label:"Font Size",type:"number"},{prop:"width",label:"Width",type:"number"},{prop:"height",label:"Height",type:"number"},{prop:"padding",label:"Padding",type:"number"},{prop:"margin",label:"Margin",type:"number"},{prop:"borderRadius",label:"Border Radius",type:"number"},{prop:"gap",label:"Gap",type:"number"},{prop:"display",label:"Display",type:"enum",options:["flex","block","none","grid"]},{prop:"textAlign",label:"Text Align",type:"enum",options:["left","center","right"]},{prop:"flexDirection",label:"Flex Direction",type:"enum",options:["row","column"]}],f="style.",M=new Map(g.map(({prop:a,type:t})=>[a,t]));class D{constructor(t,e,s){this.root=t,this.store=e;const o=e.projectHistory;this.historyResource=o?new R({history:o,kind:"session-state",scope:"session",subject:{...s.journal,id:`${s.journal.id}/react-dom-edits`},displayName:"React DOM edits",capture:()=>this.captureHistoryState(),restore:async i=>{this.restoreHistoryState(i)}}):null}capabilities={transform:!1,inspectorFields:!0,persist:!1};provenance={source:"foreign",label:"live-only",detail:"Unmodified ingested React game — style edits apply for this session only and are never saved."};doc={};historyResource;projector=new x(w());snapCache=null;snapInvalidationScheduled=!1;boxEditSession=null;lockedIds=new Set;snapshot(){if(this.snapCache)return this.snapCache;this.projector.project(this.root);const t=j(this.projector);return this.snapCache=t,this.snapInvalidationScheduled||(this.snapInvalidationScheduled=!0,queueMicrotask(()=>{this.snapCache=null,this.snapInvalidationScheduled=!1})),t}nodeCount(){return this.snapshot().nodes.size}toEditorNode(t){return{id:t.id,label:S(t.el,t.tag),role:"element",kind:t.tag,parentId:t.parentId,childIds:t.childIds}}applyStyleToElement(t,e,s){t.style&&(t.style[e]=s)}recordStyleEdit(t,e,s){const o=this.doc[t]??{};o[e]=s,this.doc[t]=o}hierarchy={roots:()=>{const{nodes:t,rootIds:e}=this.snapshot();return e.map(s=>this.toEditorNode(t.get(s)))},node:t=>{const e=this.snapshot().nodes.get(t);return e?this.toEditorNode(e):null}};selection={get:()=>[...this.store.selectedEntityIds],set:t=>this.store.selectMultiple(t)};pickable={pick:(t,e)=>{const{nodes:s}=this.snapshot();let o=null,i=Number.POSITIVE_INFINITY,r=-1,l=-1;for(const c of s.values()){if(l++,this.lockedIds.has(c.id)||c.el.style?.pointerEvents==="none")continue;const n=c.el.getBoundingClientRect?.();if(!n||t<n.left||t>n.right||e<n.top||e>n.bottom)continue;const p=n.width*n.height;(p<i||p===i&&l>r)&&(o=c.id,i=p,r=l)}return o}};hostRect(){const t=this.root.getBoundingClientRect?.();return{left:t?.left??0,top:t?.top??0}}toHostRelative(t){const e=this.hostRect();return{x:t.left-e.left,y:t.top-e.top,width:t.width,height:t.height}}rects={rect:t=>{const s=this.snapshot().nodes.get(t)?.el.getBoundingClientRect?.();return s?this.toHostRelative(s):null},contextRects:t=>{const{nodes:e}=this.snapshot(),s=e.get(t);if(!s)return{};const o=s.parentId?e.get(s.parentId):void 0,i=o?.el.getBoundingClientRect?.(),l=(o?o.childIds:this.snapshot().rootIds).filter(d=>d!==t).map(d=>e.get(d)?.el.getBoundingClientRect?.()).filter(d=>d!=null).map(d=>this.toHostRelative(d)),c=s.el,n=c.getBoundingClientRect?.();let p;if(n){const d=y(h(c,"borderTopWidth",u))??0,I=y(h(c,"borderRightWidth",u))??0,E=y(h(c,"borderBottomWidth",u))??0,m=y(h(c,"borderLeftWidth",u))??0;p=this.toHostRelative({left:n.left+m,top:n.top+d,width:Math.max(0,n.width-m-I),height:Math.max(0,n.height-d-E)})}return{...i?{parent:this.toHostRelative(i)}:{},...l.length?{siblings:l}:{},...p?{paddingBox:p}:{}}}};colorSample={backgroundChainAt:(t,e)=>{const s=this.pickable.pick(t,e);if(!s)return null;const{nodes:o}=this.snapshot(),i=[];let r=o.get(s);for(;r;)i.push(h(r.el,"backgroundColor",u)),r=r.parentId?o.get(r.parentId):void 0;return i}};boxEdit={begin:t=>{this.historyResource?.assertCanMutate(),this.boxEditSession={id:t,touched:new Map,priorInline:new Map}},apply:(t,e)=>{this.historyResource?.assertCanMutate();const s=this.boxEditSession;if(!s||s.id!==t)return;const o=this.snapshot().nodes.get(t);if(!o)return;const i=h(o.el,"position",u),r=i==="absolute"||i==="fixed";for(const[l,c]of Object.entries(e)){const n=T(l,r);if(!n){console.warn(`[DomAuthoringAdapter] boxEdit: dropping patch key "${l}" for "${t}" — `+(l==="x"||l==="y"?`node is not absolutely/fixed positioned (computed position: "${i}"), no left/top to move`:"unrecognized box-edit patch key"));continue}if(!s.priorInline.has(n.prop)){const d=b(o.el.style,n.prop);s.priorInline.set(n.prop,d==null?"":String(d))}const p=n.cssValue(c);this.applyStyleToElement(o.el,n.prop,p),s.touched.set(n.prop,p)}},end:t=>{const e=this.boxEditSession;this.boxEditSession=null,!(!e||e.id!==t||e.touched.size===0)&&this.commitBoxEdit(t,e.touched,e.priorInline)}};commitBoxEdit(t,e,s){this.historyResource?.assertCanMutate();const o=this.captureHistoryState(),i=o.styles[t]??{};o.styles[t]=i;for(const[l,c]of s)i[l]=c;let r=!1;for(const[l,c]of e)r=this.writeStyleEntry(t,l,c)||r;r&&this.historyResource&&this.historyResource.record(`Edit ${e.size} Styles`,o,this.captureHistoryState()).catch(()=>{})}inspector={properties:()=>g.map(({prop:t,label:e,type:s,options:o})=>({path:`${f}${t}`,label:e,type:s,...o?{options:o}:{}})),get:(t,e)=>{if(e==="locked")return this.lockedIds.has(t);if(e==="visible"){const l=this.snapshot().nodes.get(t);return l?b(l.el.style,"visibility")!=="hidden":void 0}if(!e.startsWith(f))return;const s=e.slice(f.length),o=this.snapshot().nodes.get(t);if(!o)return;const i=b(o.el.style,s),r=M.get(s);return r==="number"?y(i):r==="color"?k(i):i},set:(t,e,s)=>{if(e==="locked"){s?this.lockedIds.add(t):this.lockedIds.delete(t),this.store.notifyIngestEdit();return}if(e==="visible"){this.writeStyle(t,"visibility",s?"visible":"hidden");return}if(!e.startsWith(f))return;const o=e.slice(f.length);this.writeStyle(t,o,String(s))}};assetSubject={get:t=>this.assetSubjectForNode(this.snapshot(),t),entries:()=>{const t=this.snapshot();return[...t.nodes.keys()].flatMap(e=>{const s=this.assetSubjectForNode(t,e);return s?[{id:e,subject:s}]:[]})}};assetSubjectForNode(t,e){const s=t.nodes.get(e);return!s||s.tag!=="svg"||!s.el.outerHTML?null:{kind:"image",name:S(s.el,s.tag),mediaType:"image/svg+xml",text:s.el.outerHTML}}writeStyleEntry(t,e,s){const o=this.snapshot().nodes.get(t);return o?(this.applyStyleToElement(o.el,e,s),this.recordStyleEdit(t,e,s),this.store.notifyIngestEdit(),!0):!1}writeStyle(t,e,s){this.historyResource?.assertCanMutate();const o=this.captureHistoryState();this.writeStyleEntry(t,e,s)&&this.historyResource&&this.historyResource.record(`Set ${e}`,o,this.captureHistoryState()).catch(()=>{})}dispose(){this.historyResource?.dispose()}captureHistoryState(){const t={};for(const[e,s]of this.snapshot().nodes){const o={};for(const{prop:i}of g){const r=b(s.el.style,i);r!==""&&(o[i]=String(r))}t[e]=o}return{edits:structuredClone(this.doc),styles:t}}restoreHistoryState(t){for(const s of Object.keys(this.doc))delete this.doc[s];Object.assign(this.doc,structuredClone(t.edits));const{nodes:e}=this.snapshot();for(const[s,o]of e){const i=t.styles[s]??{};for(const{prop:r}of g)this.applyStyleToElement(o.el,r,i[r]??"")}this.store.notifyIngestEdit()}subscribe(t){return this.store.subscribe(t)}get persistence(){return{...C(),destination:v}}}export{D};