@holoscript/core 8.0.5 → 8.0.6

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 (159) hide show
  1. package/dist/{GLTFPipeline-EK3LFJKW.cjs → GLTFPipeline-PVLTKDBD.cjs} +11 -11
  2. package/dist/{GLTFPipeline-37FPRVPH.js → GLTFPipeline-QPI4I7DL.js} +7 -7
  3. package/dist/{HoloScriptRuntime-ACDFKVVH.js → HoloScriptRuntime-6ZGLUCFS.js} +3 -3
  4. package/dist/{HoloScriptRuntime-ON2OQVEF.cjs → HoloScriptRuntime-ALUASIL2.cjs} +4 -4
  5. package/dist/{chunk-V6MKC2FZ.js → chunk-2GQHTXOK.js} +3 -3
  6. package/dist/{chunk-ROHLEP2W.cjs → chunk-2J5WZLF5.cjs} +19 -19
  7. package/dist/{chunk-HKEXJUWS.cjs → chunk-2VL6SJ33.cjs} +7 -7
  8. package/dist/{chunk-YWOBW2PV.cjs → chunk-3B5NVDHJ.cjs} +18 -18
  9. package/dist/{chunk-J7XZV333.js → chunk-3B7AY37W.js} +4 -4
  10. package/dist/{chunk-LKWQNUE6.cjs → chunk-3OIZJNVT.cjs} +5 -5
  11. package/dist/{chunk-HNDK4IQU.cjs → chunk-3SBVODUP.cjs} +19 -19
  12. package/dist/{chunk-JBNDTXXV.cjs → chunk-44GM3P4G.cjs} +18 -18
  13. package/dist/{chunk-MVPBWHAC.js → chunk-4DO425P5.js} +3 -3
  14. package/dist/{chunk-ON5QSY35.cjs → chunk-4FDL7JLJ.cjs} +76 -45
  15. package/dist/{chunk-XB274MW5.cjs → chunk-5BLWXOIP.cjs} +13 -13
  16. package/dist/{chunk-QACVP4PM.js → chunk-5BQIJG3O.js} +33 -5
  17. package/dist/{chunk-XKTPFXGA.js → chunk-5IHG2LGT.js} +3 -3
  18. package/dist/{chunk-7M3PNU2M.cjs → chunk-5TIZXMED.cjs} +10 -10
  19. package/dist/{chunk-UFZZ7TSN.cjs → chunk-6DOKCECB.cjs} +20 -20
  20. package/dist/{chunk-ONDAWTW4.js → chunk-6OTFG3EB.js} +3 -3
  21. package/dist/{chunk-OJXHYNXN.js → chunk-7MVLEZB2.js} +3 -3
  22. package/dist/{chunk-5NWINHR5.cjs → chunk-A3GFOZAF.cjs} +38 -38
  23. package/dist/{chunk-OBIYPYYS.cjs → chunk-BFROVZOF.cjs} +5 -5
  24. package/dist/{chunk-UWJHCOH2.js → chunk-BKCK3IU6.js} +4 -4
  25. package/dist/{chunk-DHO2YRIM.js → chunk-C34AJIJO.js} +4 -4
  26. package/dist/{chunk-QPSKHBJP.js → chunk-CXS3DUKD.js} +12 -6
  27. package/dist/{chunk-ANXZFVY2.js → chunk-D63CGNJU.js} +3 -3
  28. package/dist/{chunk-CCATWPXM.js → chunk-DBPGNHFS.js} +4 -4
  29. package/dist/{chunk-6DO5IZ5N.cjs → chunk-DCE3LDO3.cjs} +36 -6
  30. package/dist/{chunk-BOVPWH4H.js → chunk-DPZXVDGM.js} +3 -3
  31. package/dist/{chunk-FXKAW7ZO.cjs → chunk-DQRQZB33.cjs} +3 -3
  32. package/dist/{chunk-QD32ADK6.js → chunk-E64LOLJU.js} +4 -4
  33. package/dist/{chunk-IUTY5WQ2.cjs → chunk-E767PVC6.cjs} +5 -5
  34. package/dist/{chunk-CMT5NMMS.js → chunk-EK7L4DW7.js} +4 -4
  35. package/dist/{chunk-D3STJ56J.js → chunk-F63LYRVE.js} +4 -4
  36. package/dist/{chunk-OBP5REIV.js → chunk-GCYR3D2K.js} +5 -5
  37. package/dist/{chunk-ZMCVKFXI.cjs → chunk-H5PUZHJV.cjs} +95 -9
  38. package/dist/{chunk-2X7NGX3M.js → chunk-HBEN5TQR.js} +4 -4
  39. package/dist/{chunk-2IWC4FP7.cjs → chunk-HBLKLLG5.cjs} +10 -10
  40. package/dist/{chunk-NCWCUZNS.cjs → chunk-IBXT6UP3.cjs} +14 -14
  41. package/dist/{chunk-DAJXW4KX.js → chunk-IIUFMUTV.js} +3 -3
  42. package/dist/{chunk-OH2FAIVU.js → chunk-IS4AEGLU.js} +4 -4
  43. package/dist/{chunk-PY37LNDP.js → chunk-ISG3TQ2O.js} +4 -4
  44. package/dist/{chunk-ADADVMXY.js → chunk-ISM4NX6N.js} +2 -2
  45. package/dist/{chunk-WRKUDAZJ.js → chunk-JEB5UU3E.js} +3 -3
  46. package/dist/{chunk-KMC6CQH3.js → chunk-K5UGRXKR.js} +5 -5
  47. package/dist/{chunk-OMXII44L.js → chunk-KDZRD6EI.js} +3 -3
  48. package/dist/{chunk-ZU7NIRT6.js → chunk-LAUFLPB6.js} +3 -3
  49. package/dist/{chunk-JC5YBPSF.cjs → chunk-LY4DMQOW.cjs} +5 -5
  50. package/dist/{chunk-KQCN6AKJ.cjs → chunk-N5YOAFNA.cjs} +5 -5
  51. package/dist/{chunk-WQKJSGVS.js → chunk-NDUX553L.js} +36 -6
  52. package/dist/{chunk-5H2G27PK.cjs → chunk-NE5CZ2NC.cjs} +38 -38
  53. package/dist/{chunk-4SDKXQ4C.js → chunk-NPDNFPTU.js} +4 -4
  54. package/dist/{chunk-S3MDHNKB.cjs → chunk-NTGBEMYL.cjs} +5 -5
  55. package/dist/{chunk-CR4FMIWL.cjs → chunk-NTJZJ5IP.cjs} +14 -14
  56. package/dist/{chunk-3WZEJHUQ.cjs → chunk-OXGPGQXN.cjs} +7 -7
  57. package/dist/{chunk-YN2YWTXW.js → chunk-P4AIF7OQ.js} +4 -4
  58. package/dist/{chunk-YVD3CSO3.js → chunk-P52PPB5R.js} +4 -4
  59. package/dist/{chunk-YT5L3B57.cjs → chunk-PVWNU4QT.cjs} +5 -5
  60. package/dist/{chunk-KKP7JKN4.cjs → chunk-QWAR3GY6.cjs} +12 -6
  61. package/dist/{chunk-UWXE23BT.cjs → chunk-QWSB553J.cjs} +4 -4
  62. package/dist/{chunk-GYZE55MO.js → chunk-RCZHLCX2.js} +3 -3
  63. package/dist/{chunk-FFAOS5HQ.js → chunk-RXU4PQKA.js} +6 -6
  64. package/dist/{chunk-5KVXXUD4.js → chunk-S6OVFUXD.js} +3 -3
  65. package/dist/{chunk-TWUXUCEW.cjs → chunk-TCBJMNXS.cjs} +38 -38
  66. package/dist/{chunk-J6M4FPK5.js → chunk-TDCJ7YPA.js} +3 -3
  67. package/dist/{chunk-4V2E7U7Q.cjs → chunk-TFUMBR7G.cjs} +7 -7
  68. package/dist/{chunk-XIVIE43A.cjs → chunk-TFWYKOOB.cjs} +5 -5
  69. package/dist/{chunk-7H33U5SM.cjs → chunk-TJIMBJ6L.cjs} +2 -2
  70. package/dist/{chunk-QXH7QDSZ.js → chunk-U36W76U7.js} +3 -3
  71. package/dist/{chunk-E4M5OAYO.js → chunk-ULXWSPCK.js} +38 -7
  72. package/dist/{chunk-UO4WPSGQ.js → chunk-VATGR4EM.js} +95 -10
  73. package/dist/{chunk-6FH72EB2.cjs → chunk-VFKXK4GR.cjs} +16 -16
  74. package/dist/{chunk-LHAXPADA.js → chunk-VHAONJBY.js} +4 -4
  75. package/dist/{chunk-YN6V7R3L.cjs → chunk-WOH6LKYT.cjs} +5 -5
  76. package/dist/{chunk-R24NNAEG.js → chunk-X4EBCG4K.js} +4 -4
  77. package/dist/{chunk-AVJHHUC5.cjs → chunk-X7LYK5TX.cjs} +21 -21
  78. package/dist/{chunk-FYSPZT4V.cjs → chunk-X7QB5PL5.cjs} +7 -7
  79. package/dist/{chunk-IUDGEUDO.cjs → chunk-XHZCF3AS.cjs} +13 -13
  80. package/dist/{chunk-PJGFU5DN.cjs → chunk-YAPPQYJH.cjs} +5 -5
  81. package/dist/{chunk-U44IKGG7.cjs → chunk-YG3OAHJZ.cjs} +30 -30
  82. package/dist/{chunk-I5CDNPPE.cjs → chunk-YTR32ZEB.cjs} +80 -49
  83. package/dist/{chunk-UJXISJBN.js → chunk-YU5RJQPE.js} +3 -3
  84. package/dist/{chunk-IWC5DM2M.cjs → chunk-ZXZ2AL2J.cjs} +14 -14
  85. package/dist/compiler/agent-inference.cjs +6 -6
  86. package/dist/compiler/agent-inference.js +2 -2
  87. package/dist/compiler/android-xr.cjs +6 -6
  88. package/dist/compiler/android-xr.js +4 -4
  89. package/dist/compiler/android.cjs +5 -5
  90. package/dist/compiler/android.js +3 -3
  91. package/dist/compiler/ar.cjs +5 -5
  92. package/dist/compiler/ar.js +3 -3
  93. package/dist/compiler/babylon.cjs +5 -5
  94. package/dist/compiler/babylon.js +4 -4
  95. package/dist/compiler/business-quest.cjs +9 -9
  96. package/dist/compiler/business-quest.js +1 -1
  97. package/dist/compiler/context.cjs +5 -5
  98. package/dist/compiler/context.js +2 -2
  99. package/dist/compiler/domain-block-utils.cjs +152 -152
  100. package/dist/compiler/domain-block-utils.js +3 -3
  101. package/dist/compiler/dtdl.cjs +6 -6
  102. package/dist/compiler/dtdl.js +3 -3
  103. package/dist/compiler/gltf-pipeline.cjs +8 -8
  104. package/dist/compiler/gltf-pipeline.js +1 -1
  105. package/dist/compiler/godot.cjs +5 -5
  106. package/dist/compiler/godot.js +4 -4
  107. package/dist/compiler/incremental.cjs +7 -7
  108. package/dist/compiler/incremental.js +2 -2
  109. package/dist/compiler/index.cjs +375 -185
  110. package/dist/compiler/index.js +236 -57
  111. package/dist/compiler/ios.cjs +5 -5
  112. package/dist/compiler/ios.js +3 -3
  113. package/dist/compiler/llm-provider-capabilities.cjs +5 -5
  114. package/dist/compiler/llm-provider-capabilities.js +2 -2
  115. package/dist/compiler/multi-layer.cjs +7 -7
  116. package/dist/compiler/multi-layer.js +6 -6
  117. package/dist/compiler/openxr.cjs +5 -5
  118. package/dist/compiler/openxr.js +4 -4
  119. package/dist/compiler/playcanvas.cjs +5 -5
  120. package/dist/compiler/playcanvas.js +4 -4
  121. package/dist/compiler/r3f.cjs +10 -10
  122. package/dist/compiler/r3f.js +5 -5
  123. package/dist/compiler/sdf.cjs +6 -6
  124. package/dist/compiler/sdf.js +4 -4
  125. package/dist/compiler/state.cjs +5 -5
  126. package/dist/compiler/state.js +3 -3
  127. package/dist/compiler/trait-composition.cjs +6 -6
  128. package/dist/compiler/trait-composition.js +2 -2
  129. package/dist/compiler/unity.cjs +5 -5
  130. package/dist/compiler/unity.js +4 -4
  131. package/dist/compiler/unreal.cjs +6 -6
  132. package/dist/compiler/unreal.js +4 -4
  133. package/dist/compiler/urdf.cjs +13 -13
  134. package/dist/compiler/urdf.js +4 -4
  135. package/dist/compiler/usd-physics.cjs +6 -6
  136. package/dist/compiler/usd-physics.js +3 -3
  137. package/dist/compiler/visionos.cjs +5 -5
  138. package/dist/compiler/visionos.js +4 -4
  139. package/dist/compiler/vrchat.cjs +6 -6
  140. package/dist/compiler/vrchat.js +4 -4
  141. package/dist/compiler/vrr.cjs +6 -6
  142. package/dist/compiler/vrr.js +4 -4
  143. package/dist/compiler/wasm.cjs +9 -9
  144. package/dist/compiler/wasm.js +4 -4
  145. package/dist/compiler/webgpu.cjs +5 -5
  146. package/dist/compiler/webgpu.js +4 -4
  147. package/dist/debugger.cjs +4 -4
  148. package/dist/debugger.js +2 -2
  149. package/dist/index.cjs +570 -1940
  150. package/dist/index.js +86 -1456
  151. package/dist/reconstruction/index.cjs +31 -31
  152. package/dist/reconstruction/index.js +2 -2
  153. package/dist/runtime.cjs +14 -6
  154. package/dist/runtime.js +2 -2
  155. package/dist/traits/botanical-lotus.cjs +52 -48
  156. package/dist/traits/botanical-lotus.js +2 -2
  157. package/dist/traits/index.cjs +481 -473
  158. package/dist/traits/index.js +12 -8
  159. package/package.json +40 -40
package/dist/index.js CHANGED
@@ -1,91 +1,91 @@
1
- export { GLTFPipeline, createGLTFPipeline, generateScaleNormalMap, generateScaleTexture } from './chunk-KMC6CQH3.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-OJXHYNXN.js';
1
+ export { GLTFPipeline, createGLTFPipeline, generateScaleNormalMap, generateScaleTexture } from './chunk-K5UGRXKR.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-7MVLEZB2.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-OBP5REIV.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-GCYR3D2K.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_Native2DCompiler, init_A2AAgentCardCompiler, init_NIRCompiler, Native2DCompiler, GaussianSplattingCompiler, NIRCompiler, A2AAgentCardCompiler, USDZPipeline } from './chunk-WQKJSGVS.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-WQKJSGVS.js';
8
+ import { init_ThreeJSCompiler, init_Native2DCompiler, init_A2AAgentCardCompiler, init_NIRCompiler, Native2DCompiler, CodeEditorCompiler, GaussianSplattingCompiler, NIRCompiler, A2AAgentCardCompiler, USDZPipeline } from './chunk-NDUX553L.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-NDUX553L.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';
13
- export { AgentInferenceExportTarget_default as AgentInferenceExportTarget } from './chunk-V6MKC2FZ.js';
13
+ export { AgentInferenceExportTarget_default as AgentInferenceExportTarget } from './chunk-2GQHTXOK.js';
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-ONDAWTW4.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-6OTFG3EB.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
21
  import './chunk-YQELFNJV.js';
22
22
  import './chunk-FHP6LXJS.js';
23
- import { IncrementalCompiler } from './chunk-GYZE55MO.js';
24
- export { IncrementalCompiler, TraitDependencyGraph, createIncrementalCompiler, globalTraitGraph } from './chunk-GYZE55MO.js';
23
+ import { IncrementalCompiler } from './chunk-RCZHLCX2.js';
24
+ export { IncrementalCompiler, TraitDependencyGraph, createIncrementalCompiler, globalTraitGraph } from './chunk-RCZHLCX2.js';
25
25
  export { hololand_exports as hololand } from './chunk-JD7CIZ33.js';
26
26
  export { CompositionTestRunner, DEFAULT_STDLIB_POLICY, PROTOCOL_CONSTANTS, TEST_TRAIT, buildStdlibPermissionScopeDiff, calculateRevenueDistribution, checkLicenseCompatibility, createStdlibActions, ethToWei, evaluateStdlibPermissionScopePolicy, findExtraPermissionScopes, findMissingRequiredPermissionScopes, formatRevenueDistribution, isPathAllowed, isValidPermissionScopeName, normalizePermissionScopeName, parseHostFromUrl, redactStdlibPermissionPreview, registerStdlib, resolveImportChain, resolveRepoRelativePath, stdlibPermissionPreviewHasPublicLeak, testHandler, toStringArray, truncateText, weiToEth } from './chunk-ZZ7RO2UQ.js';
27
27
  export { AsyncFunctionHandler, ErrorBoundary, ExportImportHandler, InteropContext, TypeScriptTypeLoader } from './chunk-5JEU52DW.js';
28
28
  export { ABSORB_TRAIT, AbsorbProcessor, HOT_RELOAD_TRAIT, HotReloadWatcher, SCRIPT_TEST_TRAIT, ScriptTestRunner } from './chunk-2M2DPHKB.js';
29
29
  import { computeContentHash } from './chunk-4R6SBXDB.js';
30
30
  export { classifyPublishMode, computeContentHash, extractImports, generateProvenance } from './chunk-4R6SBXDB.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';
35
- import { init_DTDLCompiler, DTDLCompiler } from './chunk-J6M4FPK5.js';
36
- export { DTDLCompiler, DTDL_TRAIT_COMPONENTS } from './chunk-J6M4FPK5.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';
43
- import { init_StateCompiler, StateCompiler } from './chunk-ANXZFVY2.js';
44
- import { TraitCompositionCompiler } from './chunk-XKTPFXGA.js';
45
- export { TraitCompositionCompiler } from './chunk-XKTPFXGA.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-E4M5OAYO.js';
51
- export { ENVIRONMENT_PRESETS, R3FCompiler, registerAllPresets } from './chunk-E4M5OAYO.js';
31
+ import { init_WASMCompiler, WASMCompiler } from './chunk-P52PPB5R.js';
32
+ export { WASMCompiler, compileASTToWASM, compileToWASM, createWASMCompiler } from './chunk-P52PPB5R.js';
33
+ import { init_WebGPUCompiler, WebGPUCompiler } from './chunk-EK7L4DW7.js';
34
+ export { WebGPUCompiler } from './chunk-EK7L4DW7.js';
35
+ import { init_DTDLCompiler, DTDLCompiler } from './chunk-TDCJ7YPA.js';
36
+ export { DTDLCompiler, DTDL_TRAIT_COMPONENTS } from './chunk-TDCJ7YPA.js';
37
+ import { init_URDFCompiler, URDFCompiler } from './chunk-X4EBCG4K.js';
38
+ export { URDFCompiler, compileForGazebo, compileForROS2, compileToURDF, createURDFCompiler, generateControllersYaml, generateROS2LaunchFile } from './chunk-X4EBCG4K.js';
39
+ import { USDPhysicsCompiler } from './chunk-VHAONJBY.js';
40
+ export { USDPhysicsCompiler, compileForIsaacSim, compileToUSDPhysics } from './chunk-VHAONJBY.js';
41
+ import { init_SDFCompiler, SDFCompiler } from './chunk-IS4AEGLU.js';
42
+ export { SDFCompiler } from './chunk-IS4AEGLU.js';
43
+ import { init_StateCompiler, StateCompiler } from './chunk-D63CGNJU.js';
44
+ import { TraitCompositionCompiler } from './chunk-5IHG2LGT.js';
45
+ export { TraitCompositionCompiler } from './chunk-5IHG2LGT.js';
46
+ import { init_UnrealCompiler, UnrealCompiler } from './chunk-F63LYRVE.js';
47
+ export { UnrealCompiler, compileToUnreal } from './chunk-F63LYRVE.js';
48
+ import { init_GodotCompiler, GodotCompiler } from './chunk-ISG3TQ2O.js';
49
+ export { GodotCompiler } from './chunk-ISG3TQ2O.js';
50
+ import { init_R3FCompiler, init_visual, MATERIAL_PRESETS, ENVIRONMENT_PRESETS, R3FCompiler } from './chunk-ULXWSPCK.js';
51
+ export { ENVIRONMENT_PRESETS, R3FCompiler, registerAllPresets } from './chunk-ULXWSPCK.js';
52
52
  import './chunk-XT6JY5W5.js';
53
- import './chunk-UO4WPSGQ.js';
54
- import { init_PlayCanvasCompiler, PlayCanvasCompiler } from './chunk-DHO2YRIM.js';
55
- import { init_AndroidCompiler, AndroidCompiler } from './chunk-WRKUDAZJ.js';
56
- export { AndroidCompiler, compileToAndroid } from './chunk-WRKUDAZJ.js';
57
- import { init_AndroidXRCompiler, AndroidXRCompiler } from './chunk-YN2YWTXW.js';
58
- export { AndroidXRCompiler, compileToAndroidXR } from './chunk-YN2YWTXW.js';
53
+ import './chunk-VATGR4EM.js';
54
+ import { init_PlayCanvasCompiler, PlayCanvasCompiler } from './chunk-C34AJIJO.js';
55
+ import { init_AndroidCompiler, AndroidCompiler } from './chunk-JEB5UU3E.js';
56
+ export { AndroidCompiler, compileToAndroid } from './chunk-JEB5UU3E.js';
57
+ import { init_AndroidXRCompiler, AndroidXRCompiler } from './chunk-P4AIF7OQ.js';
58
+ export { AndroidXRCompiler, compileToAndroidXR } from './chunk-P4AIF7OQ.js';
59
59
  import './chunk-FDSGHPAK.js';
60
- import { init_IOSCompiler, IOSCompiler } from './chunk-OMXII44L.js';
61
- export { IOSCompiler, compileToIOS } from './chunk-OMXII44L.js';
62
- import { init_VisionOSCompiler, VisionOSCompiler } from './chunk-2X7NGX3M.js';
63
- export { VisionOSCompiler } from './chunk-2X7NGX3M.js';
60
+ import { init_IOSCompiler, IOSCompiler } from './chunk-KDZRD6EI.js';
61
+ export { IOSCompiler, compileToIOS } from './chunk-KDZRD6EI.js';
62
+ import { init_VisionOSCompiler, VisionOSCompiler } from './chunk-HBEN5TQR.js';
63
+ export { VisionOSCompiler } from './chunk-HBEN5TQR.js';
64
64
  export { FileSizeExceededError, IPFSPinError, IPFSService, IPFSUploadError, InfuraProvider, NFTStorageProvider, PinataProvider } from './chunk-WRWEX5ZF.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
- import { init_ARCompiler, ARCompiler } from './chunk-UJXISJBN.js';
70
- export { ARCompiler } from './chunk-UJXISJBN.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';
65
+ import { MultiLayerCompiler } from './chunk-RXU4PQKA.js';
66
+ export { MultiLayerCompiler } from './chunk-RXU4PQKA.js';
67
+ import { init_VRRCompiler, VRRCompiler } from './chunk-NPDNFPTU.js';
68
+ export { VRRCompiler } from './chunk-NPDNFPTU.js';
69
+ import { init_ARCompiler, ARCompiler } from './chunk-YU5RJQPE.js';
70
+ export { ARCompiler } from './chunk-YU5RJQPE.js';
71
+ import { init_OpenXRCompiler, OpenXRCompiler } from './chunk-E64LOLJU.js';
72
+ export { OpenXRCompiler } from './chunk-E64LOLJU.js';
73
+ import { init_VRChatCompiler, VRChatCompiler } from './chunk-BKCK3IU6.js';
74
+ export { VRChatCompiler, compileToVRChat } from './chunk-BKCK3IU6.js';
75
+ import { init_BabylonCompiler, BabylonCompiler } from './chunk-3B7AY37W.js';
76
+ export { BabylonCompiler } from './chunk-3B7AY37W.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-CCATWPXM.js';
82
- export { UnityCompiler } from './chunk-CCATWPXM.js';
81
+ import { init_UnityCompiler, UnityCompiler } from './chunk-DBPGNHFS.js';
82
+ export { UnityCompiler } from './chunk-DBPGNHFS.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-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
- import { init_CompilerBase, init_CompilerDocumentationGenerator, init_CultureTraits, CompilerBase, CompilerDocumentationGenerator } from './chunk-QPSKHBJP.js';
88
- export { BUILTIN_NORMS, BUILTIN_NORM_PROVENANCE, CompilerBase, UNKNOWN_NORM_PROVENANCE, criticalMassForChange, deserializeNormProvenance, getBuiltinNorm, normalizeNormProvenance, normsByCategory, serializeNormProvenance } from './chunk-QPSKHBJP.js';
85
+ import { init_DomainBlockCompilerMixin, compileDomainBlocks, compileWeatherBlock, compileAudioSourceBlock, compilePostProcessingBlock, compileParticleBlock, compilePhysicsBlock, compileMaterialBlock } from './chunk-DPZXVDGM.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-DPZXVDGM.js';
87
+ import { init_CompilerBase, init_CompilerDocumentationGenerator, init_CultureTraits, CompilerBase, CompilerDocumentationGenerator } from './chunk-CXS3DUKD.js';
88
+ export { BUILTIN_NORMS, BUILTIN_NORM_PROVENANCE, CompilerBase, UNKNOWN_NORM_PROVENANCE, criticalMassForChange, deserializeNormProvenance, getBuiltinNorm, normalizeNormProvenance, normsByCategory, serializeNormProvenance } from './chunk-CXS3DUKD.js';
89
89
  import './chunk-THCK6ECW.js';
90
90
  import './chunk-N75IH2HY.js';
91
91
  export { DeterminismHarness, captureEnvironment, describeEnvironment, hashBytes } from './chunk-NW5G5FBQ.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 { __commonJS, __export, __publicField, __require } from './chunk-OL46QLBJ.js';
117
+ import { __export, __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';
@@ -127,1391 +127,6 @@ 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
128
  import { Worker } from 'worker_threads';
129
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
-
1515
130
  // src/composition/CompositionParser.ts
1516
131
  function getProp(props, key2) {
1517
132
  if (!props) return void 0;
@@ -8238,6 +6853,18 @@ var WASMReferenceExporter = class extends ReferenceExporter {
8238
6853
  };
8239
6854
  }
8240
6855
  };
6856
+ var CodeEditorReferenceExporter = class extends ReferenceExporter {
6857
+ export(composition) {
6858
+ const output = new CodeEditorCompiler().compile(composition);
6859
+ return {
6860
+ target: "code-editor",
6861
+ output,
6862
+ format: "json",
6863
+ warnings: [],
6864
+ usedFallback: true
6865
+ };
6866
+ }
6867
+ };
8241
6868
  var Native2DReferenceExporter = class extends ReferenceExporter {
8242
6869
  export(composition) {
8243
6870
  const output = new Native2DCompiler().compile(composition, "", void 0, {
@@ -8264,6 +6891,7 @@ var ReferenceExporterRegistry = class {
8264
6891
  this.exporters.set("r3f", new R3FReferenceExporter());
8265
6892
  this.exporters.set("babylon", new BabylonReferenceExporter());
8266
6893
  this.exporters.set("native-2d", new Native2DReferenceExporter());
6894
+ this.exporters.set("code-editor", new CodeEditorReferenceExporter());
8267
6895
  this.exporters.set("openxr", new OpenXRReferenceExporter());
8268
6896
  this.exporters.set("vrchat", new VRChatReferenceExporter());
8269
6897
  this.exporters.set("ios", new IOSReferenceExporter());
@@ -11079,6 +9707,8 @@ var CompilerFactory = class {
11079
9707
  return new GaussianSplattingCompiler(options);
11080
9708
  case "canvas2d-game":
11081
9709
  return new Canvas2DGameCompiler(options);
9710
+ case "code-editor":
9711
+ return new CodeEditorCompiler();
11082
9712
  default:
11083
9713
  throw new Error(`Unknown export target: ${target}`);
11084
9714
  }
@@ -24776,7 +23406,7 @@ button refreshBtn {
24776
23406
 
24777
23407
  // src/barrel/runtime-env.ts
24778
23408
  async function createHoloScriptEnvironment() {
24779
- const { HoloScriptRuntime } = await import('./HoloScriptRuntime-ACDFKVVH.js');
23409
+ const { HoloScriptRuntime } = await import('./HoloScriptRuntime-6ZGLUCFS.js');
24780
23410
  return {
24781
23411
  parser: new HoloScriptParser(),
24782
23412
  runtime: new HoloScriptRuntime(),
@@ -34906,7 +33536,7 @@ var GeometryType;
34906
33536
  var BodyType;
34907
33537
  var LightType;
34908
33538
  try {
34909
- const holoVm = require_dist();
33539
+ const holoVm = __require("@holoscript/holo-vm");
34910
33540
  HoloBytecodeBuilder = holoVm.HoloBytecodeBuilder;
34911
33541
  ComponentType2 = holoVm.ComponentType;
34912
33542
  GeometryType = holoVm.GeometryType;
@@ -34965,14 +33595,14 @@ var HolobCompiler = class {
34965
33595
  const builder = new HoloBytecodeBuilder();
34966
33596
  this.stringTable.clear();
34967
33597
  this.entityCount = 0;
34968
- const entityIds = this.defineEntities(builder, composition);
33598
+ const { ids: entityIds, lightIds } = this.defineEntities(builder, composition);
34969
33599
  const main = builder.addFunction("main");
34970
33600
  if (composition.environment) {
34971
33601
  this.compileEnvironment(main, composition.environment);
34972
33602
  }
34973
33603
  if (composition.lights) {
34974
- for (const light of composition.lights) {
34975
- this.compileLight(main, builder, light);
33604
+ for (let i = 0; i < composition.lights.length; i++) {
33605
+ this.compileLight(main, composition.lights[i], lightIds[i]);
34976
33606
  }
34977
33607
  }
34978
33608
  if (composition.objects) {
@@ -35004,6 +33634,7 @@ var HolobCompiler = class {
35004
33634
  // ─── Entity Definition ──────────────────────────────────────────────
35005
33635
  defineEntities(builder, composition) {
35006
33636
  const ids = /* @__PURE__ */ new Map();
33637
+ const lightIds = [];
35007
33638
  if (composition.objects) {
35008
33639
  for (const obj of composition.objects) {
35009
33640
  this.entityCount++;
@@ -35014,11 +33645,13 @@ var HolobCompiler = class {
35014
33645
  if (composition.lights) {
35015
33646
  for (const light of composition.lights) {
35016
33647
  this.entityCount++;
35017
- builder.addEntity(light.name || `light_${this.entityCount}`, 0);
35018
- ids.set(light.name || `light_${this.entityCount}`, this.entityCount);
33648
+ const key2 = light.name || `light_${this.entityCount}`;
33649
+ builder.addEntity(key2, 0);
33650
+ ids.set(key2, this.entityCount);
33651
+ lightIds.push(this.entityCount);
35019
33652
  }
35020
33653
  }
35021
- return ids;
33654
+ return { ids, lightIds };
35022
33655
  }
35023
33656
  // ─── Object Compilation ─────────────────────────────────────────────
35024
33657
  compileObject(fn, builder, obj, entityId) {
@@ -35098,10 +33731,7 @@ var HolobCompiler = class {
35098
33731
  }
35099
33732
  }
35100
33733
  // ─── Light Compilation ──────────────────────────────────────────────
35101
- compileLight(fn, builder, light) {
35102
- this.entityCount++;
35103
- const entityId = this.entityCount;
35104
- builder.addEntity(light.name || `light_${entityId}`, 0);
33734
+ compileLight(fn, light, entityId) {
35105
33735
  const lightType = LIGHT_MAP[light.lightType || "directional"] ?? 0;
35106
33736
  const lightExt = light;
35107
33737
  const intensity = lightExt.intensity ?? 1;