@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,8 +1,8 @@
1
1
  'use strict';
2
2
 
3
3
  var chunkAIA52I7T_cjs = require('./chunk-AIA52I7T.cjs');
4
- var chunkHGVXZDSK_cjs = require('./chunk-HGVXZDSK.cjs');
5
- var chunkRMHC2VG7_cjs = require('./chunk-RMHC2VG7.cjs');
4
+ var chunkXUUVDHIF_cjs = require('./chunk-XUUVDHIF.cjs');
5
+ var chunkKKP7JKN4_cjs = require('./chunk-KKP7JKN4.cjs');
6
6
  var chunkHCCQLAA4_cjs = require('./chunk-HCCQLAA4.cjs');
7
7
  var ans = require('@holoscript/core-types/ans');
8
8
 
@@ -14,15 +14,15 @@ chunkHCCQLAA4_cjs.__export(UnrealCompiler_exports, {
14
14
  });
15
15
  function compileToUnreal(composition, options) {
16
16
  const compiler = new exports.UnrealCompiler(options);
17
- return compiler.compile(composition, chunkRMHC2VG7_cjs.createTestCompilerToken());
17
+ return compiler.compile(composition, chunkKKP7JKN4_cjs.createTestCompilerToken());
18
18
  }
19
19
  exports.UnrealCompiler = void 0;
20
20
  var init_UnrealCompiler = chunkHCCQLAA4_cjs.__esm({
21
21
  "src/compiler/UnrealCompiler.ts"() {
22
- chunkRMHC2VG7_cjs.init_CompilerBase();
23
- chunkHGVXZDSK_cjs.init_DomainBlockCompilerMixin();
22
+ chunkKKP7JKN4_cjs.init_CompilerBase();
23
+ chunkXUUVDHIF_cjs.init_DomainBlockCompilerMixin();
24
24
  chunkAIA52I7T_cjs.init_PlatformConditionalCompilerMixin();
25
- exports.UnrealCompiler = class extends chunkRMHC2VG7_cjs.CompilerBase {
25
+ exports.UnrealCompiler = class extends chunkKKP7JKN4_cjs.CompilerBase {
26
26
  constructor(options = {}) {
27
27
  super();
28
28
  this.compilerName = "UnrealCompiler";
@@ -644,32 +644,32 @@ var init_UnrealCompiler = chunkHCCQLAA4_cjs.__esm({
644
644
  this.emitS("");
645
645
  this.emitS("// === v4.2 Domain Blocks ===");
646
646
  let blockIdx = 0;
647
- const compiled = chunkHGVXZDSK_cjs.compileDomainBlocks(
647
+ const compiled = chunkXUUVDHIF_cjs.compileDomainBlocks(
648
648
  domainBlocks,
649
649
  {
650
650
  material: (block) => {
651
- const mat = chunkHGVXZDSK_cjs.compileMaterialBlock(block);
652
- return chunkHGVXZDSK_cjs.materialToUnreal(mat, `DB${blockIdx++}`);
651
+ const mat = chunkXUUVDHIF_cjs.compileMaterialBlock(block);
652
+ return chunkXUUVDHIF_cjs.materialToUnreal(mat, `DB${blockIdx++}`);
653
653
  },
654
654
  physics: (block) => {
655
- const phys = chunkHGVXZDSK_cjs.compilePhysicsBlock(block);
656
- return chunkHGVXZDSK_cjs.physicsToUnreal(phys, `DB${blockIdx++}`);
655
+ const phys = chunkXUUVDHIF_cjs.compilePhysicsBlock(block);
656
+ return chunkXUUVDHIF_cjs.physicsToUnreal(phys, `DB${blockIdx++}`);
657
657
  },
658
658
  vfx: (block) => {
659
- const ps = chunkHGVXZDSK_cjs.compileParticleBlock(block);
660
- return chunkHGVXZDSK_cjs.particlesToUnreal(ps, `DB${blockIdx++}`);
659
+ const ps = chunkXUUVDHIF_cjs.compileParticleBlock(block);
660
+ return chunkXUUVDHIF_cjs.particlesToUnreal(ps, `DB${blockIdx++}`);
661
661
  },
662
662
  postfx: (block) => {
663
- const pp = chunkHGVXZDSK_cjs.compilePostProcessingBlock(block);
664
- return chunkHGVXZDSK_cjs.postProcessingToUnreal(pp, `DB${blockIdx++}`);
663
+ const pp = chunkXUUVDHIF_cjs.compilePostProcessingBlock(block);
664
+ return chunkXUUVDHIF_cjs.postProcessingToUnreal(pp, `DB${blockIdx++}`);
665
665
  },
666
666
  audio: (block) => {
667
- const audio = chunkHGVXZDSK_cjs.compileAudioSourceBlock(block);
668
- return chunkHGVXZDSK_cjs.audioSourceToUnreal(audio, `DB${blockIdx++}`);
667
+ const audio = chunkXUUVDHIF_cjs.compileAudioSourceBlock(block);
668
+ return chunkXUUVDHIF_cjs.audioSourceToUnreal(audio, `DB${blockIdx++}`);
669
669
  },
670
670
  weather: (block) => {
671
- const weather = chunkHGVXZDSK_cjs.compileWeatherBlock(block);
672
- return chunkHGVXZDSK_cjs.weatherToUnreal(weather);
671
+ const weather = chunkXUUVDHIF_cjs.compileWeatherBlock(block);
672
+ return chunkXUUVDHIF_cjs.weatherToUnreal(weather);
673
673
  }
674
674
  },
675
675
  (block) => `// Domain block: ${block.domain}/${block.keyword} "${this.escapeStringValue(block.name, "TypeScript")}"`
@@ -714,5 +714,5 @@ var init_UnrealCompiler = chunkHCCQLAA4_cjs.__esm({
714
714
  exports.UnrealCompiler_exports = UnrealCompiler_exports;
715
715
  exports.compileToUnreal = compileToUnreal;
716
716
  exports.init_UnrealCompiler = init_UnrealCompiler;
717
- //# sourceMappingURL=chunk-27MPVJVZ.cjs.map
718
- //# sourceMappingURL=chunk-27MPVJVZ.cjs.map
717
+ //# sourceMappingURL=chunk-NHWSN2SD.cjs.map
718
+ //# sourceMappingURL=chunk-NHWSN2SD.cjs.map
@@ -1,4 +1,4 @@
1
- import { HoloScriptRuntime } from './chunk-IHESJZSW.js';
1
+ import { HoloScriptRuntime } from './chunk-3NFFOWGG.js';
2
2
  import { HoloScriptCodeParser } from './chunk-URG2SJLK.js';
3
3
 
4
4
  // src/HoloScriptDebugger.ts
@@ -417,5 +417,5 @@ function createDebugger(runtime) {
417
417
  }
418
418
 
419
419
  export { HoloScriptDebugger, createDebugger };
420
- //# sourceMappingURL=chunk-XMWZG36H.js.map
421
- //# sourceMappingURL=chunk-XMWZG36H.js.map
420
+ //# sourceMappingURL=chunk-NV4VMVXU.js.map
421
+ //# sourceMappingURL=chunk-NV4VMVXU.js.map
@@ -2,8 +2,8 @@
2
2
 
3
3
  var chunkFEWUHQNM_cjs = require('./chunk-FEWUHQNM.cjs');
4
4
  var chunkAIA52I7T_cjs = require('./chunk-AIA52I7T.cjs');
5
- var chunkHGVXZDSK_cjs = require('./chunk-HGVXZDSK.cjs');
6
- var chunkRMHC2VG7_cjs = require('./chunk-RMHC2VG7.cjs');
5
+ var chunkXUUVDHIF_cjs = require('./chunk-XUUVDHIF.cjs');
6
+ var chunkKKP7JKN4_cjs = require('./chunk-KKP7JKN4.cjs');
7
7
  var chunkHCCQLAA4_cjs = require('./chunk-HCCQLAA4.cjs');
8
8
  var ans = require('@holoscript/core-types/ans');
9
9
 
@@ -4976,36 +4976,36 @@ function compileAndroidXRDomainBlocks(compiler, composition) {
4976
4976
  compiler.emit("");
4977
4977
  compiler.emit("// === v4.2 Domain Blocks ===");
4978
4978
  let blockIdx = 0;
4979
- const compiled = chunkHGVXZDSK_cjs.compileDomainBlocks(
4979
+ const compiled = chunkXUUVDHIF_cjs.compileDomainBlocks(
4980
4980
  // @ts-expect-error During migration
4981
4981
  domainBlocks,
4982
4982
  {
4983
4983
  material: (block) => {
4984
- const mat = chunkHGVXZDSK_cjs.compileMaterialBlock(block);
4985
- return chunkHGVXZDSK_cjs.materialToAndroidXR(mat, `db${blockIdx++}`);
4984
+ const mat = chunkXUUVDHIF_cjs.compileMaterialBlock(block);
4985
+ return chunkXUUVDHIF_cjs.materialToAndroidXR(mat, `db${blockIdx++}`);
4986
4986
  },
4987
4987
  physics: (block) => {
4988
- const phys = chunkHGVXZDSK_cjs.compilePhysicsBlock(block);
4989
- return chunkHGVXZDSK_cjs.physicsToAndroidXR(phys, `db${blockIdx++}`);
4988
+ const phys = chunkXUUVDHIF_cjs.compilePhysicsBlock(block);
4989
+ return chunkXUUVDHIF_cjs.physicsToAndroidXR(phys, `db${blockIdx++}`);
4990
4990
  },
4991
4991
  vfx: (block) => {
4992
- const ps = chunkHGVXZDSK_cjs.compileParticleBlock(block);
4993
- return chunkHGVXZDSK_cjs.particlesToAndroidXR(ps, `db${blockIdx++}`);
4992
+ const ps = chunkXUUVDHIF_cjs.compileParticleBlock(block);
4993
+ return chunkXUUVDHIF_cjs.particlesToAndroidXR(ps, `db${blockIdx++}`);
4994
4994
  },
4995
4995
  postfx: (block) => {
4996
- const pp = chunkHGVXZDSK_cjs.compilePostProcessingBlock(block);
4996
+ const pp = chunkXUUVDHIF_cjs.compilePostProcessingBlock(block);
4997
4997
  const postfx = pp;
4998
4998
  const effects = postfx.effects.map((e) => `// Effect: ${e.type} \u2014 ${JSON.stringify(e.properties)}`).join("\n");
4999
4999
  return `// Post-Processing: ${postfx.keyword} \u2014 configure via Filament Renderer post-processing
5000
5000
  ${effects}`;
5001
5001
  },
5002
5002
  audio: (block) => {
5003
- const audio = chunkHGVXZDSK_cjs.compileAudioSourceBlock(block);
5004
- return chunkHGVXZDSK_cjs.audioSourceToAndroidXR(audio, `db${blockIdx++}`);
5003
+ const audio = chunkXUUVDHIF_cjs.compileAudioSourceBlock(block);
5004
+ return chunkXUUVDHIF_cjs.audioSourceToAndroidXR(audio, `db${blockIdx++}`);
5005
5005
  },
5006
5006
  weather: (block) => {
5007
- const weather = chunkHGVXZDSK_cjs.compileWeatherBlock(block);
5008
- return chunkHGVXZDSK_cjs.weatherToAndroidXR(weather);
5007
+ const weather = chunkXUUVDHIF_cjs.compileWeatherBlock(block);
5008
+ return chunkXUUVDHIF_cjs.weatherToAndroidXR(weather);
5009
5009
  }
5010
5010
  },
5011
5011
  (block) => `// Domain block: ${block.domain}/${block.keyword} "${compiler.escapeStringValue(block.name, "Kotlin")}"`
@@ -5032,7 +5032,7 @@ function emitTransition(compiler, tr) {
5032
5032
  }
5033
5033
  var init_AndroidXRGenerators = chunkHCCQLAA4_cjs.__esm({
5034
5034
  "src/compiler/AndroidXRGenerators.ts"() {
5035
- chunkHGVXZDSK_cjs.init_DomainBlockCompilerMixin();
5035
+ chunkXUUVDHIF_cjs.init_DomainBlockCompilerMixin();
5036
5036
  init_AndroidXRTraitMap();
5037
5037
  }
5038
5038
  });
@@ -5632,12 +5632,12 @@ function compileToAndroidXR(composition, options) {
5632
5632
  exports.AndroidXRCompiler = void 0;
5633
5633
  var init_AndroidXRCompiler = chunkHCCQLAA4_cjs.__esm({
5634
5634
  "src/compiler/AndroidXRCompiler.ts"() {
5635
- chunkRMHC2VG7_cjs.init_CompilerBase();
5635
+ chunkKKP7JKN4_cjs.init_CompilerBase();
5636
5636
  chunkAIA52I7T_cjs.init_PlatformConditionalCompilerMixin();
5637
5637
  chunkFEWUHQNM_cjs.init_AndroidKotlinHelpers();
5638
5638
  init_AndroidXRGenerators();
5639
5639
  init_AndroidXRGlassesGenerators();
5640
- exports.AndroidXRCompiler = class extends chunkRMHC2VG7_cjs.CompilerBase {
5640
+ exports.AndroidXRCompiler = class extends chunkKKP7JKN4_cjs.CompilerBase {
5641
5641
  constructor(options = {}) {
5642
5642
  super();
5643
5643
  this.compilerName = "AndroidXRCompiler";
@@ -5733,5 +5733,5 @@ exports.compileToAndroidXR = compileToAndroidXR;
5733
5733
  exports.getTraitMapping = getTraitMapping;
5734
5734
  exports.init_AndroidXRCompiler = init_AndroidXRCompiler;
5735
5735
  exports.init_AndroidXRTraitMap = init_AndroidXRTraitMap;
5736
- //# sourceMappingURL=chunk-Y3MWXQSB.cjs.map
5737
- //# sourceMappingURL=chunk-Y3MWXQSB.cjs.map
5736
+ //# sourceMappingURL=chunk-NXZFOPVD.cjs.map
5737
+ //# sourceMappingURL=chunk-NXZFOPVD.cjs.map
@@ -1,10 +1,10 @@
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 ans = require('@holoscript/core-types/ans');
5
5
 
6
6
  // src/compiler/ContextCompiler.ts
7
- chunkRMHC2VG7_cjs.init_CompilerBase();
7
+ chunkKKP7JKN4_cjs.init_CompilerBase();
8
8
  var BANNED_DEFAULT_PATTERNS = [
9
9
  { pattern: /\bgit\s+add\s+(?:-A|--all|\.)(?=\s|$)/i, rule: "F.001/F.011 - git add -A leaked .env twice" },
10
10
  { pattern: /:\s*any\b|\bas\s+any\b|<any>/i, rule: "global CLAUDE.md - no `any` in TypeScript, use `unknown`" },
@@ -28,7 +28,7 @@ var KNOWN_DIAMOND_IDS = /* @__PURE__ */ new Set([
28
28
  // Add more as graduate.py promotes - verify against D:/GOLD/INDEX.md.
29
29
  ]);
30
30
  var DEFAULT_FLUENT_PROSE_CHARS = 150;
31
- var ContextCompiler = class extends chunkRMHC2VG7_cjs.CompilerBase {
31
+ var ContextCompiler = class extends chunkKKP7JKN4_cjs.CompilerBase {
32
32
  constructor(options = {}) {
33
33
  super();
34
34
  this.compilerName = "ContextCompiler";
@@ -1989,5 +1989,5 @@ function toCursorSlug(name) {
1989
1989
  exports.ContextCompileError = ContextCompileError;
1990
1990
  exports.ContextCompiler = ContextCompiler;
1991
1991
  exports.createContextCompiler = createContextCompiler;
1992
- //# sourceMappingURL=chunk-ZUL5AVTX.cjs.map
1993
- //# sourceMappingURL=chunk-ZUL5AVTX.cjs.map
1992
+ //# sourceMappingURL=chunk-OBIYPYYS.cjs.map
1993
+ //# sourceMappingURL=chunk-OBIYPYYS.cjs.map
@@ -1,4 +1,4 @@
1
- import { init_CompilerBase, CompilerBase, escapeStringValue } from './chunk-QTPMJRGS.js';
1
+ import { init_CompilerBase, CompilerBase, escapeStringValue } from './chunk-QPSKHBJP.js';
2
2
  import { init_roomplan, init_lidar_scanner, init_face_tracking, init_ios_object_capture, init_shareplay, init_uwb_positioning, init_airpods_spatial_audio, ROOMPLAN_TRAITS, LIDAR_SCANNER_TRAITS, IOS_OBJECT_CAPTURE_TRAITS, FACE_TRACKING_TRAITS, SHAREPLAY_TRAITS, UWB_POSITIONING_TRAITS, AIRPODS_SPATIAL_AUDIO_TRAITS } from './chunk-SIEXCILW.js';
3
3
  import { init_npu_scene, init_portal_ar, init_camera_hand_tracking, NPU_SCENE_TRAITS, NPU_SCENE_DEFAULTS, PORTAL_AR_TRAITS, CAMERA_HAND_TRACKING_TRAITS } from './chunk-CBJY23VL.js';
4
4
  import { __esm, __export } from './chunk-OL46QLBJ.js';
@@ -5382,5 +5382,5 @@ var init_IOSCompiler = __esm({
5382
5382
  });
5383
5383
 
5384
5384
  export { IOSCompiler, IOSCompiler_exports, compileToIOS, init_IOSCompiler };
5385
- //# sourceMappingURL=chunk-ZXBZVXDW.js.map
5386
- //# sourceMappingURL=chunk-ZXBZVXDW.js.map
5385
+ //# sourceMappingURL=chunk-OMXII44L.js.map
5386
+ //# sourceMappingURL=chunk-OMXII44L.js.map
@@ -1,8 +1,8 @@
1
1
  'use strict';
2
2
 
3
3
  var chunkOIQYIIO3_cjs = require('./chunk-OIQYIIO3.cjs');
4
- var chunkHGVXZDSK_cjs = require('./chunk-HGVXZDSK.cjs');
5
- var chunkRMHC2VG7_cjs = require('./chunk-RMHC2VG7.cjs');
4
+ var chunkXUUVDHIF_cjs = require('./chunk-XUUVDHIF.cjs');
5
+ var chunkKKP7JKN4_cjs = require('./chunk-KKP7JKN4.cjs');
6
6
  var chunkHCCQLAA4_cjs = require('./chunk-HCCQLAA4.cjs');
7
7
  var ans = require('@holoscript/core-types/ans');
8
8
 
@@ -15,8 +15,8 @@ var SHAPE_TO_PRIMITIVE; exports.PlayCanvasCompiler = void 0;
15
15
  var init_PlayCanvasCompiler = chunkHCCQLAA4_cjs.__esm({
16
16
  "src/compiler/PlayCanvasCompiler.ts"() {
17
17
  chunkOIQYIIO3_cjs.init_TraitCompositor();
18
- chunkRMHC2VG7_cjs.init_CompilerBase();
19
- chunkHGVXZDSK_cjs.init_DomainBlockCompilerMixin();
18
+ chunkKKP7JKN4_cjs.init_CompilerBase();
19
+ chunkXUUVDHIF_cjs.init_DomainBlockCompilerMixin();
20
20
  SHAPE_TO_PRIMITIVE = {
21
21
  sphere: "sphere",
22
22
  orb: "sphere",
@@ -32,7 +32,7 @@ var init_PlayCanvasCompiler = chunkHCCQLAA4_cjs.__esm({
32
32
  capsule: "capsule",
33
33
  disc: "plane"
34
34
  };
35
- exports.PlayCanvasCompiler = class extends chunkRMHC2VG7_cjs.CompilerBase {
35
+ exports.PlayCanvasCompiler = class extends chunkKKP7JKN4_cjs.CompilerBase {
36
36
  constructor(options = {}) {
37
37
  super();
38
38
  this.compilerName = "PlayCanvasCompiler";
@@ -146,33 +146,33 @@ var init_PlayCanvasCompiler = chunkHCCQLAA4_cjs.__esm({
146
146
  this.emit("");
147
147
  this.emit("// === v4.2 Domain Blocks ===");
148
148
  let blockIdx = 0;
149
- const compiled = chunkHGVXZDSK_cjs.compileDomainBlocks(
149
+ const compiled = chunkXUUVDHIF_cjs.compileDomainBlocks(
150
150
  // @ts-expect-error During migration
151
151
  domainBlocks,
152
152
  {
153
153
  material: (block) => {
154
- const mat = chunkHGVXZDSK_cjs.compileMaterialBlock(block);
155
- return chunkHGVXZDSK_cjs.materialToPlayCanvas(mat, `db${blockIdx++}`);
154
+ const mat = chunkXUUVDHIF_cjs.compileMaterialBlock(block);
155
+ return chunkXUUVDHIF_cjs.materialToPlayCanvas(mat, `db${blockIdx++}`);
156
156
  },
157
157
  physics: (block) => {
158
- const phys = chunkHGVXZDSK_cjs.compilePhysicsBlock(block);
159
- return chunkHGVXZDSK_cjs.physicsToPlayCanvas(phys, `db${blockIdx++}`);
158
+ const phys = chunkXUUVDHIF_cjs.compilePhysicsBlock(block);
159
+ return chunkXUUVDHIF_cjs.physicsToPlayCanvas(phys, `db${blockIdx++}`);
160
160
  },
161
161
  vfx: (block) => {
162
- const ps = chunkHGVXZDSK_cjs.compileParticleBlock(block);
163
- return chunkHGVXZDSK_cjs.particlesToPlayCanvas(ps, `db${blockIdx++}`);
162
+ const ps = chunkXUUVDHIF_cjs.compileParticleBlock(block);
163
+ return chunkXUUVDHIF_cjs.particlesToPlayCanvas(ps, `db${blockIdx++}`);
164
164
  },
165
165
  postfx: (block) => {
166
- const pp = chunkHGVXZDSK_cjs.compilePostProcessingBlock(block);
166
+ const pp = chunkXUUVDHIF_cjs.compilePostProcessingBlock(block);
167
167
  return `// Post-Processing: ${pp.keyword} \u2014 configure via PlayCanvas PostEffects
168
168
  ` + pp.effects.map((e) => `// Effect: ${e.type} \u2014 ${JSON.stringify(e.properties)}`).join("\n");
169
169
  },
170
170
  audio: (block) => {
171
- const audio = chunkHGVXZDSK_cjs.compileAudioSourceBlock(block);
172
- return chunkHGVXZDSK_cjs.audioSourceToPlayCanvas(audio, `db${blockIdx++}`);
171
+ const audio = chunkXUUVDHIF_cjs.compileAudioSourceBlock(block);
172
+ return chunkXUUVDHIF_cjs.audioSourceToPlayCanvas(audio, `db${blockIdx++}`);
173
173
  },
174
174
  weather: (block) => {
175
- const weather = chunkHGVXZDSK_cjs.compileWeatherBlock(block);
175
+ const weather = chunkXUUVDHIF_cjs.compileWeatherBlock(block);
176
176
  return `// Weather: ${weather.keyword} "${weather.name || ""}" \u2014 implement via PlayCanvas particle system
177
177
  ` + weather.layers.map((l) => `// Layer: ${l.type} \u2014 ${JSON.stringify(l.properties)}`).join("\n");
178
178
  }
@@ -755,5 +755,5 @@ var init_PlayCanvasCompiler = chunkHCCQLAA4_cjs.__esm({
755
755
 
756
756
  exports.PlayCanvasCompiler_exports = PlayCanvasCompiler_exports;
757
757
  exports.init_PlayCanvasCompiler = init_PlayCanvasCompiler;
758
- //# sourceMappingURL=chunk-MJVIRCUV.cjs.map
759
- //# sourceMappingURL=chunk-MJVIRCUV.cjs.map
758
+ //# sourceMappingURL=chunk-OR4Q2BGL.cjs.map
759
+ //# sourceMappingURL=chunk-OR4Q2BGL.cjs.map
@@ -1,8 +1,8 @@
1
1
  import { init_ProvenanceSemiring, ProvenanceSemiring } from './chunk-TJHVSBP2.js';
2
2
  import { init_TraitCompositor, TraitCompositor } from './chunk-4C57PR42.js';
3
3
  import { init_PlatformConditionalCompilerMixin, createPlatformTarget, PlatformConditionalCompilerMixin } from './chunk-GZG4KA4E.js';
4
- import { init_DomainBlockCompilerMixin, compileDomainBlocks, compileWeatherBlock, compileAudioSourceBlock, audioSourceToBabylon, compilePostProcessingBlock, postProcessingToBabylon, compileParticleBlock, particlesToBabylon, compilePhysicsBlock, physicsToBabylon, compileMaterialBlock, materialToBabylon } from './chunk-W55Z7QIX.js';
5
- import { init_CompilerBase, CompilerBase } from './chunk-QTPMJRGS.js';
4
+ import { init_DomainBlockCompilerMixin, compileDomainBlocks, compileWeatherBlock, compileAudioSourceBlock, audioSourceToBabylon, compilePostProcessingBlock, postProcessingToBabylon, compileParticleBlock, particlesToBabylon, compilePhysicsBlock, physicsToBabylon, compileMaterialBlock, materialToBabylon } from './chunk-JCLBKPMX.js';
5
+ import { init_CompilerBase, CompilerBase } from './chunk-QPSKHBJP.js';
6
6
  import { __export, __esm } from './chunk-OL46QLBJ.js';
7
7
  import { ANSCapabilityPath } from '@holoscript/core-types/ans';
8
8
 
@@ -840,5 +840,5 @@ ${layers}`;
840
840
  });
841
841
 
842
842
  export { BabylonCompiler, BabylonCompiler_exports, init_BabylonCompiler };
843
- //# sourceMappingURL=chunk-6ASWLXXN.js.map
844
- //# sourceMappingURL=chunk-6ASWLXXN.js.map
843
+ //# sourceMappingURL=chunk-PHVRG4I2.js.map
844
+ //# sourceMappingURL=chunk-PHVRG4I2.js.map
@@ -3907,6 +3907,7 @@ var init_ANSNamespace = __esm({
3907
3907
  UNITY: "/compile/gamedev/unity",
3908
3908
  UNREAL: "/compile/gamedev/unreal",
3909
3909
  GODOT: "/compile/gamedev/godot",
3910
+ CANVAS2D_GAME: "/compile/gamedev/canvas2d-game",
3910
3911
  // ── social-vr ────────────────────────────────────────────────────────
3911
3912
  VRCHAT: "/compile/social-vr/vrchat",
3912
3913
  // ── xr ───────────────────────────────────────────────────────────────
@@ -3964,6 +3965,7 @@ var init_ANSNamespace = __esm({
3964
3965
  unity: ANSDomain.GAMEDEV,
3965
3966
  unreal: ANSDomain.GAMEDEV,
3966
3967
  godot: ANSDomain.GAMEDEV,
3968
+ "canvas2d-game": ANSDomain.GAMEDEV,
3967
3969
  // social-vr
3968
3970
  vrchat: ANSDomain.SOCIAL_VR,
3969
3971
  // xr
@@ -4020,6 +4022,7 @@ var init_ANSNamespace = __esm({
4020
4022
  unity: ANSCapabilityPath.UNITY,
4021
4023
  unreal: ANSCapabilityPath.UNREAL,
4022
4024
  godot: ANSCapabilityPath.GODOT,
4025
+ "canvas2d-game": ANSCapabilityPath.CANVAS2D_GAME,
4023
4026
  vrchat: ANSCapabilityPath.VRCHAT,
4024
4027
  openxr: ANSCapabilityPath.OPENXR,
4025
4028
  "openxr-spatial-entities": ANSCapabilityPath.OPENXR_SPATIAL_ENTITIES,
@@ -5463,6 +5466,7 @@ var init_CompilerBase = __esm({
5463
5466
  UnityCompiler: "unity",
5464
5467
  UnrealCompiler: "unreal",
5465
5468
  GodotCompiler: "godot",
5469
+ Canvas2DGameCompiler: "canvas2d-game",
5466
5470
  VRChatCompiler: "vrchat",
5467
5471
  OpenXRCompiler: "openxr",
5468
5472
  OpenXRSpatialEntitiesCompiler: "openxr-spatial-entities",
@@ -5955,5 +5959,5 @@ Required Permission: ${decision.requiredPermission || "unknown"}`
5955
5959
  });
5956
5960
 
5957
5961
  export { ANSCapabilityPath, BUILTIN_NORMS, BUILTIN_NORM_PROVENANCE, CompilerBase, CompilerDocumentationGenerator, UNKNOWN_NORM_PROVENANCE, UnauthorizedCompilerAccessError, createTestCompilerToken, criticalMassForChange, deserializeNormProvenance, escapeStringValue, getBuiltinNorm, getRBAC, init_ANSNamespace, init_AgentRBAC, init_CompilerBase, init_CompilerDocumentationGenerator, init_CultureTraits, isCapabilityTokenCredential, normalizeNormProvenance, normsByCategory, serializeNormProvenance };
5958
- //# sourceMappingURL=chunk-QTPMJRGS.js.map
5959
- //# sourceMappingURL=chunk-QTPMJRGS.js.map
5962
+ //# sourceMappingURL=chunk-QPSKHBJP.js.map
5963
+ //# sourceMappingURL=chunk-QPSKHBJP.js.map
@@ -1,4 +1,4 @@
1
- import { init_CompilerBase, CompilerBase } from './chunk-QTPMJRGS.js';
1
+ import { init_CompilerBase, CompilerBase } from './chunk-QPSKHBJP.js';
2
2
  import { ANSCapabilityPath } from '@holoscript/core-types/ans';
3
3
 
4
4
  // src/compiler/ContextCompiler.ts
@@ -1985,5 +1985,5 @@ function toCursorSlug(name) {
1985
1985
  }
1986
1986
 
1987
1987
  export { ContextCompileError, ContextCompiler, createContextCompiler };
1988
- //# sourceMappingURL=chunk-VEXPG4WN.js.map
1989
- //# sourceMappingURL=chunk-VEXPG4WN.js.map
1988
+ //# sourceMappingURL=chunk-QXH7QDSZ.js.map
1989
+ //# sourceMappingURL=chunk-QXH7QDSZ.js.map
@@ -0,0 +1,207 @@
1
+ // src/events/EventBus.ts
2
+ var EventBus = class {
3
+ constructor() {
4
+ this.listeners = /* @__PURE__ */ new Map();
5
+ this.history = [];
6
+ this.maxHistory = 100;
7
+ this.nextId = 0;
8
+ this.paused = false;
9
+ }
10
+ /**
11
+ * Subscribe to an event.
12
+ */
13
+ on(event, callback, priority = 0) {
14
+ const id = this.nextId++;
15
+ const list = this.listeners.get(event) || [];
16
+ list.push({ callback, priority, once: false, id });
17
+ list.sort((a, b) => b.priority - a.priority);
18
+ this.listeners.set(event, list);
19
+ return id;
20
+ }
21
+ /**
22
+ * Subscribe to an event once (auto-removes after first fire).
23
+ */
24
+ once(event, callback, priority = 0) {
25
+ const id = this.nextId++;
26
+ const list = this.listeners.get(event) || [];
27
+ list.push({ callback, priority, once: true, id });
28
+ list.sort((a, b) => b.priority - a.priority);
29
+ this.listeners.set(event, list);
30
+ return id;
31
+ }
32
+ /**
33
+ * Unsubscribe by listener ID.
34
+ */
35
+ off(listenerId) {
36
+ for (const [event, list] of this.listeners) {
37
+ const idx = list.findIndex((l) => l.id === listenerId);
38
+ if (idx !== -1) {
39
+ list.splice(idx, 1);
40
+ return;
41
+ }
42
+ }
43
+ }
44
+ /**
45
+ * Unsubscribe all listeners for an event.
46
+ */
47
+ offAll(event) {
48
+ this.listeners.delete(event);
49
+ }
50
+ /**
51
+ * Emit an event to all subscribers.
52
+ */
53
+ emit(event, data) {
54
+ if (this.paused) return;
55
+ this.history.push({ event, data, timestamp: Date.now() });
56
+ if (this.history.length > this.maxHistory) this.history.shift();
57
+ const list = this.listeners.get(event);
58
+ if (list) {
59
+ const toRemove = [];
60
+ for (const listener of list) {
61
+ listener.callback(data);
62
+ if (listener.once) toRemove.push(listener.id);
63
+ }
64
+ for (const id of toRemove) {
65
+ const idx = list.findIndex((l) => l.id === id);
66
+ if (idx !== -1) list.splice(idx, 1);
67
+ }
68
+ }
69
+ if (event !== "*") {
70
+ const wildcardList = this.listeners.get("*");
71
+ if (wildcardList) {
72
+ for (const listener of wildcardList) {
73
+ listener.callback({ event, data });
74
+ }
75
+ }
76
+ }
77
+ }
78
+ /**
79
+ * Get event history.
80
+ */
81
+ getHistory() {
82
+ return [...this.history];
83
+ }
84
+ /**
85
+ * Get listener count for an event.
86
+ */
87
+ listenerCount(event) {
88
+ return this.listeners.get(event)?.length || 0;
89
+ }
90
+ /**
91
+ * Pause/resume event emission.
92
+ */
93
+ setPaused(paused) {
94
+ this.paused = paused;
95
+ }
96
+ /**
97
+ * Clear all listeners and history.
98
+ */
99
+ clear() {
100
+ this.listeners.clear();
101
+ this.history = [];
102
+ }
103
+ };
104
+ var sharedBus = null;
105
+ function getSharedEventBus() {
106
+ if (!sharedBus) sharedBus = new EventBus();
107
+ return sharedBus;
108
+ }
109
+ function setSharedEventBus(bus) {
110
+ sharedBus = bus;
111
+ }
112
+
113
+ // src/monitoring/telemetry.ts
114
+ var TelemetryRegistry = class {
115
+ constructor() {
116
+ this.measurements = [];
117
+ this.maxHistory = 1e4;
118
+ }
119
+ /**
120
+ * Increments a monotonic counter (e.g., total_nodes_executed)
121
+ */
122
+ incrementCounter(name, value = 1, labels) {
123
+ this.measurements.push({
124
+ name,
125
+ type: "counter",
126
+ value,
127
+ labels,
128
+ timestamp: Date.now()
129
+ });
130
+ if (this.measurements.length > this.maxHistory) this.measurements.shift();
131
+ }
132
+ /**
133
+ * Records an instantaneous value (e.g., active_agents)
134
+ */
135
+ setGauge(name, value, labels) {
136
+ this.measurements.push({
137
+ name,
138
+ type: "gauge",
139
+ value,
140
+ labels,
141
+ timestamp: Date.now()
142
+ });
143
+ if (this.measurements.length > this.maxHistory) this.measurements.shift();
144
+ }
145
+ /**
146
+ * Wraps an async function and records its execution latency into a histogram.
147
+ */
148
+ async measureLatency(name, fn, labels) {
149
+ const start = performance.now();
150
+ try {
151
+ return await fn();
152
+ } finally {
153
+ const duration = performance.now() - start;
154
+ this.measurements.push({
155
+ name,
156
+ type: "histogram",
157
+ value: duration,
158
+ labels,
159
+ timestamp: Date.now()
160
+ });
161
+ if (this.measurements.length > this.maxHistory) this.measurements.shift();
162
+ if (duration > 500) {
163
+ this.measurements.push({
164
+ name: "slo_violation_count",
165
+ type: "counter",
166
+ value: 1,
167
+ labels: { ...labels, metric_name: name, threshold: "500ms" },
168
+ timestamp: Date.now()
169
+ });
170
+ }
171
+ }
172
+ }
173
+ /**
174
+ * Snapshots current aggregations for dashboard export.
175
+ */
176
+ getSnapshot() {
177
+ const snapshot = { counters: {}, histograms: {}, gauges: {} };
178
+ const histAggregations = {};
179
+ for (const m of this.measurements) {
180
+ const key = m.labels ? `${m.name}{${JSON.stringify(m.labels)}}` : m.name;
181
+ if (m.type === "counter") {
182
+ snapshot.counters[key] = (snapshot.counters[key] || 0) + m.value;
183
+ } else if (m.type === "gauge") {
184
+ snapshot.gauges[key] = m.value;
185
+ } else if (m.type === "histogram") {
186
+ if (!histAggregations[key]) histAggregations[key] = { count: 0, sum: 0, max: 0 };
187
+ histAggregations[key].count++;
188
+ histAggregations[key].sum += m.value;
189
+ if (m.value > histAggregations[key].max) histAggregations[key].max = m.value;
190
+ }
191
+ }
192
+ for (const [key, agg] of Object.entries(histAggregations)) {
193
+ snapshot.histograms[key] = {
194
+ count: agg.count,
195
+ sum: agg.sum,
196
+ avg: agg.count > 0 ? agg.sum / agg.count : 0,
197
+ max: agg.max
198
+ };
199
+ }
200
+ return snapshot;
201
+ }
202
+ };
203
+ var telemetry = new TelemetryRegistry();
204
+
205
+ export { EventBus, getSharedEventBus, setSharedEventBus, telemetry };
206
+ //# sourceMappingURL=chunk-RARB3MBR.js.map
207
+ //# sourceMappingURL=chunk-RARB3MBR.js.map