@holoscript/core 8.0.7 → 8.0.9

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