@holoscript/core 6.0.3 → 7.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 (244) hide show
  1. package/README.md +40 -40
  2. package/dist/codebase/index.d.ts +25 -0
  3. package/dist/compiler/index.d.ts +82 -0
  4. package/dist/constants.d.ts +4 -0
  5. package/dist/coordinators/index.d.ts +189 -0
  6. package/dist/entries/interop.d.ts +9 -0
  7. package/dist/entries/scripting.d.ts +7 -0
  8. package/dist/index.d.ts +520 -19
  9. package/dist/paper-0c-spike/index.d.ts +29 -0
  10. package/dist/reconstruction/index.d.ts +78 -0
  11. package/dist/self-improvement/index.d.ts +0 -48
  12. package/dist/storage/index.d.ts +24 -0
  13. package/dist/tools/index.d.ts +33 -0
  14. package/dist/traitDocs/traitDocs.d.ts +69 -0
  15. package/dist/traits/index.d.ts +61 -0
  16. package/package.json +102 -19
  17. package/dist/GLTFPipeline-3KLWWUQO.cjs +0 -34
  18. package/dist/GLTFPipeline-LYII2ZVQ.js +0 -13
  19. package/dist/HoloScriptPlusParser-BZR5DELQ.js +0 -692
  20. package/dist/HoloScriptPlusParser-SBMYDNXO.cjs +0 -697
  21. package/dist/USDZExporter-MHEHXZB4.cjs +0 -709
  22. package/dist/USDZExporter-YA55ZS35.js +0 -707
  23. package/dist/chunk-26TLYBFD.js +0 -309
  24. package/dist/chunk-27LWW5FU.cjs +0 -410
  25. package/dist/chunk-2UX5LRAP.cjs +0 -833
  26. package/dist/chunk-32TWR3HE.js +0 -70
  27. package/dist/chunk-3FXV5S25.cjs +0 -633
  28. package/dist/chunk-3FYZOR7S.cjs +0 -69
  29. package/dist/chunk-3KEU5QYY.cjs +0 -175
  30. package/dist/chunk-4FCZDTD5.js +0 -610
  31. package/dist/chunk-4KJ2R7VP.cjs +0 -507
  32. package/dist/chunk-4SMUJFHL.js +0 -1213
  33. package/dist/chunk-54FHG2MX.js +0 -655
  34. package/dist/chunk-56IF4NTA.js +0 -56
  35. package/dist/chunk-5GLCTO44.js +0 -161
  36. package/dist/chunk-5TOFIR6L.js +0 -407
  37. package/dist/chunk-65RFOWZI.js +0 -765
  38. package/dist/chunk-6OQBLABR.js +0 -5240
  39. package/dist/chunk-6WNCRE6F.js +0 -126
  40. package/dist/chunk-74YCHHTE.js +0 -1872
  41. package/dist/chunk-7H5UNJZD.cjs +0 -1973
  42. package/dist/chunk-7KPI4EKH.cjs +0 -701
  43. package/dist/chunk-7LCYLPW2.cjs +0 -663
  44. package/dist/chunk-7N3JIJMT.js +0 -1395
  45. package/dist/chunk-7X2IEJIE.cjs +0 -2526
  46. package/dist/chunk-A6GO3DPZ.cjs +0 -1002
  47. package/dist/chunk-AC4BSHFV.js +0 -765
  48. package/dist/chunk-AIUXRS74.cjs +0 -3681
  49. package/dist/chunk-ARNKA274.cjs +0 -130
  50. package/dist/chunk-AW7WAELW.js +0 -975
  51. package/dist/chunk-BKIGPPVM.js +0 -629
  52. package/dist/chunk-BO2OKHIY.js +0 -6055
  53. package/dist/chunk-BU5ZAFMC.js +0 -115
  54. package/dist/chunk-BY3B7ZYV.cjs +0 -457
  55. package/dist/chunk-C2QHVHZF.js +0 -4066
  56. package/dist/chunk-C7BNX4XJ.js +0 -1043
  57. package/dist/chunk-CLYEIWA5.cjs +0 -408
  58. package/dist/chunk-CMYAWUX3.js +0 -4455
  59. package/dist/chunk-CN4NOESF.cjs +0 -416
  60. package/dist/chunk-CNVM7J3M.js +0 -883
  61. package/dist/chunk-CO2VM2DK.js +0 -1965
  62. package/dist/chunk-CQDOF3G7.cjs +0 -1404
  63. package/dist/chunk-DH5G2JUA.cjs +0 -614
  64. package/dist/chunk-DIEDKX5B.cjs +0 -660
  65. package/dist/chunk-DN7UFU63.cjs +0 -172
  66. package/dist/chunk-DXVCEFZB.js +0 -2027
  67. package/dist/chunk-EGIZHYJP.cjs +0 -85
  68. package/dist/chunk-EJA7G2C4.cjs +0 -428
  69. package/dist/chunk-ELLQPFAF.js +0 -830
  70. package/dist/chunk-EMO7HAKJ.cjs +0 -1875
  71. package/dist/chunk-ENV7K6XA.js +0 -282
  72. package/dist/chunk-EPWRXL6S.js +0 -2522
  73. package/dist/chunk-EUFLX2PI.js +0 -56956
  74. package/dist/chunk-F5LVGHNT.js +0 -449
  75. package/dist/chunk-FEFHPUEM.cjs +0 -6122
  76. package/dist/chunk-FF3Q7ADR.js +0 -380
  77. package/dist/chunk-GC3YU46J.js +0 -762
  78. package/dist/chunk-H6WMMLQK.cjs +0 -4492
  79. package/dist/chunk-H7XMORZI.js +0 -2731
  80. package/dist/chunk-HAN4V3PF.cjs +0 -2037
  81. package/dist/chunk-HBZYCASG.js +0 -4208
  82. package/dist/chunk-HF4OFY25.cjs +0 -4097
  83. package/dist/chunk-HHS6FMOU.cjs +0 -3813
  84. package/dist/chunk-HJJLD366.js +0 -1169
  85. package/dist/chunk-HKCVM6OK.cjs +0 -2237
  86. package/dist/chunk-HUFNKFA6.js +0 -698
  87. package/dist/chunk-I3XGTIHM.cjs +0 -1505
  88. package/dist/chunk-I6XZ5DZF.cjs +0 -488
  89. package/dist/chunk-IHOUYQIA.js +0 -406
  90. package/dist/chunk-ILRBGFVD.cjs +0 -72
  91. package/dist/chunk-KDB6BUMB.js +0 -3666
  92. package/dist/chunk-KUJRR4FJ.js +0 -657
  93. package/dist/chunk-KYM4XRFG.js +0 -421
  94. package/dist/chunk-L3Z2HIWJ.cjs +0 -793
  95. package/dist/chunk-LBPEZQAF.js +0 -2232
  96. package/dist/chunk-LER4WXW5.cjs +0 -286
  97. package/dist/chunk-LK5IAVH6.cjs +0 -1173
  98. package/dist/chunk-M6FU6S22.js +0 -2911
  99. package/dist/chunk-MWEFR6YQ.js +0 -1857
  100. package/dist/chunk-N5FTS757.cjs +0 -415
  101. package/dist/chunk-NCUHGRTZ.js +0 -752
  102. package/dist/chunk-NKRKT6V2.js +0 -69
  103. package/dist/chunk-NLPSZT4C.js +0 -630
  104. package/dist/chunk-NRUB55IT.cjs +0 -771
  105. package/dist/chunk-NTMZSDXM.cjs +0 -633
  106. package/dist/chunk-ODGMVILH.js +0 -9662
  107. package/dist/chunk-PBA6NXCT.cjs +0 -1216
  108. package/dist/chunk-PHENW4MQ.js +0 -65
  109. package/dist/chunk-PJMOXFPR.cjs +0 -1861
  110. package/dist/chunk-PLMYCCA4.js +0 -504
  111. package/dist/chunk-PPULB4GG.cjs +0 -9728
  112. package/dist/chunk-PQLGZKMC.cjs +0 -755
  113. package/dist/chunk-Q56TT7IL.js +0 -483
  114. package/dist/chunk-QHVVVN47.cjs +0 -2033
  115. package/dist/chunk-QWKUKVRE.js +0 -2026
  116. package/dist/chunk-RE3OKSYF.cjs +0 -424
  117. package/dist/chunk-RT7LJRSF.cjs +0 -57378
  118. package/dist/chunk-SPDELRRV.cjs +0 -319
  119. package/dist/chunk-SUCBB66F.js +0 -229
  120. package/dist/chunk-TSWTWZ42.cjs +0 -4214
  121. package/dist/chunk-UITWA6DV.cjs +0 -2829
  122. package/dist/chunk-UQW6SLM5.js +0 -172
  123. package/dist/chunk-V2ILLPHK.cjs +0 -237
  124. package/dist/chunk-V42NTCFH.js +0 -3645
  125. package/dist/chunk-VJ3L7CHT.cjs +0 -169
  126. package/dist/chunk-VJVCD5T5.cjs +0 -769
  127. package/dist/chunk-VK5AXKO3.js +0 -746
  128. package/dist/chunk-VSXOIUCF.cjs +0 -473
  129. package/dist/chunk-VZNKJZTT.cjs +0 -749
  130. package/dist/chunk-W76ETJTI.js +0 -678
  131. package/dist/chunk-WFJIDI2N.cjs +0 -424
  132. package/dist/chunk-WN3YF33G.cjs +0 -118
  133. package/dist/chunk-WUXIRGZP.cjs +0 -2915
  134. package/dist/chunk-WYH4GVZ5.js +0 -1488
  135. package/dist/chunk-X4YVN7H3.cjs +0 -888
  136. package/dist/chunk-X67XRI2T.js +0 -410
  137. package/dist/chunk-XDXZM3ZP.cjs +0 -1046
  138. package/dist/chunk-XH7SE4HH.cjs +0 -72
  139. package/dist/chunk-XNMEH2BI.js +0 -126
  140. package/dist/chunk-XSF76QRU.js +0 -468
  141. package/dist/chunk-XSUZMPVQ.cjs +0 -682
  142. package/dist/chunk-XUILI4KB.cjs +0 -430
  143. package/dist/chunk-Y5MUAYTO.js +0 -167
  144. package/dist/chunk-Y7VK5TH3.cjs +0 -129
  145. package/dist/chunk-YCMQQQ5U.cjs +0 -5244
  146. package/dist/chunk-YYXH45E2.js +0 -426
  147. package/dist/chunk-ZGTGVSTZ.js +0 -422
  148. package/dist/chunk-ZL6VJ6SN.js +0 -421
  149. package/dist/cli/holoscript-runner.cjs +0 -2258
  150. package/dist/cli/holoscript-runner.js +0 -2233
  151. package/dist/codebase/index.cjs +0 -336
  152. package/dist/codebase/index.js +0 -331
  153. package/dist/compiler/agent-inference.cjs +0 -29
  154. package/dist/compiler/agent-inference.js +0 -6
  155. package/dist/compiler/android-xr.cjs +0 -20
  156. package/dist/compiler/android-xr.js +0 -10
  157. package/dist/compiler/android.cjs +0 -21
  158. package/dist/compiler/android.js +0 -11
  159. package/dist/compiler/ar.cjs +0 -21
  160. package/dist/compiler/ar.js +0 -9
  161. package/dist/compiler/babylon.cjs +0 -18
  162. package/dist/compiler/babylon.js +0 -12
  163. package/dist/compiler/coco.cjs +0 -27
  164. package/dist/compiler/coco.js +0 -4
  165. package/dist/compiler/domain-block-utils.cjs +0 -595
  166. package/dist/compiler/domain-block-utils.js +0 -9
  167. package/dist/compiler/dtdl.cjs +0 -25
  168. package/dist/compiler/dtdl.js +0 -9
  169. package/dist/compiler/gltf-pipeline.cjs +0 -39
  170. package/dist/compiler/gltf-pipeline.js +0 -4
  171. package/dist/compiler/godot.cjs +0 -16
  172. package/dist/compiler/godot.js +0 -10
  173. package/dist/compiler/incremental.cjs +0 -30
  174. package/dist/compiler/incremental.js +0 -5
  175. package/dist/compiler/index.cjs +0 -1522
  176. package/dist/compiler/index.js +0 -1321
  177. package/dist/compiler/ios.cjs +0 -21
  178. package/dist/compiler/ios.js +0 -11
  179. package/dist/compiler/multi-layer.cjs +0 -27
  180. package/dist/compiler/multi-layer.js +0 -12
  181. package/dist/compiler/nodetoy.cjs +0 -23
  182. package/dist/compiler/nodetoy.js +0 -4
  183. package/dist/compiler/openxr.cjs +0 -16
  184. package/dist/compiler/openxr.js +0 -10
  185. package/dist/compiler/playcanvas.cjs +0 -17
  186. package/dist/compiler/playcanvas.js +0 -11
  187. package/dist/compiler/r3f.cjs +0 -35
  188. package/dist/compiler/r3f.js +0 -13
  189. package/dist/compiler/remotion.cjs +0 -23
  190. package/dist/compiler/remotion.js +0 -4
  191. package/dist/compiler/reproducibility.cjs +0 -39
  192. package/dist/compiler/reproducibility.js +0 -4
  193. package/dist/compiler/sdf.cjs +0 -22
  194. package/dist/compiler/sdf.js +0 -10
  195. package/dist/compiler/semantic-scene.cjs +0 -31
  196. package/dist/compiler/semantic-scene.js +0 -4
  197. package/dist/compiler/state.cjs +0 -18
  198. package/dist/compiler/state.js +0 -8
  199. package/dist/compiler/trait-composition.cjs +0 -27
  200. package/dist/compiler/trait-composition.js +0 -6
  201. package/dist/compiler/unity.cjs +0 -16
  202. package/dist/compiler/unity.js +0 -10
  203. package/dist/compiler/unreal.cjs +0 -20
  204. package/dist/compiler/unreal.js +0 -10
  205. package/dist/compiler/urdf.cjs +0 -46
  206. package/dist/compiler/urdf.js +0 -10
  207. package/dist/compiler/usd-physics.cjs +0 -24
  208. package/dist/compiler/usd-physics.js +0 -7
  209. package/dist/compiler/visionos.cjs +0 -16
  210. package/dist/compiler/visionos.js +0 -10
  211. package/dist/compiler/vrchat.cjs +0 -20
  212. package/dist/compiler/vrchat.js +0 -10
  213. package/dist/compiler/vrr.cjs +0 -22
  214. package/dist/compiler/vrr.js +0 -10
  215. package/dist/compiler/wasm.cjs +0 -34
  216. package/dist/compiler/wasm.js +0 -10
  217. package/dist/compiler/webgpu.cjs +0 -16
  218. package/dist/compiler/webgpu.js +0 -10
  219. package/dist/debugger.cjs +0 -21
  220. package/dist/debugger.js +0 -8
  221. package/dist/entries/interop.cjs +0 -62
  222. package/dist/entries/interop.js +0 -5
  223. package/dist/entries/scripting.cjs +0 -67
  224. package/dist/entries/scripting.js +0 -10
  225. package/dist/index.cjs +0 -61703
  226. package/dist/index.js +0 -58652
  227. package/dist/math/vec3.cjs +0 -57
  228. package/dist/math/vec3.js +0 -4
  229. package/dist/parser.cjs +0 -26
  230. package/dist/parser.js +0 -9
  231. package/dist/playwright-7DTEQCBD.cjs +0 -98673
  232. package/dist/playwright-BIZXMLD2.js +0 -98660
  233. package/dist/post-quantum-JTTAAGO3.cjs +0 -6
  234. package/dist/post-quantum-RVPVDEPI.js +0 -4
  235. package/dist/runtime.cjs +0 -16
  236. package/dist/runtime.js +0 -7
  237. package/dist/storage/index.cjs +0 -37
  238. package/dist/storage/index.js +0 -4
  239. package/dist/traits/index.cjs +0 -14331
  240. package/dist/traits/index.js +0 -12126
  241. package/dist/type-checker.cjs +0 -18
  242. package/dist/type-checker.js +0 -5
  243. package/dist/wot/index.cjs +0 -29
  244. package/dist/wot/index.js +0 -4
@@ -1,72 +0,0 @@
1
- 'use strict';
2
-
3
- var chunkVZNKJZTT_cjs = require('./chunk-VZNKJZTT.cjs');
4
- var chunkY7VK5TH3_cjs = require('./chunk-Y7VK5TH3.cjs');
5
- var chunk2UX5LRAP_cjs = require('./chunk-2UX5LRAP.cjs');
6
- var chunkQHVVVN47_cjs = require('./chunk-QHVVVN47.cjs');
7
-
8
- // src/compiler/MultiLayerCompiler.ts
9
- chunkVZNKJZTT_cjs.init_VRRCompiler();
10
- chunkY7VK5TH3_cjs.init_ARCompiler();
11
- chunk2UX5LRAP_cjs.init_BabylonCompiler();
12
- chunkQHVVVN47_cjs.init_CompilerBase();
13
- chunkQHVVVN47_cjs.init_ANSNamespace();
14
- var MultiLayerCompiler = class extends chunkQHVVVN47_cjs.CompilerBase {
15
- constructor(options) {
16
- super();
17
- this.compilerName = "MultiLayerCompiler";
18
- this.options = options;
19
- }
20
- getRequiredCapability() {
21
- return chunkQHVVVN47_cjs.ANSCapabilityPath.MULTI_LAYER;
22
- }
23
- compile(composition, agentToken, outputPath) {
24
- this.validateCompilerAccess(agentToken, outputPath);
25
- const result = {
26
- success: true,
27
- warnings: [],
28
- errors: []
29
- };
30
- if (this.options.targets.includes("ar")) {
31
- const arCompiler = new chunkY7VK5TH3_cjs.ARCompiler({
32
- target: "webxr",
33
- minify: this.options.minify,
34
- source_maps: this.options.source_maps,
35
- features: { hit_test: true, image_tracking: true }
36
- });
37
- const arResult = arCompiler.compile(composition, agentToken);
38
- result.ar = arResult;
39
- if (!arResult.success) result.success = false;
40
- }
41
- if (this.options.targets.includes("vrr")) {
42
- const vrrCompiler = new chunkVZNKJZTT_cjs.VRRCompiler({
43
- target: "threejs",
44
- minify: this.options.minify,
45
- source_maps: this.options.source_maps,
46
- performance: { target_fps: 60, max_players: 1e3, lazy_loading: true },
47
- api_integrations: {}
48
- // Configured upstream based on @reality_mirror traits
49
- });
50
- const vrrResult = vrrCompiler.compile(composition, agentToken);
51
- result.vrr = vrrResult;
52
- if (!vrrResult.success) result.success = false;
53
- }
54
- if (this.options.targets.includes("vr")) {
55
- const vrCompiler = new chunk2UX5LRAP_cjs.BabylonCompiler({});
56
- try {
57
- const vrResult = vrCompiler.compile(composition, agentToken);
58
- result.vr = vrResult;
59
- } catch (err) {
60
- result.success = false;
61
- result.errors.push(`VR Compilation Error: ${err instanceof Error ? err.message : String(err)}`);
62
- }
63
- }
64
- return result;
65
- }
66
- };
67
- var MultiLayerCompiler_default = MultiLayerCompiler;
68
-
69
- exports.MultiLayerCompiler = MultiLayerCompiler;
70
- exports.MultiLayerCompiler_default = MultiLayerCompiler_default;
71
- //# sourceMappingURL=chunk-XH7SE4HH.cjs.map
72
- //# sourceMappingURL=chunk-XH7SE4HH.cjs.map
@@ -1,126 +0,0 @@
1
- import { __esm } from './chunk-32TWR3HE.js';
2
-
3
- // src/traits/constants/mobile/npu-scene.ts
4
- var NPU_SCENE_TRAITS, NPU_SCENE_DEFAULTS;
5
- var init_npu_scene = __esm({
6
- "src/traits/constants/mobile/npu-scene.ts"() {
7
- NPU_SCENE_TRAITS = [
8
- // --- Classification ---
9
- "npu_classify",
10
- // whole-image classification (VNClassifyImageRequest / ImageLabeler)
11
- // --- Detection ---
12
- "npu_detect",
13
- // bounding-box object detection (VNRecognizeAnimalsRequest / ObjectDetector)
14
- // --- Segmentation ---
15
- "npu_segment",
16
- // semantic segmentation mask (VNGeneratePersonSegmentationRequest / Segmenter)
17
- // --- Depth ---
18
- "npu_depth",
19
- // monocular depth estimation (ARFrame.sceneDepth / DepthEstimation ML Kit)
20
- // --- Entity Pipeline ---
21
- "npu_entity_pipe",
22
- // pipe recognized objects into .holo scene graph as interactive entities
23
- // --- Realtime ---
24
- "npu_realtime",
25
- // continuous inference on every camera frame (throttled to target FPS)
26
- // --- Custom Models ---
27
- "npu_model_custom",
28
- // load user-provided CoreML (.mlmodelc) or TFLite (.tflite) model
29
- // --- Label Overlay ---
30
- "npu_label_overlay"
31
- // holographic labels floating above recognized objects in AR space
32
- ];
33
- NPU_SCENE_DEFAULTS = {
34
- /** Target inference FPS for npu_realtime */
35
- targetFPS: 15,
36
- /** Minimum confidence threshold for detection/classification (0-1) */
37
- confidenceThreshold: 0.6,
38
- /** Maximum number of detected objects to track simultaneously */
39
- maxDetections: 20,
40
- /** Default entity scale factor when mapping detections to .holo entities */
41
- entityScale: 0.1,
42
- /** Label overlay offset above detected object (meters) */
43
- labelOffsetY: 0.15,
44
- /** Default segmentation classes of interest */
45
- segmentationClasses: ["person", "furniture", "vehicle", "animal", "food"]
46
- };
47
- }
48
- });
49
-
50
- // src/traits/constants/mobile/camera-hand-tracking.ts
51
- var CAMERA_HAND_TRACKING_TRAITS;
52
- var init_camera_hand_tracking = __esm({
53
- "src/traits/constants/mobile/camera-hand-tracking.ts"() {
54
- CAMERA_HAND_TRACKING_TRAITS = [
55
- // --- Core ---
56
- "camera_hand_track",
57
- // enable camera-based hand tracking
58
- "camera_hand_skeleton",
59
- // 21-joint skeleton data per hand (wrist, thumb[4], index[4], middle[4], ring[4], pinky[4])
60
- // --- Gestures ---
61
- "camera_hand_gesture_pinch",
62
- // pinch-to-grab (thumb + index tip proximity)
63
- "camera_hand_gesture_point",
64
- // point-to-select (index extended, others curled)
65
- "camera_hand_gesture_palm",
66
- // open-palm-to-dismiss (all fingers extended)
67
- "camera_hand_gesture_fist",
68
- // fist-to-grip (all fingers curled)
69
- // --- Configuration ---
70
- "camera_hand_two_hands",
71
- // track both hands simultaneously
72
- "camera_hand_confidence",
73
- // per-joint confidence threshold (filter noisy joints)
74
- "camera_hand_to_spatial"
75
- // bridge to existing spatial_input trait system
76
- ];
77
- }
78
- });
79
-
80
- // src/traits/constants/mobile/portal-ar.ts
81
- var PORTAL_AR_TRAITS;
82
- var init_portal_ar = __esm({
83
- "src/traits/constants/mobile/portal-ar.ts"() {
84
- PORTAL_AR_TRAITS = [
85
- // --- Mode ---
86
- "portal_mode",
87
- // enable portal AR rendering mode
88
- "portal_peek_through",
89
- // tilt phone to reveal holographic layer
90
- "portal_toggle",
91
- // tap to switch between real and holographic view
92
- // --- Occlusion ---
93
- "portal_occlusion",
94
- // real-world objects occlude holograms (depth buffer)
95
- "portal_people_occlusion",
96
- // people occlude holograms (ARKit matting / ML segmentation)
97
- "portal_reverse_occlusion",
98
- // holograms occlude real objects (inverted portal)
99
- // --- Rendering ---
100
- "portal_parallax",
101
- // depth-correct parallax as phone moves
102
- "portal_depth_fade",
103
- // holograms fade at distance for realism
104
- "portal_environment_twin",
105
- // whole-room holographic twin layer
106
- "portal_lighting_match",
107
- // match hologram lighting to real environment
108
- // --- Boundary ---
109
- "portal_boundary",
110
- // define portal edges (circle, rectangle, freeform)
111
- "portal_transition",
112
- // visual effect when crossing portal boundary
113
- "portal_edge_glow",
114
- // glow effect at portal boundary edges
115
- // --- World Mesh ---
116
- "portal_world_mesh",
117
- // use ARKit/ARCore scene mesh for portal integration
118
- "portal_mesh_occlusion"
119
- // scene mesh provides occlusion geometry
120
- ];
121
- }
122
- });
123
-
124
- export { CAMERA_HAND_TRACKING_TRAITS, NPU_SCENE_DEFAULTS, NPU_SCENE_TRAITS, PORTAL_AR_TRAITS, init_camera_hand_tracking, init_npu_scene, init_portal_ar };
125
- //# sourceMappingURL=chunk-XNMEH2BI.js.map
126
- //# sourceMappingURL=chunk-XNMEH2BI.js.map
@@ -1,468 +0,0 @@
1
- import { __esm } from './chunk-32TWR3HE.js';
2
-
3
- // src/traits/visual/types.ts
4
- var VISUAL_LAYER_PRIORITY;
5
- var init_types = __esm({
6
- "src/traits/visual/types.ts"() {
7
- VISUAL_LAYER_PRIORITY = {
8
- base_material: 0,
9
- surface: 1,
10
- condition: 2,
11
- physical: 3,
12
- scale: 4,
13
- lighting: 5,
14
- visual_effect: 6,
15
- environmental: 7,
16
- mood: 8
17
- };
18
- }
19
- });
20
-
21
- // src/traits/visual/TraitVisualRegistry.ts
22
- var TraitVisualRegistry;
23
- var init_TraitVisualRegistry = __esm({
24
- "src/traits/visual/TraitVisualRegistry.ts"() {
25
- TraitVisualRegistry = class _TraitVisualRegistry {
26
- constructor() {
27
- this.configs = /* @__PURE__ */ new Map();
28
- }
29
- /** Get the singleton instance. */
30
- static getInstance() {
31
- if (!_TraitVisualRegistry.instance) {
32
- _TraitVisualRegistry.instance = new _TraitVisualRegistry();
33
- }
34
- return _TraitVisualRegistry.instance;
35
- }
36
- /** Register a single trait's visual configuration. */
37
- register(traitName, config) {
38
- this.configs.set(traitName, config);
39
- }
40
- /** Register multiple trait visual configs at once. */
41
- registerBatch(entries) {
42
- for (const [name, config] of Object.entries(entries)) {
43
- this.configs.set(name, config);
44
- }
45
- }
46
- /** Look up a trait's visual config. Returns undefined if not registered. */
47
- get(traitName) {
48
- return this.configs.get(traitName);
49
- }
50
- /** Check if a trait has a registered visual config. */
51
- has(traitName) {
52
- return this.configs.has(traitName);
53
- }
54
- /** Get all registered configs (read-only). */
55
- getAll() {
56
- return this.configs;
57
- }
58
- /** Number of registered trait visuals. */
59
- get size() {
60
- return this.configs.size;
61
- }
62
- /** Reset the registry (primarily for testing). */
63
- reset() {
64
- this.configs.clear();
65
- }
66
- };
67
- }
68
- });
69
-
70
- // src/traits/visual/composition-rules.ts
71
- var COMPOSITION_RULES;
72
- var init_composition_rules = __esm({
73
- "src/traits/visual/composition-rules.ts"() {
74
- COMPOSITION_RULES = [
75
- // ══════════════════════════════════════════════════════════════════
76
- // REQUIREMENT RULES — trait only applies if another trait provides
77
- // the required tag (a trait cannot self-satisfy its own requirement)
78
- // ══════════════════════════════════════════════════════════════════
79
- // Corrosion traits only apply to objects with a metallic base
80
- { trait: "rusted", requires: { tags: ["metallic"] } },
81
- { trait: "tarnished", requires: { tags: ["metallic"] } },
82
- { trait: "corroded", requires: { tags: ["metallic"] } },
83
- // Metal finishing requires a metallic base
84
- { trait: "brushed", requires: { tags: ["metallic"] } },
85
- { trait: "hammered", requires: { tags: ["metallic"] } },
86
- // Organic overgrowth requires an organic or mineral base
87
- { trait: "moss_covered", requires: { tags: ["organic", "mineral", "stone"] } },
88
- { trait: "vine_covered", requires: { tags: ["organic", "mineral", "stone"] } },
89
- // Biological processes require organic base
90
- { trait: "decayed", requires: { tags: ["organic"] } },
91
- { trait: "fossilized", requires: { tags: ["organic"] } },
92
- { trait: "witherable", requires: { tags: ["organic"] } },
93
- { trait: "bloomable", requires: { tags: ["organic"] } },
94
- // ══════════════════════════════════════════════════════════════════
95
- // SUPPRESSION RULES — trait removes listed traits from consideration
96
- // ══════════════════════════════════════════════════════════════════
97
- // Pristine/brand_new suppress all damage/wear states
98
- {
99
- trait: "pristine",
100
- suppresses: [
101
- "rusted",
102
- "worn",
103
- "weathered",
104
- "decayed",
105
- "tarnished",
106
- "corroded",
107
- "crumbling",
108
- "faded",
109
- "stained",
110
- "scratched",
111
- "dented",
112
- "chipped",
113
- "cracked",
114
- "shattered",
115
- "battle_scarred",
116
- "charred",
117
- "tattered",
118
- "dust_covered",
119
- "moss_covered",
120
- "vine_covered"
121
- ]
122
- },
123
- {
124
- trait: "brand_new",
125
- suppresses: [
126
- "rusted",
127
- "worn",
128
- "weathered",
129
- "decayed",
130
- "tarnished",
131
- "corroded",
132
- "faded",
133
- "stained",
134
- "scratched",
135
- "dented",
136
- "chipped",
137
- "antique",
138
- "dust_covered"
139
- ]
140
- },
141
- // Restored suppresses active decay (but not cosmetic scars)
142
- {
143
- trait: "restored",
144
- suppresses: ["decayed", "crumbling", "corroded", "rusted"]
145
- },
146
- // Mirrored overrides surface textures
147
- {
148
- trait: "mirrored",
149
- suppresses: ["matte_surface", "frosted_surface", "brushed"]
150
- },
151
- // Temperature conflicts — fire and ice cancel each other
152
- {
153
- trait: "frozen_liquid",
154
- suppresses: ["fiery", "elemental_fire", "volcanic_eruption", "boiling", "charred"]
155
- },
156
- {
157
- trait: "elemental_fire",
158
- suppresses: ["frozen_liquid", "elemental_ice", "frosted_surface"]
159
- },
160
- // Visibility — invisible/cloaking suppress visual effects
161
- {
162
- trait: "invisible",
163
- suppresses: ["glowing", "neon_glow", "luminous", "bioluminescent", "holographic", "outlined"]
164
- },
165
- {
166
- trait: "cloaking",
167
- suppresses: ["glowing", "neon_glow", "holographic", "outlined"]
168
- },
169
- // Petrification/fossilization suppress living traits
170
- {
171
- trait: "petrified",
172
- suppresses: ["growable", "bloomable", "photosynthetic", "witherable"]
173
- },
174
- {
175
- trait: "fossilized",
176
- suppresses: ["growable", "bloomable", "bioluminescent", "photosynthetic"]
177
- },
178
- // Crystallization suppresses soft surface textures
179
- {
180
- trait: "crystallized",
181
- suppresses: ["furry", "velvety", "woolly", "silky"]
182
- },
183
- // Magic conflicts — blessed and cursed cancel each other
184
- { trait: "cursed", suppresses: ["blessed"] },
185
- { trait: "blessed", suppresses: ["cursed"] },
186
- // Environmental conflicts
187
- {
188
- trait: "drought",
189
- suppresses: ["leaking", "overflowing", "moss_covered"]
190
- },
191
- {
192
- trait: "flood",
193
- suppresses: ["drought", "dust_covered", "sandstorm"]
194
- },
195
- {
196
- trait: "underwater",
197
- suppresses: ["fiery", "elemental_fire"]
198
- },
199
- // ══════════════════════════════════════════════════════════════════
200
- // ADDITIVE RULES — extra properties blended on top
201
- // ══════════════════════════════════════════════════════════════════
202
- // Frozen adds blue tint
203
- { trait: "frozen_liquid", additive: { color: "#D6EAF8" } },
204
- // Enchanted adds a subtle purple shimmer
205
- { trait: "enchanted", additive: { emissive: "#9966FF", emissiveIntensity: 0.3 } },
206
- // Ghostly adds transparency
207
- { trait: "ghostly", additive: { opacity: 0.3, transparent: true } },
208
- // Electric adds blue-white emissive
209
- { trait: "electric_arc", additive: { emissive: "#00BFFF", emissiveIntensity: 0.5 } },
210
- // Bioluminescence adds green glow
211
- { trait: "bioluminescent", additive: { emissive: "#00FFAA", emissiveIntensity: 0.4 } },
212
- // Iridescent/pearlescent add color-shift sheen
213
- { trait: "iridescent", additive: { iridescence: 0.5 } },
214
- { trait: "pearlescent", additive: { iridescence: 0.8 } },
215
- // ══════════════════════════════════════════════════════════════════
216
- // MULTI-TRAIT MERGE RULES — when all listed traits are present,
217
- // override merged material with these values (applied last)
218
- // ══════════════════════════════════════════════════════════════════
219
- // ── Metal synergies ─────────────────────────────────────────────
220
- // Iron + rusted = corroded bronze appearance
221
- {
222
- traits: ["rusted", "iron_material"],
223
- merge: { color: "#6B3A1F", roughness: 0.9, metalness: 0.5 }
224
- },
225
- // Copper + rusted = verdigris patina
226
- {
227
- traits: ["rusted", "copper_material"],
228
- merge: { color: "#5C8A7A", roughness: 0.7, metalness: 0.6 }
229
- },
230
- // Gold + polished = high-shine gold
231
- {
232
- traits: ["gold_material", "polished"],
233
- merge: { roughness: 0.05, envMapIntensity: 2 }
234
- },
235
- // ── Elemental synergies ─────────────────────────────────────────
236
- // Water + frozen = deep ice
237
- {
238
- traits: ["elemental_water", "frozen_liquid"],
239
- merge: { color: "#B0D4E8", transmission: 0.85, roughness: 0.05 }
240
- },
241
- // Fire + angry = rage inferno
242
- {
243
- traits: ["elemental_fire", "angry"],
244
- merge: { emissive: "#FF1100", emissiveIntensity: 3.5 }
245
- },
246
- // Lightning + thunderstorm = storm energy
247
- {
248
- traits: ["elemental_lightning", "thunderstorm"],
249
- merge: { emissive: "#FFFFFF", emissiveIntensity: 4.5 }
250
- },
251
- // Earth + ancient = primordial stone
252
- {
253
- traits: ["elemental_earth", "ancient"],
254
- merge: { roughness: 1, color: "#5A4A3A" }
255
- },
256
- // ── Magic synergies ─────────────────────────────────────────────
257
- // Enchanted + ancient = magical artifact
258
- {
259
- traits: ["enchanted", "ancient"],
260
- merge: { emissive: "#9966FF", emissiveIntensity: 0.5, color: "#8B6914" }
261
- },
262
- // Blessed + gold = holy golden artifact
263
- {
264
- traits: ["blessed", "gold_material"],
265
- merge: { emissive: "#FFFACD", emissiveIntensity: 0.8, envMapIntensity: 2 }
266
- },
267
- // Enchanted + diamond = spellbound gem
268
- {
269
- traits: ["enchanted", "diamond_gem"],
270
- merge: { emissive: "#CC88FF", emissiveIntensity: 0.6, iridescence: 1 }
271
- },
272
- // Crystal + enchanted = magical crystal
273
- {
274
- traits: ["crystal_gem", "enchanted"],
275
- merge: { emissive: "#CC88FF", emissiveIntensity: 1, iridescence: 1 }
276
- },
277
- // Cursed + blood stained = profane artifact
278
- {
279
- traits: ["cursed", "blood_stained"],
280
- merge: { emissive: "#660000", emissiveIntensity: 0.8, color: "#4A0000" }
281
- },
282
- // ── Age + condition synergies ───────────────────────────────────
283
- // Ancient + weathered = time-worn relic
284
- {
285
- traits: ["ancient", "weathered"],
286
- merge: { roughness: 0.95, color: "#6B5A4A" }
287
- },
288
- // Ancient + moss = ancient overgrown ruins
289
- {
290
- traits: ["ancient", "moss_covered"],
291
- merge: { roughness: 0.95, color: "#3A6A2F" }
292
- },
293
- // Pristine + crystal = flawless crystal
294
- {
295
- traits: ["pristine", "crystal_gem"],
296
- merge: { roughness: 0, transmission: 0.98, envMapIntensity: 2.5 }
297
- },
298
- // ── Nature synergies ────────────────────────────────────────────
299
- // Bioluminescent + aquatic = glowing sea creature
300
- {
301
- traits: ["bioluminescent", "aquatic"],
302
- merge: { emissive: "#00CCAA", emissiveIntensity: 1.2 }
303
- },
304
- // Venomous + glowing = toxic glow
305
- {
306
- traits: ["venomous", "glowing"],
307
- merge: { emissive: "#00FF00", emissiveIntensity: 0.8, color: "#3A5A1A" }
308
- },
309
- // Wildfire + wooden = burning wood
310
- {
311
- traits: ["wildfire", "wooden"],
312
- merge: { emissive: "#FF4500", emissiveIntensity: 2.5, roughness: 0.9 }
313
- },
314
- // ── Visual effect synergies ─────────────────────────────────────
315
- // Emissive + angry mood = intense red emissive
316
- {
317
- traits: ["emissive", "angry"],
318
- merge: { emissive: "#FF2200", emissiveIntensity: 2.5 }
319
- },
320
- // Holographic + ghostly = spectral hologram
321
- {
322
- traits: ["holographic", "ghostly"],
323
- merge: { opacity: 0.2, emissive: "#88BBFF", emissiveIntensity: 1.5 }
324
- },
325
- // Holographic + neon = vibrant holographic display
326
- {
327
- traits: ["holographic", "neon_glow"],
328
- merge: { emissive: "#00FFFF", emissiveIntensity: 2, opacity: 0.5 }
329
- },
330
- // Frozen + crystalline = ice crystal formation
331
- {
332
- traits: ["frozen_liquid", "crystalline"],
333
- merge: { transmission: 0.9, ior: 1.31, iridescence: 0.7 }
334
- },
335
- // Eerie + ghostly = spectral haunting
336
- {
337
- traits: ["eerie", "ghostly"],
338
- merge: { emissive: "#6633AA", emissiveIntensity: 0.5, opacity: 0.25 }
339
- },
340
- // ── Sci-fi synergies ────────────────────────────────────────────
341
- // Plasma + force field = plasma barrier
342
- {
343
- traits: ["plasma", "force_field"],
344
- merge: { emissive: "#FF00FF", emissiveIntensity: 2.5, opacity: 0.4 }
345
- }
346
- ];
347
- }
348
- });
349
-
350
- // src/traits/visual/TraitCompositor.ts
351
- var TraitCompositor;
352
- var init_TraitCompositor = __esm({
353
- "src/traits/visual/TraitCompositor.ts"() {
354
- init_types();
355
- init_TraitVisualRegistry();
356
- init_composition_rules();
357
- TraitCompositor = class {
358
- constructor(registry, rules) {
359
- this.registry = registry ?? TraitVisualRegistry.getInstance();
360
- this.rules = rules ?? COMPOSITION_RULES;
361
- }
362
- /**
363
- * Compose multiple trait visuals into a single material config.
364
- * Returns only the properties that were explicitly set by at least one trait.
365
- */
366
- compose(traitNames) {
367
- const entries = [];
368
- for (const name of traitNames) {
369
- const config = this.registry.get(name);
370
- if (!config) continue;
371
- const layer = config.layer ?? "visual_effect";
372
- const priority = VISUAL_LAYER_PRIORITY[layer];
373
- entries.push({ name, config, priority });
374
- }
375
- const suppressedTraits = this.getSuppressedTraits(traitNames);
376
- const activeEntries = entries.filter((e) => !suppressedTraits.has(e.name));
377
- const tagProviders = /* @__PURE__ */ new Map();
378
- for (const entry of activeEntries) {
379
- if (entry.config.tags) {
380
- for (const tag of entry.config.tags) {
381
- if (!tagProviders.has(tag)) tagProviders.set(tag, /* @__PURE__ */ new Set());
382
- tagProviders.get(tag).add(entry.name);
383
- }
384
- }
385
- }
386
- const filteredEntries = activeEntries.filter((e) => {
387
- return this.meetsRequirements(e.name, tagProviders);
388
- });
389
- filteredEntries.sort((a, b) => a.priority - b.priority);
390
- const merged = {};
391
- for (const entry of filteredEntries) {
392
- if (entry.config.material) {
393
- Object.assign(merged, entry.config.material);
394
- }
395
- if (entry.config.emissive) {
396
- merged.emissive = entry.config.emissive.color;
397
- merged.emissiveIntensity = entry.config.emissive.intensity;
398
- }
399
- if (entry.config.opacity !== void 0) {
400
- merged.opacity = entry.config.opacity;
401
- merged.transparent = entry.config.opacity < 1;
402
- }
403
- }
404
- const activeTraitNames = filteredEntries.map((e) => e.name);
405
- const activeTags = /* @__PURE__ */ new Set();
406
- for (const entry of filteredEntries) {
407
- if (entry.config.tags) {
408
- for (const tag of entry.config.tags) {
409
- activeTags.add(tag);
410
- }
411
- }
412
- }
413
- this.applyAdditiveRules(activeTraitNames, activeTags, merged);
414
- return merged;
415
- }
416
- /** Get set of trait names suppressed by other active traits. */
417
- getSuppressedTraits(traitNames) {
418
- const suppressed = /* @__PURE__ */ new Set();
419
- const nameSet = new Set(traitNames);
420
- for (const rule of this.rules) {
421
- if ("suppresses" in rule && rule.suppresses && nameSet.has(rule.trait)) {
422
- for (const s of rule.suppresses) {
423
- suppressed.add(s);
424
- }
425
- }
426
- }
427
- return suppressed;
428
- }
429
- /** Check if a trait's requirement rules are satisfied by OTHER traits' tags. */
430
- meetsRequirements(traitName, tagProviders) {
431
- for (const rule of this.rules) {
432
- if (!("requires" in rule) || rule.trait !== traitName || !rule.requires) continue;
433
- if (rule.requires.tags) {
434
- const hasRequired = rule.requires.tags.some((tag) => {
435
- const providers = tagProviders.get(tag);
436
- if (!providers) return false;
437
- for (const provider of providers) {
438
- if (provider !== traitName) return true;
439
- }
440
- return false;
441
- });
442
- if (!hasRequired) return false;
443
- }
444
- }
445
- return true;
446
- }
447
- /** Apply additive rules and multi-trait merge overrides. */
448
- applyAdditiveRules(traitNames, allTags, merged) {
449
- const nameSet = new Set(traitNames);
450
- for (const rule of this.rules) {
451
- if ("additive" in rule && rule.additive && nameSet.has(rule.trait)) {
452
- Object.assign(merged, rule.additive);
453
- }
454
- if ("traits" in rule && rule.traits && "merge" in rule && rule.merge) {
455
- const allPresent = rule.traits.every((t) => nameSet.has(t));
456
- if (allPresent) {
457
- Object.assign(merged, rule.merge);
458
- }
459
- }
460
- }
461
- }
462
- };
463
- }
464
- });
465
-
466
- export { COMPOSITION_RULES, TraitCompositor, TraitVisualRegistry, VISUAL_LAYER_PRIORITY, init_TraitCompositor, init_TraitVisualRegistry, init_composition_rules, init_types };
467
- //# sourceMappingURL=chunk-XSF76QRU.js.map
468
- //# sourceMappingURL=chunk-XSF76QRU.js.map