@holoscript/core 6.1.3 → 8.0.0

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 (166) hide show
  1. package/dist/{GLTFPipeline-SFIORFJU.js → GLTFPipeline-276GE64O.js} +6 -6
  2. package/dist/{GLTFPipeline-VNNDPONV.cjs → GLTFPipeline-M7WSSJED.cjs} +10 -10
  3. package/dist/HoloScriptRuntime-3URVTKPJ.js +10 -0
  4. package/dist/HoloScriptRuntime-SXEAEU2N.cjs +19 -0
  5. package/dist/{chunk-2B7WVIDZ.js → chunk-23J755AR.js} +4 -4
  6. package/dist/{chunk-HANL7K2Q.cjs → chunk-253GBQZY.cjs} +38 -38
  7. package/dist/{chunk-KQTPCYTG.cjs → chunk-25IQCHTO.cjs} +38 -38
  8. package/dist/{chunk-V73NPPTM.cjs → chunk-3AO425MZ.cjs} +20 -20
  9. package/dist/{chunk-6S6TKNEA.cjs → chunk-3HYYMEXI.cjs} +279 -124
  10. package/dist/{chunk-IHESJZSW.js → chunk-3NFFOWGG.js} +6 -209
  11. package/dist/{chunk-AO4I2Z7M.cjs → chunk-3WZEJHUQ.cjs} +7 -7
  12. package/dist/{chunk-IRWWS72C.cjs → chunk-4V2E7U7Q.cjs} +7 -7
  13. package/dist/{chunk-ER4GATIU.js → chunk-62FBK3B7.js} +6 -6
  14. package/dist/{chunk-L63H3SQ4.cjs → chunk-6DPSFNJB.cjs} +19 -19
  15. package/dist/{chunk-XFXGA5IW.cjs → chunk-73FELZVJ.cjs} +14 -14
  16. package/dist/{chunk-QWNQ523V.cjs → chunk-7CUEMLDZ.cjs} +47 -47
  17. package/dist/{chunk-52ULD552.cjs → chunk-7HIASF7S.cjs} +13 -13
  18. package/dist/{chunk-U4NBQJBY.js → chunk-ANXZFVY2.js} +3 -3
  19. package/dist/{chunk-NHHVLKV3.js → chunk-AYBXB26F.js} +5 -5
  20. package/dist/{chunk-KX76JUQY.js → chunk-B4TFTDG4.js} +3 -3
  21. package/dist/{chunk-OEFY723R.js → chunk-BE4UJCQT.js} +4 -4
  22. package/dist/{chunk-DIL6DDDN.cjs → chunk-C2A5DUMF.cjs} +38 -38
  23. package/dist/{chunk-H3MGK7TX.cjs → chunk-CXFDRBQU.cjs} +10 -10
  24. package/dist/{chunk-4SY77NA4.cjs → chunk-D54CNIAJ.cjs} +2 -2
  25. package/dist/{chunk-22W6NGYN.js → chunk-DAJXW4KX.js} +3 -3
  26. package/dist/{chunk-RUXGBKPS.cjs → chunk-EUDQTK7N.cjs} +15 -222
  27. package/dist/{chunk-SXYLMIGP.js → chunk-F43YAA34.js} +3 -3
  28. package/dist/{chunk-H5DZIHJP.cjs → chunk-FYSPZT4V.cjs} +7 -7
  29. package/dist/{chunk-TK74TR4H.js → chunk-GIOYPNTH.js} +36 -2
  30. package/dist/{chunk-2HLIGOKU.cjs → chunk-GQHQOPXZ.cjs} +36 -2
  31. package/dist/{chunk-BPICAGBV.cjs → chunk-GQT4TYKY.cjs} +35 -35
  32. package/dist/{chunk-QAVXL2IH.js → chunk-GYZE55MO.js} +3 -3
  33. package/dist/{chunk-77V4GTCA.js → chunk-H652NHX5.js} +78 -74
  34. package/dist/{chunk-KHPCJRI3.cjs → chunk-HINXWAOD.cjs} +14 -14
  35. package/dist/{chunk-W6P2GBHH.cjs → chunk-HZSPDCXV.cjs} +3 -3
  36. package/dist/{chunk-EMMC5CSQ.js → chunk-HZTDET3N.js} +4 -4
  37. package/dist/{chunk-5CKA5SXU.js → chunk-IPWSXCCN.js} +4 -4
  38. package/dist/{chunk-GQYKQSTC.cjs → chunk-IUTY5WQ2.cjs} +5 -5
  39. package/dist/{chunk-MSMIFMBL.js → chunk-IVSZDECV.js} +4 -4
  40. package/dist/{chunk-2A7FURVO.js → chunk-IZM5VQZD.js} +4 -4
  41. package/dist/{chunk-33XCOVE3.js → chunk-J6M4FPK5.js} +3 -3
  42. package/dist/{chunk-6KMK2UXT.cjs → chunk-JC5YBPSF.cjs} +5 -5
  43. package/dist/{chunk-W55Z7QIX.js → chunk-JCLBKPMX.js} +3 -3
  44. package/dist/{chunk-MXJ5SS53.cjs → chunk-JJBE3TIH.cjs} +10 -10
  45. package/dist/{chunk-HRODTEEO.js → chunk-JX7YL6ZE.js} +5 -5
  46. package/dist/{chunk-IVIA7K75.cjs → chunk-K4VVR7CN.cjs} +18 -18
  47. package/dist/{chunk-VSK7W3O5.cjs → chunk-KEFNV2WM.cjs} +16 -16
  48. package/dist/{chunk-HZCQO4JM.cjs → chunk-KH4CNH66.cjs} +4 -4
  49. package/dist/{chunk-6FGQNDR4.js → chunk-KJLB4OPV.js} +4 -4
  50. package/dist/{chunk-RMHC2VG7.cjs → chunk-KKP7JKN4.cjs} +6 -2
  51. package/dist/{chunk-OEV5RMZO.cjs → chunk-KQCN6AKJ.cjs} +5 -5
  52. package/dist/{chunk-7AD52FRS.cjs → chunk-KVRSTFNH.cjs} +14 -14
  53. package/dist/{chunk-ZKSS47EV.cjs → chunk-LICPB5HZ.cjs} +13 -13
  54. package/dist/{chunk-S5IFXW6E.js → chunk-MGE5Z4GS.js} +4 -4
  55. package/dist/{chunk-6L4VE27M.js → chunk-NBMHU6SW.js} +4 -4
  56. package/dist/{chunk-QCCBXSCE.js → chunk-NGKREZ36.js} +5 -5
  57. package/dist/{chunk-27MPVJVZ.cjs → chunk-NHWSN2SD.cjs} +21 -21
  58. package/dist/{chunk-XMWZG36H.js → chunk-NV4VMVXU.js} +3 -3
  59. package/dist/{chunk-Y3MWXQSB.cjs → chunk-NXZFOPVD.cjs} +19 -19
  60. package/dist/{chunk-ZUL5AVTX.cjs → chunk-OBIYPYYS.cjs} +5 -5
  61. package/dist/{chunk-ZXBZVXDW.js → chunk-OMXII44L.js} +3 -3
  62. package/dist/{chunk-MJVIRCUV.cjs → chunk-OR4Q2BGL.cjs} +18 -18
  63. package/dist/{chunk-6ASWLXXN.js → chunk-PHVRG4I2.js} +4 -4
  64. package/dist/{chunk-QTPMJRGS.js → chunk-QPSKHBJP.js} +6 -2
  65. package/dist/{chunk-VEXPG4WN.js → chunk-QXH7QDSZ.js} +3 -3
  66. package/dist/chunk-RARB3MBR.js +207 -0
  67. package/dist/{chunk-EOBB6A4B.js → chunk-RVBHAXFG.js} +231 -76
  68. package/dist/{chunk-XXZJEFKW.cjs → chunk-S3MDHNKB.cjs} +5 -5
  69. package/dist/{chunk-4UUKPCY4.js → chunk-S4W6Z2MN.js} +4 -4
  70. package/dist/{chunk-BVLP6D3Q.cjs → chunk-SJBGLS25.cjs} +5 -5
  71. package/dist/chunk-SMIWS6DE.cjs +212 -0
  72. package/dist/{chunk-R3IVNY6P.js → chunk-T2QCTZMO.js} +4 -4
  73. package/dist/{chunk-AIX25INK.cjs → chunk-TVHSPJ4N.cjs} +79 -75
  74. package/dist/{chunk-Z5XMPRNC.cjs → chunk-U44IKGG7.cjs} +30 -30
  75. package/dist/{chunk-OPZ7XDDI.js → chunk-UJXISJBN.js} +3 -3
  76. package/dist/{chunk-FXKTYFYA.js → chunk-UM6C3CGK.js} +4 -4
  77. package/dist/{chunk-LAOCQJ2M.js → chunk-UMABK6SI.js} +4 -4
  78. package/dist/{chunk-GN3KDX4W.js → chunk-V6MKC2FZ.js} +3 -3
  79. package/dist/{chunk-EDPQSGB3.cjs → chunk-W7VDOASB.cjs} +5 -5
  80. package/dist/{chunk-DMXC24WV.js → chunk-WJIHFLMJ.js} +2 -2
  81. package/dist/{chunk-UDMYRFDZ.js → chunk-WRKUDAZJ.js} +3 -3
  82. package/dist/{chunk-GCMWDSBZ.cjs → chunk-XIVIE43A.cjs} +5 -5
  83. package/dist/{chunk-UD3DSHZM.js → chunk-XKTPFXGA.js} +3 -3
  84. package/dist/{chunk-HGVXZDSK.cjs → chunk-XUUVDHIF.cjs} +7 -7
  85. package/dist/{chunk-5N54COB6.cjs → chunk-YN6V7R3L.cjs} +13 -13
  86. package/dist/{chunk-I2O7TW6B.js → chunk-ZBQXLH2L.js} +4 -4
  87. package/dist/{chunk-EOFNVCM6.js → chunk-ZU7NIRT6.js} +11 -11
  88. package/dist/{chunk-P7YIA5LN.js → chunk-ZZEI7MV4.js} +4 -4
  89. package/dist/compiler/agent-inference.cjs +6 -6
  90. package/dist/compiler/agent-inference.js +2 -2
  91. package/dist/compiler/android-xr.cjs +6 -6
  92. package/dist/compiler/android-xr.js +4 -4
  93. package/dist/compiler/android.cjs +5 -5
  94. package/dist/compiler/android.js +3 -3
  95. package/dist/compiler/ar.cjs +5 -5
  96. package/dist/compiler/ar.js +3 -3
  97. package/dist/compiler/babylon.cjs +5 -5
  98. package/dist/compiler/babylon.js +4 -4
  99. package/dist/compiler/business-quest.cjs +9 -9
  100. package/dist/compiler/business-quest.js +1 -1
  101. package/dist/compiler/context.cjs +5 -5
  102. package/dist/compiler/context.js +2 -2
  103. package/dist/compiler/domain-block-utils.cjs +151 -151
  104. package/dist/compiler/domain-block-utils.js +3 -3
  105. package/dist/compiler/dtdl.cjs +6 -6
  106. package/dist/compiler/dtdl.js +3 -3
  107. package/dist/compiler/gltf-pipeline.cjs +8 -8
  108. package/dist/compiler/gltf-pipeline.js +1 -1
  109. package/dist/compiler/godot.cjs +5 -5
  110. package/dist/compiler/godot.js +4 -4
  111. package/dist/compiler/incremental.cjs +7 -7
  112. package/dist/compiler/incremental.js +2 -2
  113. package/dist/compiler/index.cjs +182 -182
  114. package/dist/compiler/index.js +56 -56
  115. package/dist/compiler/ios.cjs +5 -5
  116. package/dist/compiler/ios.js +3 -3
  117. package/dist/compiler/llm-provider-capabilities.cjs +5 -5
  118. package/dist/compiler/llm-provider-capabilities.js +2 -2
  119. package/dist/compiler/multi-layer.cjs +7 -7
  120. package/dist/compiler/multi-layer.js +6 -6
  121. package/dist/compiler/openxr.cjs +5 -5
  122. package/dist/compiler/openxr.js +4 -4
  123. package/dist/compiler/playcanvas.cjs +5 -5
  124. package/dist/compiler/playcanvas.js +4 -4
  125. package/dist/compiler/r3f.cjs +9 -9
  126. package/dist/compiler/r3f.js +4 -4
  127. package/dist/compiler/sdf.cjs +6 -6
  128. package/dist/compiler/sdf.js +4 -4
  129. package/dist/compiler/state.cjs +5 -5
  130. package/dist/compiler/state.js +3 -3
  131. package/dist/compiler/trait-composition.cjs +6 -6
  132. package/dist/compiler/trait-composition.js +2 -2
  133. package/dist/compiler/unity.cjs +5 -5
  134. package/dist/compiler/unity.js +4 -4
  135. package/dist/compiler/unreal.cjs +6 -6
  136. package/dist/compiler/unreal.js +4 -4
  137. package/dist/compiler/urdf.cjs +13 -13
  138. package/dist/compiler/urdf.js +4 -4
  139. package/dist/compiler/usd-physics.cjs +6 -6
  140. package/dist/compiler/usd-physics.js +3 -3
  141. package/dist/compiler/visionos.cjs +5 -5
  142. package/dist/compiler/visionos.js +4 -4
  143. package/dist/compiler/vrchat.cjs +6 -6
  144. package/dist/compiler/vrchat.js +4 -4
  145. package/dist/compiler/vrr.cjs +6 -6
  146. package/dist/compiler/vrr.js +4 -4
  147. package/dist/compiler/wasm.cjs +9 -9
  148. package/dist/compiler/wasm.js +4 -4
  149. package/dist/compiler/webgpu.cjs +5 -5
  150. package/dist/compiler/webgpu.js +4 -4
  151. package/dist/debugger.cjs +7 -6
  152. package/dist/debugger.js +5 -4
  153. package/dist/entries/scripting.cjs +0 -13
  154. package/dist/entries/scripting.js +0 -1
  155. package/dist/index.cjs +1002 -881
  156. package/dist/index.js +506 -87
  157. package/dist/parser.cjs +5 -5
  158. package/dist/parser.js +1 -1
  159. package/dist/reconstruction/index.cjs +31 -31
  160. package/dist/reconstruction/index.js +2 -2
  161. package/dist/runtime.cjs +302 -4
  162. package/dist/runtime.d.ts +61 -0
  163. package/dist/runtime.js +25 -3
  164. package/dist/traits/index.cjs +450 -439
  165. package/dist/traits/index.js +24 -13
  166. package/package.json +20 -20
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- var chunkRMHC2VG7_cjs = require('./chunk-RMHC2VG7.cjs');
3
+ var chunkKKP7JKN4_cjs = require('./chunk-KKP7JKN4.cjs');
4
4
  var chunkHCCQLAA4_cjs = require('./chunk-HCCQLAA4.cjs');
5
5
  var ans = require('@holoscript/core-types/ans');
6
6
 
@@ -13,7 +13,7 @@ chunkHCCQLAA4_cjs.__export(ARCompiler_exports, {
13
13
  var AR_TRAIT_NAMES; exports.ARCompiler = void 0; exports.ARCompiler_default = void 0;
14
14
  var init_ARCompiler = chunkHCCQLAA4_cjs.__esm({
15
15
  "src/compiler/ARCompiler.ts"() {
16
- chunkRMHC2VG7_cjs.init_CompilerBase();
16
+ chunkKKP7JKN4_cjs.init_CompilerBase();
17
17
  AR_TRAIT_NAMES = [
18
18
  "ar_beacon",
19
19
  "overlay",
@@ -23,7 +23,7 @@ var init_ARCompiler = chunkHCCQLAA4_cjs.__esm({
23
23
  "camera_overlay",
24
24
  "x402_paywall"
25
25
  ];
26
- exports.ARCompiler = class extends chunkRMHC2VG7_cjs.CompilerBase {
26
+ exports.ARCompiler = class extends chunkKKP7JKN4_cjs.CompilerBase {
27
27
  constructor(options = {}) {
28
28
  super();
29
29
  this.compilerName = "ARCompiler";
@@ -486,5 +486,5 @@ var init_ARCompiler = chunkHCCQLAA4_cjs.__esm({
486
486
 
487
487
  exports.ARCompiler_exports = ARCompiler_exports;
488
488
  exports.init_ARCompiler = init_ARCompiler;
489
- //# sourceMappingURL=chunk-XXZJEFKW.cjs.map
490
- //# sourceMappingURL=chunk-XXZJEFKW.cjs.map
489
+ //# sourceMappingURL=chunk-S3MDHNKB.cjs.map
490
+ //# sourceMappingURL=chunk-S3MDHNKB.cjs.map
@@ -1,6 +1,6 @@
1
1
  import { init_PlatformConditionalCompilerMixin, filterCompositionForPlatform } from './chunk-GZG4KA4E.js';
2
- import { init_DomainBlockCompilerMixin, compileDomainBlocks, compileWeatherBlock, compileAudioSourceBlock, audioSourceToVisionOS, compilePostProcessingBlock, compileParticleBlock, particlesToVisionOS, compilePhysicsBlock, physicsToVisionOS, compileMaterialBlock, materialToVisionOS } from './chunk-W55Z7QIX.js';
3
- import { init_CompilerBase, CompilerBase } from './chunk-QTPMJRGS.js';
2
+ import { init_DomainBlockCompilerMixin, compileDomainBlocks, compileWeatherBlock, compileAudioSourceBlock, audioSourceToVisionOS, compilePostProcessingBlock, compileParticleBlock, particlesToVisionOS, compilePhysicsBlock, physicsToVisionOS, compileMaterialBlock, materialToVisionOS } from './chunk-JCLBKPMX.js';
3
+ import { init_CompilerBase, CompilerBase } from './chunk-QPSKHBJP.js';
4
4
  import { __esm, __export } from './chunk-OL46QLBJ.js';
5
5
  import { ANSCapabilityPath } from '@holoscript/core-types/ans';
6
6
 
@@ -2422,5 +2422,5 @@ ${layers}`;
2422
2422
  });
2423
2423
 
2424
2424
  export { VisionOSCompiler, VisionOSCompiler_exports, generateTraitCode, getTraitMapping, init_VisionOSCompiler, init_VisionOSTraitMap, listAllTraits };
2425
- //# sourceMappingURL=chunk-4UUKPCY4.js.map
2426
- //# sourceMappingURL=chunk-4UUKPCY4.js.map
2425
+ //# sourceMappingURL=chunk-S4W6Z2MN.js.map
2426
+ //# sourceMappingURL=chunk-S4W6Z2MN.js.map
@@ -4,9 +4,9 @@ var chunkLM2VU56C_cjs = require('./chunk-LM2VU56C.cjs');
4
4
  var chunkCIWWXYHZ_cjs = require('./chunk-CIWWXYHZ.cjs');
5
5
 
6
6
  // src/version.ts
7
- var HOLOSCRIPT_VERSION = "6.1.2" ;
8
- var GIT_COMMIT_SHA = "d63800d9b" ;
9
- var BUILD_TIMESTAMP = "2026-05-30T23:09:33.844Z" ;
7
+ var HOLOSCRIPT_VERSION = "8.0.0" ;
8
+ var GIT_COMMIT_SHA = "fe71f4fd6" ;
9
+ var BUILD_TIMESTAMP = "2026-06-01T03:27:39.090Z" ;
10
10
  function getVersionString() {
11
11
  const sha = `+${GIT_COMMIT_SHA}` ;
12
12
  return `${HOLOSCRIPT_VERSION}${sha}`;
@@ -2192,5 +2192,5 @@ exports.putCachedWeightBlob = putCachedWeightBlob;
2192
2192
  exports.resetHoloMapTelemetryForTests = resetHoloMapTelemetryForTests;
2193
2193
  exports.runHoloMapMicroEncoderCpu = runHoloMapMicroEncoderCpu;
2194
2194
  exports.tryCreateHoloMapEncoderDevice = tryCreateHoloMapEncoderDevice;
2195
- //# sourceMappingURL=chunk-BVLP6D3Q.cjs.map
2196
- //# sourceMappingURL=chunk-BVLP6D3Q.cjs.map
2195
+ //# sourceMappingURL=chunk-SJBGLS25.cjs.map
2196
+ //# sourceMappingURL=chunk-SJBGLS25.cjs.map
@@ -0,0 +1,212 @@
1
+ 'use strict';
2
+
3
+ // src/events/EventBus.ts
4
+ var EventBus = class {
5
+ constructor() {
6
+ this.listeners = /* @__PURE__ */ new Map();
7
+ this.history = [];
8
+ this.maxHistory = 100;
9
+ this.nextId = 0;
10
+ this.paused = false;
11
+ }
12
+ /**
13
+ * Subscribe to an event.
14
+ */
15
+ on(event, callback, priority = 0) {
16
+ const id = this.nextId++;
17
+ const list = this.listeners.get(event) || [];
18
+ list.push({ callback, priority, once: false, id });
19
+ list.sort((a, b) => b.priority - a.priority);
20
+ this.listeners.set(event, list);
21
+ return id;
22
+ }
23
+ /**
24
+ * Subscribe to an event once (auto-removes after first fire).
25
+ */
26
+ once(event, callback, priority = 0) {
27
+ const id = this.nextId++;
28
+ const list = this.listeners.get(event) || [];
29
+ list.push({ callback, priority, once: true, id });
30
+ list.sort((a, b) => b.priority - a.priority);
31
+ this.listeners.set(event, list);
32
+ return id;
33
+ }
34
+ /**
35
+ * Unsubscribe by listener ID.
36
+ */
37
+ off(listenerId) {
38
+ for (const [event, list] of this.listeners) {
39
+ const idx = list.findIndex((l) => l.id === listenerId);
40
+ if (idx !== -1) {
41
+ list.splice(idx, 1);
42
+ return;
43
+ }
44
+ }
45
+ }
46
+ /**
47
+ * Unsubscribe all listeners for an event.
48
+ */
49
+ offAll(event) {
50
+ this.listeners.delete(event);
51
+ }
52
+ /**
53
+ * Emit an event to all subscribers.
54
+ */
55
+ emit(event, data) {
56
+ if (this.paused) return;
57
+ this.history.push({ event, data, timestamp: Date.now() });
58
+ if (this.history.length > this.maxHistory) this.history.shift();
59
+ const list = this.listeners.get(event);
60
+ if (list) {
61
+ const toRemove = [];
62
+ for (const listener of list) {
63
+ listener.callback(data);
64
+ if (listener.once) toRemove.push(listener.id);
65
+ }
66
+ for (const id of toRemove) {
67
+ const idx = list.findIndex((l) => l.id === id);
68
+ if (idx !== -1) list.splice(idx, 1);
69
+ }
70
+ }
71
+ if (event !== "*") {
72
+ const wildcardList = this.listeners.get("*");
73
+ if (wildcardList) {
74
+ for (const listener of wildcardList) {
75
+ listener.callback({ event, data });
76
+ }
77
+ }
78
+ }
79
+ }
80
+ /**
81
+ * Get event history.
82
+ */
83
+ getHistory() {
84
+ return [...this.history];
85
+ }
86
+ /**
87
+ * Get listener count for an event.
88
+ */
89
+ listenerCount(event) {
90
+ return this.listeners.get(event)?.length || 0;
91
+ }
92
+ /**
93
+ * Pause/resume event emission.
94
+ */
95
+ setPaused(paused) {
96
+ this.paused = paused;
97
+ }
98
+ /**
99
+ * Clear all listeners and history.
100
+ */
101
+ clear() {
102
+ this.listeners.clear();
103
+ this.history = [];
104
+ }
105
+ };
106
+ var sharedBus = null;
107
+ function getSharedEventBus() {
108
+ if (!sharedBus) sharedBus = new EventBus();
109
+ return sharedBus;
110
+ }
111
+ function setSharedEventBus(bus) {
112
+ sharedBus = bus;
113
+ }
114
+
115
+ // src/monitoring/telemetry.ts
116
+ var TelemetryRegistry = class {
117
+ constructor() {
118
+ this.measurements = [];
119
+ this.maxHistory = 1e4;
120
+ }
121
+ /**
122
+ * Increments a monotonic counter (e.g., total_nodes_executed)
123
+ */
124
+ incrementCounter(name, value = 1, labels) {
125
+ this.measurements.push({
126
+ name,
127
+ type: "counter",
128
+ value,
129
+ labels,
130
+ timestamp: Date.now()
131
+ });
132
+ if (this.measurements.length > this.maxHistory) this.measurements.shift();
133
+ }
134
+ /**
135
+ * Records an instantaneous value (e.g., active_agents)
136
+ */
137
+ setGauge(name, value, labels) {
138
+ this.measurements.push({
139
+ name,
140
+ type: "gauge",
141
+ value,
142
+ labels,
143
+ timestamp: Date.now()
144
+ });
145
+ if (this.measurements.length > this.maxHistory) this.measurements.shift();
146
+ }
147
+ /**
148
+ * Wraps an async function and records its execution latency into a histogram.
149
+ */
150
+ async measureLatency(name, fn, labels) {
151
+ const start = performance.now();
152
+ try {
153
+ return await fn();
154
+ } finally {
155
+ const duration = performance.now() - start;
156
+ this.measurements.push({
157
+ name,
158
+ type: "histogram",
159
+ value: duration,
160
+ labels,
161
+ timestamp: Date.now()
162
+ });
163
+ if (this.measurements.length > this.maxHistory) this.measurements.shift();
164
+ if (duration > 500) {
165
+ this.measurements.push({
166
+ name: "slo_violation_count",
167
+ type: "counter",
168
+ value: 1,
169
+ labels: { ...labels, metric_name: name, threshold: "500ms" },
170
+ timestamp: Date.now()
171
+ });
172
+ }
173
+ }
174
+ }
175
+ /**
176
+ * Snapshots current aggregations for dashboard export.
177
+ */
178
+ getSnapshot() {
179
+ const snapshot = { counters: {}, histograms: {}, gauges: {} };
180
+ const histAggregations = {};
181
+ for (const m of this.measurements) {
182
+ const key = m.labels ? `${m.name}{${JSON.stringify(m.labels)}}` : m.name;
183
+ if (m.type === "counter") {
184
+ snapshot.counters[key] = (snapshot.counters[key] || 0) + m.value;
185
+ } else if (m.type === "gauge") {
186
+ snapshot.gauges[key] = m.value;
187
+ } else if (m.type === "histogram") {
188
+ if (!histAggregations[key]) histAggregations[key] = { count: 0, sum: 0, max: 0 };
189
+ histAggregations[key].count++;
190
+ histAggregations[key].sum += m.value;
191
+ if (m.value > histAggregations[key].max) histAggregations[key].max = m.value;
192
+ }
193
+ }
194
+ for (const [key, agg] of Object.entries(histAggregations)) {
195
+ snapshot.histograms[key] = {
196
+ count: agg.count,
197
+ sum: agg.sum,
198
+ avg: agg.count > 0 ? agg.sum / agg.count : 0,
199
+ max: agg.max
200
+ };
201
+ }
202
+ return snapshot;
203
+ }
204
+ };
205
+ var telemetry = new TelemetryRegistry();
206
+
207
+ exports.EventBus = EventBus;
208
+ exports.getSharedEventBus = getSharedEventBus;
209
+ exports.setSharedEventBus = setSharedEventBus;
210
+ exports.telemetry = telemetry;
211
+ //# sourceMappingURL=chunk-SMIWS6DE.cjs.map
212
+ //# sourceMappingURL=chunk-SMIWS6DE.cjs.map
@@ -1,5 +1,5 @@
1
- import { init_DomainBlockCompilerMixin, compileDomainBlocks, compileWeatherBlock, compileAudioSourceBlock, compileParticleBlock, compilePhysicsBlock, compileMaterialBlock } from './chunk-W55Z7QIX.js';
2
- import { init_CompilerBase, CompilerBase } from './chunk-QTPMJRGS.js';
1
+ import { init_DomainBlockCompilerMixin, compileDomainBlocks, compileWeatherBlock, compileAudioSourceBlock, compileParticleBlock, compilePhysicsBlock, compileMaterialBlock } from './chunk-JCLBKPMX.js';
2
+ import { init_CompilerBase, CompilerBase } from './chunk-QPSKHBJP.js';
3
3
  import { init_safeJsonParse, jsonClone } from './chunk-VVKVQZI6.js';
4
4
  import { __export, __esm } from './chunk-OL46QLBJ.js';
5
5
  import { ANSCapabilityPath } from '@holoscript/core-types/ans';
@@ -807,5 +807,5 @@ const ${twinName} = new THREE.Group();`);
807
807
  });
808
808
 
809
809
  export { VRRCompiler, VRRCompiler_default, VRRCompiler_exports, init_VRRCompiler };
810
- //# sourceMappingURL=chunk-R3IVNY6P.js.map
811
- //# sourceMappingURL=chunk-R3IVNY6P.js.map
810
+ //# sourceMappingURL=chunk-T2QCTZMO.js.map
811
+ //# sourceMappingURL=chunk-T2QCTZMO.js.map
@@ -1,7 +1,77 @@
1
1
  'use strict';
2
2
 
3
3
  var chunkILRBGFVD_cjs = require('./chunk-ILRBGFVD.cjs');
4
- var orbital = require('@holoscript/engine/orbital');
4
+
5
+ // src/traits/MitosisTrait.ts
6
+ var mitosisHandler = {
7
+ name: "mitosis",
8
+ defaultConfig: {
9
+ strategy: "collaborative",
10
+ max_children: 5,
11
+ auto_cleanup: true
12
+ },
13
+ onAttach(node, config, context) {
14
+ const state = {
15
+ parent_id: ("parent_id" in config ? config.parent_id : null) || null,
16
+ active_children: [],
17
+ tasks_delegated: 0,
18
+ completed_tasks: 0,
19
+ last_sync_time: Date.now()
20
+ };
21
+ node.__mitosisState = state;
22
+ context.emit?.("mitosis_init", {
23
+ nodeId: node.id,
24
+ strategy: config.strategy,
25
+ parent_id: state.parent_id
26
+ });
27
+ },
28
+ onDetach(node, config, context) {
29
+ const state = node.__mitosisState;
30
+ if (state && config.auto_cleanup) {
31
+ for (const childId of state.active_children) {
32
+ context.emit?.("mitosis_despawn_child", { childId });
33
+ }
34
+ }
35
+ delete node.__mitosisState;
36
+ },
37
+ onEvent(node, config, context, event) {
38
+ const state = node.__mitosisState;
39
+ if (!state) return;
40
+ if (event.type === "mitosis_spawned") {
41
+ const childId = event.childId;
42
+ const parentId = event.parentId;
43
+ if (node.id === parentId) {
44
+ state.active_children.push(childId);
45
+ state.tasks_delegated++;
46
+ context.emit?.("on_mitosis_spawned", { childId, parentId: node.id });
47
+ }
48
+ } else if (event.type === "mitosis_child_complete") {
49
+ const childId = "childId" in event ? event.childId : "";
50
+ const parentId = "parentId" in event ? event.parentId : "";
51
+ const result = "result" in event ? event.result : void 0;
52
+ if (node.id === parentId) {
53
+ state.completed_tasks++;
54
+ state.last_sync_time = Date.now();
55
+ context.emit?.("mitosis_synced", {
56
+ parentId: node.id,
57
+ childId,
58
+ result
59
+ });
60
+ if (config.strategy === "collaborative") {
61
+ if (result && typeof result === "object") {
62
+ Object.assign(node.properties || {}, result);
63
+ }
64
+ }
65
+ }
66
+ } else if (event.type === "mitosis_child_failed") {
67
+ context.emit?.("on_mitosis_error", {
68
+ parentId: node.id,
69
+ childId: event.childId,
70
+ error: event.error
71
+ });
72
+ }
73
+ }
74
+ };
5
75
 
6
76
  // src/traits/JEPAPredictor.ts
7
77
  var JEPAPredictor = class {
@@ -472,76 +542,8 @@ function requireFloat32(value, name) {
472
542
  throw new TypeError(`jepa:update_weights: ${name} must be a Float32Array`);
473
543
  }
474
544
 
475
- // src/traits/MitosisTrait.ts
476
- var mitosisHandler = {
477
- name: "mitosis",
478
- defaultConfig: {
479
- strategy: "collaborative",
480
- max_children: 5,
481
- auto_cleanup: true
482
- },
483
- onAttach(node, config, context) {
484
- const state = {
485
- parent_id: ("parent_id" in config ? config.parent_id : null) || null,
486
- active_children: [],
487
- tasks_delegated: 0,
488
- completed_tasks: 0,
489
- last_sync_time: Date.now()
490
- };
491
- node.__mitosisState = state;
492
- context.emit?.("mitosis_init", {
493
- nodeId: node.id,
494
- strategy: config.strategy,
495
- parent_id: state.parent_id
496
- });
497
- },
498
- onDetach(node, config, context) {
499
- const state = node.__mitosisState;
500
- if (state && config.auto_cleanup) {
501
- for (const childId of state.active_children) {
502
- context.emit?.("mitosis_despawn_child", { childId });
503
- }
504
- }
505
- delete node.__mitosisState;
506
- },
507
- onEvent(node, config, context, event) {
508
- const state = node.__mitosisState;
509
- if (!state) return;
510
- if (event.type === "mitosis_spawned") {
511
- const childId = event.childId;
512
- const parentId = event.parentId;
513
- if (node.id === parentId) {
514
- state.active_children.push(childId);
515
- state.tasks_delegated++;
516
- context.emit?.("on_mitosis_spawned", { childId, parentId: node.id });
517
- }
518
- } else if (event.type === "mitosis_child_complete") {
519
- const childId = "childId" in event ? event.childId : "";
520
- const parentId = "parentId" in event ? event.parentId : "";
521
- const result = "result" in event ? event.result : void 0;
522
- if (node.id === parentId) {
523
- state.completed_tasks++;
524
- state.last_sync_time = Date.now();
525
- context.emit?.("mitosis_synced", {
526
- parentId: node.id,
527
- childId,
528
- result
529
- });
530
- if (config.strategy === "collaborative") {
531
- if (result && typeof result === "object") {
532
- Object.assign(node.properties || {}, result);
533
- }
534
- }
535
- }
536
- } else if (event.type === "mitosis_child_failed") {
537
- context.emit?.("on_mitosis_error", {
538
- parentId: node.id,
539
- childId: event.childId,
540
- error: event.error
541
- });
542
- }
543
- }
544
- };
545
+ // src/traits/OrbitalTrait.ts
546
+ var _orbital = null;
545
547
  var orbitalHandler = {
546
548
  name: "orbital",
547
549
  defaultConfig: {},
@@ -554,16 +556,18 @@ var orbitalHandler = {
554
556
  /**
555
557
  * Called every frame to update orbital position
556
558
  */
557
- onUpdate(node, config, context, _delta) {
559
+ async onUpdate(node, config, context, _delta) {
558
560
  const properties = node.properties || {};
559
561
  const mergedConfig = { ...properties, ...config };
560
562
  if (!mergedConfig || !mergedConfig.semiMajorAxis) {
561
563
  return;
562
564
  }
565
+ _orbital ?? (_orbital = await import('@holoscript/engine/orbital'));
566
+ const { calculatePosition } = _orbital;
563
567
  const julianDate = context.julianDate || 0;
564
568
  const visualScale = context.getScaleMultiplier() * 50;
565
569
  const satelliteScale = 5;
566
- const rawPosition = orbital.calculatePosition(mergedConfig, julianDate);
570
+ const rawPosition = calculatePosition(mergedConfig, julianDate);
567
571
  const currentScale = mergedConfig.parent ? visualScale * satelliteScale : visualScale;
568
572
  let finalPosition = [
569
573
  rawPosition[0] * currentScale,
@@ -598,5 +602,5 @@ exports.embeddingHandler = embeddingHandler;
598
602
  exports.jepObjectiveHandler = jepObjectiveHandler;
599
603
  exports.mitosisHandler = mitosisHandler;
600
604
  exports.orbitalHandler = orbitalHandler;
601
- //# sourceMappingURL=chunk-AIX25INK.cjs.map
602
- //# sourceMappingURL=chunk-AIX25INK.cjs.map
605
+ //# sourceMappingURL=chunk-TVHSPJ4N.cjs.map
606
+ //# sourceMappingURL=chunk-TVHSPJ4N.cjs.map