@holoscript/core 8.0.8 → 8.0.10

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 (463) hide show
  1. package/LICENSE +21 -0
  2. package/bin/holoscript.cjs +5 -1
  3. package/dist/GLTFPipeline-L76YTXKA.js +15 -0
  4. package/dist/GLTFPipeline-ZWJN7GI6.cjs +36 -0
  5. package/dist/HoloCompositionParser-K76KTEEE.js +12 -0
  6. package/dist/HoloCompositionParser-UZH6Y4HO.cjs +45 -0
  7. package/dist/HoloScriptCodeParser-2D4ERFUZ.js +6 -0
  8. package/dist/HoloScriptCodeParser-UDRLDA7I.cjs +23 -0
  9. package/dist/HoloScriptPlusParser-FTMCGWXD.js +13 -0
  10. package/dist/HoloScriptPlusParser-LQR5GIKF.cjs +30 -0
  11. package/dist/HoloScriptRuntime-UTRLJI5L.js +12 -0
  12. package/dist/HoloScriptRuntime-YBYXJHJN.cjs +21 -0
  13. package/dist/SceneIRCompiler-63KA3M2F.js +17 -0
  14. package/dist/SceneIRCompiler-KWUFHZ4O.cjs +42 -0
  15. package/dist/{USDZExporter-AUHZODOF.cjs → USDZExporter-ML4UMIGC.cjs} +3 -3
  16. package/dist/{USDZExporter-GXB4AUSG.js → USDZExporter-ZFKLQ76G.js} +3 -3
  17. package/dist/agents/index.cjs +1 -1
  18. package/dist/agents/index.js +1 -1
  19. package/dist/audit/AuditLogger.d.ts +106 -0
  20. package/dist/audit/AuditQueryBuilder.d.ts +79 -0
  21. package/dist/audit/ComplianceReporter.d.ts +90 -0
  22. package/dist/audit/index.d.ts +13 -0
  23. package/dist/{chunk-FGMDMJM7.js → chunk-2BYAUHBO.js} +3 -3
  24. package/dist/{chunk-EDPYCLRC.cjs → chunk-2E6PP5UE.cjs} +83 -59
  25. package/dist/{chunk-GASCWJK5.js → chunk-2EGGAZT3.js} +65 -287
  26. package/dist/{chunk-SIEXCILW.js → chunk-2I3XAGMF.js} +3 -3
  27. package/dist/{chunk-OS533P33.cjs → chunk-2KKOYZYI.cjs} +1074 -1655
  28. package/dist/chunk-2MQKNDNH.js +51 -0
  29. package/dist/{chunk-7DMMMBCY.cjs → chunk-2X3IPCBK.cjs} +10 -10
  30. package/dist/chunk-2ZOTBO25.cjs +202 -0
  31. package/dist/chunk-356N4NPM.cjs +152 -0
  32. package/dist/{chunk-X3GJPRVK.cjs → chunk-36NPLOI4.cjs} +92 -81
  33. package/dist/{chunk-SLU6UPJI.cjs → chunk-37HHY7RH.cjs} +5 -5
  34. package/dist/{chunk-YDPEHCCI.cjs → chunk-3CDDRUER.cjs} +3 -118
  35. package/dist/chunk-3F7ZZWIN.js +1651 -0
  36. package/dist/chunk-3ILD7TKP.cjs +187 -0
  37. package/dist/{chunk-X27QRG4C.cjs → chunk-3IUHTGDD.cjs} +153 -41
  38. package/dist/{chunk-PXNZ6TME.js → chunk-4376VHNJ.js} +60 -36
  39. package/dist/{chunk-YKGPCZEE.cjs → chunk-4FIBOJW6.cjs} +10 -10
  40. package/dist/chunk-4Q7RKQQI.cjs +14195 -0
  41. package/dist/{chunk-YCM6QQRT.cjs → chunk-566ZB4LZ.cjs} +180 -8
  42. package/dist/{chunk-2Y3V22SG.js → chunk-5CURIYGT.js} +3 -3
  43. package/dist/{chunk-QBWNJXNR.js → chunk-5FYMCVBY.js} +5 -5
  44. package/dist/{chunk-ZA34AN3R.js → chunk-5LVFTGKH.js} +841 -12
  45. package/dist/{chunk-Z6PMDS4G.js → chunk-5OUOMBKK.js} +1090 -53
  46. package/dist/chunk-63AUAIL6.js +48 -0
  47. package/dist/chunk-655FATJU.js +110 -0
  48. package/dist/{chunk-TQ377OLB.cjs → chunk-65S62L4D.cjs} +28 -22
  49. package/dist/chunk-6NTAZN5Z.cjs +502 -0
  50. package/dist/chunk-6TRX6AR2.js +9376 -0
  51. package/dist/chunk-6ZCCLKS2.cjs +51 -0
  52. package/dist/{chunk-MDR235RZ.js → chunk-734OB5SK.js} +721 -8
  53. package/dist/{chunk-Q2Q34NF3.js → chunk-77QI552M.js} +6 -6
  54. package/dist/{chunk-WKX5AMOY.js → chunk-7I74JWPW.js} +3 -3
  55. package/dist/{chunk-5FSKKMR7.cjs → chunk-7IDJDMPU.cjs} +232 -4
  56. package/dist/chunk-7VBKRGIZ.cjs +847 -0
  57. package/dist/{chunk-KCPHASCO.js → chunk-AATYYLYK.js} +5 -5
  58. package/dist/{chunk-DTGBOSEM.cjs → chunk-AWXFEAQL.cjs} +12 -12
  59. package/dist/{chunk-THCK6ECW.js → chunk-B3CWTCK2.js} +231 -3
  60. package/dist/chunk-BCP4E7MD.cjs +997 -0
  61. package/dist/chunk-BG7RPYJP.js +91 -0
  62. package/dist/{chunk-VF257YKO.js → chunk-BP4KTMLY.js} +117 -5
  63. package/dist/{chunk-YN6IETRZ.js → chunk-BQJ3YBF3.js} +6424 -987
  64. package/dist/{chunk-7X5PNIQJ.js → chunk-BXSOEQI3.js} +27 -25
  65. package/dist/{chunk-WFKVS2K4.cjs → chunk-C65C5VED.cjs} +1101 -55
  66. package/dist/{chunk-KOUAQL2B.cjs → chunk-CANAL6CT.cjs} +1569 -168
  67. package/dist/{chunk-FDSGHPAK.js → chunk-CBSDJF3B.js} +3 -3
  68. package/dist/{chunk-FEWUHQNM.cjs → chunk-CFVK26P4.cjs} +4 -4
  69. package/dist/{chunk-M7K4LE66.cjs → chunk-CI33NINL.cjs} +4 -4
  70. package/dist/{chunk-2OWDB4FB.js → chunk-CKV5NYAE.js} +6 -6
  71. package/dist/{chunk-LPS5AMQD.cjs → chunk-CM4NHXVO.cjs} +24 -24
  72. package/dist/chunk-D3HSRXYB.js +115 -0
  73. package/dist/{chunk-FNHJRI32.js → chunk-DBH3D2MU.js} +1561 -160
  74. package/dist/{chunk-GW3LKD5C.js → chunk-DJNH4HFW.js} +3 -3
  75. package/dist/{chunk-2GCNOI2U.cjs → chunk-DN6F4DHH.cjs} +9 -3
  76. package/dist/chunk-DQRJ5RJG.js +432 -0
  77. package/dist/{chunk-C7ZBSV2Q.js → chunk-DUG3OQAS.js} +106 -43
  78. package/dist/chunk-ECUYJOJ2.cjs +199 -0
  79. package/dist/chunk-EEMTCAK7.js +182 -0
  80. package/dist/{chunk-3SKLAUDD.cjs → chunk-EI3J6LTW.cjs} +359 -581
  81. package/dist/{chunk-SSSN7VAM.js → chunk-EM2OGPYE.js} +4 -4
  82. package/dist/{chunk-56VOWURB.cjs → chunk-ENZCIQZC.cjs} +522 -453
  83. package/dist/chunk-ESBXUYOC.cjs +836 -0
  84. package/dist/{chunk-L5U4W6JC.js → chunk-ESSEF6U2.js} +4 -4
  85. package/dist/chunk-ET3AN4W3.js +824 -0
  86. package/dist/chunk-EXKSFGSX.cjs +14 -14
  87. package/dist/{chunk-I76GIKN7.cjs → chunk-F3YT6GUF.cjs} +17 -17
  88. package/dist/{chunk-WRWEX5ZF.js → chunk-F75DZBBI.js} +3 -3
  89. package/dist/{chunk-4JGRWHZJ.js → chunk-FG6PYGIZ.js} +12 -6
  90. package/dist/chunk-FGGJQRLZ.js +14 -14
  91. package/dist/{chunk-SXOSDZD6.js → chunk-FWCHPCD4.js} +128 -10
  92. package/dist/{chunk-XW6IXEQH.cjs → chunk-G35CAQ7I.cjs} +5 -5
  93. package/dist/{chunk-7VMGP2FW.js → chunk-G6KACNMO.js} +132 -188
  94. package/dist/{chunk-FJPADH77.cjs → chunk-GAWJJAGT.cjs} +6 -6
  95. package/dist/chunk-GGR7QUKK.cjs +4724 -0
  96. package/dist/chunk-GIBF4BHH.js +14098 -0
  97. package/dist/{chunk-AWB7QYY6.cjs → chunk-GILYQ5VH.cjs} +6 -6
  98. package/dist/{chunk-FWVYAMNW.cjs → chunk-GKFCHGCM.cjs} +4 -4
  99. package/dist/{chunk-Y3ZFVUUU.js → chunk-GLEJ2TLS.js} +3 -3
  100. package/dist/{chunk-3GWWJT7L.js → chunk-GP3OKSKT.js} +13 -13
  101. package/dist/chunk-GTIPOEHN.js +196 -0
  102. package/dist/{chunk-LMJ5EBV7.cjs → chunk-GZPUA2TL.cjs} +16 -15
  103. package/dist/{chunk-IELX2OKI.js → chunk-H4LJ4HEA.js} +3 -115
  104. package/dist/{chunk-ACVWFGBI.cjs → chunk-HCX4SMFK.cjs} +3 -3
  105. package/dist/{chunk-HYNTS5CP.js → chunk-HHRZ6STP.js} +24 -2
  106. package/dist/chunk-HIDEIEFG.js +48 -0
  107. package/dist/{chunk-W6RW64BB.cjs → chunk-HSWBIDZM.cjs} +228 -5
  108. package/dist/{chunk-GSOUNWEL.js → chunk-HVX7QQYK.js} +1035 -1616
  109. package/dist/{chunk-TRCGG42I.cjs → chunk-IFW5IW4L.cjs} +6502 -1019
  110. package/dist/{chunk-F5LKJ6F5.cjs → chunk-IJU6AS67.cjs} +32 -28
  111. package/dist/{chunk-TVANHNJ7.js → chunk-IK6Z2HNC.js} +173 -3
  112. package/dist/{chunk-QGMUTVVH.cjs → chunk-IS7NTKY5.cjs} +20 -20
  113. package/dist/{chunk-YFVQWSNJ.js → chunk-IXWGYWH6.js} +3 -3
  114. package/dist/chunk-J2DAS2PL.js +148 -0
  115. package/dist/chunk-JBQXZIWB.js +148 -0
  116. package/dist/chunk-JBYBMBMW.js +261 -0
  117. package/dist/{chunk-LWUOUCYL.js → chunk-JEJ7TT54.js} +5 -5
  118. package/dist/{chunk-DUCB6LGL.js → chunk-JOTCTHN5.js} +211 -5
  119. package/dist/{chunk-47RUFYKR.js → chunk-K56UVEXV.js} +3 -3
  120. package/dist/{chunk-XSFNHP2E.js → chunk-KB26H447.js} +3 -3
  121. package/dist/{chunk-3NGDZZR4.js → chunk-KEYG7HGY.js} +430 -37
  122. package/dist/{chunk-DY72BMU5.js → chunk-KFVNCW4Q.js} +4 -4
  123. package/dist/chunk-KPGC7SK2.js +192 -0
  124. package/dist/chunk-KROXXBK5.cjs +53 -0
  125. package/dist/{chunk-ZPZAVHXL.cjs → chunk-LB3ZZMKT.cjs} +137 -19
  126. package/dist/chunk-LDYZWNJW.cjs +1654 -0
  127. package/dist/{chunk-UGXHYIWT.cjs → chunk-LHNHO27U.cjs} +28 -28
  128. package/dist/{chunk-ULMSSHCJ.cjs → chunk-LMB555QB.cjs} +405 -38
  129. package/dist/{chunk-CBJY23VL.js → chunk-MD4IVS42.js} +3 -3
  130. package/dist/{chunk-VMLKSV26.js → chunk-MDDWEBCX.js} +226 -3
  131. package/dist/chunk-MUWH4QK5.cjs +94 -0
  132. package/dist/{chunk-T6W3Z3SH.cjs → chunk-N2ILK7BF.cjs} +4 -4
  133. package/dist/{chunk-6EX3I5P4.cjs → chunk-N74QRJGP.cjs} +6 -6
  134. package/dist/chunk-NFFHLX37.cjs +132 -0
  135. package/dist/chunk-NJSYWX7H.js +190 -0
  136. package/dist/{chunk-SH5PPVK7.cjs → chunk-NQN5LFN4.cjs} +165 -221
  137. package/dist/chunk-NTQRFOPP.cjs +56 -0
  138. package/dist/{chunk-YFWRJW4B.js → chunk-NWMJPTVL.js} +51 -55
  139. package/dist/{chunk-63ZGNR2T.cjs → chunk-OC6GV5QH.cjs} +42 -42
  140. package/dist/{chunk-7E7GCQCK.js → chunk-OG3MBHM3.js} +9 -3
  141. package/dist/chunk-OMNHTCS4.cjs +264 -0
  142. package/dist/chunk-OQXB6NNC.cjs +117 -0
  143. package/dist/{chunk-Y57W2CT5.cjs → chunk-OV46CCA2.cjs} +51 -55
  144. package/dist/{chunk-6PRZIHGL.cjs → chunk-OV6HHKLE.cjs} +21 -266
  145. package/dist/{chunk-C37BHB7N.cjs → chunk-P26YYPOO.cjs} +5 -5
  146. package/dist/{chunk-2BZHWUSR.cjs → chunk-P7JEKJTZ.cjs} +16 -16
  147. package/dist/{chunk-NGBXXZLL.cjs → chunk-PDXX5UI4.cjs} +45 -45
  148. package/dist/{chunk-FHQFPYV4.js → chunk-PJFTTSKE.js} +8 -7
  149. package/dist/{chunk-GVFJ6T4S.cjs → chunk-PVODJEJ7.cjs} +721 -8
  150. package/dist/{chunk-ZZ7RO2UQ.js → chunk-Q265VZJ4.js} +3 -3
  151. package/dist/{chunk-E7JP3BS3.cjs → chunk-Q47JEE2C.cjs} +4 -4
  152. package/dist/chunk-QBY7LRN2.js +281 -0
  153. package/dist/{chunk-GH6C2QGW.cjs → chunk-QEDMOGF3.cjs} +857 -16
  154. package/dist/{chunk-5WUNN6ZN.cjs → chunk-QHSAVOOL.cjs} +24 -2
  155. package/dist/chunk-QJNCDVYM.cjs +137 -0
  156. package/dist/chunk-QM7FJB5W.js +4717 -0
  157. package/dist/chunk-QQFB4RT2.cjs +448 -0
  158. package/dist/chunk-QSYBHQAD.cjs +196 -0
  159. package/dist/{chunk-2YSNA2F2.cjs → chunk-QVJMDVYZ.cjs} +5 -5
  160. package/dist/chunk-RAJMAX6D.js +131 -0
  161. package/dist/{chunk-VVKVQZI6.js → chunk-RAN3ECAS.js} +3 -3
  162. package/dist/chunk-RKGUZBOC.js +79 -0
  163. package/dist/{chunk-HLFDZ35S.cjs → chunk-RRQIAJLQ.cjs} +8 -8
  164. package/dist/{chunk-PABONWKI.js → chunk-RXQNRZ5F.js} +3 -3
  165. package/dist/{chunk-7ZHYEITD.cjs → chunk-S4O7CFHQ.cjs} +10 -11
  166. package/dist/chunk-SE7ANBGN.js +128 -0
  167. package/dist/{chunk-X2AVEAZM.cjs → chunk-SJIRCTIS.cjs} +176 -2
  168. package/dist/{chunk-WXQ57LAO.js → chunk-SQXAZHDG.js} +4 -4
  169. package/dist/chunk-SR73L5ZP.cjs +84 -0
  170. package/dist/{chunk-OABEO6HH.js → chunk-SZOLTWWD.js} +2349 -214
  171. package/dist/{chunk-5JEU52DW.js → chunk-TPZ3BN2D.js} +3 -3
  172. package/dist/{chunk-QFU53KRH.js → chunk-TSTFYGGX.js} +4 -5
  173. package/dist/{chunk-EBS32AJI.cjs → chunk-TZCFKZ6Z.cjs} +5 -5
  174. package/dist/chunk-UCVZXQ63.js +724 -0
  175. package/dist/chunk-UGQ3QNV6.js +992 -0
  176. package/dist/chunk-UNMVGZVW.js +142 -0
  177. package/dist/{chunk-TEVX443G.js → chunk-UTUD6GJI.js} +178 -6
  178. package/dist/chunk-UXBYA7DV.cjs +155 -0
  179. package/dist/chunk-V6GXFSK7.cjs +443 -0
  180. package/dist/chunk-VHORVGCG.cjs +761 -0
  181. package/dist/{chunk-B4EKV6HQ.js → chunk-VKCTYLDN.js} +500 -442
  182. package/dist/{chunk-O3MGZDCT.cjs → chunk-VTEXJOSD.cjs} +63 -63
  183. package/dist/chunk-VVAAZITA.cjs +287 -0
  184. package/dist/{chunk-V7AKE5VT.cjs → chunk-W2GA3EQB.cjs} +435 -42
  185. package/dist/chunk-W4GABFCR.js +37 -0
  186. package/dist/chunk-WKEK4NCA.js +490 -0
  187. package/dist/{chunk-5A4TCHOC.cjs → chunk-WNYXT4TE.cjs} +4 -4
  188. package/dist/{chunk-S762UEV5.js → chunk-WTH23ISI.js} +6 -6
  189. package/dist/{chunk-BTKZGHAV.js → chunk-WWNCM473.js} +10 -6
  190. package/dist/{chunk-4YNYPHH3.cjs → chunk-X75H75UY.cjs} +2351 -213
  191. package/dist/{chunk-LYJJI7ZK.cjs → chunk-XCUDDFKC.cjs} +216 -9
  192. package/dist/chunk-YAO4HPJL.cjs +120 -0
  193. package/dist/chunk-YKY2JBER.cjs +9443 -0
  194. package/dist/chunk-YP5CHEYU.cjs +154 -0
  195. package/dist/{chunk-WRNEH5MO.js → chunk-YW3I2FQL.js} +18 -7
  196. package/dist/{chunk-BRNUPDHJ.js → chunk-Z557DVYN.js} +386 -19
  197. package/dist/{chunk-VSACG2AR.js → chunk-Z6LZUYZF.js} +21 -264
  198. package/dist/chunk-ZHPMP447.cjs +43 -0
  199. package/dist/{chunk-LODTHGST.cjs → chunk-ZK7KX5CD.cjs} +133 -70
  200. package/dist/{chunk-CCPSNT6B.cjs → chunk-ZRPALBQB.cjs} +5 -5
  201. package/dist/chunk-ZVFHPMC5.js +824 -0
  202. package/dist/chunk-ZVQMKUGJ.js +443 -0
  203. package/dist/cli/holoscript-runner.cjs +86 -48
  204. package/dist/cli/holoscript-runner.js +54 -16
  205. package/dist/codebase/index.cjs +1 -1
  206. package/dist/codebase/index.js +1 -1
  207. package/dist/compiler/agent-inference.cjs +11 -11
  208. package/dist/compiler/agent-inference.js +9 -6
  209. package/dist/compiler/android-xr.cjs +13 -12
  210. package/dist/compiler/android-xr.js +11 -10
  211. package/dist/compiler/android.cjs +12 -12
  212. package/dist/compiler/android.js +10 -10
  213. package/dist/compiler/business-quest.cjs +10 -10
  214. package/dist/compiler/business-quest.js +2 -2
  215. package/dist/compiler/coco.cjs +1 -1
  216. package/dist/compiler/coco.js +1 -1
  217. package/dist/compiler/context.cjs +9 -9
  218. package/dist/compiler/context.js +6 -6
  219. package/dist/compiler/daimon-seed.cjs +36 -0
  220. package/dist/compiler/daimon-seed.js +12 -0
  221. package/dist/compiler/domain-block-utils.cjs +205 -156
  222. package/dist/compiler/domain-block-utils.js +8 -7
  223. package/dist/compiler/dtdl.cjs +10 -10
  224. package/dist/compiler/dtdl.js +7 -7
  225. package/dist/compiler/gltf-pipeline.cjs +9 -9
  226. package/dist/compiler/gltf-pipeline.js +2 -2
  227. package/dist/compiler/godot.cjs +10 -9
  228. package/dist/compiler/godot.js +9 -8
  229. package/dist/compiler/incremental.cjs +11 -11
  230. package/dist/compiler/incremental.js +6 -6
  231. package/dist/compiler/index.cjs +2585 -3273
  232. package/dist/compiler/index.d.ts +149 -35
  233. package/dist/compiler/index.js +2197 -3102
  234. package/dist/compiler/ios.cjs +11 -11
  235. package/dist/compiler/ios.js +9 -9
  236. package/dist/compiler/llm-provider-capabilities.cjs +9 -9
  237. package/dist/compiler/llm-provider-capabilities.js +6 -6
  238. package/dist/compiler/nodetoy.cjs +1 -1
  239. package/dist/compiler/nodetoy.js +1 -1
  240. package/dist/compiler/openxr.cjs +11 -10
  241. package/dist/compiler/openxr.js +10 -9
  242. package/dist/compiler/remotion.cjs +1 -1
  243. package/dist/compiler/remotion.js +1 -1
  244. package/dist/compiler/reproducibility.cjs +1 -1
  245. package/dist/compiler/reproducibility.js +1 -1
  246. package/dist/compiler/sdf.cjs +11 -10
  247. package/dist/compiler/sdf.js +9 -8
  248. package/dist/compiler/semantic-scene.cjs +7 -7
  249. package/dist/compiler/semantic-scene.js +2 -2
  250. package/dist/compiler/state.cjs +9 -9
  251. package/dist/compiler/state.js +7 -7
  252. package/dist/compiler/trait-composition.cjs +11 -11
  253. package/dist/compiler/trait-composition.js +7 -7
  254. package/dist/compiler/traits/ProvenanceSemiring.d.ts +167 -0
  255. package/dist/compiler/traits/Semiring.d.ts +26 -0
  256. package/dist/compiler/unity.cjs +11 -10
  257. package/dist/compiler/unity.js +10 -9
  258. package/dist/compiler/unreal.cjs +12 -11
  259. package/dist/compiler/unreal.js +10 -9
  260. package/dist/compiler/urdf.cjs +18 -17
  261. package/dist/compiler/urdf.js +9 -8
  262. package/dist/compiler/usd-physics.cjs +11 -10
  263. package/dist/compiler/usd-physics.js +8 -7
  264. package/dist/compiler/visionos.cjs +11 -10
  265. package/dist/compiler/visionos.js +10 -9
  266. package/dist/compiler/vrchat.cjs +11 -10
  267. package/dist/compiler/vrchat.js +9 -8
  268. package/dist/compiler/wasm.cjs +14 -13
  269. package/dist/compiler/wasm.js +9 -8
  270. package/dist/compiler/webgpu.cjs +10 -9
  271. package/dist/compiler/webgpu.js +9 -8
  272. package/dist/constants.cjs +398 -0
  273. package/dist/constants.js +9 -0
  274. package/dist/coordinators/index.cjs +4 -1
  275. package/dist/coordinators/index.js +4 -1
  276. package/dist/debugger.cjs +11 -9
  277. package/dist/debugger.js +9 -7
  278. package/dist/{dist-ACXG6IH5.cjs → dist-GRMOP2UL.cjs} +341 -65
  279. package/dist/{dist-VD4L6V7Q.js → dist-ZBUKU2JG.js} +333 -63
  280. package/dist/entries/interop.cjs +23 -23
  281. package/dist/entries/interop.js +3 -3
  282. package/dist/entries/scripting.cjs +12 -11
  283. package/dist/entries/scripting.js +8 -7
  284. package/dist/evolution/index.cjs +66 -0
  285. package/dist/evolution/index.d.ts +162 -0
  286. package/dist/evolution/index.js +17 -0
  287. package/dist/hololand/index.cjs +41 -37
  288. package/dist/hololand/index.js +3 -3
  289. package/dist/index.cjs +12394 -3224
  290. package/dist/index.d.ts +260 -18
  291. package/dist/index.js +10755 -2182
  292. package/dist/keyword-registry/PluginKeywordRegistry.d.ts +138 -0
  293. package/dist/keyword-registry/index.cjs +29 -0
  294. package/dist/keyword-registry/index.d.ts +1 -0
  295. package/dist/keyword-registry/index.js +4 -0
  296. package/dist/math/tropical-spmv.cjs +11 -11
  297. package/dist/math/tropical-spmv.d.ts +1 -0
  298. package/dist/math/tropical-spmv.js +2 -2
  299. package/dist/math/tropicalSpmv.d.ts +43 -0
  300. package/dist/math/vec3.cjs +1 -1
  301. package/dist/math/vec3.js +1 -1
  302. package/dist/matter/StagedMatter.d.ts +82 -0
  303. package/dist/matter/index.cjs +17 -0
  304. package/dist/matter/index.d.ts +1 -0
  305. package/dist/matter/index.js +4 -0
  306. package/dist/{ml-dsa-Z7JDKW4L.js → ml-dsa-J6VKVT4K.js} +3 -3
  307. package/dist/{ml-dsa-FSKBTE3W.cjs → ml-dsa-MTIK4ZUQ.cjs} +23 -23
  308. package/dist/paper-0c-spike/index.cjs +1 -1
  309. package/dist/paper-0c-spike/index.js +1 -1
  310. package/dist/parameter-envelope/ParameterEnvelope.d.ts +128 -0
  311. package/dist/parameter-envelope/index.cjs +17 -0
  312. package/dist/parameter-envelope/index.d.ts +2 -0
  313. package/dist/parameter-envelope/index.js +4 -0
  314. package/dist/parser/HoloCompositionTypes.d.ts +2013 -0
  315. package/dist/parser/PipelineParser.d.ts +162 -0
  316. package/dist/parser.cjs +36 -20
  317. package/dist/parser.js +13 -9
  318. package/dist/plugin-manifest/ManifestAutoLoader.d.ts +35 -0
  319. package/dist/plugin-manifest/PluginManifest.d.ts +156 -0
  320. package/dist/plugin-manifest/index.cjs +25 -0
  321. package/dist/plugin-manifest/index.d.ts +2 -0
  322. package/dist/plugin-manifest/index.js +4 -0
  323. package/dist/plugin-solver-contract/PluginSolverContract.d.ts +288 -0
  324. package/dist/plugin-solver-contract/index.cjs +41 -0
  325. package/dist/plugin-solver-contract/index.d.ts +1 -0
  326. package/dist/plugin-solver-contract/index.js +4 -0
  327. package/dist/policy/ContentPolicyGate.d.ts +51 -0
  328. package/dist/policy/PolicyPack.d.ts +120 -0
  329. package/dist/policy/blocklist.d.ts +32 -0
  330. package/dist/policy/defaults.d.ts +44 -0
  331. package/dist/policy/index.cjs +106 -0
  332. package/dist/policy/index.d.ts +17 -0
  333. package/dist/policy/index.js +5 -0
  334. package/dist/policy/jsonLogic.d.ts +31 -0
  335. package/dist/policy/types.d.ts +174 -0
  336. package/dist/proof-composition/ProofCompositionLaw.d.ts +93 -0
  337. package/dist/proof-composition/index.cjs +25 -0
  338. package/dist/proof-composition/index.d.ts +1 -0
  339. package/dist/proof-composition/index.js +4 -0
  340. package/dist/receipts/hash-policy.d.ts +85 -0
  341. package/dist/reconstruction/index.cjs +75 -47
  342. package/dist/reconstruction/index.js +5 -5
  343. package/dist/runtime/plugin-trait-registrar.d.ts +36 -0
  344. package/dist/runtime.cjs +81 -79
  345. package/dist/runtime.js +9 -7
  346. package/dist/scene-presets-EDKYZ5GW.js +4 -0
  347. package/dist/scene-presets-NCW2CFRS.cjs +17 -0
  348. package/dist/self-improvement/index.cjs +1 -1
  349. package/dist/self-improvement/index.js +1 -1
  350. package/dist/{src-PT2FERDV.cjs → src-G3D7ZATQ.cjs} +545 -21
  351. package/dist/{src-J6CM4AUR.js → src-UXYA7HM6.js} +539 -16
  352. package/dist/storage/index.cjs +10 -10
  353. package/dist/storage/index.js +3 -3
  354. package/dist/testing.cjs +1 -1
  355. package/dist/testing.js +1 -1
  356. package/dist/tools/index.cjs +3631 -0
  357. package/dist/tools/index.js +3581 -0
  358. package/dist/traitDocs/traitDocs.cjs +9 -9
  359. package/dist/traitDocs/traitDocs.d.ts +1 -0
  360. package/dist/traitDocs/traitDocs.js +3 -3
  361. package/dist/traits/ControlLoopTrait.d.ts +154 -0
  362. package/dist/traits/KinematicChainTrait.d.ts +116 -0
  363. package/dist/traits/SensorSamplingTrait.d.ts +154 -0
  364. package/dist/traits/TraitTypes.d.ts +270 -0
  365. package/dist/traits/TransactionTrait.d.ts +121 -0
  366. package/dist/traits/botanical-lotus.cjs +54 -50
  367. package/dist/traits/botanical-lotus.js +2 -5
  368. package/dist/traits/control-loop.cjs +21 -0
  369. package/dist/traits/control-loop.d.ts +1 -0
  370. package/dist/traits/control-loop.js +4 -0
  371. package/dist/traits/engines/cloth-verlet.d.ts +65 -0
  372. package/dist/traits/engines/index.cjs +19 -19
  373. package/dist/traits/engines/index.d.ts +15 -275
  374. package/dist/traits/engines/index.js +3 -3
  375. package/dist/traits/engines/motion-data-schema.d.ts +119 -0
  376. package/dist/traits/engines/motion-matching.d.ts +102 -0
  377. package/dist/traits/engines/noise.d.ts +25 -0
  378. package/dist/traits/engines/onnx-adapter.d.ts +173 -0
  379. package/dist/traits/engines/onnx-motion-matching.d.ts +163 -0
  380. package/dist/traits/engines/pfnn-network.d.ts +92 -0
  381. package/dist/traits/engines/synthetic-walk-cycle.d.ts +38 -0
  382. package/dist/traits/engines/tensor-ops.d.ts +15 -0
  383. package/dist/traits/index.cjs +2789 -1259
  384. package/dist/traits/index.d.ts +35 -0
  385. package/dist/traits/index.js +1692 -411
  386. package/dist/traits/kinematic-chain.cjs +25 -0
  387. package/dist/traits/kinematic-chain.d.ts +1 -0
  388. package/dist/traits/kinematic-chain.js +4 -0
  389. package/dist/traits/sensor-sampling.cjs +33 -0
  390. package/dist/traits/sensor-sampling.d.ts +1 -0
  391. package/dist/traits/sensor-sampling.js +4 -0
  392. package/dist/traits/simulation-solver-factory.cjs +1 -1
  393. package/dist/traits/simulation-solver-factory.js +1 -1
  394. package/dist/traits/transaction.cjs +29 -0
  395. package/dist/traits/transaction.d.ts +1 -0
  396. package/dist/traits/transaction.js +4 -0
  397. package/dist/traits/webcam-gaze.cjs +1 -1
  398. package/dist/traits/webcam-gaze.js +1 -1
  399. package/dist/type-checker.cjs +7 -6
  400. package/dist/type-checker.js +5 -4
  401. package/dist/types/AdvancedTypeSystem.d.ts +489 -0
  402. package/dist/types/HoloScriptPlus.d.ts +810 -0
  403. package/dist/types/base.d.ts +248 -0
  404. package/dist/types.d.ts +799 -0
  405. package/dist/world/index.cjs +3 -4
  406. package/dist/world/index.js +3 -4
  407. package/dist/world-model/index.cjs +1 -1
  408. package/dist/world-model/index.js +1 -1
  409. package/dist/wot/index.cjs +1 -1
  410. package/dist/wot/index.js +1 -1
  411. package/package.json +135 -69
  412. package/dist/GLTFPipeline-3EJLL3TS.cjs +0 -38
  413. package/dist/GLTFPipeline-3OWJV2VK.js +0 -17
  414. package/dist/HoloScriptPlusParser-ADWRY5OS.cjs +0 -698
  415. package/dist/HoloScriptPlusParser-JLJDXHSC.js +0 -693
  416. package/dist/HoloScriptPlusParser-QCGFPWIL.cjs +0 -27
  417. package/dist/HoloScriptPlusParser-WENAFEFV.js +0 -10
  418. package/dist/HoloScriptRuntime-GGRVEU4T.cjs +0 -19
  419. package/dist/HoloScriptRuntime-GJK6VJPH.js +0 -10
  420. package/dist/chunk-22Q5A6RV.js +0 -979
  421. package/dist/chunk-4C57PR42.js +0 -468
  422. package/dist/chunk-4W5G5QVL.cjs +0 -847
  423. package/dist/chunk-5ET6L4NS.js +0 -487
  424. package/dist/chunk-C4GSLCHE.cjs +0 -7153
  425. package/dist/chunk-F2G6CWFT.js +0 -7089
  426. package/dist/chunk-G6PNEASF.cjs +0 -814
  427. package/dist/chunk-GTA4Q3A3.js +0 -1491
  428. package/dist/chunk-HCCQLAA4.cjs +0 -74
  429. package/dist/chunk-HFSVMKM3.cjs +0 -72
  430. package/dist/chunk-KAIVDEIG.cjs +0 -4539
  431. package/dist/chunk-KQU64CIX.cjs +0 -1508
  432. package/dist/chunk-MSYSQ2AJ.js +0 -4533
  433. package/dist/chunk-NHJLP37F.js +0 -70
  434. package/dist/chunk-NHYRRAGI.cjs +0 -490
  435. package/dist/chunk-OIQYIIO3.cjs +0 -473
  436. package/dist/chunk-OL46QLBJ.js +0 -61
  437. package/dist/chunk-SKZPC5AG.cjs +0 -984
  438. package/dist/chunk-SLHLXUMO.js +0 -445
  439. package/dist/chunk-UOIGFQXC.cjs +0 -9750
  440. package/dist/chunk-UOL6Y5TD.cjs +0 -759
  441. package/dist/chunk-UVFI7XIR.cjs +0 -452
  442. package/dist/chunk-VEPGBETF.js +0 -844
  443. package/dist/chunk-XQ5MWMP2.js +0 -756
  444. package/dist/chunk-XT6JY5W5.js +0 -9684
  445. package/dist/chunk-YRRAUB35.js +0 -811
  446. package/dist/compiler/GasOptimizationAnalyzer.d.ts +0 -73
  447. package/dist/compiler/NFTMarketplaceCompiler.d.ts +0 -23
  448. package/dist/compiler/ar.cjs +0 -23
  449. package/dist/compiler/ar.js +0 -11
  450. package/dist/compiler/babylon.cjs +0 -21
  451. package/dist/compiler/babylon.js +0 -15
  452. package/dist/compiler/multi-layer.cjs +0 -24
  453. package/dist/compiler/multi-layer.js +0 -15
  454. package/dist/compiler/playcanvas.cjs +0 -19
  455. package/dist/compiler/playcanvas.js +0 -13
  456. package/dist/compiler/r3f.cjs +0 -39
  457. package/dist/compiler/r3f.d.ts +0 -22
  458. package/dist/compiler/r3f.js +0 -17
  459. package/dist/compiler/vrr.cjs +0 -24
  460. package/dist/compiler/vrr.js +0 -12
  461. package/dist/parser/NFTMarketplaceTypes.d.ts +0 -191
  462. package/dist/playwright-3AT3AKTV.cjs +0 -98673
  463. package/dist/playwright-VZPDVUEQ.js +0 -98660
@@ -1,6 +1,6 @@
1
- import { init_DomainBlockCompilerMixin, compileDomainBlocks, compileMaterialBlock, materialToWebGPU } from './chunk-ZA34AN3R.js';
2
- import { init_CompilerBase, CompilerBase } from './chunk-C7ZBSV2Q.js';
3
- import { __export, __esm } from './chunk-OL46QLBJ.js';
1
+ import { init_DomainBlockCompilerMixin, datavizToWebGPU, compileDataVizBlock, compileMaterialBlock, materialToWebGPU, compileParticleBlock, compilePostProcessingBlock, compileProceduralBlock } from './chunk-5LVFTGKH.js';
2
+ import { init_CompilerBase, CompilerBase } from './chunk-DUG3OQAS.js';
3
+ import { __export, __esm } from './chunk-W4GABFCR.js';
4
4
  import { ANSCapabilityPath } from '@holoscript/core-types/ans';
5
5
 
6
6
  // src/compiler/WebGPUCompiler.ts
@@ -52,7 +52,10 @@ var init_WebGPUCompiler = __esm({
52
52
  }
53
53
  this.emit("");
54
54
  this.emitDeviceInit();
55
+ this.emitGeometryHelpers();
56
+ this.emitShaderSources();
55
57
  if (composition.environment) this.emitEnvironment(composition.environment);
58
+ this.emitCamera(composition.camera);
56
59
  if (composition.objects) {
57
60
  for (const obj of composition.objects) this.emitObject(obj);
58
61
  }
@@ -62,10 +65,8 @@ var init_WebGPUCompiler = __esm({
62
65
  if (composition.lights) {
63
66
  for (const light of composition.lights) this.emitLight(light);
64
67
  }
65
- if (composition.camera) this.emitCamera(composition.camera);
66
68
  if (this.options.enableCompute) this.emitComputeShaders(composition);
67
69
  this.emitWebGPUDomainBlocks(composition);
68
- this.emitShaderSources();
69
70
  this.emitRenderLoop(composition);
70
71
  return this.lines.join("\n");
71
72
  }
@@ -74,23 +75,160 @@ var init_WebGPUCompiler = __esm({
74
75
  if (domainBlocks.length === 0) return;
75
76
  this.emit("");
76
77
  this.emit("// === v4.2 Domain Blocks ===");
77
- let blockIdx = 0;
78
- const compiled = compileDomainBlocks(
79
- domainBlocks,
80
- {
81
- material: (block) => {
82
- const mat = compileMaterialBlock(block);
83
- return materialToWebGPU(mat, `db${blockIdx++}`);
84
- }
85
- },
86
- (block) => `// Domain block: ${block.domain}/${block.keyword} "${this.escapeStringValue(block.name, "TypeScript")}"`
87
- );
88
- for (const line of compiled) {
89
- for (const l of line.split("\n")) {
90
- this.emit(l);
78
+ for (let i = 0; i < domainBlocks.length; i++) {
79
+ const block = domainBlocks[i];
80
+ const prefix = this.domainBlockVar(block, i);
81
+ switch (block.domain) {
82
+ case "material":
83
+ this.emitMaterialDomainBlock(block, prefix);
84
+ break;
85
+ case "dataviz":
86
+ this.emitMultiline(datavizToWebGPU(compileDataVizBlock(block), prefix));
87
+ break;
88
+ case "vfx":
89
+ this.emitParticleDomainBlock(block, prefix);
90
+ break;
91
+ case "postfx":
92
+ this.emitPostFXDomainBlock(block, prefix);
93
+ break;
94
+ case "procedural":
95
+ this.emitProceduralDomainBlock(block, prefix);
96
+ break;
97
+ default:
98
+ this.emitDomainMetadataBlock(block, prefix);
99
+ break;
91
100
  }
101
+ this.emit("");
102
+ }
103
+ }
104
+ emitMaterialDomainBlock(block, prefix) {
105
+ const mat = compileMaterialBlock(block);
106
+ this.emitMultiline(materialToWebGPU(mat, prefix));
107
+ if (Object.keys(mat.textureMaps).length > 0) {
108
+ this.emit(`const ${prefix}TextureMaps = ${this.json(mat.textureMaps)};`);
109
+ this.emit(`const ${prefix}Textures = await loadMaterialTextureSet(${prefix}TextureMaps);`);
110
+ this.emit(
111
+ `const ${prefix}TextureReceipt = { name: "${this.escapeStringValue(mat.name, "TypeScript")}", maps: Object.keys(${prefix}TextureMaps), loaded: Object.values(${prefix}Textures).filter((t) => t.loaded).length };`
112
+ );
113
+ }
114
+ }
115
+ emitParticleDomainBlock(block, prefix) {
116
+ const ps = compileParticleBlock(block);
117
+ const count = Math.max(
118
+ 1,
119
+ Math.floor(
120
+ this.numberProp(block, ["max_particles", "maxParticles", "count", "rate"], 512)
121
+ )
122
+ );
123
+ const seed = this.hashSeed(`${ps.name}:${ps.keyword}:${count}`);
124
+ this.emit(`// Domain particles: ${this.escapeStringValue(ps.name, "TypeScript")}`);
125
+ this.emit(`const ${prefix}ParticleConfig = ${this.json({
126
+ name: ps.name,
127
+ keyword: ps.keyword,
128
+ traits: ps.traits,
129
+ properties: ps.properties,
130
+ modules: ps.modules
131
+ })};`);
132
+ this.emit(`const ${prefix}ParticleCount = ${count};`);
133
+ this.emit(`const ${prefix}ParticleData = makeParticleCloud(${prefix}ParticleCount, ${seed});`);
134
+ this.emit(
135
+ `const ${prefix}ParticleBuf = createBuffer(device, ${prefix}ParticleData, GPUBufferUsage.VERTEX | GPUBufferUsage.STORAGE);`
136
+ );
137
+ this.emit(`const ${prefix}ParticlePipeline = device.createRenderPipeline({`);
138
+ this.indent();
139
+ this.emit('layout: "auto",');
140
+ this.emit(
141
+ 'vertex: { module: device.createShaderModule({ code: WGSL_PARTICLE_RENDER }), entryPoint: "vs_particle",'
142
+ );
143
+ this.emit(
144
+ ' buffers: [{ arrayStride: 32, attributes: [{ shaderLocation: 0, offset: 0, format: "float32x3" }, { shaderLocation: 1, offset: 12, format: "float32x3" }, { shaderLocation: 2, offset: 24, format: "float32" }] }] },'
145
+ );
146
+ this.emit(
147
+ 'fragment: { module: device.createShaderModule({ code: WGSL_PARTICLE_RENDER }), entryPoint: "fs_particle",'
148
+ );
149
+ this.emit(
150
+ ' targets: [{ format, blend: { color: { srcFactor: "src-alpha", dstFactor: "one", operation: "add" }, alpha: { srcFactor: "zero", dstFactor: "one", operation: "add" } } }] },'
151
+ );
152
+ this.emit(
153
+ 'primitive: { topology: "point-list" }, depthStencil: { format: "depth24plus", depthWriteEnabled: false, depthCompare: "less" },'
154
+ );
155
+ this.dedent();
156
+ this.emit("});");
157
+ }
158
+ emitPostFXDomainBlock(block, prefix) {
159
+ const pp = compilePostProcessingBlock(block);
160
+ this.emit(`// Domain post-processing: ${this.escapeStringValue(pp.name ?? block.name, "TypeScript")}`);
161
+ this.emit(`const ${prefix}PostFXConfig = ${this.json({
162
+ name: pp.name,
163
+ keyword: pp.keyword,
164
+ effects: pp.effects
165
+ })};`);
166
+ this.emit(`const ${prefix}PostFXPipeline = device.createRenderPipeline({`);
167
+ this.indent();
168
+ this.emit('layout: "auto",');
169
+ this.emit(
170
+ 'vertex: { module: device.createShaderModule({ code: WGSL_POSTFX }), entryPoint: "vs_postfx" },'
171
+ );
172
+ this.emit(
173
+ 'fragment: { module: device.createShaderModule({ code: WGSL_POSTFX }), entryPoint: "fs_postfx", targets: [{ format, blend: { color: { srcFactor: "src-alpha", dstFactor: "one-minus-src-alpha", operation: "add" }, alpha: { srcFactor: "one", dstFactor: "one-minus-src-alpha", operation: "add" } } }] },'
174
+ );
175
+ this.emit('primitive: { topology: "triangle-list" }, multisample: { count: MSAA_COUNT },');
176
+ this.dedent();
177
+ this.emit("});");
178
+ }
179
+ emitProceduralDomainBlock(block, prefix) {
180
+ const proc = compileProceduralBlock(block);
181
+ this.emit(`// Domain procedural: ${this.escapeStringValue(proc.name, "TypeScript")}`);
182
+ this.emit(`const ${prefix}ProceduralConfig = ${this.json({
183
+ name: proc.name,
184
+ keyword: proc.keyword,
185
+ genType: proc.genType,
186
+ seed: proc.seed,
187
+ density: proc.density,
188
+ scaleRange: proc.scaleRange,
189
+ noise: proc.noise,
190
+ sourceMesh: proc.sourceMesh,
191
+ traits: proc.traits,
192
+ properties: proc.properties
193
+ })};`);
194
+ this.emit(
195
+ `const ${prefix}ProceduralUniform = createBuffer(device, new Float32Array([${proc.seed ?? 1}, ${proc.density ?? 1}, ${this.numberProp(block, ["count"], 1)}, 0]), GPUBufferUsage.UNIFORM);`
196
+ );
197
+ if (block.keyword === "scatter" || block.keyword === "distribute" || block.properties?.count) {
198
+ const count = Math.max(1, Math.floor(this.numberProp(block, ["count"], 128)));
199
+ this.emit(`const ${prefix}ScatterInstanceCount = ${count};`);
200
+ this.emit(`const ${prefix}ScatterVertices = generateConeVertices(0.08, 0.36, 8);`);
201
+ this.emit(`const ${prefix}ScatterVBO = createBuffer(device, ${prefix}ScatterVertices, GPUBufferUsage.VERTEX);`);
202
+ this.emit(`const ${prefix}ScatterVertexCount = ${prefix}ScatterVertices.length / 6;`);
203
+ this.emit(`const ${prefix}ScatterPipeline = device.createRenderPipeline({`);
204
+ this.indent();
205
+ this.emit('layout: "auto",');
206
+ this.emit(
207
+ 'vertex: { module: device.createShaderModule({ code: WGSL_SCATTER }), entryPoint: "vs_scatter",'
208
+ );
209
+ this.emit(
210
+ ' buffers: [{ arrayStride: 24, attributes: [{ shaderLocation: 0, offset: 0, format: "float32x3" }, { shaderLocation: 1, offset: 12, format: "float32x3" }] }] },'
211
+ );
212
+ this.emit(
213
+ 'fragment: { module: device.createShaderModule({ code: WGSL_SCATTER }), entryPoint: "fs_scatter", targets: [{ format }] },'
214
+ );
215
+ this.emit(
216
+ 'primitive: { topology: "triangle-list", cullMode: "back" }, depthStencil: { format: "depth24plus", depthWriteEnabled: true, depthCompare: "less" }, multisample: { count: MSAA_COUNT },'
217
+ );
218
+ this.dedent();
219
+ this.emit("});");
92
220
  }
93
221
  }
222
+ emitDomainMetadataBlock(block, prefix) {
223
+ this.emit(`const ${prefix}DomainBlock = ${this.json({
224
+ domain: block.domain,
225
+ keyword: block.keyword,
226
+ name: block.name,
227
+ traits: block.traits,
228
+ properties: block.properties,
229
+ childCount: block.children?.length ?? 0
230
+ })};`);
231
+ }
94
232
  // ─── Device Init ──────────────────────────────────────────────────────────
95
233
  emitDeviceInit() {
96
234
  this.emit("// === WebGPU Device Initialization ===");
@@ -98,6 +236,7 @@ var init_WebGPUCompiler = __esm({
98
236
  this.emit("const adapter = await navigator.gpu.requestAdapter();");
99
237
  this.emit('if (!adapter) throw new Error("WebGPU not supported");');
100
238
  this.emit("const device = await adapter.requestDevice();");
239
+ this.emit('document.body.dataset.holoscriptWebgpu = "device-ready";');
101
240
  this.emit('const context = canvas.getContext("webgpu") as GPUCanvasContext;');
102
241
  this.emit("const format = navigator.gpu.getPreferredCanvasFormat();");
103
242
  this.emit('context.configure({ device, format, alphaMode: "premultiplied" });');
@@ -126,6 +265,145 @@ var init_WebGPUCompiler = __esm({
126
265
  );
127
266
  this.dedent();
128
267
  this.emit("}");
268
+ this.emit("function createFallbackTexture(device, rgba) {");
269
+ this.indent();
270
+ this.emit('const tex = device.createTexture({ size: [1, 1, 1], format: "rgba8unorm", usage: GPUTextureUsage.TEXTURE_BINDING | GPUTextureUsage.COPY_DST });');
271
+ this.emit("device.queue.writeTexture({ texture: tex }, new Uint8Array(rgba), { bytesPerRow: 4 }, [1, 1, 1]);");
272
+ this.emit("return tex;");
273
+ this.dedent();
274
+ this.emit("}");
275
+ this.emit("async function loadTexture2D(src) {");
276
+ this.indent();
277
+ this.emit('const sampler = device.createSampler({ magFilter: "linear", minFilter: "linear", mipmapFilter: "linear", addressModeU: "repeat", addressModeV: "repeat" });');
278
+ this.emit("try {");
279
+ this.indent();
280
+ this.emit("const resp = await fetch(src);");
281
+ this.emit("if (!resp.ok) throw new Error(`texture fetch ${resp.status}`);");
282
+ this.emit("const bitmap = await createImageBitmap(await resp.blob());");
283
+ this.emit('const texture = device.createTexture({ size: [bitmap.width, bitmap.height, 1], format: "rgba8unorm", usage: GPUTextureUsage.TEXTURE_BINDING | GPUTextureUsage.COPY_DST | GPUTextureUsage.RENDER_ATTACHMENT });');
284
+ this.emit("device.queue.copyExternalImageToTexture({ source: bitmap }, { texture }, [bitmap.width, bitmap.height]);");
285
+ this.emit("return { src, texture, view: texture.createView(), sampler, loaded: true };");
286
+ this.dedent();
287
+ this.emit("} catch {");
288
+ this.indent();
289
+ this.emit("const texture = createFallbackTexture(device, [255, 255, 255, 255]);");
290
+ this.emit("return { src, texture, view: texture.createView(), sampler, loaded: false };");
291
+ this.dedent();
292
+ this.emit("}");
293
+ this.dedent();
294
+ this.emit("}");
295
+ this.emit("async function loadMaterialTextureSet(maps) {");
296
+ this.indent();
297
+ this.emit("const entries = await Promise.all(Object.entries(maps).map(async ([kind, src]) => [kind, await loadTexture2D(src)]));");
298
+ this.emit("return Object.fromEntries(entries);");
299
+ this.dedent();
300
+ this.emit("}");
301
+ this.emit("const assetLoader = {");
302
+ this.indent();
303
+ this.emit("async load(src) {");
304
+ this.indent();
305
+ this.emit('return { src, kind: "external-model", loaded: false };');
306
+ this.dedent();
307
+ this.emit("},");
308
+ this.dedent();
309
+ this.emit("};");
310
+ this.emit("function makeParticleCloud(count, seed) {");
311
+ this.indent();
312
+ this.emit("let s = seed || 1;");
313
+ this.emit("const rnd = () => { s = (s * 1664525 + 1013904223) >>> 0; return s / 4294967296; };");
314
+ this.emit("const data = new Float32Array(count * 8);");
315
+ this.emit("for (let i = 0; i < count; i++) {");
316
+ this.indent();
317
+ this.emit("const o = i * 8;");
318
+ this.emit("data[o + 0] = rnd() * 1.8 - 0.9; data[o + 1] = rnd() * 1.2 - 0.6; data[o + 2] = rnd() * 1.8 - 0.9;");
319
+ this.emit("data[o + 3] = 0.0; data[o + 4] = 0.25 + rnd(); data[o + 5] = 0.0; data[o + 6] = rnd(); data[o + 7] = 0.0;");
320
+ this.dedent();
321
+ this.emit("}");
322
+ this.emit("return data;");
323
+ this.dedent();
324
+ this.emit("}");
325
+ this.emit("");
326
+ }
327
+ emitGeometryHelpers() {
328
+ this.emit("// === Geometry Helpers ===");
329
+ this.emit("function generateCubeVertices(size) {");
330
+ this.indent();
331
+ this.emit("const s = size / 2;");
332
+ this.emit("return new Float32Array([");
333
+ this.indent();
334
+ this.emit("-s,-s, s, 0,0,1, s,-s, s, 0,0,1, s, s, s, 0,0,1, -s,-s, s, 0,0,1, s, s, s, 0,0,1, -s, s, s, 0,0,1,");
335
+ this.emit(" s,-s,-s, 0,0,-1, -s,-s,-s, 0,0,-1, -s, s,-s, 0,0,-1, s,-s,-s, 0,0,-1, -s, s,-s, 0,0,-1, s, s,-s, 0,0,-1,");
336
+ this.emit("-s,-s,-s, -1,0,0, -s,-s, s, -1,0,0, -s, s, s, -1,0,0, -s,-s,-s, -1,0,0, -s, s, s, -1,0,0, -s, s,-s, -1,0,0,");
337
+ this.emit(" s,-s, s, 1,0,0, s,-s,-s, 1,0,0, s, s,-s, 1,0,0, s,-s, s, 1,0,0, s, s,-s, 1,0,0, s, s, s, 1,0,0,");
338
+ this.emit("-s, s, s, 0,1,0, s, s, s, 0,1,0, s, s,-s, 0,1,0, -s, s, s, 0,1,0, s, s,-s, 0,1,0, -s, s,-s, 0,1,0,");
339
+ this.emit("-s,-s,-s, 0,-1,0, s,-s,-s, 0,-1,0, s,-s, s, 0,-1,0, -s,-s,-s, 0,-1,0, s,-s, s, 0,-1,0, -s,-s, s, 0,-1,0");
340
+ this.dedent();
341
+ this.emit("]);");
342
+ this.dedent();
343
+ this.emit("}");
344
+ this.emit("function generatePlaneVertices(width, depth) {");
345
+ this.indent();
346
+ this.emit("const x = width / 2, z = depth / 2;");
347
+ this.emit("return new Float32Array([-x,0,-z,0,1,0, x,0,-z,0,1,0, x,0,z,0,1,0, -x,0,-z,0,1,0, x,0,z,0,1,0, -x,0,z,0,1,0]);");
348
+ this.dedent();
349
+ this.emit("}");
350
+ this.emit("function generateSphereVertices(radius, lat, lon) {");
351
+ this.indent();
352
+ this.emit("const rings = Math.max(3, lat | 0), segs = Math.max(3, lon | 0); const out = [];");
353
+ this.emit("const P = (ri, si) => {");
354
+ this.emit(" const phi = Math.PI * ri / rings, theta = 2 * Math.PI * si / segs;");
355
+ this.emit(" const nx = Math.sin(phi) * Math.cos(theta), ny = Math.cos(phi), nz = Math.sin(phi) * Math.sin(theta);");
356
+ this.emit(" return [nx * radius, ny * radius, nz * radius, nx, ny, nz];");
357
+ this.emit("};");
358
+ this.emit("for (let ri = 0; ri < rings; ri++) { for (let si = 0; si < segs; si++) {");
359
+ this.emit(" const a = P(ri, si), b = P(ri + 1, si), c = P(ri + 1, si + 1), d = P(ri, si + 1);");
360
+ this.emit(" out.push(...a, ...b, ...c, ...a, ...c, ...d);");
361
+ this.emit("} } return new Float32Array(out);");
362
+ this.dedent();
363
+ this.emit("}");
364
+ this.emit("function generateCylinderVertices(radius, height, segments) {");
365
+ this.indent();
366
+ this.emit("const segs = Math.max(3, segments | 0), hy = height / 2, out = [];");
367
+ this.emit("for (let i = 0; i < segs; i++) {");
368
+ this.emit(" const t0 = 2*Math.PI*i/segs, t1 = 2*Math.PI*(i+1)/segs;");
369
+ this.emit(" const c0 = Math.cos(t0), s0 = Math.sin(t0), c1 = Math.cos(t1), s1 = Math.sin(t1);");
370
+ this.emit(" const b0 = [radius*c0, -hy, radius*s0, c0, 0, s0], t0v = [radius*c0, hy, radius*s0, c0, 0, s0];");
371
+ this.emit(" const b1 = [radius*c1, -hy, radius*s1, c1, 0, s1], t1v = [radius*c1, hy, radius*s1, c1, 0, s1];");
372
+ this.emit(" out.push(...b0, ...b1, ...t1v, ...b0, ...t1v, ...t0v);");
373
+ this.emit(" out.push(0, hy, 0, 0, 1, 0, radius*c0, hy, radius*s0, 0, 1, 0, radius*c1, hy, radius*s1, 0, 1, 0);");
374
+ this.emit(" out.push(0, -hy, 0, 0, -1, 0, radius*c1, -hy, radius*s1, 0, -1, 0, radius*c0, -hy, radius*s0, 0, -1, 0);");
375
+ this.emit("} return new Float32Array(out);");
376
+ this.dedent();
377
+ this.emit("}");
378
+ this.emit("function generateConeVertices(radius, height, segments) {");
379
+ this.indent();
380
+ this.emit("const segs = Math.max(3, segments | 0), hy = height / 2, out = [];");
381
+ this.emit("const ny = radius / Math.hypot(radius, height) || 0, nyx = height / Math.hypot(radius, height) || 1;");
382
+ this.emit("for (let i = 0; i < segs; i++) {");
383
+ this.emit(" const t0 = 2*Math.PI*i/segs, t1 = 2*Math.PI*(i+1)/segs;");
384
+ this.emit(" const c0 = Math.cos(t0), s0 = Math.sin(t0), c1 = Math.cos(t1), s1 = Math.sin(t1);");
385
+ this.emit(" out.push(0, hy, 0, (c0+c1)*0.5*nyx, ny, (s0+s1)*0.5*nyx);");
386
+ this.emit(" out.push(radius*c0, -hy, radius*s0, c0*nyx, ny, s0*nyx);");
387
+ this.emit(" out.push(radius*c1, -hy, radius*s1, c1*nyx, ny, s1*nyx);");
388
+ this.emit(" out.push(0, -hy, 0, 0, -1, 0, radius*c1, -hy, radius*s1, 0, -1, 0, radius*c0, -hy, radius*s0, 0, -1, 0);");
389
+ this.emit("} return new Float32Array(out);");
390
+ this.dedent();
391
+ this.emit("}");
392
+ this.emit("function generateTorusVertices(radius, tube, radial, tubular) {");
393
+ this.indent();
394
+ this.emit("const R = Math.max(3, radial | 0), T = Math.max(3, tubular | 0), out = [];");
395
+ this.emit("const P = (ri, ti) => {");
396
+ this.emit(" const u = 2*Math.PI*ri/R, v = 2*Math.PI*ti/T;");
397
+ this.emit(" const cu = Math.cos(u), su = Math.sin(u), cv = Math.cos(v), sv = Math.sin(v);");
398
+ this.emit(" const x = (radius + tube*cv)*cu, y = tube*sv, z = (radius + tube*cv)*su;");
399
+ this.emit(" return [x, y, z, cv*cu, sv, cv*su];");
400
+ this.emit("};");
401
+ this.emit("for (let ri = 0; ri < R; ri++) { for (let ti = 0; ti < T; ti++) {");
402
+ this.emit(" const a = P(ri, ti), b = P(ri + 1, ti), c = P(ri + 1, ti + 1), d = P(ri, ti + 1);");
403
+ this.emit(" out.push(...a, ...b, ...c, ...a, ...c, ...d);");
404
+ this.emit("} } return new Float32Array(out);");
405
+ this.dedent();
406
+ this.emit("}");
129
407
  this.emit("");
130
408
  }
131
409
  // ─── Environment ──────────────────────────────────────────────────────────
@@ -165,12 +443,11 @@ var init_WebGPUCompiler = __esm({
165
443
  const isPointCloud = traits.some((t) => t.name === "point_cloud");
166
444
  const isGpuParticle = traits.some((t) => isGpuParticleTraitName(t.name));
167
445
  if (isModel && modelSrc) {
168
- this.emit(`const ${v}Model = await assetLoader.load("${modelSrc}");`);
169
- const pos = this.findObjProp(obj, "position");
170
- const [px, py, pz] = Array.isArray(pos) ? pos : [0, 0, 0];
446
+ this.emit(`const ${v}Asset = await assetLoader.load("${modelSrc}");`);
171
447
  this.emit(
172
- `const ${v}ModelMatrix = createBuffer(device, new Float32Array([1,0,0,0, 0,1,0,0, 0,0,1,0, ${px},${py},${pz},1]), GPUBufferUsage.UNIFORM);`
448
+ `// Model asset "${this.escapeStringValue(modelSrc, "TypeScript")}" is tracked in ${v}Asset; fallback mesh keeps the render path defined.`
173
449
  );
450
+ this.emitMeshObject(v, obj, "cube");
174
451
  } else if (isModel) {
175
452
  this.emit(`// WARNING: geometry "model" without source URL \u2014 placeholder cube`);
176
453
  this.emitMeshObject(v, obj, "cube");
@@ -213,8 +490,10 @@ var init_WebGPUCompiler = __esm({
213
490
  const [cr, cg, cb] = this.extractMaterialColor(material, color);
214
491
  const rough = this.extractMaterialProp(material, "roughness", 0.5);
215
492
  const metal = this.extractMaterialProp(material, "metalness", 0);
493
+ const [er, eg, eb] = this.extractEmissive(material, obj);
494
+ const emissiveStrength = this.extractMaterialProp(material, "emissive_intensity", 1);
216
495
  this.emit(
217
- `const ${v}Mat = createBuffer(device, new Float32Array([${cr},${cg},${cb},1.0, ${rough},${metal},0,0]), GPUBufferUsage.UNIFORM);`
496
+ `const ${v}Mat = createBuffer(device, new Float32Array([${cr},${cg},${cb},1.0, ${rough},${metal},${emissiveStrength},0, ${er},${eg},${eb},0]), GPUBufferUsage.UNIFORM);`
218
497
  );
219
498
  this.emit(`const ${v}Pipeline = device.createRenderPipeline({`);
220
499
  this.indent();
@@ -238,7 +517,7 @@ var init_WebGPUCompiler = __esm({
238
517
  `const ${v}Bind = device.createBindGroup({ layout: ${v}Pipeline.getBindGroupLayout(0), entries: [`
239
518
  );
240
519
  this.emit(
241
- ` { binding: 0, resource: { buffer: ${v}Model } }, { binding: 1, resource: { buffer: ${v}Mat } }] });`
520
+ ` { binding: 0, resource: { buffer: ${v}Model } }, { binding: 1, resource: { buffer: ${v}Mat } }, { binding: 2, resource: { buffer: vpUniform } }] });`
242
521
  );
243
522
  }
244
523
  emitGaussianSplatObject(v, obj) {
@@ -373,8 +652,8 @@ var init_WebGPUCompiler = __esm({
373
652
  // ─── Camera ───────────────────────────────────────────────────────────────
374
653
  emitCamera(cam) {
375
654
  this.emit("// === Camera ===");
376
- let fov = 60, near = 0.1, far = 1e3, pos = [0, 1, 5], lookAt = [0, 0, 0];
377
- for (const prop of cam.properties) {
655
+ let fov = 60, near = 0.1, far = 1e3, pos = [4, 3, 6], lookAt = [0, 0, 0];
656
+ for (const prop of cam?.properties ?? []) {
378
657
  if (prop.key === "fov" || prop.key === "field_of_view") fov = prop.value;
379
658
  else if (prop.key === "near") near = prop.value;
380
659
  else if (prop.key === "far") far = prop.value;
@@ -386,13 +665,38 @@ var init_WebGPUCompiler = __esm({
386
665
  this.emit(`const cameraNear = ${near}, cameraFar = ${far};`);
387
666
  this.emit(`const cameraPos = new Float32Array([${pos.join(",")}]);`);
388
667
  this.emit(`const cameraTarget = new Float32Array([${lookAt.join(",")}]);`);
389
- this.emit("const aspect = canvas.width / canvas.height;");
668
+ this.emit("const cameraUp = new Float32Array([0, 1, 0]);");
669
+ this.emit("const aspect = (canvas.width || 1) / (canvas.height || 1);");
670
+ this.emit("function mat4Multiply(a: Float32Array, b: Float32Array): Float32Array {");
671
+ this.indent();
672
+ this.emit("const o = new Float32Array(16);");
673
+ this.emit("for (let c = 0; c < 4; c++) { for (let r = 0; r < 4; r++) {");
674
+ this.emit(" o[c*4+r] = a[0*4+r]*b[c*4+0] + a[1*4+r]*b[c*4+1] + a[2*4+r]*b[c*4+2] + a[3*4+r]*b[c*4+3];");
675
+ this.emit("} } return o;");
676
+ this.dedent();
677
+ this.emit("}");
678
+ this.emit("function lookAtMatrix(eye: Float32Array, target: Float32Array, up: Float32Array): Float32Array {");
679
+ this.indent();
680
+ this.emit("const zx = eye[0]-target[0], zy = eye[1]-target[1], zz = eye[2]-target[2];");
681
+ this.emit("let zl = Math.hypot(zx, zy, zz) || 1; const fz = [zx/zl, zy/zl, zz/zl];");
682
+ this.emit("const xx = up[1]*fz[2]-up[2]*fz[1], xy = up[2]*fz[0]-up[0]*fz[2], xz = up[0]*fz[1]-up[1]*fz[0];");
683
+ this.emit("let xl = Math.hypot(xx, xy, xz) || 1; const rx = [xx/xl, xy/xl, xz/xl];");
684
+ this.emit("const uy = [fz[1]*rx[2]-fz[2]*rx[1], fz[2]*rx[0]-fz[0]*rx[2], fz[0]*rx[1]-fz[1]*rx[0]];");
685
+ this.emit("return new Float32Array([");
686
+ this.emit(" rx[0], uy[0], fz[0], 0,");
687
+ this.emit(" rx[1], uy[1], fz[1], 0,");
688
+ this.emit(" rx[2], uy[2], fz[2], 0,");
689
+ this.emit(" -(rx[0]*eye[0]+rx[1]*eye[1]+rx[2]*eye[2]),");
690
+ this.emit(" -(uy[0]*eye[0]+uy[1]*eye[1]+uy[2]*eye[2]),");
691
+ this.emit(" -(fz[0]*eye[0]+fz[1]*eye[1]+fz[2]*eye[2]), 1]);");
692
+ this.dedent();
693
+ this.emit("}");
390
694
  this.emit("function buildViewProjection(): Float32Array {");
391
695
  this.indent();
392
696
  this.emit("const f = 1.0 / Math.tan(cameraFov / 2), ri = 1.0 / (cameraNear - cameraFar);");
393
- this.emit(
394
- "return new Float32Array([f/aspect,0,0,0, 0,f,0,0, 0,0,(cameraNear+cameraFar)*ri,-1, 0,0,cameraNear*cameraFar*ri*2,0]);"
395
- );
697
+ this.emit("const proj = new Float32Array([f/aspect,0,0,0, 0,f,0,0, 0,0,cameraFar*ri,-1, 0,0,cameraNear*cameraFar*ri,0]);");
698
+ this.emit("const view = lookAtMatrix(cameraPos, cameraTarget, cameraUp);");
699
+ this.emit("return mat4Multiply(proj, view);");
396
700
  this.dedent();
397
701
  this.emit("}");
398
702
  this.emit(
@@ -431,7 +735,7 @@ var init_WebGPUCompiler = __esm({
431
735
  this.emit(
432
736
  `const ${v}CustomCompute = device.createComputePipeline({ layout: "auto", compute: { module: device.createShaderModule({ code: WGSL_CUSTOM_${v.toUpperCase()} }), entryPoint: "${entry}" } });`
433
737
  );
434
- this.emit(`const ${v}Workgroups: [number, number, number] = [${wg}];`);
738
+ this.emit(`const ${v}Workgroups = [${wg}];`);
435
739
  }
436
740
  }
437
741
  this.emit("");
@@ -441,7 +745,9 @@ var init_WebGPUCompiler = __esm({
441
745
  this.emit("// === WGSL Shader Sources ===");
442
746
  this.emit("const WGSL_VERTEX = /* wgsl */`");
443
747
  this.emit("struct Uniforms { model: mat4x4<f32> };");
748
+ this.emit("struct Camera { viewProj: mat4x4<f32> };");
444
749
  this.emit("@group(0) @binding(0) var<uniform> u: Uniforms;");
750
+ this.emit("@group(0) @binding(2) var<uniform> cam: Camera;");
445
751
  this.emit("struct VIn { @location(0) pos: vec3<f32>, @location(1) norm: vec3<f32> };");
446
752
  this.emit(
447
753
  "struct VOut { @builtin(position) clip: vec4<f32>, @location(0) wNorm: vec3<f32>, @location(1) wPos: vec3<f32> };"
@@ -449,17 +755,19 @@ var init_WebGPUCompiler = __esm({
449
755
  this.emit("@vertex fn vs_main(i: VIn) -> VOut {");
450
756
  this.emit(" var o: VOut; let w = u.model * vec4<f32>(i.pos, 1.0);");
451
757
  this.emit(
452
- " o.clip = w; o.wNorm = (u.model * vec4<f32>(i.norm, 0.0)).xyz; o.wPos = w.xyz; return o; }`;"
758
+ " o.clip = cam.viewProj * w; o.wNorm = normalize((u.model * vec4<f32>(i.norm, 0.0)).xyz); o.wPos = w.xyz; return o; }`;"
453
759
  );
454
760
  this.emit("");
455
761
  this.emit("const WGSL_FRAGMENT = /* wgsl */`");
456
- this.emit("struct Mat { color: vec4<f32>, rm: vec4<f32> };");
762
+ this.emit("struct Mat { color: vec4<f32>, rm: vec4<f32>, emissive: vec4<f32> };");
457
763
  this.emit("@group(0) @binding(1) var<uniform> mat: Mat;");
458
764
  this.emit("struct FIn { @location(0) wNorm: vec3<f32>, @location(1) wPos: vec3<f32> };");
459
765
  this.emit("@fragment fn fs_main(i: FIn) -> @location(0) vec4<f32> {");
460
766
  this.emit(" let N = normalize(i.wNorm); let L = normalize(vec3<f32>(1.0, 2.0, 1.5));");
461
767
  this.emit(" let d = max(dot(N, L), 0.0) * (1.0 - mat.rm[0] * 0.5);");
462
- this.emit(" return vec4<f32>(mat.color.rgb * (0.15 + d), mat.color.a); }`;");
768
+ this.emit(" let lit = mat.color.rgb * (0.15 + d);");
769
+ this.emit(" let emit = mat.emissive.rgb * mat.rm[2];");
770
+ this.emit(" return vec4<f32>(lit + emit, mat.color.a); }`;");
463
771
  this.emit("");
464
772
  this.emit("const WGSL_SPLAT = /* wgsl */`");
465
773
  this.emit(
@@ -498,6 +806,25 @@ var init_WebGPUCompiler = __esm({
498
806
  " let t = clamp(i.life, 0.0, 1.0); return vec4<f32>(mix(vec3(1.0,0.2,0.0), vec3(1.0,1.0,0.5), t), t*0.8); }`;"
499
807
  );
500
808
  this.emit("");
809
+ this.emit("const WGSL_SCATTER = /* wgsl */`");
810
+ this.emit("struct VIn { @location(0) pos: vec3<f32>, @location(1) norm: vec3<f32> };");
811
+ this.emit("struct VOut { @builtin(position) clip: vec4<f32>, @location(0) shade: f32 };");
812
+ this.emit("fn hash11(v: f32) -> f32 { return fract(sin(v * 12.9898) * 43758.5453); }");
813
+ this.emit("@vertex fn vs_scatter(i: VIn, @builtin(instance_index) instance: u32) -> VOut {");
814
+ this.emit(" let id = f32(instance);");
815
+ this.emit(" let x = hash11(id + 1.0) * 1.8 - 0.9; let z = hash11(id + 7.0) * 1.8 - 0.9;");
816
+ this.emit(" let scale = 0.35 + hash11(id + 13.0) * 0.45;");
817
+ this.emit(" var o: VOut; o.clip = vec4<f32>(i.pos.x * scale + x, i.pos.y * scale - 0.65, i.pos.z * scale + z, 1.0);");
818
+ this.emit(" o.shade = 0.45 + max(i.norm.y, 0.0) * 0.45; return o; }");
819
+ this.emit("@fragment fn fs_scatter(i: VOut) -> @location(0) vec4<f32> { return vec4<f32>(0.08 * i.shade, 0.34 * i.shade, 0.12 * i.shade, 1.0); }`;");
820
+ this.emit("");
821
+ this.emit("const WGSL_POSTFX = /* wgsl */`");
822
+ this.emit("struct VO { @builtin(position) pos: vec4<f32> };");
823
+ this.emit("@vertex fn vs_postfx(@builtin(vertex_index) vi: u32) -> VO {");
824
+ this.emit(" var p = array<vec2<f32>,3>(vec2(-1.0,-1.0), vec2(3.0,-1.0), vec2(-1.0,3.0));");
825
+ this.emit(" var o: VO; o.pos = vec4<f32>(p[vi], 0.0, 1.0); return o; }");
826
+ this.emit("@fragment fn fs_postfx() -> @location(0) vec4<f32> { return vec4<f32>(0.04, 0.08, 0.05, 0.18); }`;");
827
+ this.emit("");
501
828
  this.emit("const WGSL_PARTICLE_COMPUTE = /* wgsl */`");
502
829
  this.emit("struct P { pos: vec3<f32>, _p0: f32, vel: vec3<f32>, life: f32 };");
503
830
  this.emit("@group(0) @binding(0) var<storage, read> pin: array<P>;");
@@ -578,8 +905,11 @@ var init_WebGPUCompiler = __esm({
578
905
  for (const obj of group.objects) this.emitDrawCall(obj);
579
906
  }
580
907
  }
908
+ this.emitDomainBlockDrawCalls(composition, false);
909
+ this.emitDomainBlockDrawCalls(composition, true);
581
910
  this.emit("rp.end();");
582
911
  this.emit("device.queue.submit([enc.finish()]);");
912
+ this.emit("document.body.dataset.holoscriptWebgpuFrame = String(frameCount);");
583
913
  this.emit("requestAnimationFrame(frame);");
584
914
  this.dedent();
585
915
  this.emit("}");
@@ -605,10 +935,37 @@ var init_WebGPUCompiler = __esm({
605
935
  for (const child of obj.children) this.emitDrawCall(child);
606
936
  }
607
937
  }
938
+ emitDomainBlockDrawCalls(composition, postFxOnly) {
939
+ const blocks = composition.domainBlocks ?? [];
940
+ for (let i = 0; i < blocks.length; i++) {
941
+ const block = blocks[i];
942
+ const prefix = this.domainBlockVar(block, i);
943
+ if (block.domain === "postfx") {
944
+ if (postFxOnly) {
945
+ this.emit(`rp.setPipeline(${prefix}PostFXPipeline); rp.draw(3);`);
946
+ }
947
+ continue;
948
+ }
949
+ if (postFxOnly) continue;
950
+ if (block.domain === "vfx") {
951
+ this.emit(
952
+ `rp.setPipeline(${prefix}ParticlePipeline); rp.setVertexBuffer(0, ${prefix}ParticleBuf); rp.draw(${prefix}ParticleCount);`
953
+ );
954
+ }
955
+ if (block.domain === "procedural" && (block.keyword === "scatter" || block.keyword === "distribute" || block.properties?.count)) {
956
+ this.emit(
957
+ `rp.setPipeline(${prefix}ScatterPipeline); rp.setVertexBuffer(0, ${prefix}ScatterVBO); rp.draw(${prefix}ScatterVertexCount, ${prefix}ScatterInstanceCount);`
958
+ );
959
+ }
960
+ }
961
+ }
608
962
  // ─── Helpers ──────────────────────────────────────────────────────────────
609
963
  emit(line) {
610
964
  this.lines.push(this.options.indent.repeat(this.indentLevel) + line);
611
965
  }
966
+ emitMultiline(code) {
967
+ for (const line of code.split("\n")) this.emit(line);
968
+ }
612
969
  indent() {
613
970
  this.indentLevel++;
614
971
  }
@@ -618,6 +975,33 @@ var init_WebGPUCompiler = __esm({
618
975
  sanitizeName(name) {
619
976
  return name.replace(/[^a-zA-Z0-9_]/g, "_");
620
977
  }
978
+ domainBlockVar(block, index) {
979
+ const raw = `${block.domain}_${block.keyword}_${block.name || index}`;
980
+ const safe = this.sanitizeName(raw);
981
+ return `db${index}_${safe || "domain"}`;
982
+ }
983
+ json(value) {
984
+ return JSON.stringify(value).replace(/</g, "\\u003c");
985
+ }
986
+ numberProp(block, keys, fallback) {
987
+ for (const key of keys) {
988
+ const value = block.properties?.[key];
989
+ if (typeof value === "number" && Number.isFinite(value)) return value;
990
+ if (typeof value === "string" && value.trim() !== "") {
991
+ const parsed = Number(value);
992
+ if (Number.isFinite(parsed)) return parsed;
993
+ }
994
+ }
995
+ return fallback;
996
+ }
997
+ hashSeed(value) {
998
+ let h = 2166136261;
999
+ for (let i = 0; i < value.length; i++) {
1000
+ h ^= value.charCodeAt(i);
1001
+ h = Math.imul(h, 16777619);
1002
+ }
1003
+ return h >>> 0;
1004
+ }
621
1005
  findObjProp(obj, key) {
622
1006
  return obj.properties?.find((p) => p.key === key)?.value;
623
1007
  }
@@ -648,6 +1032,15 @@ var init_WebGPUCompiler = __esm({
648
1032
  }
649
1033
  return fallback;
650
1034
  }
1035
+ extractEmissive(material, obj) {
1036
+ const objEmissive = this.findObjProp(obj, "emissive");
1037
+ if (objEmissive !== void 0) return this.parseColor(objEmissive);
1038
+ if (material && typeof material === "object" && !Array.isArray(material)) {
1039
+ const m = material;
1040
+ if (m.emissive !== void 0) return this.parseColor(m.emissive);
1041
+ }
1042
+ return [0, 0, 0];
1043
+ }
651
1044
  geometryVertexDataFn(meshType) {
652
1045
  const map = {
653
1046
  sphere: "generateSphereVertices(0.5, 16, 16)",
@@ -665,5 +1058,5 @@ var init_WebGPUCompiler = __esm({
665
1058
  });
666
1059
 
667
1060
  export { WebGPUCompiler, WebGPUCompiler_exports, init_WebGPUCompiler };
668
- //# sourceMappingURL=chunk-3NGDZZR4.js.map
669
- //# sourceMappingURL=chunk-3NGDZZR4.js.map
1061
+ //# sourceMappingURL=chunk-KEYG7HGY.js.map
1062
+ //# sourceMappingURL=chunk-KEYG7HGY.js.map
@@ -1,5 +1,5 @@
1
- import { init_AgentRBAC, init_CompilerBase, getRBAC, UnauthorizedCompilerAccessError } from './chunk-C7ZBSV2Q.js';
2
- import { __export, __esm } from './chunk-OL46QLBJ.js';
1
+ import { init_AgentRBAC, init_CompilerBase, getRBAC, UnauthorizedCompilerAccessError } from './chunk-DUG3OQAS.js';
2
+ import { __export, __esm } from './chunk-W4GABFCR.js';
3
3
 
4
4
  // src/compiler/StateCompiler.ts
5
5
  var StateCompiler_exports = {};
@@ -109,5 +109,5 @@ var init_StateCompiler = __esm({
109
109
  });
110
110
 
111
111
  export { StateCompiler, StateCompiler_exports, UnauthorizedStateCompilerAccessError, init_StateCompiler };
112
- //# sourceMappingURL=chunk-DY72BMU5.js.map
113
- //# sourceMappingURL=chunk-DY72BMU5.js.map
112
+ //# sourceMappingURL=chunk-KFVNCW4Q.js.map
113
+ //# sourceMappingURL=chunk-KFVNCW4Q.js.map