@holoscript/core 6.0.4 → 6.1.1

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 (352) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +3 -3
  3. package/bin/holoscript.cjs +3 -0
  4. package/dist/GLTFPipeline-SFIORFJU.js +16 -0
  5. package/dist/GLTFPipeline-VNNDPONV.cjs +37 -0
  6. package/dist/{HoloScriptPlusParser-BN6KVRCM.js → HoloScriptPlusParser-7FBIFUFC.js} +6 -5
  7. package/dist/{HoloScriptPlusParser-NC5FE6AL.cjs → HoloScriptPlusParser-A2W7OCN2.cjs} +17 -16
  8. package/dist/HoloScriptPlusParser-F2Z56FJR.js +10 -0
  9. package/dist/HoloScriptPlusParser-WKHRIH6T.cjs +27 -0
  10. package/dist/{USDZExporter-UWGWNMMD.cjs → USDZExporter-3FWJ25JI.cjs} +344 -16
  11. package/dist/{USDZExporter-NTMBNTDB.js → USDZExporter-D2HQLQYK.js} +344 -16
  12. package/dist/agents/index.cjs +19 -0
  13. package/dist/agents/index.d.ts +100 -0
  14. package/dist/agents/index.js +17 -0
  15. package/dist/chunk-22W6NGYN.js +725 -0
  16. package/dist/{chunk-5OEOHAAW.cjs → chunk-27MPVJVZ.cjs} +64 -28
  17. package/dist/{chunk-RVYPEYPX.js → chunk-2A7FURVO.js} +44 -8
  18. package/dist/{chunk-XCWFGZAA.js → chunk-2B7WVIDZ.js} +11 -8
  19. package/dist/{chunk-NDQNIJEH.js → chunk-2BSMSUCE.js} +250 -24
  20. package/dist/chunk-2HLIGOKU.cjs +5546 -0
  21. package/dist/{chunk-EONILVMF.js → chunk-2M2DPHKB.js} +4 -4
  22. package/dist/{chunk-G7CT3EMP.cjs → chunk-2YSNA2F2.cjs} +319 -47
  23. package/dist/{chunk-IWI6J7FX.js → chunk-33XCOVE3.js} +5 -5
  24. package/dist/chunk-3FOKASKO.cjs +348 -0
  25. package/dist/{chunk-DXJQDCFL.js → chunk-4C57PR42.js} +3 -3
  26. package/dist/{chunk-MPXBVFHQ.js → chunk-4N4SXXWF.js} +4 -3
  27. package/dist/chunk-4PDEPEQW.cjs +41 -0
  28. package/dist/chunk-4R6SBXDB.js +45 -0
  29. package/dist/chunk-4SY77NA4.cjs +413 -0
  30. package/dist/{chunk-YCXFCXDS.js → chunk-4UUKPCY4.js} +668 -110
  31. package/dist/{chunk-LGGRPKTV.cjs → chunk-52ULD552.cjs} +114 -35
  32. package/dist/{chunk-L4G4RLXX.js → chunk-5CKA5SXU.js} +438 -22
  33. package/dist/chunk-5FSKKMR7.cjs +2092 -0
  34. package/dist/{chunk-FF3Q7ADR.js → chunk-5JEU52DW.js} +5 -3
  35. package/dist/chunk-5N54COB6.cjs +327 -0
  36. package/dist/chunk-5S7RKFGR.cjs +446 -0
  37. package/dist/{chunk-KED34ILP.js → chunk-6ASWLXXN.js} +21 -9
  38. package/dist/chunk-6CTRH7HT.cjs +1985 -0
  39. package/dist/{chunk-CAUCGUEA.cjs → chunk-6EX3I5P4.cjs} +6 -6
  40. package/dist/chunk-6FGQNDR4.js +5731 -0
  41. package/dist/{chunk-72EQECGT.cjs → chunk-6KMK2UXT.cjs} +122 -46
  42. package/dist/{chunk-G4VZTCIB.js → chunk-6L4VE27M.js} +33 -23
  43. package/dist/{chunk-ATSKSYVE.cjs → chunk-6S6TKNEA.cjs} +6478 -1738
  44. package/dist/chunk-77V4GTCA.js +596 -0
  45. package/dist/{chunk-ZP4D3CSX.cjs → chunk-7AD52FRS.cjs} +16 -16
  46. package/dist/chunk-7OPW2KO7.cjs +639 -0
  47. package/dist/chunk-A6KINLZJ.js +236 -0
  48. package/dist/chunk-AIA52I7T.cjs +543 -0
  49. package/dist/chunk-AIX25INK.cjs +602 -0
  50. package/dist/{chunk-B5TCIAPQ.cjs → chunk-AO4I2Z7M.cjs} +17 -18
  51. package/dist/{chunk-Q5SJOGHQ.cjs → chunk-BPICAGBV.cjs} +324 -199
  52. package/dist/chunk-BRQJKJGT.cjs +20 -0
  53. package/dist/{chunk-3FXV5S25.cjs → chunk-C37BHB7N.cjs} +6 -3
  54. package/dist/{chunk-XUTX5CBW.js → chunk-CBJY23VL.js} +3 -3
  55. package/dist/chunk-CIWWXYHZ.cjs +50 -0
  56. package/dist/{chunk-XXINBTZK.cjs → chunk-DIL6DDDN.cjs} +101 -45
  57. package/dist/chunk-DMXC24WV.js +404 -0
  58. package/dist/{chunk-PMGODDJA.cjs → chunk-DTGBOSEM.cjs} +12 -12
  59. package/dist/chunk-E7JP3BS3.cjs +61 -0
  60. package/dist/{chunk-HJJLD366.js → chunk-EKBKLK7P.js} +3 -3
  61. package/dist/chunk-EKYL4PE3.cjs +404 -0
  62. package/dist/{chunk-UPJBDCVF.js → chunk-EMMC5CSQ.js} +12 -8
  63. package/dist/{chunk-GGHSW2NN.js → chunk-EOBB6A4B.js} +6389 -1718
  64. package/dist/chunk-EOFNVCM6.js +325 -0
  65. package/dist/{chunk-FHQVYCH2.js → chunk-ER4GATIU.js} +7 -7
  66. package/dist/{chunk-N5FTS757.cjs → chunk-EXKSFGSX.cjs} +7 -148
  67. package/dist/{chunk-LK5IAVH6.cjs → chunk-EXUP2BUM.cjs} +27 -27
  68. package/dist/chunk-FDSGHPAK.js +130 -0
  69. package/dist/chunk-FEWUHQNM.cjs +144 -0
  70. package/dist/{chunk-5TOFIR6L.js → chunk-FGGJQRLZ.js} +5 -142
  71. package/dist/chunk-FHP6LXJS.js +415 -0
  72. package/dist/{chunk-7LCYLPW2.cjs → chunk-FJPADH77.cjs} +7 -4
  73. package/dist/{chunk-T36DDXSF.js → chunk-FXKTYFYA.js} +150 -25
  74. package/dist/chunk-GCMWDSBZ.cjs +729 -0
  75. package/dist/chunk-GJNCFRJU.cjs +125 -0
  76. package/dist/{chunk-Q4QX3AET.cjs → chunk-GMP623FG.cjs} +16 -13
  77. package/dist/{chunk-XD6IYDUX.js → chunk-GN3KDX4W.js} +119 -43
  78. package/dist/{chunk-QLEAOI3Q.cjs → chunk-GQYKQSTC.cjs} +10 -10
  79. package/dist/chunk-GTU2Z2WW.cjs +262 -0
  80. package/dist/chunk-GZG4KA4E.js +529 -0
  81. package/dist/{chunk-BND3ST2K.cjs → chunk-H3MGK7TX.cjs} +42 -32
  82. package/dist/{chunk-XRKWN5PL.cjs → chunk-H5DZIHJP.cjs} +14 -18
  83. package/dist/{chunk-Z34RLXRA.cjs → chunk-HANL7K2Q.cjs} +65 -50
  84. package/dist/{chunk-3SAK5KFL.cjs → chunk-HCCQLAA4.cjs} +2 -11
  85. package/dist/{chunk-LXJ4667L.cjs → chunk-HGVXZDSK.cjs} +108 -20
  86. package/dist/{chunk-3FJCK5XA.js → chunk-HRODTEEO.js} +30 -10
  87. package/dist/{chunk-HQUEA5R6.cjs → chunk-HZCQO4JM.cjs} +6 -6
  88. package/dist/{chunk-S565K7NK.js → chunk-I2O7TW6B.js} +12 -8
  89. package/dist/chunk-IHESJZSW.js +4490 -0
  90. package/dist/{chunk-FSF7EQVA.cjs → chunk-IRWWS72C.cjs} +63 -22
  91. package/dist/{chunk-5O6TQC6M.cjs → chunk-IVIA7K75.cjs} +689 -127
  92. package/dist/chunk-IVY74O6C.js +247 -0
  93. package/dist/chunk-J32ZJZJH.js +554 -0
  94. package/dist/chunk-JD7CIZ33.js +1949 -0
  95. package/dist/{chunk-T7LEXZUZ.cjs → chunk-JIYN45TV.cjs} +14 -15
  96. package/dist/{chunk-FFKU7BTK.cjs → chunk-KHPCJRI3.cjs} +24 -21
  97. package/dist/chunk-KKFZ3B6J.cjs +557 -0
  98. package/dist/chunk-KPJL34Y7.cjs +186 -0
  99. package/dist/{chunk-HE7ULERA.cjs → chunk-KQTPCYTG.cjs} +128 -44
  100. package/dist/{chunk-OFKWH2IP.js → chunk-KX76JUQY.js} +3 -3
  101. package/dist/chunk-L4LFINPO.js +623 -0
  102. package/dist/{chunk-33LSUQDD.cjs → chunk-L63H3SQ4.cjs} +43 -31
  103. package/dist/{chunk-K6EKD26I.js → chunk-LAOCQJ2M.js} +64 -8
  104. package/dist/chunk-LM2VU56C.cjs +37 -0
  105. package/dist/chunk-M56JSP4A.js +400 -0
  106. package/dist/chunk-MBOOR7X4.js +18 -0
  107. package/dist/{chunk-XWPNTWDN.cjs → chunk-MJVIRCUV.cjs} +31 -27
  108. package/dist/{chunk-SDAMZIRE.js → chunk-MSMIFMBL.js} +135 -18
  109. package/dist/{chunk-56IF4NTA.js → chunk-MXFUTKCO.js} +18 -18
  110. package/dist/{chunk-6UEHYZ7V.cjs → chunk-MXJ5SS53.cjs} +447 -31
  111. package/dist/chunk-MXWNGCRS.js +2176 -0
  112. package/dist/chunk-MYY4PMWX.cjs +264 -0
  113. package/dist/chunk-N75IH2HY.js +258 -0
  114. package/dist/{chunk-GVUR45UF.cjs → chunk-NG77ATEW.cjs} +7 -6
  115. package/dist/chunk-NW5G5FBQ.js +215 -0
  116. package/dist/{chunk-E3FWRT3Z.js → chunk-OEFY723R.js} +28 -13
  117. package/dist/chunk-OEV5RMZO.cjs +3042 -0
  118. package/dist/{chunk-X4ZF6CNE.cjs → chunk-OIQYIIO3.cjs} +7 -7
  119. package/dist/{chunk-2CWOLHTE.js → chunk-OL46QLBJ.js} +3 -11
  120. package/dist/chunk-OPZ7XDDI.js +487 -0
  121. package/dist/chunk-OSYNRVOV.cjs +243 -0
  122. package/dist/{chunk-TEWCN33Y.js → chunk-P7YIA5LN.js} +91 -7
  123. package/dist/chunk-PGANYCAG.cjs +220 -0
  124. package/dist/{chunk-CS2EMTGF.js → chunk-QAVXL2IH.js} +62 -21
  125. package/dist/{chunk-T4NKMBDL.js → chunk-QCCBXSCE.js} +1666 -756
  126. package/dist/{chunk-F4IULT7N.js → chunk-QPOQ7VPI.js} +16 -13
  127. package/dist/{chunk-6XSERL6L.js → chunk-QTPMJRGS.js} +3108 -2827
  128. package/dist/{chunk-F3HH56EB.cjs → chunk-QWNQ523V.cjs} +1730 -823
  129. package/dist/{chunk-R7MA7QWV.js → chunk-R3IVNY6P.js} +102 -23
  130. package/dist/chunk-R75BSDH7.cjs +50 -0
  131. package/dist/{chunk-BF2235SI.cjs → chunk-RMHC2VG7.cjs} +2876 -2592
  132. package/dist/chunk-RUXGBKPS.cjs +4517 -0
  133. package/dist/{chunk-UERJ3YJV.js → chunk-S5IFXW6E.js} +113 -9
  134. package/dist/{chunk-27LWW5FU.cjs → chunk-S6YWHCKV.cjs} +5 -5
  135. package/dist/{chunk-WB4Z63GG.js → chunk-SIEXCILW.js} +3 -3
  136. package/dist/{chunk-CLYEIWA5.cjs → chunk-SLU6UPJI.cjs} +5 -3
  137. package/dist/{chunk-LZ266PCM.cjs → chunk-T5J7ZKP3.cjs} +446 -60
  138. package/dist/chunk-TDCNJHWO.js +341 -0
  139. package/dist/{chunk-IHOUYQIA.js → chunk-TG7O4WBC.js} +5 -5
  140. package/dist/chunk-THCK6ECW.js +2085 -0
  141. package/dist/chunk-TJHVSBP2.js +439 -0
  142. package/dist/chunk-TK74TR4H.js +5541 -0
  143. package/dist/{chunk-CDPGV4DN.js → chunk-U4NBQJBY.js} +14 -15
  144. package/dist/{chunk-NOZZ46QU.js → chunk-UD3DSHZM.js} +10 -14
  145. package/dist/chunk-UDMYRFDZ.js +3038 -0
  146. package/dist/{chunk-WDW67DZB.cjs → chunk-UOIGFQXC.cjs} +90 -68
  147. package/dist/{chunk-BU7VWW2K.js → chunk-URG2SJLK.js} +14 -15
  148. package/dist/{chunk-EQV4R3EV.cjs → chunk-V73NPPTM.cjs} +152 -35
  149. package/dist/chunk-VECQYRXL.js +474 -0
  150. package/dist/chunk-VEXPG4WN.js +1989 -0
  151. package/dist/{chunk-LDP5OK6G.js → chunk-VMLKSV26.js} +5 -5
  152. package/dist/{chunk-5BGSECRJ.cjs → chunk-VSK7W3O5.cjs} +47 -27
  153. package/dist/chunk-VVKVQZI6.js +55 -0
  154. package/dist/{chunk-YQK5JNFK.js → chunk-W55Z7QIX.js} +103 -15
  155. package/dist/{chunk-KSGXLT74.cjs → chunk-W6P2GBHH.cjs} +3 -3
  156. package/dist/{chunk-IBDG74G2.cjs → chunk-W6RW64BB.cjs} +7 -7
  157. package/dist/chunk-WDT3JTGM.cjs +483 -0
  158. package/dist/{chunk-HPS76H7Q.js → chunk-WKX5AMOY.js} +3 -3
  159. package/dist/chunk-WNNE3PO3.js +34 -0
  160. package/dist/{chunk-XG23EUQX.cjs → chunk-WRLUBRKS.cjs} +538 -312
  161. package/dist/{chunk-IFNQFCTM.js → chunk-WRNEH5MO.js} +79 -8
  162. package/dist/{chunk-54FHG2MX.js → chunk-WRWEX5ZF.js} +7 -4
  163. package/dist/{chunk-KCQ5NDYC.cjs → chunk-X3GJPRVK.cjs} +154 -80
  164. package/dist/{chunk-7AGYRWKW.cjs → chunk-XFXGA5IW.cjs} +126 -22
  165. package/dist/{chunk-TQSZUOW5.cjs → chunk-XHIV6326.cjs} +4 -4
  166. package/dist/chunk-XJAN7CZG.cjs +432 -0
  167. package/dist/chunk-XL6INWKT.js +121 -0
  168. package/dist/{chunk-E3UALNFA.js → chunk-XMWZG36H.js} +4 -4
  169. package/dist/{chunk-BKIGPPVM.js → chunk-XSFNHP2E.js} +6 -3
  170. package/dist/{chunk-H5Z7NASB.js → chunk-XT6JY5W5.js} +25 -3
  171. package/dist/chunk-XXZJEFKW.cjs +490 -0
  172. package/dist/chunk-Y3MWXQSB.cjs +5737 -0
  173. package/dist/chunk-YF2I3MV3.js +46 -0
  174. package/dist/{chunk-V3NN3HPP.js → chunk-YIMN575O.js} +437 -52
  175. package/dist/chunk-YIVFJNYV.js +176 -0
  176. package/dist/{chunk-MD6KDHVE.cjs → chunk-YKGPCZEE.cjs} +10 -10
  177. package/dist/chunk-YQELFNJV.js +39 -0
  178. package/dist/chunk-YSCKYJOB.cjs +2196 -0
  179. package/dist/chunk-Z5XMPRNC.cjs +5390 -0
  180. package/dist/{chunk-3FYZOR7S.cjs → chunk-ZDSYWBIE.cjs} +18 -18
  181. package/dist/{chunk-6TZPZCOJ.cjs → chunk-ZKSS47EV.cjs} +24 -19
  182. package/dist/chunk-ZUL5AVTX.cjs +1993 -0
  183. package/dist/chunk-ZXBZVXDW.js +5386 -0
  184. package/dist/{chunk-DMG7C4H2.js → chunk-ZZ7RO2UQ.js} +312 -44
  185. package/dist/cli/holoscript-runner.cjs +200 -204
  186. package/dist/cli/holoscript-runner.js +144 -148
  187. package/dist/codebase/index.cjs +1 -1
  188. package/dist/codebase/index.js +1 -1
  189. package/dist/compiler/agent-inference.cjs +10 -7
  190. package/dist/compiler/agent-inference.js +6 -3
  191. package/dist/compiler/android-xr.cjs +12 -7
  192. package/dist/compiler/android-xr.js +10 -5
  193. package/dist/compiler/android.cjs +12 -8
  194. package/dist/compiler/android.js +10 -6
  195. package/dist/compiler/ar.cjs +9 -6
  196. package/dist/compiler/ar.js +7 -4
  197. package/dist/compiler/babylon.cjs +12 -8
  198. package/dist/compiler/babylon.js +11 -7
  199. package/dist/compiler/business-quest.cjs +43 -0
  200. package/dist/compiler/business-quest.js +4 -0
  201. package/dist/compiler/coco.cjs +1 -1
  202. package/dist/compiler/coco.js +1 -1
  203. package/dist/compiler/context.cjs +25 -0
  204. package/dist/compiler/context.d.ts +28 -0
  205. package/dist/compiler/context.js +8 -0
  206. package/dist/compiler/domain-block-utils.cjs +155 -152
  207. package/dist/compiler/domain-block-utils.js +7 -4
  208. package/dist/compiler/dtdl.cjs +10 -7
  209. package/dist/compiler/dtdl.js +7 -4
  210. package/dist/compiler/gltf-pipeline.cjs +9 -9
  211. package/dist/compiler/gltf-pipeline.js +2 -2
  212. package/dist/compiler/godot.cjs +9 -6
  213. package/dist/compiler/godot.js +8 -5
  214. package/dist/compiler/incremental.cjs +12 -7
  215. package/dist/compiler/incremental.js +7 -2
  216. package/dist/compiler/index.cjs +3550 -268
  217. package/dist/compiler/index.d.ts +404 -21
  218. package/dist/compiler/index.js +3280 -138
  219. package/dist/compiler/ios.cjs +11 -8
  220. package/dist/compiler/ios.js +9 -6
  221. package/dist/compiler/llm-provider-capabilities.cjs +25 -0
  222. package/dist/compiler/llm-provider-capabilities.d.ts +43 -0
  223. package/dist/compiler/llm-provider-capabilities.js +8 -0
  224. package/dist/compiler/multi-layer.cjs +14 -10
  225. package/dist/compiler/multi-layer.js +13 -9
  226. package/dist/compiler/nodetoy.cjs +5 -5
  227. package/dist/compiler/nodetoy.js +2 -2
  228. package/dist/compiler/openxr.cjs +10 -6
  229. package/dist/compiler/openxr.js +9 -5
  230. package/dist/compiler/playcanvas.cjs +10 -7
  231. package/dist/compiler/playcanvas.js +9 -6
  232. package/dist/compiler/r3f.cjs +17 -13
  233. package/dist/compiler/r3f.d.ts +22 -0
  234. package/dist/compiler/r3f.js +12 -8
  235. package/dist/compiler/remotion.cjs +1 -1
  236. package/dist/compiler/remotion.js +1 -1
  237. package/dist/compiler/reproducibility.cjs +1 -1
  238. package/dist/compiler/reproducibility.js +1 -1
  239. package/dist/compiler/sdf.cjs +10 -7
  240. package/dist/compiler/sdf.js +8 -5
  241. package/dist/compiler/semantic-scene.cjs +1 -1
  242. package/dist/compiler/semantic-scene.js +1 -1
  243. package/dist/compiler/state.cjs +9 -5
  244. package/dist/compiler/state.js +7 -3
  245. package/dist/compiler/trait-composition.cjs +11 -7
  246. package/dist/compiler/trait-composition.js +7 -3
  247. package/dist/compiler/unity.cjs +10 -6
  248. package/dist/compiler/unity.js +9 -5
  249. package/dist/compiler/unreal.cjs +11 -7
  250. package/dist/compiler/unreal.js +9 -5
  251. package/dist/compiler/urdf.cjs +20 -13
  252. package/dist/compiler/urdf.js +8 -5
  253. package/dist/compiler/usd-physics.cjs +10 -7
  254. package/dist/compiler/usd-physics.js +7 -4
  255. package/dist/compiler/visionos.cjs +10 -6
  256. package/dist/compiler/visionos.js +9 -5
  257. package/dist/compiler/vrchat.cjs +10 -7
  258. package/dist/compiler/vrchat.js +8 -5
  259. package/dist/compiler/vrr.cjs +10 -7
  260. package/dist/compiler/vrr.js +8 -5
  261. package/dist/compiler/wasm.cjs +13 -10
  262. package/dist/compiler/wasm.js +8 -5
  263. package/dist/compiler/webgpu.cjs +9 -6
  264. package/dist/compiler/webgpu.js +8 -5
  265. package/dist/constants.d.ts +3 -2
  266. package/dist/coordinators/index.cjs +1266 -0
  267. package/dist/coordinators/index.d.ts +260 -0
  268. package/dist/coordinators/index.js +1259 -0
  269. package/dist/debugger.cjs +9 -7
  270. package/dist/debugger.js +7 -5
  271. package/dist/entries/interop.cjs +23 -21
  272. package/dist/entries/interop.js +5 -3
  273. package/dist/entries/scripting.cjs +18 -18
  274. package/dist/entries/scripting.js +8 -8
  275. package/dist/hololand/index.cjs +146 -0
  276. package/dist/hololand/index.d.ts +70 -0
  277. package/dist/hololand/index.js +5 -0
  278. package/dist/index.cjs +20332 -18121
  279. package/dist/index.d.ts +1477 -40
  280. package/dist/index.js +19451 -17638
  281. package/dist/math/tropical-spmv.cjs +45 -0
  282. package/dist/math/tropical-spmv.js +4 -0
  283. package/dist/math/vec3.cjs +14 -14
  284. package/dist/math/vec3.js +2 -2
  285. package/dist/{ml-dsa-PHCWUBPX.cjs → ml-dsa-FSKBTE3W.cjs} +177 -90
  286. package/dist/{ml-dsa-WYLJHJO6.js → ml-dsa-Z7JDKW4L.js} +158 -71
  287. package/dist/paper-0c-spike/index.cjs +150 -0
  288. package/dist/paper-0c-spike/index.d.ts +29 -0
  289. package/dist/paper-0c-spike/index.js +141 -0
  290. package/dist/parser.cjs +45 -11
  291. package/dist/parser.d.ts +11 -0
  292. package/dist/parser.js +10 -8
  293. package/dist/{playwright-RL6GY4F7.cjs → playwright-3AT3AKTV.cjs} +1985 -1985
  294. package/dist/{playwright-5OSAPTNH.js → playwright-VZPDVUEQ.js} +3 -3
  295. package/dist/reconstruction/index.cjs +153 -0
  296. package/dist/reconstruction/index.d.ts +105 -0
  297. package/dist/reconstruction/index.js +8 -0
  298. package/dist/runtime.cjs +7 -5
  299. package/dist/runtime.js +6 -4
  300. package/dist/self-improvement/index.cjs +563 -0
  301. package/dist/self-improvement/index.js +545 -0
  302. package/dist/storage/index.cjs +10 -9
  303. package/dist/storage/index.js +3 -2
  304. package/dist/testing.cjs +25 -0
  305. package/dist/testing.d.ts +70 -0
  306. package/dist/testing.js +4 -0
  307. package/dist/tools/index.d.ts +22 -1
  308. package/dist/traitDocs/traitDocs.cjs +33 -0
  309. package/dist/traitDocs/traitDocs.d.ts +69 -0
  310. package/dist/traitDocs/traitDocs.js +7 -0
  311. package/dist/traits/botanical-lotus.cjs +41 -0
  312. package/dist/traits/botanical-lotus.d.ts +172 -0
  313. package/dist/traits/botanical-lotus.js +4 -0
  314. package/dist/traits/engines/index.cjs +520 -0
  315. package/dist/traits/engines/index.d.ts +111 -0
  316. package/dist/traits/engines/index.js +380 -0
  317. package/dist/traits/index.cjs +17630 -7881
  318. package/dist/traits/index.d.ts +197 -0
  319. package/dist/traits/index.js +16573 -7193
  320. package/dist/traits/simulation-solver-factory.cjs +13 -0
  321. package/dist/traits/simulation-solver-factory.d.ts +23 -0
  322. package/dist/traits/simulation-solver-factory.js +4 -0
  323. package/dist/traits/webcam-gaze.cjs +35 -0
  324. package/dist/traits/webcam-gaze.d.ts +17 -0
  325. package/dist/traits/webcam-gaze.js +4 -0
  326. package/dist/type-checker.cjs +6 -5
  327. package/dist/type-checker.js +4 -3
  328. package/dist/world/index.cjs +947 -0
  329. package/dist/world/index.d.ts +147 -0
  330. package/dist/world/index.js +939 -0
  331. package/dist/world-model/index.cjs +1446 -0
  332. package/dist/world-model/index.d.ts +119 -0
  333. package/dist/world-model/index.js +1414 -0
  334. package/dist/wot/index.cjs +29 -0
  335. package/dist/wot/index.js +4 -0
  336. package/package.json +153 -61
  337. package/dist/GLTFPipeline-DEN36VNK.js +0 -12
  338. package/dist/GLTFPipeline-YPCAK236.cjs +0 -33
  339. package/dist/chunk-4XSNJCLC.cjs +0 -1859
  340. package/dist/chunk-A7PIMZGU.js +0 -263
  341. package/dist/chunk-BWFJEM5A.js +0 -5419
  342. package/dist/chunk-CBJSLA2E.cjs +0 -5423
  343. package/dist/chunk-K3JDKWGI.cjs +0 -270
  344. package/dist/chunk-LSW7P7ML.js +0 -3675
  345. package/dist/chunk-MEASWI2Y.js +0 -126
  346. package/dist/chunk-NCUKG4SK.cjs +0 -3075
  347. package/dist/chunk-Q5JT3YML.cjs +0 -129
  348. package/dist/chunk-QGKNANZ3.js +0 -3071
  349. package/dist/chunk-S2N5TNMA.js +0 -1855
  350. package/dist/chunk-TSH3MSQU.cjs +0 -129
  351. package/dist/chunk-WGMEAYBG.js +0 -126
  352. package/dist/chunk-X6SEAXAX.cjs +0 -3681
@@ -1,24 +1,26 @@
1
1
  'use strict';
2
2
 
3
- var chunkK3JDKWGI_cjs = require('./chunk-K3JDKWGI.cjs');
4
- var chunkX4ZF6CNE_cjs = require('./chunk-X4ZF6CNE.cjs');
5
- var chunkLXJ4667L_cjs = require('./chunk-LXJ4667L.cjs');
6
- var chunkBF2235SI_cjs = require('./chunk-BF2235SI.cjs');
7
- var chunk3SAK5KFL_cjs = require('./chunk-3SAK5KFL.cjs');
8
- var platform = require('@holoscript/platform');
3
+ var chunk5S7RKFGR_cjs = require('./chunk-5S7RKFGR.cjs');
4
+ var chunkOIQYIIO3_cjs = require('./chunk-OIQYIIO3.cjs');
5
+ var chunkAIA52I7T_cjs = require('./chunk-AIA52I7T.cjs');
6
+ var chunkHGVXZDSK_cjs = require('./chunk-HGVXZDSK.cjs');
7
+ var chunkRMHC2VG7_cjs = require('./chunk-RMHC2VG7.cjs');
8
+ var chunkHCCQLAA4_cjs = require('./chunk-HCCQLAA4.cjs');
9
+ var ans = require('@holoscript/core-types/ans');
9
10
 
10
11
  // src/compiler/BabylonCompiler.ts
11
12
  var BabylonCompiler_exports = {};
12
- chunk3SAK5KFL_cjs.__export(BabylonCompiler_exports, {
13
+ chunkHCCQLAA4_cjs.__export(BabylonCompiler_exports, {
13
14
  BabylonCompiler: () => exports.BabylonCompiler
14
15
  });
15
16
  var SHAPE_TO_MESH; exports.BabylonCompiler = void 0;
16
- var init_BabylonCompiler = chunk3SAK5KFL_cjs.__esm({
17
+ var init_BabylonCompiler = chunkHCCQLAA4_cjs.__esm({
17
18
  "src/compiler/BabylonCompiler.ts"() {
18
- chunkX4ZF6CNE_cjs.init_TraitCompositor();
19
- chunkK3JDKWGI_cjs.init_ProvenanceSemiring();
20
- chunkBF2235SI_cjs.init_CompilerBase();
21
- chunkLXJ4667L_cjs.init_DomainBlockCompilerMixin();
19
+ chunkOIQYIIO3_cjs.init_TraitCompositor();
20
+ chunk5S7RKFGR_cjs.init_ProvenanceSemiring();
21
+ chunkRMHC2VG7_cjs.init_CompilerBase();
22
+ chunkHGVXZDSK_cjs.init_DomainBlockCompilerMixin();
23
+ chunkAIA52I7T_cjs.init_PlatformConditionalCompilerMixin();
22
24
  SHAPE_TO_MESH = {
23
25
  sphere: "CreateSphere",
24
26
  orb: "CreateSphere",
@@ -34,7 +36,7 @@ var init_BabylonCompiler = chunk3SAK5KFL_cjs.__esm({
34
36
  capsule: "CreateCapsule",
35
37
  disc: "CreateDisc"
36
38
  };
37
- exports.BabylonCompiler = class extends chunkBF2235SI_cjs.CompilerBase {
39
+ exports.BabylonCompiler = class extends chunkRMHC2VG7_cjs.CompilerBase {
38
40
  constructor(options = {}) {
39
41
  super();
40
42
  this.compilerName = "BabylonCompiler";
@@ -44,20 +46,30 @@ var init_BabylonCompiler = chunk3SAK5KFL_cjs.__esm({
44
46
  className: options.className || "GeneratedScene",
45
47
  useHavok: options.useHavok ?? true,
46
48
  enableXR: options.enableXR ?? false,
47
- indent: options.indent || " "
49
+ indent: options.indent || " ",
50
+ provenanceHash: options.provenanceHash ?? "",
51
+ platformTarget: options.platformTarget ?? ""
48
52
  };
49
53
  }
50
54
  getRequiredCapability() {
51
- return platform.ANSCapabilityPath.BABYLON;
55
+ return ans.ANSCapabilityPath.BABYLON;
52
56
  }
53
57
  compile(composition, agentToken, outputPath) {
54
58
  this.validateCompilerAccess(agentToken, outputPath);
59
+ if (this.options.platformTarget) {
60
+ const target = typeof this.options.platformTarget === "string" ? chunkAIA52I7T_cjs.createPlatformTarget(this.options.platformTarget) : this.options.platformTarget;
61
+ const platformMixin = new chunkAIA52I7T_cjs.PlatformConditionalCompilerMixin();
62
+ composition = platformMixin.filterForPlatform(composition, target);
63
+ }
55
64
  this.lines = [];
56
65
  this.indentLevel = 0;
57
66
  this.emit("// Auto-generated by HoloScript BabylonCompiler");
58
67
  this.emit(
59
68
  `// Source: composition "${this.escapeStringValue(composition.name, "TypeScript")}"`
60
69
  );
70
+ if (this.options.provenanceHash) {
71
+ this.emit(`// Provenance Hash: ${this.options.provenanceHash}`);
72
+ }
61
73
  this.emit("");
62
74
  this.emitImports(composition);
63
75
  this.emit("");
@@ -126,31 +138,31 @@ var init_BabylonCompiler = chunk3SAK5KFL_cjs.__esm({
126
138
  this.emit("");
127
139
  this.emit("// === v4.2 Domain Blocks ===");
128
140
  let blockIdx = 0;
129
- const compiled = chunkLXJ4667L_cjs.compileDomainBlocks(
141
+ const compiled = chunkHGVXZDSK_cjs.compileDomainBlocks(
130
142
  domainBlocks,
131
143
  {
132
144
  material: (block) => {
133
- const mat = chunkLXJ4667L_cjs.compileMaterialBlock(block);
134
- return chunkLXJ4667L_cjs.materialToBabylon(mat, `db${blockIdx++}`);
145
+ const mat = chunkHGVXZDSK_cjs.compileMaterialBlock(block);
146
+ return chunkHGVXZDSK_cjs.materialToBabylon(mat, `db${blockIdx++}`);
135
147
  },
136
148
  physics: (block) => {
137
- const phys = chunkLXJ4667L_cjs.compilePhysicsBlock(block);
138
- return chunkLXJ4667L_cjs.physicsToBabylon(phys, `db${blockIdx++}`);
149
+ const phys = chunkHGVXZDSK_cjs.compilePhysicsBlock(block);
150
+ return chunkHGVXZDSK_cjs.physicsToBabylon(phys, `db${blockIdx++}`);
139
151
  },
140
152
  vfx: (block) => {
141
- const ps = chunkLXJ4667L_cjs.compileParticleBlock(block);
142
- return chunkLXJ4667L_cjs.particlesToBabylon(ps, `db${blockIdx++}`);
153
+ const ps = chunkHGVXZDSK_cjs.compileParticleBlock(block);
154
+ return chunkHGVXZDSK_cjs.particlesToBabylon(ps, `db${blockIdx++}`);
143
155
  },
144
156
  postfx: (block) => {
145
- const pp = chunkLXJ4667L_cjs.compilePostProcessingBlock(block);
146
- return chunkLXJ4667L_cjs.postProcessingToBabylon(pp);
157
+ const pp = chunkHGVXZDSK_cjs.compilePostProcessingBlock(block);
158
+ return chunkHGVXZDSK_cjs.postProcessingToBabylon(pp);
147
159
  },
148
160
  audio: (block) => {
149
- const audio = chunkLXJ4667L_cjs.compileAudioSourceBlock(block);
150
- return chunkLXJ4667L_cjs.audioSourceToBabylon(audio, `db${blockIdx++}`);
161
+ const audio = chunkHGVXZDSK_cjs.compileAudioSourceBlock(block);
162
+ return chunkHGVXZDSK_cjs.audioSourceToBabylon(audio, `db${blockIdx++}`);
151
163
  },
152
164
  weather: (block) => {
153
- const weather = chunkLXJ4667L_cjs.compileWeatherBlock(block);
165
+ const weather = chunkHGVXZDSK_cjs.compileWeatherBlock(block);
154
166
  const layers = weather.layers.map((l) => `// Layer: ${l.type} \u2014 ${JSON.stringify(l.properties)}`).join("\n");
155
167
  return `// Weather: ${weather.keyword} "${weather.name || ""}" \u2014 implement via Babylon.js particle systems
156
168
  ${layers}`;
@@ -334,7 +346,7 @@ ${layers}`;
334
346
  (t) => t.name === "physics" || t.name === "collidable"
335
347
  );
336
348
  if (physicsTraits.length > 0) {
337
- const semiring = new chunkK3JDKWGI_cjs.ProvenanceSemiring();
349
+ const semiring = new chunk5S7RKFGR_cjs.ProvenanceSemiring();
338
350
  const applications = physicsTraits.map((t) => ({
339
351
  name: t.name,
340
352
  config: t.config || {},
@@ -407,7 +419,7 @@ ${layers}`;
407
419
  }
408
420
  if (obj.traits && Array.isArray(obj.traits) && obj.traits.length > 0) {
409
421
  const traitNames = obj.traits.map((t) => t.name);
410
- const compositor = new chunkX4ZF6CNE_cjs.TraitCompositor();
422
+ const compositor = new chunkOIQYIIO3_cjs.TraitCompositor();
411
423
  const composed = compositor.compose(traitNames);
412
424
  if (Object.keys(composed).length > 0) {
413
425
  const matVar = `${v}ComposedMat`;
@@ -831,5 +843,5 @@ ${layers}`;
831
843
 
832
844
  exports.BabylonCompiler_exports = BabylonCompiler_exports;
833
845
  exports.init_BabylonCompiler = init_BabylonCompiler;
834
- //# sourceMappingURL=chunk-33LSUQDD.cjs.map
835
- //# sourceMappingURL=chunk-33LSUQDD.cjs.map
846
+ //# sourceMappingURL=chunk-L63H3SQ4.cjs.map
847
+ //# sourceMappingURL=chunk-L63H3SQ4.cjs.map
@@ -1,7 +1,53 @@
1
- import { init_DomainBlockCompilerMixin, compileDomainBlocks, inputToGodot, compileInputBlock, navigationToGodot, compileNavigationBlock, renderingToGodot, compileRenderingBlock, proceduralToGodot, compileProceduralBlock, web3ToGodot, compileWeb3Block, architectureToGodot, compileArchitectureBlock, musicToGodot, compileMusicBlock, educationToGodot, compileEducationBlock, datavizToGodot, compileDataVizBlock, iotToGodot, compileIoTBlock, compileRoboticsBlock, roboticsToGodot, compileHealthcareBlock, healthcareToGodot, compilePaymentBlock, paymentToGodot, compileNarrativeBlock, narrativeToGodot, compileWeatherBlock, weatherToGodot, compileAudioSourceBlock, audioSourceToGodot, compilePostProcessingBlock, postProcessingToGodot, compileParticleBlock, particlesToGodot, compilePhysicsBlock, physicsToGodot, compileMaterialBlock, materialToGodot } from './chunk-YQK5JNFK.js';
2
- import { init_CompilerBase, CompilerBase } from './chunk-6XSERL6L.js';
3
- import { __export, __esm } from './chunk-2CWOLHTE.js';
4
- import { ANSCapabilityPath } from '@holoscript/platform';
1
+ import { init_DomainBlockCompilerMixin, compileDomainBlocks, inputToGodot, compileInputBlock, navigationToGodot, compileNavigationBlock, renderingToGodot, compileRenderingBlock, proceduralToGodot, compileProceduralBlock, web3ToGodot, compileWeb3Block, architectureToGodot, compileArchitectureBlock, musicToGodot, compileMusicBlock, educationToGodot, compileEducationBlock, datavizToGodot, compileDataVizBlock, iotToGodot, compileIoTBlock, compileRoboticsBlock, roboticsToGodot, compileHealthcareBlock, healthcareToGodot, compilePaymentBlock, paymentToGodot, compileNarrativeBlock, narrativeToGodot, compileWeatherBlock, weatherToGodot, compileAudioSourceBlock, audioSourceToGodot, compilePostProcessingBlock, postProcessingToGodot, compileParticleBlock, particlesToGodot, compilePhysicsBlock, physicsToGodot, compileMaterialBlock, materialToGodot } from './chunk-W55Z7QIX.js';
2
+ import { init_CompilerBase, CompilerBase } from './chunk-QTPMJRGS.js';
3
+ import { __esm, __export } from './chunk-OL46QLBJ.js';
4
+ import { ANSCapabilityPath } from '@holoscript/core-types/ans';
5
+
6
+ // src/compiler/godot-acoustic-bus.ts
7
+ function compileAcousticTrait(traitName, config, varName) {
8
+ const bus = `${varName}_acoustic_bus`;
9
+ const effects = [];
10
+ const body = [];
11
+ if (traitName === "audio_material") {
12
+ const preset = String(config.preset || "default");
13
+ const room = preset === "metal" ? 0.85 : preset === "glass" ? 0.35 : 0.6;
14
+ const damping = preset === "metal" ? 0.1 : preset === "glass" ? 0.55 : 0.3;
15
+ body.push(`var ${varName}_reverb = AudioEffectReverb.new()`);
16
+ body.push(`${varName}_reverb.room_size = ${room}`);
17
+ body.push(`${varName}_reverb.damping = ${damping}`);
18
+ body.push(`AudioServer.add_bus_effect(${bus}_idx, ${varName}_reverb)`);
19
+ effects.push("AudioEffectReverb");
20
+ } else if (traitName === "audio_occlusion") {
21
+ const attenuation = Math.min(1, Math.max(0, num(config.attenuation, 0.3)));
22
+ const cutoff = Math.round(2e3 - attenuation * 1500);
23
+ body.push(`var ${varName}_lowpass = AudioEffectLowPassFilter.new()`);
24
+ body.push(`${varName}_lowpass.cutoff_hz = ${cutoff}`);
25
+ body.push(`AudioServer.add_bus_effect(${bus}_idx, ${varName}_lowpass)`);
26
+ effects.push("AudioEffectLowPassFilter");
27
+ } else if (traitName === "audio_portal") {
28
+ const wet = Math.min(1, Math.max(0, num(config.wet, 0.5)));
29
+ body.push(`var ${varName}_portal = AudioEffectReverb.new()`);
30
+ body.push(`${varName}_portal.wet = ${wet}`);
31
+ body.push(`AudioServer.add_bus_effect(${bus}_idx, ${varName}_portal)`);
32
+ effects.push("AudioEffectReverb");
33
+ } else {
34
+ return null;
35
+ }
36
+ const lines = [
37
+ `# @${traitName} \u2014 real Godot acoustic bus (E-G16)`,
38
+ `AudioServer.add_bus()`,
39
+ `var ${bus}_idx = AudioServer.bus_count - 1`,
40
+ `AudioServer.set_bus_name(${bus}_idx, "${bus}")`,
41
+ ...body
42
+ ];
43
+ return { lines, effects, busName: bus };
44
+ }
45
+ var num;
46
+ var init_godot_acoustic_bus = __esm({
47
+ "src/compiler/godot-acoustic-bus.ts"() {
48
+ num = (v, fallback) => typeof v === "number" && Number.isFinite(v) ? v : fallback;
49
+ }
50
+ });
5
51
 
6
52
  // src/compiler/GodotCompiler.ts
7
53
  var GodotCompiler_exports = {};
@@ -12,6 +58,7 @@ var GodotCompiler;
12
58
  var init_GodotCompiler = __esm({
13
59
  "src/compiler/GodotCompiler.ts"() {
14
60
  init_CompilerBase();
61
+ init_godot_acoustic_bus();
15
62
  init_DomainBlockCompilerMixin();
16
63
  GodotCompiler = class extends CompilerBase {
17
64
  constructor(options = {}) {
@@ -22,7 +69,8 @@ var init_GodotCompiler = __esm({
22
69
  this.options = {
23
70
  className: options.className || "GeneratedScene",
24
71
  indent: options.indent || " ",
25
- godotVersion: options.godotVersion || "4.3"
72
+ godotVersion: options.godotVersion || "4.3",
73
+ provenanceHash: options.provenanceHash ?? ""
26
74
  };
27
75
  }
28
76
  getRequiredCapability() {
@@ -38,6 +86,9 @@ var init_GodotCompiler = __esm({
38
86
  );
39
87
  this.emit(`# Target: Godot ${this.options.godotVersion}`);
40
88
  this.emit(`# Do not edit manually \u2014 regenerate from .holo source`);
89
+ if (this.options.provenanceHash) {
90
+ this.emit(`# Provenance Hash: ${this.options.provenanceHash}`);
91
+ }
41
92
  this.emit("");
42
93
  this.emit("extends Node3D");
43
94
  this.emit(`class_name ${this.options.className}`);
@@ -379,7 +430,12 @@ var init_GodotCompiler = __esm({
379
430
  } else if (tn === "reverb_zone") {
380
431
  this.emit(`var ${varName}_reverb = AudioEffectReverb.new()`);
381
432
  this.emit(`# @reverb_zone \u2014 add to AudioBus`);
382
- } else if (tn === "ambisonics" || tn === "hrtf" || tn === "audio_occlusion" || tn === "audio_portal" || tn === "audio_material" || tn === "head_tracked_audio") {
433
+ } else if (tn === "audio_material" || tn === "audio_occlusion" || tn === "audio_portal") {
434
+ const acoustic = compileAcousticTrait(tn, trait.config || {}, varName);
435
+ if (acoustic) {
436
+ for (const line of acoustic.lines) this.emit(line);
437
+ }
438
+ } else if (tn === "ambisonics" || tn === "hrtf" || tn === "head_tracked_audio") {
383
439
  this.emit(`# @${tn} \u2014 spatial audio: ${JSON.stringify(trait.config || {})}`);
384
440
  } else if (tn === "gaussian_splat" || tn === "nerf" || tn === "volumetric_video" || tn === "point_cloud" || tn === "photogrammetry") {
385
441
  this.emit(`# @${tn} \u2014 volumetric renderer: ${JSON.stringify(trait.config || {})}`);
@@ -626,5 +682,5 @@ var init_GodotCompiler = __esm({
626
682
  });
627
683
 
628
684
  export { GodotCompiler, GodotCompiler_exports, init_GodotCompiler };
629
- //# sourceMappingURL=chunk-K6EKD26I.js.map
630
- //# sourceMappingURL=chunk-K6EKD26I.js.map
685
+ //# sourceMappingURL=chunk-LAOCQJ2M.js.map
686
+ //# sourceMappingURL=chunk-LAOCQJ2M.js.map
@@ -0,0 +1,37 @@
1
+ 'use strict';
2
+
3
+ // src/reconstruction/replayFingerprint.ts
4
+ function fnv1a32Hex(input) {
5
+ let hash = 2166136261;
6
+ for (let i = 0; i < input.length; i += 1) {
7
+ hash ^= input.charCodeAt(i);
8
+ hash = hash * 16777619 >>> 0;
9
+ }
10
+ const primary = hash.toString(16).padStart(8, "0");
11
+ let hash2 = 2166136261;
12
+ for (let i = input.length - 1; i >= 0; i -= 1) {
13
+ hash2 ^= input.charCodeAt(i);
14
+ hash2 = hash2 * 16777619 >>> 0;
15
+ }
16
+ const secondary = hash2.toString(16).padStart(8, "0");
17
+ return `${primary}${secondary}`;
18
+ }
19
+ function computeHoloMapReplayFingerprint(parts) {
20
+ const video = parts.videoHash ?? "no-video";
21
+ const base = `${parts.modelHash}|${parts.seed}|${parts.weightStrategy}|${video}`;
22
+ let payload = parts.weightCid ? `${base}|cid:${parts.weightCid}` : base;
23
+ const tileGrid = parts.tileGrid;
24
+ if (tileGrid !== void 0 && Number.isFinite(tileGrid) && Math.floor(tileGrid) !== 4) {
25
+ payload += `|grid:${Math.floor(tileGrid)}`;
26
+ }
27
+ const vert = parts.verticalProfile;
28
+ if (vert && vert !== "generalist") {
29
+ payload += `|vert:${vert}`;
30
+ }
31
+ return fnv1a32Hex(payload);
32
+ }
33
+
34
+ exports.computeHoloMapReplayFingerprint = computeHoloMapReplayFingerprint;
35
+ exports.fnv1a32Hex = fnv1a32Hex;
36
+ //# sourceMappingURL=chunk-LM2VU56C.cjs.map
37
+ //# sourceMappingURL=chunk-LM2VU56C.cjs.map
@@ -0,0 +1,400 @@
1
+ // src/traits/SkeletonTrait.ts
2
+ var SkeletonTrait = class {
3
+ constructor(config = {}) {
4
+ this.bones = /* @__PURE__ */ new Map();
5
+ this.boneTransforms = /* @__PURE__ */ new Map();
6
+ this.clips = /* @__PURE__ */ new Map();
7
+ this.parameters = /* @__PURE__ */ new Map();
8
+ this.eventListeners = /* @__PURE__ */ new Map();
9
+ this.enabled = true;
10
+ this.config = {
11
+ rigType: config.rigType ?? "custom",
12
+ bones: config.bones,
13
+ humanoidMap: config.humanoidMap,
14
+ clips: config.clips,
15
+ blendTrees: config.blendTrees ?? /* @__PURE__ */ new Map(),
16
+ layers: config.layers ?? [{ name: "base", weight: 1, blendMode: "override" }],
17
+ parameters: config.parameters ?? /* @__PURE__ */ new Map(),
18
+ defaultClip: config.defaultClip,
19
+ speed: config.speed ?? 1,
20
+ rootMotion: config.rootMotion ?? false,
21
+ cullingMode: config.cullingMode ?? "always"
22
+ };
23
+ this.state = {
24
+ currentTime: 0,
25
+ normalizedTime: 0,
26
+ isPlaying: false,
27
+ layerWeights: this.config.layers?.map((l) => l.weight) ?? [1]
28
+ };
29
+ if (config.bones) {
30
+ for (const bone of config.bones) {
31
+ this.bones.set(bone.name, bone);
32
+ this.boneTransforms.set(bone.name, { ...bone.bindPose });
33
+ }
34
+ }
35
+ if (config.clips) {
36
+ for (const clip of config.clips) {
37
+ this.clips.set(clip.name, clip);
38
+ }
39
+ }
40
+ if (config.parameters) {
41
+ this.parameters = new Map(config.parameters);
42
+ }
43
+ }
44
+ // ============================================================================
45
+ // Configuration
46
+ // ============================================================================
47
+ /**
48
+ * Get configuration
49
+ */
50
+ getConfig() {
51
+ return { ...this.config };
52
+ }
53
+ /**
54
+ * Get animation state
55
+ */
56
+ getState() {
57
+ return { ...this.state };
58
+ }
59
+ /**
60
+ * Get bone count
61
+ */
62
+ getBoneCount() {
63
+ return this.bones.size;
64
+ }
65
+ /**
66
+ * Get bone names
67
+ */
68
+ getBoneNames() {
69
+ return Array.from(this.bones.keys());
70
+ }
71
+ /**
72
+ * Get bone transform
73
+ */
74
+ getBoneTransform(boneName) {
75
+ return this.boneTransforms.get(boneName);
76
+ }
77
+ /**
78
+ * Set bone transform (for IK or procedural animation)
79
+ */
80
+ setBoneTransform(boneName, transform) {
81
+ const current = this.boneTransforms.get(boneName);
82
+ if (current) {
83
+ this.boneTransforms.set(boneName, {
84
+ position: transform.position ?? current.position,
85
+ rotation: transform.rotation ?? current.rotation,
86
+ scale: transform.scale ?? current.scale
87
+ });
88
+ }
89
+ }
90
+ // ============================================================================
91
+ // Animation Playback
92
+ // ============================================================================
93
+ /**
94
+ * Play animation clip
95
+ */
96
+ play(clipName, options) {
97
+ const clip = this.clips.get(clipName);
98
+ if (!clip) {
99
+ console.warn(`Animation clip not found: ${clipName}`);
100
+ return;
101
+ }
102
+ const crossfade = options?.crossfade ?? 0;
103
+ if (crossfade > 0 && this.state.currentClip) {
104
+ this.state.crossfadeTarget = clipName;
105
+ this.state.crossfadeProgress = 0;
106
+ } else {
107
+ this.state.currentClip = clipName;
108
+ this.state.currentTime = 0;
109
+ this.state.normalizedTime = 0;
110
+ }
111
+ this.state.isPlaying = true;
112
+ }
113
+ /**
114
+ * Stop animation
115
+ */
116
+ stop() {
117
+ this.state.isPlaying = false;
118
+ this.state.currentTime = 0;
119
+ this.state.normalizedTime = 0;
120
+ }
121
+ /**
122
+ * Pause animation
123
+ */
124
+ pause() {
125
+ this.state.isPlaying = false;
126
+ }
127
+ /**
128
+ * Resume animation
129
+ */
130
+ resume() {
131
+ this.state.isPlaying = true;
132
+ }
133
+ /**
134
+ * Is playing
135
+ */
136
+ isPlaying() {
137
+ return this.state.isPlaying;
138
+ }
139
+ /**
140
+ * Get current clip name
141
+ */
142
+ getCurrentClip() {
143
+ return this.state.currentClip;
144
+ }
145
+ /**
146
+ * Set playback speed
147
+ */
148
+ setSpeed(speed) {
149
+ this.config.speed = speed;
150
+ }
151
+ /**
152
+ * Get playback speed
153
+ */
154
+ getSpeed() {
155
+ return this.config.speed ?? 1;
156
+ }
157
+ // ============================================================================
158
+ // Parameters (for blend trees and state machines)
159
+ // ============================================================================
160
+ /**
161
+ * Set parameter
162
+ */
163
+ setParameter(name, value) {
164
+ this.parameters.set(name, value);
165
+ }
166
+ /**
167
+ * Get parameter
168
+ */
169
+ getParameter(name) {
170
+ return this.parameters.get(name);
171
+ }
172
+ /**
173
+ * Set float parameter
174
+ */
175
+ setFloat(name, value) {
176
+ this.parameters.set(name, value);
177
+ }
178
+ /**
179
+ * Set bool parameter
180
+ */
181
+ setBool(name, value) {
182
+ this.parameters.set(name, value);
183
+ }
184
+ /**
185
+ * Set trigger (auto-resets)
186
+ */
187
+ setTrigger(name) {
188
+ this.parameters.set(name, true);
189
+ }
190
+ // ============================================================================
191
+ // Blend Trees
192
+ // ============================================================================
193
+ /**
194
+ * Add blend tree
195
+ */
196
+ addBlendTree(name, tree) {
197
+ if (!this.config.blendTrees) {
198
+ this.config.blendTrees = /* @__PURE__ */ new Map();
199
+ }
200
+ this.config.blendTrees.set(name, tree);
201
+ }
202
+ /**
203
+ * Activate blend tree
204
+ */
205
+ activateBlendTree(name) {
206
+ if (this.config.blendTrees?.has(name)) {
207
+ this.state.activeBlendTree = name;
208
+ }
209
+ }
210
+ // ============================================================================
211
+ // Layers
212
+ // ============================================================================
213
+ /**
214
+ * Set layer weight
215
+ */
216
+ setLayerWeight(layerIndex, weight) {
217
+ if (this.state.layerWeights[layerIndex] !== void 0) {
218
+ this.state.layerWeights[layerIndex] = Math.max(0, Math.min(1, weight));
219
+ }
220
+ }
221
+ /**
222
+ * Get layer weight
223
+ */
224
+ getLayerWeight(layerIndex) {
225
+ return this.state.layerWeights[layerIndex] ?? 0;
226
+ }
227
+ // ============================================================================
228
+ // Clips
229
+ // ============================================================================
230
+ /**
231
+ * Add animation clip
232
+ */
233
+ addClip(clip) {
234
+ this.clips.set(clip.name, clip);
235
+ if (!this.config.clips) {
236
+ this.config.clips = [];
237
+ }
238
+ this.config.clips.push(clip);
239
+ }
240
+ /**
241
+ * Get clip
242
+ */
243
+ getClip(name) {
244
+ return this.clips.get(name);
245
+ }
246
+ /**
247
+ * Get clip duration
248
+ */
249
+ getClipDuration(name) {
250
+ return this.clips.get(name)?.duration ?? 0;
251
+ }
252
+ /**
253
+ * Get all clip names
254
+ */
255
+ getClipNames() {
256
+ return Array.from(this.clips.keys());
257
+ }
258
+ // ============================================================================
259
+ // Update (called each frame)
260
+ // ============================================================================
261
+ /**
262
+ * Update animation (called by animation system each frame)
263
+ */
264
+ update(deltaTime) {
265
+ if (!this.enabled || !this.state.isPlaying) return;
266
+ const clip = this.state.currentClip ? this.clips.get(this.state.currentClip) : void 0;
267
+ if (!clip) return;
268
+ const speed = this.config.speed ?? 1;
269
+ this.state.currentTime += deltaTime * speed;
270
+ if (clip.loop) {
271
+ this.state.currentTime = this.state.currentTime % clip.duration;
272
+ } else if (this.state.currentTime >= clip.duration) {
273
+ this.state.currentTime = clip.duration;
274
+ this.state.isPlaying = false;
275
+ }
276
+ this.state.normalizedTime = clip.duration > 0 ? this.state.currentTime / clip.duration : 0;
277
+ if (clip.events) {
278
+ for (const event of clip.events) {
279
+ if (Math.abs(this.state.currentTime - event.time) < deltaTime) {
280
+ this.emitEvent(event);
281
+ }
282
+ }
283
+ }
284
+ if (this.state.crossfadeTarget && this.state.crossfadeProgress !== void 0) {
285
+ this.state.crossfadeProgress += deltaTime;
286
+ }
287
+ }
288
+ // ============================================================================
289
+ // Events
290
+ // ============================================================================
291
+ /**
292
+ * Add event listener
293
+ */
294
+ on(event, callback) {
295
+ if (!this.eventListeners.has(event)) {
296
+ this.eventListeners.set(event, []);
297
+ }
298
+ this.eventListeners.get(event).push(callback);
299
+ }
300
+ /**
301
+ * Remove event listener
302
+ */
303
+ off(event, callback) {
304
+ const listeners = this.eventListeners.get(event);
305
+ if (listeners) {
306
+ const index = listeners.indexOf(callback);
307
+ if (index !== -1) {
308
+ listeners.splice(index, 1);
309
+ }
310
+ }
311
+ }
312
+ /**
313
+ * Emit animation event
314
+ */
315
+ emitEvent(event) {
316
+ const listeners = this.eventListeners.get(event.name);
317
+ if (listeners) {
318
+ for (const callback of listeners) {
319
+ callback(event);
320
+ }
321
+ }
322
+ }
323
+ // ============================================================================
324
+ // Enable/Disable
325
+ // ============================================================================
326
+ /**
327
+ * Enable/disable skeleton
328
+ */
329
+ setEnabled(enabled) {
330
+ this.enabled = enabled;
331
+ }
332
+ /**
333
+ * Is enabled
334
+ */
335
+ isEnabled() {
336
+ return this.enabled;
337
+ }
338
+ // ============================================================================
339
+ // Serialization
340
+ // ============================================================================
341
+ /**
342
+ * Serialize for animation system
343
+ */
344
+ serialize() {
345
+ return {
346
+ rigType: this.config.rigType,
347
+ boneCount: this.bones.size,
348
+ clipCount: this.clips.size,
349
+ layerCount: this.config.layers?.length ?? 0,
350
+ currentClip: this.state.currentClip,
351
+ currentTime: this.state.currentTime,
352
+ normalizedTime: this.state.normalizedTime,
353
+ isPlaying: this.state.isPlaying,
354
+ speed: this.config.speed,
355
+ rootMotion: this.config.rootMotion,
356
+ enabled: this.enabled
357
+ };
358
+ }
359
+ };
360
+ function createSkeletonTrait(config = {}) {
361
+ return new SkeletonTrait(config);
362
+ }
363
+ var skeletonHandler = {
364
+ name: "skeleton",
365
+ defaultConfig: {},
366
+ onAttach(node, config, ctx) {
367
+ const instance = new SkeletonTrait(config);
368
+ node.__skeleton_instance = instance;
369
+ ctx.emit("skeleton_attached", { node, config });
370
+ },
371
+ onDetach(node, _config, ctx) {
372
+ const instance = node.__skeleton_instance;
373
+ if (instance) {
374
+ if (typeof instance.onDetach === "function") instance.onDetach(node, ctx);
375
+ else if (typeof instance.dispose === "function") instance.dispose();
376
+ else if (typeof instance.cleanup === "function") instance.cleanup();
377
+ }
378
+ ctx.emit("skeleton_detached", { node });
379
+ delete node.__skeleton_instance;
380
+ },
381
+ onEvent(node, _config, ctx, event) {
382
+ const instance = node.__skeleton_instance;
383
+ if (!instance) return;
384
+ if (typeof instance.onEvent === "function") instance.onEvent(event);
385
+ else if (typeof instance.emit === "function" && event.type) instance.emit(event);
386
+ if (event.type === "skeleton_configure" && event.payload) {
387
+ Object.assign(instance, event.payload);
388
+ ctx.emit("skeleton_configured", { node });
389
+ }
390
+ },
391
+ onUpdate(node, _config, ctx, dt) {
392
+ const instance = node.__skeleton_instance;
393
+ if (!instance) return;
394
+ if (typeof instance.onUpdate === "function") instance.onUpdate(node, ctx, dt);
395
+ }
396
+ };
397
+
398
+ export { SkeletonTrait, createSkeletonTrait, skeletonHandler };
399
+ //# sourceMappingURL=chunk-M56JSP4A.js.map
400
+ //# sourceMappingURL=chunk-M56JSP4A.js.map