@holoscript/core 8.0.12 → 8.0.14

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/README.md +14 -0
  2. package/bin/holo-decision.mjs +133 -0
  3. package/dist/{GLTFPipeline-L76YTXKA.js → GLTFPipeline-6LS3UDYX.js} +6 -6
  4. package/dist/{GLTFPipeline-ZWJN7GI6.cjs → GLTFPipeline-VTI6PRRQ.cjs} +10 -10
  5. package/dist/{HoloCompositionParser-FLBZKFD3.js → HoloCompositionParser-GILABNN3.js} +5 -5
  6. package/dist/{HoloCompositionParser-3XEC7IJC.cjs → HoloCompositionParser-ZVRYVEA5.cjs} +12 -12
  7. package/dist/{HoloScriptPlusParser-RNUCHOAJ.cjs → HoloScriptPlusParser-WTPRPRPR.cjs} +8 -8
  8. package/dist/{HoloScriptPlusParser-55AY4MUF.js → HoloScriptPlusParser-ZP53ECSL.js} +5 -5
  9. package/dist/{SceneIRCompiler-KWUFHZ4O.cjs → SceneIRCompiler-7KQ5NKAU.cjs} +11 -11
  10. package/dist/{SceneIRCompiler-63KA3M2F.js → SceneIRCompiler-VX75RB6H.js} +6 -6
  11. package/dist/{chunk-EM2OGPYE.js → chunk-2GKF7JQ6.js} +3 -3
  12. package/dist/{chunk-HVX7QQYK.js → chunk-3KHRZTNW.js} +3 -3
  13. package/dist/{chunk-UTUD6GJI.js → chunk-42Z3SVHQ.js} +3 -3
  14. package/dist/{chunk-Z4IUBW46.js → chunk-47XZ62KM.js} +112 -55
  15. package/dist/{chunk-GGR7QUKK.cjs → chunk-4CRMVEON.cjs} +37 -37
  16. package/dist/{chunk-QBY7LRN2.js → chunk-4NEPHK2K.js} +3 -3
  17. package/dist/{chunk-65S62L4D.cjs → chunk-5B2AJKA5.cjs} +20 -20
  18. package/dist/{chunk-PJFTTSKE.js → chunk-5T6BWIB7.js} +4 -4
  19. package/dist/{chunk-KFVNCW4Q.js → chunk-62OYZT6Q.js} +3 -3
  20. package/dist/{chunk-3KMANSQJ.cjs → chunk-645EWDZW.cjs} +4 -4
  21. package/dist/{chunk-BP4KTMLY.js → chunk-6FCNMTL5.js} +4 -4
  22. package/dist/{chunk-77QI552M.js → chunk-73EDVY5D.js} +3 -3
  23. package/dist/{chunk-7IDJDMPU.cjs → chunk-7FYSSI3C.cjs} +27 -2
  24. package/dist/{chunk-WNYXT4TE.cjs → chunk-7ITJP33Q.cjs} +3 -3
  25. package/dist/chunk-7ZKQ32XK.js +1571 -0
  26. package/dist/{chunk-P7JEKJTZ.cjs → chunk-B6JHTTMR.cjs} +25 -14
  27. package/dist/{chunk-FG6PYGIZ.js → chunk-BLCWQ225.js} +4 -4
  28. package/dist/{chunk-7NPZZZD7.js → chunk-C73GVAYC.js} +16 -9
  29. package/dist/{chunk-RMOEL2GD.cjs → chunk-CESMPUEZ.cjs} +3794 -1137
  30. package/dist/{chunk-SQXAZHDG.js → chunk-CHIZSMWD.js} +3 -3
  31. package/dist/{chunk-G35CAQ7I.cjs → chunk-D44CEFY4.cjs} +5 -5
  32. package/dist/chunk-ERYKKPHW.cjs +1884 -0
  33. package/dist/{chunk-TYNRXRHF.js → chunk-EYHPTJ3F.js} +3695 -1045
  34. package/dist/{chunk-J3UHV5T4.cjs → chunk-FGXJPJ3W.cjs} +4 -4
  35. package/dist/{chunk-IJU6AS67.cjs → chunk-FHR2AVMA.cjs} +23 -23
  36. package/dist/{chunk-LMB555QB.cjs → chunk-FOM36K5I.cjs} +18 -18
  37. package/dist/{chunk-JBYBMBMW.js → chunk-FWKEY4LD.js} +3 -2
  38. package/dist/{chunk-ZRPALBQB.cjs → chunk-GGH3ZYDB.cjs} +5 -5
  39. package/dist/{chunk-2BYAUHBO.js → chunk-GI5YYZH6.js} +3 -3
  40. package/dist/{chunk-VTEXJOSD.cjs → chunk-GYJLP4BO.cjs} +30 -30
  41. package/dist/{chunk-OC6GV5QH.cjs → chunk-HCONR4J6.cjs} +38 -38
  42. package/dist/{chunk-B3CWTCK2.js → chunk-IA7FCSRY.js} +27 -2
  43. package/dist/{chunk-5FYMCVBY.js → chunk-IXFNA5TT.js} +4 -4
  44. package/dist/{chunk-G6KACNMO.js → chunk-JCVSCKUH.js} +4 -4
  45. package/dist/{chunk-FHVPN7BN.js → chunk-JQCXLKAU.js} +3 -3
  46. package/dist/{chunk-F3YT6GUF.cjs → chunk-KLM6QD6D.cjs} +14 -14
  47. package/dist/{chunk-UGQ3QNV6.js → chunk-KOGPVAP6.js} +24 -8
  48. package/dist/{chunk-CKV5NYAE.js → chunk-KYJD2UMV.js} +4 -4
  49. package/dist/{chunk-LB3ZZMKT.cjs → chunk-L4DBUX3N.cjs} +10 -10
  50. package/dist/{chunk-RXQNRZ5F.js → chunk-LGRKBTPM.js} +3 -3
  51. package/dist/{chunk-OMNHTCS4.cjs → chunk-LHUDAJQT.cjs} +3 -2
  52. package/dist/{chunk-PDXX5UI4.cjs → chunk-LQNL3IYV.cjs} +38 -38
  53. package/dist/{chunk-WWNCM473.js → chunk-M7XR3F53.js} +4 -4
  54. package/dist/{chunk-IFW5IW4L.cjs → chunk-ML4V5PVU.cjs} +670 -627
  55. package/dist/{chunk-656IAS7B.cjs → chunk-N7IYRAFG.cjs} +21 -14
  56. package/dist/chunk-N7MIIDLI.cjs +1605 -0
  57. package/dist/{chunk-USOUXQYD.js → chunk-NWKARJM2.js} +130 -22
  58. package/dist/{chunk-VVAAZITA.cjs → chunk-OOP4S3GU.cjs} +5 -5
  59. package/dist/{chunk-TX6ZBIF4.js → chunk-ORBVCOTC.js} +3 -3
  60. package/dist/{chunk-RRQIAJLQ.cjs → chunk-OSKGCXAQ.cjs} +5 -5
  61. package/dist/{chunk-QEDMOGF3.cjs → chunk-P65OIMJT.cjs} +7 -7
  62. package/dist/{chunk-QM7FJB5W.js → chunk-PSWCJQS4.js} +4 -4
  63. package/dist/{chunk-7N63JHUN.cjs → chunk-PZ46WRHX.cjs} +8 -8
  64. package/dist/{chunk-AATYYLYK.js → chunk-Q4J2K7FI.js} +16 -5
  65. package/dist/chunk-QLPRI3QW.js +1875 -0
  66. package/dist/{chunk-WTH23ISI.js → chunk-R5VKLUMR.js} +4 -4
  67. package/dist/{chunk-NQN5LFN4.cjs → chunk-REN3LHO6.cjs} +19 -19
  68. package/dist/{chunk-JEJ7TT54.js → chunk-RVN7OPCP.js} +4 -4
  69. package/dist/{chunk-ZK7KX5CD.cjs → chunk-SE2Y5BSL.cjs} +6 -6
  70. package/dist/{chunk-2X3IPCBK.cjs → chunk-SKVBUGMC.cjs} +7 -7
  71. package/dist/{chunk-GZPUA2TL.cjs → chunk-SNMQUWIO.cjs} +10 -10
  72. package/dist/{chunk-OIBRWLPY.cjs → chunk-TKDDIE3T.cjs} +54 -3
  73. package/dist/{chunk-5H5GFBMG.cjs → chunk-TMNAKNV2.cjs} +112 -55
  74. package/dist/{chunk-5LVFTGKH.js → chunk-TZQKJOPC.js} +3 -3
  75. package/dist/{chunk-TSTFYGGX.js → chunk-UKEK2NZJ.js} +3 -3
  76. package/dist/{chunk-3IUHTGDD.cjs → chunk-VA7THINF.cjs} +38 -38
  77. package/dist/{chunk-Z557DVYN.js → chunk-VMCR5QVI.js} +4 -4
  78. package/dist/{chunk-IS7NTKY5.cjs → chunk-VTFLKSJL.cjs} +14 -14
  79. package/dist/{chunk-VO52AJD5.js → chunk-VXHB6ZHY.js} +4 -4
  80. package/dist/{chunk-S4O7CFHQ.cjs → chunk-VZI7S7P6.cjs} +7 -7
  81. package/dist/{chunk-BQJ3YBF3.js → chunk-W4AJMMQR.js} +667 -628
  82. package/dist/{chunk-2KKOYZYI.cjs → chunk-XZC75AJ4.cjs} +5 -5
  83. package/dist/{chunk-FWCHPCD4.js → chunk-Y2OCKXVD.js} +4 -4
  84. package/dist/{chunk-EI5G5JLY.cjs → chunk-YBM34FUJ.cjs} +134 -22
  85. package/dist/{chunk-DUG3OQAS.js → chunk-YDSNDCV3.js} +3 -3
  86. package/dist/{chunk-566ZB4LZ.cjs → chunk-YM7UUYR5.cjs} +5 -5
  87. package/dist/{chunk-BCP4E7MD.cjs → chunk-YMI3ED3B.cjs} +26 -10
  88. package/dist/{chunk-CP7V3ATL.js → chunk-Z7NUL73U.js} +51 -4
  89. package/dist/cli/holoscript-runner.cjs +11 -11
  90. package/dist/cli/holoscript-runner.js +4 -4
  91. package/dist/compiler/agent-inference.cjs +8 -8
  92. package/dist/compiler/agent-inference.js +4 -4
  93. package/dist/compiler/android-xr.cjs +7 -7
  94. package/dist/compiler/android-xr.js +5 -5
  95. package/dist/compiler/android.cjs +6 -6
  96. package/dist/compiler/android.js +4 -4
  97. package/dist/compiler/context.cjs +6 -6
  98. package/dist/compiler/context.js +3 -3
  99. package/dist/compiler/daimon-seed.cjs +9 -9
  100. package/dist/compiler/daimon-seed.js +4 -4
  101. package/dist/compiler/domain-block-utils.cjs +165 -165
  102. package/dist/compiler/domain-block-utils.js +4 -4
  103. package/dist/compiler/dtdl.cjs +7 -7
  104. package/dist/compiler/dtdl.js +4 -4
  105. package/dist/compiler/gltf-pipeline.cjs +8 -8
  106. package/dist/compiler/gltf-pipeline.js +1 -1
  107. package/dist/compiler/godot.cjs +6 -6
  108. package/dist/compiler/godot.js +5 -5
  109. package/dist/compiler/incremental.cjs +8 -8
  110. package/dist/compiler/incremental.js +3 -3
  111. package/dist/compiler/index.cjs +871 -207
  112. package/dist/compiler/index.d.ts +21 -1
  113. package/dist/compiler/index.js +696 -60
  114. package/dist/compiler/ios.cjs +6 -6
  115. package/dist/compiler/ios.js +4 -4
  116. package/dist/compiler/llm-provider-capabilities.cjs +6 -6
  117. package/dist/compiler/llm-provider-capabilities.js +3 -3
  118. package/dist/compiler/openxr.cjs +6 -6
  119. package/dist/compiler/openxr.js +5 -5
  120. package/dist/compiler/sdf.cjs +7 -7
  121. package/dist/compiler/sdf.js +5 -5
  122. package/dist/compiler/state.cjs +6 -6
  123. package/dist/compiler/state.js +4 -4
  124. package/dist/compiler/trait-composition.cjs +7 -7
  125. package/dist/compiler/trait-composition.js +3 -3
  126. package/dist/compiler/unity.cjs +6 -6
  127. package/dist/compiler/unity.js +5 -5
  128. package/dist/compiler/unreal.cjs +7 -7
  129. package/dist/compiler/unreal.js +5 -5
  130. package/dist/compiler/urdf.cjs +14 -14
  131. package/dist/compiler/urdf.js +5 -5
  132. package/dist/compiler/usd-physics.cjs +7 -7
  133. package/dist/compiler/usd-physics.js +4 -4
  134. package/dist/compiler/visionos.cjs +6 -6
  135. package/dist/compiler/visionos.js +5 -5
  136. package/dist/compiler/vrchat.cjs +7 -7
  137. package/dist/compiler/vrchat.js +5 -5
  138. package/dist/compiler/wasm.cjs +10 -10
  139. package/dist/compiler/wasm.js +5 -5
  140. package/dist/compiler/webgpu.cjs +6 -6
  141. package/dist/compiler/webgpu.js +5 -5
  142. package/dist/constants.cjs +3 -3
  143. package/dist/constants.js +1 -1
  144. package/dist/entries/scripting.cjs +6 -6
  145. package/dist/entries/scripting.js +2 -2
  146. package/dist/evolution/index.cjs +21 -17
  147. package/dist/evolution/index.d.ts +9 -0
  148. package/dist/evolution/index.js +6 -6
  149. package/dist/index.cjs +930 -703
  150. package/dist/index.d.ts +70 -5
  151. package/dist/index.js +192 -109
  152. package/dist/parser.cjs +19 -19
  153. package/dist/parser.js +5 -5
  154. package/dist/reconstruction/index.cjs +127 -38
  155. package/dist/reconstruction/index.d.ts +159 -0
  156. package/dist/reconstruction/index.js +11 -2
  157. package/dist/runtime.d.ts +1 -0
  158. package/dist/traitDocs/traitDocs.cjs +8 -8
  159. package/dist/traitDocs/traitDocs.js +2 -2
  160. package/dist/traits/index.cjs +566 -471
  161. package/dist/traits/index.js +93 -11
  162. package/package.json +25 -41
  163. package/dist/chunk-G3BM3CT4.cjs +0 -639
  164. package/dist/chunk-KEYG7HGY.js +0 -1062
  165. package/dist/chunk-QX34ELJ7.js +0 -625
  166. package/dist/chunk-W2GA3EQB.cjs +0 -1065
@@ -2725,6 +2725,44 @@ var evolveProgramHandler = {
2725
2725
  }
2726
2726
  };
2727
2727
 
2728
+ // src/traits/FreezeWhenTrait.ts
2729
+ var DEFAULT_EXEMPT = ["fix", "native-format", "infra-repair"];
2730
+ var freezeWhenHandler = {
2731
+ name: "freeze_when",
2732
+ defaultConfig: {
2733
+ id: "",
2734
+ scope: "",
2735
+ signal: "",
2736
+ unfreeze: "",
2737
+ exempt: DEFAULT_EXEMPT,
2738
+ severity: "advisory",
2739
+ reason: "",
2740
+ repair: ""
2741
+ },
2742
+ onAttach(node, config, context) {
2743
+ node.__freezeWhen = {
2744
+ id: config.id,
2745
+ scope: config.scope,
2746
+ signal: config.signal,
2747
+ unfreeze: config.unfreeze,
2748
+ exempt: config.exempt ?? DEFAULT_EXEMPT,
2749
+ severity: config.severity ?? "advisory",
2750
+ reason: config.reason ?? "",
2751
+ repair: config.repair ?? ""
2752
+ };
2753
+ context.emit?.("freeze_declared", {
2754
+ node,
2755
+ rule: node.__freezeWhen,
2756
+ derived: true,
2757
+ nativeExempt: true
2758
+ });
2759
+ },
2760
+ onDetach(node, _config, context) {
2761
+ delete node.__freezeWhen;
2762
+ context.emit?.("freeze_when_detached", { node });
2763
+ }
2764
+ };
2765
+
2728
2766
  // src/traits/AiUpscalingTrait.ts
2729
2767
  var aiUpscalingHandler = {
2730
2768
  name: "ai_upscaling",
@@ -24323,6 +24361,200 @@ export default IframeSandbox;`;
24323
24361
  }
24324
24362
  };
24325
24363
 
24364
+ // src/traits/RetryTrait.ts
24365
+ function computeDelay(config, attempt) {
24366
+ let delay;
24367
+ switch (config.backoff) {
24368
+ case "exponential":
24369
+ delay = config.base_delay_ms * Math.pow(2, attempt);
24370
+ break;
24371
+ case "linear":
24372
+ delay = config.base_delay_ms * (attempt + 1);
24373
+ break;
24374
+ case "constant":
24375
+ default:
24376
+ delay = config.base_delay_ms;
24377
+ break;
24378
+ }
24379
+ delay = Math.min(delay, config.max_delay_ms);
24380
+ if (config.jitter > 0) {
24381
+ const jitterAmount = delay * config.jitter;
24382
+ delay += Math.random() * jitterAmount * 2 - jitterAmount;
24383
+ }
24384
+ return Math.max(0, Math.round(delay));
24385
+ }
24386
+ var retryHandler = {
24387
+ name: "retry",
24388
+ defaultConfig: {
24389
+ max_retries: 3,
24390
+ base_delay_ms: 1e3,
24391
+ max_delay_ms: 3e4,
24392
+ backoff: "exponential",
24393
+ jitter: 0.1,
24394
+ circuit_threshold: 5,
24395
+ circuit_reset_ms: 6e4
24396
+ },
24397
+ onAttach(node, _config, _context) {
24398
+ const state = {
24399
+ circuit: "closed",
24400
+ consecutiveFailures: 0,
24401
+ circuitOpenedAt: 0,
24402
+ totalAttempts: 0,
24403
+ totalSuccesses: 0,
24404
+ totalFailures: 0,
24405
+ pendingActions: /* @__PURE__ */ new Map(),
24406
+ actionCounter: 0
24407
+ };
24408
+ node.__retryState = state;
24409
+ },
24410
+ onDetach(node, _config, _context) {
24411
+ delete node.__retryState;
24412
+ },
24413
+ onUpdate(node, config, context, _delta) {
24414
+ const state = node.__retryState;
24415
+ if (!state) return;
24416
+ if (state.circuit === "open") {
24417
+ const elapsed = Date.now() - state.circuitOpenedAt;
24418
+ if (elapsed >= config.circuit_reset_ms) {
24419
+ state.circuit = "half-open";
24420
+ context.emit?.("retry:circuit_half", {
24421
+ testAttempt: state.totalAttempts + 1
24422
+ });
24423
+ }
24424
+ }
24425
+ },
24426
+ onEvent(node, config, context, event) {
24427
+ const state = node.__retryState;
24428
+ if (!state) return;
24429
+ const eventType = typeof event === "string" ? event : event.type;
24430
+ const payload = extractPayload(event);
24431
+ switch (eventType) {
24432
+ case "retry:execute": {
24433
+ const actionName = payload.action;
24434
+ if (!actionName) break;
24435
+ if (state.circuit === "open") {
24436
+ context.emit?.("retry:failure", {
24437
+ actionName,
24438
+ attempt: 0,
24439
+ error: "Circuit breaker is OPEN"
24440
+ });
24441
+ break;
24442
+ }
24443
+ const retryId = `retry_${state.actionCounter++}`;
24444
+ state.pendingActions.set(retryId, {
24445
+ actionName,
24446
+ attempt: 0,
24447
+ startedAt: Date.now()
24448
+ });
24449
+ state.totalAttempts++;
24450
+ context.emit?.("retry:attempt", {
24451
+ retryId,
24452
+ actionName,
24453
+ attempt: 0,
24454
+ maxRetries: config.max_retries
24455
+ });
24456
+ context.emit?.(actionName, {
24457
+ ...payload.params,
24458
+ __retryId: retryId
24459
+ });
24460
+ break;
24461
+ }
24462
+ case "retry:action_result": {
24463
+ const retryId = payload.retryId;
24464
+ const success = payload.success;
24465
+ const error = payload.error;
24466
+ const pending = state.pendingActions.get(retryId);
24467
+ if (!pending) break;
24468
+ if (success) {
24469
+ state.totalSuccesses++;
24470
+ state.consecutiveFailures = 0;
24471
+ state.pendingActions.delete(retryId);
24472
+ if (state.circuit === "half-open") {
24473
+ state.circuit = "closed";
24474
+ context.emit?.("retry:circuit_close", {
24475
+ recoveredAfterMs: Date.now() - state.circuitOpenedAt
24476
+ });
24477
+ }
24478
+ context.emit?.("retry:success", {
24479
+ actionName: pending.actionName,
24480
+ attempt: pending.attempt,
24481
+ elapsed: Date.now() - pending.startedAt
24482
+ });
24483
+ } else {
24484
+ state.totalFailures++;
24485
+ state.consecutiveFailures++;
24486
+ pending.attempt++;
24487
+ context.emit?.("retry:failure", {
24488
+ actionName: pending.actionName,
24489
+ attempt: pending.attempt,
24490
+ error: error ?? "unknown"
24491
+ });
24492
+ if (state.consecutiveFailures >= config.circuit_threshold) {
24493
+ state.circuit = "open";
24494
+ state.circuitOpenedAt = Date.now();
24495
+ state.pendingActions.delete(retryId);
24496
+ context.emit?.("retry:circuit_open", {
24497
+ consecutiveFailures: state.consecutiveFailures,
24498
+ resetMs: config.circuit_reset_ms
24499
+ });
24500
+ break;
24501
+ }
24502
+ if (state.circuit === "half-open") {
24503
+ state.circuit = "open";
24504
+ state.circuitOpenedAt = Date.now();
24505
+ state.pendingActions.delete(retryId);
24506
+ context.emit?.("retry:circuit_open", {
24507
+ consecutiveFailures: state.consecutiveFailures,
24508
+ resetMs: config.circuit_reset_ms
24509
+ });
24510
+ break;
24511
+ }
24512
+ if (pending.attempt > config.max_retries) {
24513
+ state.pendingActions.delete(retryId);
24514
+ context.emit?.("retry:exhausted", {
24515
+ actionName: pending.actionName,
24516
+ totalAttempts: pending.attempt
24517
+ });
24518
+ } else {
24519
+ const delay = computeDelay(config, pending.attempt - 1);
24520
+ state.totalAttempts++;
24521
+ setTimeout(() => {
24522
+ if (!node.__retryState) return;
24523
+ context.emit?.("retry:attempt", {
24524
+ retryId,
24525
+ actionName: pending.actionName,
24526
+ attempt: pending.attempt,
24527
+ maxRetries: config.max_retries
24528
+ });
24529
+ context.emit?.(pending.actionName, {
24530
+ __retryId: retryId
24531
+ });
24532
+ }, delay);
24533
+ }
24534
+ }
24535
+ break;
24536
+ }
24537
+ case "retry:reset_circuit": {
24538
+ state.circuit = "closed";
24539
+ state.consecutiveFailures = 0;
24540
+ context.emit?.("retry:circuit_close", { recoveredAfterMs: 0 });
24541
+ break;
24542
+ }
24543
+ case "retry:get_status": {
24544
+ context.emit?.("retry:status", {
24545
+ circuit: state.circuit,
24546
+ consecutiveFailures: state.consecutiveFailures,
24547
+ totalAttempts: state.totalAttempts,
24548
+ totalSuccesses: state.totalSuccesses,
24549
+ totalFailures: state.totalFailures,
24550
+ pending: state.pendingActions.size
24551
+ });
24552
+ break;
24553
+ }
24554
+ }
24555
+ }
24556
+ };
24557
+
24326
24558
  // src/traits/SchedulerTrait.ts
24327
24559
  var schedulerHandler = {
24328
24560
  name: "scheduler",
@@ -25412,6 +25644,110 @@ function addEntry(state, config, context, level, payload) {
25412
25644
  }
25413
25645
  }
25414
25646
 
25647
+ // src/traits/CacheTrait.ts
25648
+ var cacheHandler = {
25649
+ name: "cache",
25650
+ defaultConfig: {
25651
+ max_size: 1e3,
25652
+ default_ttl_ms: 6e4,
25653
+ eviction_policy: "lru"
25654
+ },
25655
+ onAttach(node, _config, _context) {
25656
+ node.__cacheState = {
25657
+ entries: /* @__PURE__ */ new Map(),
25658
+ hits: 0,
25659
+ misses: 0,
25660
+ evictions: 0
25661
+ };
25662
+ },
25663
+ onDetach(node) {
25664
+ delete node.__cacheState;
25665
+ },
25666
+ onUpdate(node, config, _context, _delta) {
25667
+ const state = node.__cacheState;
25668
+ if (!state) return;
25669
+ const now = Date.now();
25670
+ for (const [key, entry] of state.entries) {
25671
+ if (entry.expiresAt > 0 && now >= entry.expiresAt) {
25672
+ state.entries.delete(key);
25673
+ state.evictions++;
25674
+ }
25675
+ }
25676
+ },
25677
+ onEvent(node, config, context, event) {
25678
+ const state = node.__cacheState;
25679
+ if (!state) return;
25680
+ const eventType = typeof event === "string" ? event : event.type;
25681
+ switch (eventType) {
25682
+ case "cache:set": {
25683
+ const key = event.key;
25684
+ if (!key) break;
25685
+ const ttl = event.ttl ?? config.default_ttl_ms;
25686
+ if (state.entries.size >= config.max_size && !state.entries.has(key)) {
25687
+ evictOne(state, config, context);
25688
+ }
25689
+ const now = Date.now();
25690
+ state.entries.set(key, {
25691
+ value: event.value,
25692
+ expiresAt: ttl > 0 ? now + ttl : 0,
25693
+ accessedAt: now,
25694
+ createdAt: now
25695
+ });
25696
+ break;
25697
+ }
25698
+ case "cache:get": {
25699
+ const key = event.key;
25700
+ if (!key) break;
25701
+ const entry = state.entries.get(key);
25702
+ if (entry && (entry.expiresAt === 0 || Date.now() < entry.expiresAt)) {
25703
+ state.hits++;
25704
+ entry.accessedAt = Date.now();
25705
+ context.emit?.("cache:result", { key, value: entry.value, hit: true });
25706
+ } else {
25707
+ state.misses++;
25708
+ if (entry) state.entries.delete(key);
25709
+ context.emit?.("cache:result", { key, value: void 0, hit: false });
25710
+ }
25711
+ break;
25712
+ }
25713
+ case "cache:invalidate": {
25714
+ const key = event.key;
25715
+ if (key) state.entries.delete(key);
25716
+ break;
25717
+ }
25718
+ case "cache:clear": {
25719
+ state.entries.clear();
25720
+ break;
25721
+ }
25722
+ case "cache:get_stats": {
25723
+ context.emit?.("cache:stats", {
25724
+ hits: state.hits,
25725
+ misses: state.misses,
25726
+ size: state.entries.size,
25727
+ evictions: state.evictions,
25728
+ hitRate: state.hits + state.misses > 0 ? state.hits / (state.hits + state.misses) : 0
25729
+ });
25730
+ break;
25731
+ }
25732
+ }
25733
+ }
25734
+ };
25735
+ function evictOne(state, config, context) {
25736
+ if (state.entries.size === 0) return;
25737
+ let oldest = null;
25738
+ for (const [key, entry] of state.entries) {
25739
+ const time = config.eviction_policy === "lru" ? entry.accessedAt : entry.createdAt;
25740
+ if (!oldest || time < oldest.time) {
25741
+ oldest = { key, time };
25742
+ }
25743
+ }
25744
+ if (oldest) {
25745
+ state.entries.delete(oldest.key);
25746
+ state.evictions++;
25747
+ context.emit?.("cache:evict", { key: oldest.key, reason: config.eviction_policy });
25748
+ }
25749
+ }
25750
+
25415
25751
  // src/traits/FairnessMonitorTrait.ts
25416
25752
  var DEFAULT_POSITIVE_DECISION_VALUES = ["true", "approved", "approve", "pass", "1", "yes"];
25417
25753
  var DEFAULT_CONFIG5 = {
@@ -44488,6 +44824,333 @@ var environmentalAudioHandler = {
44488
44824
  }
44489
44825
  };
44490
44826
 
44827
+ // src/traits/FluidSimulationTrait.ts
44828
+ function poly6Kernel(r, h) {
44829
+ if (r < 0 || r > h) return 0;
44830
+ const coeff = 315 / (64 * Math.PI * h ** 9);
44831
+ return coeff * (h * h - r * r) ** 3;
44832
+ }
44833
+ function spikyKernelGradient(dx, dy, dz, h) {
44834
+ const r = Math.sqrt(dx * dx + dy * dy + dz * dz);
44835
+ if (r > h || r < 1e-5) return [0, 0, 0];
44836
+ const coeff = -45 / (Math.PI * h ** 6) * (h - r) ** 2;
44837
+ return [coeff * (dx / r), coeff * (dy / r), coeff * (dz / r)];
44838
+ }
44839
+ function viscosityKernelLaplacian(r, h) {
44840
+ if (r < 0 || r > h) return 0;
44841
+ return 45 / (Math.PI * h ** 6) * (h - r);
44842
+ }
44843
+ var SpatialHash = class {
44844
+ constructor(cellSize) {
44845
+ this.cells = /* @__PURE__ */ new Map();
44846
+ this.cellSize = cellSize;
44847
+ }
44848
+ key(x, y, z) {
44849
+ const cx = Math.floor(x / this.cellSize);
44850
+ const cy = Math.floor(y / this.cellSize);
44851
+ const cz = Math.floor(z / this.cellSize);
44852
+ return `${cx},${cy},${cz}`;
44853
+ }
44854
+ insert(id, pos) {
44855
+ const k = this.key(pos[0], pos[1], pos[2]);
44856
+ if (!this.cells.has(k)) this.cells.set(k, []);
44857
+ this.cells.get(k).push(id);
44858
+ }
44859
+ getNeighbors(pos) {
44860
+ const cx = Math.floor(pos[0] / this.cellSize);
44861
+ const cy = Math.floor(pos[1] / this.cellSize);
44862
+ const cz = Math.floor(pos[2] / this.cellSize);
44863
+ const result = [];
44864
+ for (let dx = -1; dx <= 1; dx++) {
44865
+ for (let dy = -1; dy <= 1; dy++) {
44866
+ for (let dz = -1; dz <= 1; dz++) {
44867
+ const k = `${cx + dx},${cy + dy},${cz + dz}`;
44868
+ const cell = this.cells.get(k);
44869
+ if (cell) result.push(...cell);
44870
+ }
44871
+ }
44872
+ }
44873
+ return result;
44874
+ }
44875
+ clear() {
44876
+ this.cells.clear();
44877
+ }
44878
+ };
44879
+ var FluidSimulationSystem = class {
44880
+ constructor(config = {}) {
44881
+ this.particles = /* @__PURE__ */ new Map();
44882
+ this.nextId = 0;
44883
+ this.boundaries = [];
44884
+ this.cfg = {
44885
+ restDensity: config.restDensity ?? 1e3,
44886
+ viscosity: config.viscosity ?? 1e-3,
44887
+ gravity: config.gravity ?? [0, -9.81, 0],
44888
+ solverType: config.solverType ?? "sph",
44889
+ timeStep: config.timeStep ?? 0.016,
44890
+ maxVelocity: config.maxVelocity ?? 100,
44891
+ smoothingRadius: config.smoothingRadius ?? 0.04,
44892
+ gridCellSize: config.gridCellSize ?? 0.04,
44893
+ particleRadius: config.particleRadius ?? 0.01,
44894
+ gasConstant: config.gasConstant ?? 8.314,
44895
+ surfaceTension: config.surfaceTension ?? 0.072
44896
+ };
44897
+ this.spatialHash = new SpatialHash(this.cfg.gridCellSize);
44898
+ }
44899
+ // ── Particle Management ────────────────────────────────────────────────
44900
+ addParticle(position, velocity) {
44901
+ const id = this.nextId++;
44902
+ this.particles.set(id, {
44903
+ id,
44904
+ position: [...position],
44905
+ velocity: velocity ? [...velocity] : [0, 0, 0],
44906
+ force: [0, 0, 0],
44907
+ density: this.cfg.restDensity,
44908
+ pressure: 0,
44909
+ mass: 1
44910
+ });
44911
+ return id;
44912
+ }
44913
+ getParticle(id) {
44914
+ return this.particles.get(id);
44915
+ }
44916
+ getParticles() {
44917
+ return Array.from(this.particles.values());
44918
+ }
44919
+ getParticleCount() {
44920
+ return this.particles.size;
44921
+ }
44922
+ removeParticle(id) {
44923
+ return this.particles.delete(id);
44924
+ }
44925
+ clearParticles() {
44926
+ this.particles.clear();
44927
+ this.nextId = 0;
44928
+ }
44929
+ // ── Boundary Management ────────────────────────────────────────────────
44930
+ addBoundary(boundary) {
44931
+ this.boundaries.push(boundary);
44932
+ }
44933
+ getBoundaries() {
44934
+ return [...this.boundaries];
44935
+ }
44936
+ clearBoundaries() {
44937
+ this.boundaries.length = 0;
44938
+ }
44939
+ // ── Configuration ──────────────────────────────────────────────────────
44940
+ getConfig() {
44941
+ return { ...this.cfg };
44942
+ }
44943
+ setConfig(partial) {
44944
+ Object.assign(this.cfg, partial);
44945
+ if (partial.gridCellSize !== void 0) {
44946
+ this.spatialHash = new SpatialHash(this.cfg.gridCellSize);
44947
+ }
44948
+ }
44949
+ // ── Simulation Step ────────────────────────────────────────────────────
44950
+ step(dt) {
44951
+ const h = this.cfg.smoothingRadius;
44952
+ const deltaT = dt ?? this.cfg.timeStep;
44953
+ const particles = Array.from(this.particles.values());
44954
+ this.spatialHash.clear();
44955
+ for (const p of particles) {
44956
+ this.spatialHash.insert(p.id, p.position);
44957
+ }
44958
+ for (const pi of particles) {
44959
+ let density = 0;
44960
+ for (const pj of particles) {
44961
+ const r = this.dist(pi.position, pj.position);
44962
+ density += pj.mass * poly6Kernel(r, h);
44963
+ }
44964
+ pi.density = Math.max(density, this.cfg.restDensity * 0.01);
44965
+ pi.pressure = this.cfg.gasConstant * (pi.density - this.cfg.restDensity);
44966
+ }
44967
+ for (const pi of particles) {
44968
+ pi.force = [
44969
+ this.cfg.gravity[0] * pi.mass,
44970
+ this.cfg.gravity[1] * pi.mass,
44971
+ this.cfg.gravity[2] * pi.mass
44972
+ ];
44973
+ for (const pj of particles) {
44974
+ if (pi.id === pj.id) continue;
44975
+ const dx = pi.position[0] - pj.position[0];
44976
+ const dy = pi.position[1] - pj.position[1];
44977
+ const dz = pi.position[2] - pj.position[2];
44978
+ const r = Math.sqrt(dx * dx + dy * dy + dz * dz);
44979
+ if (r < h && r > 1e-5) {
44980
+ const grad = spikyKernelGradient(dx, dy, dz, h);
44981
+ const pScale = -pj.mass * ((pi.pressure + pj.pressure) / (2 * pj.density));
44982
+ pi.force[0] += pScale * grad[0];
44983
+ pi.force[1] += pScale * grad[1];
44984
+ pi.force[2] += pScale * grad[2];
44985
+ const viscLap = viscosityKernelLaplacian(r, h);
44986
+ const vScale = this.cfg.viscosity * pj.mass * (1 / pj.density) * viscLap;
44987
+ pi.force[0] += vScale * (pj.velocity[0] - pi.velocity[0]);
44988
+ pi.force[1] += vScale * (pj.velocity[1] - pi.velocity[1]);
44989
+ pi.force[2] += vScale * (pj.velocity[2] - pi.velocity[2]);
44990
+ }
44991
+ }
44992
+ }
44993
+ for (const p of particles) {
44994
+ p.velocity[0] += p.force[0] / p.mass * deltaT;
44995
+ p.velocity[1] += p.force[1] / p.mass * deltaT;
44996
+ p.velocity[2] += p.force[2] / p.mass * deltaT;
44997
+ const speed = Math.sqrt(p.velocity[0] ** 2 + p.velocity[1] ** 2 + p.velocity[2] ** 2);
44998
+ if (speed > this.cfg.maxVelocity) {
44999
+ const scale = this.cfg.maxVelocity / speed;
45000
+ p.velocity[0] *= scale;
45001
+ p.velocity[1] *= scale;
45002
+ p.velocity[2] *= scale;
45003
+ }
45004
+ p.position[0] += p.velocity[0] * deltaT;
45005
+ p.position[1] += p.velocity[1] * deltaT;
45006
+ p.position[2] += p.velocity[2] * deltaT;
45007
+ }
45008
+ for (const p of particles) {
45009
+ this.applyBoundaries(p);
45010
+ }
45011
+ }
45012
+ // ── Density Queries ────────────────────────────────────────────────────
45013
+ getDensityAt(position) {
45014
+ const h = this.cfg.smoothingRadius;
45015
+ let density = 0;
45016
+ for (const p of this.particles.values()) {
45017
+ const r = this.dist(position, p.position);
45018
+ density += p.mass * poly6Kernel(r, h);
45019
+ }
45020
+ return density;
45021
+ }
45022
+ isInsideFluid(position) {
45023
+ return this.getDensityAt(position) > this.cfg.restDensity * 0.5;
45024
+ }
45025
+ // ── Statistics ─────────────────────────────────────────────────────────
45026
+ getKineticEnergy() {
45027
+ let energy = 0;
45028
+ for (const p of this.particles.values()) {
45029
+ energy += 0.5 * p.mass * (p.velocity[0] ** 2 + p.velocity[1] ** 2 + p.velocity[2] ** 2);
45030
+ }
45031
+ return energy;
45032
+ }
45033
+ getAverageDensity() {
45034
+ if (this.particles.size === 0) return 0;
45035
+ let total = 0;
45036
+ for (const p of this.particles.values()) total += p.density;
45037
+ return total / this.particles.size;
45038
+ }
45039
+ reset() {
45040
+ this.particles.clear();
45041
+ this.spatialHash.clear();
45042
+ this.boundaries.length = 0;
45043
+ this.nextId = 0;
45044
+ }
45045
+ // ── Private Helpers ────────────────────────────────────────────────────
45046
+ dist(a, b) {
45047
+ return Math.sqrt((a[0] - b[0]) ** 2 + (a[1] - b[1]) ** 2 + (a[2] - b[2]) ** 2);
45048
+ }
45049
+ applyBoundaries(p) {
45050
+ const pr = this.cfg.particleRadius;
45051
+ for (const b of this.boundaries) {
45052
+ if (b.type === "plane") {
45053
+ const dx = p.position[0] - b.position[0];
45054
+ const dy = p.position[1] - b.position[1];
45055
+ const dz = p.position[2] - b.position[2];
45056
+ const d = dx * b.normal[0] + dy * b.normal[1] + dz * b.normal[2];
45057
+ if (d < pr) {
45058
+ p.position[0] += b.normal[0] * (pr - d);
45059
+ p.position[1] += b.normal[1] * (pr - d);
45060
+ p.position[2] += b.normal[2] * (pr - d);
45061
+ const vn = p.velocity[0] * b.normal[0] + p.velocity[1] * b.normal[1] + p.velocity[2] * b.normal[2];
45062
+ if (vn < 0) {
45063
+ p.velocity[0] -= (1 + b.restitution) * vn * b.normal[0];
45064
+ p.velocity[1] -= (1 + b.restitution) * vn * b.normal[1];
45065
+ p.velocity[2] -= (1 + b.restitution) * vn * b.normal[2];
45066
+ }
45067
+ }
45068
+ } else if (b.type === "sphere") {
45069
+ const dx = p.position[0] - b.position[0];
45070
+ const dy = p.position[1] - b.position[1];
45071
+ const dz = p.position[2] - b.position[2];
45072
+ const dist = Math.sqrt(dx * dx + dy * dy + dz * dz);
45073
+ const maxDist = b.radius - pr;
45074
+ if (dist > maxDist && dist > 1e-6) {
45075
+ const nx = dx / dist;
45076
+ const ny = dy / dist;
45077
+ const nz = dz / dist;
45078
+ p.position[0] = b.position[0] + nx * maxDist;
45079
+ p.position[1] = b.position[1] + ny * maxDist;
45080
+ p.position[2] = b.position[2] + nz * maxDist;
45081
+ const vn = p.velocity[0] * nx + p.velocity[1] * ny + p.velocity[2] * nz;
45082
+ if (vn > 0) {
45083
+ p.velocity[0] -= (1 + b.restitution) * vn * nx;
45084
+ p.velocity[1] -= (1 + b.restitution) * vn * ny;
45085
+ p.velocity[2] -= (1 + b.restitution) * vn * nz;
45086
+ }
45087
+ }
45088
+ } else if (b.type === "box") {
45089
+ const halfX = b.size[0] / 2;
45090
+ const halfY = b.size[1] / 2;
45091
+ const halfZ = b.size[2] / 2;
45092
+ const limit = pr;
45093
+ if (p.position[0] > b.position[0] + halfX - limit) {
45094
+ p.position[0] = b.position[0] + halfX - limit;
45095
+ p.velocity[0] *= -b.restitution;
45096
+ } else if (p.position[0] < b.position[0] - halfX + limit) {
45097
+ p.position[0] = b.position[0] - halfX + limit;
45098
+ p.velocity[0] *= -b.restitution;
45099
+ }
45100
+ if (p.position[1] > b.position[1] + halfY - limit) {
45101
+ p.position[1] = b.position[1] + halfY - limit;
45102
+ p.velocity[1] *= -b.restitution;
45103
+ } else if (p.position[1] < b.position[1] - halfY + limit) {
45104
+ p.position[1] = b.position[1] - halfY + limit;
45105
+ p.velocity[1] *= -b.restitution;
45106
+ }
45107
+ if (p.position[2] > b.position[2] + halfZ - limit) {
45108
+ p.position[2] = b.position[2] + halfZ - limit;
45109
+ p.velocity[2] *= -b.restitution;
45110
+ } else if (p.position[2] < b.position[2] - halfZ + limit) {
45111
+ p.position[2] = b.position[2] - halfZ + limit;
45112
+ p.velocity[2] *= -b.restitution;
45113
+ }
45114
+ }
45115
+ }
45116
+ }
45117
+ };
45118
+ var fluidSimulationHandler = {
45119
+ name: "fluid_simulation",
45120
+ defaultConfig: {},
45121
+ onAttach(node, config, ctx) {
45122
+ const instance = new FluidSimulationSystem(config);
45123
+ node.__fluid_simulation_instance = instance;
45124
+ ctx.emit("fluid_simulation_attached", { node, config });
45125
+ },
45126
+ onDetach(node, _config, ctx) {
45127
+ const instance = node.__fluid_simulation_instance;
45128
+ if (instance) {
45129
+ if (typeof instance.onDetach === "function") instance.onDetach(node, ctx);
45130
+ else if (typeof instance.dispose === "function") instance.dispose();
45131
+ else if (typeof instance.cleanup === "function") instance.cleanup();
45132
+ }
45133
+ ctx.emit("fluid_simulation_detached", { node });
45134
+ delete node.__fluid_simulation_instance;
45135
+ },
45136
+ onEvent(node, _config, ctx, event) {
45137
+ const instance = node.__fluid_simulation_instance;
45138
+ if (!instance) return;
45139
+ if (typeof instance.onEvent === "function") instance.onEvent(event);
45140
+ else if (typeof instance.emit === "function" && event.type) instance.emit(event);
45141
+ if (event.type === "fluid_simulation_configure" && event.payload) {
45142
+ Object.assign(instance, event.payload);
45143
+ ctx.emit("fluid_simulation_configured", { node });
45144
+ }
45145
+ },
45146
+ onUpdate(node, _config, ctx, dt) {
45147
+ const instance = node.__fluid_simulation_instance;
45148
+ if (!instance) return;
45149
+ if (typeof instance.onUpdate === "function") instance.onUpdate(node, ctx, dt);
45150
+ else if (typeof instance.step === "function") instance.step(dt);
45151
+ }
45152
+ };
45153
+
44491
45154
  // src/traits/GranularMaterialTrait.ts
44492
45155
  function toVec3(v) {
44493
45156
  if (Array.isArray(v)) {
@@ -53788,200 +54451,6 @@ var httpClientHandler = {
53788
54451
  }
53789
54452
  };
53790
54453
 
53791
- // src/traits/RetryTrait.ts
53792
- function computeDelay(config, attempt) {
53793
- let delay;
53794
- switch (config.backoff) {
53795
- case "exponential":
53796
- delay = config.base_delay_ms * Math.pow(2, attempt);
53797
- break;
53798
- case "linear":
53799
- delay = config.base_delay_ms * (attempt + 1);
53800
- break;
53801
- case "constant":
53802
- default:
53803
- delay = config.base_delay_ms;
53804
- break;
53805
- }
53806
- delay = Math.min(delay, config.max_delay_ms);
53807
- if (config.jitter > 0) {
53808
- const jitterAmount = delay * config.jitter;
53809
- delay += Math.random() * jitterAmount * 2 - jitterAmount;
53810
- }
53811
- return Math.max(0, Math.round(delay));
53812
- }
53813
- var retryHandler = {
53814
- name: "retry",
53815
- defaultConfig: {
53816
- max_retries: 3,
53817
- base_delay_ms: 1e3,
53818
- max_delay_ms: 3e4,
53819
- backoff: "exponential",
53820
- jitter: 0.1,
53821
- circuit_threshold: 5,
53822
- circuit_reset_ms: 6e4
53823
- },
53824
- onAttach(node, _config, _context) {
53825
- const state = {
53826
- circuit: "closed",
53827
- consecutiveFailures: 0,
53828
- circuitOpenedAt: 0,
53829
- totalAttempts: 0,
53830
- totalSuccesses: 0,
53831
- totalFailures: 0,
53832
- pendingActions: /* @__PURE__ */ new Map(),
53833
- actionCounter: 0
53834
- };
53835
- node.__retryState = state;
53836
- },
53837
- onDetach(node, _config, _context) {
53838
- delete node.__retryState;
53839
- },
53840
- onUpdate(node, config, context, _delta) {
53841
- const state = node.__retryState;
53842
- if (!state) return;
53843
- if (state.circuit === "open") {
53844
- const elapsed = Date.now() - state.circuitOpenedAt;
53845
- if (elapsed >= config.circuit_reset_ms) {
53846
- state.circuit = "half-open";
53847
- context.emit?.("retry:circuit_half", {
53848
- testAttempt: state.totalAttempts + 1
53849
- });
53850
- }
53851
- }
53852
- },
53853
- onEvent(node, config, context, event) {
53854
- const state = node.__retryState;
53855
- if (!state) return;
53856
- const eventType = typeof event === "string" ? event : event.type;
53857
- const payload = extractPayload(event);
53858
- switch (eventType) {
53859
- case "retry:execute": {
53860
- const actionName = payload.action;
53861
- if (!actionName) break;
53862
- if (state.circuit === "open") {
53863
- context.emit?.("retry:failure", {
53864
- actionName,
53865
- attempt: 0,
53866
- error: "Circuit breaker is OPEN"
53867
- });
53868
- break;
53869
- }
53870
- const retryId = `retry_${state.actionCounter++}`;
53871
- state.pendingActions.set(retryId, {
53872
- actionName,
53873
- attempt: 0,
53874
- startedAt: Date.now()
53875
- });
53876
- state.totalAttempts++;
53877
- context.emit?.("retry:attempt", {
53878
- retryId,
53879
- actionName,
53880
- attempt: 0,
53881
- maxRetries: config.max_retries
53882
- });
53883
- context.emit?.(actionName, {
53884
- ...payload.params,
53885
- __retryId: retryId
53886
- });
53887
- break;
53888
- }
53889
- case "retry:action_result": {
53890
- const retryId = payload.retryId;
53891
- const success = payload.success;
53892
- const error = payload.error;
53893
- const pending = state.pendingActions.get(retryId);
53894
- if (!pending) break;
53895
- if (success) {
53896
- state.totalSuccesses++;
53897
- state.consecutiveFailures = 0;
53898
- state.pendingActions.delete(retryId);
53899
- if (state.circuit === "half-open") {
53900
- state.circuit = "closed";
53901
- context.emit?.("retry:circuit_close", {
53902
- recoveredAfterMs: Date.now() - state.circuitOpenedAt
53903
- });
53904
- }
53905
- context.emit?.("retry:success", {
53906
- actionName: pending.actionName,
53907
- attempt: pending.attempt,
53908
- elapsed: Date.now() - pending.startedAt
53909
- });
53910
- } else {
53911
- state.totalFailures++;
53912
- state.consecutiveFailures++;
53913
- pending.attempt++;
53914
- context.emit?.("retry:failure", {
53915
- actionName: pending.actionName,
53916
- attempt: pending.attempt,
53917
- error: error ?? "unknown"
53918
- });
53919
- if (state.consecutiveFailures >= config.circuit_threshold) {
53920
- state.circuit = "open";
53921
- state.circuitOpenedAt = Date.now();
53922
- state.pendingActions.delete(retryId);
53923
- context.emit?.("retry:circuit_open", {
53924
- consecutiveFailures: state.consecutiveFailures,
53925
- resetMs: config.circuit_reset_ms
53926
- });
53927
- break;
53928
- }
53929
- if (state.circuit === "half-open") {
53930
- state.circuit = "open";
53931
- state.circuitOpenedAt = Date.now();
53932
- state.pendingActions.delete(retryId);
53933
- context.emit?.("retry:circuit_open", {
53934
- consecutiveFailures: state.consecutiveFailures,
53935
- resetMs: config.circuit_reset_ms
53936
- });
53937
- break;
53938
- }
53939
- if (pending.attempt > config.max_retries) {
53940
- state.pendingActions.delete(retryId);
53941
- context.emit?.("retry:exhausted", {
53942
- actionName: pending.actionName,
53943
- totalAttempts: pending.attempt
53944
- });
53945
- } else {
53946
- const delay = computeDelay(config, pending.attempt - 1);
53947
- state.totalAttempts++;
53948
- setTimeout(() => {
53949
- if (!node.__retryState) return;
53950
- context.emit?.("retry:attempt", {
53951
- retryId,
53952
- actionName: pending.actionName,
53953
- attempt: pending.attempt,
53954
- maxRetries: config.max_retries
53955
- });
53956
- context.emit?.(pending.actionName, {
53957
- __retryId: retryId
53958
- });
53959
- }, delay);
53960
- }
53961
- }
53962
- break;
53963
- }
53964
- case "retry:reset_circuit": {
53965
- state.circuit = "closed";
53966
- state.consecutiveFailures = 0;
53967
- context.emit?.("retry:circuit_close", { recoveredAfterMs: 0 });
53968
- break;
53969
- }
53970
- case "retry:get_status": {
53971
- context.emit?.("retry:status", {
53972
- circuit: state.circuit,
53973
- consecutiveFailures: state.consecutiveFailures,
53974
- totalAttempts: state.totalAttempts,
53975
- totalSuccesses: state.totalSuccesses,
53976
- totalFailures: state.totalFailures,
53977
- pending: state.pendingActions.size
53978
- });
53979
- break;
53980
- }
53981
- }
53982
- }
53983
- };
53984
-
53985
54454
  // src/traits/DatabaseTrait.ts
53986
54455
  var databaseHandler = {
53987
54456
  name: "database",
@@ -54083,110 +54552,6 @@ var databaseHandler = {
54083
54552
  }
54084
54553
  };
54085
54554
 
54086
- // src/traits/CacheTrait.ts
54087
- var cacheHandler = {
54088
- name: "cache",
54089
- defaultConfig: {
54090
- max_size: 1e3,
54091
- default_ttl_ms: 6e4,
54092
- eviction_policy: "lru"
54093
- },
54094
- onAttach(node, _config, _context) {
54095
- node.__cacheState = {
54096
- entries: /* @__PURE__ */ new Map(),
54097
- hits: 0,
54098
- misses: 0,
54099
- evictions: 0
54100
- };
54101
- },
54102
- onDetach(node) {
54103
- delete node.__cacheState;
54104
- },
54105
- onUpdate(node, config, _context, _delta) {
54106
- const state = node.__cacheState;
54107
- if (!state) return;
54108
- const now = Date.now();
54109
- for (const [key, entry] of state.entries) {
54110
- if (entry.expiresAt > 0 && now >= entry.expiresAt) {
54111
- state.entries.delete(key);
54112
- state.evictions++;
54113
- }
54114
- }
54115
- },
54116
- onEvent(node, config, context, event) {
54117
- const state = node.__cacheState;
54118
- if (!state) return;
54119
- const eventType = typeof event === "string" ? event : event.type;
54120
- switch (eventType) {
54121
- case "cache:set": {
54122
- const key = event.key;
54123
- if (!key) break;
54124
- const ttl = event.ttl ?? config.default_ttl_ms;
54125
- if (state.entries.size >= config.max_size && !state.entries.has(key)) {
54126
- evictOne(state, config, context);
54127
- }
54128
- const now = Date.now();
54129
- state.entries.set(key, {
54130
- value: event.value,
54131
- expiresAt: ttl > 0 ? now + ttl : 0,
54132
- accessedAt: now,
54133
- createdAt: now
54134
- });
54135
- break;
54136
- }
54137
- case "cache:get": {
54138
- const key = event.key;
54139
- if (!key) break;
54140
- const entry = state.entries.get(key);
54141
- if (entry && (entry.expiresAt === 0 || Date.now() < entry.expiresAt)) {
54142
- state.hits++;
54143
- entry.accessedAt = Date.now();
54144
- context.emit?.("cache:result", { key, value: entry.value, hit: true });
54145
- } else {
54146
- state.misses++;
54147
- if (entry) state.entries.delete(key);
54148
- context.emit?.("cache:result", { key, value: void 0, hit: false });
54149
- }
54150
- break;
54151
- }
54152
- case "cache:invalidate": {
54153
- const key = event.key;
54154
- if (key) state.entries.delete(key);
54155
- break;
54156
- }
54157
- case "cache:clear": {
54158
- state.entries.clear();
54159
- break;
54160
- }
54161
- case "cache:get_stats": {
54162
- context.emit?.("cache:stats", {
54163
- hits: state.hits,
54164
- misses: state.misses,
54165
- size: state.entries.size,
54166
- evictions: state.evictions,
54167
- hitRate: state.hits + state.misses > 0 ? state.hits / (state.hits + state.misses) : 0
54168
- });
54169
- break;
54170
- }
54171
- }
54172
- }
54173
- };
54174
- function evictOne(state, config, context) {
54175
- if (state.entries.size === 0) return;
54176
- let oldest = null;
54177
- for (const [key, entry] of state.entries) {
54178
- const time = config.eviction_policy === "lru" ? entry.accessedAt : entry.createdAt;
54179
- if (!oldest || time < oldest.time) {
54180
- oldest = { key, time };
54181
- }
54182
- }
54183
- if (oldest) {
54184
- state.entries.delete(oldest.key);
54185
- state.evictions++;
54186
- context.emit?.("cache:evict", { key: oldest.key, reason: config.eviction_policy });
54187
- }
54188
- }
54189
-
54190
54555
  // src/traits/StreamTrait.ts
54191
54556
  var streamHandler = {
54192
54557
  name: "stream",
@@ -59987,333 +60352,6 @@ var gotchaHandler = {
59987
60352
  }
59988
60353
  };
59989
60354
 
59990
- // src/traits/FluidSimulationTrait.ts
59991
- function poly6Kernel(r, h) {
59992
- if (r < 0 || r > h) return 0;
59993
- const coeff = 315 / (64 * Math.PI * h ** 9);
59994
- return coeff * (h * h - r * r) ** 3;
59995
- }
59996
- function spikyKernelGradient(dx, dy, dz, h) {
59997
- const r = Math.sqrt(dx * dx + dy * dy + dz * dz);
59998
- if (r > h || r < 1e-5) return [0, 0, 0];
59999
- const coeff = -45 / (Math.PI * h ** 6) * (h - r) ** 2;
60000
- return [coeff * (dx / r), coeff * (dy / r), coeff * (dz / r)];
60001
- }
60002
- function viscosityKernelLaplacian(r, h) {
60003
- if (r < 0 || r > h) return 0;
60004
- return 45 / (Math.PI * h ** 6) * (h - r);
60005
- }
60006
- var SpatialHash = class {
60007
- constructor(cellSize) {
60008
- this.cells = /* @__PURE__ */ new Map();
60009
- this.cellSize = cellSize;
60010
- }
60011
- key(x, y, z) {
60012
- const cx = Math.floor(x / this.cellSize);
60013
- const cy = Math.floor(y / this.cellSize);
60014
- const cz = Math.floor(z / this.cellSize);
60015
- return `${cx},${cy},${cz}`;
60016
- }
60017
- insert(id, pos) {
60018
- const k = this.key(pos[0], pos[1], pos[2]);
60019
- if (!this.cells.has(k)) this.cells.set(k, []);
60020
- this.cells.get(k).push(id);
60021
- }
60022
- getNeighbors(pos) {
60023
- const cx = Math.floor(pos[0] / this.cellSize);
60024
- const cy = Math.floor(pos[1] / this.cellSize);
60025
- const cz = Math.floor(pos[2] / this.cellSize);
60026
- const result = [];
60027
- for (let dx = -1; dx <= 1; dx++) {
60028
- for (let dy = -1; dy <= 1; dy++) {
60029
- for (let dz = -1; dz <= 1; dz++) {
60030
- const k = `${cx + dx},${cy + dy},${cz + dz}`;
60031
- const cell = this.cells.get(k);
60032
- if (cell) result.push(...cell);
60033
- }
60034
- }
60035
- }
60036
- return result;
60037
- }
60038
- clear() {
60039
- this.cells.clear();
60040
- }
60041
- };
60042
- var FluidSimulationSystem = class {
60043
- constructor(config = {}) {
60044
- this.particles = /* @__PURE__ */ new Map();
60045
- this.nextId = 0;
60046
- this.boundaries = [];
60047
- this.cfg = {
60048
- restDensity: config.restDensity ?? 1e3,
60049
- viscosity: config.viscosity ?? 1e-3,
60050
- gravity: config.gravity ?? [0, -9.81, 0],
60051
- solverType: config.solverType ?? "sph",
60052
- timeStep: config.timeStep ?? 0.016,
60053
- maxVelocity: config.maxVelocity ?? 100,
60054
- smoothingRadius: config.smoothingRadius ?? 0.04,
60055
- gridCellSize: config.gridCellSize ?? 0.04,
60056
- particleRadius: config.particleRadius ?? 0.01,
60057
- gasConstant: config.gasConstant ?? 8.314,
60058
- surfaceTension: config.surfaceTension ?? 0.072
60059
- };
60060
- this.spatialHash = new SpatialHash(this.cfg.gridCellSize);
60061
- }
60062
- // ── Particle Management ────────────────────────────────────────────────
60063
- addParticle(position, velocity) {
60064
- const id = this.nextId++;
60065
- this.particles.set(id, {
60066
- id,
60067
- position: [...position],
60068
- velocity: velocity ? [...velocity] : [0, 0, 0],
60069
- force: [0, 0, 0],
60070
- density: this.cfg.restDensity,
60071
- pressure: 0,
60072
- mass: 1
60073
- });
60074
- return id;
60075
- }
60076
- getParticle(id) {
60077
- return this.particles.get(id);
60078
- }
60079
- getParticles() {
60080
- return Array.from(this.particles.values());
60081
- }
60082
- getParticleCount() {
60083
- return this.particles.size;
60084
- }
60085
- removeParticle(id) {
60086
- return this.particles.delete(id);
60087
- }
60088
- clearParticles() {
60089
- this.particles.clear();
60090
- this.nextId = 0;
60091
- }
60092
- // ── Boundary Management ────────────────────────────────────────────────
60093
- addBoundary(boundary) {
60094
- this.boundaries.push(boundary);
60095
- }
60096
- getBoundaries() {
60097
- return [...this.boundaries];
60098
- }
60099
- clearBoundaries() {
60100
- this.boundaries.length = 0;
60101
- }
60102
- // ── Configuration ──────────────────────────────────────────────────────
60103
- getConfig() {
60104
- return { ...this.cfg };
60105
- }
60106
- setConfig(partial) {
60107
- Object.assign(this.cfg, partial);
60108
- if (partial.gridCellSize !== void 0) {
60109
- this.spatialHash = new SpatialHash(this.cfg.gridCellSize);
60110
- }
60111
- }
60112
- // ── Simulation Step ────────────────────────────────────────────────────
60113
- step(dt) {
60114
- const h = this.cfg.smoothingRadius;
60115
- const deltaT = dt ?? this.cfg.timeStep;
60116
- const particles = Array.from(this.particles.values());
60117
- this.spatialHash.clear();
60118
- for (const p of particles) {
60119
- this.spatialHash.insert(p.id, p.position);
60120
- }
60121
- for (const pi of particles) {
60122
- let density = 0;
60123
- for (const pj of particles) {
60124
- const r = this.dist(pi.position, pj.position);
60125
- density += pj.mass * poly6Kernel(r, h);
60126
- }
60127
- pi.density = Math.max(density, this.cfg.restDensity * 0.01);
60128
- pi.pressure = this.cfg.gasConstant * (pi.density - this.cfg.restDensity);
60129
- }
60130
- for (const pi of particles) {
60131
- pi.force = [
60132
- this.cfg.gravity[0] * pi.mass,
60133
- this.cfg.gravity[1] * pi.mass,
60134
- this.cfg.gravity[2] * pi.mass
60135
- ];
60136
- for (const pj of particles) {
60137
- if (pi.id === pj.id) continue;
60138
- const dx = pi.position[0] - pj.position[0];
60139
- const dy = pi.position[1] - pj.position[1];
60140
- const dz = pi.position[2] - pj.position[2];
60141
- const r = Math.sqrt(dx * dx + dy * dy + dz * dz);
60142
- if (r < h && r > 1e-5) {
60143
- const grad = spikyKernelGradient(dx, dy, dz, h);
60144
- const pScale = -pj.mass * ((pi.pressure + pj.pressure) / (2 * pj.density));
60145
- pi.force[0] += pScale * grad[0];
60146
- pi.force[1] += pScale * grad[1];
60147
- pi.force[2] += pScale * grad[2];
60148
- const viscLap = viscosityKernelLaplacian(r, h);
60149
- const vScale = this.cfg.viscosity * pj.mass * (1 / pj.density) * viscLap;
60150
- pi.force[0] += vScale * (pj.velocity[0] - pi.velocity[0]);
60151
- pi.force[1] += vScale * (pj.velocity[1] - pi.velocity[1]);
60152
- pi.force[2] += vScale * (pj.velocity[2] - pi.velocity[2]);
60153
- }
60154
- }
60155
- }
60156
- for (const p of particles) {
60157
- p.velocity[0] += p.force[0] / p.mass * deltaT;
60158
- p.velocity[1] += p.force[1] / p.mass * deltaT;
60159
- p.velocity[2] += p.force[2] / p.mass * deltaT;
60160
- const speed = Math.sqrt(p.velocity[0] ** 2 + p.velocity[1] ** 2 + p.velocity[2] ** 2);
60161
- if (speed > this.cfg.maxVelocity) {
60162
- const scale = this.cfg.maxVelocity / speed;
60163
- p.velocity[0] *= scale;
60164
- p.velocity[1] *= scale;
60165
- p.velocity[2] *= scale;
60166
- }
60167
- p.position[0] += p.velocity[0] * deltaT;
60168
- p.position[1] += p.velocity[1] * deltaT;
60169
- p.position[2] += p.velocity[2] * deltaT;
60170
- }
60171
- for (const p of particles) {
60172
- this.applyBoundaries(p);
60173
- }
60174
- }
60175
- // ── Density Queries ────────────────────────────────────────────────────
60176
- getDensityAt(position) {
60177
- const h = this.cfg.smoothingRadius;
60178
- let density = 0;
60179
- for (const p of this.particles.values()) {
60180
- const r = this.dist(position, p.position);
60181
- density += p.mass * poly6Kernel(r, h);
60182
- }
60183
- return density;
60184
- }
60185
- isInsideFluid(position) {
60186
- return this.getDensityAt(position) > this.cfg.restDensity * 0.5;
60187
- }
60188
- // ── Statistics ─────────────────────────────────────────────────────────
60189
- getKineticEnergy() {
60190
- let energy = 0;
60191
- for (const p of this.particles.values()) {
60192
- energy += 0.5 * p.mass * (p.velocity[0] ** 2 + p.velocity[1] ** 2 + p.velocity[2] ** 2);
60193
- }
60194
- return energy;
60195
- }
60196
- getAverageDensity() {
60197
- if (this.particles.size === 0) return 0;
60198
- let total = 0;
60199
- for (const p of this.particles.values()) total += p.density;
60200
- return total / this.particles.size;
60201
- }
60202
- reset() {
60203
- this.particles.clear();
60204
- this.spatialHash.clear();
60205
- this.boundaries.length = 0;
60206
- this.nextId = 0;
60207
- }
60208
- // ── Private Helpers ────────────────────────────────────────────────────
60209
- dist(a, b) {
60210
- return Math.sqrt((a[0] - b[0]) ** 2 + (a[1] - b[1]) ** 2 + (a[2] - b[2]) ** 2);
60211
- }
60212
- applyBoundaries(p) {
60213
- const pr = this.cfg.particleRadius;
60214
- for (const b of this.boundaries) {
60215
- if (b.type === "plane") {
60216
- const dx = p.position[0] - b.position[0];
60217
- const dy = p.position[1] - b.position[1];
60218
- const dz = p.position[2] - b.position[2];
60219
- const d = dx * b.normal[0] + dy * b.normal[1] + dz * b.normal[2];
60220
- if (d < pr) {
60221
- p.position[0] += b.normal[0] * (pr - d);
60222
- p.position[1] += b.normal[1] * (pr - d);
60223
- p.position[2] += b.normal[2] * (pr - d);
60224
- const vn = p.velocity[0] * b.normal[0] + p.velocity[1] * b.normal[1] + p.velocity[2] * b.normal[2];
60225
- if (vn < 0) {
60226
- p.velocity[0] -= (1 + b.restitution) * vn * b.normal[0];
60227
- p.velocity[1] -= (1 + b.restitution) * vn * b.normal[1];
60228
- p.velocity[2] -= (1 + b.restitution) * vn * b.normal[2];
60229
- }
60230
- }
60231
- } else if (b.type === "sphere") {
60232
- const dx = p.position[0] - b.position[0];
60233
- const dy = p.position[1] - b.position[1];
60234
- const dz = p.position[2] - b.position[2];
60235
- const dist = Math.sqrt(dx * dx + dy * dy + dz * dz);
60236
- const maxDist = b.radius - pr;
60237
- if (dist > maxDist && dist > 1e-6) {
60238
- const nx = dx / dist;
60239
- const ny = dy / dist;
60240
- const nz = dz / dist;
60241
- p.position[0] = b.position[0] + nx * maxDist;
60242
- p.position[1] = b.position[1] + ny * maxDist;
60243
- p.position[2] = b.position[2] + nz * maxDist;
60244
- const vn = p.velocity[0] * nx + p.velocity[1] * ny + p.velocity[2] * nz;
60245
- if (vn > 0) {
60246
- p.velocity[0] -= (1 + b.restitution) * vn * nx;
60247
- p.velocity[1] -= (1 + b.restitution) * vn * ny;
60248
- p.velocity[2] -= (1 + b.restitution) * vn * nz;
60249
- }
60250
- }
60251
- } else if (b.type === "box") {
60252
- const halfX = b.size[0] / 2;
60253
- const halfY = b.size[1] / 2;
60254
- const halfZ = b.size[2] / 2;
60255
- const limit = pr;
60256
- if (p.position[0] > b.position[0] + halfX - limit) {
60257
- p.position[0] = b.position[0] + halfX - limit;
60258
- p.velocity[0] *= -b.restitution;
60259
- } else if (p.position[0] < b.position[0] - halfX + limit) {
60260
- p.position[0] = b.position[0] - halfX + limit;
60261
- p.velocity[0] *= -b.restitution;
60262
- }
60263
- if (p.position[1] > b.position[1] + halfY - limit) {
60264
- p.position[1] = b.position[1] + halfY - limit;
60265
- p.velocity[1] *= -b.restitution;
60266
- } else if (p.position[1] < b.position[1] - halfY + limit) {
60267
- p.position[1] = b.position[1] - halfY + limit;
60268
- p.velocity[1] *= -b.restitution;
60269
- }
60270
- if (p.position[2] > b.position[2] + halfZ - limit) {
60271
- p.position[2] = b.position[2] + halfZ - limit;
60272
- p.velocity[2] *= -b.restitution;
60273
- } else if (p.position[2] < b.position[2] - halfZ + limit) {
60274
- p.position[2] = b.position[2] - halfZ + limit;
60275
- p.velocity[2] *= -b.restitution;
60276
- }
60277
- }
60278
- }
60279
- }
60280
- };
60281
- var fluidSimulationHandler = {
60282
- name: "fluid_simulation",
60283
- defaultConfig: {},
60284
- onAttach(node, config, ctx) {
60285
- const instance = new FluidSimulationSystem(config);
60286
- node.__fluid_simulation_instance = instance;
60287
- ctx.emit("fluid_simulation_attached", { node, config });
60288
- },
60289
- onDetach(node, _config, ctx) {
60290
- const instance = node.__fluid_simulation_instance;
60291
- if (instance) {
60292
- if (typeof instance.onDetach === "function") instance.onDetach(node, ctx);
60293
- else if (typeof instance.dispose === "function") instance.dispose();
60294
- else if (typeof instance.cleanup === "function") instance.cleanup();
60295
- }
60296
- ctx.emit("fluid_simulation_detached", { node });
60297
- delete node.__fluid_simulation_instance;
60298
- },
60299
- onEvent(node, _config, ctx, event) {
60300
- const instance = node.__fluid_simulation_instance;
60301
- if (!instance) return;
60302
- if (typeof instance.onEvent === "function") instance.onEvent(event);
60303
- else if (typeof instance.emit === "function" && event.type) instance.emit(event);
60304
- if (event.type === "fluid_simulation_configure" && event.payload) {
60305
- Object.assign(instance, event.payload);
60306
- ctx.emit("fluid_simulation_configured", { node });
60307
- }
60308
- },
60309
- onUpdate(node, _config, ctx, dt) {
60310
- const instance = node.__fluid_simulation_instance;
60311
- if (!instance) return;
60312
- if (typeof instance.onUpdate === "function") instance.onUpdate(node, ctx, dt);
60313
- else if (typeof instance.step === "function") instance.step(dt);
60314
- }
60315
- };
60316
-
60317
60355
  // src/traits/VRTraitSystem.ts
60318
60356
  function vec3ToTuple(v) {
60319
60357
  return v;
@@ -61137,6 +61175,7 @@ var VRTraitRegistry = class {
61137
61175
  this.register(provenanceHandler);
61138
61176
  this.register(provenanceDensifyHandler);
61139
61177
  this.register(evolveProgramHandler);
61178
+ this.register(freezeWhenHandler);
61140
61179
  this.register(bodyHandler);
61141
61180
  this.register(proactiveHandler);
61142
61181
  this.register(eventTraitHandler);
@@ -61640,6 +61679,6 @@ var VRTraitRegistry = class {
61640
61679
  };
61641
61680
  var vrTraitRegistry = new VRTraitRegistry();
61642
61681
 
61643
- export { AIDriverTrait, ALL_CIRCUITS, ARKIT_MOUTH_SHAPES, AnimationTrait, BUILTIN_CIRCUITS, BarretenbergBackend, BehaviorTreeRunner, CARE_ETHICS_TRAIT, CRDTRoomTraitValidationError, CRDT_ROOM_TRAIT_DEFAULTS, CharacterTrait, ComponentType, ConsensusTrait, DEFAULT_ANIMATION_MAP, DEFAULT_AUTONOMY_GUARD_POLICY, DEFAULT_BEHAVIOR_FACT_TTL_ALERT_RULE, DEFAULT_EXPRESSION_PRESETS, DEFAULT_EXTERNAL_TIMEOUT_MS, DEFAULT_FOVEATED_BLEND, DEFAULT_FREQUENCY_BANDS, DEFAULT_REPUTATION_LEDGER_MAX_FACTS, DEFAULT_REPUTATION_LEDGER_TTL_DAYS, DEFAULT_SYNC_FIELD, DEFAULT_TRAIT_CONFIG2 as DEFAULT_TRAIT_CONFIG, DRAFT_DEFAULTS, DRAFT_TRAIT, DialogTrait, DraftManager, ECSWorld, EmotionDirectiveTrait, EnvironmentalAudioSystem, GEM_RESONANCE_ELEMENT_FREQUENCIES, GOAPPlanner, GOLDEN_ANGLE_DEG, HOLOSCRIPT_HUMANOID_BONE_MAP, IKTrait, InteractiveGraphTrait, JobQueuePersistence, JointTrait, LIGHTING_PRESETS, LOCAL_WEBCAM_VIEW_ID, LightingTrait, LipSyncTrait, LobbyTrait, MATERIAL_PRESETS2 as MATERIAL_PRESETS, MAX_EXPERIENCE_LOG_ENTRIES, MaterialTrait, MorphTrait, MultiviewGaussianRendererTrait, NetworkedTrait, OCULUS_VISEME_MAP, PIDControllerTrait, PressableTrait, REFERENCE_SPACE_CHAIN, REFUSED_CARE_OPTIMIZATION_TARGETS, RenderingTrait, RigidbodyTrait, SHADER_CHUNKS, SHADER_PRESETS, SPATIAL_PREDICATE_CIRCUITS, SYNC_PRESETS, SandboxExecutionTrait, ShaderTrait, SlidableTrait, SpatialAwarenessTrait, SyncTierTrait, TIER_DEFAULTS, TriggerTrait, URDFRobotTrait, VRTraitRegistry, VoiceInputTrait, VoiceOutputTrait, VoronoiFractureSystem, WEATHER_PRESETS, aIDriverHandler, abTestHandler, abstain, accessibleHandler, advancedClothHandler, affinityHandler, agentDiscoveryHandler, agentMemoryHandler, agentMovementSystem, agentPortalHandler, aiInpaintingHandler, aiTextureGenHandler, aiUpscalingHandler, ainpcBrainHandler, alertHandler, altTextHandler, ambisonicsHandler, analyticsHandler, analyzeFairnessWindow, anchorHandler, animationConfigFromStateMachine, applyFBXAxisConversion, applyStatModifiers, applyUSDAxisConversion, approve, audioMaterialHandler, audioOcclusionHandler, audioPortalHandler, auditLogHandler, autoRigHandler, autoVote, avatarEmbodimentHandler, behaviorTreeHandler, biofeedbackHandler, blackboardHandler, bloomReactiveHandler, bodyTrackingHandler, bufferHandler, buildBehaviorFactDisclosure, buoyancyHandler, cRDTRoomHandler, careEthicsHandler, chainHandler, characterHandler, choreographyHandler, circuitBreakerHandler, clearLocalLLMNativeBridges, clothHandler, coLocatedHandler, compareSemVer, computeHandler, computePhyllotaxisPosition, computerUseHandler, consensusHandler, consentGateHandler, controlNetHandler, controllerInputHandler, controlnetHandler, createAIDriverTrait, createAnimationTrait, createApprovalRequest, createBaseMainnetAccountingAdapter, createBehaviorFactTtlAlertRule, createCRDTRoomTraitConfig, createCanBusAccountingAdapter, createCareField, createCharacterTrait, createConsensusTrait, createDialogTrait, createEdiX12AccountingAdapter, createEmotionDirectiveTrait, createHl7FhirAccountingAdapter, createIKTrait, createJointTrait, createLightingTrait, createLipSyncTrait, createLobbyTrait, createMaterialTrait, createMorphTrait, createNativeAutoRigPlan, createNetworkedTrait, createRenderingTrait, createRepairLoop, createRigidbodyTrait, createRollbackCheckpoint, createSelectiveDisclosure, createShaderTrait, createSharedSpatialProvider, createSimulatedController, createSpatialAwarenessTrait, createTriggerTrait, createURDFRobotTrait, createVoiceInputTrait, createVoiceOutputTrait, cronHandler, dataBindingHandler, deriveBloomReactiveOutput, deriveFairnessRisk, deriveLotusCenterPhase, deriveLotusGardenerSchedule, deriveLotusGenesisGate, deriveLotusGenesisSeed, deriveLotusPetalVisual, deriveLotusRootEmissive, deriveLotusStalkPosture, deriveWalkableNavmesh, destructionHandler, deviceProfiles, dialogHandler, dialogueHandler, diffusionRealtimeHandler, digitalTwinHandler, dropTableHandler, economyPrimitivesHandler, effectiveWeight, embeddingSearchHandler, emissiveAt, emotionDirectiveHandler, emotionHandler, emotionalVoiceHandler, encounterHandler, environmentalAudioHandler, evaluateAction, evaluateAutonomyGuard, evaluateCareEthicsTurn, evolveProgramHandler, extractLotusGenesisAnchorHash, extractPayload, eyeTrackedHandler, faceTrackingHandler, factionHandler, fairnessMonitorHandler, fbxHandler, feedbackLoopHandler, findReachablePath, findWalkableNodeAt, flowFieldHandler, fluidHandler, forgetPolicyHandler, formationControlHandler, gardenerPulseJitter, gaussianSplatHandler, gazeFocusAnalyticsHandler, gemResonanceHandler, generatedMeshHandler, geospatialAnchorHandler, geospatialEnvHandler, gestureHandler, getActiveSessions, getAgentId, getAirAbsorption, getAuditLog, getCachedThingDescription, getCapabilities, getCareEthicsState, getEventHistory, getFBXAnimationStacks, getFBXBoneNames, getFBXMorphTargets, getFBXState, getGLTFAnimations, getGLTFMorphTargets, getGLTFState, getMQTTSinkClient, getMQTTSinkState, getMQTTSourceClient, getMQTTSourceState, getMyProposals, getMyVotes, getNegotiationMethods, getPredicateCircuitId, getSession, getUSDActiveVariant, getUSDAnimation, getUSDBlendShapes, getUSDJointNames, getUSDState, getUSDVariantSets, getWoTThingState, gltfHandler, goalOrientedHandler, gpuBufferHandler, gpuParticleHandler, gpuPhysicsHandler, granularMaterialHandler, handMenuHandler, handMeshAIHandler, handTrackingHandler, hapticCueHandler, hapticHandler, hasMQTTSinkTrait, hasMQTTSourceTrait, hasVoted, hasWoTThingTrait, hashGardenerSeed, hashSeed, headTrackedAudioHandler, heatmap3dHandler, highContrastHandler, hitlHandler, hrtfHandler, iKHandler, initiate, invalidateThingDescription, isConsentGranted, isFBXLoaded, isGLTFLoaded, isInSession, isMQTTSinkConnected, isMQTTSourceConnected, isNativeLLMBackend, isReservedPaperId, isUSDLoaded, isUSDZ, isWalkableAt, jointHandler, layerAwareHandler, leave, lightEstimationHandler, lightingHandler, lipSyncHandler, llmAgentHandler, lobbyHandler, localLLMHandler, locomotionHandler, lodSystem, lotusCenterHandler, lotusGardenerHandler, lotusGenesisTriggerHandler, lotusPetalHandler, lotusRootHandler, lotusStalkHandler, luckHandler, magnifiableHandler, marketplaceHandler, marketplaceIntegrationHandler, matchesCondition, materialHandler, materialXHandler, memoryCrystalHandler, memoryHandler, meshDetectionHandler, messagingHandler, modifiedThreshold, morphHandler, motionReducedHandler, mqttSinkHandler, mqttSourceHandler, multiAgentHandler, multiviewGaussianRendererHandler, negotiationHandler, nerfHandler, networkedAvatarHandler, networkedHandler, neuralAnimationHandler, neuralForgeHandler, neuralLinkHandler, neuralUpscalingHandler, nftHandler, normalizeCenter, normalizeLotusSeed, normalizePointCloud, npcAIHandler, objectTrackingHandler, occlusionHandler, onboardingHandler, openXRHALHandler, parseCRDTRoomEntityConfig, parseCRDTRoomTraitConfig, partnerSDKHandler, passthroughCameraHandler, patrolHandler, perceptionHandler, perceptualColorHandler, persistentAnchorHandler, photogrammetryHandler, phyllotaxisHandler, physicsSystem, pickByWeight, planeDetectionHandler, poiHandler, pointCloudHandler, portableHandler, poseEstimationHandler, pressableHandler, propose, provenanceDensifyHandler, provenanceHandler, publishToMQTTSink, qrDecodeHandler, quotaHandler, ragKnowledgeHandler, rateLimiterHandler, rbacHandler, realityKitMeshHandler, recallTriggerHandler, recordGratitude, registerLocalLLMNativeBridge, rememberRelationalContext, remotePresenceHandler, renderNetworkHandler, renderingHandler, reputationLedgerHandler, resolveBloomStage, resolveCRDTRoomTraitConfig, resolvePulseHz, resourceAccountingHandler, reverbZoneHandler, rigidbodyHandler, roadmapNodeHandler, roleHandler, rooftopAnchorHandler, roomMeshHandler, ropeHandler, runECSBenchmark, runFairnessMonitorSweep, runResourceAccountingAudit, sampleTrack, sceneGraphHandler, sceneReconstructionHandler, schedulerHandler, screenReaderHandler, scrollableHandler, seatedHandler, secondsToUSDTimeCode, seededRand01, sensorHandler, setAgentManifest, shaderHandler, sharePlayHandler, sharedAnchorHandler, sharedWorldHandler, shouldFire, signRequest, skillRegistryHandler, slidableHandler, softBodyHandler, sonificationHandler, spatialAccessoryHandler, spatialAudioCueHandler, spatialAwarenessHandler, spatialNavigationHandler, spatialPanelHandler, spatialPersonaHandler, spectatorHandler, ssoOidcHandler, ssoSamlHandler, stableDiffusionHandler, stableFairnessMonitorHash, stableResourceAccountingReceiptHash, statHandler, structuredLoggerHandler, subtitleHandler, syncTierHandler, tenantHandler, terrainAnchorHandler, timeoutGuardHandler, tokenGatedHandler, transformHandler, triggerHandler, tutorialHandler, urdfRobotHandler, usdHandler, usdTimeCodeToSeconds, userMonitorHandler, validateCRDTRoomTraitConfig, validateCareField, validateSemVer, vectorDBHandler, verifyWebhookSignature, visionHandler, voiceInputHandler, voiceMeshHandler, voiceOutputHandler, voiceProximityHandler, volumetricHandler, volumetricVideoHandler, volumetricWindowHandler, voronoiFractureHandler, vote, vpsHandler, vrTraitRegistry, walletHandler, wasmBridgeHandler, windHandler, withNegotiation, worldPortalHandler, wotThingHandler, zkPrivateHandler };
61644
- //# sourceMappingURL=chunk-BQJ3YBF3.js.map
61645
- //# sourceMappingURL=chunk-BQJ3YBF3.js.map
61682
+ export { AIDriverTrait, ALL_CIRCUITS, ARKIT_MOUTH_SHAPES, AnimationTrait, BUILTIN_CIRCUITS, BarretenbergBackend, BehaviorTreeRunner, CARE_ETHICS_TRAIT, CRDTRoomTraitValidationError, CRDT_ROOM_TRAIT_DEFAULTS, CharacterTrait, ComponentType, ConsensusTrait, DEFAULT_ANIMATION_MAP, DEFAULT_AUTONOMY_GUARD_POLICY, DEFAULT_BEHAVIOR_FACT_TTL_ALERT_RULE, DEFAULT_EXPRESSION_PRESETS, DEFAULT_EXTERNAL_TIMEOUT_MS, DEFAULT_FOVEATED_BLEND, DEFAULT_FREQUENCY_BANDS, DEFAULT_REPUTATION_LEDGER_MAX_FACTS, DEFAULT_REPUTATION_LEDGER_TTL_DAYS, DEFAULT_SYNC_FIELD, DEFAULT_TRAIT_CONFIG2 as DEFAULT_TRAIT_CONFIG, DRAFT_DEFAULTS, DRAFT_TRAIT, DialogTrait, DraftManager, ECSWorld, EmotionDirectiveTrait, EnvironmentalAudioSystem, GEM_RESONANCE_ELEMENT_FREQUENCIES, GOAPPlanner, GOLDEN_ANGLE_DEG, HOLOSCRIPT_HUMANOID_BONE_MAP, IKTrait, InteractiveGraphTrait, JobQueuePersistence, JointTrait, LIGHTING_PRESETS, LOCAL_WEBCAM_VIEW_ID, LightingTrait, LipSyncTrait, LobbyTrait, MATERIAL_PRESETS2 as MATERIAL_PRESETS, MAX_EXPERIENCE_LOG_ENTRIES, MaterialTrait, MorphTrait, MultiviewGaussianRendererTrait, NetworkedTrait, OCULUS_VISEME_MAP, PIDControllerTrait, PressableTrait, REFERENCE_SPACE_CHAIN, REFUSED_CARE_OPTIMIZATION_TARGETS, RenderingTrait, RigidbodyTrait, SHADER_CHUNKS, SHADER_PRESETS, SPATIAL_PREDICATE_CIRCUITS, SYNC_PRESETS, SandboxExecutionTrait, ShaderTrait, SlidableTrait, SpatialAwarenessTrait, SyncTierTrait, TIER_DEFAULTS, TriggerTrait, URDFRobotTrait, VRTraitRegistry, VoiceInputTrait, VoiceOutputTrait, VoronoiFractureSystem, WEATHER_PRESETS, aIDriverHandler, abTestHandler, abstain, accessibleHandler, advancedClothHandler, affinityHandler, agentDiscoveryHandler, agentMemoryHandler, agentMovementSystem, agentPortalHandler, aiInpaintingHandler, aiTextureGenHandler, aiUpscalingHandler, ainpcBrainHandler, alertHandler, altTextHandler, ambisonicsHandler, analyticsHandler, analyzeFairnessWindow, anchorHandler, animationConfigFromStateMachine, applyFBXAxisConversion, applyStatModifiers, applyUSDAxisConversion, approve, audioMaterialHandler, audioOcclusionHandler, audioPortalHandler, auditLogHandler, autoRigHandler, autoVote, avatarEmbodimentHandler, behaviorTreeHandler, biofeedbackHandler, blackboardHandler, bloomReactiveHandler, bodyTrackingHandler, bufferHandler, buildBehaviorFactDisclosure, buoyancyHandler, cRDTRoomHandler, cacheHandler, careEthicsHandler, chainHandler, characterHandler, choreographyHandler, circuitBreakerHandler, clearLocalLLMNativeBridges, clothHandler, coLocatedHandler, compareSemVer, computeHandler, computePhyllotaxisPosition, computerUseHandler, consensusHandler, consentGateHandler, controlNetHandler, controllerInputHandler, controlnetHandler, createAIDriverTrait, createAnimationTrait, createApprovalRequest, createBaseMainnetAccountingAdapter, createBehaviorFactTtlAlertRule, createCRDTRoomTraitConfig, createCanBusAccountingAdapter, createCareField, createCharacterTrait, createConsensusTrait, createDialogTrait, createEdiX12AccountingAdapter, createEmotionDirectiveTrait, createHl7FhirAccountingAdapter, createIKTrait, createJointTrait, createLightingTrait, createLipSyncTrait, createLobbyTrait, createMaterialTrait, createMorphTrait, createNativeAutoRigPlan, createNetworkedTrait, createRenderingTrait, createRepairLoop, createRigidbodyTrait, createRollbackCheckpoint, createSelectiveDisclosure, createShaderTrait, createSharedSpatialProvider, createSimulatedController, createSpatialAwarenessTrait, createTriggerTrait, createURDFRobotTrait, createVoiceInputTrait, createVoiceOutputTrait, cronHandler, dataBindingHandler, deriveBloomReactiveOutput, deriveFairnessRisk, deriveLotusCenterPhase, deriveLotusGardenerSchedule, deriveLotusGenesisGate, deriveLotusGenesisSeed, deriveLotusPetalVisual, deriveLotusRootEmissive, deriveLotusStalkPosture, deriveWalkableNavmesh, destructionHandler, deviceProfiles, dialogHandler, dialogueHandler, diffusionRealtimeHandler, digitalTwinHandler, dropTableHandler, economyPrimitivesHandler, effectiveWeight, embeddingSearchHandler, emissiveAt, emotionDirectiveHandler, emotionHandler, emotionalVoiceHandler, encounterHandler, environmentalAudioHandler, evaluateAction, evaluateAutonomyGuard, evaluateCareEthicsTurn, evolveProgramHandler, extractLotusGenesisAnchorHash, extractPayload, eyeTrackedHandler, faceTrackingHandler, factionHandler, fairnessMonitorHandler, fbxHandler, feedbackLoopHandler, findReachablePath, findWalkableNodeAt, flowFieldHandler, fluidHandler, fluidSimulationHandler, forgetPolicyHandler, formationControlHandler, freezeWhenHandler, gardenerPulseJitter, gaussianSplatHandler, gazeFocusAnalyticsHandler, gemResonanceHandler, generatedMeshHandler, geospatialAnchorHandler, geospatialEnvHandler, gestureHandler, getActiveSessions, getAgentId, getAirAbsorption, getAuditLog, getCachedThingDescription, getCapabilities, getCareEthicsState, getEventHistory, getFBXAnimationStacks, getFBXBoneNames, getFBXMorphTargets, getFBXState, getGLTFAnimations, getGLTFMorphTargets, getGLTFState, getMQTTSinkClient, getMQTTSinkState, getMQTTSourceClient, getMQTTSourceState, getMyProposals, getMyVotes, getNegotiationMethods, getPredicateCircuitId, getSession, getUSDActiveVariant, getUSDAnimation, getUSDBlendShapes, getUSDJointNames, getUSDState, getUSDVariantSets, getWoTThingState, gltfHandler, goalOrientedHandler, gpuBufferHandler, gpuParticleHandler, gpuPhysicsHandler, granularMaterialHandler, handMenuHandler, handMeshAIHandler, handTrackingHandler, hapticCueHandler, hapticHandler, hasMQTTSinkTrait, hasMQTTSourceTrait, hasVoted, hasWoTThingTrait, hashGardenerSeed, hashSeed, headTrackedAudioHandler, heatmap3dHandler, highContrastHandler, hitlHandler, hrtfHandler, iKHandler, initiate, invalidateThingDescription, isConsentGranted, isFBXLoaded, isGLTFLoaded, isInSession, isMQTTSinkConnected, isMQTTSourceConnected, isNativeLLMBackend, isReservedPaperId, isUSDLoaded, isUSDZ, isWalkableAt, jointHandler, layerAwareHandler, leave, lightEstimationHandler, lightingHandler, lipSyncHandler, llmAgentHandler, lobbyHandler, localLLMHandler, locomotionHandler, lodSystem, lotusCenterHandler, lotusGardenerHandler, lotusGenesisTriggerHandler, lotusPetalHandler, lotusRootHandler, lotusStalkHandler, luckHandler, magnifiableHandler, marketplaceHandler, marketplaceIntegrationHandler, matchesCondition, materialHandler, materialXHandler, memoryCrystalHandler, memoryHandler, meshDetectionHandler, messagingHandler, modifiedThreshold, morphHandler, motionReducedHandler, mqttSinkHandler, mqttSourceHandler, multiAgentHandler, multiviewGaussianRendererHandler, negotiationHandler, nerfHandler, networkedAvatarHandler, networkedHandler, neuralAnimationHandler, neuralForgeHandler, neuralLinkHandler, neuralUpscalingHandler, nftHandler, normalizeCenter, normalizeLotusSeed, normalizePointCloud, npcAIHandler, objectTrackingHandler, occlusionHandler, onboardingHandler, openXRHALHandler, parseCRDTRoomEntityConfig, parseCRDTRoomTraitConfig, partnerSDKHandler, passthroughCameraHandler, patrolHandler, perceptionHandler, perceptualColorHandler, persistentAnchorHandler, photogrammetryHandler, phyllotaxisHandler, physicsSystem, pickByWeight, planeDetectionHandler, poiHandler, pointCloudHandler, portableHandler, poseEstimationHandler, pressableHandler, propose, provenanceDensifyHandler, provenanceHandler, publishToMQTTSink, qrDecodeHandler, quotaHandler, ragKnowledgeHandler, rateLimiterHandler, rbacHandler, realityKitMeshHandler, recallTriggerHandler, recordGratitude, registerLocalLLMNativeBridge, rememberRelationalContext, remotePresenceHandler, renderNetworkHandler, renderingHandler, reputationLedgerHandler, resolveBloomStage, resolveCRDTRoomTraitConfig, resolvePulseHz, resourceAccountingHandler, retryHandler, reverbZoneHandler, rigidbodyHandler, roadmapNodeHandler, roleHandler, rooftopAnchorHandler, roomMeshHandler, ropeHandler, runECSBenchmark, runFairnessMonitorSweep, runResourceAccountingAudit, sampleTrack, sceneGraphHandler, sceneReconstructionHandler, schedulerHandler, screenReaderHandler, scrollableHandler, seatedHandler, secondsToUSDTimeCode, seededRand01, sensorHandler, setAgentManifest, shaderHandler, sharePlayHandler, sharedAnchorHandler, sharedWorldHandler, shouldFire, signRequest, skillRegistryHandler, slidableHandler, softBodyHandler, sonificationHandler, spatialAccessoryHandler, spatialAudioCueHandler, spatialAwarenessHandler, spatialNavigationHandler, spatialPanelHandler, spatialPersonaHandler, spectatorHandler, ssoOidcHandler, ssoSamlHandler, stableDiffusionHandler, stableFairnessMonitorHash, stableResourceAccountingReceiptHash, statHandler, structuredLoggerHandler, subtitleHandler, syncTierHandler, tenantHandler, terrainAnchorHandler, timeoutGuardHandler, tokenGatedHandler, transformHandler, triggerHandler, tutorialHandler, urdfRobotHandler, usdHandler, usdTimeCodeToSeconds, userMonitorHandler, validateCRDTRoomTraitConfig, validateCareField, validateSemVer, vectorDBHandler, verifyWebhookSignature, visionHandler, voiceInputHandler, voiceMeshHandler, voiceOutputHandler, voiceProximityHandler, volumetricHandler, volumetricVideoHandler, volumetricWindowHandler, voronoiFractureHandler, vote, vpsHandler, vrTraitRegistry, walletHandler, wasmBridgeHandler, windHandler, withNegotiation, worldPortalHandler, wotThingHandler, zkPrivateHandler };
61683
+ //# sourceMappingURL=chunk-W4AJMMQR.js.map
61684
+ //# sourceMappingURL=chunk-W4AJMMQR.js.map