@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,4 +1,4 @@
1
- import{a as Uu}from"./jsx-runtime-DPjLkJKQ.js";import{x as Vy,m as oy}from"./index-bQE2NA0D.js";import{td as pa,c8 as Hu,te as gy,tf as by,tg as Ef,gy as cm}from"./index-GIL7oGEO.js";import{r as Wl}from"./index-nmcBqr7Y.js";import{g as Jy}from"./_commonjsHelpers-D6-XlEtG.js";import{r as xy}from"./index-D_NuPfjr.js";var mf={exports:{}},_t={};/**
1
+ import{a as Uu}from"./jsx-runtime-DPjLkJKQ.js";import{x as Vy,m as oy}from"./index-bQE2NA0D.js";import{b as pa,C as Hu,G as gy,c as by,T as Ef,e as cm}from"./index-BLo2LE8C.js";import{r as Wl}from"./index-nmcBqr7Y.js";import{g as Jy}from"./_commonjsHelpers-D6-XlEtG.js";import{r as xy}from"./index-D_NuPfjr.js";var mf={exports:{}},_t={};/**
2
2
  * @license React
3
3
  * react-reconciler-constants.production.js
4
4
  *
Binary file
@@ -0,0 +1 @@
1
+ import{fw as o,fx as s,aH as c,dW as u}from"./index-Ckxb31Yz.js";import{E as l,a as E,F as g,c as h}from"./instance-fork-actions-D3sRzS3K.js";function i(t,n){return o(t,n)}function F(t,n){const e=c(t);return E(e.hierarchy.node(n),i(e,n),n)}let r=null;function M(){r||(r=s(({nodeId:t,store:n})=>F(n,t),({nodeId:t,store:n})=>{const e=i(c(n),t);return[{label:l,action:()=>{e?.extractComponent?.(t).then(u)}}]}))}function k(){r?.(),r=null}function f(t,n){return o(t,n)}function x(t,n){const e=c(t);return h(e.hierarchy.node(n),f(e,n),n)}let a=null;function b(){a||(a=s(({nodeId:t,store:n})=>x(n,t),({nodeId:t,store:n})=>{const e=f(c(n),t);return[{label:g,action:()=>{e?.forkComponent?.(t).then(u)}}]}))}function A(){a?.(),a=null}export{i as a,b,A as c,M as e,f as i,k as u};
@@ -1 +1 @@
1
- import{r as b}from"./index-nmcBqr7Y.js";import{fS as _,fT as x,fU as B,fV as I,fW as R,fX as C,fY as $,fZ as P,f_ as A,aU as T}from"./index-GIL7oGEO.js";function z(){b.useSyncExternalStore(_,x,x),b.useSyncExternalStore(B,I,I),b.useSyncExternalStore(R,C,C);const t=T();return(t==="workspace:game"?$(P()):null)??A(t)}function K(t){return t?{capture:typeof t.captureFrame=="function",memory:typeof t.memorySnapshot=="function"}:null}class D{constructor(s=10){this.capacity=s}captures=[];selectedId=null;add(s){this.captures.push(s),this.captures.length>this.capacity&&this.captures.splice(0,this.captures.length-this.capacity),this.selectedId=s.id}get all(){return this.captures}select(s){this.captures.some(e=>e.id===s)&&(this.selectedId=s)}get selectedIdOrNull(){return this.selectedId}get selected(){return this.selectedId===null?null:this.captures.find(s=>s.id===this.selectedId)??null}clear(){this.captures=[],this.selectedId=null}}function Z(t){const s=new Map,e=[];for(const o of t.drawCalls){const r=o.target.kind==="canvas"?"canvas":o.target.label??"framebuffer";let n=s.get(r);n||(n=[],s.set(r,n),e.push(r)),n.push(o)}return e.map(o=>({target:o,draws:s.get(o)??[]}))}function q(t){const s=new Set;for(const e of t.drawCalls)s.add(e.target.kind==="canvas"?"canvas":e.target.label??"framebuffer");return{id:t.id,drawCalls:t.totals.drawCalls,unattributed:t.totals.unattributed,truncated:t.totals.truncated,targets:s.size}}function J(t,s){let e=Math.max(0,t.cpuMs);for(const a of t.phases)e=Math.max(e,(a.startMs??0)+a.ms);for(const a of t.systems)e=Math.max(e,a.startMs+a.ms);for(const a of t.components)e=Math.max(e,a.startMs+a.ms);const o=e>0?e:1,r=s/o,n=(a,l,u,p)=>({x:Math.max(0,a*r),w:Math.max(0,l*r),depth:u,label:p,ms:l}),c=[n(0,t.cpuMs,0,`frame ${t.id}`)];for(const a of t.phases)c.push(n(a.startMs??0,a.ms,1,a.name));for(const a of t.systems)c.push(n(a.startMs,a.ms,2,a.name));for(const a of t.components)c.push(n(a.startMs,a.ms,3,a.name));return c}function Q(t,s,e){if(t.length===0)return[];const o=Math.max(1,...t.map(n=>n.cpuMs)),r=s/t.length;return t.map((n,c)=>({index:c,frameId:n.id,x:c*r,w:r,h:Math.max(0,n.cpuMs/o*e),cpuMs:n.cpuMs}))}function tt(t){if(!Number.isFinite(t)||t<0)return"—";if(t<1024)return`${t} B`;const s=["KB","MB","GB","TB"];let e=t/1024,o=0;for(;e>=1024&&o<s.length-1;)e/=1024,o++;return`${e<10?e.toFixed(2):e.toFixed(1)} ${s[o]}`}function et(t,s){const e=Math.max(0,t),o=Math.max(0,e-Math.max(0,s));return{frameMs:e,gapMs:o,dominated:e>20&&o>e/2}}function U(t){const s=new Map;let e=0,o=0;for(const r of t){e+=r.duration;for(const n of r.scripts??[]){o+=n.duration;const c=n.sourceURL?n.sourceURL.split("/").slice(-2).join("/"):"",a=n.sourceFunctionName||n.invoker||"(anonymous)",l=c?`${a} @ ${c}`:a,u=s.get(l)??{totalMs:0,count:0};u.totalMs+=n.duration,u.count+=1,s.set(l,u)}}return{longFrameCount:t.length,totalLongMs:Math.round(e),unattributedMs:Math.round(Math.max(0,e-o)),scripts:[...s.entries()].map(([r,n])=>({key:r,totalMs:Math.round(n.totalMs),count:n.count})).sort((r,n)=>n.totalMs-r.totalMs).slice(0,8)}}const N=5,L=20;function G(t,s,e){const o=t.filter(i=>i.timestamp>=s&&i.intervalMs>0);if(o.length<N)return null;let r=0,n=0,c=0,a=0;for(const i of o)r+=i.intervalMs,n+=i.cpuMs,i.render.gpuMs!==null&&(c+=i.render.gpuMs,a++);const l=o.length,u=r/l,p=n/l,m=e!==null&&e.sampleCount>=L?Math.max(0,e.busyMs-n)/l:null;return{frames:l,fps:u>0?1e3/u:0,frameMs:u,loopMs:p,otherMainMs:m,pipelineMs:Math.max(0,u-p-(m??0)),gpuDrawMs:a>0?c/a:null}}const w=.05,v=3,W=4;function V(t,s){return t.filter(e=>e.timestamp>=s&&e.intervalMs>0)}function E(t,s){const e=new Map;for(const[r,n]of t)e.set(r,(e.get(r)??0)+n);const o=new Map;for(const[r,n]of e)o.set(r,n/s);return o}function H(t,s){const e=t.length,o=E(t.flatMap(l=>l.phases.map(u=>[u.name,u.ms])),e),r=E(t.flatMap(l=>l.systems.map(u=>[`${u.phase} ${u.name}`,u.ms])),e),n=[];let c=0;for(const[l,u]of[...o.entries()].sort((p,m)=>m[1]-p[1])){c+=u,n.push({label:l,depth:2,ms:u});const p=[...r.entries()].filter(([i])=>i.startsWith(`${l} `)).map(([i,f])=>{const S=i.slice(l.length+1);return[S.split(" / ").at(-1)??S,f]}).sort((i,f)=>f[1]-i[1]);for(const[i,f]of p.slice(0,v))n.push({label:i,depth:3,ms:f});const m=p.slice(v);m.length>0&&n.push({label:`${m.length} more system${m.length===1?"":"s"}`,depth:3,ms:m.reduce((i,[,f])=>i+f,0)})}const a=s-c;return a>w&&n.push({label:"outside the phases",depth:2,ms:a}),n}function O(t,s,e,o){if(t===null)return[];const r=U(s.filter(l=>(l.startTime??0)>=e)),n=[];let c=0;for(const l of r.scripts.slice(0,W)){const u=Math.min(l.totalMs/o,t-c);u<=w||(c+=u,n.push({label:l.key,depth:2,ms:u,note:"named by the browser (long frames)"}))}const a=t-c;return(a>w||n.length===0)&&n.push({label:"unattributed",depth:2,ms:Math.max(0,a),note:"below the browser's 50ms attribution threshold"}),n}function st(t,s,e,o){const r=G(t,s,e);if(r===null)return null;const n=V(t,s),c=[{label:"Frame interval",depth:0,ms:r.frameMs,note:`${r.frames} frames at ${r.fps.toFixed(0)} fps`},{label:"Scene loop (CPU)",depth:1,ms:r.loopMs},...H(n,r.loopMs),{label:"Other main thread",depth:1,ms:r.otherMainMs,note:r.otherMainMs===null?"not sampled yet":"React, timers, observers"},...O(r.otherMainMs,o,s,r.frames),{label:"Display pipeline",depth:1,ms:r.pipelineMs,note:"everything after the main thread — the remainder"}];return r.gpuDrawMs!==null&&(c.push({label:"viewport GPU draw",depth:2,ms:r.gpuDrawMs,note:"measured; runs in parallel with the CPU rows",parallel:!0}),c.push({label:"compositor + vsync wait",depth:2,ms:Math.max(0,r.pipelineMs-r.gpuDrawMs),note:"post-effects, glass chrome, waiting for the next frame slot"})),{rows:c,budget:r}}let M=new D,F=null,g=!1,h=null,k=0;const y=new Set;function d(){k++;for(const t of y)t()}function nt(t){return y.add(t),()=>y.delete(t)}function rt(){return k}function X(t){t!==F&&(F=t,M=new D,h=null,d())}function at(){return M}function ot(){return g}function ct(){return h}function ut(t){M.select(t),d()}function lt(){M.clear(),h=null,d()}async function it(t){if(!(!t||g)){X(t),g=!0,h=null,d();try{const s=await t.captureFrame();M.add(s)}catch(s){h=s instanceof Error?s.message:String(s)}finally{g=!1,d()}}}export{X as a,lt as b,it as c,K as d,q as e,rt as f,at as g,ut as h,ot as i,Z as j,Q as k,ct as l,J as m,tt as n,et as o,U as p,nt as s,st as t,z as u};
1
+ import{r as b}from"./index-nmcBqr7Y.js";import{gI as B,gJ as x,gK as P,gL as I,gM as R,gN as C,gO as _,gP as $,gQ as A,aQ as N}from"./index-Ckxb31Yz.js";function Q(){b.useSyncExternalStore(B,x,x),b.useSyncExternalStore(P,I,I),b.useSyncExternalStore(R,C,C);const t=N();return(t==="workspace:game"?_($()):null)??A(t)}function X(t){return t?{capture:typeof t.captureFrame=="function",memory:typeof t.memorySnapshot=="function"}:null}class D{constructor(s=10){this.capacity=s}captures=[];selectedId=null;add(s){this.captures.push(s),this.captures.length>this.capacity&&this.captures.splice(0,this.captures.length-this.capacity),this.selectedId=s.id}get all(){return this.captures}select(s){this.captures.some(e=>e.id===s)&&(this.selectedId=s)}get selectedIdOrNull(){return this.selectedId}get selected(){return this.selectedId===null?null:this.captures.find(s=>s.id===this.selectedId)??null}clear(){this.captures=[],this.selectedId=null}}function Y(t){const s=new Map,e=[];for(const o of t.drawCalls){const r=o.target.kind==="canvas"?"canvas":o.target.label??"framebuffer";let n=s.get(r);n||(n=[],s.set(r,n),e.push(r)),n.push(o)}return e.map(o=>({target:o,draws:s.get(o)??[]}))}function J(t){const s=new Set;for(const e of t.drawCalls)s.add(e.target.kind==="canvas"?"canvas":e.target.label??"framebuffer");return{id:t.id,drawCalls:t.totals.drawCalls,unattributed:t.totals.unattributed,truncated:t.totals.truncated,targets:s.size}}function q(t,s){let e=Math.max(0,t.cpuMs);for(const a of t.phases)e=Math.max(e,(a.startMs??0)+a.ms);for(const a of t.systems)e=Math.max(e,a.startMs+a.ms);for(const a of t.components)e=Math.max(e,a.startMs+a.ms);const o=e>0?e:1,r=s/o,n=(a,l,u,p)=>({x:Math.max(0,a*r),w:Math.max(0,l*r),depth:u,label:p,ms:l}),c=[n(0,t.cpuMs,0,`frame ${t.id}`)];for(const a of t.phases)c.push(n(a.startMs??0,a.ms,1,a.name));for(const a of t.systems)c.push(n(a.startMs,a.ms,2,a.name));for(const a of t.components)c.push(n(a.startMs,a.ms,3,a.name));return c}function Z(t,s,e){if(t.length===0)return[];const o=Math.max(1,...t.map(n=>n.cpuMs)),r=s/t.length;return t.map((n,c)=>({index:c,frameId:n.id,x:c*r,w:r,h:Math.max(0,n.cpuMs/o*e),cpuMs:n.cpuMs}))}function tt(t){if(!Number.isFinite(t)||t<0)return"—";if(t<1024)return`${t} B`;const s=["KB","MB","GB","TB"];let e=t/1024,o=0;for(;e>=1024&&o<s.length-1;)e/=1024,o++;return`${e<10?e.toFixed(2):e.toFixed(1)} ${s[o]}`}function et(t,s){const e=Math.max(0,t),o=Math.max(0,e-Math.max(0,s));return{frameMs:e,gapMs:o,dominated:e>20&&o>e/2}}function L(t){const s=new Map;let e=0,o=0;for(const r of t){e+=r.duration;for(const n of r.scripts??[]){o+=n.duration;const c=n.sourceURL?n.sourceURL.split("/").slice(-2).join("/"):"",a=n.sourceFunctionName||n.invoker||"(anonymous)",l=c?`${a} @ ${c}`:a,u=s.get(l)??{totalMs:0,count:0};u.totalMs+=n.duration,u.count+=1,s.set(l,u)}}return{longFrameCount:t.length,totalLongMs:Math.round(e),unattributedMs:Math.round(Math.max(0,e-o)),scripts:[...s.entries()].map(([r,n])=>({key:r,totalMs:Math.round(n.totalMs),count:n.count})).sort((r,n)=>n.totalMs-r.totalMs).slice(0,8)}}const T=5,U=20;function G(t,s,e){const o=t.filter(i=>i.timestamp>=s&&i.intervalMs>0);if(o.length<T)return null;let r=0,n=0,c=0,a=0;for(const i of o)r+=i.intervalMs,n+=i.cpuMs,i.render.gpuMs!==null&&(c+=i.render.gpuMs,a++);const l=o.length,u=r/l,p=n/l,m=e!==null&&e.sampleCount>=U?Math.max(0,e.busyMs-n)/l:null;return{frames:l,fps:u>0?1e3/u:0,frameMs:u,loopMs:p,otherMainMs:m,pipelineMs:Math.max(0,u-p-(m??0)),gpuDrawMs:a>0?c/a:null}}const w=.05,v=3,O=4;function W(t,s){return t.filter(e=>e.timestamp>=s&&e.intervalMs>0)}function E(t,s){const e=new Map;for(const[r,n]of t)e.set(r,(e.get(r)??0)+n);const o=new Map;for(const[r,n]of e)o.set(r,n/s);return o}function H(t,s){const e=t.length,o=E(t.flatMap(l=>l.phases.map(u=>[u.name,u.ms])),e),r=E(t.flatMap(l=>l.systems.map(u=>[`${u.phase} ${u.name}`,u.ms])),e),n=[];let c=0;for(const[l,u]of[...o.entries()].sort((p,m)=>m[1]-p[1])){c+=u,n.push({label:l,depth:2,ms:u});const p=[...r.entries()].filter(([i])=>i.startsWith(`${l} `)).map(([i,f])=>{const S=i.slice(l.length+1);return[S.split(" / ").at(-1)??S,f]}).sort((i,f)=>f[1]-i[1]);for(const[i,f]of p.slice(0,v))n.push({label:i,depth:3,ms:f});const m=p.slice(v);m.length>0&&n.push({label:`${m.length} more system${m.length===1?"":"s"}`,depth:3,ms:m.reduce((i,[,f])=>i+f,0)})}const a=s-c;return a>w&&n.push({label:"outside the phases",depth:2,ms:a}),n}function V(t,s,e,o){if(t===null)return[];const r=L(s.filter(l=>(l.startTime??0)>=e)),n=[];let c=0;for(const l of r.scripts.slice(0,O)){const u=Math.min(l.totalMs/o,t-c);u<=w||(c+=u,n.push({label:l.key,depth:2,ms:u,note:"named by the browser (long frames)"}))}const a=t-c;return(a>w||n.length===0)&&n.push({label:"unattributed",depth:2,ms:Math.max(0,a),note:"below the browser's 50ms attribution threshold"}),n}function st(t,s,e,o){const r=G(t,s,e);if(r===null)return null;const n=W(t,s),c=[{label:"Frame interval",depth:0,ms:r.frameMs,note:`${r.frames} frames at ${r.fps.toFixed(0)} fps`},{label:"Scene loop (CPU)",depth:1,ms:r.loopMs},...H(n,r.loopMs),{label:"Other main thread",depth:1,ms:r.otherMainMs,note:r.otherMainMs===null?"not sampled yet":"React, timers, observers"},...V(r.otherMainMs,o,s,r.frames),{label:"Display pipeline",depth:1,ms:r.pipelineMs,note:"everything after the main thread — the remainder"}];return r.gpuDrawMs!==null&&(c.push({label:"viewport GPU draw",depth:2,ms:r.gpuDrawMs,note:"measured; runs in parallel with the CPU rows",parallel:!0}),c.push({label:"compositor + vsync wait",depth:2,ms:Math.max(0,r.pipelineMs-r.gpuDrawMs),note:"post-effects, glass chrome, waiting for the next frame slot"})),{rows:c,budget:r}}let M=new D,F=null,g=!1,h=null,k=0;const y=new Set;function d(){k++;for(const t of y)t()}function nt(t){return y.add(t),()=>y.delete(t)}function rt(){return k}function K(t){t!==F&&(F=t,M=new D,h=null,d())}function at(){return M}function ot(){return g}function ct(){return h}function ut(t){M.select(t),d()}function lt(){M.clear(),h=null,d()}async function it(t){if(!(!t||g)){K(t),g=!0,h=null,d();try{const s=await t.captureFrame();M.add(s)}catch(s){h=s instanceof Error?s.message:String(s)}finally{g=!1,d()}}}export{K as a,lt as b,it as c,X as d,J as e,rt as f,at as g,ut as h,ot as i,Y as j,Z as k,ct as l,q as m,tt as n,et as o,L as p,nt as s,st as t,Q as u};
@@ -1 +1 @@
1
- import{formatLoopGateMessage as J,formatAudioGateMessage as Q}from"./loop-gate-report-N52EWFGD.js";import{bindScopedSystem as V}from"./system-slot-E2mEdiih.js";import{hasUserData as X}from"./user-data-BB2Of6Ht.js";import{registerSeededRandom as Z,createSeededRandom as ee,DEFAULT_SEEDED_RANDOM_SEED as te}from"./seeded-random-i3mtgBKZ.js";import{registerSimClock as re,createSimClock as oe}from"./sim-clock-CLflx7kg.js";import{createSystemRunner as ne}from"./system-runner-DkOjxEBt.js";import{c1 as N,c2 as P}from"./index-GIL7oGEO.js";import{createPerformanceProfiler as se}from"./performance-profiler-D_Jey87L.js";import{InputManager as ie}from"./input-manager-DH_hGW6d.js";import{a as ae,r as de,D as ce}from"./debug-registry-Dgvitx8M.js";import{registerGameplayRngTrapControl as ue,createGameplayRngTrap as le}from"./gameplay-rng-trap-CTNhm-UW.js";import{createStateBridge as me}from"./state-bridge-DLP1jLRW.js";import"./object-marks-DwvIEBOK.js";import"./render-seed-DF4JHy7P.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";import"./asset-parse-error-BHMwBRU3.js";import"./loader-CaF_I7Yt.js";import"./binding-identity-DcTpbvyg.js";import"./prompt-labels-DSMdM2_B.js";import"./schema-kl9-2B_J.js";const fe=N.filter(u=>u===P.PRE_RENDER||u===P.RENDER);function He(u){const{id:i,kind:d,pausable:h=!0,adapter:l,mounted:f,scene:b,canvasRoot:y,container:R,physics:I,collisions:O,physics2d:A,camera:T,frame:k,binding:D=null}=u;if(d==="three"&&!b)throw new Error(`RootInstance "${i}" (kind: three): a three world requires a scene — pass \`scene\` in RootInstanceInit.`);if(d==="canvas"&&y==null)throw new Error(`RootInstance "${i}" (kind: canvas): a canvas world requires a native substrate root — pass \`canvasRoot\` in RootInstanceInit.`);if(d==="dom"&&!R)throw new Error(`RootInstance "${i}" (kind: react): a react world requires a container — pass \`container\` in RootInstanceInit.`);let w=!1;const v=f.dispose.bind(f);return f.dispose=()=>{w=!0,v()},{id:i,kind:d,pausable:h,adapter:l,mounted:f,physics:I,collisions:O,physics2d:A,camera:T,frame:k?{runPhase(E,L){w||k.runPhase(E,L)},endFrame(){w||k.endFrame?.()}}:void 0,binding:D,get disposed(){return w},threeScene(){if(d!=="three"||!b)throw new Error(`RootInstance "${i}" (kind: ${d}): threeScene() requested but this world is not a three world`);return b},canvasRoot(){if(d!=="canvas"||y===void 0||y===null)throw new Error(`RootInstance "${i}" (kind: ${d}): canvasRoot() requested but this world is not a canvas world`);return y},reactRoot(){if(d!=="dom"||!R)throw new Error(`RootInstance "${i}" (kind: ${d}): reactRoot() requested but this world is not a react world`);return R}}}function pe(u){const{physics:i,rapierWorld:d}=u;return!i||!d?null:{physics:i,rapierWorld:d}}function he(u,i){const d=[];u.traverse(h=>d.push(h));for(const h of i){const l=pe(h);if(l)for(const f of d){const b=l.physics.get(f);b&&(l.rapierWorld.removeRigidBody(b.body),l.physics.remove(f))}}u.removeFromParent();for(const h of d){const l=h;X(h,"__sharedGeometry")||l.geometry?.dispose();const f=l.material;if(Array.isArray(f))for(const b of f)b.dispose();else f?.dispose()}}function ge(u){return[]}function We(u){const i=[],d=se(),h=ne(d.systemObserver,"game"),l=new ie,f=me(),b=ee(u.seed??te),y=le();let R=!1;const I={setEnabled(e){R=e},get enabled(){return R}};let O=0,A=0,T=0;const k=new Set,D=oe({dispose:e=>he(e,i.flatMap(ge))}),w=ae({getTick:()=>O,getSimT:()=>A,getFixedDt:()=>u.loop.fixedDt,getDefaultRootId:()=>i.length>0?q().id:null,getLoopLiveness:()=>u.loop.liveness});let v=!1;h.add("input",()=>{v&&l.poll(w.getGameTick())},{name:"input.poll"}),l.setDebugEmit((e,t)=>w.forRoot("(game)").emit(e,t));let $=null,E=null;const L=new Map;function q(){if(i.length===0)throw new Error("Game.defaultRoot: no roots registered yet");return i.find(e=>e.kind==="three")??i[0]}const j=new Set,G=new Set,M=new Map,_=new Map;function H(){const e={debug:w.adapter},t=new Map([["debug","(game)"]]),a=(s,n,c)=>{for(const r of Object.keys(n)){if(n[r]===void 0)continue;const o=t.get(r);if(o!==void 0){if(e[r]===n[r]||c?.has(r))continue;j.has(r)||(j.add(r),console.warn(`[game] systemAdapters: "${r}" is registered by both ${o} and ${s} — the FIRST registration (${o}) wins; the later one is shadowed (game-scoped system adapters).`));continue}e[r]=n[r],t.set(r,s)}};for(const s of i){const n=M.get(s.id);n&&a(`world "${s.id}" (declared systems export)`,n);const c=s.mounted.systems;c&&a(`world "${s.id}"`,c,n?new Set(Object.keys(n)):void 0)}return e}let m=!1;const x=new Set;function C(e,t,a){const s=`${e}:${t}`;if(x.has(s))return;x.add(s);const n=e==="loop"?J({worldId:t,reason:a}):Q({worldId:t,reason:a});console.warn(n)}const F=new WeakMap;function U(e){for(const t of i){if(t.disposed||!t.pausable)continue;t.mounted.drivesOwnLoop&&(t.mounted.setPaused?t.mounted.setPaused(e):e&&C("loop",t.id,"self-driven world, adapter declares no setPaused capability"));const a=M.get(t.id)?.audio??t.mounted.systems?.audio;a?e?(F.has(a)||F.set(a,a.isMuted()),a.setMuted(!0)):F.has(a)&&(a.setMuted(F.get(a)),F.delete(a)):e&&!_.get(t.id)?.some(s=>s.slot==="audio")&&C("audio",t.id,"no SystemAdapters.audio on this world")}}function z(e,t){R&&y.enable(),d.beginFrame();const a=t?.skipRenderPhases??!1,s=t?.onlyFrozen??!1,n=i.length;v=!1;for(let r=0;r<n;r++){const o=i[r];if(!o.disposed){if(s){if(m&&o.pausable&&!o.mounted.drivesOwnLoop){v=!0;break}}else if(o.mounted.drivesOwnLoop?!m||!o.pausable||!o.mounted.setPaused:!m||!o.pausable){v=!0;break}}}let c=!1;if(!s)for(let r=0;r<n;r++){const o=i[r];if(!o.disposed&&o.mounted.drivesOwnLoop&&(!m||!o.pausable||!o.mounted.setPaused)){c=!0;break}}if(s){for(const r of N){d.beginPhase(),v&&h.runPhase(r,e);for(let o=0;o<n;o++){const p=i[o];if(!p.disposed&&!p.mounted.drivesOwnLoop&&m&&p.pausable)try{p.frame?.runPhase(r,e)}catch(g){console.error(`[game] world "${p.id}" (kind: ${p.kind}) runPhase("${r}") threw (step()):`,g)}}d.endPhase(r)}for(let r=0;r<n;r++){const o=i[r];if(!o.disposed&&!o.mounted.drivesOwnLoop&&m&&o.pausable)if(c=!0,o.frame)try{o.frame.endFrame?.()}catch(p){console.error(`[game] world "${o.id}" (kind: ${o.kind}) endFrame() threw (step()):`,p)}else try{o.mounted.update?.(e)}catch(p){console.error(`[game] world "${o.id}" (kind: ${o.kind}) update() threw (step()):`,p)}}}else{for(const r of N){if(d.beginPhase(),!(a&&(r===P.PRE_RENDER||r===P.RENDER))){h.runPhase(r,e);for(let p=0;p<n;p++){const g=i[p];if(g.disposed||g.mounted.drivesOwnLoop)continue;const B=m&&g.pausable;if(B&&r!==P.RENDER)continue;const K=B?0:e;try{g.frame?.runPhase(r,K)}catch(Y){console.error(`[game] world "${g.id}" (kind: ${g.kind}) runPhase("${r}") threw:`,Y)}}}d.endPhase(r)}for(let r=0;r<n;r++){const o=i[r];if(!(o.disposed||o.mounted.drivesOwnLoop||m&&o.pausable)){if(c=!0,o.frame)try{o.frame.endFrame?.()}catch(g){console.error(`[game] world "${o.id}" (kind: ${o.kind}) endFrame() threw:`,g)}else if(!(a&&o.mounted.updateCadence==="display"))try{o.mounted.update?.(e)}catch(g){console.error(`[game] world "${o.id}" (kind: ${o.kind}) update() threw:`,g)}}}}v&&l.endFrame(),c&&(f.bump(),O++,A+=e,D.flush(A)),d.endFrame(),R&&y.disable()}function W(e,t){if(T=e,R&&y.enable(),d.beginFrame(),k.size>0)for(const s of[...k])try{s(e,t)}catch(n){console.error("[game] an onRenderStep callback threw:",n)}const a=i.length;for(const s of fe){d.beginPhase(),h.runPhase(s,t);for(let n=0;n<a;n++){const c=i[n];if(c.disposed||c.mounted.drivesOwnLoop)continue;const r=m&&c.pausable;if(!(r&&s!==P.RENDER))try{c.frame?.runPhase(s,r?0:t)}catch(o){console.error(`[game] world "${c.id}" (kind: ${c.kind}) runPhase("${s}") threw (display frame):`,o)}}d.endPhase(s)}for(let s=0;s<a;s++){const n=i[s];if(n.disposed||n.mounted.drivesOwnLoop||n.frame||n.mounted.updateCadence!=="display")continue;const c=m&&n.pausable;try{n.mounted.update?.(c?0:t)}catch(r){console.error(`[game] world "${n.id}" (kind: ${n.kind}) update() threw (display frame):`,r)}}d.endFrame(),R&&y.disable()}const S={loop:u.loop,assets:u.assets,playtest:u.playtest??null,profiler:d,systems:h,get roots(){return i},world(e){return i.find(t=>t.id===e)??null},get defaultRoot(){return q()},get systemAdapters(){return H()},subscribeSystemAdapters(e){return G.add(e),()=>G.delete(e)},notifySystemAdaptersChanged(){for(const e of G)e()},get declaredSystemAbsences(){return[..._.values()].flat()},installDeclaredSystemAdapters(e,t,a=[]){const s=i.find(r=>r.id===e);if(!s)throw new Error(`installDeclaredSystemAdapters: no mounted root is named "${e}" (mounted: ${i.map(r=>`"${r.id}"`).join(", ")||"none"}).`);if(M.has(e))throw new Error(`installDeclaredSystemAdapters: root "${e}" already installed its declared systems — a declaration is static and installs exactly once per mount.`);const n=s.mounted.systemScope??s.mounted,c=Object.fromEntries(Object.entries(t).map(([r,o])=>[r,o===void 0?void 0:V(o,n)]));M.set(e,c),_.set(e,a),S.notifySystemAdaptersChanged()},input:l,state:f,play:{get paused(){return m},pause(){m||(m=!0,U(!0))},resume(){m&&(m=!1,U(!1))},step(e=1/60){if(m)for(const t of i)t.disposed||!t.pausable||!t.mounted.drivesOwnLoop||t.mounted.setPaused&&(t.mounted.step?t.mounted.step():C("loop",t.id,"self-driven world, adapter declares no step capability"));z(e,{onlyFrozen:!0})}},registerRoot(e){if(i.some(t=>t.id===e.id))throw new Error(`Game.registerRoot: duplicate world id "${e.id}"`);if(i.some(t=>t.mounted===e.mounted))throw new Error(`Game.registerRoot: world "${e.id}" shares its \`mounted\` object with an already-registered world ("${i.find(t=>t.mounted===e.mounted).id}") — the same mount cannot be registered twice.`);i.push(e),S.notifySystemAdaptersChanged(),f.bump(),e.mounted.drivesOwnLoop&&e.kind!=="dom"&&!e.mounted.observe&&console.warn(`[game] world "${e.id}" (kind: ${e.kind}, adapter: "${e.adapter.id}"): no state bridge — this mounted game has no \`observe\` (RootStateObserver); react HUDs/useRootObservation cannot subscribe to its state.`)},runFrame(e,t){z(e,t)},runRenderFrame(e,t){W(e,t)},get renderAlpha(){return T},onRenderStep(e,t){const a=t?.signal;if(a?.aborted)return()=>{};k.add(e);let s=null;const n=()=>{k.delete(e),s?.(),s=null};return a&&(a.addEventListener("abort",n,{once:!0}),s=()=>a.removeEventListener("abort",n)),n},runTicks(e,t){if(!Number.isInteger(e)||e<0)throw new RangeError(`Game.runTicks: n must be a non-negative integer, got ${e}`);if(m)throw new ce("RUN_TICKS_PAUSED","Game.runTicks: refused — Game.play.paused is true; stepping the frozen set is Game.play.step()'s contract, not runTicks'");const a=t?.render??"last",s=u.loop.fixedDt;for(let n=0;n<e;n++){const c=n===e-1;z(s,{skipRenderPhases:a==="all"?!1:a==="none"?!0:!c})}},loadInputMap(e,t){if(t?.optional===!0){if($)return E??Promise.resolve();let a=L.get(e);return a||(a=l.loadMapIfPresent(e).then(s=>{s&&!$&&($=e,E=Promise.resolve())}),L.set(e,a)),a}if($&&$!==e)throw new Error(`Game.loadInputMap: input map is already "${$}"; root requested "${e}". Input is game-owned, so roots cannot load competing maps.`);return $=e,E??=l.loadMap(e),E},dispose(){D.dispose(),l.dispose(),w.strip()}};return de(S,w),w.setRunTicksTarget({runTicks:S.runTicks}),Z(S,b),ue(S,I),re(S,D),S}export{We as createGame,He as createRootInstance,he as disposeDebrisSubtree};
1
+ import{formatLoopGateMessage as J,formatAudioGateMessage as Q}from"./loop-gate-report-N52EWFGD.js";import{bindScopedSystem as V}from"./system-slot-E2mEdiih.js";import{hasUserData as X}from"./user-data-CZqsJDk-.js";import{registerSeededRandom as Z,createSeededRandom as ee,DEFAULT_SEEDED_RANDOM_SEED as te}from"./seeded-random-CN0scLZj.js";import{registerSimClock as re,createSimClock as oe}from"./sim-clock-DEfbb_-P.js";import{createSystemRunner as ne}from"./system-runner-D_DtVrer.js";import{cv as N,cw as P}from"./index-Ckxb31Yz.js";import{createPerformanceProfiler as se}from"./performance-profiler-D_Jey87L.js";import{InputManager as ie}from"./input-manager-Cxx3RJgG.js";import{a as ae,r as de,D as ce}from"./debug-registry-B3Cnne3x.js";import{registerGameplayRngTrapControl as ue,createGameplayRngTrap as le}from"./gameplay-rng-trap-BhRx_CtU.js";import{createStateBridge as me}from"./state-bridge-DLP1jLRW.js";import"./object-marks-DwvIEBOK.js";import"./render-seed-DF4JHy7P.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"./asset-parse-error-BHMwBRU3.js";import"./loader-BbMsvIxP.js";import"./binding-identity-DcTpbvyg.js";import"./prompt-labels-DSMdM2_B.js";import"./schema-Iy-mbzll.js";const fe=N.filter(u=>u===P.PRE_RENDER||u===P.RENDER);function He(u){const{id:i,kind:d,pausable:h=!0,adapter:l,mounted:f,scene:b,canvasRoot:y,container:R,physics:I,collisions:O,physics2d:A,camera:T,frame:k,binding:D=null}=u;if(d==="three"&&!b)throw new Error(`RootInstance "${i}" (kind: three): a three world requires a scene — pass \`scene\` in RootInstanceInit.`);if(d==="canvas"&&y==null)throw new Error(`RootInstance "${i}" (kind: canvas): a canvas world requires a native substrate root — pass \`canvasRoot\` in RootInstanceInit.`);if(d==="dom"&&!R)throw new Error(`RootInstance "${i}" (kind: react): a react world requires a container — pass \`container\` in RootInstanceInit.`);let w=!1;const v=f.dispose.bind(f);return f.dispose=()=>{w=!0,v()},{id:i,kind:d,pausable:h,adapter:l,mounted:f,physics:I,collisions:O,physics2d:A,camera:T,frame:k?{runPhase(E,L){w||k.runPhase(E,L)},endFrame(){w||k.endFrame?.()}}:void 0,binding:D,get disposed(){return w},threeScene(){if(d!=="three"||!b)throw new Error(`RootInstance "${i}" (kind: ${d}): threeScene() requested but this world is not a three world`);return b},canvasRoot(){if(d!=="canvas"||y===void 0||y===null)throw new Error(`RootInstance "${i}" (kind: ${d}): canvasRoot() requested but this world is not a canvas world`);return y},reactRoot(){if(d!=="dom"||!R)throw new Error(`RootInstance "${i}" (kind: ${d}): reactRoot() requested but this world is not a react world`);return R}}}function pe(u){const{physics:i,rapierWorld:d}=u;return!i||!d?null:{physics:i,rapierWorld:d}}function he(u,i){const d=[];u.traverse(h=>d.push(h));for(const h of i){const l=pe(h);if(l)for(const f of d){const b=l.physics.get(f);b&&(l.rapierWorld.removeRigidBody(b.body),l.physics.remove(f))}}u.removeFromParent();for(const h of d){const l=h;X(h,"__sharedGeometry")||l.geometry?.dispose();const f=l.material;if(Array.isArray(f))for(const b of f)b.dispose();else f?.dispose()}}function ge(u){return[]}function We(u){const i=[],d=se(),h=ne(d.systemObserver,"game"),l=new ie,f=me(),b=ee(u.seed??te),y=le();let R=!1;const I={setEnabled(e){R=e},get enabled(){return R}};let O=0,A=0,T=0;const k=new Set,D=oe({dispose:e=>he(e,i.flatMap(ge))}),w=ae({getTick:()=>O,getSimT:()=>A,getFixedDt:()=>u.loop.fixedDt,getDefaultRootId:()=>i.length>0?q().id:null,getLoopLiveness:()=>u.loop.liveness});let v=!1;h.add("input",()=>{v&&l.poll(w.getGameTick())},{name:"input.poll"}),l.setDebugEmit((e,t)=>w.forRoot("(game)").emit(e,t));let $=null,E=null;const L=new Map;function q(){if(i.length===0)throw new Error("Game.defaultRoot: no roots registered yet");return i.find(e=>e.kind==="three")??i[0]}const j=new Set,G=new Set,M=new Map,_=new Map;function H(){const e={debug:w.adapter},t=new Map([["debug","(game)"]]),a=(s,n,c)=>{for(const r of Object.keys(n)){if(n[r]===void 0)continue;const o=t.get(r);if(o!==void 0){if(e[r]===n[r]||c?.has(r))continue;j.has(r)||(j.add(r),console.warn(`[game] systemAdapters: "${r}" is registered by both ${o} and ${s} — the FIRST registration (${o}) wins; the later one is shadowed (game-scoped system adapters).`));continue}e[r]=n[r],t.set(r,s)}};for(const s of i){const n=M.get(s.id);n&&a(`world "${s.id}" (declared systems export)`,n);const c=s.mounted.systems;c&&a(`world "${s.id}"`,c,n?new Set(Object.keys(n)):void 0)}return e}let m=!1;const x=new Set;function C(e,t,a){const s=`${e}:${t}`;if(x.has(s))return;x.add(s);const n=e==="loop"?J({worldId:t,reason:a}):Q({worldId:t,reason:a});console.warn(n)}const F=new WeakMap;function U(e){for(const t of i){if(t.disposed||!t.pausable)continue;t.mounted.drivesOwnLoop&&(t.mounted.setPaused?t.mounted.setPaused(e):e&&C("loop",t.id,"self-driven world, adapter declares no setPaused capability"));const a=M.get(t.id)?.audio??t.mounted.systems?.audio;a?e?(F.has(a)||F.set(a,a.isMuted()),a.setMuted(!0)):F.has(a)&&(a.setMuted(F.get(a)),F.delete(a)):e&&!_.get(t.id)?.some(s=>s.slot==="audio")&&C("audio",t.id,"no SystemAdapters.audio on this world")}}function z(e,t){R&&y.enable(),d.beginFrame();const a=t?.skipRenderPhases??!1,s=t?.onlyFrozen??!1,n=i.length;v=!1;for(let r=0;r<n;r++){const o=i[r];if(!o.disposed){if(s){if(m&&o.pausable&&!o.mounted.drivesOwnLoop){v=!0;break}}else if(o.mounted.drivesOwnLoop?!m||!o.pausable||!o.mounted.setPaused:!m||!o.pausable){v=!0;break}}}let c=!1;if(!s)for(let r=0;r<n;r++){const o=i[r];if(!o.disposed&&o.mounted.drivesOwnLoop&&(!m||!o.pausable||!o.mounted.setPaused)){c=!0;break}}if(s){for(const r of N){d.beginPhase(),v&&h.runPhase(r,e);for(let o=0;o<n;o++){const p=i[o];if(!p.disposed&&!p.mounted.drivesOwnLoop&&m&&p.pausable)try{p.frame?.runPhase(r,e)}catch(g){console.error(`[game] world "${p.id}" (kind: ${p.kind}) runPhase("${r}") threw (step()):`,g)}}d.endPhase(r)}for(let r=0;r<n;r++){const o=i[r];if(!o.disposed&&!o.mounted.drivesOwnLoop&&m&&o.pausable)if(c=!0,o.frame)try{o.frame.endFrame?.()}catch(p){console.error(`[game] world "${o.id}" (kind: ${o.kind}) endFrame() threw (step()):`,p)}else try{o.mounted.update?.(e)}catch(p){console.error(`[game] world "${o.id}" (kind: ${o.kind}) update() threw (step()):`,p)}}}else{for(const r of N){if(d.beginPhase(),!(a&&(r===P.PRE_RENDER||r===P.RENDER))){h.runPhase(r,e);for(let p=0;p<n;p++){const g=i[p];if(g.disposed||g.mounted.drivesOwnLoop)continue;const B=m&&g.pausable;if(B&&r!==P.RENDER)continue;const K=B?0:e;try{g.frame?.runPhase(r,K)}catch(Y){console.error(`[game] world "${g.id}" (kind: ${g.kind}) runPhase("${r}") threw:`,Y)}}}d.endPhase(r)}for(let r=0;r<n;r++){const o=i[r];if(!(o.disposed||o.mounted.drivesOwnLoop||m&&o.pausable)){if(c=!0,o.frame)try{o.frame.endFrame?.()}catch(g){console.error(`[game] world "${o.id}" (kind: ${o.kind}) endFrame() threw:`,g)}else if(!(a&&o.mounted.updateCadence==="display"))try{o.mounted.update?.(e)}catch(g){console.error(`[game] world "${o.id}" (kind: ${o.kind}) update() threw:`,g)}}}}v&&l.endFrame(),c&&(f.bump(),O++,A+=e,D.flush(A)),d.endFrame(),R&&y.disable()}function W(e,t){if(T=e,R&&y.enable(),d.beginFrame(),k.size>0)for(const s of[...k])try{s(e,t)}catch(n){console.error("[game] an onRenderStep callback threw:",n)}const a=i.length;for(const s of fe){d.beginPhase(),h.runPhase(s,t);for(let n=0;n<a;n++){const c=i[n];if(c.disposed||c.mounted.drivesOwnLoop)continue;const r=m&&c.pausable;if(!(r&&s!==P.RENDER))try{c.frame?.runPhase(s,r?0:t)}catch(o){console.error(`[game] world "${c.id}" (kind: ${c.kind}) runPhase("${s}") threw (display frame):`,o)}}d.endPhase(s)}for(let s=0;s<a;s++){const n=i[s];if(n.disposed||n.mounted.drivesOwnLoop||n.frame||n.mounted.updateCadence!=="display")continue;const c=m&&n.pausable;try{n.mounted.update?.(c?0:t)}catch(r){console.error(`[game] world "${n.id}" (kind: ${n.kind}) update() threw (display frame):`,r)}}d.endFrame(),R&&y.disable()}const S={loop:u.loop,assets:u.assets,playtest:u.playtest??null,profiler:d,systems:h,get roots(){return i},world(e){return i.find(t=>t.id===e)??null},get defaultRoot(){return q()},get systemAdapters(){return H()},subscribeSystemAdapters(e){return G.add(e),()=>G.delete(e)},notifySystemAdaptersChanged(){for(const e of G)e()},get declaredSystemAbsences(){return[..._.values()].flat()},installDeclaredSystemAdapters(e,t,a=[]){const s=i.find(r=>r.id===e);if(!s)throw new Error(`installDeclaredSystemAdapters: no mounted root is named "${e}" (mounted: ${i.map(r=>`"${r.id}"`).join(", ")||"none"}).`);if(M.has(e))throw new Error(`installDeclaredSystemAdapters: root "${e}" already installed its declared systems — a declaration is static and installs exactly once per mount.`);const n=s.mounted.systemScope??s.mounted,c=Object.fromEntries(Object.entries(t).map(([r,o])=>[r,o===void 0?void 0:V(o,n)]));M.set(e,c),_.set(e,a),S.notifySystemAdaptersChanged()},input:l,state:f,play:{get paused(){return m},pause(){m||(m=!0,U(!0))},resume(){m&&(m=!1,U(!1))},step(e=1/60){if(m)for(const t of i)t.disposed||!t.pausable||!t.mounted.drivesOwnLoop||t.mounted.setPaused&&(t.mounted.step?t.mounted.step():C("loop",t.id,"self-driven world, adapter declares no step capability"));z(e,{onlyFrozen:!0})}},registerRoot(e){if(i.some(t=>t.id===e.id))throw new Error(`Game.registerRoot: duplicate world id "${e.id}"`);if(i.some(t=>t.mounted===e.mounted))throw new Error(`Game.registerRoot: world "${e.id}" shares its \`mounted\` object with an already-registered world ("${i.find(t=>t.mounted===e.mounted).id}") — the same mount cannot be registered twice.`);i.push(e),S.notifySystemAdaptersChanged(),f.bump(),e.mounted.drivesOwnLoop&&e.kind!=="dom"&&!e.mounted.observe&&console.warn(`[game] world "${e.id}" (kind: ${e.kind}, adapter: "${e.adapter.id}"): no state bridge — this mounted game has no \`observe\` (RootStateObserver); react HUDs/useRootObservation cannot subscribe to its state.`)},runFrame(e,t){z(e,t)},runRenderFrame(e,t){W(e,t)},get renderAlpha(){return T},onRenderStep(e,t){const a=t?.signal;if(a?.aborted)return()=>{};k.add(e);let s=null;const n=()=>{k.delete(e),s?.(),s=null};return a&&(a.addEventListener("abort",n,{once:!0}),s=()=>a.removeEventListener("abort",n)),n},runTicks(e,t){if(!Number.isInteger(e)||e<0)throw new RangeError(`Game.runTicks: n must be a non-negative integer, got ${e}`);if(m)throw new ce("RUN_TICKS_PAUSED","Game.runTicks: refused — Game.play.paused is true; stepping the frozen set is Game.play.step()'s contract, not runTicks'");const a=t?.render??"last",s=u.loop.fixedDt;for(let n=0;n<e;n++){const c=n===e-1;z(s,{skipRenderPhases:a==="all"?!1:a==="none"?!0:!c})}},loadInputMap(e,t){if(t?.optional===!0){if($)return E??Promise.resolve();let a=L.get(e);return a||(a=l.loadMapIfPresent(e).then(s=>{s&&!$&&($=e,E=Promise.resolve())}),L.set(e,a)),a}if($&&$!==e)throw new Error(`Game.loadInputMap: input map is already "${$}"; root requested "${e}". Input is game-owned, so roots cannot load competing maps.`);return $=e,E??=l.loadMap(e),E},dispose(){D.dispose(),l.dispose(),w.strip()}};return de(S,w),w.setRunTicksTarget({runTicks:S.runTicks}),Z(S,b),ue(S,I),re(S,D),S}export{We as createGame,He as createRootInstance,he as disposeDebrisSubtree};
@@ -1 +1 @@
1
- import{i as e}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 s=e()({contractVersion:{optional:!1,kind:"value",required:"shape"},root:{optional:!0,kind:"value",required:"effect"},presentation:{optional:!0,kind:"value",required:"effect"},world:{optional:!0,kind:"value",required:"effect"},ready:{optional:!0,kind:"value",required:"effect"},lifecycle:{optional:!0,kind:"value",required:"effect"},scenes:{optional:!0,kind:"value",required:"effect"},systems:{optional:!0,kind:"value",required:"operation"}}),f=e()({start:{optional:!0,kind:"function",required:"effect"},pause:{optional:!0,kind:"function",required:"effect"},resume:{optional:!0,kind:"function",required:"effect"},dispose:{optional:!0,kind:"function",required:"effect"}}),c=e()({list:{optional:!1,kind:"function",required:"operation"},current:{optional:!1,kind:"function",required:"operation"},goTo:{optional:!1,kind:"function",required:"effect"}}),k=e()({id:{optional:!1,kind:"value",required:"shape"},label:{optional:!1,kind:"value",required:"shape"}}),q=e()({name:{optional:!1,kind:"value",required:"shape"},description:{optional:!0,kind:"value",required:"shape"},argsJsonSchema:{optional:!0,kind:"value",required:"shape"},run:{optional:!1,kind:"function",required:"effect"}}),E=e()({name:{optional:!1,kind:"value",required:"shape"},tier:{optional:!0,kind:"value",required:"shape"},read:{optional:!1,kind:"function",required:"operation"}}),v=e()({id:{optional:!1,kind:"value",required:"shape"},label:{optional:!1,kind:"value",required:"shape"},count:{optional:!1,kind:"value",required:"operation"}}),A=e()({commands:{optional:!0,kind:"value",required:"operation"},state:{optional:!0,kind:"value",required:"operation"},hierarchy:{optional:!0,kind:"function",required:"operation"},systemAdapters:{optional:!0,kind:"value",required:"operation"}}),S=e()({physics:{optional:!0,kind:"value",required:"effect"},networking:{optional:!0,kind:"value",required:"operation"},navigation:{optional:!0,kind:"value",required:"operation"},audio:{optional:!0,kind:"value",required:"effect"},camera:{optional:!0,kind:"value",required:"effect"},renderDebug:{optional:!0,kind:"value",required:"effect"}}),_=e()({present:{optional:!1,kind:"value",required:"shape"},evidence:{optional:!1,kind:"value",required:"claim"}});export{q as GAME_COMMAND_SHAPE,s as GAME_CONTRACT_SHAPE,v as GAME_HIERARCHY_GROUP_SHAPE,f as GAME_LIFECYCLE_SHAPE,c as GAME_SCENES_SHAPE,k as GAME_SCENE_SHAPE,E as GAME_STATE_PROVIDER_SHAPE,A as GAME_SYSTEMS_SHAPE,S as GAME_SYSTEM_ADAPTERS_SHAPE,_ as GAME_SYSTEM_EMPTY_SHAPE};
1
+ import{i as e}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 s=e()({contractVersion:{optional:!1,kind:"value",required:"shape"},root:{optional:!0,kind:"value",required:"effect"},presentation:{optional:!0,kind:"value",required:"effect"},world:{optional:!0,kind:"value",required:"effect"},ready:{optional:!0,kind:"value",required:"effect"},lifecycle:{optional:!0,kind:"value",required:"effect"},scenes:{optional:!0,kind:"value",required:"effect"},systems:{optional:!0,kind:"value",required:"operation"}}),f=e()({start:{optional:!0,kind:"function",required:"effect"},pause:{optional:!0,kind:"function",required:"effect"},resume:{optional:!0,kind:"function",required:"effect"},dispose:{optional:!0,kind:"function",required:"effect"}}),c=e()({list:{optional:!1,kind:"function",required:"operation"},current:{optional:!1,kind:"function",required:"operation"},goTo:{optional:!1,kind:"function",required:"effect"}}),k=e()({id:{optional:!1,kind:"value",required:"shape"},label:{optional:!1,kind:"value",required:"shape"}}),q=e()({name:{optional:!1,kind:"value",required:"shape"},description:{optional:!0,kind:"value",required:"shape"},argsJsonSchema:{optional:!0,kind:"value",required:"shape"},run:{optional:!1,kind:"function",required:"effect"}}),E=e()({name:{optional:!1,kind:"value",required:"shape"},tier:{optional:!0,kind:"value",required:"shape"},read:{optional:!1,kind:"function",required:"operation"}}),v=e()({id:{optional:!1,kind:"value",required:"shape"},label:{optional:!1,kind:"value",required:"shape"},count:{optional:!1,kind:"value",required:"operation"}}),A=e()({commands:{optional:!0,kind:"value",required:"operation"},state:{optional:!0,kind:"value",required:"operation"},hierarchy:{optional:!0,kind:"function",required:"operation"},systemAdapters:{optional:!0,kind:"value",required:"operation"}}),S=e()({physics:{optional:!0,kind:"value",required:"effect"},networking:{optional:!0,kind:"value",required:"operation"},navigation:{optional:!0,kind:"value",required:"operation"},audio:{optional:!0,kind:"value",required:"effect"},camera:{optional:!0,kind:"value",required:"effect"},renderDebug:{optional:!0,kind:"value",required:"effect"}}),_=e()({present:{optional:!1,kind:"value",required:"shape"},evidence:{optional:!1,kind:"value",required:"claim"}});export{q as GAME_COMMAND_SHAPE,s as GAME_CONTRACT_SHAPE,v as GAME_HIERARCHY_GROUP_SHAPE,f as GAME_LIFECYCLE_SHAPE,c as GAME_SCENES_SHAPE,k as GAME_SCENE_SHAPE,E as GAME_STATE_PROVIDER_SHAPE,A as GAME_SYSTEMS_SHAPE,S as GAME_SYSTEM_ADAPTERS_SHAPE,_ as GAME_SYSTEM_EMPTY_SHAPE};
@@ -1,4 +1,4 @@
1
- import{g as Rt}from"./_commonjsHelpers-D6-XlEtG.js";import{jS as N}from"./index-GIL7oGEO.js";import"./index-nmcBqr7Y.js";import"./index-D_NuPfjr.js";import"./jsx-runtime-DPjLkJKQ.js";import"./index-CtzuWnCS.js";import"./index-CinJrH5C.js";import"./index-FUuS4qwW.js";import"./client-DNXj_opT.js";import"./three.module-D396a9Mn.js";var j={exports:{}},qe;function Ot(){if(qe)return j.exports;qe=1;var d=String,x=function(){return{isColorSupported:!1,reset:d,bold:d,dim:d,italic:d,underline:d,inverse:d,hidden:d,strikethrough:d,black:d,red:d,green:d,yellow:d,blue:d,magenta:d,cyan:d,white:d,gray:d,bgBlack:d,bgRed:d,bgGreen:d,bgYellow:d,bgBlue:d,bgMagenta:d,bgCyan:d,bgWhite:d,blackBright:d,redBright:d,greenBright:d,yellowBright:d,blueBright:d,magentaBright:d,cyanBright:d,whiteBright:d,bgBlackBright:d,bgRedBright:d,bgGreenBright:d,bgYellowBright:d,bgBlueBright:d,bgMagentaBright:d,bgCyanBright:d,bgWhiteBright:d}};return j.exports=x(),j.exports.createColors=x,j.exports}var te,ze;function Ee(){if(ze)return te;ze=1;let d=Ot(),x=N;class v extends Error{constructor(y,b,g,w,S,o){super(y),this.name="CssSyntaxError",this.reason=y,S&&(this.file=S),w&&(this.source=w),o&&(this.plugin=o),typeof b<"u"&&typeof g<"u"&&(typeof b=="number"?(this.line=b,this.column=g):(this.line=b.line,this.column=b.column,this.endLine=g.line,this.endColumn=g.column)),this.setMessage(),Error.captureStackTrace&&Error.captureStackTrace(this,v)}setMessage(){this.message=this.plugin?this.plugin+": ":"",this.message+=this.file?this.file:"<css input>",typeof this.line<"u"&&(this.message+=":"+this.line+":"+this.column),this.message+=": "+this.reason}showSourceCode(y){if(!this.source)return"";let b=this.source;y==null&&(y=d.isColorSupported);let g=e=>e,w=e=>e,S=e=>e;if(y){let{bold:e,gray:t,red:i}=d.createColors(!0);w=n=>e(i(n)),g=n=>t(n),x&&(S=n=>x(n))}let o=b.split(/\r?\n/),f=Math.max(this.line-3,0),s=Math.min(this.line+2,o.length),r=String(s).length;return o.slice(f,s).map((e,t)=>{let i=f+1+t,n=" "+(" "+i).slice(-r)+" | ";if(i===this.line){if(e.length>160){let c=20,u=Math.max(0,this.column-c),l=Math.max(this.column+c,this.endColumn+c),a=e.slice(u,l),h=g(n.replace(/\d/g," "))+e.slice(0,Math.min(this.column-1,c-1)).replace(/[^\t]/g," ");return w(">")+g(n)+S(a)+`
1
+ import{g as Rt}from"./_commonjsHelpers-D6-XlEtG.js";import{kv as N}from"./index-Ckxb31Yz.js";import"./index-nmcBqr7Y.js";import"./index-D_NuPfjr.js";import"./jsx-runtime-DPjLkJKQ.js";import"./index-CtzuWnCS.js";import"./index-CinJrH5C.js";import"./index-FUuS4qwW.js";import"./client-DNXj_opT.js";import"./three.module-IFn-4i31.js";var j={exports:{}},qe;function Ot(){if(qe)return j.exports;qe=1;var d=String,x=function(){return{isColorSupported:!1,reset:d,bold:d,dim:d,italic:d,underline:d,inverse:d,hidden:d,strikethrough:d,black:d,red:d,green:d,yellow:d,blue:d,magenta:d,cyan:d,white:d,gray:d,bgBlack:d,bgRed:d,bgGreen:d,bgYellow:d,bgBlue:d,bgMagenta:d,bgCyan:d,bgWhite:d,blackBright:d,redBright:d,greenBright:d,yellowBright:d,blueBright:d,magentaBright:d,cyanBright:d,whiteBright:d,bgBlackBright:d,bgRedBright:d,bgGreenBright:d,bgYellowBright:d,bgBlueBright:d,bgMagentaBright:d,bgCyanBright:d,bgWhiteBright:d}};return j.exports=x(),j.exports.createColors=x,j.exports}var te,ze;function Ee(){if(ze)return te;ze=1;let d=Ot(),x=N;class v extends Error{constructor(y,b,g,w,S,o){super(y),this.name="CssSyntaxError",this.reason=y,S&&(this.file=S),w&&(this.source=w),o&&(this.plugin=o),typeof b<"u"&&typeof g<"u"&&(typeof b=="number"?(this.line=b,this.column=g):(this.line=b.line,this.column=b.column,this.endLine=g.line,this.endColumn=g.column)),this.setMessage(),Error.captureStackTrace&&Error.captureStackTrace(this,v)}setMessage(){this.message=this.plugin?this.plugin+": ":"",this.message+=this.file?this.file:"<css input>",typeof this.line<"u"&&(this.message+=":"+this.line+":"+this.column),this.message+=": "+this.reason}showSourceCode(y){if(!this.source)return"";let b=this.source;y==null&&(y=d.isColorSupported);let g=e=>e,w=e=>e,S=e=>e;if(y){let{bold:e,gray:t,red:i}=d.createColors(!0);w=n=>e(i(n)),g=n=>t(n),x&&(S=n=>x(n))}let o=b.split(/\r?\n/),f=Math.max(this.line-3,0),s=Math.min(this.line+2,o.length),r=String(s).length;return o.slice(f,s).map((e,t)=>{let i=f+1+t,n=" "+(" "+i).slice(-r)+" | ";if(i===this.line){if(e.length>160){let c=20,u=Math.max(0,this.column-c),l=Math.max(this.column+c,this.endColumn+c),a=e.slice(u,l),h=g(n.replace(/\d/g," "))+e.slice(0,Math.min(this.column-1,c-1)).replace(/[^\t]/g," ");return w(">")+g(n)+S(a)+`
2
2
  `+h+w("^")}let p=g(n.replace(/\d/g," "))+e.slice(0,this.column-1).replace(/[^\t]/g," ");return w(">")+g(n)+S(e)+`
3
3
  `+p+w("^")}return" "+g(n)+S(e)}).join(`
4
4
  `)}toString(){let y=this.showSourceCode();return y&&(y=`
@@ -0,0 +1 @@
1
+ import{lA as ht,lB as be,lC as gt,dO as vt,br as X,lD as xt,lE as we,lF as yt,lG as Se,a5 as L,a6 as ue,lH as bt,lI as wt,ab as Q,ac as G,lJ as St,lK as jt,ae as de,lL as Et,aa as $e,lM as Mt,lN as It,eO as Te,aG as ze,hd as Rt,he as Dt,hf as Ct,hg as Pt,q as ie,ap as h,X as At,gM as Ft,gN as je,gP as _t,g4 as kt,eX as Ne,lk as $t,bZ as Tt,lO as zt,p as Oe}from"./index-Ckxb31Yz.js";import{a as s}from"./jsx-runtime-DPjLkJKQ.js";import{r}from"./index-nmcBqr7Y.js";import"./index-CtzuWnCS.js";import{u as Nt,d as Ot,c as Gt}from"./frame-debugger-store-BZgIOlU6.js";import{meterPercent as Vt}from"./audio-meter-CyiToeUW.js";import{p as Ge}from"./utility-view-state-DYJY8V8O.js";import{P as Lt}from"./PlayBar-qVJpgwJt.js";import{a as Ee,R as Ht}from"./ResolutionPicker-DpHVJxn5.js";import{setUserData as Ve}from"./user-data-CZqsJDk-.js";import{D as pe,E as Bt,F as ne,G as Wt,H as Le,I as He,J as Be,K as We,u as Ut,v as qt,L as me,t as J,M as Xt,N as Kt,O as Jt,P as se,Q as Ue,R as Me,S as qe,T as Yt,U as Xe,i as Qt,V as Zt,W as Ie,X as en,a as Ke,Y as tn}from"./play-mode-DomOvQie.js";import{bG as nn,x as Je,al as sn,aW as on,z as rn,aU as fe,M as Re,cr as an,V as W,be as ln,ax as Ye,ay as De,aX as cn,a_ as un}from"./three.module-IFn-4i31.js";import{e as dn,S as pn}from"./surface-state-BAUJu6GY.js";import{d as mn}from"./surface-content-Dg9Kkazf.js";import{resolvePresentedSize as fn,fitPresentation as hn}from"./presentation-BPP5pXeQ.js";import{a as gn,X as Qe}from"./active-ingest-DEgq9JiA.js";import"./index-FUuS4qwW.js";import"./client-DNXj_opT.js";import"./_commonjsHelpers-D6-XlEtG.js";import"./index-D_NuPfjr.js";import"./index-CinJrH5C.js";import"./configurations-C2qgJNnW.js";import"./ingest-source-persistence-DH6ioCOu.js";import"./capability-coverage-CfUeULDN.js";import"./game-contract-seams-TCpIMmHP.js";import"./object-marks-DwvIEBOK.js";import"./drei-asset-caches-jJoHXbTj.js";import"./native-debug-module-j-MekcLS.js";import"./native-entry-surface-BE8LJNdu.js";import"./debug-registry-B3Cnne3x.js";import"./playtest-BnFenMBW.js";import"./instruments-IKn-vvNb.js";import"./frame-pacing-D5acoOzO.js";import"./edit-mode-authoring-D_BiHCQj.js";import"./json-history-resource-r-9q_hxP.js";import"./binding-resolver-BWwG10zJ.js";import"./adapter-surface-Y37Nzcyw.js";import"./entry-adjudication-BYy7TXOB.js";import"./r3f-root-factory-DjGnbU4n.js";import"./register-render-vitals-BO7x64kR.js";import"./render-census-BrQX_CXv.js";import"./structural-signature-0w-i_ats.js";import"./render-vitals-BZ5HtvMi.js";import"./static-batch-advisor-DqfXWRUq.js";import"./webgl-frame-capture-CRKX73E9.js";import"./world-state-ZGDGY_Xl.js";import"./frame-selector-cache-cCeUbcjG.js";import"./dev-build-gDYrq68M.js";import"./game-input-seams-BC6xhZy3.js";import"./seeded-random-CN0scLZj.js";import"./render-seed-DF4JHy7P.js";import"./frame-delta-D2nsw_Ht.js";import"./events-156d8d12.esm-C734MYnx.js";import"./index-bQE2NA0D.js";import"./realm-services-D25JHoqD.js";import"./canvas-entry-runtime-E5YjSgre.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"./relative-path-guard-GiM7Lsz8.js";import"./react-root-DGLRLr-F.js";import"./editor-presentation-activity-C7SNSmTd.js";import"./pixi-story-model-DNkfnWUV.js";import"./viewport-root-presentation-C9M98VNM.js";import"./mounted-authoring-TIN5EnCb.js";import"./three-DSsr_Lvp.js";import"./viewport-pick-context-DkawXbEi.js";import"./logger-Dqis-7W1.js";import"./run-ticks-settled-B0cTtmhQ.js";import"./three-authoring-adapter-Yqsank46.js";import"./source-persistence-backend-_-JMEXxE.js";import"./three-projection-core-kubBTx0s.js";import"./body-marks-D8iaje6y.js";import"./structural-ids-CblajJQK.js";import"./object3d-authoring-subject-CyE4rQ2A.js";import"./rapier-physics-adapter-CaZqWLu0.js";import"./r3f-physics-binding-C8OqNRG2.js";import"./deferred-ingest-play-7V8OrW3e.js";import"./rrweb-Cd2ifIRP.js";import"./react-world-authoring-adapter-BMT9kLWU.js";import"./board-guides-C3usUZZk.js";import"./writer-BPbm4_my.js";import"./story-arg-descriptors-Ek86ExX7.js";import"./inspect-BRgDdtVk.js";import"./inference-diagnostics-YW0yJkKx.js";const Ze=8,oe=1e3/60;function vn(e,t=Ze){return!(e>0)||t<=0?0:Math.min(t,Math.max(1,Math.round(Vt(e)/100*t)))}function Ce(e,t){const n=e.filter(a=>a.id>t),o=n.at(-1)?.id??t,i=n.map(a=>a.intervalMs).filter(a=>Number.isFinite(a)&&a>0).sort((a,m)=>a-m);if(i.length===0)return{frameId:o,intervalMs:null};const l=Math.floor((i.length-1)*.95);return{frameId:o,intervalMs:i[l]??null}}function xn(e){const t=e.slice(-3);return t.slice(-2).length===2&&t.slice(-2).every(n=>n>=50)?"danger":t.length===3&&t.every(n=>n>oe*1.05)?"warning":"normal"}function yn(e,t,n,o=50){if(e.length===0||t<=0||n<=0)return"";const i=Math.max(1,e.length-1);return e.map((l,a)=>{const m=a/i*t,d=Math.min(1,Math.max(0,l/o)),g=n-d*n;return`${m.toFixed(1)},${g.toFixed(1)}`}).join(" ")}const et="muted",Pe={enabled:!1,recording:!1,fps:0,cpuMs:0,p95Ms:0,p99Ms:0,frames:[],phases:[],systems:[],components:[],render:{gpuMs:null,drawCalls:0,triangles:0,geometries:0,textures:0,renderPasses:0}};function Ae(){return St(et)===!0}function bn(e){jt(et,e)}function wn(e,t){const n=t.find(i=>i.id==="master")?.level;if(!e.isMuted()&&n!==void 0)return n;const o=t.filter(i=>i.id!=="master").map(i=>i.level);return o.length>0?Math.max(...o):n??0}function Sn(){const e=X();r.useSyncExternalStore(e.subscribe,e.getShellSnapshot??e.getSnapshot);const t=e.playState==="playing",[n,o]=r.useState(!1),[i,l]=r.useState(0),[a,m]=r.useState(!1),[d,g]=r.useState(!1),[u,T]=r.useState(Ae),R=r.useRef(Ae()),E=r.useRef(new WeakMap),y=r.useRef(null),D=r.useSyncExternalStore(xt,we,we),v=yt();r.useEffect(()=>{const p=R.current||!t;for(const f of Se())E.current.get(f)!==p&&(f.setMuted(p),E.current.set(f,p))},[D,t]),r.useEffect(()=>{if(!v){l(0),m(!1),g(!1);return}const p=v.acquireMeters?.()??null;g(p!==null);const f=()=>{m(v.isMuted()),l(p?wn(v,p.read()):0)};f();const A=setInterval(f,100);return()=>{clearInterval(A),p?.dispose()}},[v]);const M=()=>{const p=!R.current,f=p||!t;for(const A of Se())A.resume?.(),A.setMuted(f),E.current.set(A,f);R.current=p,T(p),bn(p),m(f)},C=vn(i),z=v&&a&&!u&&!t?" (not playing)":"",P=v?a?"Audio muted":i>0?"Audio playing":"Audio quiet":"Audio unavailable";return s.jsxs("div",{className:"vgai-header-audio","data-muted":a||void 0,"data-available":!!v,children:[s.jsxs(L,{ref:y,type:"button",variant:"ghost",size:"compact",className:"vgai-header-telemetry-button","data-testid":"header-audio-telemetry","aria-label":`${P}; open audio controls`,"aria-haspopup":"menu","aria-expanded":n,title:`${P}${z}${d?"":" · level metering unavailable"}`,onClick:()=>o(p=>!p),children:[s.jsx(ue,{icon:a?bt:wt,size:"sm"}),s.jsx("span",{className:"vgai-audio-vu","aria-hidden":"true",children:Array.from({length:Ze},(p,f)=>s.jsx("i",{"data-filled":f<C||void 0},f))})]}),n&&s.jsx(Q,{anchorRef:y,onDismiss:()=>o(!1),gap:3,children:s.jsx(G,{onClick:()=>{M(),o(!1)},children:u?"Unmute audio":"Mute audio"})})]})}function jn(){const e=Nt(),t=e?.profiler??null,[n,o]=r.useState(Pe),[i,l]=r.useState([]);r.useEffect(()=>{if(!t){o(Pe),l([]);return}const R=t.telemetryEnabled;t.telemetryEnabled=!0;const E=t.getSnapshot(),y=Ce(E.frames,0);let D=y.frameId;o(E),l(y.intervalMs===null?[]:[y.intervalMs]);let v=null;const M=()=>{v=null;const z=t.getSnapshot(),P=Ce(z.frames,D);D=P.frameId,o(z);const p=P.intervalMs;p!==null&&l(f=>[...f,p].slice(-24))},C=t.subscribe(()=>{v===null&&(v=setTimeout(M,500))});return()=>{C(),v!==null&&clearTimeout(v),R||(t.telemetryEnabled=!1)}},[t]);const a=i.at(-1)??null,m=yn(i,72,18),d=a?Math.round(1e3/a):n.fps>0?Math.round(n.fps):null,g=a??(n.fps>0?1e3/n.fps:null),u=xn(i),T=e?`${e.label}: ${d??"—"} FPS · ${g?.toFixed(1)??"—"} ms frame time · open Profiler`:"The active document has no live render loop to profile";return s.jsxs(L,{type:"button",variant:"ghost",size:"compact",className:"vgai-header-telemetry-button vgai-header-performance","data-testid":"header-performance-telemetry","data-performance-tone":u,disabled:!e,"aria-label":T,title:T,onClick:()=>Ge.open("profiler"),children:[s.jsxs("svg",{className:"vgai-performance-graph","aria-hidden":"true",viewBox:"0 0 72 18",width:"72",height:"18",children:[s.jsx("line",{className:"vgai-performance-budget",x1:"0",x2:"72",y1:18-oe/50*18,y2:18-oe/50*18}),m&&s.jsx("polyline",{className:"vgai-performance-sparkline",points:m})]}),s.jsxs("span",{className:"vgai-performance-readout",children:[s.jsxs("strong",{className:"vgai-header-fps",children:[d??"—"," FPS"]}),s.jsxs("span",{className:"vgai-header-frame-ms",children:[g?.toFixed(1)??"—"," ms"]})]})]})}function En(){return r.useSyncExternalStore(ht,be,be),gt().telemetry==="hidden"?null:s.jsxs(vt,{className:"vgai-header-telemetry vgai-chrome-island vgai-glass-island","data-island-scale":"compact",align:"center",gap:1,children:[s.jsx(Sn,{}),s.jsx(jn,{})]})}let Y=!1,re=0,w=null,N=null;const Mn=new nn(1,1,1,16,1,!0),In=new Je({color:2280686,transparent:!0,opacity:.45,side:sn,depthWrite:!1}),Rn=new on({color:16755200,transparent:!0,opacity:.9}),Dn=new rn(.12,12,8),Cn=new Je({color:16755200,depthWrite:!1}),Pn=16724804,An=2280686;let $=[];function Fe(){return Y}function Fn(e){e!==Y&&(Y=e,e?re=requestAnimationFrame(tt):(cancelAnimationFrame(re),$n()))}function tt(){if(!Y)return;re=requestAnimationFrame(tt);const e=pe(),t=e?de().navigation?.crowdAgents?.()??[]:[];if(e!==N&&(N&&w&&N.remove(w),N=e,e&&(w||(w=new fe,w.name="crowd-debug-draw",Ve(w,"editorHelper",!0)),e.add(w))),!(!w||!e)){_n(w,t.length);for(let n=0;n<t.length;n++)kn($[n],t[n])}}function _n(e,t){for(;$.length<t;){const n=new fe,o=In.clone(),i=new Re(Mn,o),l=new an(new W(1,0,0),new W,1,16755200),a=new ln(new Ye,Rn),m=new Re(Dn,Cn);n.add(i),n.add(l),e.add(n),e.add(a),e.add(m),$.push({root:n,cylinder:i,cylinderMaterial:o,arrow:l,path:a,target:m})}for(;$.length>t;){const n=$.pop();e.remove(n.root),e.remove(n.path),e.remove(n.target),n.arrow.dispose(),n.path.geometry.dispose(),n.cylinderMaterial.dispose()}}function kn(e,t){e.root.position.set(t.position.x,t.position.y,t.position.z),e.cylinder.scale.set(t.radius,t.height,t.radius),e.cylinder.position.y=t.height/2,e.cylinderMaterial.color.setHex(t.state==="invalid"?Pn:An);const n=t.corners??[];n.length>0?(e.path.visible=!0,e.path.geometry.setFromPoints([new W(t.position.x,t.position.y+.05,t.position.z),...n.map(i=>new W(i.x,i.y+.05,i.z))])):e.path.visible=!1,t.target&&n.length>0?(e.target.visible=!0,e.target.position.set(t.target.x,t.target.y+.05,t.target.z)):e.target.visible=!1;const o=Math.hypot(t.velocity.x,t.velocity.y,t.velocity.z);o>.01?(e.arrow.visible=!0,e.arrow.position.y=t.height/2,e.arrow.setDirection(new W(t.velocity.x/o,t.velocity.y/o,t.velocity.z/o)),e.arrow.setLength(Math.max(o*.5,.2))):e.arrow.visible=!1}function $n(){if(w){N?.remove(w);for(const e of $)e.arrow.dispose();w.clear()}$=[],w=null,N=null}function Tn({onPresetChange:e}){const[t,n]=r.useState(!1),o=r.useRef(null),i=Le(),l=i.kind==="fit";return s.jsxs("div",{className:"vgai-playbar-popover-anchor",children:[s.jsxs(L,{ref:o,variant:"ghost",size:"comfortable","aria-haspopup":"menu","aria-expanded":t,"aria-controls":t?"vgai-device-preset-menu":void 0,"data-testid":"device-preset-picker",onClick:()=>n(a=>!a),title:"Device preview — constrain the game to a device resolution + DPR. Phone/tablet presets show the safe area, set --vgai-safe-area-inset-top/right/bottom/left CSS vars on the game mount, and send mouse input as touch.",children:[s.jsx(ue,{icon:Et,size:"md"}),s.jsx($e,{variant:"code",children:l?"Device":`${i.width}×${i.height}`})]}),t&&s.jsxs(Q,{id:"vgai-device-preset-menu",anchorRef:o,className:"vgai-resolution-menu",gap:4,onDismiss:()=>n(!1),children:[Bt.map(a=>s.jsx(G,{role:"menuitemradio","aria-checked":a.id===i.id,"data-testid":`device-preset-${a.id}`,onSelect:()=>{e(a),n(!1)},children:a.label},a.id)),s.jsxs(G,{role:"menuitemcheckbox","aria-checked":ne(),"data-testid":"device-touch-toggle",onSelect:()=>Wt(!ne()),children:[ne()?"✓ ":" ","Pointer as touch"]})]})]})}function zn(){const e=Mt(()=>It()??null),n=Ot(e)?.capture===!0;return s.jsx(L,{type:"button",size:"compact",variant:"ghost","data-testid":"game-capture-frame",className:"vgai-frame-capture-game-button",disabled:!n,title:n?"Capture one rendered frame and open the Frame debugger":"No render-debug adapter registered for this world — frame capture is unavailable",onClick:()=>{Gt(e),Ge.open("frame")},children:"Capture frame"})}let nt={label:"Fill",width:null,height:null},ae=1,st=0;const le=new Set;function V(){st++;for(const e of le)e()}function it(e){return le.add(e),()=>{le.delete(e)}}const ot=()=>st;function rt(){return nt}function at(e){nt=e,V()}function lt(e,t){return e.width!==null||!t?e:{label:`Project — ${t.width}×${t.height}`,width:t.width,height:t.height}}function Nn(e){return e?[lt({label:"Fill",width:null,height:null},e),...Ee.filter(t=>t.width!==null)]:Ee}function ct(e){He(e.id),at(e.width===null||e.height===null?{label:"Fill",width:null,height:null}:{label:e.label,width:e.width,height:e.height})}function On(e){e!==ae&&(ae=e,V())}function Gn(){return ae}function ut(e){return Array.from(e.children).filter(t=>t.dataset?.vgaiRootSurface==="true")}function Vn(e,t,n){for(const o of t)o.contains(e)||e.appendChild(o);if(n)for(const o of ut(n))e.appendChild(o)}function Ln({name:e}){return s.jsx("div",{"data-testid":"game-instance-name",style:{flex:"0 0 auto",padding:"3px 10px",background:h.surface.chrome,color:h.content.primary,borderBottom:`1px solid ${h.boundary.default}`,fontSize:11,fontWeight:600,userSelect:"none"},children:e})}function dt({name:e,testId:t,borderLeft:n,focused:o,onFocus:i,children:l}){return s.jsxs("div",{"data-testid":t,"data-focused":o||void 0,onPointerDownCapture:i,style:{flex:1,minWidth:0,height:"100%",display:"flex",flexDirection:"column",overflow:"hidden",position:"relative",cursor:i&&!o?"pointer":void 0,...n?{borderLeft:`1px solid ${h.boundary.default}`}:{}},children:[s.jsx(Ln,{name:e}),s.jsx("div",{style:{flex:1,minHeight:0,position:"relative",display:"flex",alignItems:"center",justifyContent:"center"},children:l}),o&&s.jsx("div",{"aria-hidden":!0,style:{position:"absolute",inset:0,pointerEvents:"none",zIndex:40,border:`2px solid ${h.accent.default}`,boxShadow:`inset 0 0 0 1px ${h.accent.default}`}})]})}function Hn({index:e}){const t=r.useRef(null),n=qe(e+1),o=r.useSyncExternalStore(Xe,Qt),[i,l]=r.useState(null),a=r.useSyncExternalStore(me,J);return r.useEffect(()=>{const m=t.current;if(!m||!o)return;let d=null,g=!1;return Zt(m,n).then(u=>{g?Ie(u):(d=u,l(u))},u=>{At.error(`Failed to mount ${n}: ${u}`,"play-mode")}),()=>{g=!0,l(null),d&&Ie(d)}},[e,o]),s.jsx(dt,{name:n,testId:`game-instance-slot-${e+1}`,borderLeft:!0,focused:i!=null&&a===i,onFocus:i?()=>Ue(i):void 0,children:s.jsx("div",{ref:t,"data-vgai-instance-viewport":"",style:{position:"absolute",inset:0}})})}function Bn({style:e}){const t=r.useSyncExternalStore(Te,ze),o=X().playState!=="stopped",i=r.useRef(null);r.useSyncExternalStore(it,ot),r.useSyncExternalStore(Be,We);const l=r.useSyncExternalStore(Ut,qt),a=l>0,m=r.useSyncExternalStore(me,J),d=Le(),g=rt(),[u,T]=r.useState({width:0,height:0}),[R,E]=r.useState(0),y=r.useRef(null),D=r.useSyncExternalStore(Rt,Dt),v=r.useSyncExternalStore(Ct,Pt),M=Yt(),C=gn(),z=M.length>0?M.map(c=>c.rootId):C?[C.worldId]:D.filter(c=>c.mechanism==="host-mount").map(c=>c.rootId),P=!!(y.current&&mn(y.current)),p=M.length>0?M.some(c=>c.hasRenderableContent):P,f=M.length>0||C!==null,A=o?dn({surface:"Game",rootIds:z,phase:f?"ready":"loading",content:f?p?"present":"empty":"unknown",readiness:D,failures:v}):null;r.useEffect(()=>{if(!o||!f||p)return;const c=window.setTimeout(()=>E(x=>x+1),250);return()=>window.clearTimeout(c)},[R,p,o,f]),r.useEffect(()=>{const c=i.current;if(!c||typeof MutationObserver>"u")return;const x=new MutationObserver(()=>E(I=>I+1));return x.observe(c,{childList:!0,subtree:!0,characterData:!0}),()=>x.disconnect()},[]),r.useEffect(()=>{const c=Xt();c.width!==null&&(ct(c),V())},[]);const Z=r.useRef([]),he=r.useCallback(c=>{if(c===y.current)return;!c&&y.current&&(Z.current=ut(y.current)),c&&(Vn(c,Z.current,y.current),Z.current=[]);const x=y.current;y.current=c,c?ie().workspace.liveDocument.setContainer(c):x&&ie().workspace.liveDocument.releaseContainer(x),c?Kt(c):x&&Jt(x)},[]);r.useEffect(()=>{const c=i.current;if(!c)return;const x=new ResizeObserver(([I])=>{if(!I)return;const{width:K,height:ye}=I.contentRect;T(te=>te.width===K&&te.height===ye?te:{width:K,height:ye})});return x.observe(c),()=>x.disconnect()},[]);const mt=t?.config.resolution,F=fn(g,mt),ge=F.kind==="fill",ft=ge||a,H=F.kind==="logical"?F.width:null,B=F.kind==="logical"?F.height:null,ve=d.dpr;r.useEffect(()=>{const c=ve??en();a?u.width>0&&u.height>0&&se(u.width/(l+1),u.height,c):H===null||B===null?u.width>0&&u.height>0&&se(u.width,u.height,c):se(H,B,c)},[H,B,u.width,u.height,ve,o,a,l]);const ee=hn(u,{width:H??0,height:B??0},{allowUpscale:F.kind==="logical"&&F.allowUpscale}),_=ge?1:ee.scale;r.useEffect(()=>{On(_)},[_]);const b=d.safeArea,xe={"--vgai-safe-area-inset-top":`${b?.top??0}px`,"--vgai-safe-area-inset-right":`${b?.right??0}px`,"--vgai-safe-area-inset-bottom":`${b?.bottom??0}px`,"--vgai-safe-area-inset-left":`${b?.left??0}px`};return s.jsx("div",{style:{overflow:"hidden",position:"relative",flexDirection:"column",...e},children:s.jsxs("div",{ref:i,style:{flex:1,overflow:"hidden",display:"flex",alignItems:"center",justifyContent:"center",position:"relative"},children:[(()=>{const c=ft?s.jsx("div",{ref:he,"data-testid":"game-runtime-container","aria-hidden":"true",style:{position:"absolute",inset:0,...o?{}:{visibility:"hidden"},...xe}},"game-mount-fill"):s.jsxs("div",{style:{position:"relative",width:ee.width,height:ee.height,overflow:"hidden",...o?{}:{visibility:"hidden"}},children:[s.jsx("div",{ref:he,"data-testid":"game-runtime-container","aria-hidden":"true",style:{width:H??0,height:B??0,transformOrigin:"top left",transform:`scale(${_})`,...xe}}),b&&s.jsx("div",{"data-testid":"device-safe-area-overlay",style:{position:"absolute",inset:0,pointerEvents:"none",zIndex:2},children:[["top",b.top,{top:0,left:0,right:0,height:b.top*_}],["bottom",b.bottom,{bottom:0,left:0,right:0,height:b.bottom*_}],["left",b.left,{top:0,bottom:0,left:0,width:b.left*_}],["right",b.right,{top:0,bottom:0,right:0,width:b.right*_}]].map(([x,I,K])=>I>0?s.jsx("div",{"data-testid":`device-safe-area-${x}`,style:{position:"absolute",...K,background:h.semantic.dangerFaint,boxShadow:`inset 0 0 0 1px ${h.semantic.dangerMuted}`}},x):null)})]},"game-mount-device");return a?s.jsxs(s.Fragment,{children:[s.jsx(dt,{name:qe(0),testId:"game-instance-slot-0",focused:m===Me(),onFocus:()=>Ue(Me()),children:c}),Array.from({length:l},(x,I)=>s.jsx(Hn,{index:I},I))]}):c})(),!o&&s.jsxs("div",{"data-testid":"game-stopped-placeholder",style:{position:"absolute",inset:0,display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",gap:6,background:h.surface.shell,color:h.content.dim,fontSize:11,pointerEvents:"none"},children:[s.jsx("span",{style:{color:h.content.primary,fontSize:13},children:"Game is stopped"}),s.jsx("span",{children:"Press Play to start the composed runtime."})]}),o&&s.jsx(pn,{explanation:A,testId:"game-surface-status",style:{zIndex:30,background:h.surface.shell}})]})})}function _e(){return Ke().map(({id:e,name:t})=>`${e}\0${t}`).join("")}function Wn({instanceId:e}){const t=X();r.useSyncExternalStore(t.subscribe,t.getSnapshot,t.getSnapshot);const n=r.useSyncExternalStore(me,J,J),[,o]=r.useState(0);r.useEffect(()=>{const g=window.setInterval(()=>o(u=>u+1),250);return()=>window.clearInterval(g)},[]);const i=Qe(e),l=zt(),a=i?(i.loop.activeTimeouts??0)+(i.loop.activeIntervals??0)+(i.loop.activeAnimationFrames??0)+i.loop.pending:0,m=i?i.listeners.window+i.listeners.document:0,d=[["Mount",e],["Simulation",t.playState==="paused"?"Paused":"Running"],["Input",n===e?"Keyboard focus":"Inactive"],["Input events",i?`${i.loop.input??0} observed · ${i.loop.inputBlocked??0} blocked`:"Not measured"],["Network",l?l.getConnectionState?.()??"Not reported by this adapter":"Not registered"],["Owned callbacks",String(a)],["Owned listeners",String(m)],["Realm globals",String(i?.globals??0)],["Browser storage",i?`Shared origin · ${i.storage.local.reads+i.storage.session.reads} reads · ${i.storage.local.writes+i.storage.session.writes} writes`:"Shared origin"]];return s.jsx("div",{role:"none",style:{display:"grid",gridTemplateColumns:"112px minmax(120px, 1fr)",gap:"4px 12px",padding:"8px 10px",fontSize:10,lineHeight:"15px"},children:d.map(([g,u])=>s.jsxs("div",{style:{display:"contents"},children:[s.jsx("span",{style:{color:h.content.dim},children:g}),s.jsx("span",{style:{color:h.content.primary,fontFamily:g==="Mount"?h.typography.mono:void 0,overflow:"hidden",textOverflow:"ellipsis"},children:u})]},g))})}function Un(){r.useSyncExternalStore(Xe,_e,_e),r.useSyncExternalStore(Ft,je,je);const e=Ke(),t=_t(),n=e.find(d=>d.id===t)??e[0],[o,i]=r.useState(!1),l=r.useRef(null);if(e.length<2||!n)return null;const m=(Qe(n.id)?.loop.firedWhileHeld??0)>0;return s.jsxs("div",{className:"vgai-playbar-popover-anchor",children:[s.jsxs(L,{ref:l,variant:"ghost",size:"compact","aria-haspopup":"menu","aria-expanded":o,onClick:()=>i(d=>!d),title:`Runtime instruments inspect ${n.name}; agent-addressed commands are unchanged`,children:[s.jsx(ue,{icon:kt,size:"sm",style:{color:m?h.semantic.warning:void 0}}),s.jsxs($e,{variant:"code",children:["Inspect ",n.name]}),s.jsx(Ne,{direction:"down"})]}),o&&s.jsxs(Q,{anchorRef:l,gap:3,onDismiss:()=>i(!1),style:{minWidth:270},children:[e.map(d=>s.jsxs(G,{role:"menuitemradio","aria-checked":d.id===n.id,onSelect:()=>$t(d.id),children:[d.id===n.id?"✓ ":" ",d.name]},d.id)),s.jsx(Tt,{}),s.jsx(Wn,{instanceId:n.id})]})]})}let q=!1,ce=0,S=null,O=null,U=null,j=null,k=0;function ke(){return q}function qn(e){e!==q&&(q=e,e?ce=requestAnimationFrame(pt):(cancelAnimationFrame(ce),U?.setDebugDrawEnabled?.(!1),Yn()))}function pt(){if(!q)return;ce=requestAnimationFrame(pt);const e=pe(),t=e?Oe(de().physics):null;if(t!==U&&(U?.setDebugDrawEnabled?.(!1),U=t,t?.setDebugDrawEnabled?.(!0)),Xn(e),!S||!e)return;const n=t?.contactPoints?.()??null;Kn(S,n)}function Xn(e){e!==O&&(O&&S&&O.remove(S),O=e,e&&(S||(S=new fe,S.name="physics-debug-draw",Ve(S,"editorHelper",!0)),e.add(S)))}function Kn(e,t){const n=t?t.length/3:0;if(!j){k=64;const l=new Ye;l.setAttribute("position",new De(new Float32Array(k*3),3));const a=new cn({color:16724821,size:10,sizeAttenuation:!1,depthTest:!1,transparent:!0,opacity:.95});j=new un(l,a),j.renderOrder=999,j.frustumCulled=!1,e.add(j)}const o=j.geometry;if(n>k){for(;k<n;)k*=2;o.setAttribute("position",new De(new Float32Array(k*3),3))}const i=o.getAttribute("position");t&&n>0&&i.array.set(t),i.needsUpdate=!0,o.setDrawRange(0,n),j.visible=n>0}function Jn(){const e=pe(),n=(e?Oe(de().physics):null)?.debugDraw?.()??null;let o=!1;n&&e&&e.traverse(a=>{a===n&&(o=!0)});const i=n?.geometry.getAttribute("position"),l=j?.geometry.drawRange.count??0;return{enabled:q,wireframeInScene:o,wireframeVisible:n?.visible??!1,wireframeVertexCount:i?.count??0,contactMarkerCount:j?.visible&&Number.isFinite(l)?l:0}}typeof window<"u"&&(window.__vgaiPhysicsDebug=Jn);function Yn(){S&&(O?.remove(S),j&&(j.geometry.dispose(),j.material.dispose()),S.clear()),j=null,k=0,S=null,O=null,U=null}function Qn(){const[e,t]=r.useState(!1),n=r.useRef(null);return s.jsxs("div",{style:{position:"relative"},children:[s.jsxs(L,{ref:n,type:"button",variant:"outline",size:"compact","data-testid":"game-debug-menu","aria-haspopup":"menu","aria-expanded":e,"aria-controls":e?"vgai-game-debug-menu":void 0,onClick:()=>t(o=>!o),children:[s.jsx("span",{children:"Debug"}),s.jsx(Ne,{direction:"down"})]}),e&&s.jsxs(Q,{id:"vgai-game-debug-menu",anchorRef:n,gap:3,onDismiss:()=>t(!1),style:{minWidth:190},children:[s.jsxs(G,{onClick:()=>{Fn(!Fe()),V()},children:[Fe()?"✓ ":" ","Crowd debug draw"]}),s.jsxs(G,{onClick:()=>{qn(!ke()),V()},children:[ke()?"✓ ":" ","Physics debug draw"]})]})]})}function Zn(e){const t=r.useSyncExternalStore(Te,ze),n=X();return r.useSyncExternalStore(n.subscribe,n.getShellSnapshot??n.getSnapshot),r.useSyncExternalStore(it,ot),r.useSyncExternalStore(Be,We),s.jsxs("div",{"data-testid":"game-doc-toolbar",style:{display:"grid",alignItems:"center",gridTemplateColumns:"minmax(0, 1fr) auto minmax(0, 1fr)",width:"100%",gap:6,padding:"2px 8px"},children:[s.jsxs("div",{style:{display:"flex",alignItems:"center",minWidth:0,overflow:"auto"},children:[s.jsx(Un,{}),s.jsx(Tn,{onPresetChange:o=>{ct(o),V()}}),s.jsx(Ht,{resolution:lt(rt(),t?.config.resolution),options:Nn(t?.config.resolution),onResolutionChange:o=>{He(tn),at(o)},scale:Gn(),title:"Change game resolution"}),s.jsx(Qn,{}),n.playState!=="stopped"&&s.jsx(zn,{})]}),s.jsx(Lt,{placement:"runtime"}),s.jsx("div",{style:{display:"flex",justifyContent:"flex-end",minWidth:0},children:s.jsx(En,{})})]})}function es(e){const t=X();r.useSyncExternalStore(t.subscribe,t.getShellSnapshot??t.getSnapshot);const n=t.playState!=="stopped";return s.jsxs("div",{style:{flex:1,position:"relative",display:"flex",flexDirection:"column"},children:[s.jsx(Bn,{style:{flex:1,position:"relative",display:"flex",flexDirection:"column",pointerEvents:"auto",...t.playState==="playing"?{outline:`2px solid ${h.semantic.success}`,outlineOffset:-2}:n?{outline:`2px solid ${h.semantic.warning}`,outlineOffset:-2}:{}}}),t.playState==="paused"&&s.jsx("div",{"data-testid":"game-paused-notice",style:{position:"absolute",left:"50%",top:12,transform:"translateX(-50%)",padding:"6px 12px",borderRadius:6,background:"rgba(0,0,0,.72)",color:h.content.primary,fontSize:12,letterSpacing:".04em",pointerEvents:"none",zIndex:2},children:"Paused by the editor — press ▶ Play to resume (Escape pauses)"})]})}const ki="workspace.service";function $i(){return ie().workspace.liveDocument.register({Content:es,Toolbar:Zn})}export{ki as point,$i as start};
@@ -0,0 +1,2 @@
1
+ import{createGameModuleResolver as k,setFocusedInstanceProvider as M}from"./game-module-access-ry3xb1Ix.js";import{n as d}from"./command-results-CUQD49AB.js";import{i as g}from"./active-ingest-DEgq9JiA.js";import{i as y,q as h,t as w}from"./play-mode-DomOvQie.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";import"./game-contract-seams-TCpIMmHP.js";import"./capability-coverage-CfUeULDN.js";import"./ingest-source-persistence-DH6ioCOu.js";import"./playtest-BnFenMBW.js";import"./drei-asset-caches-jJoHXbTj.js";import"./native-debug-module-j-MekcLS.js";import"./native-entry-surface-BE8LJNdu.js";import"./debug-registry-B3Cnne3x.js";import"./instruments-IKn-vvNb.js";import"./frame-pacing-D5acoOzO.js";import"./edit-mode-authoring-D_BiHCQj.js";import"./json-history-resource-r-9q_hxP.js";import"./binding-resolver-BWwG10zJ.js";import"./adapter-surface-Y37Nzcyw.js";import"./entry-adjudication-BYy7TXOB.js";import"./r3f-root-factory-DjGnbU4n.js";import"./register-render-vitals-BO7x64kR.js";import"./render-census-BrQX_CXv.js";import"./structural-signature-0w-i_ats.js";import"./render-vitals-BZ5HtvMi.js";import"./static-batch-advisor-DqfXWRUq.js";import"./webgl-frame-capture-CRKX73E9.js";import"./world-state-ZGDGY_Xl.js";import"./frame-selector-cache-cCeUbcjG.js";import"./dev-build-gDYrq68M.js";import"./game-input-seams-BC6xhZy3.js";import"./seeded-random-CN0scLZj.js";import"./render-seed-DF4JHy7P.js";import"./frame-delta-D2nsw_Ht.js";import"./events-156d8d12.esm-C734MYnx.js";import"./index-bQE2NA0D.js";import"./realm-services-D25JHoqD.js";import"./canvas-entry-runtime-E5YjSgre.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"./relative-path-guard-GiM7Lsz8.js";import"./react-root-DGLRLr-F.js";import"./editor-presentation-activity-C7SNSmTd.js";import"./pixi-story-model-DNkfnWUV.js";import"./surface-content-Dg9Kkazf.js";import"./viewport-root-presentation-C9M98VNM.js";import"./mounted-authoring-TIN5EnCb.js";import"./three-DSsr_Lvp.js";import"./viewport-pick-context-DkawXbEi.js";import"./logger-Dqis-7W1.js";import"./run-ticks-settled-B0cTtmhQ.js";import"./three-authoring-adapter-Yqsank46.js";import"./source-persistence-backend-_-JMEXxE.js";import"./three-projection-core-kubBTx0s.js";import"./body-marks-D8iaje6y.js";import"./user-data-CZqsJDk-.js";import"./object-marks-DwvIEBOK.js";import"./structural-ids-CblajJQK.js";import"./object3d-authoring-subject-CyE4rQ2A.js";import"./rapier-physics-adapter-CaZqWLu0.js";import"./r3f-physics-binding-C8OqNRG2.js";import"./deferred-ingest-play-7V8OrW3e.js";import"./rrweb-Cd2ifIRP.js";import"./react-world-authoring-adapter-BMT9kLWU.js";import"./board-guides-C3usUZZk.js";import"./writer-BPbm4_my.js";import"./story-arg-descriptors-Ek86ExX7.js";import"./inspect-BRgDdtVk.js";import"./inference-diagnostics-YW0yJkKx.js";class E extends Error{member;supported;constructor(e,r,o){super(`playwright-shim: ${e}.${r} is not supported by the in-page shim. Supported ${e} members: ${o.join(", ")}. This shim is DOM-only — canvas gameplay input must use game.input.*, while React-only DOM games may use Page keyboard/locator input. See packages/editor/src/playwright-shim.ts for the full supported subset and the wire's closure-capture limitation.`),this.name="PageShimUnsupportedError",this.member=r,this.supported=o}}function b(t,e){const r=Object.keys(t);return new Proxy(t,{get(o,i,n){if(typeof i=="symbol"||i in o)return Reflect.get(o,i,n);throw new E(e,i,r)}})}function m(t){return t.replace(/\s+/g," ").trim()}function O(t){const e=t.tagName.toLowerCase();if(e==="button")return"button";if(e==="a"&&t.hasAttribute("href"))return"link";if(/^h[1-6]$/.test(e))return"heading";if(e==="textarea")return"textbox";if(e==="select")return"combobox";if(e==="img")return"img";if(e==="input"){const r=(t.getAttribute("type")??"text").toLowerCase();return r==="button"||r==="submit"||r==="reset"?"button":r==="checkbox"?"checkbox":r==="radio"?"radio":"textbox"}return null}function v(t){return t.getAttribute("role")??O(t)}function S(t){const e=t.getAttribute("aria-label");return e&&e.trim()?m(e):m(t.textContent??"")}function T(t,e){if(e===void 0)return!0;const r=S(t);return e instanceof RegExp?e.test(r):r===e}function x(t,e,r){return Array.from(t.querySelectorAll("*")).filter(i=>v(i)===e&&T(i,r?.name))}function I(t,e){const r=Array.from(t.querySelectorAll("*")).filter(n=>n.tagName!=="SCRIPT"&&n.tagName!=="STYLE"),o=n=>{const s=m(n.textContent??"");return s.length===0?!1:e instanceof RegExp?e.test(s):s.includes(e)},i=r.filter(o);return i.filter(n=>!i.some(s=>s!==n&&n.contains(s)))}function C(t,e){return Array.from(t.querySelectorAll("[data-testid]")).filter(r=>{const o=r.getAttribute("data-testid")??"";return e instanceof RegExp?e.test(o):o===e})}function L(t){if(!(t instanceof HTMLElement))return!0;if(t.hidden)return!1;const e=getComputedStyle(t);return e.display!=="none"&&e.visibility!=="hidden"&&e.opacity!=="0"}function _(t){const e=t.getBoundingClientRect?.()??{left:0,top:0,width:0,height:0},r=e.left+e.width/2,o=e.top+e.height/2,i={bubbles:!0,cancelable:!0,clientX:r,clientY:o,button:0};typeof PointerEvent<"u"&&t.dispatchEvent(new PointerEvent("pointerdown",{...i,pointerId:1,isPrimary:!0})),t.dispatchEvent(new MouseEvent("mousedown",i)),typeof PointerEvent<"u"&&t.dispatchEvent(new PointerEvent("pointerup",{...i,pointerId:1,isPrimary:!0})),t.dispatchEvent(new MouseEvent("mouseup",i)),t.dispatchEvent(new MouseEvent("click",i))}function N(t){const e=t instanceof HTMLTextAreaElement?HTMLTextAreaElement.prototype:HTMLInputElement.prototype,r=Object.getOwnPropertyDescriptor(e,"value");return o=>{r?.set?r.set.call(t,o):t.value=o}}function G(t,e){if(!(t instanceof HTMLInputElement)&&!(t instanceof HTMLTextAreaElement))throw new Error(`playwright-shim: fill() target is not an <input>/<textarea> (got <${t.tagName.toLowerCase()}>)`);t.focus(),N(t)(e),t.dispatchEvent(new Event("input",{bubbles:!0})),t.dispatchEvent(new Event("change",{bubbles:!0}))}const l=new Set(["Alt","Control","Meta","Shift"]);function p(t){return t!=="ControlOrMeta"?t:/Mac|iPhone|iPad/.test(navigator.platform)?"Meta":"Control"}function B(t){return/^[a-z]$/i.test(t)?`Key${t.toUpperCase()}`:/^[0-9]$/.test(t)?`Digit${t}`:t===" "?"Space":t}function K(t){const e=document.activeElement;return e instanceof HTMLElement&&t.contains(e)?e:t}function f(t,e,r,o){K(t).dispatchEvent(new KeyboardEvent(e,{key:r,code:B(r),bubbles:!0,cancelable:!0,altKey:o.has("Alt"),ctrlKey:o.has("Control"),metaKey:o.has("Meta"),shiftKey:o.has("Shift")}))}function F(t){const e=new Set,r=async i=>{const n=p(i);e.add(n),f(t,"keydown",n,e)},o=async i=>{const n=p(i);f(t,"keyup",n,e),e.delete(n)};return{down:r,up:o,async press(i){const n=i.split("+").map(p),s=n.filter(c=>l.has(c)),a=n.find(c=>!l.has(c));for(const c of s)await r(c);a&&(await r(a),await o(a));for(const c of s.reverse())await o(c)}}}function R(t){const e=[];function r(o,i){const n=v(o);if(n){const a=S(o);e.push(`${" ".repeat(i)}- ${n}${a?` "${a}"`:""}`)}const s=n?i+1:i;for(const a of Array.from(o.children))r(a,s)}for(const o of Array.from(t.children))r(o,0);return e.join(`
2
+ `)}function u(t,e){const r=i=>{const n=t()[0];if(!n)throw new Error(`playwright-shim: ${i}() found no element for ${e}`);return n};return b({async click(){_(r("click"))},async fill(i){G(r("fill"),i)},async textContent(){const i=t()[0];return i?i.textContent??null:null},async evaluate(i,n){return i(r("evaluate"),n)},async count(){return t().length},async waitFor(i){const n=i?.timeout??5e3,s=i?.state??"visible",a=Date.now()+n;for(;;){const c=t()[0];if(c&&(s==="attached"||L(c)))return;if(Date.now()>=a)throw new Error(`playwright-shim: waitFor() timed out after ${n}ms waiting for ${e} to be ${s}`);await new Promise(P=>setTimeout(P,50))}},first(){return u(()=>t().slice(0,1),`${e}.first()`)},nth(i){return u(()=>{const n=t()[i];return n?[n]:[]},`${e}.nth(${i})`)},async ariaSnapshot(){return R(r("ariaSnapshot"))}},"Locator")}async function D(t,e){if(typeof t=="function")return t(e);if(typeof t=="string")return new Function("arg",`return (${t})(arg)`)(e);throw new Error("playwright-shim: evaluate() requires a function or a function-source string")}function A(t){const e={keyboard:F(t),evaluate:async(r,o)=>D(r,o),locator:r=>u(()=>Array.from(t.querySelectorAll(r)),`locator(${JSON.stringify(r)})`),getByRole:(r,o)=>u(()=>x(t,r,o),`getByRole(${JSON.stringify(r)}${o?.name!==void 0?`, {name: ${JSON.stringify(String(o.name))}}`:""})`),getByText:r=>u(()=>I(t,r),`getByText(${JSON.stringify(String(r))})`),getByTestId:r=>u(()=>C(t,r),`getByTestId(${JSON.stringify(String(r))})`),click:async r=>{await e.locator(r).click()},fill:async(r,o)=>{await e.locator(r).fill(o)},ariaSnapshot:async()=>R(t)};return b(e,"Page")}const ye="workspace.command";typeof window<"u"&&(M(w),window.__vgaiGameEval=async(t,e)=>{const r=await $({src:t,...e===void 0?{}:{instance:e}});if(!r.ok)throw new Error(r.error??"game-eval failed");return r.data?.result??null});async function $(t){if(!y()&&!g())return d();const e=t.src;if(typeof e!="string")return{ok:!1,error:`game-eval requires a string "src" (the step's toString())`};const r=h();if(!r)return{ok:!1,error:"game-eval: no play-mode game container is mounted yet",data:{code:"GAME_EVAL_ERROR"}};const o=t.instance,i=typeof o=="string"?o:void 0;let n;try{n=new Function("scope",`return (${e})(scope)`)}catch(a){return{ok:!1,error:`game-eval: failed to reconstruct the step function from source — ${a instanceof Error?a.message:String(a)}`,data:{code:"GAME_EVAL_ERROR"}}}const s={page:A(r),modules:k(i),instanceId:i??w()};try{const a=await n(s),c=a===void 0?null:a;try{JSON.stringify(c)}catch{return{ok:!1,error:`game-eval: the step returned an unserializable value (${Object.prototype.toString.call(c)}) — return plain data (numbers, strings, arrays, plain objects), not live module objects.`,data:{code:"GAME_EVAL_UNSERIALIZABLE"}}}return{ok:!0,data:{result:c}}}catch(a){return{ok:!1,error:`game-eval step failed: ${a instanceof Error?a.stack??a.message:String(a)}`,data:{code:"GAME_EVAL_ERROR"}}}}async function H(t){if(!y()&&!g())return d();const e=t.src;if(typeof e!="string")return{ok:!1,error:`page-script requires a string "src" (the step's toString())`};const r=h();if(!r)return{ok:!1,error:"page-script: no play-mode game container is mounted yet",data:{code:"PAGE_SCRIPT_ERROR"}};let o;try{o=new Function("page",`return (${e})(page)`)}catch(n){return{ok:!1,error:`page-script: failed to reconstruct the step function from source — ${n instanceof Error?n.message:String(n)}`,data:{code:"PAGE_SCRIPT_ERROR"}}}const i=A(r);try{const n=await o(i);return{ok:!0,data:{result:n===void 0?null:n}}}catch(n){return n instanceof E?{ok:!1,error:n.message,data:{code:"PAGE_SHIM_UNSUPPORTED",member:n.member,supported:[...n.supported]}}:{ok:!1,error:`page-script: step threw — ${n instanceof Error?n.message:String(n)}`,data:{code:"PAGE_SCRIPT_ERROR"}}}}const he={"game-eval":{timeoutMs:6e4,derivedRefresh:"always",handle:$},"page-script":{timeoutMs:6e4,derivedRefresh:"always",handle:H}};export{he as commands,ye as point};
@@ -1 +1 @@
1
- import{getSeededRandom as d}from"./seeded-random-i3mtgBKZ.js";import"./render-seed-DF4JHy7P.js";import"./debug-registry-Dgvitx8M.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 c="/inputmaps/default.inputmap.json";function w(r,p,u){const{id:o,inputMapPath:a=c,optionalInputMap:s=!1}=u;if(!r.game)return Promise.resolve();const n=r.game,i=n.input;return p.setInputActionsSource(o,()=>i.actionNames().map(t=>({name:t,valueType:i.getActionValueType(t)}))),p.setInputTraceSource(o,()=>{const t=i.getInputTrace();return{version:t.version,seed:d(n)?.seed??null,fixedDt:n.loop.fixedDt,ticks:t.ticks}}),p.setVirtualInputTarget(o,{setVirtualAction:(t,e)=>i.setVirtualAction(t,e),tapVirtualAction:t=>i.tapVirtualAction(t),clearVirtualActions:()=>i.clearVirtualActions(),scheduleActionAtTick:(t,e,l)=>i.scheduleActionAtTick(t,e,l),startInputRecording:()=>i.startInputRecording(),stopInputRecording:()=>i.stopInputRecording(),isInputRecording:()=>i.isInputRecording(),injectAxis:(t,e)=>i.injectAxis(t,e),injectVector2:(t,e)=>i.injectVector2(t,e),injectPointerDelta:(t,e)=>i.injectPointerDelta(t,e),injectPointerPosition:(t,e)=>i.injectPointerPosition(t,e)}),r.headless||a===null?Promise.resolve():(s?n.loadInputMap(a,{optional:!0}):n.loadInputMap(a)).catch(t=>{console.error(`world "${o}": failed to load input map "${a}" — declared input actions and \`game.input.*\` (bot/virtual input) will not work until a valid map loads. Ship one at the conventional path (${c}). Cause: ${t instanceof Error?t.message:String(t)}`)})}export{c as DEFAULT_INPUT_MAP_PATH,w as wireGameInputSeams};
1
+ import{getSeededRandom as d}from"./seeded-random-CN0scLZj.js";import"./render-seed-DF4JHy7P.js";import"./debug-registry-B3Cnne3x.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 c="/inputmaps/default.inputmap.json";function w(r,p,u){const{id:o,inputMapPath:a=c,optionalInputMap:s=!1}=u;if(!r.game)return Promise.resolve();const n=r.game,i=n.input;return p.setInputActionsSource(o,()=>i.actionNames().map(t=>({name:t,valueType:i.getActionValueType(t)}))),p.setInputTraceSource(o,()=>{const t=i.getInputTrace();return{version:t.version,seed:d(n)?.seed??null,fixedDt:n.loop.fixedDt,ticks:t.ticks}}),p.setVirtualInputTarget(o,{setVirtualAction:(t,e)=>i.setVirtualAction(t,e),tapVirtualAction:t=>i.tapVirtualAction(t),clearVirtualActions:()=>i.clearVirtualActions(),scheduleActionAtTick:(t,e,l)=>i.scheduleActionAtTick(t,e,l),startInputRecording:()=>i.startInputRecording(),stopInputRecording:()=>i.stopInputRecording(),isInputRecording:()=>i.isInputRecording(),injectAxis:(t,e)=>i.injectAxis(t,e),injectVector2:(t,e)=>i.injectVector2(t,e),injectPointerDelta:(t,e)=>i.injectPointerDelta(t,e),injectPointerPosition:(t,e)=>i.injectPointerPosition(t,e)}),r.headless||a===null?Promise.resolve():(s?n.loadInputMap(a,{optional:!0}):n.loadInputMap(a)).catch(t=>{console.error(`world "${o}": failed to load input map "${a}" — declared input actions and \`game.input.*\` (bot/virtual input) will not work until a valid map loads. Ship one at the conventional path (${c}). Cause: ${t instanceof Error?t.message:String(t)}`)})}export{c as DEFAULT_INPUT_MAP_PATH,w as wireGameInputSeams};
@@ -1 +1 @@
1
- import{B as d}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="vgai-mount";let i=null;function u(t){return globalThis.__vgaiGameModuleUrls?.(t)??[]}function b(t){i=t}function h(t){const o=t.replace(/^\/+/,"");if(!o.startsWith("src/")||/[?#]/.test(o))throw new Error(`modules("${t}"): pass the project-relative served path, starting "src/" with its real extension and no query — e.g. modules("src/sim/host.ts").`);return o}function m(t){const o=u(t).flatMap(r=>{const{pathname:e,searchParams:a}=new URL(r);if(a.get(l)!==t)return[];const s=e.lastIndexOf("/src/");return s===-1?[]:[e.slice(s+1)]});return[...new Set(o)].sort()}function O(t){const o=r=>p(r,w(r,t));return Object.defineProperty(o,"loaded",{enumerable:!0,get:()=>{const r=t??i?.();return r?m(r):[]}}),o}const f=new Set(["then","catch","finally","constructor","toJSON"]);function p(t,o){return new Proxy(o,{get(r,e){if(e==="then"||e==="catch"||e==="finally")return Reflect.get(r,e).bind(r);if(typeof e=="symbol"||f.has(e))return Reflect.get(r,e);throw new Error(`modules("${t}") returns a PROMISE — it dynamic-imports the running mount's own copy of that module — so \`.${String(e)}\` reads a promise, not your export. Await it: \`const m = await modules("${t}"); m.${String(e)}\` (and make the \`game.run\` callback \`async\`).`)}})}async function w(t,o){const r=h(t),e=o??i?.();if(!e)throw new Error(`modules(): no play instance is mounted — enter Play first (${d("play")}).`);const a=`/${r}`,s=u(e).find(n=>{const c=new URL(n);return c.pathname.endsWith(a)&&c.searchParams.get(l)===e});if(!s){const n=m(e);throw new Error(`modules("${t}"): the running mount has not loaded that module (nothing to reach — a module the game never imported has no live instance). Loaded project modules (also readable as modules.loaded): ${n.join(", ")||"(none yet — play first)"}`)}try{return await import(s)}catch(n){throw new Error(`modules("${t}") could not load ${s} — the path must be the exact served file (check the extension: .ts vs .tsx). ${n instanceof Error?n.message:String(n)}`)}}export{O as createGameModuleResolver,w as importGameModule,m as loadedGameModulePaths,h as normalizeGameModulePath,b as setFocusedInstanceProvider};
1
+ import{B as d}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="vgai-mount";let i=null;function u(t){return globalThis.__vgaiGameModuleUrls?.(t)??[]}function b(t){i=t}function h(t){const o=t.replace(/^\/+/,"");if(!o.startsWith("src/")||/[?#]/.test(o))throw new Error(`modules("${t}"): pass the project-relative served path, starting "src/" with its real extension and no query — e.g. modules("src/sim/host.ts").`);return o}function m(t){const o=u(t).flatMap(r=>{const{pathname:e,searchParams:a}=new URL(r);if(a.get(l)!==t)return[];const s=e.lastIndexOf("/src/");return s===-1?[]:[e.slice(s+1)]});return[...new Set(o)].sort()}function O(t){const o=r=>p(r,w(r,t));return Object.defineProperty(o,"loaded",{enumerable:!0,get:()=>{const r=t??i?.();return r?m(r):[]}}),o}const f=new Set(["then","catch","finally","constructor","toJSON"]);function p(t,o){return new Proxy(o,{get(r,e){if(e==="then"||e==="catch"||e==="finally")return Reflect.get(r,e).bind(r);if(typeof e=="symbol"||f.has(e))return Reflect.get(r,e);throw new Error(`modules("${t}") returns a PROMISE — it dynamic-imports the running mount's own copy of that module — so \`.${String(e)}\` reads a promise, not your export. Await it: \`const m = await modules("${t}"); m.${String(e)}\` (and make the \`game.run\` callback \`async\`).`)}})}async function w(t,o){const r=h(t),e=o??i?.();if(!e)throw new Error(`modules(): no play instance is mounted — enter Play first (${d("play")}).`);const a=`/${r}`,s=u(e).find(n=>{const c=new URL(n);return c.pathname.endsWith(a)&&c.searchParams.get(l)===e});if(!s){const n=m(e);throw new Error(`modules("${t}"): the running mount has not loaded that module (nothing to reach — a module the game never imported has no live instance). Loaded project modules (also readable as modules.loaded): ${n.join(", ")||"(none yet — play first)"}`)}try{return await import(s)}catch(n){throw new Error(`modules("${t}") could not load ${s} — the path must be the exact served file (check the extension: .ts vs .tsx). ${n instanceof Error?n.message:String(n)}`)}}export{O as createGameModuleResolver,w as importGameModule,m as loadedGameModulePaths,h as normalizeGameModulePath,b as setFocusedInstanceProvider};
@@ -1 +1 @@
1
- import{pcmStats as A}from"./wav-encode-D31zWF6O.js";import{a1 as x,a0 as y}from"./index-GIL7oGEO.js";import{c as C,B as I,O,W as S,C as F,Q as g,d as V,e as k}from"./output-DK8waum9.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 u="opus",R=128e3;function z(e){const r=e.fps??30;if(!Number.isInteger(r)||r<1||r>60||60%r!==0)throw new Error("Video export FPS must be a positive divisor of 60.");if(!Number.isSafeInteger(e.frames)||e.frames<1)throw new Error("Video export frames must be a positive safe integer.");if(e.frames/r>300)throw new Error("Video export is limited to five minutes per file.");return r}async function U(e){if(!await C("vp9",{width:e.clientWidth,height:e.clientHeight}))throw new Error("This browser cannot encode VP9 video at the game resolution.")}async function G(e,r,t){const{buffer:a}=await e.render(e.startSeconds,e.startSeconds+r),d=a.length/a.sampleRate;if(Math.abs(d-r)>1/t)throw new Error(`Offline audio render returned ${d.toFixed(4)}s for a ${r.toFixed(4)}s export window (tolerance one frame, ${(1/t).toFixed(4)}s).`);if(!await k(u,{numberOfChannels:a.numberOfChannels,sampleRate:a.sampleRate}))throw new Error(`This browser cannot encode ${u} at ${a.sampleRate} Hz, ${a.numberOfChannels} channel(s).`);const i=[];for(let s=0;s<a.numberOfChannels;s++)i.push(a.getChannelData(s));const o=A(i);return{buffer:a,track:{codec:u,sampleRate:a.sampleRate,channels:a.numberOfChannels,durationSeconds:d,rms:o.rms,peak:o.peak}}}async function _(e,r,t){const a=z(r),d=performance.now(),i=e.ownerDocument.createElement("canvas");if(i.width=e.clientWidth,i.height=e.clientHeight,i.width<1||i.height<1)throw new Error("Game surface has no exportable size.");const o=i.width,s=i.height,v=r.frames/a,m=t.audio?await G(t.audio,v,a):null;t.signal?.throwIfAborted(),t.assertActive();let c=null;const w=new I,n=new O({target:w,format:new S}),l=new F(i,{codec:"vp9",quality:new g({bitrate:3e6})});n.addVideoTrack(l,{frameRate:a}),m&&(c=new V({codec:u,quality:new g({bitrate:R})}),n.addAudioTrack(c));const E=y();let h=null;const p=()=>{h??=n.cancel()};t.signal?.addEventListener("abort",p,{once:!0});try{t.signal?.throwIfAborted(),await n.start(),c&&m&&(await c.add(m.buffer),c.close(),t.signal?.throwIfAborted());for(let f=0;f<r.frames;f++){if(t.signal?.throwIfAborted(),t.assertActive(),!e.isConnected)throw new Error("Game surface was removed during video export.");if(e.clientWidth!==o||e.clientHeight!==s)throw new Error("Game surface resized during video export.");if(f>0)for(let b=0;b<60/a;b++)t.step();if(await x(e,i,{size:{width:o,height:s},snapshots:E,canvasFrame:t.canvasFrame}),t.signal?.throwIfAborted(),t.assertActive(),e.clientWidth!==o||e.clientHeight!==s)throw new Error("Game surface resized during video export.");await l.add(f/a,1/a,{keyFrame:f%(a*2)===0})}if(t.assertActive(),t.signal?.throwIfAborted(),await n.finalize(),t.signal?.throwIfAborted(),t.assertActive(),!w.buffer)throw new Error("Video encoder produced no output.");return{blob:new Blob([w.buffer],{type:"video/webm"}),frames:r.frames,fps:a,durationMs:r.frames*1e3/a,wallMs:performance.now()-d,width:o,height:s,audio:m?.track??!1}}catch(f){throw h?await h:n.state!=="finalized"&&await n.cancel(),f}finally{t.signal?.removeEventListener("abort",p)}}export{U as assertGameplayVideoSupport,_ as exportGameplayVideo,z as validateGameplayExport};
1
+ import{pcmStats as A}from"./wav-encode-D31zWF6O.js";import{a2 as x,a1 as y}from"./index-Ckxb31Yz.js";import{c as C,B as I,O,W as S,C as F,Q as g,d as V,e as k}from"./output-DK8waum9.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 u="opus",R=128e3;function z(e){const r=e.fps??30;if(!Number.isInteger(r)||r<1||r>60||60%r!==0)throw new Error("Video export FPS must be a positive divisor of 60.");if(!Number.isSafeInteger(e.frames)||e.frames<1)throw new Error("Video export frames must be a positive safe integer.");if(e.frames/r>300)throw new Error("Video export is limited to five minutes per file.");return r}async function U(e){if(!await C("vp9",{width:e.clientWidth,height:e.clientHeight}))throw new Error("This browser cannot encode VP9 video at the game resolution.")}async function G(e,r,t){const{buffer:a}=await e.render(e.startSeconds,e.startSeconds+r),d=a.length/a.sampleRate;if(Math.abs(d-r)>1/t)throw new Error(`Offline audio render returned ${d.toFixed(4)}s for a ${r.toFixed(4)}s export window (tolerance one frame, ${(1/t).toFixed(4)}s).`);if(!await k(u,{numberOfChannels:a.numberOfChannels,sampleRate:a.sampleRate}))throw new Error(`This browser cannot encode ${u} at ${a.sampleRate} Hz, ${a.numberOfChannels} channel(s).`);const i=[];for(let s=0;s<a.numberOfChannels;s++)i.push(a.getChannelData(s));const o=A(i);return{buffer:a,track:{codec:u,sampleRate:a.sampleRate,channels:a.numberOfChannels,durationSeconds:d,rms:o.rms,peak:o.peak}}}async function _(e,r,t){const a=z(r),d=performance.now(),i=e.ownerDocument.createElement("canvas");if(i.width=e.clientWidth,i.height=e.clientHeight,i.width<1||i.height<1)throw new Error("Game surface has no exportable size.");const o=i.width,s=i.height,v=r.frames/a,m=t.audio?await G(t.audio,v,a):null;t.signal?.throwIfAborted(),t.assertActive();let c=null;const w=new I,n=new O({target:w,format:new S}),l=new F(i,{codec:"vp9",quality:new g({bitrate:3e6})});n.addVideoTrack(l,{frameRate:a}),m&&(c=new V({codec:u,quality:new g({bitrate:R})}),n.addAudioTrack(c));const E=y();let h=null;const p=()=>{h??=n.cancel()};t.signal?.addEventListener("abort",p,{once:!0});try{t.signal?.throwIfAborted(),await n.start(),c&&m&&(await c.add(m.buffer),c.close(),t.signal?.throwIfAborted());for(let f=0;f<r.frames;f++){if(t.signal?.throwIfAborted(),t.assertActive(),!e.isConnected)throw new Error("Game surface was removed during video export.");if(e.clientWidth!==o||e.clientHeight!==s)throw new Error("Game surface resized during video export.");if(f>0)for(let b=0;b<60/a;b++)t.step();if(await x(e,i,{size:{width:o,height:s},snapshots:E,canvasFrame:t.canvasFrame}),t.signal?.throwIfAborted(),t.assertActive(),e.clientWidth!==o||e.clientHeight!==s)throw new Error("Game surface resized during video export.");await l.add(f/a,1/a,{keyFrame:f%(a*2)===0})}if(t.assertActive(),t.signal?.throwIfAborted(),await n.finalize(),t.signal?.throwIfAborted(),t.assertActive(),!w.buffer)throw new Error("Video encoder produced no output.");return{blob:new Blob([w.buffer],{type:"video/webm"}),frames:r.frames,fps:a,durationMs:r.frames*1e3/a,wallMs:performance.now()-d,width:o,height:s,audio:m?.track??!1}}catch(f){throw h?await h:n.state!=="finalized"&&await n.cancel(),f}finally{t.signal?.removeEventListener("abort",p)}}export{U as assertGameplayVideoSupport,_ as exportGameplayVideo,z as validateGameplayExport};
@@ -0,0 +1 @@
1
+ import{R as N,E as P}from"./rrweb-Cd2ifIRP.js";import{$ as C,a0 as L,a1 as F,a2 as O}from"./index-Ckxb31Yz.js";import{B as U,O as $,W as B,C as D,Q as A,I,a as W,U as H,A as V,b as q}from"./output-DK8waum9.js";function x(e,r){const o=new URLSearchParams({replay:e,file:r});return`${C}/recording/replay-file?${o}`}async function T(e,r){const o=await fetch(x(e,r));if(!o.ok)throw new Error(`could not load replay ${r}: HTTP ${o.status}`);return o.text()}function z(e){return new Promise((r,o)=>{const s=new FileReader;s.onload=()=>r(String(s.result)),s.onerror=()=>o(s.error??new Error("could not read replay asset")),s.readAsDataURL(e)})}async function j(e){let r=await T(e,"events.json");const o=new Set(r.match(/https:\/\/replay-assets\.invalid\/\d{6}\.(?:png|jpg|webp|gif|svg)/g)??[]),s=await Promise.all([...o].map(async a=>{const i=a.split("/").at(-1),n=await fetch(x(e,`assets/${i}`));if(!n.ok)throw new Error(`could not load replay asset ${i}`);return[a,await z(await n.blob())]}));for(const[a,i]of s)r=r.replaceAll(a,i);const t=JSON.parse(r);if(!Array.isArray(t)||t.length===0)throw new Error("replay contains no DOM events");return t}function G(e,r,o){return Math.max(0,e.videoStartEpochMs+o-r[0].timestamp)}function _(e,r,o){const s=e.videoStartEpochMs+o;let t={rect:e.canvas,drawingWidth:e.canvas.drawingWidth,drawingHeight:e.canvas.drawingHeight};for(const a of r){if(a.timestamp>s)break;a.type===P.Custom&&a.data.tag==="vgai-canvas-layout"&&a.data.payload&&typeof a.data.payload=="object"&&"rect"in a.data.payload&&"drawingWidth"in a.data.payload&&"drawingHeight"in a.data.payload&&(t=a.data.payload)}return t}async function J(e,r){await new Promise((o,s)=>{const t=()=>{clearTimeout(n),e.removeEventListener("loadeddata",a),e.removeEventListener("error",i)},a=()=>{t(),o()},i=()=>{t(),s(new Error("replay video failed to load"))},n=setTimeout(()=>{t(),s(new Error("replay video load timed out"))},15e3);e.readyState>=HTMLMediaElement.HAVE_CURRENT_DATA?a():(e.addEventListener("loadeddata",a,{once:!0}),e.addEventListener("error",i,{once:!0}))}),!(Math.abs(e.currentTime-r)<.001)&&await new Promise((o,s)=>{const t=()=>{clearTimeout(n),e.removeEventListener("seeked",a),e.removeEventListener("error",i)},a=()=>{t(),o()},i=()=>{t(),s(new Error("replay video seek failed"))},n=setTimeout(()=>{t(),s(new Error("replay video seek timed out"))},15e3);e.addEventListener("seeked",a,{once:!0}),e.addEventListener("error",i,{once:!0}),e.currentTime=r})}async function Q(e){e.fonts.size>0&&e.fonts.status!=="loaded"&&await Promise.race([e.fonts.ready.then(()=>{}),new Promise(r=>setTimeout(r,3e3))]),await Promise.all(Array.from(e.images,r=>r.decode().catch(()=>{})))}async function S(e,r){const[o,s]=await Promise.all([T(e,"manifest.json"),j(e)]),t=JSON.parse(o);if(t.status!=="complete"||t.format!=="canvas-dom"||t.version!==1||!t.capture||typeof t.capture.durationMs!="number")throw new Error("replay manifest is incomplete or unsupported");const a=document.createElement("div");a.setAttribute("data-vgai-replay-block",""),Object.assign(a.style,{position:"fixed",left:"-100000px",top:"0",width:`${t.viewport.width}px`,height:`${t.viewport.height}px`,overflow:"hidden",pointerEvents:"none"});const i=document.createElement("div");a.append(i),document.body.append(a);const n=document.createElement("video");n.muted=!0,n.preload="auto",n.playsInline=!0,n.src=x(e,"video"),a.append(n);let w;try{w=new N(s,{root:i,showWarning:!1,showDebug:!1,mouseTail:!1,UNSAFE_replayCanvas:!0,insertStyleRules:["[data-vgai-replay-video] { visibility: hidden !important; }"]});const f=w;return await r({manifest:t,async render(u){const h=Math.max(0,Math.min(u,t.capture.durationMs));await J(n,h/1e3),f.pause(G(t,s,h)),await Q(f.iframe.contentDocument);const y=f.getMirror().getNode(t.canvas.nodeId),p=f.getMirror().getNode(t.surfaceNodeId);if(!y||y.tagName!=="CANVAS")throw new Error("replay canvas placeholder is unavailable");if(!p||typeof p.getBoundingClientRect!="function")throw new Error("replay game surface is unavailable");const c=y,g=p;c.setAttribute("data-vgai-root-surface","true");const E=_(t,s,h);c.width=E.drawingWidth,c.height=E.drawingHeight;const d=c.getContext("2d");if(!d)throw new Error("replay canvas has no 2D context");return d.drawImage(n,0,0,c.width,c.height),c.style.setProperty("visibility","visible","important"),g}})}finally{n.pause(),w?.destroy(),n.removeAttribute("src"),n.load(),a.remove()}}async function Z(e,r){return S(e,async({manifest:o,render:s})=>{const t=Math.max(0,Math.min(r,o.capture.durationMs)),a=await s(t),i=await L(a),n=a.getBoundingClientRect();return{...i,replayPath:e,positionMs:t,width:Math.max(1,Math.round(n.width)),height:Math.max(1,Math.round(n.height))}})}async function ee(e){const r=e.fps??30;if(!Number.isInteger(r)||r<1||r>60)throw new Error("replay export fps must be an integer from 1 to 60");return S(e.replayPath,async({manifest:o,render:s})=>{const t=e.startMs??0,a=e.endMs??o.capture.durationMs;if(!Number.isFinite(t)||!Number.isFinite(a)||t<0||a<=t||a>o.capture.durationMs||a-t>3e5)throw new Error("replay export requires a valid recorded interval of at most five minutes");const i=t/1e3,n=a/1e3,w=Math.ceil((n-i)*r),f=await s(t),u=document.createElement("canvas"),h=f.getBoundingClientRect();u.width=Math.max(1,Math.round(h.width)),u.height=Math.max(1,Math.round(h.height));const y={width:u.width,height:u.height},p=new U,c=new $({target:p,format:new B}),g=new D(u,{codec:"vp9",quality:new A({bitrate:3e6})});c.addVideoTrack(g,{frameRate:r});const E=new I({source:new H(x(e.replayPath,"video")),formats:[W]});try{const d=await E.getPrimaryAudioTrack();if(o.capture.audio&&!d)throw new Error("recorded audio track is missing");const M=d?new V({codec:"opus",quality:new A({bitrate:128e3})}):null;M&&c.addAudioTrack(M),await c.start();const R=async()=>{if(!(!M||!d)){for await(const l of new q(d).samples(i,n))try{const m=Math.max(0,Math.ceil((i-l.timestamp)*l.sampleRate)),v=Math.min(l.numberOfFrames,Math.ceil((n-l.timestamp)*l.sampleRate));if(v<=m)continue;const b=l.trim(m,v);try{b.setTimestamp(Math.max(0,b.timestamp-i)),await M.add(b)}finally{b.close()}}finally{l.close()}M.close()}},k=async()=>{const l=F();for(let m=0;m<w;m++){const v=m/r;await O(await s(t+v*1e3),u,{size:y,snapshots:l}),await g.add(v,Math.min(1/r,n-i-v),{keyFrame:m%(r*2)===0})}g.close()};if(await Promise.all([R(),k()]),await c.finalize(),!p.buffer)throw new Error("replay encoder produced no output");return{blob:new Blob([p.buffer],{type:"video/webm"}),frames:w,fps:r,durationMs:a-t,...y,audio:d!==null}}catch(d){throw c.state!=="finalized"&&await c.cancel(),d}finally{E.dispose()}})}export{Z as c,ee as e};
@@ -1,3 +1,3 @@
1
- import{c as i}from"./debug-registry-Dgvitx8M.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";function m(r){if(!r)return"<unknown call site — no stack captured>";const t=r.split(`
1
+ import{c as i}from"./debug-registry-B3Cnne3x.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";function m(r){if(!r)return"<unknown call site — no stack captured>";const t=r.split(`
2
2
  `);return(t[2]??t[1]??t[0]??"<unknown call site>").trim()}function S(r=t=>{console.warn(t)}){const t=new Set;let e;function a(){const n=m(new Error().stack);return t.has(n)||(t.add(n),r(`[determinism] the global Math.random generator was drawn from during a gameplay frame while this project declares determinism.seededRandom — use ctx.random() / ctx.random.stream(name) instead. Call site:
3
3
  ${n}`)),e()}return{enable(){e=Math.random,Math.random=a},disable(){Math.random===a&&e&&(Math.random=e,e=void 0)}}}const o=i("gameplay-rng-trap");function M(r,t){o.set(r,t)}function k(r){return o.get(r)??null}export{S as createGameplayRngTrap,k as getGameplayRngTrapControl,M as registerGameplayRngTrapControl};
@@ -0,0 +1 @@
1
+ import{ae as a}from"./index-Ckxb31Yz.js";import{s as n,n as s}from"./command-results-CUQD49AB.js";import{g as m,i as p}from"./play-mode-DomOvQie.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"./drei-asset-caches-jJoHXbTj.js";import"./native-debug-module-j-MekcLS.js";import"./native-entry-surface-BE8LJNdu.js";import"./debug-registry-B3Cnne3x.js";import"./playtest-BnFenMBW.js";import"./game-contract-seams-TCpIMmHP.js";import"./instruments-IKn-vvNb.js";import"./frame-pacing-D5acoOzO.js";import"./edit-mode-authoring-D_BiHCQj.js";import"./json-history-resource-r-9q_hxP.js";import"./binding-resolver-BWwG10zJ.js";import"./adapter-surface-Y37Nzcyw.js";import"./entry-adjudication-BYy7TXOB.js";import"./r3f-root-factory-DjGnbU4n.js";import"./register-render-vitals-BO7x64kR.js";import"./render-census-BrQX_CXv.js";import"./structural-signature-0w-i_ats.js";import"./render-vitals-BZ5HtvMi.js";import"./static-batch-advisor-DqfXWRUq.js";import"./webgl-frame-capture-CRKX73E9.js";import"./world-state-ZGDGY_Xl.js";import"./frame-selector-cache-cCeUbcjG.js";import"./dev-build-gDYrq68M.js";import"./game-input-seams-BC6xhZy3.js";import"./seeded-random-CN0scLZj.js";import"./render-seed-DF4JHy7P.js";import"./frame-delta-D2nsw_Ht.js";import"./events-156d8d12.esm-C734MYnx.js";import"./index-bQE2NA0D.js";import"./realm-services-D25JHoqD.js";import"./canvas-entry-runtime-E5YjSgre.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"./relative-path-guard-GiM7Lsz8.js";import"./capability-coverage-CfUeULDN.js";import"./react-root-DGLRLr-F.js";import"./editor-presentation-activity-C7SNSmTd.js";import"./active-ingest-DEgq9JiA.js";import"./ingest-source-persistence-DH6ioCOu.js";import"./pixi-story-model-DNkfnWUV.js";import"./surface-content-Dg9Kkazf.js";import"./viewport-root-presentation-C9M98VNM.js";import"./mounted-authoring-TIN5EnCb.js";import"./three-DSsr_Lvp.js";import"./viewport-pick-context-DkawXbEi.js";import"./logger-Dqis-7W1.js";import"./run-ticks-settled-B0cTtmhQ.js";import"./three-authoring-adapter-Yqsank46.js";import"./source-persistence-backend-_-JMEXxE.js";import"./three-projection-core-kubBTx0s.js";import"./body-marks-D8iaje6y.js";import"./user-data-CZqsJDk-.js";import"./object-marks-DwvIEBOK.js";import"./structural-ids-CblajJQK.js";import"./object3d-authoring-subject-CyE4rQ2A.js";import"./rapier-physics-adapter-CaZqWLu0.js";import"./r3f-physics-binding-C8OqNRG2.js";import"./deferred-ingest-play-7V8OrW3e.js";import"./rrweb-Cd2ifIRP.js";import"./react-world-authoring-adapter-BMT9kLWU.js";import"./board-guides-C3usUZZk.js";import"./writer-BPbm4_my.js";import"./story-arg-descriptors-Ek86ExX7.js";import"./inspect-BRgDdtVk.js";import"./inference-diagnostics-YW0yJkKx.js";const Ge="workspace.command",Le={"list-gameplay-state":{derivedRefresh:"if-content-changed",handle:()=>{const e=a().debug;return e?{ok:!0,data:{providers:e.providers()}}:p()?{ok:!0,data:{providers:[]}}:s()}},"inspect-gameplay-state":{derivedRefresh:"if-content-changed",handle:e=>{const t=a().debug;if(!t)return p()?{ok:!0,data:{state:null}}:s();const r=e.keys;try{const o={};if(r&&r.length>0)for(const i of r)o[i]=t.state(i);else Object.assign(o,t.stateAll());return{ok:!0,data:{state:o}}}catch(o){return n(o)}}},"list-debug-commands":{derivedRefresh:"if-content-changed",handle:()=>{const e=a().debug;return e?{ok:!0,data:{commands:e.commands()}}:p()?{ok:!0,data:{commands:[]}}:s()}},"invoke-debug-command":{derivedRefresh:"always",handle:async e=>{const t=a().debug;if(!t)return p()?{ok:!1,error:`debug: no command registered under "${e.name}" — this game exposes no debug adapter`,data:{code:"DEBUG_COMMAND_NOT_REGISTERED",registered:[]}}:s();try{return{ok:!0,data:{result:await t.invoke(e.name,e.args??[])}}}catch(r){return n(r)}}},"inject-input":{derivedRefresh:"none",handle:e=>{const t=m();if(!t)return{ok:!1,error:"not in play mode — start play before injecting input"};let r;try{r=t.getInputTarget(e.worldId)}catch(o){return n(o)}if(!r)return{ok:!1,error:"this play session has no first-party InputManager to inject into"};try{if(e.kind==="action"){const i=e.atTick;return typeof i=="number"?(r.scheduleActionAtTick(i,e.action,e.value),{ok:!0,data:{scheduled:!0,tick:i}}):{ok:!0,data:r.setVirtualAction(e.action,e.value)}}const o=e.sourceId;switch(e.kind){case"axis":r.injectAxis(o,e.value);break;case"vector2":r.injectVector2(o,e.value);break;case"pointerDelta":r.injectPointerDelta(o,e.value);break;case"pointerPosition":r.injectPointerPosition(o,e.value);break;default:return{ok:!1,error:`unknown injection kind "${e.kind}"`}}return{ok:!0,data:{delivered:!0}}}catch(o){return n(o)}}},"set-time-scale":{derivedRefresh:"none",handle:e=>{const t=m();return t?(t.loop.timeScale=e.timeScale,{ok:!0,data:{timeScale:t.loop.timeScale}}):{ok:!1,error:"not in play mode — start play before setting time-scale"}}},"set-seed":{derivedRefresh:"none",handle:e=>{const t=m();return t?t.determinismDeclared?t.random?(t.random.reseed(e.seed),{ok:!0,data:{seed:t.random.seed}}):{ok:!1,error:"this play session has no first-party ctx.random to reseed"}:{ok:!1,error:"this project's manifest does not declare determinism.seededRandom — play.seed.set has no documented contract to reseed against (D15)",data:{code:"DETERMINISM_NOT_DECLARED"}}:{ok:!1,error:"not in play mode — start play before setting the seed"}}},"run-ticks":{derivedRefresh:"none",handle:async e=>{const t=m();if(!t)return{ok:!1,error:"not in play mode — start play before running ticks"};if(!t.runTicks)return{ok:!1,error:"this play session has no first-party Game to run ticks on",data:{code:"RUN_TICKS_UNAVAILABLE"}};try{const r=e.n,o=e.render;return t.runTicksSettled?await t.runTicksSettled(r,o?{render:o}:void 0):t.runTicks(r,o?{render:o}:void 0),{ok:!0}}catch(r){return n(r)}}}};export{Le as commands,Ge as point};
@@ -1 +1 @@
1
- import{a2 as l,a3 as a,ae as c}from"./index-GIL7oGEO.js";const g={version:1,jobs:[]};let u=g,i=null,s=0,o=!1;const r=new Set;function w(e,n=null){u=e,i=n,s++;for(const d of r)d()}function J(){return u}function v(){return i}function E(){return s}function y(e){return r.add(e),()=>r.delete(e)}function p(e){return e.status==="queued"||e.status==="running"}function h(e){return!p(e)&&(!e.readAt||Date.parse(e.readAt)<Date.parse(e.updatedAt))}function b(e){return e.filter(h).length}async function t(){try{const e=await fetch("/__editor/generations");w(await l(e,"Generation activity request failed"))}catch(e){i=e instanceof Error?e.message:String(e),s++;for(const n of r)n()}}async function G(){if(!o){o=!0;try{const e=await fetch("/__editor/generations/reconcile",{method:"POST"});a(e,"Generation reconciliation failed"),await t()}finally{o=!1}}}async function _(e){const n=await c(e.poll.tool,e.poll.input);if(!n.ok)throw new Error(n.error.message);if(n.generationWarning)throw new Error(n.generationWarning);return await t(),await f(e.id),n.data}async function S(e){if(!e.accept)throw new Error("This completed generation has no project asset to add.");const n=await c(e.accept.tool,e.accept.input,{confirm:!0});if(!n.ok)throw new Error(n.error.message);if(n.generationWarning)throw new Error(n.generationWarning);await t(),await f(e.id)}async function f(e){const n=await fetch(`/__editor/generations/${encodeURIComponent(e)}/read`,{method:"POST"});a(n,"Mark generation read failed"),await t()}async function T(e){const n=await fetch(`/__editor/generations/${encodeURIComponent(e)}`,{method:"DELETE"});a(n,"Forget generation job failed"),await t()}function A(){t();const e=window.setInterval(()=>void t(),2e3);return()=>{window.clearInterval(e)}}export{b as a,p as b,S as c,v as d,h as e,T as f,J as g,A as h,_ as i,E as j,f as m,G as p,t as r,y as s};
1
+ import{a3 as l,a4 as a,af as c}from"./index-Ckxb31Yz.js";const g={version:1,jobs:[]};let u=g,i=null,s=0,o=!1;const r=new Set;function w(e,n=null){u=e,i=n,s++;for(const d of r)d()}function J(){return u}function v(){return i}function E(){return s}function y(e){return r.add(e),()=>r.delete(e)}function p(e){return e.status==="queued"||e.status==="running"}function h(e){return!p(e)&&(!e.readAt||Date.parse(e.readAt)<Date.parse(e.updatedAt))}function b(e){return e.filter(h).length}async function t(){try{const e=await fetch("/__editor/generations");w(await l(e,"Generation activity request failed"))}catch(e){i=e instanceof Error?e.message:String(e),s++;for(const n of r)n()}}async function G(){if(!o){o=!0;try{const e=await fetch("/__editor/generations/reconcile",{method:"POST"});a(e,"Generation reconciliation failed"),await t()}finally{o=!1}}}async function _(e){const n=await c(e.poll.tool,e.poll.input);if(!n.ok)throw new Error(n.error.message);if(n.generationWarning)throw new Error(n.generationWarning);return await t(),await f(e.id),n.data}async function S(e){if(!e.accept)throw new Error("This completed generation has no project asset to add.");const n=await c(e.accept.tool,e.accept.input,{confirm:!0});if(!n.ok)throw new Error(n.error.message);if(n.generationWarning)throw new Error(n.generationWarning);await t(),await f(e.id)}async function f(e){const n=await fetch(`/__editor/generations/${encodeURIComponent(e)}/read`,{method:"POST"});a(n,"Mark generation read failed"),await t()}async function T(e){const n=await fetch(`/__editor/generations/${encodeURIComponent(e)}`,{method:"DELETE"});a(n,"Forget generation job failed"),await t()}function A(){t();const e=window.setInterval(()=>void t(),2e3);return()=>{window.clearInterval(e)}}export{b as a,p as b,S as c,v as d,h as e,T as f,J as g,A as h,_ as i,E as j,f as m,G as p,t as r,y as s};
@@ -0,0 +1 @@
1
+ import{jS as K,jT as X,fq as D,e6 as O,g_ as E,jU as Y,jV as A,bD as Q,a5 as p,h0 as Z,fF as H,jW as ee,jX as te,jY as w,jZ as ne,j_ as ae,j$ as re,k0 as ie,k1 as se,k2 as oe,bT as le,aa as h,iM as ce,eP as P,iy as R,cc as B,X as de,a6 as _,fX as ue,k3 as ge,bl as me,k4 as pe,k5 as ve,gX as fe,k6 as he,b6 as xe,k7 as ye,fk as Ce,ag as Ne,fm as je}from"./index-Ckxb31Yz.js";import{a as t}from"./jsx-runtime-DPjLkJKQ.js";import{r as u}from"./index-nmcBqr7Y.js";import"./index-CtzuWnCS.js";import{s as T,g as x,c as M,f as U,i as Ee,b as z,p as Se,r as F,d as ke,e as Te,m as $e,h as be,j as Ae,a as we}from"./generation-jobs-BYcpgeGk.js";import"./index-FUuS4qwW.js";import"./client-DNXj_opT.js";import"./_commonjsHelpers-D6-XlEtG.js";import"./index-D_NuPfjr.js";import"./index-CinJrH5C.js";import"./three.module-IFn-4i31.js";function y(e){switch(e.status){case"queued":return"queued";case"running":return"running";case"failed":return"failed";case"cancelled":return"cancelled";default:return e.acceptedAt?"ready":e.accept?e.pollError?"save-failed":"saving":"no-asset"}}function J(e){const n=y(e);return n!=="queued"&&n!=="running"&&n!=="saving"}function q(e,n){return e.status==="succeeded"&&!!e.accept&&!e.acceptedAt&&!!(e.pollError??n)}const $={queued:"Queued",running:"Running",saving:"Saving","save-failed":"Couldn't save",ready:"In project","no-asset":"No file",failed:"Failed",cancelled:"Cancelled"},Re=new Map([...["png","jpg","jpeg","webp","gif","avif","svg","bmp"].map(e=>[e,"image"]),...["mp4","webm","ogv","mov","m4v"].map(e=>[e,"video"]),...["mp3","wav","ogg","oga","m4a","flac","aac"].map(e=>[e,"audio"]),...["glb","gltf","fbx","obj","stl","ply","dae","3ds","usdz","spz"].map(e=>[e,"model"])]);function Ge(e){const n=e.slice(e.lastIndexOf("/")+1).toLowerCase(),a=n.lastIndexOf(".");return a>0?n.slice(a+1):""}function L(e){return(e.outputPaths??[]).map(n=>{const a=K.find(r=>n.startsWith(`${r}/`)),i=a?X(a,n.slice(a.length+1)):null;return{path:n,name:n.slice(n.lastIndexOf("/")+1),kind:Re.get(Ge(n))??"file",url:i}})}function G(e,n){const a=e.trim();return a.length<=n?a:`${a.slice(0,n-1).trimEnd()}…`}function j(e){const n=Oe(e);if(n)return n;const a=L(e);if(a.length===0)return G(e.label,64);const i=a[0],r=De(i.path);return a.length>1?r?`${r} · ${a.length} files`:`${a.length} files`:Ie.test(i.name)?r?`${r}/${i.name}`:G(e.label,64):i.name}const Ie=/^(image|video|audio|model|panorama|output)(-\d+)?\./;function De(e){const n=e.split("/").slice(-2,-1)[0];return n?/^[0-9a-f]{8,}$/i.test(n)||/^[0-9a-f-]{16,}$/i.test(n)?null:n:null}function Oe(e){const n=e.accept?.input;if(!n||typeof n!="object")return null;const a=n.outputName;return typeof a=="string"&&a.trim().length>0?a.trim():null}function Pe(e){for(const n of[e.accept?.input,e.poll.input]){const a=W(n,0);if(a)return a}return null}function W(e,n){if(n>3||typeof e!="object"||e===null)return null;const a=e,i=a.prompt;if(typeof i=="string"&&i.trim().length>0)return i.trim();for(const r of Object.values(a)){const l=W(r,n+1);if(l)return l}return null}function I(e){return e.operation}function Be(e){return e.mode==="managed"?"VGAI subscription":e.mode==="direct"?"Your provider key":"Mock"}function _e(e){return e.route==="mock"?"Free · mock":e.route==="managed"?e.settledCredits!==void 0?`${e.settledCredits} credits`:e.estimatedCredits!==void 0?`Up to ${e.estimatedCredits} credits`:"Credit estimate unavailable":e.settledAmount!==void 0?`$${e.settledAmount.toFixed(3)}`:e.estimatedAmount!==void 0?`Up to $${e.estimatedAmount.toFixed(3)}`:"USD estimate unavailable"}function Me(e){return e.route==="mock"?!0:e.route==="managed"?e.settledCredits!==void 0:e.settledAmount!==void 0}function Ue(e){const n=Math.floor((Date.now()-Date.parse(e))/6e4);if(!Number.isFinite(n)||n<1)return"just now";if(n<60)return`${n}m ago`;const a=Math.floor(n/60);if(a<24)return`${a}h ago`;const i=Math.floor(a/24);return i<7?`${i}d ago`:`${Math.floor(i/7)}w ago`}const S="generation:",ze="generation:create";function Fe(e){return e.route==="mock"?"Free mock":e.route==="managed"?e.settledCredits!==void 0?`${e.settledCredits} credits settled`:e.estimatedCredits!==void 0?`Up to ${e.estimatedCredits} credits`:"VGAI subscription · estimate unavailable":e.settledAmount!==void 0?`$${e.settledAmount.toFixed(3)} settled`:e.estimatedAmount!==void 0?`Up to $${e.estimatedAmount.toFixed(3)}`:"BYOK · estimate unavailable"}function V(e){return D({id:`${S}${e.id}`,title:e.label,kind:"generation",workspaceRole:"authored-subject",provenance:{origin:`${e.provider}:${e.externalId}`},Content:Le,closeable:!0,presentation:()=>({kind:"generation",id:e.id})})}function k(){return D({id:ze,title:"Create Asset",kind:"generation",workspaceRole:"workspace-task",provenance:{origin:"registered generation tools"},Content:Je,closeable:!0,presentation:()=>({kind:"generation",id:"create"})})}function Je(){u.useSyncExternalStore(O,E),u.useSyncExternalStore(Y,A,A);const e=ee(),[n,a]=u.useState(""),i=n.trim().toLowerCase(),r=E().filter(o=>o.point==="workspace.document"&&o.tool?.generation?.role==="submit").filter(o=>i?[o.title,o.tool?.generation?.provider,o.tool?.summary,o.tool?.description].filter(Boolean).some(c=>String(c).toLowerCase().includes(i)):!0),l=new Map;for(const o of r){const c=o.tool?.generation?.provider??"other";l.set(c,[...l.get(c)??[],o])}return t.jsxs("div",{className:"vgai-tool-page","data-testid":"generation-create-catalog",children:[t.jsxs("header",{className:"vgai-tool-header",children:[t.jsx("div",{className:"vgai-tool-eyebrow",children:"Installed provider extensions"}),t.jsx("h2",{className:"vgai-tool-title",children:"Create an asset"}),t.jsxs("p",{className:"vgai-tool-description",children:["Choose a native provider operation. Mock, managed, and BYOK execution remain explicit in the operation you open. Current default: ",e.preferredRoute,"."]})]}),t.jsx(Q,{type:"search","aria-label":"Search generation tools",placeholder:"Search operations or providers…",value:n,onChange:o=>a(o.target.value)}),[...l.entries()].map(([o,c])=>t.jsxs("section",{className:"vgai-tool-card",children:[t.jsx("h3",{className:"vgai-tool-section-title",children:o}),t.jsx("div",{className:"vgai-generation-create-grid",children:c.map(g=>t.jsxs(p,{variant:"ghost",className:"vgai-generation-create-card",onClick:()=>Z(g.id),children:[t.jsx("strong",{children:g.title}),t.jsx("span",{children:g.tool?.summary})]},g.id))})]},o)),r.length===0&&t.jsx("div",{className:"vgai-generation-document-empty",children:"No installed generation operation matches this search."})]})}function qe({job:e,result:n,documentId:a,active:i}){u.useSyncExternalStore(O,E),u.useSyncExternalStore(te,w,w);const r=ne(e.poll.tool,e,n);if(!r)return t.jsx("pre",{className:"vgai-generation-native-result",children:JSON.stringify(n,null,2)});const l=r.Component;return t.jsx(ae,{file:r.file,children:t.jsx(l,{tool:r.tool,contributionId:r.id,client:oe(),surfaces:re,account:se(),play:ie(),documentId:a,active:i,job:e,result:n})})}function Le({documentId:e,active:n}){const{jobs:a}=u.useSyncExternalStore(T,x,x),i=e.startsWith(S)?e.slice(S.length):e,r=a.find(d=>d.id===i),[l,o]=u.useState(),[c,g]=u.useState(!1),[s,m]=u.useState(null),[v,f]=u.useState(!1),C=async d=>{g(!0),m(null);try{o(await Ee(d))}catch(N){m(N instanceof Error?N.message:String(N))}finally{g(!1)}};if(u.useEffect(()=>{r&&C(r)},[r?.id,r?.status]),!r)return t.jsx("div",{className:"vgai-generation-document-empty",children:"This generation is no longer in project activity."});const b=s??(y(r)==="save-failed"?`Could not save into the project: ${r.pollError}`:null);return t.jsxs("div",{className:"vgai-generation-document","data-status":r.status,children:[t.jsxs("header",{className:"vgai-generation-document-header",children:[t.jsxs("div",{children:[t.jsxs("div",{className:"vgai-tool-eyebrow",children:[r.provider," · ",r.operation]}),t.jsx("h2",{className:"vgai-tool-title",children:r.label}),t.jsxs("div",{className:"vgai-generation-job-meta",children:[$[y(r)]," · ",Fe(r.billing)]})]}),t.jsxs("div",{className:"vgai-tool-actions",children:[t.jsx(p,{size:"compact",variant:"ghost",disabled:c,onClick:()=>void C(r),children:c?"Refreshing…":"Refresh"}),q(r,s)&&t.jsx(p,{size:"compact",variant:"primary",disabled:v,onClick:()=>{f(!0),m(null),M(r).catch(d=>m(d instanceof Error?d.message:String(d))).finally(()=>f(!1))},children:v?"Saving…":"Retry save"})]})]}),r.message&&t.jsx("div",{className:"vgai-tool-status",children:r.message}),b&&t.jsx("div",{className:"vgai-tool-status","data-tone":"error",role:"alert",children:b}),t.jsx("section",{className:"vgai-generation-result","aria-label":"Generation result",children:l===void 0?t.jsx("div",{className:"vgai-generation-document-empty",children:c?"Loading provider result…":"No provider result is available yet."}):t.jsx(qe,{job:r,result:l,documentId:e,active:n})}),r.outputPaths&&r.outputPaths.length>0&&t.jsxs("section",{className:"vgai-generation-output-paths",children:[t.jsx("strong",{children:"Project assets"}),r.outputPaths.map(d=>t.jsx("code",{children:d},d))]}),J(r)&&t.jsx("div",{className:"vgai-generation-document-footer",children:t.jsx(p,{size:"compact",variant:"ghost",disabled:v,onClick:()=>{f(!0),U(r.id).then(()=>H(e)).catch(d=>m(d instanceof Error?d.message:String(d))).finally(()=>f(!1))},children:"Remove from activity"})})]})}function We({output:e,onOpen:n}){const a=e.url;if(a&&e.kind==="image"){const i=t.jsx("img",{className:"vgai-generation-output-media",src:a,alt:e.name,loading:"lazy"});return n?t.jsx(p,{variant:"ghost",className:"vgai-generation-output-open",onClick:n,"aria-label":`Open ${e.name}`,children:i}):i}return a&&e.kind==="video"?t.jsx("video",{className:"vgai-generation-output-media",src:a,controls:!0,preload:"metadata",playsInline:!0,title:e.name}):a&&e.kind==="audio"?t.jsxs("div",{className:"vgai-generation-output-audio",children:[t.jsx(ge,{url:a,name:e.name}),t.jsx("audio",{src:a,controls:!0,preload:"metadata",title:e.name})]}):e.url&&e.kind==="model"&&me(e.url)?t.jsx(pe,{url:e.url}):t.jsxs("div",{className:"vgai-generation-output-file",children:[t.jsx(_,{icon:e.kind==="model"?ve:fe}),t.jsx(h,{variant:"caption",tone:"muted",children:e.name}),n&&t.jsx(p,{size:"compact",variant:"ghost",onClick:n,children:"Open file"})]})}const Ve={queued:"loading",running:"loading",saving:"loading","save-failed":"error",ready:"success","no-asset":"neutral",failed:"error",cancelled:"neutral"},Ke={queued:e=>e.queuePosition===void 0?"Waiting for the provider to start.":`Position ${e.queuePosition} in the provider queue.`,running:e=>e.message??"The provider is working on it.",saving:()=>"Downloading the finished output into this project.","save-failed":e=>e.pollError??"The finished output could not be saved.",ready:()=>"Saved into this project.","no-asset":()=>"The operation finished without a file this project can hold.",failed:e=>e.message??"The provider reported a failure.",cancelled:()=>"This generation was cancelled."};function Xe({job:e,state:n}){const a=n==="queued"||n==="running"||n==="saving",i=n==="failed"||n==="save-failed";return t.jsxs("div",{className:"vgai-generation-state-media","data-state":n,children:[t.jsx(P,{compact:!0,tone:Ve[n],...i?{icon:t.jsx(_,{icon:ue})}:{},title:$[n],description:Ke[n](e)}),a&&t.jsx("progress",{className:"vgai-generation-progress","aria-label":`${e.label} progress`,...n==="running"&&e.progress!==void 0?{value:e.progress,max:1}:{}})]})}function Ye({job:e,busy:n,error:a,run:i}){return t.jsxs("div",{className:"vgai-generation-card-actions",children:[q(e,a)&&t.jsx(p,{size:"compact",variant:"primary",disabled:n,onClick:()=>i(()=>M(e)),children:n?"Saving…":"Retry save"}),t.jsx(p,{size:"compact",variant:"ghost",onClick:()=>V(e),children:"Details"}),J(e)&&t.jsx(p,{size:"compact",variant:"ghost",disabled:n,onClick:()=>i(()=>U(e.id)),children:"Remove"})]})}function Qe({job:e,busy:n,error:a,run:i}){const r=y(e),l=L(e),o=Pe(e),c=Te(e),g=s=>{if(!s.url)return;const m=he(xe(s.name));if(m)return()=>ye(s.url,m)};return t.jsxs("article",{className:"vgai-generation-card","data-state":r,"aria-busy":z(e),"aria-label":j(e),onClickCapture:()=>{c&&$e(e.id).catch(s=>{de.warn(`Could not mark generation as seen: ${s instanceof Error?s.message:String(s)}`,"generations")})},children:[t.jsx("div",{className:"vgai-generation-card-media","data-outputs":Math.min(l.length,4),children:l.length===0?t.jsx(Xe,{job:e,state:r}):l.map(s=>t.jsx("div",{className:"vgai-generation-output",title:s.path,children:t.jsx(We,{output:s,onOpen:g(s)})},s.path))}),t.jsxs("div",{className:"vgai-generation-card-body",children:[t.jsxs("div",{className:"vgai-generation-card-heading",children:[t.jsx(h,{variant:"label",truncate:!0,title:j(e),children:j(e)}),t.jsxs(R,{className:"vgai-generation-chip","data-state":r,children:[$[r],r==="running"&&e.progress!==void 0?` · ${Math.round(e.progress*100)}%`:""]}),c&&t.jsx(R,{className:"vgai-generation-chip","data-state":"new",children:"New"})]}),t.jsxs(h,{variant:"caption",tone:"muted",truncate:!0,title:I(e),children:[e.provider," · ",I(e)]}),t.jsxs(h,{variant:"caption",tone:"dim",children:[_e(e.billing),Me(e.billing)?"":" (est.)"," · ",Be(e)," ·"," ",Ue(e.updatedAt)]}),o&&t.jsx("p",{className:"vgai-generation-card-prompt",title:o,children:o}),(a??e.pollError)&&t.jsx(B,{tone:a||r==="save-failed"?"error":"warning",className:"vgai-generation-card-alert",children:a??(r==="save-failed"?`Could not save into the project: ${e.pollError}`:`Polling will retry: ${e.pollError}`)}),t.jsx(Ye,{job:e,busy:n,error:a,run:i})]})]})}function Ze(){const{jobs:e}=u.useSyncExternalStore(T,x,x),[n,a]=u.useState(null),[i,r]=u.useState({}),l=e.filter(z).length,o=e.filter(s=>y(s)==="saving").length,c=async(s,m)=>{a(s),r(v=>{const f={...v};return delete f[s],f});try{await m()}catch(v){const f=v instanceof Error?v.message:String(v);r(C=>({...C,[s]:f}))}finally{a(null)}},g=ke();return t.jsxs("div",{className:"vgai-generation-gallery",children:[t.jsxs(le,{label:"Generations",compact:!0,className:"vgai-generation-gallery-bar",children:[t.jsx(h,{variant:"label",children:"Generations"}),t.jsxs(h,{variant:"caption",tone:"muted",children:[e.length," ",e.length===1?"generation":"generations",l>0?` · ${l} running`:"",o>0?` · ${o} saving`:""]}),t.jsx(ce,{}),t.jsx(p,{size:"compact",variant:"ghost",onClick:()=>void Se().then(F),children:"Refresh"}),t.jsx(p,{size:"compact",variant:"primary",onClick:()=>k(),children:"New asset"})]}),g&&t.jsx(B,{tone:"error",className:"vgai-generation-gallery-alert",children:g}),e.length===0?t.jsx(P,{className:"vgai-generation-gallery-empty",title:"No generated assets yet",description:"Preview generated images, video, audio and models here. Create an asset to get started.",action:t.jsx(p,{size:"compact",variant:"primary",onClick:()=>k(),children:"New asset"})}):t.jsx("section",{className:"vgai-generation-grid","aria-label":"Generated assets",children:e.map(s=>t.jsx(Qe,{job:s,busy:n===s.id,error:i[s.id]??null,run:m=>void c(s.id,m)},s.id))})]})}const gt="workspace.service",He="generation";function et(){const e=we(x().jobs);return e>0?{count:e,severity:"info"}:null}function mt(){const e=[be(),Ce({...Ne.generations,order:15,Content:Ze,badge:et,subscribeBadge:T,badgeSnapshot:Ae,visibleByDefault:!1,closeable:!0}),je({id:He,owner:"@volter/editor-game/generation",open:(n,a)=>{if(a.id==="create")return k();const i=x().jobs.find(r=>r.id===a.id);return i?V(i):null},settle:F})];return()=>{for(const n of e)n()}}export{gt as point,mt as start};
@@ -1 +1 @@
1
- import{c7 as p,r as o,v as n,L as e,t as l,u as t,c4 as m,ds as c}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 u=m(["queued","running","succeeded","failed","cancelled"]),g=p("route",[o({route:n("mock")}).strict(),o({route:n("managed"),estimatedCredits:e().nonnegative().optional(),settledCredits:e().nonnegative().optional()}).strict(),o({route:n("byok"),currency:n("USD"),estimatedAmount:e().nonnegative().optional(),settledAmount:e().nonnegative().optional()}).strict()]),r=o({tool:t().min(1),input:c()}).strict(),v=o({id:t().min(1),provider:t().min(1),externalId:t().min(1),label:t().min(1),operation:t().min(1),mode:m(["mock","direct","managed"]),status:u,createdAt:t().datetime(),updatedAt:t().datetime(),progress:e().min(0).max(1).optional(),providerStatus:t().optional(),queuePosition:e().int().nonnegative().optional(),message:t().optional(),lastPolledAt:t().datetime().optional(),lastProviderChangeAt:t().datetime().optional(),pollError:t().optional(),pollErrorAt:t().datetime().optional(),pollFailureCount:e().int().nonnegative().optional(),nextPollAt:t().datetime().optional(),billing:g,poll:r,cancel:r.optional(),accept:r.optional(),acceptedAt:t().datetime().optional(),readAt:t().datetime().optional(),provenanceOperationId:t().optional(),outputPaths:l(t()).optional()}).strict(),y=o({version:n(1),jobs:l(v)}).strict();function J(d,s){if(d!=="managed")return{};const{estimatedCredits:i,settledCredits:a}=s;return i===void 0&&a===void 0?{}:{billing:{route:"managed",...i===void 0?{}:{estimatedCredits:i},...a===void 0?{}:{settledCredits:a}}}}export{g as GenerationBillingSchema,v as GenerationJobSchema,u as GenerationJobStatusSchema,y as GenerationJobsDocumentSchema,J as managedBilling};
1
+ import{cB as p,r as o,v as i,O as e,t as l,u as t,cy as m,ei as c}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 u=m(["queued","running","succeeded","failed","cancelled"]),g=p("route",[o({route:i("mock")}).strict(),o({route:i("managed"),estimatedCredits:e().nonnegative().optional(),settledCredits:e().nonnegative().optional()}).strict(),o({route:i("byok"),currency:i("USD"),estimatedAmount:e().nonnegative().optional(),settledAmount:e().nonnegative().optional()}).strict()]),r=o({tool:t().min(1),input:c()}).strict(),v=o({id:t().min(1),provider:t().min(1),externalId:t().min(1),label:t().min(1),operation:t().min(1),mode:m(["mock","direct","managed"]),status:u,createdAt:t().datetime(),updatedAt:t().datetime(),progress:e().min(0).max(1).optional(),providerStatus:t().optional(),queuePosition:e().int().nonnegative().optional(),message:t().optional(),lastPolledAt:t().datetime().optional(),lastProviderChangeAt:t().datetime().optional(),pollError:t().optional(),pollErrorAt:t().datetime().optional(),pollFailureCount:e().int().nonnegative().optional(),nextPollAt:t().datetime().optional(),billing:g,poll:r,cancel:r.optional(),accept:r.optional(),acceptedAt:t().datetime().optional(),readAt:t().datetime().optional(),provenanceOperationId:t().optional(),outputPaths:l(t()).optional()}).strict(),y=o({version:i(1),jobs:l(v)}).strict();function B(d,s){if(d!=="managed")return{};const{estimatedCredits:n,settledCredits:a}=s;return n===void 0&&a===void 0?{}:{billing:{route:"managed",...n===void 0?{}:{estimatedCredits:n},...a===void 0?{}:{settledCredits:a}}}}export{g as GenerationBillingSchema,v as GenerationJobSchema,u as GenerationJobStatusSchema,y as GenerationJobsDocumentSchema,B as managedBilling};
@@ -1 +1 @@
1
- import{a as e}from"./jsx-runtime-DPjLkJKQ.js";import{a4 as r,q as a,af as i}from"./index-GIL7oGEO.js";import{r as p}from"./index-nmcBqr7Y.js";import"./index-CtzuWnCS.js";import{s as u,g as s,a as c,b as m}from"./generation-jobs-BQrXbGp_.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 $="workspace.status",C="Generations",T="left",U=24;function j(){const{jobs:o}=p.useSyncExternalStore(u,s,s),n=c(o),t=o.filter(m).length;return e.jsxs(r,{type:"button",variant:"ghost",size:"compact",className:"vgai-status-action","data-testid":"status-generations","aria-label":`Generations, ${n} unseen, ${t} running`,title:`${n} unseen generation results, ${t} running — open Generations`,onClick:()=>a().workspace.showUtility(i.generations.id),children:["Generations · ",n,t>0?` · ${t} running`:""]})}export{T as align,j as default,U as order,$ as point,C as title};
1
+ import{a as e}from"./jsx-runtime-DPjLkJKQ.js";import{a5 as r,q as a,ag as i}from"./index-Ckxb31Yz.js";import{r as p}from"./index-nmcBqr7Y.js";import"./index-CtzuWnCS.js";import{s as u,g as s,a as c,b as m}from"./generation-jobs-BYcpgeGk.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 $="workspace.status",C="Generations",T="left",U=24;function j(){const{jobs:o}=p.useSyncExternalStore(u,s,s),n=c(o),t=o.filter(m).length;return e.jsxs(r,{type:"button",variant:"ghost",size:"compact",className:"vgai-status-action","data-testid":"status-generations","aria-label":`Generations, ${n} unseen, ${t} running`,title:`${n} unseen generation results, ${t} running — open Generations`,onClick:()=>a().workspace.showUtility(i.generations.id),children:["Generations · ",n,t>0?` · ${t} running`:""]})}export{T as align,j as default,U as order,$ as point,C as title};
@@ -0,0 +1 @@
1
+ const e="Godot",a={id:"godot",color:{surface:{shell:"#1d2229",panel:"#21262e",chrome:"#252b34",raised:"#363d4a",inset:"#1d2229",overlay:"rgba(33,38,46,0.96)"},boundary:{default:"#363d4a",strong:"#4a5263",area:"#1d2229",indent:"#4a5263",divider:"#2c323c"},content:{primary:"#e0e0e0",muted:"#c0c3c8",dim:"#8a8e96",onAccent:"#ffffff",menu:"#e0e0e0",status:"#9a9ea6",placeholder:"#6a6d73",active:"#70bafa",selected:"#70bafa",onBright:{primary:"#1d2229",muted:"rgba(29,34,41,0.82)",dim:"rgba(29,34,41,0.7)"}},accent:{default:"#70bafa",muted:"#374f66"},widget:{regular:"#363d4a",menu:"#21262e",field:"#1d2229",emboss:"rgba(0,0,0,0.12)"},viewport:{background:"#4d4d4d",grid:"#6e6964",axisX:"#f53352",axisY:"#87d603",axisZ:"#298cf5",selection:"#ff8000",active:"#ff8000"},gizmo:{x:"#f53352",y:"#87d603",z:"#298cf5"},region:{outliner:"#21262e",properties:"#21262e"},category:{object:"#fc7f7f",modifier:"#8da5f3",material:"#ff5d5d",data:"#8eef97",scene:"#e0e0e0",collection:"#e0e0e0",tool:"#e0e0e0",operator:"#8eef97"},semantic:{danger:"#ff786b",dangerMuted:"rgba(255,120,107,0.28)",dangerFaint:"rgba(255,120,107,0.12)",warning:"#ffdd65",warningMuted:"rgba(255,221,101,0.28)",success:"#45ff8b",successMuted:"rgba(69,255,139,0.28)",dynamic:"#ffdd65",dynamicMuted:"rgba(255,221,101,0.18)",instance:"#70bafa"},neutralOverlay:{hover:"rgba(255,255,255,0.07)",active:"rgba(255,255,255,0.13)"},scrim:"rgba(0,0,0,0.6)"},typography:{sans:"'Noto Sans', 'Inter', system-ui, sans-serif",mono:"'JetBrains Mono', 'Hack', Menlo, monospace"}},t={schemaVersion:3,name:e,theme:a},o="workspace.style",i={id:"godot",title:"Godot",paletteId:"godot",materialId:"godot",material:{id:"godot",title:"Godot",description:"Flat blue-grey panels, three-pixel corners, a soft shadow under popups.",shape:{small:"3px",medium:"3px",large:"4px",full:"9999px"},elevation:{small:"none",medium:"0 3px 10px rgba(0,0,0,0.45)",large:"0 6px 18px rgba(0,0,0,0.5)"},stage:{gizmoSize:128,gizmoArrowLength:1.6,gizmoArrowHead:1.5,gizmoRingWidth:2,gizmoOpacity:.9,gizmoHighlightSaturation:.25,gizmoHighlightValue:1,gridLineWidth:1,gridMajorWidth:1,gridMajorContrast:1.3,selectionBox:"edges",selectionBoxFrame:"object",selectionBoxWidth:2}},palette:t};export{o as point,i as style};
@@ -0,0 +1 @@
1
+ const e="workspace.view",r={id:"godot",title:"Godot",layer:{all:{lighting:{source:"preview",preview:{sun:{enabled:!0,color:"#ffffff",energy:1,altitude:60,azimuth:150,shadowDistance:100},environment:{enabled:!0,energy:1,rotation:0}},tone:{mapper:"filmic",exposure:1}},backdrop:{source:"environment",opacity:1,blur:0}},overlays:{grid:{visible:!0,majorEvery:8},selection:{outline:!1,wire:!1,box:!0},axes:{x:!0,y:!0,z:!0}},interaction:{transformHandles:{scale:!1,viewRotate:!1,freeMove:!1}}}};export{e as point,r as view};
@@ -1,2 +1,2 @@
1
- import{c6 as E,u as l,r as y,k0 as P,t as b,bb as T}from"./index-GIL7oGEO.js";import{i as x}from"./relative-path-guard-GiM7Lsz8.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/assets.json",k=y({key:l().min(1),license:l().min(1).optional(),sourceHash:l().regex(/^sha256-[a-f0-9]{64}$/,'sourceHash must be "sha256-<64 hex>"').optional(),materializedAt:l().datetime()}).strict(),O=E(l().min(1),k);function z(e){if(!/^[a-f0-9]{64}$/.test(e))throw new Error(`Not a sha256 digest, refusing to record it as a sourceHash: ${e}`);return`sha256-${e}`}function m(e){const t=e.replaceAll("\\","/").replace(/^\.\//,"").replace(/^\/+/,"");if(!t)throw new Error("An asset ledger path cannot be empty.");if(!x(t))throw new Error(`An asset ledger path cannot escape the project: ${e}`);return t}function _(e){return O.parse(e)}function D(e){if(e==null||e.trim()==="")return{};let t;try{t=JSON.parse(e)}catch(s){throw new Error(`${d} is not valid JSON: ${String(s)}`)}return _(t)}function I(e,t,s){const r=m(t),n=k.parse(s),a={...e,[r]:n},i={};for(const u of Object.keys(a).sort())i[u]=a[u];return i}function M(e){const t={};for(const s of Object.keys(e).sort())t[s]=e[s];return`${JSON.stringify(t,null,2)}
2
- `}function U(e,t,s){const r=globalThis.navigator?.locks;return r?r.request(`vgai:${e}:${P(t)}`,s):s()}const H=1e4,N=15;function j(){return globalThis.crypto?.randomUUID?.()??`${Date.now()}-${Math.random()}`}async function R(e,t,s={}){const r=s.staleAfterMs??H,n=s.retryDelayMs??N,a=s.now??Date.now,i=s.sleep??(o=>new Promise(c=>setTimeout(c,o))),u=s.token??j;for(;;){const o=JSON.stringify({at:a(),owner:s.owner??"unknown",token:u()});if(await e.createIfAbsent(o))try{return await t()}finally{await e.removeIfHeldBy(o)}const c=await e.read();if(c!==null){if(a()-B(c)>r){await e.removeIfHeldBy(c);continue}await i(n)}}}function B(e){try{const t=JSON.parse(e);return typeof t.at=="number"?t.at:0}catch{return 0}}function J(){const e=new Map;return(t,s)=>{const n=(e.get(t)??Promise.resolve()).then(s,s),a=n.then(()=>{},()=>{});return e.set(t,a),a.then(()=>{e.get(t)===a&&e.delete(t)}),n}}async function S(e){return await e.exists(d)?D(await e.read(d)):{}}async function F(e,t){await e.write(d,M(t))}const f=`${d}.lock`,C=J(),A=new WeakMap;let $=0;function K(e){const t=A.get(e);if(t!==void 0)return t;$+=1;const s=`${e.id}#${$}`;return A.set(e,s),s}async function W(e,t){const s={key:t.key,...t.license?{license:t.license}:{},...t.sourceSha256?{sourceHash:z(t.sourceSha256)}:{},materializedAt:t.materializedAt??new Date().toISOString()};await C(K(e),()=>R({createIfAbsent:r=>e.writeIfAbsent(f,r),read:async()=>await e.exists(f)?e.read(f):null,removeIfHeldBy:r=>U(e.id,f,async()=>{await e.exists(f)&&await e.read(f)===r&&await e.remove(f)})},async()=>{const r=await S(e);await F(e,I(r,m(t.destPath),s))},{owner:e.id}))}const G=y({key:l().regex(/^[^:]+:.+$/,'An asset key must be "source:id"'),dest:l().min(1),sha256:l().regex(/^[a-f0-9]{64}$/,"A pack entry must pin the sha256 of its bytes as 64 lowercase hex digits")}).strict(),Y=y({packs:E(l().min(1),b(G))}).strict();function q(e){return Y.parse(e)}function V(e){const t=[],s=new Map;for(const[r,n]of Object.entries(e.packs))for(const a of n){const i=s.get(a.dest);if(i!==void 0)throw new Error(`Two packs declare the same destination "${a.dest}": "${i}" and "${r}".`);s.set(a.dest,r),t.push({...a,pack:r})}return t}const w="asset-manifest.json",v="https://vgai-asset-library.aaron-0ed.workers.dev";function L(e){return(e.baseUrl??v).replace(/\/+$/,"")}function Q(e){return e.signal?{signal:e.signal}:{}}async function X(e,t={}){const s=L(t),r=await fetch(`${s}/v1/assets/${encodeURIComponent(e)}`,Q(t));if(!r.ok)return null;const n=await r.json();return!n||typeof n!="object"||!Array.isArray(n.files)?null:n}function Z(e,t,s,r){return`${L(e?{baseUrl:e}:{})}/v1/assets/${encodeURIComponent(t)}/files/${s}`}async function we(e,t={}){const s=await ee(e),r={declared:s.length,materialized:[],alreadyPresent:[],failed:[]};if(s.length===0)return r;const n=await S(e);for(const a of s){if(t.signal?.aborted)break;if(n[m(a.dest)]&&await e.exists(a.dest)){r.alreadyPresent.push(a),t.onProgress?.(a,"already-present");continue}try{await te(e,a,t),r.materialized.push(a),t.onProgress?.(a,"materialized")}catch(i){r.failed.push({entry:a,reason:i instanceof Error?i.message:String(i)}),t.onProgress?.(a,"failed")}}return r}async function ee(e){if(!await e.exists(w))return[];const t=await e.read(w);let s;try{s=JSON.parse(t)}catch(r){throw new Error(`${w} is not valid JSON: ${r instanceof Error?r.message:String(r)}`)}return V(q(s))}async function te(e,t,s){const r=await se(t,s);await e.write(t.dest,r.bytes),await W(e,{destPath:t.dest,key:t.key,license:r.license,sourceSha256:t.sha256})}async function se(e,t={}){const s=e.key.indexOf(":");if(s<0)throw new Error(`Malformed asset key "${e.key}" (expected "source:id").`);const r=e.key.slice(0,s),n=e.key.slice(s+1);if(r!=="local")throw new Error(`Asset key "${e.key}": only the "local" (cloud-hosted) source can be materialized from the cloud worker.`);const a=t.baseUrl??v,i=t.signal?{baseUrl:a,signal:t.signal}:{baseUrl:a},u=await X(n,i);if(!u)throw new Error(`"${e.key}" is not hosted by the cloud asset library.`);const o=u.files[0];if(!o)throw new Error(`"${e.key}" has no files in the cloud library.`);if(o.dependencies.length>0)throw new Error(`"${e.key}" has ${o.dependencies.length} dependency file(s) — a pack entry names exactly one destination file.`);if(o.main.sha256!==e.sha256)throw new Error(`"${e.key}" → ${e.dest}: the cloud library reports sha256:${o.main.sha256} but ${w} pins sha256:${e.sha256}. Nothing was fetched or written; the pin is only re-cut by a reviewed change to the declaration.`);const c=Z(a,n,0),h=await fetch(c,t.signal?{signal:t.signal}:{});if(!h.ok)throw new Error(`${c} returned ${h.status} ${h.statusText}.`);const g=new Uint8Array(await h.arrayBuffer()),p=await T(g);if(p!==e.sha256)throw new Error(`"${e.key}" → ${e.dest}: ${c} delivered sha256:${p} but the declaration pins sha256:${e.sha256}. Nothing was written.`);return{bytes:g,license:u.license}}export{w as ASSET_MANIFEST_PATH,se as fetchVerifiedPackEntry,we as materializeDeclaredAssetPacks};
1
+ import{cA as E,u as l,r as y,kF as P,t as b,b3 as T}from"./index-Ckxb31Yz.js";import{i as x}from"./relative-path-guard-GiM7Lsz8.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/assets.json",k=y({key:l().min(1),license:l().min(1).optional(),sourceHash:l().regex(/^sha256-[a-f0-9]{64}$/,'sourceHash must be "sha256-<64 hex>"').optional(),materializedAt:l().datetime()}).strict(),O=E(l().min(1),k);function z(e){if(!/^[a-f0-9]{64}$/.test(e))throw new Error(`Not a sha256 digest, refusing to record it as a sourceHash: ${e}`);return`sha256-${e}`}function m(e){const t=e.replaceAll("\\","/").replace(/^\.\//,"").replace(/^\/+/,"");if(!t)throw new Error("An asset ledger path cannot be empty.");if(!x(t))throw new Error(`An asset ledger path cannot escape the project: ${e}`);return t}function _(e){return O.parse(e)}function D(e){if(e==null||e.trim()==="")return{};let t;try{t=JSON.parse(e)}catch(s){throw new Error(`${d} is not valid JSON: ${String(s)}`)}return _(t)}function I(e,t,s){const r=m(t),n=k.parse(s),a={...e,[r]:n},i={};for(const u of Object.keys(a).sort())i[u]=a[u];return i}function M(e){const t={};for(const s of Object.keys(e).sort())t[s]=e[s];return`${JSON.stringify(t,null,2)}
2
+ `}function U(e,t,s){const r=globalThis.navigator?.locks;return r?r.request(`vgai:${e}:${P(t)}`,s):s()}const H=1e4,N=15;function j(){return globalThis.crypto?.randomUUID?.()??`${Date.now()}-${Math.random()}`}async function R(e,t,s={}){const r=s.staleAfterMs??H,n=s.retryDelayMs??N,a=s.now??Date.now,i=s.sleep??(o=>new Promise(c=>setTimeout(c,o))),u=s.token??j;for(;;){const o=JSON.stringify({at:a(),owner:s.owner??"unknown",token:u()});if(await e.createIfAbsent(o))try{return await t()}finally{await e.removeIfHeldBy(o)}const c=await e.read();if(c!==null){if(a()-B(c)>r){await e.removeIfHeldBy(c);continue}await i(n)}}}function B(e){try{const t=JSON.parse(e);return typeof t.at=="number"?t.at:0}catch{return 0}}function F(){const e=new Map;return(t,s)=>{const n=(e.get(t)??Promise.resolve()).then(s,s),a=n.then(()=>{},()=>{});return e.set(t,a),a.then(()=>{e.get(t)===a&&e.delete(t)}),n}}async function S(e){return await e.exists(d)?D(await e.read(d)):{}}async function J(e,t){await e.write(d,M(t))}const f=`${d}.lock`,C=F(),A=new WeakMap;let $=0;function K(e){const t=A.get(e);if(t!==void 0)return t;$+=1;const s=`${e.id}#${$}`;return A.set(e,s),s}async function W(e,t){const s={key:t.key,...t.license?{license:t.license}:{},...t.sourceSha256?{sourceHash:z(t.sourceSha256)}:{},materializedAt:t.materializedAt??new Date().toISOString()};await C(K(e),()=>R({createIfAbsent:r=>e.writeIfAbsent(f,r),read:async()=>await e.exists(f)?e.read(f):null,removeIfHeldBy:r=>U(e.id,f,async()=>{await e.exists(f)&&await e.read(f)===r&&await e.remove(f)})},async()=>{const r=await S(e);await J(e,I(r,m(t.destPath),s))},{owner:e.id}))}const G=y({key:l().regex(/^[^:]+:.+$/,'An asset key must be "source:id"'),dest:l().min(1),sha256:l().regex(/^[a-f0-9]{64}$/,"A pack entry must pin the sha256 of its bytes as 64 lowercase hex digits")}).strict(),Y=y({packs:E(l().min(1),b(G))}).strict();function q(e){return Y.parse(e)}function V(e){const t=[],s=new Map;for(const[r,n]of Object.entries(e.packs))for(const a of n){const i=s.get(a.dest);if(i!==void 0)throw new Error(`Two packs declare the same destination "${a.dest}": "${i}" and "${r}".`);s.set(a.dest,r),t.push({...a,pack:r})}return t}const w="asset-manifest.json",v="https://vgai-asset-library.aaron-0ed.workers.dev";function L(e){return(e.baseUrl??v).replace(/\/+$/,"")}function Q(e){return e.signal?{signal:e.signal}:{}}async function X(e,t={}){const s=L(t),r=await fetch(`${s}/v1/assets/${encodeURIComponent(e)}`,Q(t));if(!r.ok)return null;const n=await r.json();return!n||typeof n!="object"||!Array.isArray(n.files)?null:n}function Z(e,t,s,r){return`${L(e?{baseUrl:e}:{})}/v1/assets/${encodeURIComponent(t)}/files/${s}`}async function we(e,t={}){const s=await ee(e),r={declared:s.length,materialized:[],alreadyPresent:[],failed:[]};if(s.length===0)return r;const n=await S(e);for(const a of s){if(t.signal?.aborted)break;if(n[m(a.dest)]&&await e.exists(a.dest)){r.alreadyPresent.push(a),t.onProgress?.(a,"already-present");continue}try{await te(e,a,t),r.materialized.push(a),t.onProgress?.(a,"materialized")}catch(i){r.failed.push({entry:a,reason:i instanceof Error?i.message:String(i)}),t.onProgress?.(a,"failed")}}return r}async function ee(e){if(!await e.exists(w))return[];const t=await e.read(w);let s;try{s=JSON.parse(t)}catch(r){throw new Error(`${w} is not valid JSON: ${r instanceof Error?r.message:String(r)}`)}return V(q(s))}async function te(e,t,s){const r=await se(t,s);await e.write(t.dest,r.bytes),await W(e,{destPath:t.dest,key:t.key,license:r.license,sourceSha256:t.sha256})}async function se(e,t={}){const s=e.key.indexOf(":");if(s<0)throw new Error(`Malformed asset key "${e.key}" (expected "source:id").`);const r=e.key.slice(0,s),n=e.key.slice(s+1);if(r!=="local")throw new Error(`Asset key "${e.key}": only the "local" (cloud-hosted) source can be materialized from the cloud worker.`);const a=t.baseUrl??v,i=t.signal?{baseUrl:a,signal:t.signal}:{baseUrl:a},u=await X(n,i);if(!u)throw new Error(`"${e.key}" is not hosted by the cloud asset library.`);const o=u.files[0];if(!o)throw new Error(`"${e.key}" has no files in the cloud library.`);if(o.dependencies.length>0)throw new Error(`"${e.key}" has ${o.dependencies.length} dependency file(s) — a pack entry names exactly one destination file.`);if(o.main.sha256!==e.sha256)throw new Error(`"${e.key}" → ${e.dest}: the cloud library reports sha256:${o.main.sha256} but ${w} pins sha256:${e.sha256}. Nothing was fetched or written; the pin is only re-cut by a reviewed change to the declaration.`);const c=Z(a,n,0),h=await fetch(c,t.signal?{signal:t.signal}:{});if(!h.ok)throw new Error(`${c} returned ${h.status} ${h.statusText}.`);const g=new Uint8Array(await h.arrayBuffer()),p=await T(g);if(p!==e.sha256)throw new Error(`"${e.key}" → ${e.dest}: ${c} delivered sha256:${p} but the declaration pins sha256:${e.sha256}. Nothing was written.`);return{bytes:g,license:u.license}}export{w as ASSET_MANIFEST_PATH,se as fetchVerifiedPackEntry,we as materializeDeclaredAssetPacks};
@@ -1,4 +1,4 @@
1
- import{aT as s,i as d,R as u,a7 as p,bD as f}from"./three.module-D396a9Mn.js";const o="vgaiIblWorldPosition";function m(){return s.envmap_physical_pars_fragment.replaceAll("getIBLIrradiance","getBaseIBLIrradiance").replaceAll("getIBLRadiance","getBaseIBLRadiance")}function v(e){return(Array.isArray(e.material)?e.material:[e.material]).filter(a=>!!a.isMeshStandardMaterial)}function y(){const e=new d(new Uint8Array(1024),16,16,u,p);return e.mapping=f,e.needsUpdate=!0,e}function _(e,n){const a=e.onBeforeCompile,i=e.customProgramCacheKey;let t=null;return e.onBeforeCompile=(r,c)=>{a.call(e,r,c),l(r.vertexShader,"#include <worldpos_vertex>"),l(r.fragmentShader,"#include <envmap_physical_pars_fragment>"),r.vertexShader=`varying vec3 ${o};
1
+ import{aQ as s,ah as d,ab as u,Y as p,bz as f}from"./three.module-IFn-4i31.js";const o="vgaiIblWorldPosition";function m(){return s.envmap_physical_pars_fragment.replaceAll("getIBLIrradiance","getBaseIBLIrradiance").replaceAll("getIBLRadiance","getBaseIBLRadiance")}function v(e){return(Array.isArray(e.material)?e.material:[e.material]).filter(a=>!!a.isMeshStandardMaterial)}function y(){const e=new d(new Uint8Array(1024),16,16,u,p);return e.mapping=f,e.needsUpdate=!0,e}function _(e,n){const a=e.onBeforeCompile,i=e.customProgramCacheKey;let t=null;return e.onBeforeCompile=(r,c)=>{a.call(e,r,c),l(r.vertexShader,"#include <worldpos_vertex>"),l(r.fragmentShader,"#include <envmap_physical_pars_fragment>"),r.vertexShader=`varying vec3 ${o};
2
2
  ${r.vertexShader.replace("#include <worldpos_vertex>",`#include <worldpos_vertex>
3
3
  #if defined(USE_ENVMAP)
4
4
  ${o} = worldPosition.xyz;
@@ -1 +1 @@
1
- import{A as r,a as D,b as O,c as i,C as o,D as t,H as m,N as p,d as I,P as N,e as d,R as U,S as n,f as C,g as M,h as c,W as G,i as g,j as h,k as V,l as y,m as K,n as Y,o as f,p as B,s as F}from"./index-GIL7oGEO.js";import{createRootBinding as u}from"./binding-Bmxqznjk.js";import{MOUNTED_CANVAS_SURFACE_SHAPE as x,MOUNTED_DOM_SURFACE_SHAPE as l,MOUNTED_ROOT_BASE_SHAPE as L,MOUNTED_THREE_SURFACE_SHAPE as b,ROOT_ADAPTER_SHAPE as j,ROOT_STATE_OBSERVER_SHAPE as k}from"./root-seam-contract-Z0VWX3Bk.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";export{r as AUDIO_ADAPTER_SHAPE,D as AUTHORING_ADAPTER_SHAPE,O as AUTHORING_PROVIDER_KEYS,i as AUTHORING_PROVIDER_SHAPES,o as CAMERA_ADAPTER_SHAPE,t as DEBUG_ADAPTER_SHAPE,m as HIERARCHY_PROVIDER_SHAPE,x as MOUNTED_CANVAS_SURFACE_SHAPE,l as MOUNTED_DOM_SURFACE_SHAPE,L as MOUNTED_ROOT_BASE_SHAPE,b as MOUNTED_THREE_SURFACE_SHAPE,p as NAVIGATION_ADAPTER_SHAPE,I as NETWORKING_ADAPTER_SHAPE,N as PHYSICS_2D_ADAPTER_SHAPE,d as PHYSICS_ADAPTER_SHAPE,U as RENDER_DEBUG_ADAPTER_SHAPE,j as ROOT_ADAPTER_SHAPE,k as ROOT_STATE_OBSERVER_SHAPE,n as SEAM_PROOF_STAGES,C as SYSTEM_ADAPTERS_SHAPE,M as SYSTEM_PROVIDER_SHAPES,c as SeamEvidenceLedger,G as WRITE_ANCHOR_KINDS,u as createRootBinding,g as defineSeamShape,h as displayKeyedPhysics,V as emptyWriteAnchorKindCounts,y as gradeSeamCarrier,K as gradeSeamEvidence,Y as inspectSeamShape,f as measureAuthoringProviders,B as nodeKeyedPhysics,F as seamStageAtLeast};
1
+ import{A as r,a as D,b as O,c as i,C as o,D as t,H as m,N as p,d as I,P as N,e as d,R as U,S as n,f as C,g as M,h as c,W as G,i as g,j as h,k as V,l as y,m as K,n as Y,o as f,p as B,s as F}from"./index-Ckxb31Yz.js";import{createRootBinding as u}from"./binding-Bmxqznjk.js";import{MOUNTED_CANVAS_SURFACE_SHAPE as x,MOUNTED_DOM_SURFACE_SHAPE as l,MOUNTED_ROOT_BASE_SHAPE as L,MOUNTED_THREE_SURFACE_SHAPE as b,ROOT_ADAPTER_SHAPE as j,ROOT_STATE_OBSERVER_SHAPE as k}from"./root-seam-contract-C7GOxf5x.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";export{r as AUDIO_ADAPTER_SHAPE,D as AUTHORING_ADAPTER_SHAPE,O as AUTHORING_PROVIDER_KEYS,i as AUTHORING_PROVIDER_SHAPES,o as CAMERA_ADAPTER_SHAPE,t as DEBUG_ADAPTER_SHAPE,m as HIERARCHY_PROVIDER_SHAPE,x as MOUNTED_CANVAS_SURFACE_SHAPE,l as MOUNTED_DOM_SURFACE_SHAPE,L as MOUNTED_ROOT_BASE_SHAPE,b as MOUNTED_THREE_SURFACE_SHAPE,p as NAVIGATION_ADAPTER_SHAPE,I as NETWORKING_ADAPTER_SHAPE,N as PHYSICS_2D_ADAPTER_SHAPE,d as PHYSICS_ADAPTER_SHAPE,U as RENDER_DEBUG_ADAPTER_SHAPE,j as ROOT_ADAPTER_SHAPE,k as ROOT_STATE_OBSERVER_SHAPE,n as SEAM_PROOF_STAGES,C as SYSTEM_ADAPTERS_SHAPE,M as SYSTEM_PROVIDER_SHAPES,c as SeamEvidenceLedger,G as WRITE_ANCHOR_KINDS,u as createRootBinding,g as defineSeamShape,h as displayKeyedPhysics,V as emptyWriteAnchorKindCounts,y as gradeSeamCarrier,K as gradeSeamEvidence,Y as inspectSeamShape,f as measureAuthoringProviders,B as nodeKeyedPhysics,F as seamStageAtLeast};