@holoscript/core 8.0.0 → 8.0.1

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 (126) hide show
  1. package/README.md +2 -2
  2. package/dist/{GLTFPipeline-M7WSSJED.cjs → GLTFPipeline-N6B6PJ6G.cjs} +10 -9
  3. package/dist/{GLTFPipeline-276GE64O.js → GLTFPipeline-P3WMNYCN.js} +6 -5
  4. package/dist/{HoloScriptRuntime-3URVTKPJ.js → HoloScriptRuntime-CBYJX3LZ.js} +3 -3
  5. package/dist/{HoloScriptRuntime-SXEAEU2N.cjs → HoloScriptRuntime-VJ374RER.cjs} +4 -4
  6. package/dist/{chunk-JJBE3TIH.cjs → chunk-2IWC4FP7.cjs} +6 -6
  7. package/dist/{chunk-S4W6Z2MN.js → chunk-2X7NGX3M.js} +3 -3
  8. package/dist/chunk-4GU5GCIY.js +1384 -0
  9. package/dist/{chunk-T2QCTZMO.js → chunk-4SDKXQ4C.js} +3 -3
  10. package/dist/{chunk-253GBQZY.cjs → chunk-5H2G27PK.cjs} +35 -35
  11. package/dist/{chunk-C2A5DUMF.cjs → chunk-5NWINHR5.cjs} +35 -35
  12. package/dist/chunk-6Q7RC2MK.cjs +1418 -0
  13. package/dist/{chunk-D54CNIAJ.cjs → chunk-7H33U5SM.cjs} +2 -2
  14. package/dist/{chunk-CXFDRBQU.cjs → chunk-7M3PNU2M.cjs} +7 -7
  15. package/dist/{chunk-B4TFTDG4.js → chunk-7T25IEZ2.js} +3 -3
  16. package/dist/{chunk-7CUEMLDZ.cjs → chunk-7V4JI5TB.cjs} +540 -38
  17. package/dist/{chunk-WJIHFLMJ.js → chunk-ADADVMXY.js} +2 -2
  18. package/dist/{chunk-GQT4TYKY.cjs → chunk-ALC6K7GL.cjs} +40 -19
  19. package/dist/{chunk-3HYYMEXI.cjs → chunk-AOVGZ25K.cjs} +17 -12
  20. package/dist/{chunk-NHWSN2SD.cjs → chunk-AVJHHUC5.cjs} +17 -17
  21. package/dist/{chunk-UM6C3CGK.js → chunk-BGY3SDG3.js} +24 -3
  22. package/dist/{chunk-JCLBKPMX.js → chunk-BOVPWH4H.js} +48 -4
  23. package/dist/{chunk-ZZEI7MV4.js → chunk-CCATWPXM.js} +3 -3
  24. package/dist/{chunk-NBMHU6SW.js → chunk-CMT5NMMS.js} +3 -3
  25. package/dist/{chunk-HINXWAOD.cjs → chunk-CR4FMIWL.cjs} +11 -11
  26. package/dist/{chunk-W7VDOASB.cjs → chunk-CR7XRXRN.cjs} +5 -5
  27. package/dist/{chunk-AYBXB26F.js → chunk-CSD27UNQ.js} +5 -5
  28. package/dist/{chunk-IZM5VQZD.js → chunk-D3STJ56J.js} +3 -3
  29. package/dist/{chunk-ZBQXLH2L.js → chunk-DHO2YRIM.js} +3 -3
  30. package/dist/{chunk-JX7YL6ZE.js → chunk-E6XXE66V.js} +4 -4
  31. package/dist/{chunk-62FBK3B7.js → chunk-FFAOS5HQ.js} +4 -4
  32. package/dist/{chunk-NV4VMVXU.js → chunk-FL33V6U7.js} +3 -3
  33. package/dist/{chunk-XUUVDHIF.cjs → chunk-HKEXJUWS.cjs} +48 -3
  34. package/dist/{chunk-NXZFOPVD.cjs → chunk-HNDK4IQU.cjs} +16 -16
  35. package/dist/{chunk-RVBHAXFG.js → chunk-HR2OSYVQ.js} +16 -11
  36. package/dist/{chunk-LICPB5HZ.cjs → chunk-IUDGEUDO.cjs} +10 -10
  37. package/dist/{chunk-73FELZVJ.cjs → chunk-IWC5DM2M.cjs} +11 -11
  38. package/dist/{chunk-NGKREZ36.js → chunk-J52VSAQ7.js} +505 -5
  39. package/dist/{chunk-PHVRG4I2.js → chunk-J7XZV333.js} +3 -3
  40. package/dist/{chunk-K4VVR7CN.cjs → chunk-JBNDTXXV.cjs} +15 -15
  41. package/dist/{chunk-3NFFOWGG.js → chunk-JIBL5LRK.js} +2 -2
  42. package/dist/{chunk-HZSPDCXV.cjs → chunk-K574J76X.cjs} +3 -3
  43. package/dist/{chunk-SJBGLS25.cjs → chunk-KHDZJE5D.cjs} +5 -5
  44. package/dist/{chunk-KH4CNH66.cjs → chunk-L5LKKENW.cjs} +4 -4
  45. package/dist/{chunk-IVSZDECV.js → chunk-LHAXPADA.js} +3 -3
  46. package/dist/{chunk-EUDQTK7N.cjs → chunk-MQWAT42R.cjs} +2 -2
  47. package/dist/{chunk-KVRSTFNH.cjs → chunk-NCWCUZNS.cjs} +8 -8
  48. package/dist/{chunk-MGE5Z4GS.js → chunk-OH2FAIVU.js} +3 -3
  49. package/dist/{chunk-UMABK6SI.js → chunk-PY37LNDP.js} +3 -3
  50. package/dist/{chunk-23J755AR.js → chunk-QD32ADK6.js} +3 -3
  51. package/dist/{chunk-HZTDET3N.js → chunk-R24NNAEG.js} +3 -3
  52. package/dist/{chunk-6DPSFNJB.cjs → chunk-ROHLEP2W.cjs} +16 -16
  53. package/dist/{chunk-25IQCHTO.cjs → chunk-TWUXUCEW.cjs} +35 -35
  54. package/dist/{chunk-3AO425MZ.cjs → chunk-UFZZ7TSN.cjs} +17 -17
  55. package/dist/{chunk-BE4UJCQT.js → chunk-UWJHCOH2.js} +3 -3
  56. package/dist/{chunk-KEFNV2WM.cjs → chunk-X3UVCWNL.cjs} +13 -13
  57. package/dist/{chunk-7HIASF7S.cjs → chunk-XB274MW5.cjs} +10 -10
  58. package/dist/{chunk-KJLB4OPV.js → chunk-YN2YWTXW.js} +3 -3
  59. package/dist/{chunk-IPWSXCCN.js → chunk-YVD3CSO3.js} +3 -3
  60. package/dist/{chunk-F43YAA34.js → chunk-YVOAF4ML.js} +3 -3
  61. package/dist/{chunk-OR4Q2BGL.cjs → chunk-YWOBW2PV.cjs} +15 -15
  62. package/dist/compiler/android-xr.cjs +5 -5
  63. package/dist/compiler/android-xr.js +3 -3
  64. package/dist/compiler/babylon.cjs +4 -4
  65. package/dist/compiler/babylon.js +3 -3
  66. package/dist/compiler/business-quest.cjs +9 -9
  67. package/dist/compiler/business-quest.js +1 -1
  68. package/dist/compiler/domain-block-utils.cjs +154 -150
  69. package/dist/compiler/domain-block-utils.js +2 -2
  70. package/dist/compiler/gltf-pipeline.cjs +8 -8
  71. package/dist/compiler/gltf-pipeline.js +1 -1
  72. package/dist/compiler/godot.cjs +4 -4
  73. package/dist/compiler/godot.js +3 -3
  74. package/dist/compiler/index.cjs +129 -581
  75. package/dist/compiler/index.d.ts +12 -0
  76. package/dist/compiler/index.js +42 -498
  77. package/dist/compiler/multi-layer.cjs +5 -5
  78. package/dist/compiler/multi-layer.js +4 -4
  79. package/dist/compiler/nodetoy.d.ts +69 -0
  80. package/dist/compiler/openxr.cjs +4 -4
  81. package/dist/compiler/openxr.js +3 -3
  82. package/dist/compiler/playcanvas.cjs +4 -4
  83. package/dist/compiler/playcanvas.js +3 -3
  84. package/dist/compiler/r3f.cjs +9 -8
  85. package/dist/compiler/r3f.js +4 -3
  86. package/dist/compiler/sdf.cjs +5 -5
  87. package/dist/compiler/sdf.js +3 -3
  88. package/dist/compiler/unity.cjs +4 -4
  89. package/dist/compiler/unity.js +3 -3
  90. package/dist/compiler/unreal.cjs +5 -5
  91. package/dist/compiler/unreal.js +3 -3
  92. package/dist/compiler/urdf.cjs +12 -12
  93. package/dist/compiler/urdf.js +3 -3
  94. package/dist/compiler/usd-physics.cjs +5 -5
  95. package/dist/compiler/usd-physics.js +2 -2
  96. package/dist/compiler/visionos.cjs +4 -4
  97. package/dist/compiler/visionos.js +3 -3
  98. package/dist/compiler/vrchat.cjs +5 -5
  99. package/dist/compiler/vrchat.js +3 -3
  100. package/dist/compiler/vrr.cjs +5 -5
  101. package/dist/compiler/vrr.js +3 -3
  102. package/dist/compiler/wasm.cjs +8 -8
  103. package/dist/compiler/wasm.js +3 -3
  104. package/dist/compiler/webgpu.cjs +4 -4
  105. package/dist/compiler/webgpu.js +3 -3
  106. package/dist/debugger.cjs +4 -4
  107. package/dist/debugger.js +2 -2
  108. package/dist/dist-ACXG6IH5.cjs +3113 -0
  109. package/dist/dist-VD4L6V7Q.js +3076 -0
  110. package/dist/index.cjs +1915 -488
  111. package/dist/index.d.ts +2 -0
  112. package/dist/index.js +1480 -53
  113. package/dist/reconstruction/index.cjs +31 -31
  114. package/dist/reconstruction/index.js +2 -2
  115. package/dist/runtime.cjs +6 -6
  116. package/dist/runtime.js +2 -2
  117. package/dist/src-4ROC227P.cjs +2094 -0
  118. package/dist/src-HCCCSYP7.js +2073 -0
  119. package/dist/traits/botanical-lotus.cjs +146 -10
  120. package/dist/traits/botanical-lotus.d.ts +330 -0
  121. package/dist/traits/botanical-lotus.js +4 -1
  122. package/dist/traits/index.cjs +594 -455
  123. package/dist/traits/index.js +9 -5
  124. package/package.json +20 -20
  125. package/dist/chunk-VECQYRXL.js +0 -474
  126. package/dist/chunk-WDT3JTGM.cjs +0 -483
package/dist/index.js CHANGED
@@ -1,12 +1,12 @@
1
- export { GLTFPipeline, createGLTFPipeline, generateScaleNormalMap, generateScaleTexture } from './chunk-JX7YL6ZE.js';
2
- export { ANCHOR_DEFAULTS, ARCORE_DEPTH_RECOMMENDED_RANGE_MILLIMETERS, HOLOMAP_MOBILE_SENSOR_BUNDLE_VERSION, TRAJECTORY_DEFAULTS, arCoreDepthFrameToMobileSensorFrame, cameraPoseFromColumnMajorTransform, createAnchorContext, createArCoreDepthMobileSensorBundle, createFusedAttentionBackend, createPagedKVCache, createTrajectoryMemory, mergeAnchoredProvenance, mobileSensorBundleToFrames, replayMobileSensorBundle, validateMobileSensorBundle } from './chunk-F43YAA34.js';
1
+ export { GLTFPipeline, createGLTFPipeline, generateScaleNormalMap, generateScaleTexture } from './chunk-E6XXE66V.js';
2
+ export { ANCHOR_DEFAULTS, ARCORE_DEPTH_RECOMMENDED_RANGE_MILLIMETERS, HOLOMAP_MOBILE_SENSOR_BUNDLE_VERSION, TRAJECTORY_DEFAULTS, arCoreDepthFrameToMobileSensorFrame, cameraPoseFromColumnMajorTransform, createAnchorContext, createArCoreDepthMobileSensorBundle, createFusedAttentionBackend, createPagedKVCache, createTrajectoryMemory, mergeAnchoredProvenance, mobileSensorBundleToFrames, replayMobileSensorBundle, validateMobileSensorBundle } from './chunk-YVOAF4ML.js';
3
3
  export { InteropBindingGenerator, MCPCircuitBreaker, getMCPCircuitBreaker } from './chunk-FGGJQRLZ.js';
4
4
  export { SkeletonTrait as SkeletonAnimationTrait, createSkeletonTrait } from './chunk-M56JSP4A.js';
5
- export { BUILD_TIMESTAMP, GIT_COMMIT_SHA, HOLOMAP_DEFAULTS, HOLOSCRIPT_VERSION, assertWeightCid, createHoloMapMicroEncoder, createHoloMapRunId, createHoloMapRuntime, frameToMicroImage, getCachedWeightBlob, getVersionInfo, getVersionString, loadHoloMapWeightBlob, logHoloMapEvent, normalizeWeightCidDigest, putCachedWeightBlob, resetHoloMapTelemetryForTests, runHoloMapMicroEncoderCpu, tryCreateHoloMapEncoderDevice } from './chunk-AYBXB26F.js';
5
+ export { BUILD_TIMESTAMP, GIT_COMMIT_SHA, HOLOMAP_DEFAULTS, HOLOSCRIPT_VERSION, assertWeightCid, createHoloMapMicroEncoder, createHoloMapRunId, createHoloMapRuntime, frameToMicroImage, getCachedWeightBlob, getVersionInfo, getVersionString, loadHoloMapWeightBlob, logHoloMapEvent, normalizeWeightCidDigest, putCachedWeightBlob, resetHoloMapTelemetryForTests, runHoloMapMicroEncoderCpu, tryCreateHoloMapEncoderDevice } from './chunk-CSD27UNQ.js';
6
6
  export { computeHoloMapReplayFingerprint, fnv1a32Hex } from './chunk-WNNE3PO3.js';
7
7
  export { CircuitBreakerState, CircuitBreaker as ResilienceCircuitBreaker, retryWithBackoff, withTimeout } from './chunk-A6KINLZJ.js';
8
- import { init_ThreeJSCompiler, init_A2AAgentCardCompiler, init_NIRCompiler, GaussianSplattingCompiler, NIRCompiler, A2AAgentCardCompiler, USDZPipeline } from './chunk-NGKREZ36.js';
9
- export { BUILTIN_RESOURCES, CAPABILITY_HIERARCHY, CATEGORY_DEFAULT_EMBODIMENT, CompilerBridge, CrossRealityTraitRegistry, EFFECTS_BY_CATEGORY, EFFECT_TO_CAPABILITY, EffectChecker, EffectRow, HANDOFF_PATH_RULES, LinearTypeChecker, MVC_BUDGET_CONSTRAINTS, PLATFORM_BUDGETS, PLATFORM_EMBODIMENT_OVERRIDES, ResourceBudgetAnalyzer, SpatialPartitionPass, TRAIT_EFFECTS, TRAIT_RESOURCE_COSTS, TRAIT_RESOURCE_MAP, TRUST_LEVEL_CAPABILITIES, ThreeJSCompiler, USDZPipeline, bestCategoryForTraits, buildSafetyReport, checkCapabilities, compilePipelineSource, compilePipelineSourceToNode, compilePipelineSourceToPython, compilePipelineToNode, compilePipelineToPython, createCrossRealityTraitRegistry, createEffectChecker, dangerLevel, deriveRequirements, effectCategory, expandCapabilities, formatReport, generateCertificate, getCompilerBridge, getCrossRealityTraitRegistry, inferFromBuiltins, inferFromTraits, isSafeTraitSet, knownBuiltins, knownTraits, quickSafetyCheck, resetCrossRealityTraitRegistry, runSafetyPass, selectModality, selectModalityForAll, spatialPartition } from './chunk-NGKREZ36.js';
8
+ import { init_ThreeJSCompiler, init_Native2DCompiler, init_A2AAgentCardCompiler, init_NIRCompiler, Native2DCompiler, GaussianSplattingCompiler, NIRCompiler, A2AAgentCardCompiler, USDZPipeline } from './chunk-J52VSAQ7.js';
9
+ export { BUILTIN_RESOURCES, CAPABILITY_HIERARCHY, CATEGORY_DEFAULT_EMBODIMENT, CompilerBridge, CrossRealityTraitRegistry, EFFECTS_BY_CATEGORY, EFFECT_TO_CAPABILITY, EffectChecker, EffectRow, HANDOFF_PATH_RULES, LinearTypeChecker, MVC_BUDGET_CONSTRAINTS, PLATFORM_BUDGETS, PLATFORM_EMBODIMENT_OVERRIDES, ResourceBudgetAnalyzer, SpatialPartitionPass, TRAIT_EFFECTS, TRAIT_RESOURCE_COSTS, TRAIT_RESOURCE_MAP, TRUST_LEVEL_CAPABILITIES, ThreeJSCompiler, USDZPipeline, bestCategoryForTraits, buildSafetyReport, checkCapabilities, compilePipelineSource, compilePipelineSourceToNode, compilePipelineSourceToPython, compilePipelineToNode, compilePipelineToPython, createCrossRealityTraitRegistry, createEffectChecker, dangerLevel, deriveRequirements, effectCategory, expandCapabilities, formatReport, generateCertificate, getCompilerBridge, getCrossRealityTraitRegistry, inferFromBuiltins, inferFromTraits, isSafeTraitSet, knownBuiltins, knownTraits, quickSafetyCheck, resetCrossRealityTraitRegistry, runSafetyPass, selectModality, selectModalityForAll, spatialPartition } from './chunk-J52VSAQ7.js';
10
10
  export { generateHullGeometry, generateMembraneGeometry, generateSplineGeometry } from './chunk-EKBKLK7P.js';
11
11
  import { generateSemanticSceneGraphObject } from './chunk-HYNTS5CP.js';
12
12
  export { SemanticSceneGraph } from './chunk-HYNTS5CP.js';
@@ -14,11 +14,10 @@ export { AgentInferenceExportTarget_default as AgentInferenceExportTarget } from
14
14
  export { assertHoloMapManifestContract } from './chunk-MBOOR7X4.js';
15
15
  export { COCOExporterImpl as COCOExporter } from './chunk-Q56TT7IL.js';
16
16
  export { RemotionBridgeImpl as RemotionBridge } from './chunk-YYXH45E2.js';
17
- export { AIDriverTrait, ARKIT_MOUTH_SHAPES, AnimationTrait, BehaviorTreeRunner, MorphTrait as BlendShapeTrait, CharacterTrait, ComponentType, DEFAULT_ANIMATION_MAP, DEFAULT_AUTONOMY_GUARD_POLICY, DEFAULT_EXPRESSION_PRESETS, DEFAULT_FREQUENCY_BANDS, DRAFT_DEFAULTS, DRAFT_TRAIT, DialogTrait, DraftManager, ECSWorld, EmotionDirectiveTrait, GOAPPlanner, IKTrait, JointTrait, LipSyncTrait, LobbyTrait, NetworkedTrait, OCULUS_VISEME_MAP, REFUSED_CARE_OPTIMIZATION_TARGETS, RigidbodyTrait, TriggerTrait, VRTraitRegistry, VoiceInputTrait, VoiceOutputTrait, accessibleHandler, aiInpaintingHandler, aiTextureGenHandler, alertHandler, altTextHandler, ambisonicsHandler, anchorHandler, audioMaterialHandler, audioOcclusionHandler, audioPortalHandler, avatarEmbodimentHandler, behaviorTreeHandler, bodyTrackingHandler, buoyancyHandler, chainHandler, clothHandler, coLocatedHandler, computeHandler, controlNetHandler, controllerInputHandler, createAIDriverTrait, createAnimationTrait, createMorphTrait as createBlendShapeTrait, createCareField, createCharacterTrait, createDialogTrait, createEmotionDirectiveTrait, createIKTrait, createJointTrait, createLipSyncTrait, createLobbyTrait, createNetworkedTrait, createRepairLoop, createRigidbodyTrait, createTriggerTrait, createVoiceInputTrait, createVoiceOutputTrait, dataBindingHandler, destructionHandler, dialogueHandler, diffusionRealtimeHandler, digitalTwinHandler, dropTableHandler, effectiveWeight, emotionHandler, emotionalVoiceHandler, encounterHandler, evaluateAutonomyGuard, extractPayload, faceTrackingHandler, factionHandler, fbxHandler, flowFieldHandler, fluidHandler, gaussianSplatHandler, geospatialAnchorHandler, geospatialEnvHandler, getCachedThingDescription, getMQTTSinkClient, getMQTTSinkState, getMQTTSourceClient, getMQTTSourceState, getWoTThingState, gltfHandler, goalOrientedHandler, gpuBufferHandler, gpuParticleHandler, gpuPhysicsHandler, handTrackingHandler, hapticCueHandler, hasMQTTSinkTrait, hasMQTTSourceTrait, hasWoTThingTrait, headTrackedAudioHandler, heatmap3dHandler, highContrastHandler, hrtfHandler, invalidateThingDescription, isMQTTSinkConnected, isMQTTSourceConnected, layerAwareHandler, lightEstimationHandler, llmAgentHandler, luckHandler, magnifiableHandler, marketplaceHandler, materialXHandler, memoryHandler, meshDetectionHandler, motionReducedHandler, mqttSinkHandler, mqttSourceHandler, multiAgentHandler, nerfHandler, neuralLinkHandler, nftHandler, occlusionHandler, patrolHandler, perceptionHandler, persistentAnchorHandler, photogrammetryHandler, pickByWeight, planeDetectionHandler, poiHandler, pointCloudHandler, portableHandler, publishToMQTTSink, rbacHandler, recordGratitude, rememberRelationalContext, remotePresenceHandler, reverbZoneHandler, roleHandler, rooftopAnchorHandler, ropeHandler, sceneGraphHandler, screenReaderHandler, sensorHandler, sharePlayHandler, sharedAnchorHandler, sharedWorldHandler, shouldFire, softBodyHandler, sonificationHandler, spatialAccessoryHandler, spatialAudioCueHandler, spatialPersonaHandler, spectatorHandler, statHandler, subtitleHandler, terrainAnchorHandler, tokenGatedHandler, usdHandler, userMonitorHandler, validateCareField, voiceProximityHandler, volumetricVideoHandler, vpsHandler, vrTraitRegistry, walletHandler, windHandler, wotThingHandler } from './chunk-RVBHAXFG.js';
17
+ export { AIDriverTrait, ARKIT_MOUTH_SHAPES, AnimationTrait, BehaviorTreeRunner, MorphTrait as BlendShapeTrait, CharacterTrait, ComponentType, DEFAULT_ANIMATION_MAP, DEFAULT_AUTONOMY_GUARD_POLICY, DEFAULT_EXPRESSION_PRESETS, DEFAULT_FREQUENCY_BANDS, DRAFT_DEFAULTS, DRAFT_TRAIT, DialogTrait, DraftManager, ECSWorld, EmotionDirectiveTrait, GOAPPlanner, IKTrait, JointTrait, LipSyncTrait, LobbyTrait, NetworkedTrait, OCULUS_VISEME_MAP, REFUSED_CARE_OPTIMIZATION_TARGETS, RigidbodyTrait, TriggerTrait, VRTraitRegistry, VoiceInputTrait, VoiceOutputTrait, accessibleHandler, aiInpaintingHandler, aiTextureGenHandler, alertHandler, altTextHandler, ambisonicsHandler, anchorHandler, audioMaterialHandler, audioOcclusionHandler, audioPortalHandler, avatarEmbodimentHandler, behaviorTreeHandler, bodyTrackingHandler, buoyancyHandler, chainHandler, clothHandler, coLocatedHandler, computeHandler, controlNetHandler, controllerInputHandler, createAIDriverTrait, createAnimationTrait, createMorphTrait as createBlendShapeTrait, createCareField, createCharacterTrait, createDialogTrait, createEmotionDirectiveTrait, createIKTrait, createJointTrait, createLipSyncTrait, createLobbyTrait, createNetworkedTrait, createRepairLoop, createRigidbodyTrait, createTriggerTrait, createVoiceInputTrait, createVoiceOutputTrait, dataBindingHandler, destructionHandler, dialogueHandler, diffusionRealtimeHandler, digitalTwinHandler, dropTableHandler, effectiveWeight, emotionHandler, emotionalVoiceHandler, encounterHandler, evaluateAutonomyGuard, extractPayload, faceTrackingHandler, factionHandler, fbxHandler, flowFieldHandler, fluidHandler, gaussianSplatHandler, geospatialAnchorHandler, geospatialEnvHandler, getCachedThingDescription, getMQTTSinkClient, getMQTTSinkState, getMQTTSourceClient, getMQTTSourceState, getWoTThingState, gltfHandler, goalOrientedHandler, gpuBufferHandler, gpuParticleHandler, gpuPhysicsHandler, handTrackingHandler, hapticCueHandler, hasMQTTSinkTrait, hasMQTTSourceTrait, hasWoTThingTrait, headTrackedAudioHandler, heatmap3dHandler, highContrastHandler, hrtfHandler, invalidateThingDescription, isMQTTSinkConnected, isMQTTSourceConnected, layerAwareHandler, lightEstimationHandler, llmAgentHandler, luckHandler, magnifiableHandler, marketplaceHandler, materialXHandler, memoryHandler, meshDetectionHandler, motionReducedHandler, mqttSinkHandler, mqttSourceHandler, multiAgentHandler, nerfHandler, neuralLinkHandler, nftHandler, occlusionHandler, patrolHandler, perceptionHandler, persistentAnchorHandler, photogrammetryHandler, pickByWeight, planeDetectionHandler, poiHandler, pointCloudHandler, portableHandler, publishToMQTTSink, rbacHandler, recordGratitude, rememberRelationalContext, remotePresenceHandler, reverbZoneHandler, roleHandler, rooftopAnchorHandler, ropeHandler, sceneGraphHandler, screenReaderHandler, sensorHandler, sharePlayHandler, sharedAnchorHandler, sharedWorldHandler, shouldFire, softBodyHandler, sonificationHandler, spatialAccessoryHandler, spatialAudioCueHandler, spatialPersonaHandler, spectatorHandler, statHandler, subtitleHandler, terrainAnchorHandler, tokenGatedHandler, usdHandler, userMonitorHandler, validateCareField, voiceProximityHandler, volumetricVideoHandler, vpsHandler, vrTraitRegistry, walletHandler, windHandler, wotThingHandler } from './chunk-HR2OSYVQ.js';
18
18
  export { LIGHTING_PRESETS, LightingTrait, MATERIAL_PRESETS, MaterialTrait, RenderingTrait, SHADER_CHUNKS, SHADER_PRESETS, ShaderTrait, createLightingTrait, createMaterialTrait, createRenderingTrait, createShaderTrait } from './chunk-QPOQ7VPI.js';
19
19
  export { HOLOMAP_SIMULATION_CONTRACT_KIND, ensureNodeWebGpuSync, isWebGpuEnvironmentPresent } from './chunk-YF2I3MV3.js';
20
20
  import './chunk-TDCNJHWO.js';
21
- import './chunk-VECQYRXL.js';
22
21
  import './chunk-YQELFNJV.js';
23
22
  import './chunk-FHP6LXJS.js';
24
23
  import { IncrementalCompiler } from './chunk-GYZE55MO.js';
@@ -29,61 +28,62 @@ export { AsyncFunctionHandler, ErrorBoundary, ExportImportHandler, InteropContex
29
28
  export { ABSORB_TRAIT, AbsorbProcessor, HOT_RELOAD_TRAIT, HotReloadWatcher, SCRIPT_TEST_TRAIT, ScriptTestRunner } from './chunk-2M2DPHKB.js';
30
29
  import { computeContentHash } from './chunk-4R6SBXDB.js';
31
30
  export { classifyPublishMode, computeContentHash, extractImports, generateProvenance } from './chunk-4R6SBXDB.js';
32
- import { init_WASMCompiler, WASMCompiler } from './chunk-IPWSXCCN.js';
33
- export { WASMCompiler, compileASTToWASM, compileToWASM, createWASMCompiler } from './chunk-IPWSXCCN.js';
34
- import { init_WebGPUCompiler, WebGPUCompiler } from './chunk-NBMHU6SW.js';
35
- export { WebGPUCompiler } from './chunk-NBMHU6SW.js';
31
+ import { init_WASMCompiler, WASMCompiler } from './chunk-YVD3CSO3.js';
32
+ export { WASMCompiler, compileASTToWASM, compileToWASM, createWASMCompiler } from './chunk-YVD3CSO3.js';
33
+ import { init_WebGPUCompiler, WebGPUCompiler } from './chunk-CMT5NMMS.js';
34
+ export { WebGPUCompiler } from './chunk-CMT5NMMS.js';
36
35
  import { init_DTDLCompiler, DTDLCompiler } from './chunk-J6M4FPK5.js';
37
36
  export { DTDLCompiler, DTDL_TRAIT_COMPONENTS } from './chunk-J6M4FPK5.js';
38
- import { init_URDFCompiler, URDFCompiler } from './chunk-HZTDET3N.js';
39
- export { URDFCompiler, compileForGazebo, compileForROS2, compileToURDF, createURDFCompiler, generateControllersYaml, generateROS2LaunchFile } from './chunk-HZTDET3N.js';
40
- import { USDPhysicsCompiler } from './chunk-IVSZDECV.js';
41
- export { USDPhysicsCompiler, compileForIsaacSim, compileToUSDPhysics } from './chunk-IVSZDECV.js';
42
- import { init_SDFCompiler, SDFCompiler } from './chunk-MGE5Z4GS.js';
43
- export { SDFCompiler } from './chunk-MGE5Z4GS.js';
37
+ import { init_URDFCompiler, URDFCompiler } from './chunk-R24NNAEG.js';
38
+ export { URDFCompiler, compileForGazebo, compileForROS2, compileToURDF, createURDFCompiler, generateControllersYaml, generateROS2LaunchFile } from './chunk-R24NNAEG.js';
39
+ import { USDPhysicsCompiler } from './chunk-LHAXPADA.js';
40
+ export { USDPhysicsCompiler, compileForIsaacSim, compileToUSDPhysics } from './chunk-LHAXPADA.js';
41
+ import { init_SDFCompiler, SDFCompiler } from './chunk-OH2FAIVU.js';
42
+ export { SDFCompiler } from './chunk-OH2FAIVU.js';
44
43
  import { init_StateCompiler, StateCompiler } from './chunk-ANXZFVY2.js';
45
44
  import { TraitCompositionCompiler } from './chunk-XKTPFXGA.js';
46
45
  export { TraitCompositionCompiler } from './chunk-XKTPFXGA.js';
47
- import { init_UnrealCompiler, UnrealCompiler } from './chunk-IZM5VQZD.js';
48
- export { UnrealCompiler, compileToUnreal } from './chunk-IZM5VQZD.js';
49
- import { init_GodotCompiler, GodotCompiler } from './chunk-UMABK6SI.js';
50
- export { GodotCompiler } from './chunk-UMABK6SI.js';
51
- import { init_R3FCompiler, init_visual, MATERIAL_PRESETS, ENVIRONMENT_PRESETS, R3FCompiler } from './chunk-UM6C3CGK.js';
52
- export { ENVIRONMENT_PRESETS, R3FCompiler, registerAllPresets } from './chunk-UM6C3CGK.js';
46
+ import { init_UnrealCompiler, UnrealCompiler } from './chunk-D3STJ56J.js';
47
+ export { UnrealCompiler, compileToUnreal } from './chunk-D3STJ56J.js';
48
+ import { init_GodotCompiler, GodotCompiler } from './chunk-PY37LNDP.js';
49
+ export { GodotCompiler } from './chunk-PY37LNDP.js';
50
+ import { init_R3FCompiler, init_visual, MATERIAL_PRESETS, ENVIRONMENT_PRESETS, R3FCompiler } from './chunk-BGY3SDG3.js';
51
+ export { ENVIRONMENT_PRESETS, R3FCompiler, registerAllPresets } from './chunk-BGY3SDG3.js';
53
52
  import './chunk-XT6JY5W5.js';
54
- import { init_PlayCanvasCompiler, PlayCanvasCompiler } from './chunk-ZBQXLH2L.js';
53
+ import './chunk-4GU5GCIY.js';
54
+ import { init_PlayCanvasCompiler, PlayCanvasCompiler } from './chunk-DHO2YRIM.js';
55
55
  import { init_AndroidCompiler, AndroidCompiler } from './chunk-WRKUDAZJ.js';
56
56
  export { AndroidCompiler, compileToAndroid } from './chunk-WRKUDAZJ.js';
57
- import { init_AndroidXRCompiler, AndroidXRCompiler } from './chunk-KJLB4OPV.js';
58
- export { AndroidXRCompiler, compileToAndroidXR } from './chunk-KJLB4OPV.js';
57
+ import { init_AndroidXRCompiler, AndroidXRCompiler } from './chunk-YN2YWTXW.js';
58
+ export { AndroidXRCompiler, compileToAndroidXR } from './chunk-YN2YWTXW.js';
59
59
  import './chunk-FDSGHPAK.js';
60
60
  import { init_IOSCompiler, IOSCompiler } from './chunk-OMXII44L.js';
61
61
  export { IOSCompiler, compileToIOS } from './chunk-OMXII44L.js';
62
- import { init_VisionOSCompiler, VisionOSCompiler } from './chunk-S4W6Z2MN.js';
63
- export { VisionOSCompiler } from './chunk-S4W6Z2MN.js';
62
+ import { init_VisionOSCompiler, VisionOSCompiler } from './chunk-2X7NGX3M.js';
63
+ export { VisionOSCompiler } from './chunk-2X7NGX3M.js';
64
64
  export { FileSizeExceededError, IPFSPinError, IPFSService, IPFSUploadError, InfuraProvider, NFTStorageProvider, PinataProvider } from './chunk-WRWEX5ZF.js';
65
- import { MultiLayerCompiler } from './chunk-62FBK3B7.js';
66
- export { MultiLayerCompiler } from './chunk-62FBK3B7.js';
67
- import { init_VRRCompiler, VRRCompiler } from './chunk-T2QCTZMO.js';
68
- export { VRRCompiler } from './chunk-T2QCTZMO.js';
65
+ import { MultiLayerCompiler } from './chunk-FFAOS5HQ.js';
66
+ export { MultiLayerCompiler } from './chunk-FFAOS5HQ.js';
67
+ import { init_VRRCompiler, VRRCompiler } from './chunk-4SDKXQ4C.js';
68
+ export { VRRCompiler } from './chunk-4SDKXQ4C.js';
69
69
  import { init_ARCompiler, ARCompiler } from './chunk-UJXISJBN.js';
70
70
  export { ARCompiler } from './chunk-UJXISJBN.js';
71
- import { init_OpenXRCompiler, OpenXRCompiler } from './chunk-23J755AR.js';
72
- export { OpenXRCompiler } from './chunk-23J755AR.js';
73
- import { init_VRChatCompiler, VRChatCompiler } from './chunk-BE4UJCQT.js';
74
- export { VRChatCompiler, compileToVRChat } from './chunk-BE4UJCQT.js';
75
- import { init_BabylonCompiler, BabylonCompiler } from './chunk-PHVRG4I2.js';
76
- export { BabylonCompiler } from './chunk-PHVRG4I2.js';
71
+ import { init_OpenXRCompiler, OpenXRCompiler } from './chunk-QD32ADK6.js';
72
+ export { OpenXRCompiler } from './chunk-QD32ADK6.js';
73
+ import { init_VRChatCompiler, VRChatCompiler } from './chunk-UWJHCOH2.js';
74
+ export { VRChatCompiler, compileToVRChat } from './chunk-UWJHCOH2.js';
75
+ import { init_BabylonCompiler, BabylonCompiler } from './chunk-J7XZV333.js';
76
+ export { BabylonCompiler } from './chunk-J7XZV333.js';
77
77
  import { init_Semiring, init_ProvenanceSemiring } from './chunk-TJHVSBP2.js';
78
78
  export { AuthorityTier, MaxPlusSemiring, MinPlusSemiring, ProvenanceSemiring, SumProductSemiring, TRAIT_ZERO, authorityWeight, createDeadElement, isDeadElement, strategyToSemiring } from './chunk-TJHVSBP2.js';
79
79
  import { init_TraitCompositor, init_composition_rules } from './chunk-4C57PR42.js';
80
80
  export { COMPOSITION_RULES, TraitCompositor, TraitVisualRegistry, VISUAL_LAYER_PRIORITY } from './chunk-4C57PR42.js';
81
- import { init_UnityCompiler, UnityCompiler } from './chunk-ZZEI7MV4.js';
82
- export { UnityCompiler } from './chunk-ZZEI7MV4.js';
81
+ import { init_UnityCompiler, UnityCompiler } from './chunk-CCATWPXM.js';
82
+ export { UnityCompiler } from './chunk-CCATWPXM.js';
83
83
  import { init_PlatformConditional, init_PlatformConditionalCompilerMixin, PLATFORM_CATEGORIES, DEFAULT_EMBODIMENT, platformCategory, ALL_PLATFORMS } from './chunk-GZG4KA4E.js';
84
84
  export { ALL_PLATFORMS, DEFAULT_EMBODIMENT, PLATFORM_CAPABILITIES, PLATFORM_CATEGORIES, PlatformConditionalCompilerMixin, ALL_PLATFORMS as XR_ALL_PLATFORMS, PLATFORM_CAPABILITIES as XR_PLATFORM_CAPABILITIES, PLATFORM_CATEGORIES as XR_PLATFORM_CATEGORIES, agentBudgetFor, createPlatformTarget, embodimentFor, filterCompositionForPlatform, hasCapability, matchesPlatform, matchesPlatformConstraint, normalizePlatformName, platformCategory, resolvePlatforms, selectBlock } from './chunk-GZG4KA4E.js';
85
- import { init_DomainBlockCompilerMixin, compileDomainBlocks, compileWeatherBlock, compileAudioSourceBlock, compilePostProcessingBlock, compileParticleBlock, compilePhysicsBlock, compileMaterialBlock } from './chunk-JCLBKPMX.js';
86
- export { architectureToGodot, architectureToR3F, architectureToUSDA, architectureToUnity, architectureToVRChat, compileArchitectureBlock, compileDataVizBlock, compileDomainBlocks, compileEducationBlock, compileHealthcareBlock, compileInputBlock, compileIoTBlock, compileMaterialBlock, compileMusicBlock, compileNarrativeBlock, compileNavigationBlock, compilePaymentBlock, compilePhysicsBlock, compileProceduralBlock, compileRenderingBlock, compileRoboticsBlock, compileWeb3Block, datavizToGodot, datavizToR3F, datavizToUSDA, datavizToUnity, datavizToVRChat, educationToGodot, educationToR3F, educationToUSDA, educationToUnity, educationToVRChat, healthcareToGodot, healthcareToR3F, healthcareToUSDA, healthcareToUnity, healthcareToVRChat, inputToGodot, inputToR3F, inputToUSDA, inputToUnity, inputToVRChat, iotToGodot, iotToR3F, iotToUSDA, iotToUnity, iotToVRChat, materialToGLTF, materialToR3F, materialToUSD, musicToGodot, musicToR3F, musicToUSDA, musicToUnity, musicToVRChat, narrativeToGodot, narrativeToR3F, narrativeToUSDA, narrativeToUnity, narrativeToVRChat, navigationToGodot, navigationToR3F, navigationToUSDA, navigationToUnity, navigationToVRChat, paymentToGodot, paymentToR3F, paymentToUSDA, paymentToUnity, paymentToVRChat, physicsToURDF, proceduralToGodot, proceduralToR3F, proceduralToUSDA, proceduralToUnity, proceduralToVRChat, renderingToGodot, renderingToR3F, renderingToUSDA, renderingToUnity, renderingToVRChat, roboticsToGodot, roboticsToR3F, roboticsToUSDA, roboticsToUnity, roboticsToVRChat, web3ToGodot, web3ToR3F, web3ToUSDA, web3ToUnity, web3ToVRChat } from './chunk-JCLBKPMX.js';
85
+ import { init_DomainBlockCompilerMixin, compileDomainBlocks, compileWeatherBlock, compileAudioSourceBlock, compilePostProcessingBlock, compileParticleBlock, compilePhysicsBlock, compileMaterialBlock } from './chunk-BOVPWH4H.js';
86
+ export { architectureToGodot, architectureToR3F, architectureToUSDA, architectureToUnity, architectureToVRChat, compileArchitectureBlock, compileDataVizBlock, compileDomainBlocks, compileEducationBlock, compileHealthcareBlock, compileInputBlock, compileIoTBlock, compileMaterialBlock, compileMusicBlock, compileNarrativeBlock, compileNavigationBlock, compilePaymentBlock, compilePhysicsBlock, compileProceduralBlock, compileRenderingBlock, compileRoboticsBlock, compileWeb3Block, datavizToGodot, datavizToR3F, datavizToUSDA, datavizToUnity, datavizToVRChat, educationToGodot, educationToR3F, educationToUSDA, educationToUnity, educationToVRChat, healthcareToGodot, healthcareToR3F, healthcareToUSDA, healthcareToUnity, healthcareToVRChat, inputToGodot, inputToR3F, inputToUSDA, inputToUnity, inputToVRChat, iotToGodot, iotToR3F, iotToUSDA, iotToUnity, iotToVRChat, materialToGLTF, materialToR3F, materialToUSD, musicToGodot, musicToR3F, musicToUSDA, musicToUnity, musicToVRChat, narrativeToGodot, narrativeToR3F, narrativeToUSDA, narrativeToUnity, narrativeToVRChat, navigationToGodot, navigationToR3F, navigationToUSDA, navigationToUnity, navigationToVRChat, paymentToGodot, paymentToR3F, paymentToUSDA, paymentToUnity, paymentToVRChat, physicsToURDF, proceduralToGodot, proceduralToR3F, proceduralToUSDA, proceduralToUnity, proceduralToVRChat, renderingToGodot, renderingToR3F, renderingToUSDA, renderingToUnity, renderingToVRChat, roboticsToGodot, roboticsToR3F, roboticsToUSDA, roboticsToUnity, roboticsToVRChat, web3ToGodot, web3ToR3F, web3ToUSDA, web3ToUnity, web3ToVRChat } from './chunk-BOVPWH4H.js';
87
87
  import { init_CompilerBase, init_CompilerDocumentationGenerator, init_CultureTraits, CompilerBase, CompilerDocumentationGenerator } from './chunk-QPSKHBJP.js';
88
88
  export { BUILTIN_NORMS, BUILTIN_NORM_PROVENANCE, CompilerBase, UNKNOWN_NORM_PROVENANCE, criticalMassForChange, deserializeNormProvenance, getBuiltinNorm, normalizeNormProvenance, normsByCategory, serializeNormProvenance } from './chunk-QPSKHBJP.js';
89
89
  import './chunk-THCK6ECW.js';
@@ -114,7 +114,7 @@ import { logger } from './chunk-PHENW4MQ.js';
114
114
  export { ConsoleLogger, NoOpLogger, enableConsoleLogging, logger, resetLogger, setHoloScriptLogger } from './chunk-PHENW4MQ.js';
115
115
  import { init_safeJsonParse, readJson, jsonClone } from './chunk-VVKVQZI6.js';
116
116
  export { jsonClone, readJson, safeJsonParse, safeJsonParseSchema, tryParseJson } from './chunk-VVKVQZI6.js';
117
- import { __export, __require } from './chunk-OL46QLBJ.js';
117
+ import { __commonJS, __export, __publicField, __require } from './chunk-OL46QLBJ.js';
118
118
  import * as fs2 from 'fs';
119
119
  import { existsSync, mkdirSync, readFileSync, writeFileSync, unlinkSync, readdirSync, statSync } from 'fs';
120
120
  import * as path3 from 'path';
@@ -128,6 +128,1391 @@ export { canonicalizeManifest, checkRateLimit, createDefaultPolicy, createPackag
128
128
  import { createRequire } from 'module';
129
129
  import { Worker } from 'worker_threads';
130
130
 
131
+ // ../holo-vm/dist/index.cjs
132
+ var require_dist = __commonJS({
133
+ "../holo-vm/dist/index.cjs"(exports$1) {
134
+ var HoloOpCode = /* @__PURE__ */ ((HoloOpCode2) => {
135
+ HoloOpCode2[HoloOpCode2["SPAWN"] = 1] = "SPAWN";
136
+ HoloOpCode2[HoloOpCode2["DESPAWN"] = 2] = "DESPAWN";
137
+ HoloOpCode2[HoloOpCode2["CLONE"] = 3] = "CLONE";
138
+ HoloOpCode2[HoloOpCode2["SET_COMPONENT"] = 4] = "SET_COMPONENT";
139
+ HoloOpCode2[HoloOpCode2["GET_COMPONENT"] = 5] = "GET_COMPONENT";
140
+ HoloOpCode2[HoloOpCode2["REMOVE_COMPONENT"] = 6] = "REMOVE_COMPONENT";
141
+ HoloOpCode2[HoloOpCode2["SET_PARENT"] = 7] = "SET_PARENT";
142
+ HoloOpCode2[HoloOpCode2["QUERY"] = 8] = "QUERY";
143
+ HoloOpCode2[HoloOpCode2["TRANSFORM"] = 16] = "TRANSFORM";
144
+ HoloOpCode2[HoloOpCode2["TRANSLATE"] = 17] = "TRANSLATE";
145
+ HoloOpCode2[HoloOpCode2["ROTATE"] = 18] = "ROTATE";
146
+ HoloOpCode2[HoloOpCode2["LOOK_AT"] = 19] = "LOOK_AT";
147
+ HoloOpCode2[HoloOpCode2["RAYCAST"] = 20] = "RAYCAST";
148
+ HoloOpCode2[HoloOpCode2["QUERY_BOX"] = 21] = "QUERY_BOX";
149
+ HoloOpCode2[HoloOpCode2["QUERY_SPHERE"] = 22] = "QUERY_SPHERE";
150
+ HoloOpCode2[HoloOpCode2["FIND_PATH"] = 23] = "FIND_PATH";
151
+ HoloOpCode2[HoloOpCode2["GET_ZONE"] = 24] = "GET_ZONE";
152
+ HoloOpCode2[HoloOpCode2["ADD_RIGIDBODY"] = 32] = "ADD_RIGIDBODY";
153
+ HoloOpCode2[HoloOpCode2["APPLY_FORCE"] = 33] = "APPLY_FORCE";
154
+ HoloOpCode2[HoloOpCode2["APPLY_IMPULSE"] = 34] = "APPLY_IMPULSE";
155
+ HoloOpCode2[HoloOpCode2["SET_VELOCITY"] = 35] = "SET_VELOCITY";
156
+ HoloOpCode2[HoloOpCode2["ADD_COLLIDER"] = 36] = "ADD_COLLIDER";
157
+ HoloOpCode2[HoloOpCode2["ADD_JOINT"] = 37] = "ADD_JOINT";
158
+ HoloOpCode2[HoloOpCode2["SET_GRAVITY"] = 38] = "SET_GRAVITY";
159
+ HoloOpCode2[HoloOpCode2["PHYSICS_STEP"] = 39] = "PHYSICS_STEP";
160
+ HoloOpCode2[HoloOpCode2["SET_GEOMETRY"] = 48] = "SET_GEOMETRY";
161
+ HoloOpCode2[HoloOpCode2["SET_MATERIAL"] = 49] = "SET_MATERIAL";
162
+ HoloOpCode2[HoloOpCode2["SET_VISIBLE"] = 50] = "SET_VISIBLE";
163
+ HoloOpCode2[HoloOpCode2["SET_LOD"] = 51] = "SET_LOD";
164
+ HoloOpCode2[HoloOpCode2["SET_LIGHT"] = 52] = "SET_LIGHT";
165
+ HoloOpCode2[HoloOpCode2["SET_ANIMATION"] = 53] = "SET_ANIMATION";
166
+ HoloOpCode2[HoloOpCode2["SET_GAUSSIAN_SPLAT"] = 54] = "SET_GAUSSIAN_SPLAT";
167
+ HoloOpCode2[HoloOpCode2["SET_PARTICLE_SYSTEM"] = 55] = "SET_PARTICLE_SYSTEM";
168
+ HoloOpCode2[HoloOpCode2["APPLY_TRAIT"] = 64] = "APPLY_TRAIT";
169
+ HoloOpCode2[HoloOpCode2["REMOVE_TRAIT"] = 65] = "REMOVE_TRAIT";
170
+ HoloOpCode2[HoloOpCode2["RESOLVE_TRAITS"] = 66] = "RESOLVE_TRAITS";
171
+ HoloOpCode2[HoloOpCode2["EMIT_EVENT"] = 67] = "EMIT_EVENT";
172
+ HoloOpCode2[HoloOpCode2["ON_EVENT"] = 68] = "ON_EVENT";
173
+ HoloOpCode2[HoloOpCode2["EVAL_CONDITION"] = 69] = "EVAL_CONDITION";
174
+ HoloOpCode2[HoloOpCode2["LOAD_ASSET"] = 80] = "LOAD_ASSET";
175
+ HoloOpCode2[HoloOpCode2["PLAY_AUDIO"] = 81] = "PLAY_AUDIO";
176
+ HoloOpCode2[HoloOpCode2["NET_SYNC"] = 82] = "NET_SYNC";
177
+ HoloOpCode2[HoloOpCode2["NET_SEND"] = 83] = "NET_SEND";
178
+ HoloOpCode2[HoloOpCode2["NET_RECV"] = 84] = "NET_RECV";
179
+ HoloOpCode2[HoloOpCode2["XR_INPUT"] = 85] = "XR_INPUT";
180
+ HoloOpCode2[HoloOpCode2["HAPTIC"] = 86] = "HAPTIC";
181
+ HoloOpCode2[HoloOpCode2["NOP"] = 96] = "NOP";
182
+ HoloOpCode2[HoloOpCode2["JUMP"] = 97] = "JUMP";
183
+ HoloOpCode2[HoloOpCode2["JUMP_IF"] = 98] = "JUMP_IF";
184
+ HoloOpCode2[HoloOpCode2["CALL"] = 99] = "CALL";
185
+ HoloOpCode2[HoloOpCode2["RETURN"] = 100] = "RETURN";
186
+ HoloOpCode2[HoloOpCode2["PUSH"] = 101] = "PUSH";
187
+ HoloOpCode2[HoloOpCode2["POP"] = 102] = "POP";
188
+ HoloOpCode2[HoloOpCode2["STORE"] = 103] = "STORE";
189
+ HoloOpCode2[HoloOpCode2["LOAD"] = 104] = "LOAD";
190
+ HoloOpCode2[HoloOpCode2["HALT"] = 105] = "HALT";
191
+ HoloOpCode2[HoloOpCode2["YIELD"] = 106] = "YIELD";
192
+ HoloOpCode2[HoloOpCode2["TIMER"] = 107] = "TIMER";
193
+ HoloOpCode2[HoloOpCode2["ADD"] = 108] = "ADD";
194
+ HoloOpCode2[HoloOpCode2["SUB"] = 109] = "SUB";
195
+ HoloOpCode2[HoloOpCode2["MUL"] = 110] = "MUL";
196
+ HoloOpCode2[HoloOpCode2["DIV"] = 111] = "DIV";
197
+ HoloOpCode2[HoloOpCode2["AGENT_INVOKE"] = 112] = "AGENT_INVOKE";
198
+ HoloOpCode2[HoloOpCode2["AGENT_READ"] = 113] = "AGENT_READ";
199
+ HoloOpCode2[HoloOpCode2["AGENT_SUBSCRIBE"] = 114] = "AGENT_SUBSCRIBE";
200
+ HoloOpCode2[HoloOpCode2["DIALOG_SHOW"] = 115] = "DIALOG_SHOW";
201
+ HoloOpCode2[HoloOpCode2["QUEST_UPDATE"] = 116] = "QUEST_UPDATE";
202
+ HoloOpCode2[HoloOpCode2["CMP_EQ"] = 128] = "CMP_EQ";
203
+ HoloOpCode2[HoloOpCode2["CMP_LT"] = 129] = "CMP_LT";
204
+ HoloOpCode2[HoloOpCode2["CMP_GT"] = 130] = "CMP_GT";
205
+ HoloOpCode2[HoloOpCode2["NOT"] = 131] = "NOT";
206
+ return HoloOpCode2;
207
+ })(HoloOpCode || {});
208
+ var ComponentType3 = /* @__PURE__ */ ((ComponentType22) => {
209
+ ComponentType22[ComponentType22["Transform"] = 1] = "Transform";
210
+ ComponentType22[ComponentType22["Geometry"] = 2] = "Geometry";
211
+ ComponentType22[ComponentType22["Material"] = 3] = "Material";
212
+ ComponentType22[ComponentType22["RigidBody"] = 4] = "RigidBody";
213
+ ComponentType22[ComponentType22["Collider"] = 5] = "Collider";
214
+ ComponentType22[ComponentType22["Light"] = 6] = "Light";
215
+ ComponentType22[ComponentType22["Animation"] = 7] = "Animation";
216
+ ComponentType22[ComponentType22["Audio"] = 8] = "Audio";
217
+ ComponentType22[ComponentType22["Network"] = 9] = "Network";
218
+ ComponentType22[ComponentType22["Trait"] = 10] = "Trait";
219
+ ComponentType22[ComponentType22["ParticleSystem"] = 11] = "ParticleSystem";
220
+ ComponentType22[ComponentType22["GaussianSplat"] = 12] = "GaussianSplat";
221
+ ComponentType22[ComponentType22["LOD"] = 13] = "LOD";
222
+ ComponentType22[ComponentType22["Custom"] = 255] = "Custom";
223
+ return ComponentType22;
224
+ })(ComponentType3 || {});
225
+ var GeometryType2 = /* @__PURE__ */ ((GeometryType3) => {
226
+ GeometryType3[GeometryType3["Cube"] = 1] = "Cube";
227
+ GeometryType3[GeometryType3["Sphere"] = 2] = "Sphere";
228
+ GeometryType3[GeometryType3["Cylinder"] = 3] = "Cylinder";
229
+ GeometryType3[GeometryType3["Plane"] = 4] = "Plane";
230
+ GeometryType3[GeometryType3["Cone"] = 5] = "Cone";
231
+ GeometryType3[GeometryType3["Torus"] = 6] = "Torus";
232
+ GeometryType3[GeometryType3["Capsule"] = 7] = "Capsule";
233
+ GeometryType3[GeometryType3["Mesh"] = 8] = "Mesh";
234
+ GeometryType3[GeometryType3["Text3D"] = 9] = "Text3D";
235
+ GeometryType3[GeometryType3["Portal"] = 10] = "Portal";
236
+ GeometryType3[GeometryType3["Terrain"] = 11] = "Terrain";
237
+ GeometryType3[GeometryType3["Skybox"] = 12] = "Skybox";
238
+ GeometryType3[GeometryType3["Billboard"] = 13] = "Billboard";
239
+ GeometryType3[GeometryType3["Line"] = 14] = "Line";
240
+ return GeometryType3;
241
+ })(GeometryType2 || {});
242
+ var BodyType2 = /* @__PURE__ */ ((BodyType22) => {
243
+ BodyType22[BodyType22["Static"] = 0] = "Static";
244
+ BodyType22[BodyType22["Dynamic"] = 1] = "Dynamic";
245
+ BodyType22[BodyType22["Kinematic"] = 2] = "Kinematic";
246
+ return BodyType22;
247
+ })(BodyType2 || {});
248
+ var ColliderShape = /* @__PURE__ */ ((ColliderShape2) => {
249
+ ColliderShape2[ColliderShape2["Box"] = 1] = "Box";
250
+ ColliderShape2[ColliderShape2["Sphere"] = 2] = "Sphere";
251
+ ColliderShape2[ColliderShape2["Capsule"] = 3] = "Capsule";
252
+ ColliderShape2[ColliderShape2["Cylinder"] = 4] = "Cylinder";
253
+ ColliderShape2[ColliderShape2["ConvexHull"] = 5] = "ConvexHull";
254
+ ColliderShape2[ColliderShape2["TriMesh"] = 6] = "TriMesh";
255
+ return ColliderShape2;
256
+ })(ColliderShape || {});
257
+ var LightType2 = /* @__PURE__ */ ((LightType22) => {
258
+ LightType22[LightType22["Directional"] = 1] = "Directional";
259
+ LightType22[LightType22["Point"] = 2] = "Point";
260
+ LightType22[LightType22["Spot"] = 3] = "Spot";
261
+ LightType22[LightType22["Ambient"] = 4] = "Ambient";
262
+ LightType22[LightType22["Area"] = 5] = "Area";
263
+ return LightType22;
264
+ })(LightType2 || {});
265
+ var SyncTier = /* @__PURE__ */ ((SyncTier2) => {
266
+ SyncTier2[SyncTier2["Physics"] = 0] = "Physics";
267
+ SyncTier2[SyncTier2["Movement"] = 1] = "Movement";
268
+ SyncTier2[SyncTier2["AIAgent"] = 2] = "AIAgent";
269
+ SyncTier2[SyncTier2["Cosmetic"] = 3] = "Cosmetic";
270
+ return SyncTier2;
271
+ })(SyncTier || {});
272
+ var ValueType = /* @__PURE__ */ ((ValueType2) => {
273
+ ValueType2[ValueType2["Null"] = 0] = "Null";
274
+ ValueType2[ValueType2["Bool"] = 1] = "Bool";
275
+ ValueType2[ValueType2["I32"] = 2] = "I32";
276
+ ValueType2[ValueType2["F32"] = 3] = "F32";
277
+ ValueType2[ValueType2["F64"] = 4] = "F64";
278
+ ValueType2[ValueType2["String"] = 5] = "String";
279
+ ValueType2[ValueType2["Vec3"] = 6] = "Vec3";
280
+ ValueType2[ValueType2["Quat"] = 7] = "Quat";
281
+ ValueType2[ValueType2["EntityRef"] = 8] = "EntityRef";
282
+ ValueType2[ValueType2["Array"] = 9] = "Array";
283
+ return ValueType2;
284
+ })(ValueType || {});
285
+ var FAMILY_NAMES = {
286
+ 0: "Entity",
287
+ 1: "Spatial",
288
+ 2: "Physics",
289
+ 3: "Rendering",
290
+ 4: "Trait",
291
+ 5: "I/O",
292
+ 6: "Control",
293
+ 7: "Agent",
294
+ 8: "Comparison"
295
+ };
296
+ function getOpcodeFamily(opcode) {
297
+ const familyByte = opcode >> 4 & 15;
298
+ return FAMILY_NAMES[familyByte] ?? "Unknown";
299
+ }
300
+ function getOpcodeName(opcode) {
301
+ return HoloOpCode[opcode] ?? `UNKNOWN_0x${opcode.toString(16).padStart(2, "0")}`;
302
+ }
303
+ function isControlFlow(opcode) {
304
+ return opcode === 97 || opcode === 98 || opcode === 99 || opcode === 100 || opcode === 105 || opcode === 106;
305
+ }
306
+ var HOLOB_MAGIC = 1213156418;
307
+ var HOLOB_VERSION = 1;
308
+ var HolobFlags = /* @__PURE__ */ ((HolobFlags2) => {
309
+ HolobFlags2[HolobFlags2["None"] = 0] = "None";
310
+ HolobFlags2[HolobFlags2["Debug"] = 1] = "Debug";
311
+ HolobFlags2[HolobFlags2["SIMD"] = 2] = "SIMD";
312
+ HolobFlags2[HolobFlags2["Threads"] = 4] = "Threads";
313
+ HolobFlags2[HolobFlags2["Networking"] = 8] = "Networking";
314
+ HolobFlags2[HolobFlags2["Physics"] = 16] = "Physics";
315
+ return HolobFlags2;
316
+ })(HolobFlags || {});
317
+ var AssetType = /* @__PURE__ */ ((AssetType2) => {
318
+ AssetType2[AssetType2["Mesh"] = 1] = "Mesh";
319
+ AssetType2[AssetType2["Texture"] = 2] = "Texture";
320
+ AssetType2[AssetType2["Audio"] = 3] = "Audio";
321
+ AssetType2[AssetType2["Animation"] = 4] = "Animation";
322
+ AssetType2[AssetType2["GaussianSplat"] = 5] = "GaussianSplat";
323
+ AssetType2[AssetType2["Font"] = 6] = "Font";
324
+ AssetType2[AssetType2["Script"] = 7] = "Script";
325
+ return AssetType2;
326
+ })(AssetType || {});
327
+ var HoloBytecodeBuilder2 = class {
328
+ constructor() {
329
+ __publicField(this, "strings", /* @__PURE__ */ new Map());
330
+ __publicField(this, "stringList", []);
331
+ __publicField(this, "assets", []);
332
+ __publicField(this, "traits", []);
333
+ __publicField(this, "functions", []);
334
+ __publicField(this, "entities", []);
335
+ __publicField(this, "events", []);
336
+ __publicField(this, "flags", 0);
337
+ }
338
+ /**
339
+ * Intern a string and return its index
340
+ */
341
+ internString(str) {
342
+ const existing = this.strings.get(str);
343
+ if (existing !== void 0) return existing;
344
+ const idx = this.stringList.length;
345
+ this.stringList.push(str);
346
+ this.strings.set(str, idx);
347
+ return idx;
348
+ }
349
+ /**
350
+ * Add a feature flag
351
+ */
352
+ addFlag(flag) {
353
+ this.flags |= flag;
354
+ return this;
355
+ }
356
+ /**
357
+ * Add an asset reference
358
+ */
359
+ addAsset(uri, type) {
360
+ const idx = this.assets.length;
361
+ this.assets.push({ uriIndex: this.internString(uri), type });
362
+ return idx;
363
+ }
364
+ /**
365
+ * Add a trait definition
366
+ */
367
+ addTrait(name, deps = [], initFunc = -1) {
368
+ const idx = this.traits.length;
369
+ this.traits.push({
370
+ nameIndex: this.internString(name),
371
+ dependencies: deps,
372
+ initFunctionIndex: initFunc,
373
+ eventHandlers: /* @__PURE__ */ new Map()
374
+ });
375
+ return idx;
376
+ }
377
+ /**
378
+ * Begin building a function
379
+ */
380
+ addFunction(name, paramCount = 0) {
381
+ const idx = this.functions.length;
382
+ const fn = {
383
+ nameIndex: this.internString(name),
384
+ instructions: [],
385
+ registerCount: 0,
386
+ paramCount
387
+ };
388
+ this.functions.push(fn);
389
+ return new HoloFunctionBuilder(fn, this, idx);
390
+ }
391
+ /**
392
+ * Add an entity definition
393
+ */
394
+ addEntity(name, archetype = 0, parentIndex = -1) {
395
+ const idx = this.entities.length;
396
+ this.entities.push({
397
+ nameIndex: this.internString(name),
398
+ archetype,
399
+ components: [],
400
+ parentIndex
401
+ });
402
+ return idx;
403
+ }
404
+ /**
405
+ * Add component data to an entity
406
+ */
407
+ addComponentToEntity(entityIdx, componentType, values) {
408
+ this.entities[entityIdx].components.push({ componentType, values });
409
+ return this;
410
+ }
411
+ /**
412
+ * Add an event binding
413
+ */
414
+ addEvent(eventType, handlerFunctionIndex, entityFilter = -1) {
415
+ this.events.push({ eventType, handlerFunctionIndex, entityFilter });
416
+ return this;
417
+ }
418
+ /**
419
+ * Build the final bytecode module
420
+ */
421
+ build() {
422
+ return {
423
+ magic: HOLOB_MAGIC,
424
+ version: HOLOB_VERSION,
425
+ flags: this.flags,
426
+ strings: [...this.stringList],
427
+ assets: [...this.assets],
428
+ traits: [...this.traits],
429
+ functions: [...this.functions],
430
+ entities: [...this.entities],
431
+ events: [...this.events]
432
+ };
433
+ }
434
+ };
435
+ var HoloFunctionBuilder = class {
436
+ constructor(func, parent, index) {
437
+ this.func = func;
438
+ this.parent = parent;
439
+ this.index = index;
440
+ }
441
+ emit(opcode, ...operands) {
442
+ this.func.instructions.push({ opcode, operands });
443
+ return this;
444
+ }
445
+ // ── Entity ────────────────────────────────────────────────────────────────
446
+ spawn(entityType, name) {
447
+ return this.emit(1, entityType, this.parent.internString(name));
448
+ }
449
+ despawn(entityId) {
450
+ return this.emit(2, entityId);
451
+ }
452
+ setComponent(entityId, compType, ...data) {
453
+ return this.emit(4, entityId, compType, ...data);
454
+ }
455
+ getComponent(entityId, compType) {
456
+ return this.emit(5, entityId, compType);
457
+ }
458
+ setParent(childId, parentId) {
459
+ return this.emit(7, childId, parentId);
460
+ }
461
+ query(archetypeMask) {
462
+ return this.emit(8, archetypeMask);
463
+ }
464
+ // ── Spatial ───────────────────────────────────────────────────────────────
465
+ transform(entityId, x, y, z) {
466
+ return this.emit(16, entityId, x, y, z, 0, 0, 0, 1, 1, 1, 1);
467
+ }
468
+ translate(entityId, dx, dy, dz) {
469
+ return this.emit(17, entityId, dx, dy, dz);
470
+ }
471
+ rotate(entityId, qx, qy, qz, qw) {
472
+ return this.emit(18, entityId, qx, qy, qz, qw);
473
+ }
474
+ lookAt(entityId, tx, ty, tz) {
475
+ return this.emit(19, entityId, tx, ty, tz);
476
+ }
477
+ raycast(ox, oy, oz, dx, dy, dz, maxDist) {
478
+ return this.emit(20, ox, oy, oz, dx, dy, dz, maxDist);
479
+ }
480
+ // ── Physics ───────────────────────────────────────────────────────────────
481
+ addRigidbody(entityId, mass, bodyType) {
482
+ return this.emit(32, entityId, mass, bodyType);
483
+ }
484
+ applyForce(entityId, fx, fy, fz) {
485
+ return this.emit(33, entityId, fx, fy, fz);
486
+ }
487
+ applyImpulse(entityId, ix, iy, iz) {
488
+ return this.emit(34, entityId, ix, iy, iz);
489
+ }
490
+ setGravity(gx, gy, gz) {
491
+ return this.emit(38, gx, gy, gz);
492
+ }
493
+ physicsStep(dt) {
494
+ return this.emit(39, dt);
495
+ }
496
+ // ── Rendering Hints ───────────────────────────────────────────────────────
497
+ setGeometry(entityId, geoType) {
498
+ return this.emit(48, entityId, geoType);
499
+ }
500
+ setMaterial(entityId, ...desc) {
501
+ return this.emit(49, entityId, ...desc);
502
+ }
503
+ setVisible(entityId, visible) {
504
+ return this.emit(50, entityId, visible ? 1 : 0);
505
+ }
506
+ setLight(entityId, lightType, ...params) {
507
+ return this.emit(52, entityId, lightType, ...params);
508
+ }
509
+ setAnimation(entityId, animId) {
510
+ return this.emit(53, entityId, animId);
511
+ }
512
+ // ── Trait ─────────────────────────────────────────────────────────────────
513
+ applyTrait(entityId, traitId) {
514
+ return this.emit(64, entityId, traitId);
515
+ }
516
+ removeTrait(entityId, traitId) {
517
+ return this.emit(65, entityId, traitId);
518
+ }
519
+ emitEvent(eventType, ...payload) {
520
+ return this.emit(67, eventType, ...payload);
521
+ }
522
+ onEvent(eventType, handlerOffset) {
523
+ return this.emit(68, eventType, handlerOffset);
524
+ }
525
+ // ── I/O ───────────────────────────────────────────────────────────────────
526
+ loadAsset(uri, assetType) {
527
+ return this.emit(80, this.parent.internString(uri), assetType);
528
+ }
529
+ playAudio(soundId, x, y, z) {
530
+ return this.emit(81, soundId, x, y, z);
531
+ }
532
+ netSync(entityId, syncTier) {
533
+ return this.emit(82, entityId, syncTier);
534
+ }
535
+ // ── Control Flow ──────────────────────────────────────────────────────────
536
+ nop() {
537
+ return this.emit(
538
+ 96
539
+ /* NOP */
540
+ );
541
+ }
542
+ jump(offset) {
543
+ return this.emit(97, offset);
544
+ }
545
+ jumpIf(offset) {
546
+ return this.emit(98, offset);
547
+ }
548
+ call(funcIdx) {
549
+ return this.emit(99, funcIdx);
550
+ }
551
+ ret() {
552
+ return this.emit(
553
+ 100
554
+ /* RETURN */
555
+ );
556
+ }
557
+ push(value) {
558
+ return this.emit(101, value);
559
+ }
560
+ pop() {
561
+ return this.emit(
562
+ 102
563
+ /* POP */
564
+ );
565
+ }
566
+ store(registerIdx) {
567
+ this.func.registerCount = Math.max(this.func.registerCount, registerIdx + 1);
568
+ return this.emit(103, registerIdx);
569
+ }
570
+ load(registerIdx) {
571
+ return this.emit(104, registerIdx);
572
+ }
573
+ halt() {
574
+ return this.emit(
575
+ 105
576
+ /* HALT */
577
+ );
578
+ }
579
+ yieldTick() {
580
+ return this.emit(
581
+ 106
582
+ /* YIELD */
583
+ );
584
+ }
585
+ timer(delayMs, handlerOffset) {
586
+ return this.emit(107, delayMs, handlerOffset);
587
+ }
588
+ // ── Arithmetic ────────────────────────────────────────────────────────────
589
+ add() {
590
+ return this.emit(
591
+ 108
592
+ /* ADD */
593
+ );
594
+ }
595
+ sub() {
596
+ return this.emit(
597
+ 109
598
+ /* SUB */
599
+ );
600
+ }
601
+ mul() {
602
+ return this.emit(
603
+ 110
604
+ /* MUL */
605
+ );
606
+ }
607
+ div() {
608
+ return this.emit(
609
+ 111
610
+ /* DIV */
611
+ );
612
+ }
613
+ // ── Comparison ────────────────────────────────────────────────────────────
614
+ cmpEq() {
615
+ return this.emit(
616
+ 128
617
+ /* CMP_EQ */
618
+ );
619
+ }
620
+ cmpLt() {
621
+ return this.emit(
622
+ 129
623
+ /* CMP_LT */
624
+ );
625
+ }
626
+ cmpGt() {
627
+ return this.emit(
628
+ 130
629
+ /* CMP_GT */
630
+ );
631
+ }
632
+ not() {
633
+ return this.emit(
634
+ 131
635
+ /* NOT */
636
+ );
637
+ }
638
+ // ── Agent Bridge ──────────────────────────────────────────────────────────
639
+ agentInvoke(agentId, actionIdx) {
640
+ return this.emit(112, agentId, actionIdx);
641
+ }
642
+ agentRead(agentId, fieldIdx) {
643
+ return this.emit(113, agentId, fieldIdx);
644
+ }
645
+ dialogShow(npcId, dialogTreeId) {
646
+ return this.emit(115, npcId, dialogTreeId);
647
+ }
648
+ questUpdate(questId, state) {
649
+ return this.emit(116, questId, state);
650
+ }
651
+ /** Get the current instruction count (useful for jump targets) */
652
+ get instructionCount() {
653
+ return this.func.instructions.length;
654
+ }
655
+ };
656
+ var ECSWorld2 = class {
657
+ constructor() {
658
+ __publicField(this, "entities", /* @__PURE__ */ new Map());
659
+ __publicField(this, "nextEntityId", 1);
660
+ __publicField(this, "archetypeIndex", /* @__PURE__ */ new Map());
661
+ }
662
+ /**
663
+ * Spawn a new entity
664
+ */
665
+ spawn(name, archetype = 0) {
666
+ const id = this.nextEntityId++;
667
+ const entity = {
668
+ id,
669
+ name,
670
+ parentId: -1,
671
+ childIds: [],
672
+ components: /* @__PURE__ */ new Map(),
673
+ traits: /* @__PURE__ */ new Set(),
674
+ alive: true,
675
+ dirty: true
676
+ };
677
+ this.entities.set(id, entity);
678
+ if (!this.archetypeIndex.has(archetype)) {
679
+ this.archetypeIndex.set(archetype, /* @__PURE__ */ new Set());
680
+ }
681
+ this.archetypeIndex.get(archetype).add(id);
682
+ return id;
683
+ }
684
+ /**
685
+ * Despawn an entity and its children
686
+ */
687
+ despawn(entityId) {
688
+ const entity = this.entities.get(entityId);
689
+ if (!entity) return false;
690
+ for (const childId of [...entity.childIds]) {
691
+ this.despawn(childId);
692
+ }
693
+ if (entity.parentId !== -1) {
694
+ const parent = this.entities.get(entity.parentId);
695
+ if (parent) {
696
+ parent.childIds = parent.childIds.filter((id) => id !== entityId);
697
+ }
698
+ }
699
+ entity.alive = false;
700
+ this.entities.delete(entityId);
701
+ return true;
702
+ }
703
+ /**
704
+ * Set a component on an entity
705
+ */
706
+ setComponent(entityId, componentType, data) {
707
+ const entity = this.entities.get(entityId);
708
+ if (!entity) return false;
709
+ entity.components.set(componentType, data);
710
+ entity.dirty = true;
711
+ return true;
712
+ }
713
+ /**
714
+ * Get a component from an entity
715
+ */
716
+ getComponent(entityId, componentType) {
717
+ const entity = this.entities.get(entityId);
718
+ if (!entity) return void 0;
719
+ return entity.components.get(componentType);
720
+ }
721
+ /**
722
+ * Remove a component from an entity
723
+ */
724
+ removeComponent(entityId, componentType) {
725
+ const entity = this.entities.get(entityId);
726
+ if (!entity) return false;
727
+ entity.dirty = true;
728
+ return entity.components.delete(componentType);
729
+ }
730
+ /**
731
+ * Set parent-child relationship
732
+ */
733
+ setParent(childId, parentId) {
734
+ const child = this.entities.get(childId);
735
+ const parent = this.entities.get(parentId);
736
+ if (!child || !parent) return false;
737
+ if (child.parentId !== -1) {
738
+ const oldParent = this.entities.get(child.parentId);
739
+ if (oldParent) {
740
+ oldParent.childIds = oldParent.childIds.filter((id) => id !== childId);
741
+ }
742
+ }
743
+ child.parentId = parentId;
744
+ parent.childIds.push(childId);
745
+ child.dirty = true;
746
+ return true;
747
+ }
748
+ /**
749
+ * Query entities by archetype mask
750
+ */
751
+ queryArchetype(mask) {
752
+ const set = this.archetypeIndex.get(mask);
753
+ return set ? [...set] : [];
754
+ }
755
+ /**
756
+ * Get entity by ID
757
+ */
758
+ getEntity(entityId) {
759
+ return this.entities.get(entityId);
760
+ }
761
+ /**
762
+ * Get all dirty entities and clear dirty flags
763
+ */
764
+ flushDirty() {
765
+ const dirty = [];
766
+ for (const entity of this.entities.values()) {
767
+ if (entity.dirty) {
768
+ dirty.push(entity);
769
+ entity.dirty = false;
770
+ }
771
+ }
772
+ return dirty;
773
+ }
774
+ /**
775
+ * Get all living entities
776
+ */
777
+ getAllEntities() {
778
+ return [...this.entities.values()];
779
+ }
780
+ /**
781
+ * Get entity count
782
+ */
783
+ get entityCount() {
784
+ return this.entities.size;
785
+ }
786
+ };
787
+ var VMStatus = /* @__PURE__ */ ((VMStatus2) => {
788
+ VMStatus2["Idle"] = "IDLE";
789
+ VMStatus2["Running"] = "RUNNING";
790
+ VMStatus2["Yielded"] = "YIELDED";
791
+ VMStatus2["Halted"] = "HALTED";
792
+ VMStatus2["Error"] = "ERROR";
793
+ return VMStatus2;
794
+ })(VMStatus || {});
795
+ var UnsupportedHostOpcodeError = class extends Error {
796
+ constructor(opcode, operands) {
797
+ const opcodeName = getOpcodeName(opcode);
798
+ const opcodeGroup = getHostOpcodeGroup(opcode);
799
+ super(
800
+ `Unsupported host opcode ${opcodeName} (${opcodeGroup}) requires a registered host callback`
801
+ );
802
+ __publicField(this, "opcode");
803
+ __publicField(this, "opcodeName");
804
+ __publicField(this, "opcodeGroup");
805
+ __publicField(this, "operands");
806
+ this.name = "UnsupportedHostOpcodeError";
807
+ this.opcode = opcode;
808
+ this.opcodeName = opcodeName;
809
+ this.opcodeGroup = opcodeGroup;
810
+ this.operands = [...operands];
811
+ }
812
+ };
813
+ var HoloVM = class {
814
+ constructor(hostCallbacks = {}) {
815
+ // Core state
816
+ __publicField(this, "bytecode", null);
817
+ __publicField(this, "world", new ECSWorld2());
818
+ // Execution state
819
+ __publicField(this, "stack", []);
820
+ __publicField(this, "callStack", []);
821
+ __publicField(this, "status", "IDLE");
822
+ __publicField(this, "tickCount", 0);
823
+ // Timer system
824
+ __publicField(this, "timers", []);
825
+ __publicField(this, "currentTimeMs", 0);
826
+ // Event queue
827
+ __publicField(this, "eventQueue", []);
828
+ // Limits
829
+ __publicField(this, "maxStackSize", 4096);
830
+ __publicField(this, "maxCallDepth", 256);
831
+ __publicField(this, "maxInstructionsPerTick", 1e4);
832
+ __publicField(this, "hostCallbacks", /* @__PURE__ */ new Map());
833
+ __publicField(this, "lastError");
834
+ this.registerHostCallbacks(hostCallbacks);
835
+ }
836
+ /**
837
+ * Load a bytecode module into the VM
838
+ */
839
+ load(bytecode) {
840
+ this.bytecode = bytecode;
841
+ this.reset();
842
+ this.initializeEntities();
843
+ }
844
+ /**
845
+ * Reset VM state without unloading bytecode
846
+ */
847
+ reset() {
848
+ this.stack = [];
849
+ this.callStack = [];
850
+ this.status = "IDLE";
851
+ this.tickCount = 0;
852
+ this.timers = [];
853
+ this.currentTimeMs = 0;
854
+ this.eventQueue = [];
855
+ this.lastError = void 0;
856
+ }
857
+ registerHostCallback(opcode, callback) {
858
+ if (!isHostOpcode(opcode)) {
859
+ throw new Error(`Opcode ${getOpcodeName(opcode)} is not a host-integration opcode`);
860
+ }
861
+ this.hostCallbacks.set(opcode, callback);
862
+ }
863
+ registerHostCallbacks(callbacks) {
864
+ for (const [opcode, callback] of Object.entries(callbacks)) {
865
+ if (callback) {
866
+ this.registerHostCallback(Number(opcode), callback);
867
+ }
868
+ }
869
+ }
870
+ /**
871
+ * Initialize entities from the bytecode's init section
872
+ */
873
+ initializeEntities() {
874
+ if (!this.bytecode) return;
875
+ for (const entityDef of this.bytecode.entities) {
876
+ const name = this.bytecode.strings[entityDef.nameIndex] ?? `entity_${entityDef.nameIndex}`;
877
+ const entityId = this.world.spawn(name, entityDef.archetype);
878
+ for (const comp of entityDef.components) {
879
+ this.world.setComponent(entityId, comp.componentType, comp.values);
880
+ }
881
+ if (entityDef.parentIndex >= 0) {
882
+ this.world.setParent(entityId, entityDef.parentIndex + 1);
883
+ }
884
+ }
885
+ }
886
+ /**
887
+ * Execute one tick of the VM (called at ~90fps)
888
+ *
889
+ * Each tick:
890
+ * 1. Process expired timers
891
+ * 2. Dispatch queued events
892
+ * 3. Resume execution from yield point (or run init)
893
+ * 4. Return dirty entities for rendering
894
+ */
895
+ tick(deltaMs) {
896
+ if (!this.bytecode) {
897
+ this.lastError = new Error("No bytecode loaded");
898
+ return {
899
+ status: "ERROR",
900
+ stackTop: null,
901
+ tickCount: this.tickCount,
902
+ entityCount: 0,
903
+ error: "No bytecode loaded"
904
+ };
905
+ }
906
+ this.tickCount++;
907
+ this.currentTimeMs += deltaMs;
908
+ this.processTimers();
909
+ this.dispatchEvents();
910
+ if (this.status === "YIELDED") {
911
+ this.status = "RUNNING";
912
+ this.executeInstructions();
913
+ } else if (this.status === "IDLE" && this.bytecode.functions.length > 0) {
914
+ this.callFunction(0);
915
+ this.executeInstructions();
916
+ }
917
+ return {
918
+ status: this.status,
919
+ stackTop: this.stack.length > 0 ? this.stack[this.stack.length - 1] : null,
920
+ tickCount: this.tickCount,
921
+ entityCount: this.world.entityCount,
922
+ error: this.status === "ERROR" ? this.lastError?.message : void 0
923
+ };
924
+ }
925
+ /**
926
+ * Main execution loop — runs until YIELD, HALT, or instruction limit
927
+ */
928
+ executeInstructions() {
929
+ if (!this.bytecode) return;
930
+ let instructionsExecuted = 0;
931
+ while (this.status === "RUNNING" && instructionsExecuted < this.maxInstructionsPerTick) {
932
+ const frame = this.currentFrame;
933
+ if (!frame) {
934
+ this.status = "HALTED";
935
+ break;
936
+ }
937
+ const func = this.bytecode.functions[frame.functionIndex];
938
+ if (!func || frame.pc >= func.instructions.length) {
939
+ this.callStack.pop();
940
+ if (this.callStack.length === 0) {
941
+ this.status = "HALTED";
942
+ }
943
+ break;
944
+ }
945
+ const instr = func.instructions[frame.pc];
946
+ frame.pc++;
947
+ instructionsExecuted++;
948
+ try {
949
+ this.executeInstruction(instr, frame);
950
+ } catch (err) {
951
+ this.status = "ERROR";
952
+ this.lastError = err instanceof Error ? err : new Error(String(err));
953
+ break;
954
+ }
955
+ if (this.status !== "RUNNING") break;
956
+ }
957
+ }
958
+ /**
959
+ * Execute a single instruction
960
+ */
961
+ executeInstruction(instr, frame) {
962
+ const op = instr.opcode;
963
+ const operands = instr.operands;
964
+ switch (op) {
965
+ // ── Entity Operations ───────────────────────────────────────────────
966
+ case 1: {
967
+ const entityType = operands[0];
968
+ const nameIdx = operands[1];
969
+ const name = this.getString(nameIdx);
970
+ const id = this.world.spawn(name, entityType);
971
+ this.push(id);
972
+ break;
973
+ }
974
+ case 2: {
975
+ const entityId = operands[0];
976
+ this.world.despawn(entityId);
977
+ break;
978
+ }
979
+ case 4: {
980
+ const entityId = operands[0];
981
+ const compType = operands[1];
982
+ const data = operands.slice(2);
983
+ this.world.setComponent(entityId, compType, data);
984
+ break;
985
+ }
986
+ case 5: {
987
+ const entityId = operands[0];
988
+ const compType = operands[1];
989
+ const data = this.world.getComponent(entityId, compType);
990
+ this.push(data ?? null);
991
+ break;
992
+ }
993
+ case 6: {
994
+ const entityId = operands[0];
995
+ const compType = operands[1];
996
+ this.world.removeComponent(entityId, compType);
997
+ break;
998
+ }
999
+ case 7: {
1000
+ const childId = operands[0];
1001
+ const parentId = operands[1];
1002
+ this.world.setParent(childId, parentId);
1003
+ break;
1004
+ }
1005
+ case 8: {
1006
+ const mask = operands[0];
1007
+ const entities = this.world.queryArchetype(mask);
1008
+ this.push(entities);
1009
+ break;
1010
+ }
1011
+ // ── Spatial Operations ──────────────────────────────────────────────
1012
+ case 16: {
1013
+ const entityId = operands[0];
1014
+ const transform = {
1015
+ position: { x: operands[1], y: operands[2], z: operands[3] },
1016
+ rotation: {
1017
+ x: operands[4],
1018
+ y: operands[5],
1019
+ z: operands[6],
1020
+ w: operands[7]
1021
+ },
1022
+ scale: { x: operands[8], y: operands[9], z: operands[10] }
1023
+ };
1024
+ this.world.setComponent(entityId, 1, transform);
1025
+ break;
1026
+ }
1027
+ case 17: {
1028
+ const entityId = operands[0];
1029
+ const existing = this.world.getComponent(
1030
+ entityId,
1031
+ 1
1032
+ /* Transform */
1033
+ );
1034
+ if (existing) {
1035
+ existing.position.x += operands[1];
1036
+ existing.position.y += operands[2];
1037
+ existing.position.z += operands[3];
1038
+ this.world.setComponent(entityId, 1, existing);
1039
+ }
1040
+ break;
1041
+ }
1042
+ case 18: {
1043
+ const entityId = operands[0];
1044
+ this.world.setComponent(entityId, 1, {
1045
+ position: { x: 0, y: 0, z: 0 },
1046
+ rotation: {
1047
+ x: operands[1],
1048
+ y: operands[2],
1049
+ z: operands[3],
1050
+ w: operands[4]
1051
+ },
1052
+ scale: { x: 1, y: 1, z: 1 }
1053
+ });
1054
+ break;
1055
+ }
1056
+ case 48: {
1057
+ const entityId = operands[0];
1058
+ const geoType = operands[1];
1059
+ this.world.setComponent(entityId, 2, { type: geoType, params: {} });
1060
+ break;
1061
+ }
1062
+ case 49: {
1063
+ const entityId = operands[0];
1064
+ const material = {
1065
+ color: operands[1] ?? 16777215,
1066
+ metalness: operands[2] ?? 0,
1067
+ roughness: operands[3] ?? 0.5,
1068
+ emissive: operands[4] ?? 0,
1069
+ opacity: operands[5] ?? 1
1070
+ };
1071
+ this.world.setComponent(entityId, 3, material);
1072
+ break;
1073
+ }
1074
+ case 50: {
1075
+ const entityId = operands[0];
1076
+ operands[1] !== 0;
1077
+ const entity = this.world.getEntity(entityId);
1078
+ if (entity) entity.dirty = true;
1079
+ break;
1080
+ }
1081
+ case 52: {
1082
+ const entityId = operands[0];
1083
+ const lightType = operands[1];
1084
+ this.world.setComponent(entityId, 6, {
1085
+ type: lightType,
1086
+ params: operands.slice(2)
1087
+ });
1088
+ break;
1089
+ }
1090
+ // ── Physics Operations ──────────────────────────────────────────────
1091
+ case 32: {
1092
+ const entityId = operands[0];
1093
+ const rb = {
1094
+ mass: operands[1],
1095
+ bodyType: operands[2],
1096
+ velocity: { x: 0, y: 0, z: 0 },
1097
+ angularVelocity: { x: 0, y: 0, z: 0 }
1098
+ };
1099
+ this.world.setComponent(entityId, 4, rb);
1100
+ break;
1101
+ }
1102
+ case 33: {
1103
+ const entityId = operands[0];
1104
+ const rb = this.world.getComponent(
1105
+ entityId,
1106
+ 4
1107
+ /* RigidBody */
1108
+ );
1109
+ if (rb && rb.mass > 0) {
1110
+ const dt = 1 / 90;
1111
+ rb.velocity.x += operands[1] / rb.mass * dt;
1112
+ rb.velocity.y += operands[2] / rb.mass * dt;
1113
+ rb.velocity.z += operands[3] / rb.mass * dt;
1114
+ this.world.setComponent(entityId, 4, rb);
1115
+ }
1116
+ break;
1117
+ }
1118
+ case 34: {
1119
+ const entityId = operands[0];
1120
+ const rb = this.world.getComponent(
1121
+ entityId,
1122
+ 4
1123
+ /* RigidBody */
1124
+ );
1125
+ if (rb && rb.mass > 0) {
1126
+ rb.velocity.x += operands[1] / rb.mass;
1127
+ rb.velocity.y += operands[2] / rb.mass;
1128
+ rb.velocity.z += operands[3] / rb.mass;
1129
+ this.world.setComponent(entityId, 4, rb);
1130
+ }
1131
+ break;
1132
+ }
1133
+ case 35: {
1134
+ const entityId = operands[0];
1135
+ const rb = this.world.getComponent(
1136
+ entityId,
1137
+ 4
1138
+ /* RigidBody */
1139
+ );
1140
+ if (rb) {
1141
+ rb.velocity = {
1142
+ x: operands[1],
1143
+ y: operands[2],
1144
+ z: operands[3]
1145
+ };
1146
+ this.world.setComponent(entityId, 4, rb);
1147
+ }
1148
+ break;
1149
+ }
1150
+ case 38: {
1151
+ this.world.setComponent(0, 255, { x: operands[0], y: operands[1], z: operands[2] });
1152
+ break;
1153
+ }
1154
+ // ── Trait Operations ────────────────────────────────────────────────
1155
+ case 64: {
1156
+ const entityId = operands[0];
1157
+ const traitId = operands[1];
1158
+ const entity = this.world.getEntity(entityId);
1159
+ if (entity) {
1160
+ entity.traits.add(traitId);
1161
+ entity.dirty = true;
1162
+ }
1163
+ break;
1164
+ }
1165
+ case 65: {
1166
+ const entityId = operands[0];
1167
+ const traitId = operands[1];
1168
+ const entity = this.world.getEntity(entityId);
1169
+ if (entity) {
1170
+ entity.traits.delete(traitId);
1171
+ entity.dirty = true;
1172
+ }
1173
+ break;
1174
+ }
1175
+ case 67: {
1176
+ const eventType = operands[0];
1177
+ const payload = operands.slice(1);
1178
+ this.eventQueue.push({ eventType, payload });
1179
+ break;
1180
+ }
1181
+ // ── Control Flow ────────────────────────────────────────────────────
1182
+ case 96:
1183
+ break;
1184
+ case 97: {
1185
+ frame.pc = operands[0];
1186
+ break;
1187
+ }
1188
+ case 98: {
1189
+ const condition = this.pop();
1190
+ if (condition) {
1191
+ frame.pc = operands[0];
1192
+ }
1193
+ break;
1194
+ }
1195
+ case 99: {
1196
+ const funcIdx = operands[0];
1197
+ this.callFunction(funcIdx);
1198
+ break;
1199
+ }
1200
+ case 100: {
1201
+ this.callStack.pop();
1202
+ if (this.callStack.length === 0) {
1203
+ this.status = "HALTED";
1204
+ }
1205
+ break;
1206
+ }
1207
+ case 101: {
1208
+ this.push(operands[0]);
1209
+ break;
1210
+ }
1211
+ case 102: {
1212
+ this.pop();
1213
+ break;
1214
+ }
1215
+ case 103: {
1216
+ const regIdx = operands[0];
1217
+ const value = this.pop();
1218
+ if (regIdx < frame.registers.length) {
1219
+ frame.registers[regIdx] = value;
1220
+ }
1221
+ break;
1222
+ }
1223
+ case 104: {
1224
+ const regIdx = operands[0];
1225
+ if (regIdx < frame.registers.length) {
1226
+ this.push(frame.registers[regIdx]);
1227
+ } else {
1228
+ this.push(null);
1229
+ }
1230
+ break;
1231
+ }
1232
+ case 105: {
1233
+ this.status = "HALTED";
1234
+ break;
1235
+ }
1236
+ case 106: {
1237
+ this.status = "YIELDED";
1238
+ break;
1239
+ }
1240
+ case 107: {
1241
+ const delayMs = operands[0];
1242
+ const handlerFunc = operands[1];
1243
+ this.timers.push({
1244
+ triggerTimeMs: this.currentTimeMs + delayMs,
1245
+ handlerFunctionIndex: handlerFunc
1246
+ });
1247
+ break;
1248
+ }
1249
+ // ── Arithmetic ──────────────────────────────────────────────────────
1250
+ case 108: {
1251
+ const b = this.pop();
1252
+ const a = this.pop();
1253
+ this.push((a ?? 0) + (b ?? 0));
1254
+ break;
1255
+ }
1256
+ case 109: {
1257
+ const b = this.pop();
1258
+ const a = this.pop();
1259
+ this.push((a ?? 0) - (b ?? 0));
1260
+ break;
1261
+ }
1262
+ case 110: {
1263
+ const b = this.pop();
1264
+ const a = this.pop();
1265
+ this.push((a ?? 0) * (b ?? 0));
1266
+ break;
1267
+ }
1268
+ case 111: {
1269
+ const b = this.pop();
1270
+ const a = this.pop();
1271
+ this.push(b !== 0 ? (a ?? 0) / b : 0);
1272
+ break;
1273
+ }
1274
+ // ── Comparison ──────────────────────────────────────────────────────
1275
+ case 128: {
1276
+ const b = this.pop();
1277
+ const a = this.pop();
1278
+ this.push(a === b ? 1 : 0);
1279
+ break;
1280
+ }
1281
+ case 129: {
1282
+ const b = this.pop();
1283
+ const a = this.pop();
1284
+ this.push(a < b ? 1 : 0);
1285
+ break;
1286
+ }
1287
+ case 130: {
1288
+ const b = this.pop();
1289
+ const a = this.pop();
1290
+ this.push(a > b ? 1 : 0);
1291
+ break;
1292
+ }
1293
+ case 131: {
1294
+ const val = this.pop();
1295
+ this.push(val ? 0 : 1);
1296
+ break;
1297
+ }
1298
+ // ── Agent Bridge (stubs — filled in by host integration) ────────────
1299
+ case 112:
1300
+ case 113:
1301
+ case 114:
1302
+ case 115:
1303
+ case 116:
1304
+ this.executeHostOpcode(op, operands);
1305
+ break;
1306
+ // ── I/O & Networking (host integration) ─────────────────────────────
1307
+ case 80:
1308
+ case 81:
1309
+ case 82:
1310
+ case 83:
1311
+ case 84:
1312
+ case 85:
1313
+ case 86:
1314
+ this.executeHostOpcode(op, operands);
1315
+ break;
1316
+ // ── Spatial queries (host integration) ───────────────────────────────
1317
+ case 20:
1318
+ case 21:
1319
+ case 22:
1320
+ case 23:
1321
+ case 24:
1322
+ this.executeHostOpcode(op, operands);
1323
+ break;
1324
+ }
1325
+ }
1326
+ // ── Stack operations ──────────────────────────────────────────────────────
1327
+ push(value) {
1328
+ if (this.stack.length >= this.maxStackSize) {
1329
+ this.status = "ERROR";
1330
+ return;
1331
+ }
1332
+ this.stack.push(value);
1333
+ }
1334
+ pop() {
1335
+ return this.stack.pop() ?? null;
1336
+ }
1337
+ // ── Call frame management ─────────────────────────────────────────────────
1338
+ get currentFrame() {
1339
+ return this.callStack[this.callStack.length - 1];
1340
+ }
1341
+ callFunction(funcIdx) {
1342
+ if (!this.bytecode) return;
1343
+ if (this.callStack.length >= this.maxCallDepth) {
1344
+ this.status = "ERROR";
1345
+ return;
1346
+ }
1347
+ const func = this.bytecode.functions[funcIdx];
1348
+ if (!func) {
1349
+ this.status = "ERROR";
1350
+ return;
1351
+ }
1352
+ const frame = {
1353
+ functionIndex: funcIdx,
1354
+ pc: 0,
1355
+ registers: new Array(func.registerCount).fill(null),
1356
+ stackBase: this.stack.length
1357
+ };
1358
+ this.callStack.push(frame);
1359
+ this.status = "RUNNING";
1360
+ }
1361
+ executeHostOpcode(opcode, operands) {
1362
+ const callback = this.hostCallbacks.get(opcode);
1363
+ if (!callback) {
1364
+ throw new UnsupportedHostOpcodeError(opcode, operands);
1365
+ }
1366
+ const result = callback({
1367
+ opcode,
1368
+ opcodeName: getOpcodeName(opcode),
1369
+ opcodeGroup: getHostOpcodeGroup(opcode),
1370
+ operands: [...operands],
1371
+ tickCount: this.tickCount,
1372
+ currentTimeMs: this.currentTimeMs,
1373
+ world: this.world,
1374
+ vm: this,
1375
+ resolveString: (index) => this.getString(index)
1376
+ });
1377
+ if (!HOST_OUTPUT_OPCODES.has(opcode)) {
1378
+ return;
1379
+ }
1380
+ if (result === void 0) {
1381
+ throw new Error(`Host callback for ${getOpcodeName(opcode)} must return a VM operand`);
1382
+ }
1383
+ this.push(result);
1384
+ }
1385
+ // ── Timer processing ──────────────────────────────────────────────────────
1386
+ processTimers() {
1387
+ const expired = [];
1388
+ this.timers = this.timers.filter((t) => {
1389
+ if (t.triggerTimeMs <= this.currentTimeMs) {
1390
+ expired.push(t);
1391
+ return false;
1392
+ }
1393
+ return true;
1394
+ });
1395
+ for (const timer of expired) {
1396
+ this.callFunction(timer.handlerFunctionIndex);
1397
+ this.executeInstructions();
1398
+ }
1399
+ }
1400
+ // ── Event dispatch ────────────────────────────────────────────────────────
1401
+ dispatchEvents() {
1402
+ if (!this.bytecode) return;
1403
+ const events = [...this.eventQueue];
1404
+ this.eventQueue = [];
1405
+ for (const event of events) {
1406
+ for (const binding of this.bytecode.events) {
1407
+ if (binding.eventType === event.eventType) {
1408
+ for (const p of event.payload) {
1409
+ this.push(p);
1410
+ }
1411
+ this.callFunction(binding.handlerFunctionIndex);
1412
+ this.executeInstructions();
1413
+ }
1414
+ }
1415
+ }
1416
+ }
1417
+ // ── Utility ───────────────────────────────────────────────────────────────
1418
+ getString(index) {
1419
+ if (!this.bytecode) return "";
1420
+ return this.bytecode.strings[index] ?? `str_${index}`;
1421
+ }
1422
+ /**
1423
+ * Get current VM status
1424
+ */
1425
+ getStatus() {
1426
+ return this.status;
1427
+ }
1428
+ /**
1429
+ * Get current stack snapshot (for debugging)
1430
+ */
1431
+ getStack() {
1432
+ return [...this.stack];
1433
+ }
1434
+ /**
1435
+ * Get the tick count
1436
+ */
1437
+ getTickCount() {
1438
+ return this.tickCount;
1439
+ }
1440
+ /**
1441
+ * Get the last execution error, preserving typed host-integration failures.
1442
+ */
1443
+ getLastError() {
1444
+ return this.lastError;
1445
+ }
1446
+ /**
1447
+ * Queue an external event (e.g., from user input or network)
1448
+ */
1449
+ queueEvent(eventType, ...payload) {
1450
+ this.eventQueue.push({ eventType, payload });
1451
+ }
1452
+ };
1453
+ var HOST_OPCODE_GROUPS = /* @__PURE__ */ new Map([
1454
+ [112, "agent"],
1455
+ [113, "agent"],
1456
+ [114, "agent"],
1457
+ [115, "agent"],
1458
+ [116, "agent"],
1459
+ [80, "io"],
1460
+ [81, "io"],
1461
+ [82, "io"],
1462
+ [83, "io"],
1463
+ [84, "io"],
1464
+ [85, "io"],
1465
+ [86, "io"],
1466
+ [20, "spatial"],
1467
+ [21, "spatial"],
1468
+ [22, "spatial"],
1469
+ [23, "spatial"],
1470
+ [24, "spatial"]
1471
+ ]);
1472
+ var HOST_OUTPUT_OPCODES = /* @__PURE__ */ new Set([
1473
+ 112,
1474
+ 113,
1475
+ 80,
1476
+ 84,
1477
+ 85,
1478
+ 20,
1479
+ 21,
1480
+ 22,
1481
+ 23,
1482
+ 24
1483
+ /* GET_ZONE */
1484
+ ]);
1485
+ function isHostOpcode(opcode) {
1486
+ return HOST_OPCODE_GROUPS.has(opcode);
1487
+ }
1488
+ function getHostOpcodeGroup(opcode) {
1489
+ return HOST_OPCODE_GROUPS.get(opcode) ?? "io";
1490
+ }
1491
+ exports$1.AssetType = AssetType;
1492
+ exports$1.BodyType = BodyType2;
1493
+ exports$1.ColliderShape = ColliderShape;
1494
+ exports$1.ComponentType = ComponentType3;
1495
+ exports$1.ECSWorld = ECSWorld2;
1496
+ exports$1.GeometryType = GeometryType2;
1497
+ exports$1.HOLOB_MAGIC = HOLOB_MAGIC;
1498
+ exports$1.HOLOB_VERSION = HOLOB_VERSION;
1499
+ exports$1.HoloBytecodeBuilder = HoloBytecodeBuilder2;
1500
+ exports$1.HoloFunctionBuilder = HoloFunctionBuilder;
1501
+ exports$1.HoloOpCode = HoloOpCode;
1502
+ exports$1.HoloVM = HoloVM;
1503
+ exports$1.HolobFlags = HolobFlags;
1504
+ exports$1.LightType = LightType2;
1505
+ exports$1.SyncTier = SyncTier;
1506
+ exports$1.UnsupportedHostOpcodeError = UnsupportedHostOpcodeError;
1507
+ exports$1.VMStatus = VMStatus;
1508
+ exports$1.ValueType = ValueType;
1509
+ exports$1.getOpcodeFamily = getOpcodeFamily;
1510
+ exports$1.getOpcodeName = getOpcodeName;
1511
+ exports$1.isControlFlow = isControlFlow;
1512
+ exports$1.isHostOpcode = isHostOpcode;
1513
+ }
1514
+ });
1515
+
131
1516
  // src/composition/CompositionParser.ts
132
1517
  function getProp(props, key2) {
133
1518
  if (!props) return void 0;
@@ -6473,6 +7858,7 @@ var CircuitBreakerRegistry = class {
6473
7858
  };
6474
7859
 
6475
7860
  // src/compiler/ReferenceExporters.ts
7861
+ init_Native2DCompiler();
6476
7862
  var ReferenceExporter = class {
6477
7863
  constructor(options = {}) {
6478
7864
  this.options = {
@@ -6853,6 +8239,20 @@ var WASMReferenceExporter = class extends ReferenceExporter {
6853
8239
  };
6854
8240
  }
6855
8241
  };
8242
+ var Native2DReferenceExporter = class extends ReferenceExporter {
8243
+ export(composition) {
8244
+ const output = new Native2DCompiler().compile(composition, "", void 0, {
8245
+ format: "html"
8246
+ });
8247
+ return {
8248
+ target: "native-2d",
8249
+ output,
8250
+ format: "text",
8251
+ warnings: [],
8252
+ usedFallback: true
8253
+ };
8254
+ }
8255
+ };
6856
8256
  var ReferenceExporterRegistry = class {
6857
8257
  constructor() {
6858
8258
  this.exporters = /* @__PURE__ */ new Map();
@@ -6864,6 +8264,7 @@ var ReferenceExporterRegistry = class {
6864
8264
  this.exporters.set("webgpu", new WebGPUReferenceExporter());
6865
8265
  this.exporters.set("r3f", new R3FReferenceExporter());
6866
8266
  this.exporters.set("babylon", new BabylonReferenceExporter());
8267
+ this.exporters.set("native-2d", new Native2DReferenceExporter());
6867
8268
  this.exporters.set("openxr", new OpenXRReferenceExporter());
6868
8269
  this.exporters.set("vrchat", new VRChatReferenceExporter());
6869
8270
  this.exporters.set("ios", new IOSReferenceExporter());
@@ -23376,7 +24777,7 @@ button refreshBtn {
23376
24777
 
23377
24778
  // src/barrel/runtime-env.ts
23378
24779
  async function createHoloScriptEnvironment() {
23379
- const { HoloScriptRuntime } = await import('./HoloScriptRuntime-3URVTKPJ.js');
24780
+ const { HoloScriptRuntime } = await import('./HoloScriptRuntime-CBYJX3LZ.js');
23380
24781
  return {
23381
24782
  parser: new HoloScriptParser(),
23382
24783
  runtime: new HoloScriptRuntime(),
@@ -33495,7 +34896,18 @@ function calculateMedian(numbers) {
33495
34896
  const mid = Math.floor(sorted.length / 2);
33496
34897
  return sorted.length % 2 === 0 ? (sorted[mid - 1] + sorted[mid]) / 2 : sorted[mid];
33497
34898
  }
33498
- var requirePeer = createRequire(import.meta.url);
34899
+ var _requirePeer;
34900
+ function requirePeer(specifier) {
34901
+ if (!_requirePeer) {
34902
+ if (typeof createRequire !== "function") {
34903
+ throw new Error(
34904
+ "@holoscript/core: optional peer symbols require a Node.js environment (`createRequire` is unavailable in this bundle). The core parser and compiler surface work without the optional peers."
34905
+ );
34906
+ }
34907
+ _requirePeer = createRequire(import.meta.url);
34908
+ }
34909
+ return _requirePeer(specifier);
34910
+ }
33499
34911
  var peerCache = /* @__PURE__ */ new Map();
33500
34912
  function loadPeer(specifier) {
33501
34913
  const cached = peerCache.get(specifier);
@@ -33534,6 +34946,13 @@ function lazyPeerSymbol(specifier, name) {
33534
34946
  if (resolved === void 0) resolved = resolveSymbol(specifier, name);
33535
34947
  return resolved;
33536
34948
  };
34949
+ const tryReal = () => {
34950
+ try {
34951
+ return real();
34952
+ } catch {
34953
+ return void 0;
34954
+ }
34955
+ };
33537
34956
  return new Proxy(target, {
33538
34957
  apply(_t, thisArg, args) {
33539
34958
  return Reflect.apply(real(), thisArg, args);
@@ -33542,21 +34961,29 @@ function lazyPeerSymbol(specifier, name) {
33542
34961
  return Reflect.construct(real(), args, newTarget);
33543
34962
  },
33544
34963
  get(_t, prop) {
33545
- const r = real();
34964
+ const r = tryReal();
34965
+ if (r == null) return Reflect.get(_t, prop);
33546
34966
  const v = Reflect.get(r, prop, r);
33547
34967
  return typeof v === "function" ? v.bind(r) : v;
33548
34968
  },
33549
34969
  has(_t, prop) {
33550
- return Reflect.has(real(), prop);
34970
+ const r = tryReal();
34971
+ return Reflect.has(r ?? _t, prop);
33551
34972
  },
33552
- getPrototypeOf() {
33553
- return Reflect.getPrototypeOf(real());
34973
+ getPrototypeOf(_t) {
34974
+ const r = tryReal();
34975
+ return Reflect.getPrototypeOf(r ?? _t);
33554
34976
  },
33555
- ownKeys() {
33556
- return Reflect.ownKeys(real());
34977
+ // ownKeys / getOwnPropertyDescriptor MUST satisfy Proxy invariants (the
34978
+ // function target has a non-configurable `prototype` key), so on resolution
34979
+ // failure delegate to the TARGET — never return [] / undefined, which throws.
34980
+ ownKeys(_t) {
34981
+ const r = tryReal();
34982
+ return Reflect.ownKeys(r ?? _t);
33557
34983
  },
33558
34984
  getOwnPropertyDescriptor(_t, prop) {
33559
- return Reflect.getOwnPropertyDescriptor(real(), prop);
34985
+ const r = tryReal();
34986
+ return Reflect.getOwnPropertyDescriptor(r ?? _t, prop);
33560
34987
  }
33561
34988
  });
33562
34989
  }
@@ -33571,7 +34998,7 @@ var GeometryType;
33571
34998
  var BodyType;
33572
34999
  var LightType;
33573
35000
  try {
33574
- const holoVm = __require("@holoscript/holo-vm");
35001
+ const holoVm = require_dist();
33575
35002
  HoloBytecodeBuilder = holoVm.HoloBytecodeBuilder;
33576
35003
  ComponentType2 = holoVm.ComponentType;
33577
35004
  GeometryType = holoVm.GeometryType;