@holoscript/core 8.0.0 → 8.0.2

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 (129) hide show
  1. package/README.md +2 -2
  2. package/dist/{GLTFPipeline-M7WSSJED.cjs → GLTFPipeline-76QTLF4Z.cjs} +10 -9
  3. package/dist/{GLTFPipeline-276GE64O.js → GLTFPipeline-ES5YMBGT.js} +6 -5
  4. package/dist/HoloScriptRuntime-2DDYOPOR.js +10 -0
  5. package/dist/{HoloScriptRuntime-SXEAEU2N.cjs → HoloScriptRuntime-ZGRR5EB3.cjs} +5 -5
  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-NGKREZ36.js → chunk-3OYVN53V.js} +505 -5
  9. package/dist/{chunk-GQT4TYKY.cjs → chunk-3OZACAFQ.cjs} +44 -19
  10. package/dist/{chunk-T2QCTZMO.js → chunk-4SDKXQ4C.js} +3 -3
  11. package/dist/{chunk-253GBQZY.cjs → chunk-5H2G27PK.cjs} +35 -35
  12. package/dist/{chunk-C2A5DUMF.cjs → chunk-5NWINHR5.cjs} +35 -35
  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-WJIHFLMJ.js → chunk-ADADVMXY.js} +2 -2
  16. package/dist/{chunk-NHWSN2SD.cjs → chunk-AVJHHUC5.cjs} +17 -17
  17. package/dist/{chunk-JCLBKPMX.js → chunk-BOVPWH4H.js} +48 -4
  18. package/dist/{chunk-ZZEI7MV4.js → chunk-CCATWPXM.js} +3 -3
  19. package/dist/{chunk-NBMHU6SW.js → chunk-CMT5NMMS.js} +3 -3
  20. package/dist/{chunk-HINXWAOD.cjs → chunk-CR4FMIWL.cjs} +11 -11
  21. package/dist/{chunk-IZM5VQZD.js → chunk-D3STJ56J.js} +3 -3
  22. package/dist/{chunk-EUDQTK7N.cjs → chunk-DAKRKDZV.cjs} +27 -38
  23. package/dist/{chunk-ZBQXLH2L.js → chunk-DHO2YRIM.js} +3 -3
  24. package/dist/{chunk-RVBHAXFG.js → chunk-DXWOTOUK.js} +16 -11
  25. package/dist/{chunk-F43YAA34.js → chunk-E47Z63DF.js} +3 -3
  26. package/dist/{chunk-62FBK3B7.js → chunk-FFAOS5HQ.js} +4 -4
  27. package/dist/{chunk-UM6C3CGK.js → chunk-FS7BFHFN.js} +28 -3
  28. package/dist/{chunk-SJBGLS25.cjs → chunk-FXIO6GHT.cjs} +5 -5
  29. package/dist/{chunk-XUUVDHIF.cjs → chunk-HKEXJUWS.cjs} +48 -3
  30. package/dist/{chunk-NXZFOPVD.cjs → chunk-HNDK4IQU.cjs} +16 -16
  31. package/dist/{chunk-SMIWS6DE.cjs → chunk-IELX2OKI.js} +118 -7
  32. package/dist/{chunk-KH4CNH66.cjs → chunk-IMGDUSTT.cjs} +4 -4
  33. package/dist/{chunk-LICPB5HZ.cjs → chunk-IUDGEUDO.cjs} +10 -10
  34. package/dist/{chunk-73FELZVJ.cjs → chunk-IWC5DM2M.cjs} +11 -11
  35. package/dist/{chunk-PHVRG4I2.js → chunk-J7XZV333.js} +3 -3
  36. package/dist/{chunk-K4VVR7CN.cjs → chunk-JBNDTXXV.cjs} +15 -15
  37. package/dist/{chunk-3NFFOWGG.js → chunk-KFIXE2MB.js} +14 -5
  38. package/dist/{chunk-B4TFTDG4.js → chunk-LCEXRE5Z.js} +3 -3
  39. package/dist/{chunk-IVSZDECV.js → chunk-LHAXPADA.js} +3 -3
  40. package/dist/{chunk-7CUEMLDZ.cjs → chunk-LKBTCABN.cjs} +540 -38
  41. package/dist/{chunk-AYBXB26F.js → chunk-LOGP3JWH.js} +5 -5
  42. package/dist/{chunk-KVRSTFNH.cjs → chunk-NCWCUZNS.cjs} +8 -8
  43. package/dist/{chunk-NV4VMVXU.js → chunk-NNFA2C3Y.js} +3 -3
  44. package/dist/{chunk-HZSPDCXV.cjs → chunk-O7WLJ53D.cjs} +3 -3
  45. package/dist/{chunk-MGE5Z4GS.js → chunk-OH2FAIVU.js} +3 -3
  46. package/dist/{chunk-UMABK6SI.js → chunk-PY37LNDP.js} +3 -3
  47. package/dist/{chunk-23J755AR.js → chunk-QD32ADK6.js} +3 -3
  48. package/dist/chunk-QRPRIJ2W.js +1525 -0
  49. package/dist/{chunk-HZTDET3N.js → chunk-R24NNAEG.js} +3 -3
  50. package/dist/{chunk-W7VDOASB.cjs → chunk-RMTPN3G4.cjs} +5 -5
  51. package/dist/{chunk-6DPSFNJB.cjs → chunk-ROHLEP2W.cjs} +16 -16
  52. package/dist/{chunk-3HYYMEXI.cjs → chunk-SMRVK6BI.cjs} +17 -12
  53. package/dist/{chunk-25IQCHTO.cjs → chunk-TWUXUCEW.cjs} +35 -35
  54. package/dist/{chunk-KEFNV2WM.cjs → chunk-U7IUS5HJ.cjs} +13 -13
  55. package/dist/{chunk-3AO425MZ.cjs → chunk-UFZZ7TSN.cjs} +17 -17
  56. package/dist/chunk-UPXIY52O.cjs +1562 -0
  57. package/dist/{chunk-BE4UJCQT.js → chunk-UWJHCOH2.js} +3 -3
  58. package/dist/{chunk-7HIASF7S.cjs → chunk-XB274MW5.cjs} +10 -10
  59. package/dist/{chunk-RARB3MBR.js → chunk-YDPEHCCI.cjs} +127 -3
  60. package/dist/{chunk-KJLB4OPV.js → chunk-YN2YWTXW.js} +3 -3
  61. package/dist/{chunk-IPWSXCCN.js → chunk-YVD3CSO3.js} +3 -3
  62. package/dist/{chunk-OR4Q2BGL.cjs → chunk-YWOBW2PV.cjs} +15 -15
  63. package/dist/{chunk-JX7YL6ZE.js → chunk-ZPYP4RBA.js} +4 -4
  64. package/dist/compiler/android-xr.cjs +5 -5
  65. package/dist/compiler/android-xr.js +3 -3
  66. package/dist/compiler/babylon.cjs +4 -4
  67. package/dist/compiler/babylon.js +3 -3
  68. package/dist/compiler/business-quest.cjs +9 -9
  69. package/dist/compiler/business-quest.js +1 -1
  70. package/dist/compiler/domain-block-utils.cjs +154 -150
  71. package/dist/compiler/domain-block-utils.js +2 -2
  72. package/dist/compiler/gltf-pipeline.cjs +8 -8
  73. package/dist/compiler/gltf-pipeline.js +1 -1
  74. package/dist/compiler/godot.cjs +4 -4
  75. package/dist/compiler/godot.js +3 -3
  76. package/dist/compiler/index.cjs +129 -581
  77. package/dist/compiler/index.d.ts +12 -0
  78. package/dist/compiler/index.js +42 -498
  79. package/dist/compiler/multi-layer.cjs +5 -5
  80. package/dist/compiler/multi-layer.js +4 -4
  81. package/dist/compiler/nodetoy.d.ts +69 -0
  82. package/dist/compiler/openxr.cjs +4 -4
  83. package/dist/compiler/openxr.js +3 -3
  84. package/dist/compiler/playcanvas.cjs +4 -4
  85. package/dist/compiler/playcanvas.js +3 -3
  86. package/dist/compiler/r3f.cjs +9 -8
  87. package/dist/compiler/r3f.js +4 -3
  88. package/dist/compiler/sdf.cjs +5 -5
  89. package/dist/compiler/sdf.js +3 -3
  90. package/dist/compiler/unity.cjs +4 -4
  91. package/dist/compiler/unity.js +3 -3
  92. package/dist/compiler/unreal.cjs +5 -5
  93. package/dist/compiler/unreal.js +3 -3
  94. package/dist/compiler/urdf.cjs +12 -12
  95. package/dist/compiler/urdf.js +3 -3
  96. package/dist/compiler/usd-physics.cjs +5 -5
  97. package/dist/compiler/usd-physics.js +2 -2
  98. package/dist/compiler/visionos.cjs +4 -4
  99. package/dist/compiler/visionos.js +3 -3
  100. package/dist/compiler/vrchat.cjs +5 -5
  101. package/dist/compiler/vrchat.js +3 -3
  102. package/dist/compiler/vrr.cjs +5 -5
  103. package/dist/compiler/vrr.js +3 -3
  104. package/dist/compiler/wasm.cjs +8 -8
  105. package/dist/compiler/wasm.js +3 -3
  106. package/dist/compiler/webgpu.cjs +4 -4
  107. package/dist/compiler/webgpu.js +3 -3
  108. package/dist/debugger.cjs +5 -5
  109. package/dist/debugger.js +3 -3
  110. package/dist/dist-ACXG6IH5.cjs +3113 -0
  111. package/dist/dist-VD4L6V7Q.js +3076 -0
  112. package/dist/index.cjs +1894 -559
  113. package/dist/index.d.ts +2 -0
  114. package/dist/index.js +1448 -113
  115. package/dist/reconstruction/index.cjs +31 -31
  116. package/dist/reconstruction/index.js +2 -2
  117. package/dist/runtime.cjs +150 -293
  118. package/dist/runtime.js +82 -23
  119. package/dist/src-4ROC227P.cjs +2094 -0
  120. package/dist/src-HCCCSYP7.js +2073 -0
  121. package/dist/traits/botanical-lotus.cjs +162 -10
  122. package/dist/traits/botanical-lotus.d.ts +330 -0
  123. package/dist/traits/botanical-lotus.js +4 -1
  124. package/dist/traits/index.cjs +610 -455
  125. package/dist/traits/index.js +9 -5
  126. package/package.json +23 -23
  127. package/dist/HoloScriptRuntime-3URVTKPJ.js +0 -10
  128. package/dist/chunk-VECQYRXL.js +0 -474
  129. 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-ZPYP4RBA.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-E47Z63DF.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-LOGP3JWH.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-3OYVN53V.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-3OYVN53V.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-DXWOTOUK.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-FS7BFHFN.js';
51
+ export { ENVIRONMENT_PRESETS, R3FCompiler, registerAllPresets } from './chunk-FS7BFHFN.js';
53
52
  import './chunk-XT6JY5W5.js';
54
- import { init_PlayCanvasCompiler, PlayCanvasCompiler } from './chunk-ZBQXLH2L.js';
53
+ import './chunk-QRPRIJ2W.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';
@@ -105,8 +105,8 @@ import './chunk-SIEXCILW.js';
105
105
  import './chunk-CBJY23VL.js';
106
106
  export { HoloScriptTypeChecker, createTypeChecker } from './chunk-VMLKSV26.js';
107
107
  export { BUILTIN_CONSTRAINTS } from './chunk-XSFNHP2E.js';
108
- import { getSharedEventBus } from './chunk-RARB3MBR.js';
109
- export { EventBus, getSharedEventBus, setSharedEventBus, telemetry } from './chunk-RARB3MBR.js';
108
+ import { lazyPeerSymbol, getSharedEventBus } from './chunk-IELX2OKI.js';
109
+ export { EventBus, getSharedEventBus, setSharedEventBus, telemetry } from './chunk-IELX2OKI.js';
110
110
  import { HoloScriptCodeParser } from './chunk-URG2SJLK.js';
111
111
  export { ERROR_CODES, HoloScriptCodeParser, ParserPools } from './chunk-URG2SJLK.js';
112
112
  import './chunk-H652NHX5.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';
@@ -125,9 +125,1393 @@ import { inflateSync, deflateSync } from 'zlib';
125
125
  import { EventEmitter } from 'events';
126
126
  import { canonicalizeManifest, verifySignature } from '@holoscript/platform';
127
127
  export { canonicalizeManifest, checkRateLimit, createDefaultPolicy, createPackageManifest, createSandbox, createStrictPolicy, decrypt, deriveKey, destroy as destroySandbox, encrypt, execute as executeSandbox, exportKey, generateEncryptionKey, generateKeyPair, hmacSha256, importKey, randomBytes, randomHex, randomUUID, resetRateLimit, sanitizeInput, sha256, sha512, signPackage, validateApiKey, validateUrl, validateWalletAddress, verifyHmacSha256, verifySignature } from '@holoscript/platform';
128
- import { createRequire } from 'module';
129
128
  import { Worker } from 'worker_threads';
130
129
 
130
+ // ../holo-vm/dist/index.cjs
131
+ var require_dist = __commonJS({
132
+ "../holo-vm/dist/index.cjs"(exports$1) {
133
+ var HoloOpCode = /* @__PURE__ */ ((HoloOpCode2) => {
134
+ HoloOpCode2[HoloOpCode2["SPAWN"] = 1] = "SPAWN";
135
+ HoloOpCode2[HoloOpCode2["DESPAWN"] = 2] = "DESPAWN";
136
+ HoloOpCode2[HoloOpCode2["CLONE"] = 3] = "CLONE";
137
+ HoloOpCode2[HoloOpCode2["SET_COMPONENT"] = 4] = "SET_COMPONENT";
138
+ HoloOpCode2[HoloOpCode2["GET_COMPONENT"] = 5] = "GET_COMPONENT";
139
+ HoloOpCode2[HoloOpCode2["REMOVE_COMPONENT"] = 6] = "REMOVE_COMPONENT";
140
+ HoloOpCode2[HoloOpCode2["SET_PARENT"] = 7] = "SET_PARENT";
141
+ HoloOpCode2[HoloOpCode2["QUERY"] = 8] = "QUERY";
142
+ HoloOpCode2[HoloOpCode2["TRANSFORM"] = 16] = "TRANSFORM";
143
+ HoloOpCode2[HoloOpCode2["TRANSLATE"] = 17] = "TRANSLATE";
144
+ HoloOpCode2[HoloOpCode2["ROTATE"] = 18] = "ROTATE";
145
+ HoloOpCode2[HoloOpCode2["LOOK_AT"] = 19] = "LOOK_AT";
146
+ HoloOpCode2[HoloOpCode2["RAYCAST"] = 20] = "RAYCAST";
147
+ HoloOpCode2[HoloOpCode2["QUERY_BOX"] = 21] = "QUERY_BOX";
148
+ HoloOpCode2[HoloOpCode2["QUERY_SPHERE"] = 22] = "QUERY_SPHERE";
149
+ HoloOpCode2[HoloOpCode2["FIND_PATH"] = 23] = "FIND_PATH";
150
+ HoloOpCode2[HoloOpCode2["GET_ZONE"] = 24] = "GET_ZONE";
151
+ HoloOpCode2[HoloOpCode2["ADD_RIGIDBODY"] = 32] = "ADD_RIGIDBODY";
152
+ HoloOpCode2[HoloOpCode2["APPLY_FORCE"] = 33] = "APPLY_FORCE";
153
+ HoloOpCode2[HoloOpCode2["APPLY_IMPULSE"] = 34] = "APPLY_IMPULSE";
154
+ HoloOpCode2[HoloOpCode2["SET_VELOCITY"] = 35] = "SET_VELOCITY";
155
+ HoloOpCode2[HoloOpCode2["ADD_COLLIDER"] = 36] = "ADD_COLLIDER";
156
+ HoloOpCode2[HoloOpCode2["ADD_JOINT"] = 37] = "ADD_JOINT";
157
+ HoloOpCode2[HoloOpCode2["SET_GRAVITY"] = 38] = "SET_GRAVITY";
158
+ HoloOpCode2[HoloOpCode2["PHYSICS_STEP"] = 39] = "PHYSICS_STEP";
159
+ HoloOpCode2[HoloOpCode2["SET_GEOMETRY"] = 48] = "SET_GEOMETRY";
160
+ HoloOpCode2[HoloOpCode2["SET_MATERIAL"] = 49] = "SET_MATERIAL";
161
+ HoloOpCode2[HoloOpCode2["SET_VISIBLE"] = 50] = "SET_VISIBLE";
162
+ HoloOpCode2[HoloOpCode2["SET_LOD"] = 51] = "SET_LOD";
163
+ HoloOpCode2[HoloOpCode2["SET_LIGHT"] = 52] = "SET_LIGHT";
164
+ HoloOpCode2[HoloOpCode2["SET_ANIMATION"] = 53] = "SET_ANIMATION";
165
+ HoloOpCode2[HoloOpCode2["SET_GAUSSIAN_SPLAT"] = 54] = "SET_GAUSSIAN_SPLAT";
166
+ HoloOpCode2[HoloOpCode2["SET_PARTICLE_SYSTEM"] = 55] = "SET_PARTICLE_SYSTEM";
167
+ HoloOpCode2[HoloOpCode2["APPLY_TRAIT"] = 64] = "APPLY_TRAIT";
168
+ HoloOpCode2[HoloOpCode2["REMOVE_TRAIT"] = 65] = "REMOVE_TRAIT";
169
+ HoloOpCode2[HoloOpCode2["RESOLVE_TRAITS"] = 66] = "RESOLVE_TRAITS";
170
+ HoloOpCode2[HoloOpCode2["EMIT_EVENT"] = 67] = "EMIT_EVENT";
171
+ HoloOpCode2[HoloOpCode2["ON_EVENT"] = 68] = "ON_EVENT";
172
+ HoloOpCode2[HoloOpCode2["EVAL_CONDITION"] = 69] = "EVAL_CONDITION";
173
+ HoloOpCode2[HoloOpCode2["LOAD_ASSET"] = 80] = "LOAD_ASSET";
174
+ HoloOpCode2[HoloOpCode2["PLAY_AUDIO"] = 81] = "PLAY_AUDIO";
175
+ HoloOpCode2[HoloOpCode2["NET_SYNC"] = 82] = "NET_SYNC";
176
+ HoloOpCode2[HoloOpCode2["NET_SEND"] = 83] = "NET_SEND";
177
+ HoloOpCode2[HoloOpCode2["NET_RECV"] = 84] = "NET_RECV";
178
+ HoloOpCode2[HoloOpCode2["XR_INPUT"] = 85] = "XR_INPUT";
179
+ HoloOpCode2[HoloOpCode2["HAPTIC"] = 86] = "HAPTIC";
180
+ HoloOpCode2[HoloOpCode2["NOP"] = 96] = "NOP";
181
+ HoloOpCode2[HoloOpCode2["JUMP"] = 97] = "JUMP";
182
+ HoloOpCode2[HoloOpCode2["JUMP_IF"] = 98] = "JUMP_IF";
183
+ HoloOpCode2[HoloOpCode2["CALL"] = 99] = "CALL";
184
+ HoloOpCode2[HoloOpCode2["RETURN"] = 100] = "RETURN";
185
+ HoloOpCode2[HoloOpCode2["PUSH"] = 101] = "PUSH";
186
+ HoloOpCode2[HoloOpCode2["POP"] = 102] = "POP";
187
+ HoloOpCode2[HoloOpCode2["STORE"] = 103] = "STORE";
188
+ HoloOpCode2[HoloOpCode2["LOAD"] = 104] = "LOAD";
189
+ HoloOpCode2[HoloOpCode2["HALT"] = 105] = "HALT";
190
+ HoloOpCode2[HoloOpCode2["YIELD"] = 106] = "YIELD";
191
+ HoloOpCode2[HoloOpCode2["TIMER"] = 107] = "TIMER";
192
+ HoloOpCode2[HoloOpCode2["ADD"] = 108] = "ADD";
193
+ HoloOpCode2[HoloOpCode2["SUB"] = 109] = "SUB";
194
+ HoloOpCode2[HoloOpCode2["MUL"] = 110] = "MUL";
195
+ HoloOpCode2[HoloOpCode2["DIV"] = 111] = "DIV";
196
+ HoloOpCode2[HoloOpCode2["AGENT_INVOKE"] = 112] = "AGENT_INVOKE";
197
+ HoloOpCode2[HoloOpCode2["AGENT_READ"] = 113] = "AGENT_READ";
198
+ HoloOpCode2[HoloOpCode2["AGENT_SUBSCRIBE"] = 114] = "AGENT_SUBSCRIBE";
199
+ HoloOpCode2[HoloOpCode2["DIALOG_SHOW"] = 115] = "DIALOG_SHOW";
200
+ HoloOpCode2[HoloOpCode2["QUEST_UPDATE"] = 116] = "QUEST_UPDATE";
201
+ HoloOpCode2[HoloOpCode2["CMP_EQ"] = 128] = "CMP_EQ";
202
+ HoloOpCode2[HoloOpCode2["CMP_LT"] = 129] = "CMP_LT";
203
+ HoloOpCode2[HoloOpCode2["CMP_GT"] = 130] = "CMP_GT";
204
+ HoloOpCode2[HoloOpCode2["NOT"] = 131] = "NOT";
205
+ return HoloOpCode2;
206
+ })(HoloOpCode || {});
207
+ var ComponentType3 = /* @__PURE__ */ ((ComponentType22) => {
208
+ ComponentType22[ComponentType22["Transform"] = 1] = "Transform";
209
+ ComponentType22[ComponentType22["Geometry"] = 2] = "Geometry";
210
+ ComponentType22[ComponentType22["Material"] = 3] = "Material";
211
+ ComponentType22[ComponentType22["RigidBody"] = 4] = "RigidBody";
212
+ ComponentType22[ComponentType22["Collider"] = 5] = "Collider";
213
+ ComponentType22[ComponentType22["Light"] = 6] = "Light";
214
+ ComponentType22[ComponentType22["Animation"] = 7] = "Animation";
215
+ ComponentType22[ComponentType22["Audio"] = 8] = "Audio";
216
+ ComponentType22[ComponentType22["Network"] = 9] = "Network";
217
+ ComponentType22[ComponentType22["Trait"] = 10] = "Trait";
218
+ ComponentType22[ComponentType22["ParticleSystem"] = 11] = "ParticleSystem";
219
+ ComponentType22[ComponentType22["GaussianSplat"] = 12] = "GaussianSplat";
220
+ ComponentType22[ComponentType22["LOD"] = 13] = "LOD";
221
+ ComponentType22[ComponentType22["Custom"] = 255] = "Custom";
222
+ return ComponentType22;
223
+ })(ComponentType3 || {});
224
+ var GeometryType2 = /* @__PURE__ */ ((GeometryType3) => {
225
+ GeometryType3[GeometryType3["Cube"] = 1] = "Cube";
226
+ GeometryType3[GeometryType3["Sphere"] = 2] = "Sphere";
227
+ GeometryType3[GeometryType3["Cylinder"] = 3] = "Cylinder";
228
+ GeometryType3[GeometryType3["Plane"] = 4] = "Plane";
229
+ GeometryType3[GeometryType3["Cone"] = 5] = "Cone";
230
+ GeometryType3[GeometryType3["Torus"] = 6] = "Torus";
231
+ GeometryType3[GeometryType3["Capsule"] = 7] = "Capsule";
232
+ GeometryType3[GeometryType3["Mesh"] = 8] = "Mesh";
233
+ GeometryType3[GeometryType3["Text3D"] = 9] = "Text3D";
234
+ GeometryType3[GeometryType3["Portal"] = 10] = "Portal";
235
+ GeometryType3[GeometryType3["Terrain"] = 11] = "Terrain";
236
+ GeometryType3[GeometryType3["Skybox"] = 12] = "Skybox";
237
+ GeometryType3[GeometryType3["Billboard"] = 13] = "Billboard";
238
+ GeometryType3[GeometryType3["Line"] = 14] = "Line";
239
+ return GeometryType3;
240
+ })(GeometryType2 || {});
241
+ var BodyType2 = /* @__PURE__ */ ((BodyType22) => {
242
+ BodyType22[BodyType22["Static"] = 0] = "Static";
243
+ BodyType22[BodyType22["Dynamic"] = 1] = "Dynamic";
244
+ BodyType22[BodyType22["Kinematic"] = 2] = "Kinematic";
245
+ return BodyType22;
246
+ })(BodyType2 || {});
247
+ var ColliderShape = /* @__PURE__ */ ((ColliderShape2) => {
248
+ ColliderShape2[ColliderShape2["Box"] = 1] = "Box";
249
+ ColliderShape2[ColliderShape2["Sphere"] = 2] = "Sphere";
250
+ ColliderShape2[ColliderShape2["Capsule"] = 3] = "Capsule";
251
+ ColliderShape2[ColliderShape2["Cylinder"] = 4] = "Cylinder";
252
+ ColliderShape2[ColliderShape2["ConvexHull"] = 5] = "ConvexHull";
253
+ ColliderShape2[ColliderShape2["TriMesh"] = 6] = "TriMesh";
254
+ return ColliderShape2;
255
+ })(ColliderShape || {});
256
+ var LightType2 = /* @__PURE__ */ ((LightType22) => {
257
+ LightType22[LightType22["Directional"] = 1] = "Directional";
258
+ LightType22[LightType22["Point"] = 2] = "Point";
259
+ LightType22[LightType22["Spot"] = 3] = "Spot";
260
+ LightType22[LightType22["Ambient"] = 4] = "Ambient";
261
+ LightType22[LightType22["Area"] = 5] = "Area";
262
+ return LightType22;
263
+ })(LightType2 || {});
264
+ var SyncTier = /* @__PURE__ */ ((SyncTier2) => {
265
+ SyncTier2[SyncTier2["Physics"] = 0] = "Physics";
266
+ SyncTier2[SyncTier2["Movement"] = 1] = "Movement";
267
+ SyncTier2[SyncTier2["AIAgent"] = 2] = "AIAgent";
268
+ SyncTier2[SyncTier2["Cosmetic"] = 3] = "Cosmetic";
269
+ return SyncTier2;
270
+ })(SyncTier || {});
271
+ var ValueType = /* @__PURE__ */ ((ValueType2) => {
272
+ ValueType2[ValueType2["Null"] = 0] = "Null";
273
+ ValueType2[ValueType2["Bool"] = 1] = "Bool";
274
+ ValueType2[ValueType2["I32"] = 2] = "I32";
275
+ ValueType2[ValueType2["F32"] = 3] = "F32";
276
+ ValueType2[ValueType2["F64"] = 4] = "F64";
277
+ ValueType2[ValueType2["String"] = 5] = "String";
278
+ ValueType2[ValueType2["Vec3"] = 6] = "Vec3";
279
+ ValueType2[ValueType2["Quat"] = 7] = "Quat";
280
+ ValueType2[ValueType2["EntityRef"] = 8] = "EntityRef";
281
+ ValueType2[ValueType2["Array"] = 9] = "Array";
282
+ return ValueType2;
283
+ })(ValueType || {});
284
+ var FAMILY_NAMES = {
285
+ 0: "Entity",
286
+ 1: "Spatial",
287
+ 2: "Physics",
288
+ 3: "Rendering",
289
+ 4: "Trait",
290
+ 5: "I/O",
291
+ 6: "Control",
292
+ 7: "Agent",
293
+ 8: "Comparison"
294
+ };
295
+ function getOpcodeFamily(opcode) {
296
+ const familyByte = opcode >> 4 & 15;
297
+ return FAMILY_NAMES[familyByte] ?? "Unknown";
298
+ }
299
+ function getOpcodeName(opcode) {
300
+ return HoloOpCode[opcode] ?? `UNKNOWN_0x${opcode.toString(16).padStart(2, "0")}`;
301
+ }
302
+ function isControlFlow(opcode) {
303
+ return opcode === 97 || opcode === 98 || opcode === 99 || opcode === 100 || opcode === 105 || opcode === 106;
304
+ }
305
+ var HOLOB_MAGIC = 1213156418;
306
+ var HOLOB_VERSION = 1;
307
+ var HolobFlags = /* @__PURE__ */ ((HolobFlags2) => {
308
+ HolobFlags2[HolobFlags2["None"] = 0] = "None";
309
+ HolobFlags2[HolobFlags2["Debug"] = 1] = "Debug";
310
+ HolobFlags2[HolobFlags2["SIMD"] = 2] = "SIMD";
311
+ HolobFlags2[HolobFlags2["Threads"] = 4] = "Threads";
312
+ HolobFlags2[HolobFlags2["Networking"] = 8] = "Networking";
313
+ HolobFlags2[HolobFlags2["Physics"] = 16] = "Physics";
314
+ return HolobFlags2;
315
+ })(HolobFlags || {});
316
+ var AssetType = /* @__PURE__ */ ((AssetType2) => {
317
+ AssetType2[AssetType2["Mesh"] = 1] = "Mesh";
318
+ AssetType2[AssetType2["Texture"] = 2] = "Texture";
319
+ AssetType2[AssetType2["Audio"] = 3] = "Audio";
320
+ AssetType2[AssetType2["Animation"] = 4] = "Animation";
321
+ AssetType2[AssetType2["GaussianSplat"] = 5] = "GaussianSplat";
322
+ AssetType2[AssetType2["Font"] = 6] = "Font";
323
+ AssetType2[AssetType2["Script"] = 7] = "Script";
324
+ return AssetType2;
325
+ })(AssetType || {});
326
+ var HoloBytecodeBuilder2 = class {
327
+ constructor() {
328
+ __publicField(this, "strings", /* @__PURE__ */ new Map());
329
+ __publicField(this, "stringList", []);
330
+ __publicField(this, "assets", []);
331
+ __publicField(this, "traits", []);
332
+ __publicField(this, "functions", []);
333
+ __publicField(this, "entities", []);
334
+ __publicField(this, "events", []);
335
+ __publicField(this, "flags", 0);
336
+ }
337
+ /**
338
+ * Intern a string and return its index
339
+ */
340
+ internString(str) {
341
+ const existing = this.strings.get(str);
342
+ if (existing !== void 0) return existing;
343
+ const idx = this.stringList.length;
344
+ this.stringList.push(str);
345
+ this.strings.set(str, idx);
346
+ return idx;
347
+ }
348
+ /**
349
+ * Add a feature flag
350
+ */
351
+ addFlag(flag) {
352
+ this.flags |= flag;
353
+ return this;
354
+ }
355
+ /**
356
+ * Add an asset reference
357
+ */
358
+ addAsset(uri, type) {
359
+ const idx = this.assets.length;
360
+ this.assets.push({ uriIndex: this.internString(uri), type });
361
+ return idx;
362
+ }
363
+ /**
364
+ * Add a trait definition
365
+ */
366
+ addTrait(name, deps = [], initFunc = -1) {
367
+ const idx = this.traits.length;
368
+ this.traits.push({
369
+ nameIndex: this.internString(name),
370
+ dependencies: deps,
371
+ initFunctionIndex: initFunc,
372
+ eventHandlers: /* @__PURE__ */ new Map()
373
+ });
374
+ return idx;
375
+ }
376
+ /**
377
+ * Begin building a function
378
+ */
379
+ addFunction(name, paramCount = 0) {
380
+ const idx = this.functions.length;
381
+ const fn = {
382
+ nameIndex: this.internString(name),
383
+ instructions: [],
384
+ registerCount: 0,
385
+ paramCount
386
+ };
387
+ this.functions.push(fn);
388
+ return new HoloFunctionBuilder(fn, this, idx);
389
+ }
390
+ /**
391
+ * Add an entity definition
392
+ */
393
+ addEntity(name, archetype = 0, parentIndex = -1) {
394
+ const idx = this.entities.length;
395
+ this.entities.push({
396
+ nameIndex: this.internString(name),
397
+ archetype,
398
+ components: [],
399
+ parentIndex
400
+ });
401
+ return idx;
402
+ }
403
+ /**
404
+ * Add component data to an entity
405
+ */
406
+ addComponentToEntity(entityIdx, componentType, values) {
407
+ this.entities[entityIdx].components.push({ componentType, values });
408
+ return this;
409
+ }
410
+ /**
411
+ * Add an event binding
412
+ */
413
+ addEvent(eventType, handlerFunctionIndex, entityFilter = -1) {
414
+ this.events.push({ eventType, handlerFunctionIndex, entityFilter });
415
+ return this;
416
+ }
417
+ /**
418
+ * Build the final bytecode module
419
+ */
420
+ build() {
421
+ return {
422
+ magic: HOLOB_MAGIC,
423
+ version: HOLOB_VERSION,
424
+ flags: this.flags,
425
+ strings: [...this.stringList],
426
+ assets: [...this.assets],
427
+ traits: [...this.traits],
428
+ functions: [...this.functions],
429
+ entities: [...this.entities],
430
+ events: [...this.events]
431
+ };
432
+ }
433
+ };
434
+ var HoloFunctionBuilder = class {
435
+ constructor(func, parent, index) {
436
+ this.func = func;
437
+ this.parent = parent;
438
+ this.index = index;
439
+ }
440
+ emit(opcode, ...operands) {
441
+ this.func.instructions.push({ opcode, operands });
442
+ return this;
443
+ }
444
+ // ── Entity ────────────────────────────────────────────────────────────────
445
+ spawn(entityType, name) {
446
+ return this.emit(1, entityType, this.parent.internString(name));
447
+ }
448
+ despawn(entityId) {
449
+ return this.emit(2, entityId);
450
+ }
451
+ setComponent(entityId, compType, ...data) {
452
+ return this.emit(4, entityId, compType, ...data);
453
+ }
454
+ getComponent(entityId, compType) {
455
+ return this.emit(5, entityId, compType);
456
+ }
457
+ setParent(childId, parentId) {
458
+ return this.emit(7, childId, parentId);
459
+ }
460
+ query(archetypeMask) {
461
+ return this.emit(8, archetypeMask);
462
+ }
463
+ // ── Spatial ───────────────────────────────────────────────────────────────
464
+ transform(entityId, x, y, z) {
465
+ return this.emit(16, entityId, x, y, z, 0, 0, 0, 1, 1, 1, 1);
466
+ }
467
+ translate(entityId, dx, dy, dz) {
468
+ return this.emit(17, entityId, dx, dy, dz);
469
+ }
470
+ rotate(entityId, qx, qy, qz, qw) {
471
+ return this.emit(18, entityId, qx, qy, qz, qw);
472
+ }
473
+ lookAt(entityId, tx, ty, tz) {
474
+ return this.emit(19, entityId, tx, ty, tz);
475
+ }
476
+ raycast(ox, oy, oz, dx, dy, dz, maxDist) {
477
+ return this.emit(20, ox, oy, oz, dx, dy, dz, maxDist);
478
+ }
479
+ // ── Physics ───────────────────────────────────────────────────────────────
480
+ addRigidbody(entityId, mass, bodyType) {
481
+ return this.emit(32, entityId, mass, bodyType);
482
+ }
483
+ applyForce(entityId, fx, fy, fz) {
484
+ return this.emit(33, entityId, fx, fy, fz);
485
+ }
486
+ applyImpulse(entityId, ix, iy, iz) {
487
+ return this.emit(34, entityId, ix, iy, iz);
488
+ }
489
+ setGravity(gx, gy, gz) {
490
+ return this.emit(38, gx, gy, gz);
491
+ }
492
+ physicsStep(dt) {
493
+ return this.emit(39, dt);
494
+ }
495
+ // ── Rendering Hints ───────────────────────────────────────────────────────
496
+ setGeometry(entityId, geoType) {
497
+ return this.emit(48, entityId, geoType);
498
+ }
499
+ setMaterial(entityId, ...desc) {
500
+ return this.emit(49, entityId, ...desc);
501
+ }
502
+ setVisible(entityId, visible) {
503
+ return this.emit(50, entityId, visible ? 1 : 0);
504
+ }
505
+ setLight(entityId, lightType, ...params) {
506
+ return this.emit(52, entityId, lightType, ...params);
507
+ }
508
+ setAnimation(entityId, animId) {
509
+ return this.emit(53, entityId, animId);
510
+ }
511
+ // ── Trait ─────────────────────────────────────────────────────────────────
512
+ applyTrait(entityId, traitId) {
513
+ return this.emit(64, entityId, traitId);
514
+ }
515
+ removeTrait(entityId, traitId) {
516
+ return this.emit(65, entityId, traitId);
517
+ }
518
+ emitEvent(eventType, ...payload) {
519
+ return this.emit(67, eventType, ...payload);
520
+ }
521
+ onEvent(eventType, handlerOffset) {
522
+ return this.emit(68, eventType, handlerOffset);
523
+ }
524
+ // ── I/O ───────────────────────────────────────────────────────────────────
525
+ loadAsset(uri, assetType) {
526
+ return this.emit(80, this.parent.internString(uri), assetType);
527
+ }
528
+ playAudio(soundId, x, y, z) {
529
+ return this.emit(81, soundId, x, y, z);
530
+ }
531
+ netSync(entityId, syncTier) {
532
+ return this.emit(82, entityId, syncTier);
533
+ }
534
+ // ── Control Flow ──────────────────────────────────────────────────────────
535
+ nop() {
536
+ return this.emit(
537
+ 96
538
+ /* NOP */
539
+ );
540
+ }
541
+ jump(offset) {
542
+ return this.emit(97, offset);
543
+ }
544
+ jumpIf(offset) {
545
+ return this.emit(98, offset);
546
+ }
547
+ call(funcIdx) {
548
+ return this.emit(99, funcIdx);
549
+ }
550
+ ret() {
551
+ return this.emit(
552
+ 100
553
+ /* RETURN */
554
+ );
555
+ }
556
+ push(value) {
557
+ return this.emit(101, value);
558
+ }
559
+ pop() {
560
+ return this.emit(
561
+ 102
562
+ /* POP */
563
+ );
564
+ }
565
+ store(registerIdx) {
566
+ this.func.registerCount = Math.max(this.func.registerCount, registerIdx + 1);
567
+ return this.emit(103, registerIdx);
568
+ }
569
+ load(registerIdx) {
570
+ return this.emit(104, registerIdx);
571
+ }
572
+ halt() {
573
+ return this.emit(
574
+ 105
575
+ /* HALT */
576
+ );
577
+ }
578
+ yieldTick() {
579
+ return this.emit(
580
+ 106
581
+ /* YIELD */
582
+ );
583
+ }
584
+ timer(delayMs, handlerOffset) {
585
+ return this.emit(107, delayMs, handlerOffset);
586
+ }
587
+ // ── Arithmetic ────────────────────────────────────────────────────────────
588
+ add() {
589
+ return this.emit(
590
+ 108
591
+ /* ADD */
592
+ );
593
+ }
594
+ sub() {
595
+ return this.emit(
596
+ 109
597
+ /* SUB */
598
+ );
599
+ }
600
+ mul() {
601
+ return this.emit(
602
+ 110
603
+ /* MUL */
604
+ );
605
+ }
606
+ div() {
607
+ return this.emit(
608
+ 111
609
+ /* DIV */
610
+ );
611
+ }
612
+ // ── Comparison ────────────────────────────────────────────────────────────
613
+ cmpEq() {
614
+ return this.emit(
615
+ 128
616
+ /* CMP_EQ */
617
+ );
618
+ }
619
+ cmpLt() {
620
+ return this.emit(
621
+ 129
622
+ /* CMP_LT */
623
+ );
624
+ }
625
+ cmpGt() {
626
+ return this.emit(
627
+ 130
628
+ /* CMP_GT */
629
+ );
630
+ }
631
+ not() {
632
+ return this.emit(
633
+ 131
634
+ /* NOT */
635
+ );
636
+ }
637
+ // ── Agent Bridge ──────────────────────────────────────────────────────────
638
+ agentInvoke(agentId, actionIdx) {
639
+ return this.emit(112, agentId, actionIdx);
640
+ }
641
+ agentRead(agentId, fieldIdx) {
642
+ return this.emit(113, agentId, fieldIdx);
643
+ }
644
+ dialogShow(npcId, dialogTreeId) {
645
+ return this.emit(115, npcId, dialogTreeId);
646
+ }
647
+ questUpdate(questId, state) {
648
+ return this.emit(116, questId, state);
649
+ }
650
+ /** Get the current instruction count (useful for jump targets) */
651
+ get instructionCount() {
652
+ return this.func.instructions.length;
653
+ }
654
+ };
655
+ var ECSWorld2 = class {
656
+ constructor() {
657
+ __publicField(this, "entities", /* @__PURE__ */ new Map());
658
+ __publicField(this, "nextEntityId", 1);
659
+ __publicField(this, "archetypeIndex", /* @__PURE__ */ new Map());
660
+ }
661
+ /**
662
+ * Spawn a new entity
663
+ */
664
+ spawn(name, archetype = 0) {
665
+ const id = this.nextEntityId++;
666
+ const entity = {
667
+ id,
668
+ name,
669
+ parentId: -1,
670
+ childIds: [],
671
+ components: /* @__PURE__ */ new Map(),
672
+ traits: /* @__PURE__ */ new Set(),
673
+ alive: true,
674
+ dirty: true
675
+ };
676
+ this.entities.set(id, entity);
677
+ if (!this.archetypeIndex.has(archetype)) {
678
+ this.archetypeIndex.set(archetype, /* @__PURE__ */ new Set());
679
+ }
680
+ this.archetypeIndex.get(archetype).add(id);
681
+ return id;
682
+ }
683
+ /**
684
+ * Despawn an entity and its children
685
+ */
686
+ despawn(entityId) {
687
+ const entity = this.entities.get(entityId);
688
+ if (!entity) return false;
689
+ for (const childId of [...entity.childIds]) {
690
+ this.despawn(childId);
691
+ }
692
+ if (entity.parentId !== -1) {
693
+ const parent = this.entities.get(entity.parentId);
694
+ if (parent) {
695
+ parent.childIds = parent.childIds.filter((id) => id !== entityId);
696
+ }
697
+ }
698
+ entity.alive = false;
699
+ this.entities.delete(entityId);
700
+ return true;
701
+ }
702
+ /**
703
+ * Set a component on an entity
704
+ */
705
+ setComponent(entityId, componentType, data) {
706
+ const entity = this.entities.get(entityId);
707
+ if (!entity) return false;
708
+ entity.components.set(componentType, data);
709
+ entity.dirty = true;
710
+ return true;
711
+ }
712
+ /**
713
+ * Get a component from an entity
714
+ */
715
+ getComponent(entityId, componentType) {
716
+ const entity = this.entities.get(entityId);
717
+ if (!entity) return void 0;
718
+ return entity.components.get(componentType);
719
+ }
720
+ /**
721
+ * Remove a component from an entity
722
+ */
723
+ removeComponent(entityId, componentType) {
724
+ const entity = this.entities.get(entityId);
725
+ if (!entity) return false;
726
+ entity.dirty = true;
727
+ return entity.components.delete(componentType);
728
+ }
729
+ /**
730
+ * Set parent-child relationship
731
+ */
732
+ setParent(childId, parentId) {
733
+ const child = this.entities.get(childId);
734
+ const parent = this.entities.get(parentId);
735
+ if (!child || !parent) return false;
736
+ if (child.parentId !== -1) {
737
+ const oldParent = this.entities.get(child.parentId);
738
+ if (oldParent) {
739
+ oldParent.childIds = oldParent.childIds.filter((id) => id !== childId);
740
+ }
741
+ }
742
+ child.parentId = parentId;
743
+ parent.childIds.push(childId);
744
+ child.dirty = true;
745
+ return true;
746
+ }
747
+ /**
748
+ * Query entities by archetype mask
749
+ */
750
+ queryArchetype(mask) {
751
+ const set = this.archetypeIndex.get(mask);
752
+ return set ? [...set] : [];
753
+ }
754
+ /**
755
+ * Get entity by ID
756
+ */
757
+ getEntity(entityId) {
758
+ return this.entities.get(entityId);
759
+ }
760
+ /**
761
+ * Get all dirty entities and clear dirty flags
762
+ */
763
+ flushDirty() {
764
+ const dirty = [];
765
+ for (const entity of this.entities.values()) {
766
+ if (entity.dirty) {
767
+ dirty.push(entity);
768
+ entity.dirty = false;
769
+ }
770
+ }
771
+ return dirty;
772
+ }
773
+ /**
774
+ * Get all living entities
775
+ */
776
+ getAllEntities() {
777
+ return [...this.entities.values()];
778
+ }
779
+ /**
780
+ * Get entity count
781
+ */
782
+ get entityCount() {
783
+ return this.entities.size;
784
+ }
785
+ };
786
+ var VMStatus = /* @__PURE__ */ ((VMStatus2) => {
787
+ VMStatus2["Idle"] = "IDLE";
788
+ VMStatus2["Running"] = "RUNNING";
789
+ VMStatus2["Yielded"] = "YIELDED";
790
+ VMStatus2["Halted"] = "HALTED";
791
+ VMStatus2["Error"] = "ERROR";
792
+ return VMStatus2;
793
+ })(VMStatus || {});
794
+ var UnsupportedHostOpcodeError = class extends Error {
795
+ constructor(opcode, operands) {
796
+ const opcodeName = getOpcodeName(opcode);
797
+ const opcodeGroup = getHostOpcodeGroup(opcode);
798
+ super(
799
+ `Unsupported host opcode ${opcodeName} (${opcodeGroup}) requires a registered host callback`
800
+ );
801
+ __publicField(this, "opcode");
802
+ __publicField(this, "opcodeName");
803
+ __publicField(this, "opcodeGroup");
804
+ __publicField(this, "operands");
805
+ this.name = "UnsupportedHostOpcodeError";
806
+ this.opcode = opcode;
807
+ this.opcodeName = opcodeName;
808
+ this.opcodeGroup = opcodeGroup;
809
+ this.operands = [...operands];
810
+ }
811
+ };
812
+ var HoloVM = class {
813
+ constructor(hostCallbacks = {}) {
814
+ // Core state
815
+ __publicField(this, "bytecode", null);
816
+ __publicField(this, "world", new ECSWorld2());
817
+ // Execution state
818
+ __publicField(this, "stack", []);
819
+ __publicField(this, "callStack", []);
820
+ __publicField(this, "status", "IDLE");
821
+ __publicField(this, "tickCount", 0);
822
+ // Timer system
823
+ __publicField(this, "timers", []);
824
+ __publicField(this, "currentTimeMs", 0);
825
+ // Event queue
826
+ __publicField(this, "eventQueue", []);
827
+ // Limits
828
+ __publicField(this, "maxStackSize", 4096);
829
+ __publicField(this, "maxCallDepth", 256);
830
+ __publicField(this, "maxInstructionsPerTick", 1e4);
831
+ __publicField(this, "hostCallbacks", /* @__PURE__ */ new Map());
832
+ __publicField(this, "lastError");
833
+ this.registerHostCallbacks(hostCallbacks);
834
+ }
835
+ /**
836
+ * Load a bytecode module into the VM
837
+ */
838
+ load(bytecode) {
839
+ this.bytecode = bytecode;
840
+ this.reset();
841
+ this.initializeEntities();
842
+ }
843
+ /**
844
+ * Reset VM state without unloading bytecode
845
+ */
846
+ reset() {
847
+ this.stack = [];
848
+ this.callStack = [];
849
+ this.status = "IDLE";
850
+ this.tickCount = 0;
851
+ this.timers = [];
852
+ this.currentTimeMs = 0;
853
+ this.eventQueue = [];
854
+ this.lastError = void 0;
855
+ }
856
+ registerHostCallback(opcode, callback) {
857
+ if (!isHostOpcode(opcode)) {
858
+ throw new Error(`Opcode ${getOpcodeName(opcode)} is not a host-integration opcode`);
859
+ }
860
+ this.hostCallbacks.set(opcode, callback);
861
+ }
862
+ registerHostCallbacks(callbacks) {
863
+ for (const [opcode, callback] of Object.entries(callbacks)) {
864
+ if (callback) {
865
+ this.registerHostCallback(Number(opcode), callback);
866
+ }
867
+ }
868
+ }
869
+ /**
870
+ * Initialize entities from the bytecode's init section
871
+ */
872
+ initializeEntities() {
873
+ if (!this.bytecode) return;
874
+ for (const entityDef of this.bytecode.entities) {
875
+ const name = this.bytecode.strings[entityDef.nameIndex] ?? `entity_${entityDef.nameIndex}`;
876
+ const entityId = this.world.spawn(name, entityDef.archetype);
877
+ for (const comp of entityDef.components) {
878
+ this.world.setComponent(entityId, comp.componentType, comp.values);
879
+ }
880
+ if (entityDef.parentIndex >= 0) {
881
+ this.world.setParent(entityId, entityDef.parentIndex + 1);
882
+ }
883
+ }
884
+ }
885
+ /**
886
+ * Execute one tick of the VM (called at ~90fps)
887
+ *
888
+ * Each tick:
889
+ * 1. Process expired timers
890
+ * 2. Dispatch queued events
891
+ * 3. Resume execution from yield point (or run init)
892
+ * 4. Return dirty entities for rendering
893
+ */
894
+ tick(deltaMs) {
895
+ if (!this.bytecode) {
896
+ this.lastError = new Error("No bytecode loaded");
897
+ return {
898
+ status: "ERROR",
899
+ stackTop: null,
900
+ tickCount: this.tickCount,
901
+ entityCount: 0,
902
+ error: "No bytecode loaded"
903
+ };
904
+ }
905
+ this.tickCount++;
906
+ this.currentTimeMs += deltaMs;
907
+ this.processTimers();
908
+ this.dispatchEvents();
909
+ if (this.status === "YIELDED") {
910
+ this.status = "RUNNING";
911
+ this.executeInstructions();
912
+ } else if (this.status === "IDLE" && this.bytecode.functions.length > 0) {
913
+ this.callFunction(0);
914
+ this.executeInstructions();
915
+ }
916
+ return {
917
+ status: this.status,
918
+ stackTop: this.stack.length > 0 ? this.stack[this.stack.length - 1] : null,
919
+ tickCount: this.tickCount,
920
+ entityCount: this.world.entityCount,
921
+ error: this.status === "ERROR" ? this.lastError?.message : void 0
922
+ };
923
+ }
924
+ /**
925
+ * Main execution loop — runs until YIELD, HALT, or instruction limit
926
+ */
927
+ executeInstructions() {
928
+ if (!this.bytecode) return;
929
+ let instructionsExecuted = 0;
930
+ while (this.status === "RUNNING" && instructionsExecuted < this.maxInstructionsPerTick) {
931
+ const frame = this.currentFrame;
932
+ if (!frame) {
933
+ this.status = "HALTED";
934
+ break;
935
+ }
936
+ const func = this.bytecode.functions[frame.functionIndex];
937
+ if (!func || frame.pc >= func.instructions.length) {
938
+ this.callStack.pop();
939
+ if (this.callStack.length === 0) {
940
+ this.status = "HALTED";
941
+ }
942
+ break;
943
+ }
944
+ const instr = func.instructions[frame.pc];
945
+ frame.pc++;
946
+ instructionsExecuted++;
947
+ try {
948
+ this.executeInstruction(instr, frame);
949
+ } catch (err) {
950
+ this.status = "ERROR";
951
+ this.lastError = err instanceof Error ? err : new Error(String(err));
952
+ break;
953
+ }
954
+ if (this.status !== "RUNNING") break;
955
+ }
956
+ }
957
+ /**
958
+ * Execute a single instruction
959
+ */
960
+ executeInstruction(instr, frame) {
961
+ const op = instr.opcode;
962
+ const operands = instr.operands;
963
+ switch (op) {
964
+ // ── Entity Operations ───────────────────────────────────────────────
965
+ case 1: {
966
+ const entityType = operands[0];
967
+ const nameIdx = operands[1];
968
+ const name = this.getString(nameIdx);
969
+ const id = this.world.spawn(name, entityType);
970
+ this.push(id);
971
+ break;
972
+ }
973
+ case 2: {
974
+ const entityId = operands[0];
975
+ this.world.despawn(entityId);
976
+ break;
977
+ }
978
+ case 4: {
979
+ const entityId = operands[0];
980
+ const compType = operands[1];
981
+ const data = operands.slice(2);
982
+ this.world.setComponent(entityId, compType, data);
983
+ break;
984
+ }
985
+ case 5: {
986
+ const entityId = operands[0];
987
+ const compType = operands[1];
988
+ const data = this.world.getComponent(entityId, compType);
989
+ this.push(data ?? null);
990
+ break;
991
+ }
992
+ case 6: {
993
+ const entityId = operands[0];
994
+ const compType = operands[1];
995
+ this.world.removeComponent(entityId, compType);
996
+ break;
997
+ }
998
+ case 7: {
999
+ const childId = operands[0];
1000
+ const parentId = operands[1];
1001
+ this.world.setParent(childId, parentId);
1002
+ break;
1003
+ }
1004
+ case 8: {
1005
+ const mask = operands[0];
1006
+ const entities = this.world.queryArchetype(mask);
1007
+ this.push(entities);
1008
+ break;
1009
+ }
1010
+ // ── Spatial Operations ──────────────────────────────────────────────
1011
+ case 16: {
1012
+ const entityId = operands[0];
1013
+ const transform = {
1014
+ position: { x: operands[1], y: operands[2], z: operands[3] },
1015
+ rotation: {
1016
+ x: operands[4],
1017
+ y: operands[5],
1018
+ z: operands[6],
1019
+ w: operands[7]
1020
+ },
1021
+ scale: { x: operands[8], y: operands[9], z: operands[10] }
1022
+ };
1023
+ this.world.setComponent(entityId, 1, transform);
1024
+ break;
1025
+ }
1026
+ case 17: {
1027
+ const entityId = operands[0];
1028
+ const existing = this.world.getComponent(
1029
+ entityId,
1030
+ 1
1031
+ /* Transform */
1032
+ );
1033
+ if (existing) {
1034
+ existing.position.x += operands[1];
1035
+ existing.position.y += operands[2];
1036
+ existing.position.z += operands[3];
1037
+ this.world.setComponent(entityId, 1, existing);
1038
+ }
1039
+ break;
1040
+ }
1041
+ case 18: {
1042
+ const entityId = operands[0];
1043
+ this.world.setComponent(entityId, 1, {
1044
+ position: { x: 0, y: 0, z: 0 },
1045
+ rotation: {
1046
+ x: operands[1],
1047
+ y: operands[2],
1048
+ z: operands[3],
1049
+ w: operands[4]
1050
+ },
1051
+ scale: { x: 1, y: 1, z: 1 }
1052
+ });
1053
+ break;
1054
+ }
1055
+ case 48: {
1056
+ const entityId = operands[0];
1057
+ const geoType = operands[1];
1058
+ this.world.setComponent(entityId, 2, { type: geoType, params: {} });
1059
+ break;
1060
+ }
1061
+ case 49: {
1062
+ const entityId = operands[0];
1063
+ const material = {
1064
+ color: operands[1] ?? 16777215,
1065
+ metalness: operands[2] ?? 0,
1066
+ roughness: operands[3] ?? 0.5,
1067
+ emissive: operands[4] ?? 0,
1068
+ opacity: operands[5] ?? 1
1069
+ };
1070
+ this.world.setComponent(entityId, 3, material);
1071
+ break;
1072
+ }
1073
+ case 50: {
1074
+ const entityId = operands[0];
1075
+ operands[1] !== 0;
1076
+ const entity = this.world.getEntity(entityId);
1077
+ if (entity) entity.dirty = true;
1078
+ break;
1079
+ }
1080
+ case 52: {
1081
+ const entityId = operands[0];
1082
+ const lightType = operands[1];
1083
+ this.world.setComponent(entityId, 6, {
1084
+ type: lightType,
1085
+ params: operands.slice(2)
1086
+ });
1087
+ break;
1088
+ }
1089
+ // ── Physics Operations ──────────────────────────────────────────────
1090
+ case 32: {
1091
+ const entityId = operands[0];
1092
+ const rb = {
1093
+ mass: operands[1],
1094
+ bodyType: operands[2],
1095
+ velocity: { x: 0, y: 0, z: 0 },
1096
+ angularVelocity: { x: 0, y: 0, z: 0 }
1097
+ };
1098
+ this.world.setComponent(entityId, 4, rb);
1099
+ break;
1100
+ }
1101
+ case 33: {
1102
+ const entityId = operands[0];
1103
+ const rb = this.world.getComponent(
1104
+ entityId,
1105
+ 4
1106
+ /* RigidBody */
1107
+ );
1108
+ if (rb && rb.mass > 0) {
1109
+ const dt = 1 / 90;
1110
+ rb.velocity.x += operands[1] / rb.mass * dt;
1111
+ rb.velocity.y += operands[2] / rb.mass * dt;
1112
+ rb.velocity.z += operands[3] / rb.mass * dt;
1113
+ this.world.setComponent(entityId, 4, rb);
1114
+ }
1115
+ break;
1116
+ }
1117
+ case 34: {
1118
+ const entityId = operands[0];
1119
+ const rb = this.world.getComponent(
1120
+ entityId,
1121
+ 4
1122
+ /* RigidBody */
1123
+ );
1124
+ if (rb && rb.mass > 0) {
1125
+ rb.velocity.x += operands[1] / rb.mass;
1126
+ rb.velocity.y += operands[2] / rb.mass;
1127
+ rb.velocity.z += operands[3] / rb.mass;
1128
+ this.world.setComponent(entityId, 4, rb);
1129
+ }
1130
+ break;
1131
+ }
1132
+ case 35: {
1133
+ const entityId = operands[0];
1134
+ const rb = this.world.getComponent(
1135
+ entityId,
1136
+ 4
1137
+ /* RigidBody */
1138
+ );
1139
+ if (rb) {
1140
+ rb.velocity = {
1141
+ x: operands[1],
1142
+ y: operands[2],
1143
+ z: operands[3]
1144
+ };
1145
+ this.world.setComponent(entityId, 4, rb);
1146
+ }
1147
+ break;
1148
+ }
1149
+ case 38: {
1150
+ this.world.setComponent(0, 255, { x: operands[0], y: operands[1], z: operands[2] });
1151
+ break;
1152
+ }
1153
+ // ── Trait Operations ────────────────────────────────────────────────
1154
+ case 64: {
1155
+ const entityId = operands[0];
1156
+ const traitId = operands[1];
1157
+ const entity = this.world.getEntity(entityId);
1158
+ if (entity) {
1159
+ entity.traits.add(traitId);
1160
+ entity.dirty = true;
1161
+ }
1162
+ break;
1163
+ }
1164
+ case 65: {
1165
+ const entityId = operands[0];
1166
+ const traitId = operands[1];
1167
+ const entity = this.world.getEntity(entityId);
1168
+ if (entity) {
1169
+ entity.traits.delete(traitId);
1170
+ entity.dirty = true;
1171
+ }
1172
+ break;
1173
+ }
1174
+ case 67: {
1175
+ const eventType = operands[0];
1176
+ const payload = operands.slice(1);
1177
+ this.eventQueue.push({ eventType, payload });
1178
+ break;
1179
+ }
1180
+ // ── Control Flow ────────────────────────────────────────────────────
1181
+ case 96:
1182
+ break;
1183
+ case 97: {
1184
+ frame.pc = operands[0];
1185
+ break;
1186
+ }
1187
+ case 98: {
1188
+ const condition = this.pop();
1189
+ if (condition) {
1190
+ frame.pc = operands[0];
1191
+ }
1192
+ break;
1193
+ }
1194
+ case 99: {
1195
+ const funcIdx = operands[0];
1196
+ this.callFunction(funcIdx);
1197
+ break;
1198
+ }
1199
+ case 100: {
1200
+ this.callStack.pop();
1201
+ if (this.callStack.length === 0) {
1202
+ this.status = "HALTED";
1203
+ }
1204
+ break;
1205
+ }
1206
+ case 101: {
1207
+ this.push(operands[0]);
1208
+ break;
1209
+ }
1210
+ case 102: {
1211
+ this.pop();
1212
+ break;
1213
+ }
1214
+ case 103: {
1215
+ const regIdx = operands[0];
1216
+ const value = this.pop();
1217
+ if (regIdx < frame.registers.length) {
1218
+ frame.registers[regIdx] = value;
1219
+ }
1220
+ break;
1221
+ }
1222
+ case 104: {
1223
+ const regIdx = operands[0];
1224
+ if (regIdx < frame.registers.length) {
1225
+ this.push(frame.registers[regIdx]);
1226
+ } else {
1227
+ this.push(null);
1228
+ }
1229
+ break;
1230
+ }
1231
+ case 105: {
1232
+ this.status = "HALTED";
1233
+ break;
1234
+ }
1235
+ case 106: {
1236
+ this.status = "YIELDED";
1237
+ break;
1238
+ }
1239
+ case 107: {
1240
+ const delayMs = operands[0];
1241
+ const handlerFunc = operands[1];
1242
+ this.timers.push({
1243
+ triggerTimeMs: this.currentTimeMs + delayMs,
1244
+ handlerFunctionIndex: handlerFunc
1245
+ });
1246
+ break;
1247
+ }
1248
+ // ── Arithmetic ──────────────────────────────────────────────────────
1249
+ case 108: {
1250
+ const b = this.pop();
1251
+ const a = this.pop();
1252
+ this.push((a ?? 0) + (b ?? 0));
1253
+ break;
1254
+ }
1255
+ case 109: {
1256
+ const b = this.pop();
1257
+ const a = this.pop();
1258
+ this.push((a ?? 0) - (b ?? 0));
1259
+ break;
1260
+ }
1261
+ case 110: {
1262
+ const b = this.pop();
1263
+ const a = this.pop();
1264
+ this.push((a ?? 0) * (b ?? 0));
1265
+ break;
1266
+ }
1267
+ case 111: {
1268
+ const b = this.pop();
1269
+ const a = this.pop();
1270
+ this.push(b !== 0 ? (a ?? 0) / b : 0);
1271
+ break;
1272
+ }
1273
+ // ── Comparison ──────────────────────────────────────────────────────
1274
+ case 128: {
1275
+ const b = this.pop();
1276
+ const a = this.pop();
1277
+ this.push(a === b ? 1 : 0);
1278
+ break;
1279
+ }
1280
+ case 129: {
1281
+ const b = this.pop();
1282
+ const a = this.pop();
1283
+ this.push(a < b ? 1 : 0);
1284
+ break;
1285
+ }
1286
+ case 130: {
1287
+ const b = this.pop();
1288
+ const a = this.pop();
1289
+ this.push(a > b ? 1 : 0);
1290
+ break;
1291
+ }
1292
+ case 131: {
1293
+ const val = this.pop();
1294
+ this.push(val ? 0 : 1);
1295
+ break;
1296
+ }
1297
+ // ── Agent Bridge (stubs — filled in by host integration) ────────────
1298
+ case 112:
1299
+ case 113:
1300
+ case 114:
1301
+ case 115:
1302
+ case 116:
1303
+ this.executeHostOpcode(op, operands);
1304
+ break;
1305
+ // ── I/O & Networking (host integration) ─────────────────────────────
1306
+ case 80:
1307
+ case 81:
1308
+ case 82:
1309
+ case 83:
1310
+ case 84:
1311
+ case 85:
1312
+ case 86:
1313
+ this.executeHostOpcode(op, operands);
1314
+ break;
1315
+ // ── Spatial queries (host integration) ───────────────────────────────
1316
+ case 20:
1317
+ case 21:
1318
+ case 22:
1319
+ case 23:
1320
+ case 24:
1321
+ this.executeHostOpcode(op, operands);
1322
+ break;
1323
+ }
1324
+ }
1325
+ // ── Stack operations ──────────────────────────────────────────────────────
1326
+ push(value) {
1327
+ if (this.stack.length >= this.maxStackSize) {
1328
+ this.status = "ERROR";
1329
+ return;
1330
+ }
1331
+ this.stack.push(value);
1332
+ }
1333
+ pop() {
1334
+ return this.stack.pop() ?? null;
1335
+ }
1336
+ // ── Call frame management ─────────────────────────────────────────────────
1337
+ get currentFrame() {
1338
+ return this.callStack[this.callStack.length - 1];
1339
+ }
1340
+ callFunction(funcIdx) {
1341
+ if (!this.bytecode) return;
1342
+ if (this.callStack.length >= this.maxCallDepth) {
1343
+ this.status = "ERROR";
1344
+ return;
1345
+ }
1346
+ const func = this.bytecode.functions[funcIdx];
1347
+ if (!func) {
1348
+ this.status = "ERROR";
1349
+ return;
1350
+ }
1351
+ const frame = {
1352
+ functionIndex: funcIdx,
1353
+ pc: 0,
1354
+ registers: new Array(func.registerCount).fill(null),
1355
+ stackBase: this.stack.length
1356
+ };
1357
+ this.callStack.push(frame);
1358
+ this.status = "RUNNING";
1359
+ }
1360
+ executeHostOpcode(opcode, operands) {
1361
+ const callback = this.hostCallbacks.get(opcode);
1362
+ if (!callback) {
1363
+ throw new UnsupportedHostOpcodeError(opcode, operands);
1364
+ }
1365
+ const result = callback({
1366
+ opcode,
1367
+ opcodeName: getOpcodeName(opcode),
1368
+ opcodeGroup: getHostOpcodeGroup(opcode),
1369
+ operands: [...operands],
1370
+ tickCount: this.tickCount,
1371
+ currentTimeMs: this.currentTimeMs,
1372
+ world: this.world,
1373
+ vm: this,
1374
+ resolveString: (index) => this.getString(index)
1375
+ });
1376
+ if (!HOST_OUTPUT_OPCODES.has(opcode)) {
1377
+ return;
1378
+ }
1379
+ if (result === void 0) {
1380
+ throw new Error(`Host callback for ${getOpcodeName(opcode)} must return a VM operand`);
1381
+ }
1382
+ this.push(result);
1383
+ }
1384
+ // ── Timer processing ──────────────────────────────────────────────────────
1385
+ processTimers() {
1386
+ const expired = [];
1387
+ this.timers = this.timers.filter((t) => {
1388
+ if (t.triggerTimeMs <= this.currentTimeMs) {
1389
+ expired.push(t);
1390
+ return false;
1391
+ }
1392
+ return true;
1393
+ });
1394
+ for (const timer of expired) {
1395
+ this.callFunction(timer.handlerFunctionIndex);
1396
+ this.executeInstructions();
1397
+ }
1398
+ }
1399
+ // ── Event dispatch ────────────────────────────────────────────────────────
1400
+ dispatchEvents() {
1401
+ if (!this.bytecode) return;
1402
+ const events = [...this.eventQueue];
1403
+ this.eventQueue = [];
1404
+ for (const event of events) {
1405
+ for (const binding of this.bytecode.events) {
1406
+ if (binding.eventType === event.eventType) {
1407
+ for (const p of event.payload) {
1408
+ this.push(p);
1409
+ }
1410
+ this.callFunction(binding.handlerFunctionIndex);
1411
+ this.executeInstructions();
1412
+ }
1413
+ }
1414
+ }
1415
+ }
1416
+ // ── Utility ───────────────────────────────────────────────────────────────
1417
+ getString(index) {
1418
+ if (!this.bytecode) return "";
1419
+ return this.bytecode.strings[index] ?? `str_${index}`;
1420
+ }
1421
+ /**
1422
+ * Get current VM status
1423
+ */
1424
+ getStatus() {
1425
+ return this.status;
1426
+ }
1427
+ /**
1428
+ * Get current stack snapshot (for debugging)
1429
+ */
1430
+ getStack() {
1431
+ return [...this.stack];
1432
+ }
1433
+ /**
1434
+ * Get the tick count
1435
+ */
1436
+ getTickCount() {
1437
+ return this.tickCount;
1438
+ }
1439
+ /**
1440
+ * Get the last execution error, preserving typed host-integration failures.
1441
+ */
1442
+ getLastError() {
1443
+ return this.lastError;
1444
+ }
1445
+ /**
1446
+ * Queue an external event (e.g., from user input or network)
1447
+ */
1448
+ queueEvent(eventType, ...payload) {
1449
+ this.eventQueue.push({ eventType, payload });
1450
+ }
1451
+ };
1452
+ var HOST_OPCODE_GROUPS = /* @__PURE__ */ new Map([
1453
+ [112, "agent"],
1454
+ [113, "agent"],
1455
+ [114, "agent"],
1456
+ [115, "agent"],
1457
+ [116, "agent"],
1458
+ [80, "io"],
1459
+ [81, "io"],
1460
+ [82, "io"],
1461
+ [83, "io"],
1462
+ [84, "io"],
1463
+ [85, "io"],
1464
+ [86, "io"],
1465
+ [20, "spatial"],
1466
+ [21, "spatial"],
1467
+ [22, "spatial"],
1468
+ [23, "spatial"],
1469
+ [24, "spatial"]
1470
+ ]);
1471
+ var HOST_OUTPUT_OPCODES = /* @__PURE__ */ new Set([
1472
+ 112,
1473
+ 113,
1474
+ 80,
1475
+ 84,
1476
+ 85,
1477
+ 20,
1478
+ 21,
1479
+ 22,
1480
+ 23,
1481
+ 24
1482
+ /* GET_ZONE */
1483
+ ]);
1484
+ function isHostOpcode(opcode) {
1485
+ return HOST_OPCODE_GROUPS.has(opcode);
1486
+ }
1487
+ function getHostOpcodeGroup(opcode) {
1488
+ return HOST_OPCODE_GROUPS.get(opcode) ?? "io";
1489
+ }
1490
+ exports$1.AssetType = AssetType;
1491
+ exports$1.BodyType = BodyType2;
1492
+ exports$1.ColliderShape = ColliderShape;
1493
+ exports$1.ComponentType = ComponentType3;
1494
+ exports$1.ECSWorld = ECSWorld2;
1495
+ exports$1.GeometryType = GeometryType2;
1496
+ exports$1.HOLOB_MAGIC = HOLOB_MAGIC;
1497
+ exports$1.HOLOB_VERSION = HOLOB_VERSION;
1498
+ exports$1.HoloBytecodeBuilder = HoloBytecodeBuilder2;
1499
+ exports$1.HoloFunctionBuilder = HoloFunctionBuilder;
1500
+ exports$1.HoloOpCode = HoloOpCode;
1501
+ exports$1.HoloVM = HoloVM;
1502
+ exports$1.HolobFlags = HolobFlags;
1503
+ exports$1.LightType = LightType2;
1504
+ exports$1.SyncTier = SyncTier;
1505
+ exports$1.UnsupportedHostOpcodeError = UnsupportedHostOpcodeError;
1506
+ exports$1.VMStatus = VMStatus;
1507
+ exports$1.ValueType = ValueType;
1508
+ exports$1.getOpcodeFamily = getOpcodeFamily;
1509
+ exports$1.getOpcodeName = getOpcodeName;
1510
+ exports$1.isControlFlow = isControlFlow;
1511
+ exports$1.isHostOpcode = isHostOpcode;
1512
+ }
1513
+ });
1514
+
131
1515
  // src/composition/CompositionParser.ts
132
1516
  function getProp(props, key2) {
133
1517
  if (!props) return void 0;
@@ -6473,6 +7857,7 @@ var CircuitBreakerRegistry = class {
6473
7857
  };
6474
7858
 
6475
7859
  // src/compiler/ReferenceExporters.ts
7860
+ init_Native2DCompiler();
6476
7861
  var ReferenceExporter = class {
6477
7862
  constructor(options = {}) {
6478
7863
  this.options = {
@@ -6853,6 +8238,20 @@ var WASMReferenceExporter = class extends ReferenceExporter {
6853
8238
  };
6854
8239
  }
6855
8240
  };
8241
+ var Native2DReferenceExporter = class extends ReferenceExporter {
8242
+ export(composition) {
8243
+ const output = new Native2DCompiler().compile(composition, "", void 0, {
8244
+ format: "html"
8245
+ });
8246
+ return {
8247
+ target: "native-2d",
8248
+ output,
8249
+ format: "text",
8250
+ warnings: [],
8251
+ usedFallback: true
8252
+ };
8253
+ }
8254
+ };
6856
8255
  var ReferenceExporterRegistry = class {
6857
8256
  constructor() {
6858
8257
  this.exporters = /* @__PURE__ */ new Map();
@@ -6864,6 +8263,7 @@ var ReferenceExporterRegistry = class {
6864
8263
  this.exporters.set("webgpu", new WebGPUReferenceExporter());
6865
8264
  this.exporters.set("r3f", new R3FReferenceExporter());
6866
8265
  this.exporters.set("babylon", new BabylonReferenceExporter());
8266
+ this.exporters.set("native-2d", new Native2DReferenceExporter());
6867
8267
  this.exporters.set("openxr", new OpenXRReferenceExporter());
6868
8268
  this.exporters.set("vrchat", new VRChatReferenceExporter());
6869
8269
  this.exporters.set("ios", new IOSReferenceExporter());
@@ -23376,7 +24776,7 @@ button refreshBtn {
23376
24776
 
23377
24777
  // src/barrel/runtime-env.ts
23378
24778
  async function createHoloScriptEnvironment() {
23379
- const { HoloScriptRuntime } = await import('./HoloScriptRuntime-3URVTKPJ.js');
24779
+ const { HoloScriptRuntime } = await import('./HoloScriptRuntime-2DDYOPOR.js');
23380
24780
  return {
23381
24781
  parser: new HoloScriptParser(),
23382
24782
  runtime: new HoloScriptRuntime(),
@@ -33495,71 +34895,6 @@ function calculateMedian(numbers) {
33495
34895
  const mid = Math.floor(sorted.length / 2);
33496
34896
  return sorted.length % 2 === 0 ? (sorted[mid - 1] + sorted[mid]) / 2 : sorted[mid];
33497
34897
  }
33498
- var requirePeer = createRequire(import.meta.url);
33499
- var peerCache = /* @__PURE__ */ new Map();
33500
- function loadPeer(specifier) {
33501
- const cached = peerCache.get(specifier);
33502
- if (cached) return cached;
33503
- let mod;
33504
- try {
33505
- mod = requirePeer(specifier);
33506
- } catch (err) {
33507
- const e = err;
33508
- const pkg = specifier.startsWith("@") ? specifier.split("/").slice(0, 2).join("/") : specifier.split("/")[0];
33509
- if (e && (e.code === "ERR_MODULE_NOT_FOUND" || e.code === "MODULE_NOT_FOUND")) {
33510
- throw new Error(
33511
- `@holoscript/core: optional peer "${pkg}" is required to use this symbol but is not installed. Run \`npm install ${pkg}\` (or your package manager's equivalent) to enable it. The core parser and compiler surface work without it.`
33512
- );
33513
- }
33514
- throw err;
33515
- }
33516
- peerCache.set(specifier, mod);
33517
- return mod;
33518
- }
33519
- function resolveSymbol(specifier, name) {
33520
- const mod = loadPeer(specifier);
33521
- if (!(name in mod)) {
33522
- const pkg = specifier.startsWith("@") ? specifier.split("/").slice(0, 2).join("/") : specifier.split("/")[0];
33523
- throw new Error(
33524
- `@holoscript/core: symbol "${name}" was not found in optional peer "${specifier}" (package "${pkg}"). The installed peer version may be incompatible with this @holoscript/core release.`
33525
- );
33526
- }
33527
- return mod[name];
33528
- }
33529
- function lazyPeerSymbol(specifier, name) {
33530
- const target = function lazyPeerProxyTarget() {
33531
- };
33532
- let resolved;
33533
- const real = () => {
33534
- if (resolved === void 0) resolved = resolveSymbol(specifier, name);
33535
- return resolved;
33536
- };
33537
- return new Proxy(target, {
33538
- apply(_t, thisArg, args) {
33539
- return Reflect.apply(real(), thisArg, args);
33540
- },
33541
- construct(_t, args, newTarget) {
33542
- return Reflect.construct(real(), args, newTarget);
33543
- },
33544
- get(_t, prop) {
33545
- const r = real();
33546
- const v = Reflect.get(r, prop, r);
33547
- return typeof v === "function" ? v.bind(r) : v;
33548
- },
33549
- has(_t, prop) {
33550
- return Reflect.has(real(), prop);
33551
- },
33552
- getPrototypeOf() {
33553
- return Reflect.getPrototypeOf(real());
33554
- },
33555
- ownKeys() {
33556
- return Reflect.ownKeys(real());
33557
- },
33558
- getOwnPropertyDescriptor(_t, prop) {
33559
- return Reflect.getOwnPropertyDescriptor(real(), prop);
33560
- }
33561
- });
33562
- }
33563
34898
 
33564
34899
  // src/barrel/compiler-plugins-crypto.ts
33565
34900
  init_CompilerBase();
@@ -33571,7 +34906,7 @@ var GeometryType;
33571
34906
  var BodyType;
33572
34907
  var LightType;
33573
34908
  try {
33574
- const holoVm = __require("@holoscript/holo-vm");
34909
+ const holoVm = require_dist();
33575
34910
  HoloBytecodeBuilder = holoVm.HoloBytecodeBuilder;
33576
34911
  ComponentType2 = holoVm.ComponentType;
33577
34912
  GeometryType = holoVm.GeometryType;