@holoscript/core 6.0.4 → 6.1.2
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.
- package/LICENSE +21 -0
- package/README.md +3 -3
- package/bin/holoscript.cjs +3 -0
- package/dist/GLTFPipeline-SFIORFJU.js +16 -0
- package/dist/GLTFPipeline-VNNDPONV.cjs +37 -0
- package/dist/{HoloScriptPlusParser-BN6KVRCM.js → HoloScriptPlusParser-7FBIFUFC.js} +6 -5
- package/dist/{HoloScriptPlusParser-NC5FE6AL.cjs → HoloScriptPlusParser-A2W7OCN2.cjs} +17 -16
- package/dist/HoloScriptPlusParser-F2Z56FJR.js +10 -0
- package/dist/HoloScriptPlusParser-WKHRIH6T.cjs +27 -0
- package/dist/{USDZExporter-UWGWNMMD.cjs → USDZExporter-3FWJ25JI.cjs} +344 -16
- package/dist/{USDZExporter-NTMBNTDB.js → USDZExporter-D2HQLQYK.js} +344 -16
- package/dist/agents/index.cjs +19 -0
- package/dist/agents/index.d.ts +100 -0
- package/dist/agents/index.js +17 -0
- package/dist/chunk-22W6NGYN.js +725 -0
- package/dist/{chunk-5OEOHAAW.cjs → chunk-27MPVJVZ.cjs} +64 -28
- package/dist/{chunk-RVYPEYPX.js → chunk-2A7FURVO.js} +44 -8
- package/dist/{chunk-XCWFGZAA.js → chunk-2B7WVIDZ.js} +11 -8
- package/dist/{chunk-NDQNIJEH.js → chunk-2BSMSUCE.js} +250 -24
- package/dist/chunk-2HLIGOKU.cjs +5546 -0
- package/dist/{chunk-EONILVMF.js → chunk-2M2DPHKB.js} +4 -4
- package/dist/{chunk-G7CT3EMP.cjs → chunk-2YSNA2F2.cjs} +319 -47
- package/dist/{chunk-IWI6J7FX.js → chunk-33XCOVE3.js} +5 -5
- package/dist/chunk-3FOKASKO.cjs +348 -0
- package/dist/{chunk-DXJQDCFL.js → chunk-4C57PR42.js} +3 -3
- package/dist/{chunk-MPXBVFHQ.js → chunk-4N4SXXWF.js} +4 -3
- package/dist/chunk-4PDEPEQW.cjs +41 -0
- package/dist/chunk-4R6HPSHJ.js +2176 -0
- package/dist/chunk-4R6SBXDB.js +45 -0
- package/dist/chunk-4SY77NA4.cjs +413 -0
- package/dist/{chunk-YCXFCXDS.js → chunk-4UUKPCY4.js} +668 -110
- package/dist/{chunk-LGGRPKTV.cjs → chunk-52ULD552.cjs} +114 -35
- package/dist/{chunk-L4G4RLXX.js → chunk-5CKA5SXU.js} +438 -22
- package/dist/chunk-5FSKKMR7.cjs +2092 -0
- package/dist/{chunk-FF3Q7ADR.js → chunk-5JEU52DW.js} +5 -3
- package/dist/chunk-5N54COB6.cjs +327 -0
- package/dist/chunk-5S7RKFGR.cjs +446 -0
- package/dist/{chunk-KED34ILP.js → chunk-6ASWLXXN.js} +21 -9
- package/dist/chunk-6CTRH7HT.cjs +1985 -0
- package/dist/{chunk-CAUCGUEA.cjs → chunk-6EX3I5P4.cjs} +6 -6
- package/dist/chunk-6FGQNDR4.js +5731 -0
- package/dist/{chunk-72EQECGT.cjs → chunk-6KMK2UXT.cjs} +122 -46
- package/dist/{chunk-G4VZTCIB.js → chunk-6L4VE27M.js} +33 -23
- package/dist/{chunk-ATSKSYVE.cjs → chunk-6S6TKNEA.cjs} +6478 -1738
- package/dist/chunk-77V4GTCA.js +596 -0
- package/dist/{chunk-ZP4D3CSX.cjs → chunk-7AD52FRS.cjs} +16 -16
- package/dist/chunk-A6KINLZJ.js +236 -0
- package/dist/chunk-AIA52I7T.cjs +543 -0
- package/dist/chunk-AIX25INK.cjs +602 -0
- package/dist/{chunk-B5TCIAPQ.cjs → chunk-AO4I2Z7M.cjs} +17 -18
- package/dist/{chunk-Q5SJOGHQ.cjs → chunk-BPICAGBV.cjs} +324 -199
- package/dist/chunk-BRQJKJGT.cjs +20 -0
- package/dist/{chunk-3FXV5S25.cjs → chunk-C37BHB7N.cjs} +6 -3
- package/dist/{chunk-XUTX5CBW.js → chunk-CBJY23VL.js} +3 -3
- package/dist/chunk-CIWWXYHZ.cjs +50 -0
- package/dist/{chunk-XXINBTZK.cjs → chunk-DIL6DDDN.cjs} +101 -45
- package/dist/chunk-DMXC24WV.js +404 -0
- package/dist/{chunk-PMGODDJA.cjs → chunk-DTGBOSEM.cjs} +12 -12
- package/dist/chunk-E7JP3BS3.cjs +61 -0
- package/dist/{chunk-HJJLD366.js → chunk-EKBKLK7P.js} +3 -3
- package/dist/chunk-EKYL4PE3.cjs +404 -0
- package/dist/{chunk-UPJBDCVF.js → chunk-EMMC5CSQ.js} +12 -8
- package/dist/{chunk-GGHSW2NN.js → chunk-EOBB6A4B.js} +6389 -1718
- package/dist/chunk-EOFNVCM6.js +325 -0
- package/dist/{chunk-FHQVYCH2.js → chunk-ER4GATIU.js} +7 -7
- package/dist/{chunk-N5FTS757.cjs → chunk-EXKSFGSX.cjs} +7 -148
- package/dist/{chunk-LK5IAVH6.cjs → chunk-EXUP2BUM.cjs} +27 -27
- package/dist/chunk-FDSGHPAK.js +130 -0
- package/dist/chunk-FEWUHQNM.cjs +144 -0
- package/dist/{chunk-5TOFIR6L.js → chunk-FGGJQRLZ.js} +5 -142
- package/dist/chunk-FHP6LXJS.js +415 -0
- package/dist/{chunk-7LCYLPW2.cjs → chunk-FJPADH77.cjs} +7 -4
- package/dist/{chunk-T36DDXSF.js → chunk-FXKTYFYA.js} +150 -25
- package/dist/chunk-G2LS3RFO.js +623 -0
- package/dist/chunk-GCMWDSBZ.cjs +729 -0
- package/dist/chunk-GJNCFRJU.cjs +125 -0
- package/dist/{chunk-Q4QX3AET.cjs → chunk-GMP623FG.cjs} +16 -13
- package/dist/{chunk-XD6IYDUX.js → chunk-GN3KDX4W.js} +119 -43
- package/dist/{chunk-QLEAOI3Q.cjs → chunk-GQYKQSTC.cjs} +10 -10
- package/dist/chunk-GTU2Z2WW.cjs +262 -0
- package/dist/chunk-GZG4KA4E.js +529 -0
- package/dist/{chunk-BND3ST2K.cjs → chunk-H3MGK7TX.cjs} +42 -32
- package/dist/{chunk-XRKWN5PL.cjs → chunk-H5DZIHJP.cjs} +14 -18
- package/dist/{chunk-Z34RLXRA.cjs → chunk-HANL7K2Q.cjs} +65 -50
- package/dist/{chunk-3SAK5KFL.cjs → chunk-HCCQLAA4.cjs} +2 -11
- package/dist/{chunk-LXJ4667L.cjs → chunk-HGVXZDSK.cjs} +108 -20
- package/dist/{chunk-3FJCK5XA.js → chunk-HRODTEEO.js} +30 -10
- package/dist/{chunk-HQUEA5R6.cjs → chunk-HZCQO4JM.cjs} +6 -6
- package/dist/{chunk-S565K7NK.js → chunk-I2O7TW6B.js} +12 -8
- package/dist/chunk-IHESJZSW.js +4490 -0
- package/dist/{chunk-FSF7EQVA.cjs → chunk-IRWWS72C.cjs} +63 -22
- package/dist/{chunk-5O6TQC6M.cjs → chunk-IVIA7K75.cjs} +689 -127
- package/dist/chunk-IVY74O6C.js +247 -0
- package/dist/chunk-J32ZJZJH.js +554 -0
- package/dist/chunk-J56PTA46.cjs +639 -0
- package/dist/chunk-JD7CIZ33.js +1949 -0
- package/dist/{chunk-T7LEXZUZ.cjs → chunk-JIYN45TV.cjs} +14 -15
- package/dist/{chunk-FFKU7BTK.cjs → chunk-KHPCJRI3.cjs} +24 -21
- package/dist/chunk-KKFZ3B6J.cjs +557 -0
- package/dist/chunk-KPJL34Y7.cjs +186 -0
- package/dist/{chunk-HE7ULERA.cjs → chunk-KQTPCYTG.cjs} +128 -44
- package/dist/{chunk-OFKWH2IP.js → chunk-KX76JUQY.js} +3 -3
- package/dist/{chunk-33LSUQDD.cjs → chunk-L63H3SQ4.cjs} +43 -31
- package/dist/{chunk-K6EKD26I.js → chunk-LAOCQJ2M.js} +64 -8
- package/dist/chunk-LM2VU56C.cjs +37 -0
- package/dist/chunk-M56JSP4A.js +400 -0
- package/dist/chunk-MBOOR7X4.js +18 -0
- package/dist/{chunk-XWPNTWDN.cjs → chunk-MJVIRCUV.cjs} +31 -27
- package/dist/{chunk-SDAMZIRE.js → chunk-MSMIFMBL.js} +135 -18
- package/dist/{chunk-56IF4NTA.js → chunk-MXFUTKCO.js} +18 -18
- package/dist/{chunk-6UEHYZ7V.cjs → chunk-MXJ5SS53.cjs} +447 -31
- package/dist/chunk-MYY4PMWX.cjs +264 -0
- package/dist/chunk-N75IH2HY.js +258 -0
- package/dist/{chunk-GVUR45UF.cjs → chunk-NG77ATEW.cjs} +7 -6
- package/dist/chunk-NW5G5FBQ.js +215 -0
- package/dist/{chunk-E3FWRT3Z.js → chunk-OEFY723R.js} +28 -13
- package/dist/chunk-OEV5RMZO.cjs +3042 -0
- package/dist/{chunk-X4ZF6CNE.cjs → chunk-OIQYIIO3.cjs} +7 -7
- package/dist/{chunk-2CWOLHTE.js → chunk-OL46QLBJ.js} +3 -11
- package/dist/chunk-OPZ7XDDI.js +487 -0
- package/dist/chunk-OSYNRVOV.cjs +243 -0
- package/dist/{chunk-TEWCN33Y.js → chunk-P7YIA5LN.js} +91 -7
- package/dist/chunk-PGANYCAG.cjs +220 -0
- package/dist/{chunk-CS2EMTGF.js → chunk-QAVXL2IH.js} +62 -21
- package/dist/{chunk-T4NKMBDL.js → chunk-QCCBXSCE.js} +1666 -756
- package/dist/{chunk-F4IULT7N.js → chunk-QPOQ7VPI.js} +16 -13
- package/dist/{chunk-6XSERL6L.js → chunk-QTPMJRGS.js} +3108 -2827
- package/dist/{chunk-F3HH56EB.cjs → chunk-QWNQ523V.cjs} +1730 -823
- package/dist/{chunk-R7MA7QWV.js → chunk-R3IVNY6P.js} +102 -23
- package/dist/chunk-R75BSDH7.cjs +50 -0
- package/dist/chunk-RAXUF5DF.cjs +2196 -0
- package/dist/{chunk-BF2235SI.cjs → chunk-RMHC2VG7.cjs} +2876 -2592
- package/dist/chunk-RUXGBKPS.cjs +4517 -0
- package/dist/{chunk-UERJ3YJV.js → chunk-S5IFXW6E.js} +113 -9
- package/dist/{chunk-27LWW5FU.cjs → chunk-S6YWHCKV.cjs} +5 -5
- package/dist/{chunk-WB4Z63GG.js → chunk-SIEXCILW.js} +3 -3
- package/dist/{chunk-CLYEIWA5.cjs → chunk-SLU6UPJI.cjs} +5 -3
- package/dist/{chunk-LZ266PCM.cjs → chunk-T5J7ZKP3.cjs} +446 -60
- package/dist/chunk-TDCNJHWO.js +341 -0
- package/dist/{chunk-IHOUYQIA.js → chunk-TG7O4WBC.js} +5 -5
- package/dist/chunk-THCK6ECW.js +2085 -0
- package/dist/chunk-TJHVSBP2.js +439 -0
- package/dist/chunk-TK74TR4H.js +5541 -0
- package/dist/{chunk-CDPGV4DN.js → chunk-U4NBQJBY.js} +14 -15
- package/dist/{chunk-NOZZ46QU.js → chunk-UD3DSHZM.js} +10 -14
- package/dist/chunk-UDMYRFDZ.js +3038 -0
- package/dist/{chunk-WDW67DZB.cjs → chunk-UOIGFQXC.cjs} +90 -68
- package/dist/{chunk-BU7VWW2K.js → chunk-URG2SJLK.js} +14 -15
- package/dist/{chunk-EQV4R3EV.cjs → chunk-V73NPPTM.cjs} +152 -35
- package/dist/chunk-VECQYRXL.js +474 -0
- package/dist/chunk-VEXPG4WN.js +1989 -0
- package/dist/{chunk-LDP5OK6G.js → chunk-VMLKSV26.js} +5 -5
- package/dist/{chunk-5BGSECRJ.cjs → chunk-VSK7W3O5.cjs} +47 -27
- package/dist/chunk-VVKVQZI6.js +55 -0
- package/dist/{chunk-YQK5JNFK.js → chunk-W55Z7QIX.js} +103 -15
- package/dist/{chunk-KSGXLT74.cjs → chunk-W6P2GBHH.cjs} +3 -3
- package/dist/{chunk-IBDG74G2.cjs → chunk-W6RW64BB.cjs} +7 -7
- package/dist/chunk-WDT3JTGM.cjs +483 -0
- package/dist/{chunk-HPS76H7Q.js → chunk-WKX5AMOY.js} +3 -3
- package/dist/chunk-WNNE3PO3.js +34 -0
- package/dist/{chunk-XG23EUQX.cjs → chunk-WRLUBRKS.cjs} +538 -312
- package/dist/{chunk-IFNQFCTM.js → chunk-WRNEH5MO.js} +79 -8
- package/dist/{chunk-54FHG2MX.js → chunk-WRWEX5ZF.js} +7 -4
- package/dist/{chunk-KCQ5NDYC.cjs → chunk-X3GJPRVK.cjs} +154 -80
- package/dist/{chunk-7AGYRWKW.cjs → chunk-XFXGA5IW.cjs} +126 -22
- package/dist/{chunk-TQSZUOW5.cjs → chunk-XHIV6326.cjs} +4 -4
- package/dist/chunk-XJAN7CZG.cjs +432 -0
- package/dist/chunk-XL6INWKT.js +121 -0
- package/dist/{chunk-E3UALNFA.js → chunk-XMWZG36H.js} +4 -4
- package/dist/{chunk-BKIGPPVM.js → chunk-XSFNHP2E.js} +6 -3
- package/dist/{chunk-H5Z7NASB.js → chunk-XT6JY5W5.js} +25 -3
- package/dist/chunk-XXZJEFKW.cjs +490 -0
- package/dist/chunk-Y3MWXQSB.cjs +5737 -0
- package/dist/chunk-YF2I3MV3.js +46 -0
- package/dist/{chunk-V3NN3HPP.js → chunk-YIMN575O.js} +437 -52
- package/dist/chunk-YIVFJNYV.js +176 -0
- package/dist/{chunk-MD6KDHVE.cjs → chunk-YKGPCZEE.cjs} +10 -10
- package/dist/chunk-YQELFNJV.js +39 -0
- package/dist/chunk-Z5XMPRNC.cjs +5390 -0
- package/dist/{chunk-3FYZOR7S.cjs → chunk-ZDSYWBIE.cjs} +18 -18
- package/dist/{chunk-6TZPZCOJ.cjs → chunk-ZKSS47EV.cjs} +24 -19
- package/dist/chunk-ZUL5AVTX.cjs +1993 -0
- package/dist/chunk-ZXBZVXDW.js +5386 -0
- package/dist/{chunk-DMG7C4H2.js → chunk-ZZ7RO2UQ.js} +312 -44
- package/dist/cli/holoscript-runner.cjs +200 -204
- package/dist/cli/holoscript-runner.js +144 -148
- package/dist/codebase/index.cjs +1 -1
- package/dist/codebase/index.js +1 -1
- package/dist/compiler/agent-inference.cjs +10 -7
- package/dist/compiler/agent-inference.js +6 -3
- package/dist/compiler/android-xr.cjs +12 -7
- package/dist/compiler/android-xr.js +10 -5
- package/dist/compiler/android.cjs +12 -8
- package/dist/compiler/android.js +10 -6
- package/dist/compiler/ar.cjs +9 -6
- package/dist/compiler/ar.js +7 -4
- package/dist/compiler/babylon.cjs +12 -8
- package/dist/compiler/babylon.js +11 -7
- package/dist/compiler/business-quest.cjs +43 -0
- package/dist/compiler/business-quest.js +4 -0
- package/dist/compiler/coco.cjs +1 -1
- package/dist/compiler/coco.js +1 -1
- package/dist/compiler/context.cjs +25 -0
- package/dist/compiler/context.d.ts +28 -0
- package/dist/compiler/context.js +8 -0
- package/dist/compiler/domain-block-utils.cjs +155 -152
- package/dist/compiler/domain-block-utils.js +7 -4
- package/dist/compiler/dtdl.cjs +10 -7
- package/dist/compiler/dtdl.js +7 -4
- package/dist/compiler/gltf-pipeline.cjs +9 -9
- package/dist/compiler/gltf-pipeline.js +2 -2
- package/dist/compiler/godot.cjs +9 -6
- package/dist/compiler/godot.js +8 -5
- package/dist/compiler/incremental.cjs +12 -7
- package/dist/compiler/incremental.js +7 -2
- package/dist/compiler/index.cjs +3550 -268
- package/dist/compiler/index.d.ts +404 -21
- package/dist/compiler/index.js +3280 -138
- package/dist/compiler/ios.cjs +11 -8
- package/dist/compiler/ios.js +9 -6
- package/dist/compiler/llm-provider-capabilities.cjs +25 -0
- package/dist/compiler/llm-provider-capabilities.d.ts +43 -0
- package/dist/compiler/llm-provider-capabilities.js +8 -0
- package/dist/compiler/multi-layer.cjs +14 -10
- package/dist/compiler/multi-layer.js +13 -9
- package/dist/compiler/nodetoy.cjs +5 -5
- package/dist/compiler/nodetoy.js +2 -2
- package/dist/compiler/openxr.cjs +10 -6
- package/dist/compiler/openxr.js +9 -5
- package/dist/compiler/playcanvas.cjs +10 -7
- package/dist/compiler/playcanvas.js +9 -6
- package/dist/compiler/r3f.cjs +17 -13
- package/dist/compiler/r3f.d.ts +22 -0
- package/dist/compiler/r3f.js +12 -8
- package/dist/compiler/remotion.cjs +1 -1
- package/dist/compiler/remotion.js +1 -1
- package/dist/compiler/reproducibility.cjs +1 -1
- package/dist/compiler/reproducibility.js +1 -1
- package/dist/compiler/sdf.cjs +10 -7
- package/dist/compiler/sdf.js +8 -5
- package/dist/compiler/semantic-scene.cjs +1 -1
- package/dist/compiler/semantic-scene.js +1 -1
- package/dist/compiler/state.cjs +9 -5
- package/dist/compiler/state.js +7 -3
- package/dist/compiler/trait-composition.cjs +11 -7
- package/dist/compiler/trait-composition.js +7 -3
- package/dist/compiler/unity.cjs +10 -6
- package/dist/compiler/unity.js +9 -5
- package/dist/compiler/unreal.cjs +11 -7
- package/dist/compiler/unreal.js +9 -5
- package/dist/compiler/urdf.cjs +20 -13
- package/dist/compiler/urdf.js +8 -5
- package/dist/compiler/usd-physics.cjs +10 -7
- package/dist/compiler/usd-physics.js +7 -4
- package/dist/compiler/visionos.cjs +10 -6
- package/dist/compiler/visionos.js +9 -5
- package/dist/compiler/vrchat.cjs +10 -7
- package/dist/compiler/vrchat.js +8 -5
- package/dist/compiler/vrr.cjs +10 -7
- package/dist/compiler/vrr.js +8 -5
- package/dist/compiler/wasm.cjs +13 -10
- package/dist/compiler/wasm.js +8 -5
- package/dist/compiler/webgpu.cjs +9 -6
- package/dist/compiler/webgpu.js +8 -5
- package/dist/constants.d.ts +3 -2
- package/dist/coordinators/index.cjs +1266 -0
- package/dist/coordinators/index.d.ts +260 -0
- package/dist/coordinators/index.js +1259 -0
- package/dist/debugger.cjs +9 -7
- package/dist/debugger.js +7 -5
- package/dist/entries/interop.cjs +23 -21
- package/dist/entries/interop.js +5 -3
- package/dist/entries/scripting.cjs +18 -18
- package/dist/entries/scripting.js +8 -8
- package/dist/hololand/index.cjs +146 -0
- package/dist/hololand/index.d.ts +70 -0
- package/dist/hololand/index.js +5 -0
- package/dist/index.cjs +20332 -18121
- package/dist/index.d.ts +1477 -40
- package/dist/index.js +19451 -17638
- package/dist/math/tropical-spmv.cjs +45 -0
- package/dist/math/tropical-spmv.js +4 -0
- package/dist/math/vec3.cjs +14 -14
- package/dist/math/vec3.js +2 -2
- package/dist/{ml-dsa-PHCWUBPX.cjs → ml-dsa-FSKBTE3W.cjs} +177 -90
- package/dist/{ml-dsa-WYLJHJO6.js → ml-dsa-Z7JDKW4L.js} +158 -71
- package/dist/paper-0c-spike/index.cjs +150 -0
- package/dist/paper-0c-spike/index.d.ts +29 -0
- package/dist/paper-0c-spike/index.js +141 -0
- package/dist/parser.cjs +45 -11
- package/dist/parser.d.ts +11 -0
- package/dist/parser.js +10 -8
- package/dist/{playwright-RL6GY4F7.cjs → playwright-3AT3AKTV.cjs} +1985 -1985
- package/dist/{playwright-5OSAPTNH.js → playwright-VZPDVUEQ.js} +3 -3
- package/dist/reconstruction/index.cjs +153 -0
- package/dist/reconstruction/index.d.ts +105 -0
- package/dist/reconstruction/index.js +8 -0
- package/dist/runtime.cjs +7 -5
- package/dist/runtime.js +6 -4
- package/dist/self-improvement/index.cjs +563 -0
- package/dist/self-improvement/index.js +545 -0
- package/dist/storage/index.cjs +10 -9
- package/dist/storage/index.js +3 -2
- package/dist/testing.cjs +25 -0
- package/dist/testing.d.ts +70 -0
- package/dist/testing.js +4 -0
- package/dist/tools/index.d.ts +22 -1
- package/dist/traitDocs/traitDocs.cjs +33 -0
- package/dist/traitDocs/traitDocs.d.ts +69 -0
- package/dist/traitDocs/traitDocs.js +7 -0
- package/dist/traits/botanical-lotus.cjs +41 -0
- package/dist/traits/botanical-lotus.d.ts +172 -0
- package/dist/traits/botanical-lotus.js +4 -0
- package/dist/traits/engines/index.cjs +520 -0
- package/dist/traits/engines/index.js +380 -0
- package/dist/traits/index.cjs +17630 -7881
- package/dist/traits/index.d.ts +197 -0
- package/dist/traits/index.js +16573 -7193
- package/dist/traits/simulation-solver-factory.cjs +13 -0
- package/dist/traits/simulation-solver-factory.d.ts +23 -0
- package/dist/traits/simulation-solver-factory.js +4 -0
- package/dist/traits/webcam-gaze.cjs +35 -0
- package/dist/traits/webcam-gaze.d.ts +17 -0
- package/dist/traits/webcam-gaze.js +4 -0
- package/dist/type-checker.cjs +6 -5
- package/dist/type-checker.js +4 -3
- package/dist/world/index.cjs +947 -0
- package/dist/world/index.d.ts +147 -0
- package/dist/world/index.js +939 -0
- package/dist/world-model/index.cjs +1446 -0
- package/dist/world-model/index.d.ts +119 -0
- package/dist/world-model/index.js +1414 -0
- package/dist/wot/index.cjs +29 -0
- package/dist/wot/index.js +4 -0
- package/package.json +153 -61
- package/dist/GLTFPipeline-DEN36VNK.js +0 -12
- package/dist/GLTFPipeline-YPCAK236.cjs +0 -33
- package/dist/chunk-4XSNJCLC.cjs +0 -1859
- package/dist/chunk-A7PIMZGU.js +0 -263
- package/dist/chunk-BWFJEM5A.js +0 -5419
- package/dist/chunk-CBJSLA2E.cjs +0 -5423
- package/dist/chunk-K3JDKWGI.cjs +0 -270
- package/dist/chunk-LSW7P7ML.js +0 -3675
- package/dist/chunk-MEASWI2Y.js +0 -126
- package/dist/chunk-NCUKG4SK.cjs +0 -3075
- package/dist/chunk-Q5JT3YML.cjs +0 -129
- package/dist/chunk-QGKNANZ3.js +0 -3071
- package/dist/chunk-S2N5TNMA.js +0 -1855
- package/dist/chunk-TSH3MSQU.cjs +0 -129
- package/dist/chunk-WGMEAYBG.js +0 -126
- package/dist/chunk-X6SEAXAX.cjs +0 -3681
|
@@ -1,22 +1,660 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
var
|
|
5
|
-
var
|
|
6
|
-
var
|
|
7
|
-
var
|
|
3
|
+
var chunkBPICAGBV_cjs = require('./chunk-BPICAGBV.cjs');
|
|
4
|
+
var chunk5S7RKFGR_cjs = require('./chunk-5S7RKFGR.cjs');
|
|
5
|
+
var chunkOIQYIIO3_cjs = require('./chunk-OIQYIIO3.cjs');
|
|
6
|
+
var chunkAIA52I7T_cjs = require('./chunk-AIA52I7T.cjs');
|
|
7
|
+
var chunkHGVXZDSK_cjs = require('./chunk-HGVXZDSK.cjs');
|
|
8
|
+
var chunkRMHC2VG7_cjs = require('./chunk-RMHC2VG7.cjs');
|
|
9
|
+
var chunkKKFZ3B6J_cjs = require('./chunk-KKFZ3B6J.cjs');
|
|
10
|
+
var chunkHCCQLAA4_cjs = require('./chunk-HCCQLAA4.cjs');
|
|
11
|
+
var ans = require('@holoscript/core-types/ans');
|
|
12
|
+
|
|
13
|
+
// src/compiler/ThreeJSCompiler.ts
|
|
14
|
+
var ThreeJSCompiler_exports = {};
|
|
15
|
+
chunkHCCQLAA4_cjs.__export(ThreeJSCompiler_exports, {
|
|
16
|
+
ThreeJSCompiler: () => exports.ThreeJSCompiler
|
|
17
|
+
});
|
|
18
|
+
var SHAPE_TO_THREE_GEOMETRY; exports.ThreeJSCompiler = void 0;
|
|
19
|
+
var init_ThreeJSCompiler = chunkHCCQLAA4_cjs.__esm({
|
|
20
|
+
"src/compiler/ThreeJSCompiler.ts"() {
|
|
21
|
+
chunkOIQYIIO3_cjs.init_TraitCompositor();
|
|
22
|
+
chunk5S7RKFGR_cjs.init_ProvenanceSemiring();
|
|
23
|
+
chunkRMHC2VG7_cjs.init_CompilerBase();
|
|
24
|
+
SHAPE_TO_THREE_GEOMETRY = {
|
|
25
|
+
sphere: "SphereGeometry",
|
|
26
|
+
orb: "SphereGeometry",
|
|
27
|
+
cube: "BoxGeometry",
|
|
28
|
+
box: "BoxGeometry",
|
|
29
|
+
cylinder: "CylinderGeometry",
|
|
30
|
+
cone: "ConeGeometry",
|
|
31
|
+
pyramid: "ConeGeometry",
|
|
32
|
+
plane: "PlaneGeometry",
|
|
33
|
+
ground: "PlaneGeometry",
|
|
34
|
+
torus: "TorusGeometry",
|
|
35
|
+
ring: "TorusGeometry",
|
|
36
|
+
capsule: "CapsuleGeometry"
|
|
37
|
+
};
|
|
38
|
+
exports.ThreeJSCompiler = class extends chunkRMHC2VG7_cjs.CompilerBase {
|
|
39
|
+
constructor(options = {}) {
|
|
40
|
+
super();
|
|
41
|
+
this.compilerName = "ThreeJSCompiler";
|
|
42
|
+
this.lines = [];
|
|
43
|
+
this.indentLevel = 0;
|
|
44
|
+
this.options = {
|
|
45
|
+
className: options.className ?? "GeneratedScene",
|
|
46
|
+
enableShadows: options.enableShadows ?? true,
|
|
47
|
+
enablePostProcessing: options.enablePostProcessing ?? false,
|
|
48
|
+
indent: options.indent ?? " ",
|
|
49
|
+
provenanceHash: options.provenanceHash ?? ""
|
|
50
|
+
};
|
|
51
|
+
}
|
|
52
|
+
getRequiredCapability() {
|
|
53
|
+
return ans.ANSCapabilityPath.R3F;
|
|
54
|
+
}
|
|
55
|
+
compile(composition, agentToken, outputPath) {
|
|
56
|
+
this.validateCompilerAccess(agentToken, outputPath);
|
|
57
|
+
this.lines = [];
|
|
58
|
+
this.indentLevel = 0;
|
|
59
|
+
this.emit("// Auto-generated by HoloScript ThreeJSCompiler");
|
|
60
|
+
this.emit(
|
|
61
|
+
`// Source: composition "${this.escapeStringValue(composition.name, "TypeScript")}"`
|
|
62
|
+
);
|
|
63
|
+
if (this.options.provenanceHash) {
|
|
64
|
+
this.emit(`// Provenance Hash: ${this.options.provenanceHash}`);
|
|
65
|
+
}
|
|
66
|
+
this.emit("");
|
|
67
|
+
this.emitImports(composition);
|
|
68
|
+
this.emit("");
|
|
69
|
+
this.emit(`export class ${this.options.className} {`);
|
|
70
|
+
this.indent();
|
|
71
|
+
this.emit("private scene: THREE.Scene;");
|
|
72
|
+
this.emit("private renderer: THREE.WebGLRenderer;");
|
|
73
|
+
this.emit("private camera: THREE.PerspectiveCamera;");
|
|
74
|
+
this.emit("private canvas: HTMLCanvasElement;");
|
|
75
|
+
this.emit("private frameId: number = 0;");
|
|
76
|
+
this.emit("");
|
|
77
|
+
this.emit("constructor(canvas: HTMLCanvasElement) {");
|
|
78
|
+
this.indent();
|
|
79
|
+
this.emit("this.canvas = canvas;");
|
|
80
|
+
this.emit("this.scene = new THREE.Scene();");
|
|
81
|
+
this.emit(
|
|
82
|
+
"this.renderer = new THREE.WebGLRenderer({ canvas, antialias: true, alpha: false });"
|
|
83
|
+
);
|
|
84
|
+
this.emit("this.renderer.setPixelRatio(window.devicePixelRatio);");
|
|
85
|
+
this.emit("this.renderer.setSize(canvas.clientWidth, canvas.clientHeight);");
|
|
86
|
+
if (this.options.enableShadows) {
|
|
87
|
+
this.emit("this.renderer.shadowMap.enabled = true;");
|
|
88
|
+
this.emit("this.renderer.shadowMap.type = THREE.PCFSoftShadowMap;");
|
|
89
|
+
}
|
|
90
|
+
this.emit(
|
|
91
|
+
"this.camera = new THREE.PerspectiveCamera(75, canvas.clientWidth / canvas.clientHeight, 0.1, 1000);"
|
|
92
|
+
);
|
|
93
|
+
this.emit("this.camera.position.set(0, 2, 10);");
|
|
94
|
+
this.dedent();
|
|
95
|
+
this.emit("}");
|
|
96
|
+
this.emit("");
|
|
97
|
+
this.emit("async build(): Promise<void> {");
|
|
98
|
+
this.indent();
|
|
99
|
+
if (composition.environment) this.emitEnvironment(composition.environment);
|
|
100
|
+
if (composition.lights?.length) {
|
|
101
|
+
for (const light of composition.lights) this.emitLight(light);
|
|
102
|
+
} else {
|
|
103
|
+
this.emit("// Default lighting");
|
|
104
|
+
this.emit("const ambientLight = new THREE.AmbientLight(0xffffff, 0.6);");
|
|
105
|
+
this.emit("this.scene.add(ambientLight);");
|
|
106
|
+
this.emit("const dirLight = new THREE.DirectionalLight(0xffffff, 0.8);");
|
|
107
|
+
this.emit("dirLight.position.set(5, 10, 5);");
|
|
108
|
+
if (this.options.enableShadows) {
|
|
109
|
+
this.emit("dirLight.castShadow = true;");
|
|
110
|
+
this.emit("dirLight.shadow.mapSize.set(2048, 2048);");
|
|
111
|
+
}
|
|
112
|
+
this.emit("this.scene.add(dirLight);");
|
|
113
|
+
this.emit("");
|
|
114
|
+
}
|
|
115
|
+
if (composition.camera) this.emitCamera(composition.camera);
|
|
116
|
+
if (composition.objects?.length) {
|
|
117
|
+
for (const obj of composition.objects) this.emitObject(obj);
|
|
118
|
+
}
|
|
119
|
+
if (composition.spatialGroups?.length) {
|
|
120
|
+
for (const g of composition.spatialGroups) this.emitGroup(g);
|
|
121
|
+
}
|
|
122
|
+
if (composition.zones?.length) {
|
|
123
|
+
for (const z of composition.zones) this.emitZone(z);
|
|
124
|
+
}
|
|
125
|
+
if (composition.audio?.length) {
|
|
126
|
+
for (const a of composition.audio) this.emitAudio(a);
|
|
127
|
+
}
|
|
128
|
+
this.emitRenderLoop();
|
|
129
|
+
this.dedent();
|
|
130
|
+
this.emit("}");
|
|
131
|
+
this.emit("");
|
|
132
|
+
this.emit("dispose(): void {");
|
|
133
|
+
this.indent();
|
|
134
|
+
this.emit("cancelAnimationFrame(this.frameId);");
|
|
135
|
+
this.emit("this.renderer.dispose();");
|
|
136
|
+
this.emit("this.scene.clear();");
|
|
137
|
+
this.dedent();
|
|
138
|
+
this.emit("}");
|
|
139
|
+
this.dedent();
|
|
140
|
+
this.emit("}");
|
|
141
|
+
return this.lines.join("\n");
|
|
142
|
+
}
|
|
143
|
+
// --- Imports ---
|
|
144
|
+
emitImports(_composition) {
|
|
145
|
+
this.emit('import * as THREE from "three";');
|
|
146
|
+
if (this.options.enablePostProcessing) {
|
|
147
|
+
this.emit('import { EffectComposer } from "three/addons/postprocessing/EffectComposer.js";');
|
|
148
|
+
this.emit(
|
|
149
|
+
'import { RenderPass } from "three/addons/postprocessing/RenderPass.js";'
|
|
150
|
+
);
|
|
151
|
+
this.emit(
|
|
152
|
+
'import { UnrealBloomPass } from "three/addons/postprocessing/UnrealBloomPass.js";'
|
|
153
|
+
);
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
// --- Environment ---
|
|
157
|
+
emitEnvironment(env) {
|
|
158
|
+
for (const prop of env.properties) {
|
|
159
|
+
if (prop.key === "background" || prop.key === "skybox" || prop.key === "preset") {
|
|
160
|
+
if (typeof prop.value === "string" && prop.value.startsWith("#")) {
|
|
161
|
+
this.emit(`this.scene.background = new THREE.Color(${this.toThreeColorHex(prop.value)});`);
|
|
162
|
+
} else {
|
|
163
|
+
this.emit(`// skybox: "${prop.value}" \u2014 load via THREE.CubeTextureLoader`);
|
|
164
|
+
}
|
|
165
|
+
} else if (prop.key === "fog" && typeof prop.value === "object") {
|
|
166
|
+
const fog = prop.value;
|
|
167
|
+
const near = fog.near ?? 10;
|
|
168
|
+
const far = fog.far ?? 100;
|
|
169
|
+
const color = this.toThreeColorHex(fog.color ?? "#cccccc");
|
|
170
|
+
this.emit(`this.scene.fog = new THREE.Fog(${color}, ${near}, ${far});`);
|
|
171
|
+
} else if (prop.key === "ambient_light") {
|
|
172
|
+
this.emit(
|
|
173
|
+
`this.scene.add(new THREE.AmbientLight(0xffffff, ${prop.value ?? 0.5}));`
|
|
174
|
+
);
|
|
175
|
+
} else if (prop.key === "ground") {
|
|
176
|
+
this.emit(
|
|
177
|
+
`const groundGeom = new THREE.PlaneGeometry(100, 100);`
|
|
178
|
+
);
|
|
179
|
+
this.emit(
|
|
180
|
+
`const groundMat = new THREE.MeshStandardMaterial({ color: 0x888888, roughness: 0.8 });`
|
|
181
|
+
);
|
|
182
|
+
this.emit(`const ground = new THREE.Mesh(groundGeom, groundMat);`);
|
|
183
|
+
this.emit(`ground.rotation.x = -Math.PI / 2;`);
|
|
184
|
+
if (this.options.enableShadows) {
|
|
185
|
+
this.emit(`ground.receiveShadow = true;`);
|
|
186
|
+
}
|
|
187
|
+
this.emit(`this.scene.add(ground);`);
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
this.emit("");
|
|
191
|
+
}
|
|
192
|
+
// --- Objects ---
|
|
193
|
+
emitObject(obj, parentVar) {
|
|
194
|
+
const v = this.sanitizeName(obj.name);
|
|
195
|
+
let geom = "cube";
|
|
196
|
+
let modelSrc;
|
|
197
|
+
let textContent;
|
|
198
|
+
let position;
|
|
199
|
+
let rotation;
|
|
200
|
+
let scale;
|
|
201
|
+
let size;
|
|
202
|
+
const mat = {};
|
|
203
|
+
for (const p of obj.properties) {
|
|
204
|
+
switch (p.key) {
|
|
205
|
+
case "geometry":
|
|
206
|
+
case "mesh":
|
|
207
|
+
case "type":
|
|
208
|
+
if (typeof p.value === "string") geom = p.value;
|
|
209
|
+
break;
|
|
210
|
+
case "position":
|
|
211
|
+
if (Array.isArray(p.value)) position = p.value;
|
|
212
|
+
break;
|
|
213
|
+
case "rotation":
|
|
214
|
+
if (Array.isArray(p.value)) rotation = p.value;
|
|
215
|
+
break;
|
|
216
|
+
case "scale":
|
|
217
|
+
scale = p.value;
|
|
218
|
+
break;
|
|
219
|
+
case "size":
|
|
220
|
+
size = p.value;
|
|
221
|
+
break;
|
|
222
|
+
case "color":
|
|
223
|
+
mat.color = p.value;
|
|
224
|
+
break;
|
|
225
|
+
case "roughness":
|
|
226
|
+
mat.roughness = p.value;
|
|
227
|
+
break;
|
|
228
|
+
case "metalness":
|
|
229
|
+
case "metallic":
|
|
230
|
+
mat.metalness = p.value;
|
|
231
|
+
break;
|
|
232
|
+
case "opacity":
|
|
233
|
+
mat.opacity = p.value;
|
|
234
|
+
break;
|
|
235
|
+
case "emissive":
|
|
236
|
+
mat.emissive = p.value;
|
|
237
|
+
break;
|
|
238
|
+
case "emissive_intensity":
|
|
239
|
+
case "emissiveIntensity":
|
|
240
|
+
mat.emissiveIntensity = p.value;
|
|
241
|
+
break;
|
|
242
|
+
case "material":
|
|
243
|
+
if (typeof p.value === "object" && p.value !== null)
|
|
244
|
+
Object.assign(mat, p.value);
|
|
245
|
+
break;
|
|
246
|
+
case "model":
|
|
247
|
+
case "src":
|
|
248
|
+
case "source":
|
|
249
|
+
if (typeof p.value === "string") modelSrc = p.value;
|
|
250
|
+
break;
|
|
251
|
+
case "text":
|
|
252
|
+
if (typeof p.value === "string") textContent = p.value;
|
|
253
|
+
break;
|
|
254
|
+
}
|
|
255
|
+
}
|
|
256
|
+
this.emit(`// Object: ${this.escapeStringValue(obj.name, "TypeScript")}`);
|
|
257
|
+
if (modelSrc) {
|
|
258
|
+
this.emit(`// GLTFLoader required for model: "${modelSrc}"`);
|
|
259
|
+
this.emit(`// import { GLTFLoader } from "three/addons/loaders/GLTFLoader.js";`);
|
|
260
|
+
this.emit(`const ${v}Loader = new GLTFLoader();`);
|
|
261
|
+
this.emit(
|
|
262
|
+
`const ${v}Gltf = await new Promise<THREE.Group>((resolve, reject) => { ${v}Loader.load("${modelSrc}", (g) => resolve(g.scene), undefined, reject); });`
|
|
263
|
+
);
|
|
264
|
+
this.emit(`const ${v} = ${v}Gltf;`);
|
|
265
|
+
this.emit(`this.scene.add(${v});`);
|
|
266
|
+
} else if (geom === "text" || textContent) {
|
|
267
|
+
this.emit(`// Text geometry requires THREE.FontLoader / troika-three-text`);
|
|
268
|
+
this.emit(`const ${v}Geom = new THREE.PlaneGeometry(2, 0.5);`);
|
|
269
|
+
this.emit(
|
|
270
|
+
`const ${v}Mat = new THREE.MeshBasicMaterial({ color: 0xffffff, transparent: true });`
|
|
271
|
+
);
|
|
272
|
+
this.emit(`const ${v} = new THREE.Mesh(${v}Geom, ${v}Mat);`);
|
|
273
|
+
this.emit(`// Text content: "${textContent || ""}"`);
|
|
274
|
+
this.emit(`this.scene.add(${v});`);
|
|
275
|
+
} else {
|
|
276
|
+
const geomArgs = this.geometryArgs(geom, size);
|
|
277
|
+
const geomClass = SHAPE_TO_THREE_GEOMETRY[geom] ?? "BoxGeometry";
|
|
278
|
+
this.emit(`const ${v}Geom = new THREE.${geomClass}(${geomArgs});`);
|
|
279
|
+
const matProps = this.buildMaterialProps(mat);
|
|
280
|
+
this.emit(`const ${v}Mat = new THREE.MeshStandardMaterial({ ${matProps} });`);
|
|
281
|
+
this.emit(`const ${v} = new THREE.Mesh(${v}Geom, ${v}Mat);`);
|
|
282
|
+
this.emit(`this.scene.add(${v});`);
|
|
283
|
+
}
|
|
284
|
+
if (position)
|
|
285
|
+
this.emit(`${v}.position.set(${position[0]}, ${position[1]}, ${position[2]});`);
|
|
286
|
+
if (rotation)
|
|
287
|
+
this.emit(`${v}.rotation.set(${rotation[0]}, ${rotation[1]}, ${rotation[2]});`);
|
|
288
|
+
if (scale) {
|
|
289
|
+
if (Array.isArray(scale)) {
|
|
290
|
+
this.emit(`${v}.scale.set(${scale[0]}, ${scale[1]}, ${scale[2]});`);
|
|
291
|
+
} else {
|
|
292
|
+
this.emit(`${v}.scale.setScalar(${scale});`);
|
|
293
|
+
}
|
|
294
|
+
}
|
|
295
|
+
if (parentVar) this.emit(`${parentVar}.add(${v});`);
|
|
296
|
+
const physicsTraits = (obj.traits || []).filter(
|
|
297
|
+
(t) => t.name === "physics" || t.name === "collidable"
|
|
298
|
+
);
|
|
299
|
+
if (physicsTraits.length > 0) {
|
|
300
|
+
const semiring = new chunk5S7RKFGR_cjs.ProvenanceSemiring();
|
|
301
|
+
const applications = physicsTraits.map((t) => ({
|
|
302
|
+
name: t.name,
|
|
303
|
+
config: t.config || {},
|
|
304
|
+
context: obj.provenance?.context
|
|
305
|
+
}));
|
|
306
|
+
const { config: physicsConfig } = semiring.add(applications);
|
|
307
|
+
const isStatic = (physicsConfig.type || "dynamic") === "static";
|
|
308
|
+
this.emit(
|
|
309
|
+
`// @physics \u2014 mass: ${physicsConfig.mass ?? 1}, type: ${isStatic ? "static" : "dynamic"}`
|
|
310
|
+
);
|
|
311
|
+
this.emit(
|
|
312
|
+
`// Use a physics library (cannon-es, rapier, ammo.js) to attach a rigid body to ${v}`
|
|
313
|
+
);
|
|
314
|
+
}
|
|
315
|
+
for (const trait of obj.traits || []) {
|
|
316
|
+
if (trait.name === "physics" || trait.name === "collidable") {
|
|
317
|
+
continue;
|
|
318
|
+
} else if (trait.name === "shadow") {
|
|
319
|
+
if (this.options.enableShadows) {
|
|
320
|
+
this.emit(`${v}.castShadow = true;`);
|
|
321
|
+
this.emit(`${v}.receiveShadow = true;`);
|
|
322
|
+
}
|
|
323
|
+
} else if (trait.name === "grabbable") {
|
|
324
|
+
this.emit(`// @grabbable \u2014 attach raycaster pointer-down handler to ${v}`);
|
|
325
|
+
} else if (trait.name === "hoverable") {
|
|
326
|
+
this.emit(`// @hoverable \u2014 attach raycaster pointer-move handler to ${v}`);
|
|
327
|
+
} else if (trait.name === "gaussian_splat") {
|
|
328
|
+
this.emit(
|
|
329
|
+
`// @gaussian_splat \u2014 use @mkkellogg/gaussian-splats-3d or three-splat for ${v}`
|
|
330
|
+
);
|
|
331
|
+
} else if (trait.name === "object_tracking") {
|
|
332
|
+
this.emit(`// @object_tracking \u2014 WebXR hit-test for ${v}`);
|
|
333
|
+
} else if (trait.name === "eye_tracked") {
|
|
334
|
+
this.emit(`// @eye_tracked \u2014 WebXR eye tracking for ${v}`);
|
|
335
|
+
} else if (trait.name === "controlnet") {
|
|
336
|
+
this.emit(
|
|
337
|
+
`// @controlnet(model: "${trait.config?.model || "canny"}") \u2014 route to inference API for ${v}`
|
|
338
|
+
);
|
|
339
|
+
} else {
|
|
340
|
+
this.emit(
|
|
341
|
+
`// @${this.escapeStringValue(trait.name, "TypeScript")}: ${JSON.stringify(trait.config || {})}`
|
|
342
|
+
);
|
|
343
|
+
}
|
|
344
|
+
}
|
|
345
|
+
if (obj.traits && obj.traits.length > 0) {
|
|
346
|
+
const traitNames = obj.traits.map((t) => t.name);
|
|
347
|
+
const compositor = new chunkOIQYIIO3_cjs.TraitCompositor();
|
|
348
|
+
const composed = compositor.compose(traitNames);
|
|
349
|
+
if (Object.keys(composed).length > 0) {
|
|
350
|
+
this.emit(`// TraitCompositor: composed ${traitNames.join(" + ")}`);
|
|
351
|
+
const composedProps = this.buildMaterialProps(composed);
|
|
352
|
+
if (composedProps) {
|
|
353
|
+
this.emit(
|
|
354
|
+
`Object.assign((${v}.material as THREE.MeshStandardMaterial), { ${composedProps} });`
|
|
355
|
+
);
|
|
356
|
+
}
|
|
357
|
+
}
|
|
358
|
+
}
|
|
359
|
+
if (obj.children?.length) {
|
|
360
|
+
for (const child of obj.children) this.emitObject(child, v);
|
|
361
|
+
}
|
|
362
|
+
this.emit("");
|
|
363
|
+
}
|
|
364
|
+
// --- Groups ---
|
|
365
|
+
emitGroup(group, parentVar) {
|
|
366
|
+
const v = this.sanitizeName(group.name);
|
|
367
|
+
this.emit(
|
|
368
|
+
`const ${v} = new THREE.Group(); // "${this.escapeStringValue(group.name, "TypeScript")}"`
|
|
369
|
+
);
|
|
370
|
+
for (const p of group.properties) {
|
|
371
|
+
if (p.key === "position" && Array.isArray(p.value))
|
|
372
|
+
this.emit(`${v}.position.set(${p.value[0]}, ${p.value[1]}, ${p.value[2]});`);
|
|
373
|
+
else if (p.key === "rotation" && Array.isArray(p.value))
|
|
374
|
+
this.emit(`${v}.rotation.set(${p.value[0]}, ${p.value[1]}, ${p.value[2]});`);
|
|
375
|
+
else if (p.key === "scale") {
|
|
376
|
+
if (Array.isArray(p.value)) {
|
|
377
|
+
this.emit(`${v}.scale.set(${p.value[0]}, ${p.value[1]}, ${p.value[2]});`);
|
|
378
|
+
} else {
|
|
379
|
+
this.emit(`${v}.scale.setScalar(${p.value});`);
|
|
380
|
+
}
|
|
381
|
+
}
|
|
382
|
+
}
|
|
383
|
+
const addTarget = parentVar ? parentVar : "this.scene";
|
|
384
|
+
this.emit(`${addTarget}.add(${v});`);
|
|
385
|
+
for (const obj of group.objects) this.emitObject(obj, v);
|
|
386
|
+
if (group.groups) {
|
|
387
|
+
for (const sub of group.groups) this.emitGroup(sub, v);
|
|
388
|
+
}
|
|
389
|
+
this.emit("");
|
|
390
|
+
}
|
|
391
|
+
// --- Lights ---
|
|
392
|
+
emitLight(light) {
|
|
393
|
+
const v = this.sanitizeName(light.name);
|
|
394
|
+
let position;
|
|
395
|
+
let color;
|
|
396
|
+
let intensity;
|
|
397
|
+
let direction;
|
|
398
|
+
let castShadow = false;
|
|
399
|
+
let angle;
|
|
400
|
+
let distance;
|
|
401
|
+
let penumbra;
|
|
402
|
+
for (const p of light.properties) {
|
|
403
|
+
if (p.key === "position" && Array.isArray(p.value)) position = p.value;
|
|
404
|
+
else if (p.key === "color") color = p.value;
|
|
405
|
+
else if (p.key === "intensity") intensity = p.value;
|
|
406
|
+
else if (p.key === "direction" && Array.isArray(p.value)) direction = p.value;
|
|
407
|
+
else if (p.key === "cast_shadow" || p.key === "castShadow") castShadow = !!p.value;
|
|
408
|
+
else if (p.key === "angle") angle = p.value;
|
|
409
|
+
else if (p.key === "distance") distance = p.value;
|
|
410
|
+
else if (p.key === "penumbra") penumbra = p.value;
|
|
411
|
+
}
|
|
412
|
+
const colorHex = this.toThreeColorHex(color ?? "#ffffff");
|
|
413
|
+
const intStr = intensity !== void 0 ? String(intensity) : "1.0";
|
|
414
|
+
switch (light.lightType) {
|
|
415
|
+
case "hemisphere":
|
|
416
|
+
case "ambient":
|
|
417
|
+
this.emit(`const ${v} = new THREE.AmbientLight(${colorHex}, ${intStr});`);
|
|
418
|
+
this.emit(`this.scene.add(${v});`);
|
|
419
|
+
break;
|
|
420
|
+
case "directional": {
|
|
421
|
+
this.emit(`const ${v} = new THREE.DirectionalLight(${colorHex}, ${intStr});`);
|
|
422
|
+
const pos = position ?? direction ?? [5, 10, 5];
|
|
423
|
+
this.emit(`${v}.position.set(${pos[0]}, ${pos[1]}, ${pos[2]});`);
|
|
424
|
+
if (castShadow && this.options.enableShadows) {
|
|
425
|
+
this.emit(`${v}.castShadow = true;`);
|
|
426
|
+
this.emit(`${v}.shadow.mapSize.set(2048, 2048);`);
|
|
427
|
+
this.emit(`${v}.shadow.camera.near = 0.1;`);
|
|
428
|
+
this.emit(`${v}.shadow.camera.far = 500;`);
|
|
429
|
+
}
|
|
430
|
+
this.emit(`this.scene.add(${v});`);
|
|
431
|
+
break;
|
|
432
|
+
}
|
|
433
|
+
case "point": {
|
|
434
|
+
const distStr = distance !== void 0 ? String(distance) : "0";
|
|
435
|
+
this.emit(
|
|
436
|
+
`const ${v} = new THREE.PointLight(${colorHex}, ${intStr}, ${distStr});`
|
|
437
|
+
);
|
|
438
|
+
if (position) this.emit(`${v}.position.set(${position[0]}, ${position[1]}, ${position[2]});`);
|
|
439
|
+
if (castShadow && this.options.enableShadows) this.emit(`${v}.castShadow = true;`);
|
|
440
|
+
this.emit(`this.scene.add(${v});`);
|
|
441
|
+
break;
|
|
442
|
+
}
|
|
443
|
+
case "spot": {
|
|
444
|
+
const angleRad = angle !== void 0 ? `${angle} * Math.PI / 180` : "Math.PI / 6";
|
|
445
|
+
const pen = penumbra ?? 0.1;
|
|
446
|
+
this.emit(
|
|
447
|
+
`const ${v} = new THREE.SpotLight(${colorHex}, ${intStr}, ${distance ?? 0}, ${angleRad}, ${pen});`
|
|
448
|
+
);
|
|
449
|
+
if (position) this.emit(`${v}.position.set(${position[0]}, ${position[1]}, ${position[2]});`);
|
|
450
|
+
if (castShadow && this.options.enableShadows) this.emit(`${v}.castShadow = true;`);
|
|
451
|
+
this.emit(`this.scene.add(${v});`);
|
|
452
|
+
break;
|
|
453
|
+
}
|
|
454
|
+
default:
|
|
455
|
+
this.emit(`// Light "${light.lightType}" not mapped \u2014 using AmbientLight fallback`);
|
|
456
|
+
this.emit(`const ${v} = new THREE.AmbientLight(${colorHex}, ${intStr});`);
|
|
457
|
+
this.emit(`this.scene.add(${v});`);
|
|
458
|
+
}
|
|
459
|
+
this.emit("");
|
|
460
|
+
}
|
|
461
|
+
// --- Camera ---
|
|
462
|
+
emitCamera(camera) {
|
|
463
|
+
let position;
|
|
464
|
+
let target;
|
|
465
|
+
let fov;
|
|
466
|
+
let near;
|
|
467
|
+
let far;
|
|
468
|
+
for (const p of camera.properties) {
|
|
469
|
+
if (p.key === "position" && Array.isArray(p.value)) position = p.value;
|
|
470
|
+
else if (p.key === "target" && Array.isArray(p.value)) target = p.value;
|
|
471
|
+
else if (p.key === "fov") fov = p.value;
|
|
472
|
+
else if (p.key === "near") near = p.value;
|
|
473
|
+
else if (p.key === "far") far = p.value;
|
|
474
|
+
}
|
|
475
|
+
if (fov !== void 0) this.emit(`this.camera.fov = ${fov};`);
|
|
476
|
+
if (near !== void 0) this.emit(`this.camera.near = ${near};`);
|
|
477
|
+
if (far !== void 0) this.emit(`this.camera.far = ${far};`);
|
|
478
|
+
if (position)
|
|
479
|
+
this.emit(
|
|
480
|
+
`this.camera.position.set(${position[0]}, ${position[1]}, ${position[2]});`
|
|
481
|
+
);
|
|
482
|
+
if (target) {
|
|
483
|
+
this.emit(
|
|
484
|
+
`this.camera.lookAt(new THREE.Vector3(${target[0]}, ${target[1]}, ${target[2]}));`
|
|
485
|
+
);
|
|
486
|
+
}
|
|
487
|
+
this.emit(`this.camera.updateProjectionMatrix();`);
|
|
488
|
+
this.emit("");
|
|
489
|
+
}
|
|
490
|
+
// --- Audio ---
|
|
491
|
+
emitAudio(audio) {
|
|
492
|
+
const v = this.sanitizeName(audio.name);
|
|
493
|
+
let src = "";
|
|
494
|
+
let loop = false;
|
|
495
|
+
let volume = 1;
|
|
496
|
+
let spatial = false;
|
|
497
|
+
for (const p of audio.properties) {
|
|
498
|
+
if (p.key === "src" || p.key === "source") src = String(p.value);
|
|
499
|
+
else if (p.key === "loop") loop = !!p.value;
|
|
500
|
+
else if (p.key === "volume") volume = p.value;
|
|
501
|
+
else if (p.key === "spatial") spatial = !!p.value;
|
|
502
|
+
}
|
|
503
|
+
if (spatial) {
|
|
504
|
+
this.emit(`const ${v}Listener = new THREE.AudioListener();`);
|
|
505
|
+
this.emit(`this.camera.add(${v}Listener);`);
|
|
506
|
+
this.emit(`const ${v} = new THREE.PositionalAudio(${v}Listener);`);
|
|
507
|
+
} else {
|
|
508
|
+
this.emit(`const ${v}Listener = new THREE.AudioListener();`);
|
|
509
|
+
this.emit(`this.camera.add(${v}Listener);`);
|
|
510
|
+
this.emit(`const ${v} = new THREE.Audio(${v}Listener);`);
|
|
511
|
+
}
|
|
512
|
+
this.emit(`const ${v}Loader = new THREE.AudioLoader();`);
|
|
513
|
+
this.emit(
|
|
514
|
+
`${v}Loader.load("${src}", (buffer) => { ${v}.setBuffer(buffer); ${v}.setLoop(${loop}); ${v}.setVolume(${volume}); ${v}.play(); });`
|
|
515
|
+
);
|
|
516
|
+
this.emit("");
|
|
517
|
+
}
|
|
518
|
+
// --- Zones ---
|
|
519
|
+
emitZone(zone) {
|
|
520
|
+
const v = this.sanitizeName(zone.name);
|
|
521
|
+
let shape = "box";
|
|
522
|
+
let position;
|
|
523
|
+
let size;
|
|
524
|
+
let radius;
|
|
525
|
+
for (const p of zone.properties) {
|
|
526
|
+
if (p.key === "shape") shape = String(p.value);
|
|
527
|
+
else if (p.key === "position" && Array.isArray(p.value)) position = p.value;
|
|
528
|
+
else if (p.key === "size") size = p.value;
|
|
529
|
+
else if (p.key === "radius") radius = p.value;
|
|
530
|
+
}
|
|
531
|
+
if (shape === "sphere") {
|
|
532
|
+
this.emit(
|
|
533
|
+
`const ${v}Geom = new THREE.SphereGeometry(${radius ?? 5}, 16, 16);`
|
|
534
|
+
);
|
|
535
|
+
} else {
|
|
536
|
+
const s = Array.isArray(size) ? size : [size ?? 5, size ?? 5, size ?? 5];
|
|
537
|
+
this.emit(`const ${v}Geom = new THREE.BoxGeometry(${s[0]}, ${s[1]}, ${s[2]});`);
|
|
538
|
+
}
|
|
539
|
+
this.emit(
|
|
540
|
+
`const ${v}Mat = new THREE.MeshBasicMaterial({ color: 0x00ff00, wireframe: true, visible: false });`
|
|
541
|
+
);
|
|
542
|
+
this.emit(`const ${v} = new THREE.Mesh(${v}Geom, ${v}Mat);`);
|
|
543
|
+
if (position) this.emit(`${v}.position.set(${position[0]}, ${position[1]}, ${position[2]});`);
|
|
544
|
+
this.emit(`this.scene.add(${v}); // trigger zone (invisible)`);
|
|
545
|
+
if (zone.handlers?.length) {
|
|
546
|
+
this.emit(
|
|
547
|
+
`// Zone handlers: attach raycaster intersection checks for ${v}`
|
|
548
|
+
);
|
|
549
|
+
for (const h of zone.handlers) {
|
|
550
|
+
this.emit(
|
|
551
|
+
`// on ${this.escapeStringValue(h.event, "TypeScript")}: implement via raycaster.intersectObject(${v})`
|
|
552
|
+
);
|
|
553
|
+
}
|
|
554
|
+
}
|
|
555
|
+
this.emit("");
|
|
556
|
+
}
|
|
557
|
+
// --- Render Loop ---
|
|
558
|
+
emitRenderLoop() {
|
|
559
|
+
this.emit("// Render loop");
|
|
560
|
+
this.emit("const animate = (): void => {");
|
|
561
|
+
this.indent();
|
|
562
|
+
this.emit("this.frameId = requestAnimationFrame(animate);");
|
|
563
|
+
this.emit("this.renderer.render(this.scene, this.camera);");
|
|
564
|
+
this.dedent();
|
|
565
|
+
this.emit("};");
|
|
566
|
+
this.emit("animate();");
|
|
567
|
+
this.emit("");
|
|
568
|
+
this.emit("// Resize handler");
|
|
569
|
+
this.emit('window.addEventListener("resize", () => {');
|
|
570
|
+
this.indent();
|
|
571
|
+
this.emit("const w = this.canvas.clientWidth, h = this.canvas.clientHeight;");
|
|
572
|
+
this.emit("this.renderer.setSize(w, h);");
|
|
573
|
+
this.emit("this.camera.aspect = w / h;");
|
|
574
|
+
this.emit("this.camera.updateProjectionMatrix();");
|
|
575
|
+
this.dedent();
|
|
576
|
+
this.emit("});");
|
|
577
|
+
}
|
|
578
|
+
// --- Value Helpers ---
|
|
579
|
+
toThreeColorHex(value) {
|
|
580
|
+
if (typeof value === "string" && value.startsWith("#")) {
|
|
581
|
+
return `0x${value.slice(1)}`;
|
|
582
|
+
}
|
|
583
|
+
if (typeof value === "number") return `0x${value.toString(16).padStart(6, "0")}`;
|
|
584
|
+
return "0xffffff";
|
|
585
|
+
}
|
|
586
|
+
buildMaterialProps(mat) {
|
|
587
|
+
const parts = [];
|
|
588
|
+
if (mat.color !== void 0) {
|
|
589
|
+
parts.push(`color: ${this.toThreeColorHex(mat.color)}`);
|
|
590
|
+
}
|
|
591
|
+
if (mat.roughness !== void 0) parts.push(`roughness: ${mat.roughness}`);
|
|
592
|
+
if (mat.metalness !== void 0) parts.push(`metalness: ${mat.metalness}`);
|
|
593
|
+
if (mat.opacity !== void 0 && mat.opacity < 1) {
|
|
594
|
+
parts.push(`opacity: ${mat.opacity}`, "transparent: true");
|
|
595
|
+
}
|
|
596
|
+
if (mat.emissive !== void 0) {
|
|
597
|
+
parts.push(`emissive: ${this.toThreeColorHex(mat.emissive)}`);
|
|
598
|
+
}
|
|
599
|
+
if (mat.emissiveIntensity !== void 0) {
|
|
600
|
+
parts.push(`emissiveIntensity: ${mat.emissiveIntensity}`);
|
|
601
|
+
}
|
|
602
|
+
return parts.join(", ");
|
|
603
|
+
}
|
|
604
|
+
geometryArgs(type, size) {
|
|
605
|
+
const s = typeof size === "number" ? size : 1;
|
|
606
|
+
switch (type) {
|
|
607
|
+
case "sphere":
|
|
608
|
+
case "orb":
|
|
609
|
+
return `${s * 0.5}, 32, 32`;
|
|
610
|
+
case "cube":
|
|
611
|
+
case "box":
|
|
612
|
+
return `${s}, ${s}, ${s}`;
|
|
613
|
+
case "cylinder":
|
|
614
|
+
return `${s * 0.5}, ${s * 0.5}, ${s * 2}, 32`;
|
|
615
|
+
case "cone":
|
|
616
|
+
case "pyramid":
|
|
617
|
+
return `${s * 0.5}, ${s * 2}, ${type === "pyramid" ? 4 : 32}`;
|
|
618
|
+
case "plane":
|
|
619
|
+
case "ground":
|
|
620
|
+
return `${s}, ${s}`;
|
|
621
|
+
case "torus":
|
|
622
|
+
case "ring":
|
|
623
|
+
return `${s * 0.5}, ${s * 0.15}, 16, 64`;
|
|
624
|
+
case "capsule":
|
|
625
|
+
return `${s * 0.3}, ${s * 0.6}, 4, 16`;
|
|
626
|
+
default:
|
|
627
|
+
return `${s}, ${s}, ${s}`;
|
|
628
|
+
}
|
|
629
|
+
}
|
|
630
|
+
// --- Emit Helpers ---
|
|
631
|
+
emit(line) {
|
|
632
|
+
this.lines.push(this.options.indent.repeat(this.indentLevel) + line);
|
|
633
|
+
}
|
|
634
|
+
indent() {
|
|
635
|
+
this.indentLevel++;
|
|
636
|
+
}
|
|
637
|
+
dedent() {
|
|
638
|
+
this.indentLevel = Math.max(0, this.indentLevel - 1);
|
|
639
|
+
}
|
|
640
|
+
sanitizeName(name) {
|
|
641
|
+
return name.replace(/[^a-zA-Z0-9_]/g, "_");
|
|
642
|
+
}
|
|
643
|
+
};
|
|
644
|
+
}
|
|
645
|
+
});
|
|
8
646
|
|
|
9
647
|
// src/compiler/A2AAgentCardCompiler.ts
|
|
10
648
|
var A2AAgentCardCompiler_exports = {};
|
|
11
|
-
|
|
649
|
+
chunkHCCQLAA4_cjs.__export(A2AAgentCardCompiler_exports, {
|
|
12
650
|
A2AAgentCardCompiler: () => exports.A2AAgentCardCompiler,
|
|
13
651
|
default: () => A2AAgentCardCompiler_default
|
|
14
652
|
});
|
|
15
653
|
exports.A2AAgentCardCompiler = void 0; var A2AAgentCardCompiler_default;
|
|
16
|
-
var init_A2AAgentCardCompiler =
|
|
654
|
+
var init_A2AAgentCardCompiler = chunkHCCQLAA4_cjs.__esm({
|
|
17
655
|
"src/compiler/A2AAgentCardCompiler.ts"() {
|
|
18
|
-
|
|
19
|
-
exports.A2AAgentCardCompiler = class extends
|
|
656
|
+
chunkRMHC2VG7_cjs.init_CompilerBase();
|
|
657
|
+
exports.A2AAgentCardCompiler = class extends chunkRMHC2VG7_cjs.CompilerBase {
|
|
20
658
|
constructor(options = {}) {
|
|
21
659
|
super();
|
|
22
660
|
this.compilerName = "A2AAgentCardCompiler";
|
|
@@ -41,7 +679,7 @@ var init_A2AAgentCardCompiler = chunk3SAK5KFL_cjs.__esm({
|
|
|
41
679
|
};
|
|
42
680
|
}
|
|
43
681
|
getRequiredCapability() {
|
|
44
|
-
return
|
|
682
|
+
return ans.ANSCapabilityPath.A2A_AGENT_CARD;
|
|
45
683
|
}
|
|
46
684
|
/**
|
|
47
685
|
* Compile a HoloComposition AST into an A2A Agent Card JSON string.
|
|
@@ -288,26 +926,10 @@ var init_A2AAgentCardCompiler = chunk3SAK5KFL_cjs.__esm({
|
|
|
288
926
|
* Compile a domain-specific block into a specialized skill.
|
|
289
927
|
*/
|
|
290
928
|
compileDomainBlockSkill(block) {
|
|
291
|
-
const domainTags = {
|
|
292
|
-
iot: ["iot", "sensor", "telemetry", "digital-twin"],
|
|
293
|
-
robotics: ["robotics", "control", "actuator", "simulation"],
|
|
294
|
-
dataviz: ["data-visualization", "analytics", "dashboard"],
|
|
295
|
-
education: ["education", "learning", "curriculum"],
|
|
296
|
-
healthcare: ["healthcare", "medical", "monitoring"],
|
|
297
|
-
music: ["music", "audio", "composition"],
|
|
298
|
-
architecture: ["architecture", "building", "design"],
|
|
299
|
-
web3: ["web3", "blockchain", "smart-contract"],
|
|
300
|
-
physics: ["physics", "simulation", "collision"],
|
|
301
|
-
material: ["material", "rendering", "pbr"],
|
|
302
|
-
vfx: ["vfx", "particles", "visual-effects"],
|
|
303
|
-
weather: ["weather", "atmosphere", "environmental"],
|
|
304
|
-
navigation: ["navigation", "pathfinding", "ai"],
|
|
305
|
-
procedural: ["procedural", "generation", "algorithms"]
|
|
306
|
-
};
|
|
307
929
|
const tags = [
|
|
308
930
|
block.domain,
|
|
309
931
|
block.keyword,
|
|
310
|
-
...domainTags
|
|
932
|
+
...block.domainTags?.length ? block.domainTags : [],
|
|
311
933
|
...block.traits
|
|
312
934
|
];
|
|
313
935
|
return {
|
|
@@ -572,7 +1194,7 @@ function validateNIRGraph(graph) {
|
|
|
572
1194
|
return { valid: errors.length === 0, errors };
|
|
573
1195
|
}
|
|
574
1196
|
var NEURON_TRAIT_MAP, SYNAPSE_TRAIT_MAP, ENCODING_TRAIT_MAP, TOPOLOGY_TRAIT_MAP, NIR_TRAIT_MAP;
|
|
575
|
-
var init_NIRTraitMap =
|
|
1197
|
+
var init_NIRTraitMap = chunkHCCQLAA4_cjs.__esm({
|
|
576
1198
|
"src/compiler/NIRTraitMap.ts"() {
|
|
577
1199
|
NEURON_TRAIT_MAP = {
|
|
578
1200
|
lif_neuron: {
|
|
@@ -1086,16 +1708,16 @@ var init_NIRTraitMap = chunk3SAK5KFL_cjs.__esm({
|
|
|
1086
1708
|
|
|
1087
1709
|
// src/compiler/NIRCompiler.ts
|
|
1088
1710
|
var NIRCompiler_exports = {};
|
|
1089
|
-
|
|
1711
|
+
chunkHCCQLAA4_cjs.__export(NIRCompiler_exports, {
|
|
1090
1712
|
NIRCompiler: () => exports.NIRCompiler,
|
|
1091
1713
|
default: () => NIRCompiler_default
|
|
1092
1714
|
});
|
|
1093
1715
|
exports.NIRCompiler = void 0; var NIRCompiler_default;
|
|
1094
|
-
var init_NIRCompiler =
|
|
1716
|
+
var init_NIRCompiler = chunkHCCQLAA4_cjs.__esm({
|
|
1095
1717
|
"src/compiler/NIRCompiler.ts"() {
|
|
1096
|
-
|
|
1718
|
+
chunkRMHC2VG7_cjs.init_CompilerBase();
|
|
1097
1719
|
init_NIRTraitMap();
|
|
1098
|
-
exports.NIRCompiler = class extends
|
|
1720
|
+
exports.NIRCompiler = class extends chunkRMHC2VG7_cjs.CompilerBase {
|
|
1099
1721
|
constructor(options = {}) {
|
|
1100
1722
|
super();
|
|
1101
1723
|
this.compilerName = "NIRCompiler";
|
|
@@ -1116,7 +1738,7 @@ var init_NIRCompiler = chunk3SAK5KFL_cjs.__esm({
|
|
|
1116
1738
|
};
|
|
1117
1739
|
}
|
|
1118
1740
|
getRequiredCapability() {
|
|
1119
|
-
return
|
|
1741
|
+
return ans.ANSCapabilityPath.NIR;
|
|
1120
1742
|
}
|
|
1121
1743
|
/**
|
|
1122
1744
|
* Compile a HoloScript composition to NIR graph JSON.
|
|
@@ -1440,695 +2062,21 @@ var init_NIRCompiler = chunk3SAK5KFL_cjs.__esm({
|
|
|
1440
2062
|
}
|
|
1441
2063
|
});
|
|
1442
2064
|
|
|
1443
|
-
// src/
|
|
1444
|
-
|
|
1445
|
-
|
|
1446
|
-
|
|
1447
|
-
|
|
1448
|
-
|
|
1449
|
-
const ch = line[i];
|
|
1450
|
-
if (inString) {
|
|
1451
|
-
if (ch === inString && line[i - 1] !== "\\") inString = null;
|
|
1452
|
-
} else if (ch === '"' || ch === "'") {
|
|
1453
|
-
inString = ch;
|
|
1454
|
-
} else if (ch === "/" && line[i + 1] === "/") {
|
|
1455
|
-
return line.substring(0, i);
|
|
1456
|
-
}
|
|
1457
|
-
}
|
|
1458
|
-
return line;
|
|
1459
|
-
}).join("\n");
|
|
1460
|
-
}
|
|
1461
|
-
function parseDuration(value) {
|
|
1462
|
-
const match = value.match(/^(\d+)(s|m|h|d)$/);
|
|
1463
|
-
if (!match) return void 0;
|
|
1464
|
-
return { value: parseInt(match[1], 10), unit: match[2] };
|
|
1465
|
-
}
|
|
1466
|
-
function extractBlock(source, keyword, name) {
|
|
1467
|
-
const results = [];
|
|
1468
|
-
const namePattern = "(\\w+)";
|
|
1469
|
-
const regex = new RegExp(`${keyword}\\s+${namePattern}\\s*\\{`, "g");
|
|
1470
|
-
let match;
|
|
1471
|
-
while ((match = regex.exec(source)) !== null) {
|
|
1472
|
-
const blockName = match[1];
|
|
1473
|
-
const startLine = source.substring(0, match.index).split("\n").length;
|
|
1474
|
-
const startIdx = source.indexOf("{", match.index);
|
|
1475
|
-
let depth = 1;
|
|
1476
|
-
let i = startIdx + 1;
|
|
1477
|
-
while (i < source.length && depth > 0) {
|
|
1478
|
-
if (source[i] === "{") depth++;
|
|
1479
|
-
if (source[i] === "}") depth--;
|
|
1480
|
-
i++;
|
|
1481
|
-
}
|
|
1482
|
-
results.push({
|
|
1483
|
-
content: source.substring(startIdx + 1, i - 1),
|
|
1484
|
-
name: blockName,
|
|
1485
|
-
startLine
|
|
1486
|
-
});
|
|
1487
|
-
}
|
|
1488
|
-
return results;
|
|
1489
|
-
}
|
|
1490
|
-
function parseProperties(content) {
|
|
1491
|
-
const props = {};
|
|
1492
|
-
const lines = content.split("\n");
|
|
1493
|
-
for (const line of lines) {
|
|
1494
|
-
const trimmed = line.trim();
|
|
1495
|
-
if (!trimmed || trimmed.startsWith("//")) continue;
|
|
1496
|
-
const kvMatch = trimmed.match(/^(\w+)\s*:\s+(.+)$/);
|
|
1497
|
-
if (kvMatch) {
|
|
1498
|
-
const key = kvMatch[1];
|
|
1499
|
-
let val = kvMatch[2].trim();
|
|
1500
|
-
if (typeof val === "string" && val.endsWith(",")) {
|
|
1501
|
-
val = val.slice(0, -1).trim();
|
|
1502
|
-
}
|
|
1503
|
-
if (typeof val === "string") {
|
|
1504
|
-
const strVal = val;
|
|
1505
|
-
if (strVal.startsWith('"') && strVal.endsWith('"')) {
|
|
1506
|
-
val = strVal.slice(1, -1);
|
|
1507
|
-
} else if (strVal.startsWith("'") && strVal.endsWith("'")) {
|
|
1508
|
-
val = strVal.slice(1, -1);
|
|
1509
|
-
} else if (strVal === "true") {
|
|
1510
|
-
val = true;
|
|
1511
|
-
} else if (strVal === "false") {
|
|
1512
|
-
val = false;
|
|
1513
|
-
} else if (/^\d+$/.test(strVal)) {
|
|
1514
|
-
val = parseInt(strVal, 10);
|
|
1515
|
-
} else if (/^\d+\.\d+$/.test(strVal)) {
|
|
1516
|
-
val = parseFloat(strVal);
|
|
1517
|
-
}
|
|
1518
|
-
}
|
|
1519
|
-
props[key] = val;
|
|
1520
|
-
}
|
|
1521
|
-
}
|
|
1522
|
-
return props;
|
|
1523
|
-
}
|
|
1524
|
-
function parseNestedBlock(content, keyword) {
|
|
1525
|
-
const blocks = extractBlock(content, keyword);
|
|
1526
|
-
if (blocks.length === 0) return void 0;
|
|
1527
|
-
return parseProperties(blocks[0].content);
|
|
1528
|
-
}
|
|
1529
|
-
function parseFieldMappings(content) {
|
|
1530
|
-
const mappings = [];
|
|
1531
|
-
const lines = content.split("\n");
|
|
1532
|
-
for (const line of lines) {
|
|
1533
|
-
const trimmed = line.trim();
|
|
1534
|
-
if (!trimmed || trimmed.startsWith("//")) continue;
|
|
1535
|
-
const mapMatch = trimmed.match(/^(\w+)\s*->\s*(\w+)(?:\s*:\s*(.+))?$/);
|
|
1536
|
-
if (mapMatch) {
|
|
1537
|
-
const transforms = mapMatch[3] ? mapMatch[3].split(":").map((t) => t.trim()).filter(Boolean) : [];
|
|
1538
|
-
mappings.push({
|
|
1539
|
-
from: mapMatch[1],
|
|
1540
|
-
to: mapMatch[2],
|
|
1541
|
-
transforms
|
|
1542
|
-
});
|
|
1543
|
-
}
|
|
1544
|
-
}
|
|
1545
|
-
return mappings;
|
|
1546
|
-
}
|
|
1547
|
-
function parseValidateFields(content) {
|
|
1548
|
-
const fields = [];
|
|
1549
|
-
const lines = content.split("\n");
|
|
1550
|
-
for (const line of lines) {
|
|
1551
|
-
const trimmed = line.trim();
|
|
1552
|
-
if (!trimmed || trimmed.startsWith("//")) continue;
|
|
1553
|
-
const vMatch = trimmed.match(/^(\w+)\s*:\s*(.+)$/);
|
|
1554
|
-
if (vMatch) {
|
|
1555
|
-
const rules = vMatch[2].split(",").map((r) => r.trim()).filter(Boolean);
|
|
1556
|
-
fields.push({ field: vMatch[1], rules });
|
|
1557
|
-
}
|
|
1558
|
-
}
|
|
1559
|
-
return fields;
|
|
1560
|
-
}
|
|
1561
|
-
function parseBranchRoutes(content) {
|
|
1562
|
-
const routes = [];
|
|
1563
|
-
const lines = content.split("\n");
|
|
1564
|
-
for (const line of lines) {
|
|
1565
|
-
const trimmed = line.trim();
|
|
1566
|
-
if (!trimmed || trimmed.startsWith("//")) continue;
|
|
1567
|
-
const whenMatch = trimmed.match(/^when\s+(.+?)\s*->\s*sink\s+(\w+)$/);
|
|
1568
|
-
if (whenMatch) {
|
|
1569
|
-
routes.push({ condition: whenMatch[1], sinkName: whenMatch[2] });
|
|
1570
|
-
continue;
|
|
1571
|
-
}
|
|
1572
|
-
const defaultMatch = trimmed.match(/^default\s*->\s*sink\s+(\w+)$/);
|
|
1573
|
-
if (defaultMatch) {
|
|
1574
|
-
routes.push({ condition: "default", sinkName: defaultMatch[1] });
|
|
1575
|
-
}
|
|
1576
|
-
}
|
|
1577
|
-
return routes;
|
|
1578
|
-
}
|
|
1579
|
-
function parseStringArray(content) {
|
|
1580
|
-
const match = content.match(/\[([\s\S]*?)\]/);
|
|
1581
|
-
if (!match) return [];
|
|
1582
|
-
return match[1].split(",").map((s) => s.trim().replace(/^["']|["']$/g, "")).filter(Boolean);
|
|
1583
|
-
}
|
|
1584
|
-
function parsePipeline(source) {
|
|
1585
|
-
const errors = [];
|
|
1586
|
-
const clean = stripComments(source);
|
|
1587
|
-
const pipelineBlocks = extractBlock(clean, "pipeline");
|
|
1588
|
-
if (pipelineBlocks.length === 0) {
|
|
1589
|
-
const quotedMatch = clean.match(/pipeline\s+["']([^"']+)["']\s*\{/);
|
|
1590
|
-
if (!quotedMatch) {
|
|
1591
|
-
return { success: false, errors: [{ message: "No pipeline block found" }] };
|
|
1592
|
-
}
|
|
1593
|
-
const startIdx = clean.indexOf("{", quotedMatch.index);
|
|
1594
|
-
let depth = 1;
|
|
1595
|
-
let i = startIdx + 1;
|
|
1596
|
-
while (i < clean.length && depth > 0) {
|
|
1597
|
-
if (clean[i] === "{") depth++;
|
|
1598
|
-
if (clean[i] === "}") depth--;
|
|
1599
|
-
i++;
|
|
1600
|
-
}
|
|
1601
|
-
const pipelineContent = clean.substring(startIdx + 1, i - 1);
|
|
1602
|
-
return parsePipelineContent(quotedMatch[1], pipelineContent, errors);
|
|
1603
|
-
}
|
|
1604
|
-
return parsePipelineContent(pipelineBlocks[0].name, pipelineBlocks[0].content, errors);
|
|
1605
|
-
}
|
|
1606
|
-
function parsePipelineContent(name, content, errors) {
|
|
1607
|
-
const invalidKeywords = [
|
|
1608
|
-
"environment",
|
|
1609
|
-
"spatial_group",
|
|
1610
|
-
"template",
|
|
1611
|
-
"object",
|
|
1612
|
-
"orb",
|
|
1613
|
-
"theme",
|
|
1614
|
-
"light",
|
|
1615
|
-
"camera",
|
|
1616
|
-
"audio",
|
|
1617
|
-
"zone",
|
|
1618
|
-
"timeline",
|
|
1619
|
-
"particle_system",
|
|
1620
|
-
"effects",
|
|
1621
|
-
"ui",
|
|
1622
|
-
"npc",
|
|
1623
|
-
"quest",
|
|
1624
|
-
"dialogue",
|
|
1625
|
-
"ability",
|
|
1626
|
-
"achievement",
|
|
1627
|
-
"talent_tree",
|
|
1628
|
-
"behavior",
|
|
1629
|
-
"state_machine",
|
|
1630
|
-
"shape",
|
|
1631
|
-
"terrain",
|
|
1632
|
-
"waypoints",
|
|
1633
|
-
"spawn_group",
|
|
1634
|
-
"composition",
|
|
1635
|
-
"constraint",
|
|
1636
|
-
"sub_orb",
|
|
1637
|
-
"norm",
|
|
1638
|
-
"metanorm"
|
|
1639
|
-
];
|
|
1640
|
-
for (const keyword of invalidKeywords) {
|
|
1641
|
-
if (new RegExp(`\\b${keyword}\\b`).test(content)) {
|
|
1642
|
-
errors.push({
|
|
1643
|
-
message: `SyntaxError: '${keyword}' is not valid in a pipeline context. Use .holo for spatial compositions or .hsplus for behaviors.`
|
|
1644
|
-
});
|
|
1645
|
-
}
|
|
1646
|
-
}
|
|
1647
|
-
const props = parseProperties(content);
|
|
1648
|
-
const schedule = typeof props.schedule === "string" ? props.schedule : void 0;
|
|
1649
|
-
const timeout = typeof props.timeout === "string" ? parseDuration(props.timeout) : void 0;
|
|
1650
|
-
let retry;
|
|
1651
|
-
const retryBlock = parseNestedBlock(content, "retry");
|
|
1652
|
-
if (retryBlock) {
|
|
1653
|
-
retry = {
|
|
1654
|
-
max: typeof retryBlock.max === "number" ? retryBlock.max : 3,
|
|
1655
|
-
backoff: retryBlock.backoff || "exponential"
|
|
1656
|
-
};
|
|
1657
|
-
}
|
|
1658
|
-
const sources = [];
|
|
1659
|
-
for (const block of extractBlock(content, "source")) {
|
|
1660
|
-
const p = parseProperties(block.content);
|
|
1661
|
-
sources.push({
|
|
1662
|
-
kind: "source",
|
|
1663
|
-
name: block.name,
|
|
1664
|
-
type: p.type || "rest",
|
|
1665
|
-
endpoint: p.endpoint,
|
|
1666
|
-
path: p.path,
|
|
1667
|
-
pattern: p.pattern,
|
|
1668
|
-
since: p.since,
|
|
1669
|
-
method: p.method,
|
|
1670
|
-
auth: parseNestedBlock(block.content, "auth"),
|
|
1671
|
-
pagination: parseNestedBlock(block.content, "pagination"),
|
|
1672
|
-
properties: p
|
|
1673
|
-
});
|
|
1674
|
-
}
|
|
1675
|
-
const transforms = [];
|
|
1676
|
-
for (const block of extractBlock(content, "transform")) {
|
|
1677
|
-
const p = parseProperties(block.content);
|
|
1678
|
-
const mappings = parseFieldMappings(block.content);
|
|
1679
|
-
const hasType = p.type !== void 0;
|
|
1680
|
-
transforms.push({
|
|
1681
|
-
kind: "transform",
|
|
1682
|
-
name: block.name,
|
|
1683
|
-
type: hasType ? p.type : mappings.length > 0 ? "field_mapping" : void 0,
|
|
1684
|
-
mappings: mappings.length > 0 ? mappings : void 0,
|
|
1685
|
-
model: p.model,
|
|
1686
|
-
prompt: p.prompt,
|
|
1687
|
-
input: p.input,
|
|
1688
|
-
output: p.output,
|
|
1689
|
-
server: p.server,
|
|
1690
|
-
tool: p.tool,
|
|
1691
|
-
method: p.method,
|
|
1692
|
-
url: p.url,
|
|
1693
|
-
timeout: typeof p.timeout === "string" ? parseDuration(p.timeout) : void 0,
|
|
1694
|
-
where: p.where,
|
|
1695
|
-
properties: p
|
|
1696
|
-
});
|
|
1697
|
-
}
|
|
1698
|
-
const filters = [];
|
|
1699
|
-
for (const block of extractBlock(content, "filter")) {
|
|
1700
|
-
const p = parseProperties(block.content);
|
|
1701
|
-
if (!p.where) {
|
|
1702
|
-
errors.push({
|
|
1703
|
-
message: `Filter "${block.name}" missing 'where' clause`,
|
|
1704
|
-
line: block.startLine,
|
|
1705
|
-
block: block.name
|
|
1706
|
-
});
|
|
1707
|
-
}
|
|
1708
|
-
filters.push({
|
|
1709
|
-
kind: "filter",
|
|
1710
|
-
name: block.name,
|
|
1711
|
-
where: p.where || ""
|
|
1712
|
-
});
|
|
1713
|
-
}
|
|
1714
|
-
const validates = [];
|
|
1715
|
-
for (const block of extractBlock(content, "validate")) {
|
|
1716
|
-
validates.push({
|
|
1717
|
-
kind: "validate",
|
|
1718
|
-
name: block.name,
|
|
1719
|
-
fields: parseValidateFields(block.content)
|
|
1720
|
-
});
|
|
1721
|
-
}
|
|
1722
|
-
const merges = [];
|
|
1723
|
-
for (const block of extractBlock(content, "merge")) {
|
|
1724
|
-
const p = parseProperties(block.content);
|
|
1725
|
-
const fromArr = typeof p.from === "string" ? parseStringArray(p.from) : [];
|
|
1726
|
-
merges.push({
|
|
1727
|
-
kind: "merge",
|
|
1728
|
-
name: block.name,
|
|
1729
|
-
from: fromArr,
|
|
1730
|
-
dedup: parseNestedBlock(block.content, "dedup"),
|
|
1731
|
-
strategy: p.strategy
|
|
1732
|
-
});
|
|
1733
|
-
}
|
|
1734
|
-
const branches = [];
|
|
1735
|
-
for (const block of extractBlock(content, "branch")) {
|
|
1736
|
-
branches.push({
|
|
1737
|
-
kind: "branch",
|
|
1738
|
-
name: block.name,
|
|
1739
|
-
routes: parseBranchRoutes(block.content)
|
|
1740
|
-
});
|
|
1741
|
-
}
|
|
1742
|
-
const sinks = [];
|
|
1743
|
-
for (const block of extractBlock(content, "sink")) {
|
|
1744
|
-
const p = parseProperties(block.content);
|
|
1745
|
-
sinks.push({
|
|
1746
|
-
kind: "sink",
|
|
1747
|
-
name: block.name,
|
|
1748
|
-
type: p.type || "rest",
|
|
1749
|
-
endpoint: p.endpoint,
|
|
1750
|
-
path: p.path,
|
|
1751
|
-
method: p.method,
|
|
1752
|
-
auth: parseNestedBlock(block.content, "auth"),
|
|
1753
|
-
batch: parseNestedBlock(block.content, "batch"),
|
|
1754
|
-
onError: parseNestedBlock(block.content, "on_error"),
|
|
1755
|
-
format: p.format,
|
|
1756
|
-
append: p.append,
|
|
1757
|
-
server: p.server,
|
|
1758
|
-
tool: p.tool,
|
|
1759
|
-
properties: p
|
|
1760
|
-
});
|
|
1761
|
-
}
|
|
1762
|
-
const steps = [
|
|
1763
|
-
...sources,
|
|
1764
|
-
...merges,
|
|
1765
|
-
...transforms,
|
|
1766
|
-
...filters,
|
|
1767
|
-
...validates,
|
|
1768
|
-
...branches,
|
|
1769
|
-
...sinks
|
|
1770
|
-
];
|
|
1771
|
-
if (sources.length === 0) {
|
|
1772
|
-
errors.push({ message: "Pipeline has no sources" });
|
|
1773
|
-
}
|
|
1774
|
-
if (sinks.length === 0) {
|
|
1775
|
-
errors.push({ message: "Pipeline has no sinks" });
|
|
1776
|
-
}
|
|
1777
|
-
const pipeline = {
|
|
1778
|
-
name,
|
|
1779
|
-
schedule,
|
|
1780
|
-
timeout,
|
|
1781
|
-
retry,
|
|
1782
|
-
steps,
|
|
1783
|
-
sources,
|
|
1784
|
-
transforms,
|
|
1785
|
-
filters,
|
|
1786
|
-
validates,
|
|
1787
|
-
merges,
|
|
1788
|
-
branches,
|
|
1789
|
-
sinks
|
|
1790
|
-
};
|
|
1791
|
-
return { success: errors.length === 0, pipeline, errors };
|
|
1792
|
-
}
|
|
1793
|
-
function isPipelineSource(source) {
|
|
1794
|
-
return /pipeline\s+["']?\w/.test(source);
|
|
1795
|
-
}
|
|
1796
|
-
|
|
1797
|
-
// src/compiler/platform/PlatformConditional.ts
|
|
1798
|
-
var PLATFORM_CATEGORIES = {
|
|
1799
|
-
vr: ["quest3", "pcvr", "visionos", "android-xr"],
|
|
1800
|
-
ar: ["visionos-ar", "android-xr-ar", "webxr"],
|
|
1801
|
-
mobile: ["ios", "android"],
|
|
1802
|
-
desktop: ["windows", "macos", "linux", "web"],
|
|
1803
|
-
automotive: ["android-auto", "carplay"],
|
|
1804
|
-
wearable: ["watchos", "wearos"]
|
|
1805
|
-
};
|
|
1806
|
-
var ALL_PLATFORMS = Object.values(
|
|
1807
|
-
PLATFORM_CATEGORIES
|
|
1808
|
-
).flat();
|
|
1809
|
-
function platformCategory(target) {
|
|
1810
|
-
for (const [cat, platforms] of Object.entries(PLATFORM_CATEGORIES)) {
|
|
1811
|
-
if (platforms.includes(target)) return cat;
|
|
1812
|
-
}
|
|
1813
|
-
return "desktop";
|
|
1814
|
-
}
|
|
1815
|
-
var PLATFORM_CAPABILITIES = {
|
|
1816
|
-
quest3: {
|
|
1817
|
-
spatialTracking: true,
|
|
1818
|
-
handTracking: true,
|
|
1819
|
-
eyeTracking: true,
|
|
1820
|
-
haptics: true,
|
|
1821
|
-
spatialAudio: true,
|
|
1822
|
-
gpu3D: true,
|
|
1823
|
-
arCamera: true,
|
|
1824
|
-
gps: false,
|
|
1825
|
-
npu: true,
|
|
1826
|
-
webxrSupport: true,
|
|
1827
|
-
frameBudgetMs: 11.1,
|
|
1828
|
-
agentBudgetMs: 5,
|
|
1829
|
-
computeModel: "edge-first"
|
|
1830
|
-
},
|
|
1831
|
-
pcvr: {
|
|
1832
|
-
spatialTracking: true,
|
|
1833
|
-
handTracking: true,
|
|
1834
|
-
eyeTracking: true,
|
|
1835
|
-
haptics: true,
|
|
1836
|
-
spatialAudio: true,
|
|
1837
|
-
gpu3D: true,
|
|
1838
|
-
arCamera: false,
|
|
1839
|
-
gps: false,
|
|
1840
|
-
npu: false,
|
|
1841
|
-
webxrSupport: true,
|
|
1842
|
-
frameBudgetMs: 11.1,
|
|
1843
|
-
agentBudgetMs: 5,
|
|
1844
|
-
computeModel: "edge-first"
|
|
1845
|
-
},
|
|
1846
|
-
visionos: {
|
|
1847
|
-
spatialTracking: true,
|
|
1848
|
-
handTracking: true,
|
|
1849
|
-
eyeTracking: true,
|
|
1850
|
-
haptics: false,
|
|
1851
|
-
spatialAudio: true,
|
|
1852
|
-
gpu3D: true,
|
|
1853
|
-
arCamera: true,
|
|
1854
|
-
gps: false,
|
|
1855
|
-
npu: true,
|
|
1856
|
-
webxrSupport: false,
|
|
1857
|
-
frameBudgetMs: 11.1,
|
|
1858
|
-
agentBudgetMs: 5,
|
|
1859
|
-
computeModel: "edge-first"
|
|
1860
|
-
},
|
|
1861
|
-
"android-xr": {
|
|
1862
|
-
spatialTracking: true,
|
|
1863
|
-
handTracking: true,
|
|
1864
|
-
eyeTracking: true,
|
|
1865
|
-
haptics: true,
|
|
1866
|
-
spatialAudio: true,
|
|
1867
|
-
gpu3D: true,
|
|
1868
|
-
arCamera: true,
|
|
1869
|
-
gps: true,
|
|
1870
|
-
npu: true,
|
|
1871
|
-
webxrSupport: true,
|
|
1872
|
-
frameBudgetMs: 11.1,
|
|
1873
|
-
agentBudgetMs: 5,
|
|
1874
|
-
computeModel: "edge-first"
|
|
1875
|
-
},
|
|
1876
|
-
"visionos-ar": {
|
|
1877
|
-
spatialTracking: true,
|
|
1878
|
-
handTracking: true,
|
|
1879
|
-
eyeTracking: true,
|
|
1880
|
-
haptics: false,
|
|
1881
|
-
spatialAudio: true,
|
|
1882
|
-
gpu3D: true,
|
|
1883
|
-
arCamera: true,
|
|
1884
|
-
gps: true,
|
|
1885
|
-
npu: true,
|
|
1886
|
-
webxrSupport: false,
|
|
1887
|
-
frameBudgetMs: 16.6,
|
|
1888
|
-
agentBudgetMs: 10,
|
|
1889
|
-
computeModel: "edge-first"
|
|
1890
|
-
},
|
|
1891
|
-
"android-xr-ar": {
|
|
1892
|
-
spatialTracking: true,
|
|
1893
|
-
handTracking: true,
|
|
1894
|
-
eyeTracking: false,
|
|
1895
|
-
haptics: true,
|
|
1896
|
-
spatialAudio: true,
|
|
1897
|
-
gpu3D: true,
|
|
1898
|
-
arCamera: true,
|
|
1899
|
-
gps: true,
|
|
1900
|
-
npu: true,
|
|
1901
|
-
webxrSupport: true,
|
|
1902
|
-
frameBudgetMs: 16.6,
|
|
1903
|
-
agentBudgetMs: 10,
|
|
1904
|
-
computeModel: "edge-first"
|
|
1905
|
-
},
|
|
1906
|
-
webxr: {
|
|
1907
|
-
spatialTracking: true,
|
|
1908
|
-
handTracking: false,
|
|
1909
|
-
eyeTracking: false,
|
|
1910
|
-
haptics: false,
|
|
1911
|
-
spatialAudio: false,
|
|
1912
|
-
gpu3D: true,
|
|
1913
|
-
arCamera: true,
|
|
1914
|
-
gps: false,
|
|
1915
|
-
npu: false,
|
|
1916
|
-
webxrSupport: true,
|
|
1917
|
-
frameBudgetMs: 16.6,
|
|
1918
|
-
agentBudgetMs: 15,
|
|
1919
|
-
computeModel: "cloud-first"
|
|
1920
|
-
},
|
|
1921
|
-
ios: {
|
|
1922
|
-
spatialTracking: false,
|
|
1923
|
-
handTracking: false,
|
|
1924
|
-
eyeTracking: false,
|
|
1925
|
-
haptics: true,
|
|
1926
|
-
spatialAudio: false,
|
|
1927
|
-
gpu3D: true,
|
|
1928
|
-
arCamera: true,
|
|
1929
|
-
gps: true,
|
|
1930
|
-
npu: true,
|
|
1931
|
-
webxrSupport: false,
|
|
1932
|
-
frameBudgetMs: 16.6,
|
|
1933
|
-
agentBudgetMs: 100,
|
|
1934
|
-
computeModel: "cloud-first"
|
|
1935
|
-
},
|
|
1936
|
-
android: {
|
|
1937
|
-
spatialTracking: false,
|
|
1938
|
-
handTracking: false,
|
|
1939
|
-
eyeTracking: false,
|
|
1940
|
-
haptics: true,
|
|
1941
|
-
spatialAudio: false,
|
|
1942
|
-
gpu3D: true,
|
|
1943
|
-
arCamera: true,
|
|
1944
|
-
gps: true,
|
|
1945
|
-
npu: true,
|
|
1946
|
-
webxrSupport: true,
|
|
1947
|
-
frameBudgetMs: 16.6,
|
|
1948
|
-
agentBudgetMs: 100,
|
|
1949
|
-
computeModel: "cloud-first"
|
|
1950
|
-
},
|
|
1951
|
-
windows: {
|
|
1952
|
-
spatialTracking: false,
|
|
1953
|
-
handTracking: false,
|
|
1954
|
-
eyeTracking: false,
|
|
1955
|
-
haptics: false,
|
|
1956
|
-
spatialAudio: false,
|
|
1957
|
-
gpu3D: true,
|
|
1958
|
-
arCamera: false,
|
|
1959
|
-
gps: false,
|
|
1960
|
-
npu: false,
|
|
1961
|
-
webxrSupport: true,
|
|
1962
|
-
frameBudgetMs: 16.6,
|
|
1963
|
-
agentBudgetMs: 200,
|
|
1964
|
-
computeModel: "cloud-first"
|
|
1965
|
-
},
|
|
1966
|
-
macos: {
|
|
1967
|
-
spatialTracking: false,
|
|
1968
|
-
handTracking: false,
|
|
1969
|
-
eyeTracking: false,
|
|
1970
|
-
haptics: false,
|
|
1971
|
-
spatialAudio: false,
|
|
1972
|
-
gpu3D: true,
|
|
1973
|
-
arCamera: false,
|
|
1974
|
-
gps: false,
|
|
1975
|
-
npu: true,
|
|
1976
|
-
webxrSupport: true,
|
|
1977
|
-
frameBudgetMs: 16.6,
|
|
1978
|
-
agentBudgetMs: 200,
|
|
1979
|
-
computeModel: "cloud-first"
|
|
1980
|
-
},
|
|
1981
|
-
linux: {
|
|
1982
|
-
spatialTracking: false,
|
|
1983
|
-
handTracking: false,
|
|
1984
|
-
eyeTracking: false,
|
|
1985
|
-
haptics: false,
|
|
1986
|
-
spatialAudio: false,
|
|
1987
|
-
gpu3D: true,
|
|
1988
|
-
arCamera: false,
|
|
1989
|
-
gps: false,
|
|
1990
|
-
npu: false,
|
|
1991
|
-
webxrSupport: true,
|
|
1992
|
-
frameBudgetMs: 16.6,
|
|
1993
|
-
agentBudgetMs: 200,
|
|
1994
|
-
computeModel: "cloud-first"
|
|
1995
|
-
},
|
|
1996
|
-
web: {
|
|
1997
|
-
spatialTracking: false,
|
|
1998
|
-
handTracking: false,
|
|
1999
|
-
eyeTracking: false,
|
|
2000
|
-
haptics: false,
|
|
2001
|
-
spatialAudio: false,
|
|
2002
|
-
gpu3D: true,
|
|
2003
|
-
arCamera: false,
|
|
2004
|
-
gps: false,
|
|
2005
|
-
npu: false,
|
|
2006
|
-
webxrSupport: true,
|
|
2007
|
-
frameBudgetMs: 16.6,
|
|
2008
|
-
agentBudgetMs: 200,
|
|
2009
|
-
computeModel: "cloud-first"
|
|
2010
|
-
},
|
|
2011
|
-
"android-auto": {
|
|
2012
|
-
spatialTracking: false,
|
|
2013
|
-
handTracking: false,
|
|
2014
|
-
eyeTracking: false,
|
|
2015
|
-
haptics: false,
|
|
2016
|
-
spatialAudio: true,
|
|
2017
|
-
gpu3D: false,
|
|
2018
|
-
arCamera: false,
|
|
2019
|
-
gps: true,
|
|
2020
|
-
npu: false,
|
|
2021
|
-
webxrSupport: false,
|
|
2022
|
-
frameBudgetMs: 30,
|
|
2023
|
-
agentBudgetMs: 15,
|
|
2024
|
-
computeModel: "safety-critical"
|
|
2025
|
-
},
|
|
2026
|
-
carplay: {
|
|
2027
|
-
spatialTracking: false,
|
|
2028
|
-
handTracking: false,
|
|
2029
|
-
eyeTracking: false,
|
|
2030
|
-
haptics: false,
|
|
2031
|
-
spatialAudio: true,
|
|
2032
|
-
gpu3D: false,
|
|
2033
|
-
arCamera: false,
|
|
2034
|
-
gps: true,
|
|
2035
|
-
npu: false,
|
|
2036
|
-
webxrSupport: false,
|
|
2037
|
-
frameBudgetMs: 30,
|
|
2038
|
-
agentBudgetMs: 15,
|
|
2039
|
-
computeModel: "safety-critical"
|
|
2040
|
-
},
|
|
2041
|
-
watchos: {
|
|
2042
|
-
spatialTracking: false,
|
|
2043
|
-
handTracking: false,
|
|
2044
|
-
eyeTracking: false,
|
|
2045
|
-
haptics: true,
|
|
2046
|
-
spatialAudio: false,
|
|
2047
|
-
gpu3D: false,
|
|
2048
|
-
arCamera: false,
|
|
2049
|
-
gps: true,
|
|
2050
|
-
npu: true,
|
|
2051
|
-
webxrSupport: false,
|
|
2052
|
-
frameBudgetMs: 33.3,
|
|
2053
|
-
agentBudgetMs: 50,
|
|
2054
|
-
computeModel: "cloud-first"
|
|
2055
|
-
},
|
|
2056
|
-
wearos: {
|
|
2057
|
-
spatialTracking: false,
|
|
2058
|
-
handTracking: false,
|
|
2059
|
-
eyeTracking: false,
|
|
2060
|
-
haptics: true,
|
|
2061
|
-
spatialAudio: false,
|
|
2062
|
-
gpu3D: false,
|
|
2063
|
-
arCamera: false,
|
|
2064
|
-
gps: true,
|
|
2065
|
-
npu: false,
|
|
2066
|
-
webxrSupport: false,
|
|
2067
|
-
frameBudgetMs: 33.3,
|
|
2068
|
-
agentBudgetMs: 50,
|
|
2069
|
-
computeModel: "cloud-first"
|
|
2070
|
-
}
|
|
2071
|
-
};
|
|
2072
|
-
var DEFAULT_EMBODIMENT = {
|
|
2073
|
-
vr: "Avatar3D",
|
|
2074
|
-
ar: "SpatialPersona",
|
|
2075
|
-
mobile: "UI2D",
|
|
2076
|
-
desktop: "FullGUI",
|
|
2077
|
-
automotive: "VoiceHUD",
|
|
2078
|
-
wearable: "UI2D"
|
|
2079
|
-
};
|
|
2080
|
-
function resolvePlatforms(condition) {
|
|
2081
|
-
let platforms = /* @__PURE__ */ new Set();
|
|
2082
|
-
if (condition.include) {
|
|
2083
|
-
for (const p of condition.include) platforms.add(p);
|
|
2084
|
-
}
|
|
2085
|
-
if (condition.includeCategories) {
|
|
2086
|
-
for (const cat of condition.includeCategories) {
|
|
2087
|
-
for (const p of PLATFORM_CATEGORIES[cat]) platforms.add(p);
|
|
2088
|
-
}
|
|
2089
|
-
}
|
|
2090
|
-
if (!condition.include && !condition.includeCategories) {
|
|
2091
|
-
for (const p of ALL_PLATFORMS) platforms.add(p);
|
|
2092
|
-
}
|
|
2093
|
-
if (condition.exclude) {
|
|
2094
|
-
for (const p of condition.exclude) platforms.delete(p);
|
|
2095
|
-
}
|
|
2096
|
-
if (condition.requireCapabilities) {
|
|
2097
|
-
platforms = new Set(
|
|
2098
|
-
[...platforms].filter((p) => {
|
|
2099
|
-
const caps = PLATFORM_CAPABILITIES[p];
|
|
2100
|
-
return condition.requireCapabilities.every((cap) => {
|
|
2101
|
-
const val = caps[cap];
|
|
2102
|
-
return typeof val === "boolean" ? val : Number(val) > 0;
|
|
2103
|
-
});
|
|
2104
|
-
})
|
|
2105
|
-
);
|
|
2106
|
-
}
|
|
2107
|
-
return [...platforms];
|
|
2108
|
-
}
|
|
2109
|
-
function matchesPlatform(target, condition) {
|
|
2110
|
-
return resolvePlatforms(condition).includes(target);
|
|
2111
|
-
}
|
|
2112
|
-
function selectBlock(target, blocks) {
|
|
2113
|
-
for (const block of blocks) {
|
|
2114
|
-
if (matchesPlatform(target, block.condition)) return block.body;
|
|
2115
|
-
}
|
|
2116
|
-
return void 0;
|
|
2117
|
-
}
|
|
2118
|
-
function embodimentFor(target) {
|
|
2119
|
-
return DEFAULT_EMBODIMENT[platformCategory(target)];
|
|
2065
|
+
// src/compiler/USDZPipeline.ts
|
|
2066
|
+
chunkHGVXZDSK_cjs.init_DomainBlockCompilerMixin();
|
|
2067
|
+
chunkBPICAGBV_cjs.init_R3FCompiler();
|
|
2068
|
+
function presetString(p, k) {
|
|
2069
|
+
const v = p[k];
|
|
2070
|
+
return typeof v === "string" ? v : void 0;
|
|
2120
2071
|
}
|
|
2121
|
-
function
|
|
2122
|
-
|
|
2072
|
+
function presetNumber(p, k) {
|
|
2073
|
+
const v = p[k];
|
|
2074
|
+
return typeof v === "number" && Number.isFinite(v) ? v : void 0;
|
|
2123
2075
|
}
|
|
2124
|
-
function
|
|
2125
|
-
const
|
|
2126
|
-
return typeof
|
|
2076
|
+
function presetBoolean(p, k) {
|
|
2077
|
+
const v = p[k];
|
|
2078
|
+
return typeof v === "boolean" ? v : void 0;
|
|
2127
2079
|
}
|
|
2128
|
-
|
|
2129
|
-
// src/compiler/USDZPipeline.ts
|
|
2130
|
-
chunkLXJ4667L_cjs.init_DomainBlockCompilerMixin();
|
|
2131
|
-
chunkQ5SJOGHQ_cjs.init_R3FCompiler();
|
|
2132
2080
|
var _USDZPipeline = class _USDZPipeline {
|
|
2133
2081
|
constructor(options = {}) {
|
|
2134
2082
|
this.materials = /* @__PURE__ */ new Map();
|
|
@@ -2347,33 +2295,49 @@ ${domainBlocksOutput}` : materials,
|
|
|
2347
2295
|
const matName = `Material_${this.sanitizeName(obj.name)}`;
|
|
2348
2296
|
const mat = { name: matName };
|
|
2349
2297
|
const presetName = typeof material === "string" ? material : typeof materialPreset === "string" ? materialPreset : void 0;
|
|
2350
|
-
if (presetName &&
|
|
2351
|
-
const preset =
|
|
2352
|
-
|
|
2353
|
-
if (
|
|
2354
|
-
|
|
2355
|
-
if (
|
|
2356
|
-
|
|
2357
|
-
if (
|
|
2358
|
-
|
|
2359
|
-
if (
|
|
2360
|
-
|
|
2361
|
-
if (
|
|
2362
|
-
|
|
2363
|
-
if (
|
|
2364
|
-
|
|
2365
|
-
if (
|
|
2366
|
-
|
|
2367
|
-
if (
|
|
2368
|
-
|
|
2369
|
-
if (
|
|
2370
|
-
|
|
2371
|
-
if (
|
|
2372
|
-
|
|
2373
|
-
if (
|
|
2374
|
-
|
|
2375
|
-
|
|
2376
|
-
|
|
2298
|
+
if (presetName && chunkBPICAGBV_cjs.MATERIAL_PRESETS[presetName]) {
|
|
2299
|
+
const preset = chunkBPICAGBV_cjs.MATERIAL_PRESETS[presetName];
|
|
2300
|
+
const colorStr = presetString(preset, "color");
|
|
2301
|
+
if (colorStr) mat.baseColor = this.hexToRGB(colorStr);
|
|
2302
|
+
const metal = presetNumber(preset, "metalness");
|
|
2303
|
+
if (metal !== void 0) mat.metallic = metal;
|
|
2304
|
+
const rough = presetNumber(preset, "roughness");
|
|
2305
|
+
if (rough !== void 0) mat.roughness = rough;
|
|
2306
|
+
const op = presetNumber(preset, "opacity");
|
|
2307
|
+
if (op !== void 0) mat.opacity = op;
|
|
2308
|
+
const emissiveStr = presetString(preset, "emissive");
|
|
2309
|
+
if (emissiveStr) mat.emissiveColor = this.hexToRGB(emissiveStr);
|
|
2310
|
+
const emissiveInt = presetNumber(preset, "emissiveIntensity");
|
|
2311
|
+
if (emissiveInt !== void 0) mat.emissiveIntensity = emissiveInt;
|
|
2312
|
+
const trans = presetNumber(preset, "transmission");
|
|
2313
|
+
if (trans !== void 0) mat.transmission = trans;
|
|
2314
|
+
const ior = presetNumber(preset, "ior");
|
|
2315
|
+
if (ior !== void 0) mat.ior = ior;
|
|
2316
|
+
const thick = presetNumber(preset, "thickness");
|
|
2317
|
+
if (thick !== void 0) mat.thickness = thick;
|
|
2318
|
+
const cc = presetNumber(preset, "clearcoat");
|
|
2319
|
+
if (cc !== void 0) mat.clearcoat = cc;
|
|
2320
|
+
const ccr = presetNumber(preset, "clearcoatRoughness");
|
|
2321
|
+
if (ccr !== void 0) mat.clearcoatRoughness = ccr;
|
|
2322
|
+
const sheen = presetNumber(preset, "sheen");
|
|
2323
|
+
if (sheen !== void 0) mat.sheen = sheen;
|
|
2324
|
+
const sheenR = presetNumber(preset, "sheenRoughness");
|
|
2325
|
+
if (sheenR !== void 0) mat.sheenRoughness = sheenR;
|
|
2326
|
+
const sheenColorStr = presetString(preset, "sheenColor");
|
|
2327
|
+
if (sheenColorStr) mat.sheenColor = this.hexToRGB(sheenColorStr);
|
|
2328
|
+
const irid = presetNumber(preset, "iridescence");
|
|
2329
|
+
if (irid !== void 0) mat.iridescence = irid;
|
|
2330
|
+
const iridIor = presetNumber(preset, "iridescenceIOR");
|
|
2331
|
+
if (iridIor !== void 0) mat.iridescenceIOR = iridIor;
|
|
2332
|
+
const aniso = presetNumber(preset, "anisotropy");
|
|
2333
|
+
if (aniso !== void 0) mat.anisotropy = aniso;
|
|
2334
|
+
const anisoRot = presetNumber(preset, "anisotropyRotation");
|
|
2335
|
+
if (anisoRot !== void 0) mat.anisotropyRotation = anisoRot;
|
|
2336
|
+
const attColorStr = presetString(preset, "attenuationColor");
|
|
2337
|
+
if (attColorStr) mat.attenuationColor = this.hexToRGB(attColorStr);
|
|
2338
|
+
const attDist = presetNumber(preset, "attenuationDistance");
|
|
2339
|
+
if (attDist !== void 0) mat.attenuationDistance = attDist;
|
|
2340
|
+
if (presetBoolean(preset, "transparent") && mat.opacity === void 0) mat.opacity = 0.99;
|
|
2377
2341
|
}
|
|
2378
2342
|
if (typeof color === "string") {
|
|
2379
2343
|
mat.baseColor = this.hexToRGB(color);
|
|
@@ -2833,59 +2797,59 @@ ${domainBlocksOutput}` : materials,
|
|
|
2833
2797
|
generateDomainBlocks(composition) {
|
|
2834
2798
|
const domainBlocks = composition.domainBlocks ?? [];
|
|
2835
2799
|
if (domainBlocks.length === 0) return "";
|
|
2836
|
-
const compiled =
|
|
2800
|
+
const compiled = chunkHGVXZDSK_cjs.compileDomainBlocks(
|
|
2837
2801
|
domainBlocks,
|
|
2838
2802
|
{
|
|
2839
2803
|
material: (block) => {
|
|
2840
|
-
const mat =
|
|
2841
|
-
return
|
|
2804
|
+
const mat = chunkHGVXZDSK_cjs.compileMaterialBlock(block);
|
|
2805
|
+
return chunkHGVXZDSK_cjs.materialToUSD(mat);
|
|
2842
2806
|
},
|
|
2843
2807
|
physics: (block) => {
|
|
2844
|
-
const phys =
|
|
2808
|
+
const phys = chunkHGVXZDSK_cjs.compilePhysicsBlock(block);
|
|
2845
2809
|
return `# Physics: ${phys.keyword} "${phys.name || ""}" \u2014 ${JSON.stringify(phys.properties)}`;
|
|
2846
2810
|
},
|
|
2847
2811
|
vfx: (block) => {
|
|
2848
|
-
const ps =
|
|
2849
|
-
return
|
|
2812
|
+
const ps = chunkHGVXZDSK_cjs.compileParticleBlock(block);
|
|
2813
|
+
return chunkHGVXZDSK_cjs.particlesToUSD(ps);
|
|
2850
2814
|
},
|
|
2851
2815
|
postfx: (block) => {
|
|
2852
|
-
const pp =
|
|
2853
|
-
return
|
|
2816
|
+
const pp = chunkHGVXZDSK_cjs.compilePostProcessingBlock(block);
|
|
2817
|
+
return chunkHGVXZDSK_cjs.postProcessingToUSD(pp);
|
|
2854
2818
|
},
|
|
2855
2819
|
audio: (block) => {
|
|
2856
|
-
const audio =
|
|
2857
|
-
return
|
|
2820
|
+
const audio = chunkHGVXZDSK_cjs.compileAudioSourceBlock(block);
|
|
2821
|
+
return chunkHGVXZDSK_cjs.audioSourceToUSD(audio);
|
|
2858
2822
|
},
|
|
2859
2823
|
weather: (block) => {
|
|
2860
|
-
const weather =
|
|
2861
|
-
return
|
|
2824
|
+
const weather = chunkHGVXZDSK_cjs.compileWeatherBlock(block);
|
|
2825
|
+
return chunkHGVXZDSK_cjs.weatherToUSD(weather);
|
|
2862
2826
|
},
|
|
2863
2827
|
narrative: (block) => {
|
|
2864
|
-
const narr =
|
|
2865
|
-
return
|
|
2828
|
+
const narr = chunkHGVXZDSK_cjs.compileNarrativeBlock(block);
|
|
2829
|
+
return chunkHGVXZDSK_cjs.narrativeToUSDA(narr);
|
|
2866
2830
|
},
|
|
2867
2831
|
payment: (block) => {
|
|
2868
|
-
const pay =
|
|
2869
|
-
return
|
|
2832
|
+
const pay = chunkHGVXZDSK_cjs.compilePaymentBlock(block);
|
|
2833
|
+
return chunkHGVXZDSK_cjs.paymentToUSDA(pay);
|
|
2870
2834
|
},
|
|
2871
2835
|
healthcare: (block) => {
|
|
2872
|
-
const h =
|
|
2873
|
-
return
|
|
2836
|
+
const h = chunkHGVXZDSK_cjs.compileHealthcareBlock(block);
|
|
2837
|
+
return chunkHGVXZDSK_cjs.healthcareToUSDA(h);
|
|
2874
2838
|
},
|
|
2875
2839
|
robotics: (block) => {
|
|
2876
|
-
const r =
|
|
2877
|
-
return
|
|
2840
|
+
const r = chunkHGVXZDSK_cjs.compileRoboticsBlock(block);
|
|
2841
|
+
return chunkHGVXZDSK_cjs.roboticsToUSDA(r);
|
|
2878
2842
|
},
|
|
2879
|
-
iot: (block) =>
|
|
2880
|
-
dataviz: (block) =>
|
|
2881
|
-
education: (block) =>
|
|
2882
|
-
music: (block) =>
|
|
2883
|
-
architecture: (block) =>
|
|
2884
|
-
web3: (block) =>
|
|
2885
|
-
procedural: (block) =>
|
|
2886
|
-
rendering: (block) =>
|
|
2887
|
-
navigation: (block) =>
|
|
2888
|
-
input: (block) =>
|
|
2843
|
+
iot: (block) => chunkHGVXZDSK_cjs.iotToUSDA(chunkHGVXZDSK_cjs.compileIoTBlock(block)),
|
|
2844
|
+
dataviz: (block) => chunkHGVXZDSK_cjs.datavizToUSDA(chunkHGVXZDSK_cjs.compileDataVizBlock(block)),
|
|
2845
|
+
education: (block) => chunkHGVXZDSK_cjs.educationToUSDA(chunkHGVXZDSK_cjs.compileEducationBlock(block)),
|
|
2846
|
+
music: (block) => chunkHGVXZDSK_cjs.musicToUSDA(chunkHGVXZDSK_cjs.compileMusicBlock(block)),
|
|
2847
|
+
architecture: (block) => chunkHGVXZDSK_cjs.architectureToUSDA(chunkHGVXZDSK_cjs.compileArchitectureBlock(block)),
|
|
2848
|
+
web3: (block) => chunkHGVXZDSK_cjs.web3ToUSDA(chunkHGVXZDSK_cjs.compileWeb3Block(block)),
|
|
2849
|
+
procedural: (block) => chunkHGVXZDSK_cjs.proceduralToUSDA(chunkHGVXZDSK_cjs.compileProceduralBlock(block)),
|
|
2850
|
+
rendering: (block) => chunkHGVXZDSK_cjs.renderingToUSDA(chunkHGVXZDSK_cjs.compileRenderingBlock(block)),
|
|
2851
|
+
navigation: (block) => chunkHGVXZDSK_cjs.navigationToUSDA(chunkHGVXZDSK_cjs.compileNavigationBlock(block)),
|
|
2852
|
+
input: (block) => chunkHGVXZDSK_cjs.inputToUSDA(chunkHGVXZDSK_cjs.compileInputBlock(block))
|
|
2889
2853
|
},
|
|
2890
2854
|
(block) => `# Domain block: ${block.domain}/${block.keyword} "${block.name}"`
|
|
2891
2855
|
);
|
|
@@ -2915,6 +2879,864 @@ _USDZPipeline.TEXTURE_CHANNEL_MAP = {
|
|
|
2915
2879
|
};
|
|
2916
2880
|
var USDZPipeline = _USDZPipeline;
|
|
2917
2881
|
|
|
2882
|
+
// src/compiler/GaussianSplattingCompiler.ts
|
|
2883
|
+
chunkRMHC2VG7_cjs.init_CompilerBase();
|
|
2884
|
+
var GAUSSIAN_SPLAT_TRAIT_NAME = "gaussian_splat";
|
|
2885
|
+
var MULTIPLAYER_TRAIT_NAME = "multiplayer";
|
|
2886
|
+
function detectMultiUserSharedSort(composition) {
|
|
2887
|
+
const objects = composition.objects ?? [];
|
|
2888
|
+
for (const obj of objects) {
|
|
2889
|
+
if (objectHasBothTraits(obj)) return true;
|
|
2890
|
+
}
|
|
2891
|
+
return false;
|
|
2892
|
+
}
|
|
2893
|
+
function objectHasBothTraits(obj) {
|
|
2894
|
+
const traits = obj.traits ?? [];
|
|
2895
|
+
let hasSplat = false;
|
|
2896
|
+
let hasMultiplayer = false;
|
|
2897
|
+
for (const t of traits) {
|
|
2898
|
+
if (t.name === GAUSSIAN_SPLAT_TRAIT_NAME) hasSplat = true;
|
|
2899
|
+
else if (t.name === MULTIPLAYER_TRAIT_NAME) hasMultiplayer = true;
|
|
2900
|
+
if (hasSplat && hasMultiplayer) return true;
|
|
2901
|
+
}
|
|
2902
|
+
const childrenLike = obj.children ?? obj.objects ?? [];
|
|
2903
|
+
for (const child of childrenLike) {
|
|
2904
|
+
if (objectHasBothTraits(child)) return true;
|
|
2905
|
+
}
|
|
2906
|
+
return false;
|
|
2907
|
+
}
|
|
2908
|
+
var SHARED_SORT_SHADER_PATH = "packages/engine/src/gpu/shaders/splat-shared-sort.wgsl";
|
|
2909
|
+
var GaussianSplattingCompiler = class extends chunkRMHC2VG7_cjs.CompilerBase {
|
|
2910
|
+
constructor(options = {}) {
|
|
2911
|
+
super();
|
|
2912
|
+
this.compilerName = "GaussianSplattingCompiler";
|
|
2913
|
+
this.options = {
|
|
2914
|
+
format: options.format ?? "glb",
|
|
2915
|
+
colorSpace: options.colorSpace ?? "srgb_rec709_display",
|
|
2916
|
+
generator: options.generator ?? "HoloScript GaussianSplattingCompiler v1.0.0",
|
|
2917
|
+
copyright: options.copyright ?? "",
|
|
2918
|
+
shDegree: options.shDegree ?? 0
|
|
2919
|
+
};
|
|
2920
|
+
}
|
|
2921
|
+
getRequiredCapability() {
|
|
2922
|
+
return ans.ANSCapabilityPath.GLTF;
|
|
2923
|
+
}
|
|
2924
|
+
compile(composition, agentToken, outputPath) {
|
|
2925
|
+
this.validateCompilerAccess(agentToken, outputPath);
|
|
2926
|
+
const { data, warnings } = this.extractGaussianData(composition);
|
|
2927
|
+
const result = this.buildGLTF(data);
|
|
2928
|
+
if (warnings && warnings.length > 0) {
|
|
2929
|
+
result.warnings = warnings;
|
|
2930
|
+
}
|
|
2931
|
+
return result;
|
|
2932
|
+
}
|
|
2933
|
+
/**
|
|
2934
|
+
* Extended compile that runs the standard glTF export AND reports
|
|
2935
|
+
* compile-time WebGPU emit flags derived from trait co-occurrence.
|
|
2936
|
+
*
|
|
2937
|
+
* The standard `compile()` API is left unchanged so existing call sites
|
|
2938
|
+
* (MCP `compile_to_3dgs`, ExportManager) keep their contract. Callers that
|
|
2939
|
+
* need the shared-sort flag opt in via this method.
|
|
2940
|
+
*
|
|
2941
|
+
* @see detectMultiUserSharedSort (the detection rule)
|
|
2942
|
+
* @see SHARED_SORT_SHADER_PATH (the kernel artifact path)
|
|
2943
|
+
*/
|
|
2944
|
+
compileExtended(composition, agentToken, outputPath) {
|
|
2945
|
+
const gltf = this.compile(composition, agentToken, outputPath);
|
|
2946
|
+
const multiUserSharedSort = detectMultiUserSharedSort(composition);
|
|
2947
|
+
return {
|
|
2948
|
+
gltf,
|
|
2949
|
+
multiUserSharedSort,
|
|
2950
|
+
sharedSortShaderPath: multiUserSharedSort ? SHARED_SORT_SHADER_PATH : void 0
|
|
2951
|
+
};
|
|
2952
|
+
}
|
|
2953
|
+
/**
|
|
2954
|
+
* Instance accessor for the multi-user shared-sort detector. Mirrors the
|
|
2955
|
+
* standalone `detectMultiUserSharedSort()` export — provided so callers
|
|
2956
|
+
* holding a compiler instance can run the check without a second import.
|
|
2957
|
+
*/
|
|
2958
|
+
detectMultiUserSharedSort(composition) {
|
|
2959
|
+
return detectMultiUserSharedSort(composition);
|
|
2960
|
+
}
|
|
2961
|
+
// ─── Data extraction ────────────────────────────────────────────────────────
|
|
2962
|
+
extractGaussianData(composition) {
|
|
2963
|
+
for (const obj of composition.objects ?? []) {
|
|
2964
|
+
const trait = obj.traits?.find((t) => t.name === "gaussian_splat");
|
|
2965
|
+
if (trait && trait.config) {
|
|
2966
|
+
const p = trait.config;
|
|
2967
|
+
const positions = this.parseFloatArray(p.positions);
|
|
2968
|
+
const scales = this.parseFloatArray(p.scales);
|
|
2969
|
+
const rotations = this.parseFloatArray(p.rotations);
|
|
2970
|
+
let colors = this.parseFloatArray(p.colors);
|
|
2971
|
+
const opacities = this.parseFloatArray(p.opacities);
|
|
2972
|
+
if (positions && scales && rotations && colors && opacities) {
|
|
2973
|
+
const count = positions.length / 3;
|
|
2974
|
+
if (scales.length === count * 3 && rotations.length === count * 4 && (colors.length === count * 4 || colors.length === count * 3) && opacities.length === count) {
|
|
2975
|
+
if (colors.length === count * 3) {
|
|
2976
|
+
colors = this.expandRgbToRgba(colors, count);
|
|
2977
|
+
}
|
|
2978
|
+
return {
|
|
2979
|
+
data: {
|
|
2980
|
+
positions,
|
|
2981
|
+
scales,
|
|
2982
|
+
rotations,
|
|
2983
|
+
colors,
|
|
2984
|
+
opacities,
|
|
2985
|
+
shCoefficients: this.parseFloatArray(p.shCoefficients),
|
|
2986
|
+
count
|
|
2987
|
+
}
|
|
2988
|
+
};
|
|
2989
|
+
}
|
|
2990
|
+
}
|
|
2991
|
+
if (positions && colors) {
|
|
2992
|
+
const count = positions.length / 3;
|
|
2993
|
+
if (colors.length === count * 3 || colors.length === count * 4) {
|
|
2994
|
+
return { data: this.computeCovarianceFromPointCloud(positions, colors) };
|
|
2995
|
+
}
|
|
2996
|
+
}
|
|
2997
|
+
}
|
|
2998
|
+
}
|
|
2999
|
+
return {
|
|
3000
|
+
data: this.generateDemoGrid(),
|
|
3001
|
+
warnings: ["No valid @gaussian_splat trait data found; falling back to demo grid"]
|
|
3002
|
+
};
|
|
3003
|
+
}
|
|
3004
|
+
expandRgbToRgba(rgb, count) {
|
|
3005
|
+
const rgba = new Float32Array(count * 4);
|
|
3006
|
+
for (let i = 0; i < count; i++) {
|
|
3007
|
+
rgba[i * 4] = rgb[i * 3];
|
|
3008
|
+
rgba[i * 4 + 1] = rgb[i * 3 + 1];
|
|
3009
|
+
rgba[i * 4 + 2] = rgb[i * 3 + 2];
|
|
3010
|
+
rgba[i * 4 + 3] = 1;
|
|
3011
|
+
}
|
|
3012
|
+
return rgba;
|
|
3013
|
+
}
|
|
3014
|
+
parseFloatArray(value) {
|
|
3015
|
+
if (value instanceof Float32Array) return value;
|
|
3016
|
+
if (Array.isArray(value)) {
|
|
3017
|
+
const nums = value.map((v) => typeof v === "number" ? v : Number(v));
|
|
3018
|
+
return new Float32Array(nums);
|
|
3019
|
+
}
|
|
3020
|
+
return void 0;
|
|
3021
|
+
}
|
|
3022
|
+
// ─── Covariance from point cloud (HoloMap raw output) ───────────────────────
|
|
3023
|
+
/**
|
|
3024
|
+
* Compute per-point Gaussian parameters from a raw point cloud.
|
|
3025
|
+
*
|
|
3026
|
+
* For each point we find k nearest neighbours, compute the 3x3 covariance
|
|
3027
|
+
* matrix of that neighbourhood, eigen-decompose it via Jacobi rotations,
|
|
3028
|
+
* and derive:
|
|
3029
|
+
* - scales = sqrt(eigenvalues) (isotropic minimum clamp)
|
|
3030
|
+
* - rotation = quaternion from eigenvector basis
|
|
3031
|
+
* - opacity = 1.0 (uniform)
|
|
3032
|
+
* - colors = passed through (RGB expanded to RGBA if needed)
|
|
3033
|
+
*/
|
|
3034
|
+
computeCovarianceFromPointCloud(positions, colors) {
|
|
3035
|
+
const n = Math.floor(positions.length / 3);
|
|
3036
|
+
const k = Math.min(12, Math.max(4, n - 1));
|
|
3037
|
+
const scales = new Float32Array(n * 3);
|
|
3038
|
+
const rotations = new Float32Array(n * 4);
|
|
3039
|
+
const opacities = new Float32Array(n);
|
|
3040
|
+
let rgbaColors;
|
|
3041
|
+
if (colors.length === n * 3) {
|
|
3042
|
+
rgbaColors = this.expandRgbToRgba(colors, n);
|
|
3043
|
+
} else {
|
|
3044
|
+
rgbaColors = colors;
|
|
3045
|
+
}
|
|
3046
|
+
const grid = this.buildSpatialGrid(positions, n);
|
|
3047
|
+
for (let i = 0; i < n; i++) {
|
|
3048
|
+
const px = positions[i * 3];
|
|
3049
|
+
const py = positions[i * 3 + 1];
|
|
3050
|
+
const pz = positions[i * 3 + 2];
|
|
3051
|
+
const neighbours = this.findKNearestNeighbours(grid, positions, n, px, py, pz, k, i);
|
|
3052
|
+
let meanX = 0, meanY = 0, meanZ = 0;
|
|
3053
|
+
for (const idx of neighbours) {
|
|
3054
|
+
meanX += positions[idx * 3];
|
|
3055
|
+
meanY += positions[idx * 3 + 1];
|
|
3056
|
+
meanZ += positions[idx * 3 + 2];
|
|
3057
|
+
}
|
|
3058
|
+
const invM = 1 / neighbours.length;
|
|
3059
|
+
meanX *= invM;
|
|
3060
|
+
meanY *= invM;
|
|
3061
|
+
meanZ *= invM;
|
|
3062
|
+
let c00 = 0, c01 = 0, c02 = 0, c11 = 0, c12 = 0, c22 = 0;
|
|
3063
|
+
for (const idx of neighbours) {
|
|
3064
|
+
const dx = positions[idx * 3] - meanX;
|
|
3065
|
+
const dy = positions[idx * 3 + 1] - meanY;
|
|
3066
|
+
const dz = positions[idx * 3 + 2] - meanZ;
|
|
3067
|
+
c00 += dx * dx;
|
|
3068
|
+
c01 += dx * dy;
|
|
3069
|
+
c02 += dx * dz;
|
|
3070
|
+
c11 += dy * dy;
|
|
3071
|
+
c12 += dy * dz;
|
|
3072
|
+
c22 += dz * dz;
|
|
3073
|
+
}
|
|
3074
|
+
const invLen = 1 / (neighbours.length - 1 || 1);
|
|
3075
|
+
c00 *= invLen;
|
|
3076
|
+
c01 *= invLen;
|
|
3077
|
+
c02 *= invLen;
|
|
3078
|
+
c11 *= invLen;
|
|
3079
|
+
c12 *= invLen;
|
|
3080
|
+
c22 *= invLen;
|
|
3081
|
+
const ev = this.jacobiEigenvalues3([
|
|
3082
|
+
c00,
|
|
3083
|
+
c01,
|
|
3084
|
+
c02,
|
|
3085
|
+
c01,
|
|
3086
|
+
c11,
|
|
3087
|
+
c12,
|
|
3088
|
+
c02,
|
|
3089
|
+
c12,
|
|
3090
|
+
c22
|
|
3091
|
+
]);
|
|
3092
|
+
const minScale = 1e-3;
|
|
3093
|
+
scales[i * 3] = Math.max(minScale, Math.sqrt(Math.abs(ev.values[0])));
|
|
3094
|
+
scales[i * 3 + 1] = Math.max(minScale, Math.sqrt(Math.abs(ev.values[1])));
|
|
3095
|
+
scales[i * 3 + 2] = Math.max(minScale, Math.sqrt(Math.abs(ev.values[2])));
|
|
3096
|
+
const q = this.rotationMatrixToQuaternion(ev.vectors);
|
|
3097
|
+
rotations[i * 4] = q[0];
|
|
3098
|
+
rotations[i * 4 + 1] = q[1];
|
|
3099
|
+
rotations[i * 4 + 2] = q[2];
|
|
3100
|
+
rotations[i * 4 + 3] = q[3];
|
|
3101
|
+
opacities[i] = 1;
|
|
3102
|
+
}
|
|
3103
|
+
return {
|
|
3104
|
+
positions,
|
|
3105
|
+
scales,
|
|
3106
|
+
rotations,
|
|
3107
|
+
colors: rgbaColors,
|
|
3108
|
+
opacities,
|
|
3109
|
+
count: n
|
|
3110
|
+
};
|
|
3111
|
+
}
|
|
3112
|
+
/** Simple uniform-grid spatial hash for k-NN acceleration. */
|
|
3113
|
+
buildSpatialGrid(positions, n) {
|
|
3114
|
+
let minX = Infinity, minY = Infinity, minZ = Infinity;
|
|
3115
|
+
let maxX = -Infinity, maxY = -Infinity, maxZ = -Infinity;
|
|
3116
|
+
for (let i = 0; i < n; i++) {
|
|
3117
|
+
const x = positions[i * 3];
|
|
3118
|
+
const y = positions[i * 3 + 1];
|
|
3119
|
+
const z = positions[i * 3 + 2];
|
|
3120
|
+
if (x < minX) minX = x;
|
|
3121
|
+
if (y < minY) minY = y;
|
|
3122
|
+
if (z < minZ) minZ = z;
|
|
3123
|
+
if (x > maxX) maxX = x;
|
|
3124
|
+
if (y > maxY) maxY = y;
|
|
3125
|
+
if (z > maxZ) maxZ = z;
|
|
3126
|
+
}
|
|
3127
|
+
const extent = Math.max(maxX - minX, maxY - minY, maxZ - minZ, 1e-6);
|
|
3128
|
+
const cellsPerAxis = Math.max(1, Math.round(Math.pow(n / 8, 1 / 3)));
|
|
3129
|
+
const cellSize = extent / cellsPerAxis;
|
|
3130
|
+
const grid = /* @__PURE__ */ new Map();
|
|
3131
|
+
for (let i = 0; i < n; i++) {
|
|
3132
|
+
const cx = Math.floor((positions[i * 3] - minX) / cellSize);
|
|
3133
|
+
const cy = Math.floor((positions[i * 3 + 1] - minY) / cellSize);
|
|
3134
|
+
const cz = Math.floor((positions[i * 3 + 2] - minZ) / cellSize);
|
|
3135
|
+
const key = `${cx},${cy},${cz}`;
|
|
3136
|
+
const arr = grid.get(key);
|
|
3137
|
+
if (arr) {
|
|
3138
|
+
arr.push(i);
|
|
3139
|
+
} else {
|
|
3140
|
+
grid.set(key, [i]);
|
|
3141
|
+
}
|
|
3142
|
+
}
|
|
3143
|
+
return grid;
|
|
3144
|
+
}
|
|
3145
|
+
findKNearestNeighbours(grid, positions, n, px, py, pz, k, selfIdx) {
|
|
3146
|
+
if (n <= 2048) {
|
|
3147
|
+
const dists = [];
|
|
3148
|
+
for (let i = 0; i < n; i++) {
|
|
3149
|
+
const dx = positions[i * 3] - px;
|
|
3150
|
+
const dy = positions[i * 3 + 1] - py;
|
|
3151
|
+
const dz = positions[i * 3 + 2] - pz;
|
|
3152
|
+
dists.push({ idx: i, d2: dx * dx + dy * dy + dz * dz });
|
|
3153
|
+
}
|
|
3154
|
+
dists.sort((a, b) => a.d2 - b.d2);
|
|
3155
|
+
return dists.slice(0, k + 1).map((d) => d.idx);
|
|
3156
|
+
}
|
|
3157
|
+
const radius = this.estimateSearchRadius(positions, n);
|
|
3158
|
+
const radius2 = radius * radius;
|
|
3159
|
+
const candidates = [];
|
|
3160
|
+
for (let i = 0; i < n; i++) {
|
|
3161
|
+
const dx = positions[i * 3] - px;
|
|
3162
|
+
const dy = positions[i * 3 + 1] - py;
|
|
3163
|
+
const dz = positions[i * 3 + 2] - pz;
|
|
3164
|
+
const d2 = dx * dx + dy * dy + dz * dz;
|
|
3165
|
+
if (d2 <= radius2) {
|
|
3166
|
+
candidates.push({ idx: i, d2 });
|
|
3167
|
+
}
|
|
3168
|
+
}
|
|
3169
|
+
candidates.sort((a, b) => a.d2 - b.d2);
|
|
3170
|
+
return candidates.slice(0, k + 1).map((c) => c.idx);
|
|
3171
|
+
}
|
|
3172
|
+
estimateSearchRadius(positions, n) {
|
|
3173
|
+
const sampleCount = Math.min(256, n);
|
|
3174
|
+
let totalDist = 0;
|
|
3175
|
+
let counted = 0;
|
|
3176
|
+
const step = Math.max(1, Math.floor(n / sampleCount));
|
|
3177
|
+
for (let i = 0; i < n; i += step) {
|
|
3178
|
+
let minD2 = Infinity;
|
|
3179
|
+
const px = positions[i * 3];
|
|
3180
|
+
const py = positions[i * 3 + 1];
|
|
3181
|
+
const pz = positions[i * 3 + 2];
|
|
3182
|
+
for (let j = 0; j < n; j++) {
|
|
3183
|
+
if (i === j) continue;
|
|
3184
|
+
const dx = positions[j * 3] - px;
|
|
3185
|
+
const dy = positions[j * 3 + 1] - py;
|
|
3186
|
+
const dz = positions[j * 3 + 2] - pz;
|
|
3187
|
+
const d2 = dx * dx + dy * dy + dz * dz;
|
|
3188
|
+
if (d2 < minD2) minD2 = d2;
|
|
3189
|
+
}
|
|
3190
|
+
if (minD2 < Infinity) {
|
|
3191
|
+
totalDist += Math.sqrt(minD2);
|
|
3192
|
+
counted++;
|
|
3193
|
+
}
|
|
3194
|
+
}
|
|
3195
|
+
const avg = counted > 0 ? totalDist / counted : 0.1;
|
|
3196
|
+
return avg * 3;
|
|
3197
|
+
}
|
|
3198
|
+
/** Jacobi eigenvalue decomposition for a 3x3 symmetric matrix.
|
|
3199
|
+
* Returns eigenvalues (descending) and eigenvectors as column-major 3x3.
|
|
3200
|
+
*/
|
|
3201
|
+
jacobiEigenvalues3(a) {
|
|
3202
|
+
let m = [
|
|
3203
|
+
[a[0], a[1], a[2]],
|
|
3204
|
+
[a[3], a[4], a[5]],
|
|
3205
|
+
[a[6], a[7], a[8]]
|
|
3206
|
+
];
|
|
3207
|
+
let v = [
|
|
3208
|
+
[1, 0, 0],
|
|
3209
|
+
[0, 1, 0],
|
|
3210
|
+
[0, 0, 1]
|
|
3211
|
+
];
|
|
3212
|
+
const eps = 1e-10;
|
|
3213
|
+
const maxSweeps = 50;
|
|
3214
|
+
for (let sweep = 0; sweep < maxSweeps; sweep++) {
|
|
3215
|
+
let offDiagSum = 0;
|
|
3216
|
+
for (let p = 0; p < 3; p++) {
|
|
3217
|
+
for (let q = p + 1; q < 3; q++) {
|
|
3218
|
+
offDiagSum += Math.abs(m[p][q]);
|
|
3219
|
+
if (Math.abs(m[p][q]) < eps) continue;
|
|
3220
|
+
const tau = (m[q][q] - m[p][p]) / (2 * m[p][q]);
|
|
3221
|
+
let t;
|
|
3222
|
+
if (tau >= 0) {
|
|
3223
|
+
t = 1 / (tau + Math.sqrt(1 + tau * tau));
|
|
3224
|
+
} else {
|
|
3225
|
+
t = 1 / (tau - Math.sqrt(1 + tau * tau));
|
|
3226
|
+
}
|
|
3227
|
+
const c = 1 / Math.sqrt(1 + t * t);
|
|
3228
|
+
const s = t * c;
|
|
3229
|
+
const mpp = m[p][p];
|
|
3230
|
+
const mqq = m[q][q];
|
|
3231
|
+
const mpq = m[p][q];
|
|
3232
|
+
m[p][p] = c * c * mpp - 2 * s * c * mpq + s * s * mqq;
|
|
3233
|
+
m[q][q] = s * s * mpp + 2 * s * c * mpq + c * c * mqq;
|
|
3234
|
+
m[p][q] = 0;
|
|
3235
|
+
m[q][p] = 0;
|
|
3236
|
+
for (let r = 0; r < 3; r++) {
|
|
3237
|
+
if (r !== p && r !== q) {
|
|
3238
|
+
const mr_p = m[r][p];
|
|
3239
|
+
const mr_q = m[r][q];
|
|
3240
|
+
m[r][p] = c * mr_p - s * mr_q;
|
|
3241
|
+
m[p][r] = m[r][p];
|
|
3242
|
+
m[r][q] = s * mr_p + c * mr_q;
|
|
3243
|
+
m[q][r] = m[r][q];
|
|
3244
|
+
}
|
|
3245
|
+
}
|
|
3246
|
+
for (let r = 0; r < 3; r++) {
|
|
3247
|
+
const vr_p = v[r][p];
|
|
3248
|
+
const vr_q = v[r][q];
|
|
3249
|
+
v[r][p] = c * vr_p - s * vr_q;
|
|
3250
|
+
v[r][q] = s * vr_p + c * vr_q;
|
|
3251
|
+
}
|
|
3252
|
+
}
|
|
3253
|
+
}
|
|
3254
|
+
if (offDiagSum < eps) break;
|
|
3255
|
+
}
|
|
3256
|
+
const vals = [m[0][0], m[1][1], m[2][2]];
|
|
3257
|
+
const cols = [
|
|
3258
|
+
[v[0][0], v[1][0], v[2][0]],
|
|
3259
|
+
[v[0][1], v[1][1], v[2][1]],
|
|
3260
|
+
[v[0][2], v[1][2], v[2][2]]
|
|
3261
|
+
];
|
|
3262
|
+
const order = [0, 1, 2].sort((i, j) => vals[j] - vals[i]);
|
|
3263
|
+
return {
|
|
3264
|
+
values: [vals[order[0]], vals[order[1]], vals[order[2]]],
|
|
3265
|
+
vectors: [
|
|
3266
|
+
cols[order[0]][0],
|
|
3267
|
+
cols[order[1]][0],
|
|
3268
|
+
cols[order[2]][0],
|
|
3269
|
+
cols[order[0]][1],
|
|
3270
|
+
cols[order[1]][1],
|
|
3271
|
+
cols[order[2]][1],
|
|
3272
|
+
cols[order[0]][2],
|
|
3273
|
+
cols[order[1]][2],
|
|
3274
|
+
cols[order[2]][2]
|
|
3275
|
+
]
|
|
3276
|
+
};
|
|
3277
|
+
}
|
|
3278
|
+
rotationMatrixToQuaternion(m) {
|
|
3279
|
+
const trace = m[0] + m[4] + m[8];
|
|
3280
|
+
let qw, qx, qy, qz;
|
|
3281
|
+
if (trace > 0) {
|
|
3282
|
+
const s = 0.5 / Math.sqrt(trace + 1);
|
|
3283
|
+
qw = 0.25 / s;
|
|
3284
|
+
qx = (m[5] - m[7]) * s;
|
|
3285
|
+
qy = (m[6] - m[2]) * s;
|
|
3286
|
+
qz = (m[1] - m[3]) * s;
|
|
3287
|
+
} else if (m[0] > m[4] && m[0] > m[8]) {
|
|
3288
|
+
const s = 2 * Math.sqrt(1 + m[0] - m[4] - m[8]);
|
|
3289
|
+
qw = (m[5] - m[7]) / s;
|
|
3290
|
+
qx = 0.25 * s;
|
|
3291
|
+
qy = (m[3] + m[1]) / s;
|
|
3292
|
+
qz = (m[6] + m[2]) / s;
|
|
3293
|
+
} else if (m[4] > m[8]) {
|
|
3294
|
+
const s = 2 * Math.sqrt(1 + m[4] - m[0] - m[8]);
|
|
3295
|
+
qw = (m[6] - m[2]) / s;
|
|
3296
|
+
qx = (m[3] + m[1]) / s;
|
|
3297
|
+
qy = 0.25 * s;
|
|
3298
|
+
qz = (m[7] + m[5]) / s;
|
|
3299
|
+
} else {
|
|
3300
|
+
const s = 2 * Math.sqrt(1 + m[8] - m[0] - m[4]);
|
|
3301
|
+
qw = (m[1] - m[3]) / s;
|
|
3302
|
+
qx = (m[6] + m[2]) / s;
|
|
3303
|
+
qy = (m[7] + m[5]) / s;
|
|
3304
|
+
qz = 0.25 * s;
|
|
3305
|
+
}
|
|
3306
|
+
const norm = Math.sqrt(qx * qx + qy * qy + qz * qz + qw * qw) || 1;
|
|
3307
|
+
return [qx / norm, qy / norm, qz / norm, qw / norm];
|
|
3308
|
+
}
|
|
3309
|
+
generateDemoGrid() {
|
|
3310
|
+
const count = 8;
|
|
3311
|
+
const positions = new Float32Array(count * 3);
|
|
3312
|
+
const scales = new Float32Array(count * 3);
|
|
3313
|
+
const rotations = new Float32Array(count * 4);
|
|
3314
|
+
const colors = new Float32Array(count * 4);
|
|
3315
|
+
const opacities = new Float32Array(count);
|
|
3316
|
+
let i = 0;
|
|
3317
|
+
for (let x = 0; x < 2; x++) {
|
|
3318
|
+
for (let y = 0; y < 2; y++) {
|
|
3319
|
+
for (let z = 0; z < 2; z++) {
|
|
3320
|
+
positions[i * 3] = x * 0.5;
|
|
3321
|
+
positions[i * 3 + 1] = y * 0.5;
|
|
3322
|
+
positions[i * 3 + 2] = z * 0.5;
|
|
3323
|
+
scales[i * 3] = 0.1;
|
|
3324
|
+
scales[i * 3 + 1] = 0.1;
|
|
3325
|
+
scales[i * 3 + 2] = 0.1;
|
|
3326
|
+
rotations[i * 4] = 0;
|
|
3327
|
+
rotations[i * 4 + 1] = 0;
|
|
3328
|
+
rotations[i * 4 + 2] = 0;
|
|
3329
|
+
rotations[i * 4 + 3] = 1;
|
|
3330
|
+
colors[i * 4] = 0.8;
|
|
3331
|
+
colors[i * 4 + 1] = 0.3;
|
|
3332
|
+
colors[i * 4 + 2] = 0.3;
|
|
3333
|
+
colors[i * 4 + 3] = 1;
|
|
3334
|
+
opacities[i] = 1;
|
|
3335
|
+
i++;
|
|
3336
|
+
}
|
|
3337
|
+
}
|
|
3338
|
+
}
|
|
3339
|
+
return { positions, scales, rotations, colors, opacities, count };
|
|
3340
|
+
}
|
|
3341
|
+
// ─── glTF builder ─────────────────────────────────────────────────────────
|
|
3342
|
+
buildGLTF(data) {
|
|
3343
|
+
const N = data.count;
|
|
3344
|
+
const bufferData = this.buildBuffer(data);
|
|
3345
|
+
const bufferViews = this.buildBufferViews(N);
|
|
3346
|
+
const accessors = this.buildAccessors(N);
|
|
3347
|
+
const primitive = {
|
|
3348
|
+
attributes: {
|
|
3349
|
+
POSITION: 0,
|
|
3350
|
+
_ROTATION: 1,
|
|
3351
|
+
_SCALE: 2,
|
|
3352
|
+
_OPACITY: 3,
|
|
3353
|
+
COLOR_0: 4
|
|
3354
|
+
},
|
|
3355
|
+
mode: 0,
|
|
3356
|
+
// POINTS
|
|
3357
|
+
extensions: {
|
|
3358
|
+
KHR_gaussian_splatting: {
|
|
3359
|
+
colorSpace: this.options.colorSpace
|
|
3360
|
+
}
|
|
3361
|
+
}
|
|
3362
|
+
};
|
|
3363
|
+
const mesh = {
|
|
3364
|
+
name: "GaussianSplatMesh",
|
|
3365
|
+
primitives: [primitive]
|
|
3366
|
+
};
|
|
3367
|
+
const node = {
|
|
3368
|
+
name: "GaussianSplatNode",
|
|
3369
|
+
mesh: 0
|
|
3370
|
+
};
|
|
3371
|
+
const gltf = {
|
|
3372
|
+
asset: {
|
|
3373
|
+
version: "2.0",
|
|
3374
|
+
generator: this.options.generator,
|
|
3375
|
+
...this.options.copyright ? { copyright: this.options.copyright } : {}
|
|
3376
|
+
},
|
|
3377
|
+
scene: 0,
|
|
3378
|
+
scenes: [{ name: "Scene", nodes: [0] }],
|
|
3379
|
+
nodes: [node],
|
|
3380
|
+
meshes: [mesh],
|
|
3381
|
+
accessors,
|
|
3382
|
+
bufferViews,
|
|
3383
|
+
buffers: [{ byteLength: bufferData.byteLength }],
|
|
3384
|
+
extensionsUsed: ["KHR_gaussian_splatting"]
|
|
3385
|
+
};
|
|
3386
|
+
const stats = {
|
|
3387
|
+
nodeCount: 1,
|
|
3388
|
+
meshCount: 1,
|
|
3389
|
+
materialCount: 0,
|
|
3390
|
+
textureCount: 0,
|
|
3391
|
+
animationCount: 0,
|
|
3392
|
+
totalVertices: N,
|
|
3393
|
+
totalTriangles: 0,
|
|
3394
|
+
fileSizeBytes: 0
|
|
3395
|
+
};
|
|
3396
|
+
if (this.options.format === "glb") {
|
|
3397
|
+
const binary = this.createGLB(gltf, bufferData);
|
|
3398
|
+
stats.fileSizeBytes = binary.byteLength;
|
|
3399
|
+
return { binary, stats };
|
|
3400
|
+
}
|
|
3401
|
+
stats.fileSizeBytes = JSON.stringify(gltf).length + bufferData.byteLength;
|
|
3402
|
+
return { json: gltf, buffer: bufferData, stats };
|
|
3403
|
+
}
|
|
3404
|
+
// ─── Binary layout ──────────────────────────────────────────────────────────
|
|
3405
|
+
buildBuffer(data) {
|
|
3406
|
+
const N = data.count;
|
|
3407
|
+
const logScales = new Float32Array(N * 3);
|
|
3408
|
+
for (let i = 0; i < N * 3; i++) {
|
|
3409
|
+
logScales[i] = Math.log(Math.max(data.scales[i], 1e-8));
|
|
3410
|
+
}
|
|
3411
|
+
const size = N * 3 * 4 + N * 4 * 4 + N * 3 * 4 + N * 4 + N * 4 * 4;
|
|
3412
|
+
const buf = new Uint8Array(size);
|
|
3413
|
+
let off = 0;
|
|
3414
|
+
const write = (arr) => {
|
|
3415
|
+
const view = new Uint8Array(arr.buffer, arr.byteOffset, arr.byteLength);
|
|
3416
|
+
buf.set(view, off);
|
|
3417
|
+
off += arr.byteLength;
|
|
3418
|
+
};
|
|
3419
|
+
write(data.positions);
|
|
3420
|
+
write(data.rotations);
|
|
3421
|
+
write(logScales);
|
|
3422
|
+
write(data.opacities);
|
|
3423
|
+
write(data.colors);
|
|
3424
|
+
return buf;
|
|
3425
|
+
}
|
|
3426
|
+
buildBufferViews(N) {
|
|
3427
|
+
let off = 0;
|
|
3428
|
+
const views = [];
|
|
3429
|
+
const add = (len) => {
|
|
3430
|
+
views.push({ buffer: 0, byteOffset: off, byteLength: len });
|
|
3431
|
+
off += len;
|
|
3432
|
+
return views.length - 1;
|
|
3433
|
+
};
|
|
3434
|
+
add(N * 3 * 4);
|
|
3435
|
+
add(N * 4 * 4);
|
|
3436
|
+
add(N * 3 * 4);
|
|
3437
|
+
add(N * 4);
|
|
3438
|
+
add(N * 4 * 4);
|
|
3439
|
+
return views;
|
|
3440
|
+
}
|
|
3441
|
+
buildAccessors(N) {
|
|
3442
|
+
let bv = 0;
|
|
3443
|
+
const accs = [];
|
|
3444
|
+
const add = (type, compType, count) => {
|
|
3445
|
+
accs.push({ bufferView: bv++, componentType: compType, count, type });
|
|
3446
|
+
};
|
|
3447
|
+
add("VEC3", 5126, N);
|
|
3448
|
+
add("VEC4", 5126, N);
|
|
3449
|
+
add("VEC3", 5126, N);
|
|
3450
|
+
add("SCALAR", 5126, N);
|
|
3451
|
+
add("VEC4", 5126, N);
|
|
3452
|
+
return accs;
|
|
3453
|
+
}
|
|
3454
|
+
// ─── GLB assembler (mirrors GLTFPipeline) ─────────────────────────────────
|
|
3455
|
+
createGLB(gltf, buffer) {
|
|
3456
|
+
const jsonString = JSON.stringify(gltf);
|
|
3457
|
+
const jsonBuffer = new TextEncoder().encode(jsonString);
|
|
3458
|
+
const jsonPadding = (4 - jsonBuffer.byteLength % 4) % 4;
|
|
3459
|
+
const paddedJsonLength = jsonBuffer.byteLength + jsonPadding;
|
|
3460
|
+
const binPadding = (4 - buffer.byteLength % 4) % 4;
|
|
3461
|
+
const paddedBinLength = buffer.byteLength + binPadding;
|
|
3462
|
+
const totalSize = 12 + 8 + paddedJsonLength + 8 + paddedBinLength;
|
|
3463
|
+
const output = new ArrayBuffer(totalSize);
|
|
3464
|
+
const view = new DataView(output);
|
|
3465
|
+
const bytes = new Uint8Array(output);
|
|
3466
|
+
let offset = 0;
|
|
3467
|
+
view.setUint32(offset, 1179937895, true);
|
|
3468
|
+
offset += 4;
|
|
3469
|
+
view.setUint32(offset, 2, true);
|
|
3470
|
+
offset += 4;
|
|
3471
|
+
view.setUint32(offset, totalSize, true);
|
|
3472
|
+
offset += 4;
|
|
3473
|
+
view.setUint32(offset, paddedJsonLength, true);
|
|
3474
|
+
offset += 4;
|
|
3475
|
+
view.setUint32(offset, 1313821514, true);
|
|
3476
|
+
offset += 4;
|
|
3477
|
+
bytes.set(jsonBuffer, offset);
|
|
3478
|
+
offset += jsonBuffer.byteLength;
|
|
3479
|
+
for (let i = 0; i < jsonPadding; i++) bytes[offset++] = 32;
|
|
3480
|
+
view.setUint32(offset, paddedBinLength, true);
|
|
3481
|
+
offset += 4;
|
|
3482
|
+
view.setUint32(offset, 5130562, true);
|
|
3483
|
+
offset += 4;
|
|
3484
|
+
bytes.set(buffer, offset);
|
|
3485
|
+
offset += buffer.byteLength;
|
|
3486
|
+
for (let i = 0; i < binPadding; i++) bytes[offset++] = 0;
|
|
3487
|
+
return new Uint8Array(output);
|
|
3488
|
+
}
|
|
3489
|
+
};
|
|
3490
|
+
function createGaussianSplattingCompiler(options) {
|
|
3491
|
+
return new GaussianSplattingCompiler(options);
|
|
3492
|
+
}
|
|
3493
|
+
|
|
3494
|
+
// src/compiler/SpatialPartitionPass.ts
|
|
3495
|
+
var MAX_DEPTH = 8;
|
|
3496
|
+
var SCALE_PER_SPLAT_UNIT = 1e-6;
|
|
3497
|
+
var MIN_SCALE = 1e-9;
|
|
3498
|
+
var SpatialPartitionPass = class {
|
|
3499
|
+
constructor(options = {}) {
|
|
3500
|
+
this.maxDepth = options.maxDepth ?? MAX_DEPTH;
|
|
3501
|
+
this.scalePerSplatUnit = options.scalePerSplatUnit ?? SCALE_PER_SPLAT_UNIT;
|
|
3502
|
+
this.includeUnpositioned = options.includeUnpositioned ?? true;
|
|
3503
|
+
}
|
|
3504
|
+
/**
|
|
3505
|
+
* Run the pass over a HoloComposition and return the serializable result.
|
|
3506
|
+
*/
|
|
3507
|
+
run(composition) {
|
|
3508
|
+
const rawSources = [];
|
|
3509
|
+
this.collectFromComposition(composition, rawSources);
|
|
3510
|
+
if (rawSources.length === 0) {
|
|
3511
|
+
return this.emptyResult(composition.name);
|
|
3512
|
+
}
|
|
3513
|
+
const maxScaleInScene = Math.max(
|
|
3514
|
+
...rawSources.map((s) => Math.max(s.maxSplats * this.scalePerSplatUnit, MIN_SCALE))
|
|
3515
|
+
);
|
|
3516
|
+
const anchors = [];
|
|
3517
|
+
const lodDist = {};
|
|
3518
|
+
let objectsWalked = 0;
|
|
3519
|
+
for (const src of rawSources) {
|
|
3520
|
+
objectsWalked++;
|
|
3521
|
+
if (!this.includeUnpositioned && !src.hasPosition) continue;
|
|
3522
|
+
const scale = Math.max(src.maxSplats * this.scalePerSplatUnit, MIN_SCALE);
|
|
3523
|
+
const lodLevel = this.computeLODLevel(scale, maxScaleInScene);
|
|
3524
|
+
const provenanceHash = src.sourceFile ? deterministicHash(`file:${src.sourceFile}:${src.maxSplats}`) : deterministicHash(`${src.objectName}:${lodLevel}:${src.maxSplats}`);
|
|
3525
|
+
const anchor = {
|
|
3526
|
+
id: `spa_${sanitiseId(src.objectName)}_l${lodLevel}`,
|
|
3527
|
+
position: src.position,
|
|
3528
|
+
scale,
|
|
3529
|
+
lodLevel,
|
|
3530
|
+
gaussianCount: src.maxSplats,
|
|
3531
|
+
importance: src.importance,
|
|
3532
|
+
provenanceHash,
|
|
3533
|
+
...src.sourceFile ? { sourceFile: src.sourceFile } : {}
|
|
3534
|
+
};
|
|
3535
|
+
anchors.push(anchor);
|
|
3536
|
+
lodDist[lodLevel] = (lodDist[lodLevel] ?? 0) + 1;
|
|
3537
|
+
}
|
|
3538
|
+
anchors.sort((a, b) => a.lodLevel - b.lodLevel);
|
|
3539
|
+
const bounds = computeBounds(anchors);
|
|
3540
|
+
const merkleRoot = computeMerkleRoot(anchors);
|
|
3541
|
+
const totalGaussians = anchors.reduce((s, a) => s + a.gaussianCount, 0);
|
|
3542
|
+
const maxLodLevel = anchors.length > 0 ? Math.max(...anchors.map((a) => a.lodLevel)) : 0;
|
|
3543
|
+
return {
|
|
3544
|
+
schema: "spatial-partition/v1",
|
|
3545
|
+
compositionName: composition.name,
|
|
3546
|
+
generatedAt: (/* @__PURE__ */ new Date()).toISOString(),
|
|
3547
|
+
anchors,
|
|
3548
|
+
bounds,
|
|
3549
|
+
merkleRoot,
|
|
3550
|
+
totalGaussians,
|
|
3551
|
+
stats: {
|
|
3552
|
+
objectsWalked,
|
|
3553
|
+
anchorsEmitted: anchors.length,
|
|
3554
|
+
lodLevelDistribution: lodDist,
|
|
3555
|
+
maxLodLevel,
|
|
3556
|
+
maxScaleInScene
|
|
3557
|
+
}
|
|
3558
|
+
};
|
|
3559
|
+
}
|
|
3560
|
+
// ── LOD level computation (same algorithm as OctreeLODSystem.computeLODLevelFromScale) ──
|
|
3561
|
+
computeLODLevel(scale, maxScaleInScene) {
|
|
3562
|
+
if (scale <= 0 || maxScaleInScene <= 0) return this.maxDepth - 1;
|
|
3563
|
+
if (scale >= maxScaleInScene) return 0;
|
|
3564
|
+
const ratio = maxScaleInScene / scale;
|
|
3565
|
+
const level = Math.floor(Math.log2(ratio));
|
|
3566
|
+
return Math.min(Math.max(0, level), this.maxDepth - 1);
|
|
3567
|
+
}
|
|
3568
|
+
// ── AST Walk (mirrors GaussianBudgetAnalyzer.collectGaussianSources) ─────────
|
|
3569
|
+
collectFromComposition(composition, out) {
|
|
3570
|
+
if (composition.objects) {
|
|
3571
|
+
for (const obj of composition.objects) {
|
|
3572
|
+
this.collectFromObject(obj, out);
|
|
3573
|
+
}
|
|
3574
|
+
}
|
|
3575
|
+
if (composition.spatialGroups) {
|
|
3576
|
+
for (const group of composition.spatialGroups) {
|
|
3577
|
+
this.collectFromGroup(group, out);
|
|
3578
|
+
}
|
|
3579
|
+
}
|
|
3580
|
+
if (composition.conditionals) {
|
|
3581
|
+
for (const cond of composition.conditionals) {
|
|
3582
|
+
if (cond.objects) {
|
|
3583
|
+
for (const obj of cond.objects) this.collectFromObject(obj, out);
|
|
3584
|
+
}
|
|
3585
|
+
if (cond.elseObjects) {
|
|
3586
|
+
for (const obj of cond.elseObjects) this.collectFromObject(obj, out);
|
|
3587
|
+
}
|
|
3588
|
+
}
|
|
3589
|
+
}
|
|
3590
|
+
if (composition.iterators) {
|
|
3591
|
+
for (const iter of composition.iterators) {
|
|
3592
|
+
if (iter.objects) {
|
|
3593
|
+
for (const obj of iter.objects) this.collectFromObject(obj, out);
|
|
3594
|
+
}
|
|
3595
|
+
}
|
|
3596
|
+
}
|
|
3597
|
+
}
|
|
3598
|
+
collectFromObject(obj, out) {
|
|
3599
|
+
if (obj.traits) {
|
|
3600
|
+
for (const trait of obj.traits) {
|
|
3601
|
+
if (trait.name === "gaussian_splat") {
|
|
3602
|
+
const src = this.extractSource(obj, trait);
|
|
3603
|
+
if (src) out.push(src);
|
|
3604
|
+
}
|
|
3605
|
+
}
|
|
3606
|
+
}
|
|
3607
|
+
if (obj.children) {
|
|
3608
|
+
for (const child of obj.children) {
|
|
3609
|
+
this.collectFromObject(child, out);
|
|
3610
|
+
}
|
|
3611
|
+
}
|
|
3612
|
+
}
|
|
3613
|
+
collectFromGroup(group, out) {
|
|
3614
|
+
if (group.objects) {
|
|
3615
|
+
for (const obj of group.objects) this.collectFromObject(obj, out);
|
|
3616
|
+
}
|
|
3617
|
+
if (group.groups) {
|
|
3618
|
+
for (const sub of group.groups) this.collectFromGroup(sub, out);
|
|
3619
|
+
}
|
|
3620
|
+
}
|
|
3621
|
+
extractSource(obj, trait) {
|
|
3622
|
+
const config = trait.config ?? {};
|
|
3623
|
+
const maxSplats = typeof config.max_splats === "number" ? config.max_splats : 5e4;
|
|
3624
|
+
const sourceFile = typeof config.src === "string" ? config.src : typeof config.source === "string" ? config.source : void 0;
|
|
3625
|
+
const importance = typeof config.importance === "number" ? Math.max(0, Math.min(1, config.importance)) : 0.5;
|
|
3626
|
+
let posArr = null;
|
|
3627
|
+
if (obj.position && typeof obj.position.x === "number") {
|
|
3628
|
+
posArr = [obj.position.x, obj.position.y, obj.position.z];
|
|
3629
|
+
} else {
|
|
3630
|
+
const posProp = obj.properties?.find((p) => p.key === "position")?.value;
|
|
3631
|
+
if (Array.isArray(posProp) && posProp.length >= 3) {
|
|
3632
|
+
posArr = [Number(posProp[0]), Number(posProp[1]), Number(posProp[2])];
|
|
3633
|
+
} else if (posProp !== null && typeof posProp === "object" && !Array.isArray(posProp) && typeof posProp["x"] === "number") {
|
|
3634
|
+
const pobj = posProp;
|
|
3635
|
+
posArr = [pobj.x, pobj.y, pobj.z];
|
|
3636
|
+
}
|
|
3637
|
+
}
|
|
3638
|
+
return {
|
|
3639
|
+
objectName: obj.name ?? `unnamed_${Math.random().toString(36).slice(2, 7)}`,
|
|
3640
|
+
position: posArr ?? [0, 0, 0],
|
|
3641
|
+
hasPosition: posArr !== null,
|
|
3642
|
+
maxSplats,
|
|
3643
|
+
sourceFile,
|
|
3644
|
+
importance
|
|
3645
|
+
};
|
|
3646
|
+
}
|
|
3647
|
+
// ── Empty-composition fast path ─────────────────────────────────────────────
|
|
3648
|
+
emptyResult(compositionName) {
|
|
3649
|
+
return {
|
|
3650
|
+
schema: "spatial-partition/v1",
|
|
3651
|
+
compositionName,
|
|
3652
|
+
generatedAt: (/* @__PURE__ */ new Date()).toISOString(),
|
|
3653
|
+
anchors: [],
|
|
3654
|
+
bounds: {
|
|
3655
|
+
min: { x: 0, y: 0, z: 0 },
|
|
3656
|
+
max: { x: 0, y: 0, z: 0 },
|
|
3657
|
+
center: { x: 0, y: 0, z: 0 },
|
|
3658
|
+
halfSize: 0
|
|
3659
|
+
},
|
|
3660
|
+
merkleRoot: "0".repeat(64),
|
|
3661
|
+
totalGaussians: 0,
|
|
3662
|
+
stats: {
|
|
3663
|
+
objectsWalked: 0,
|
|
3664
|
+
anchorsEmitted: 0,
|
|
3665
|
+
lodLevelDistribution: {},
|
|
3666
|
+
maxLodLevel: 0,
|
|
3667
|
+
maxScaleInScene: 0
|
|
3668
|
+
}
|
|
3669
|
+
};
|
|
3670
|
+
}
|
|
3671
|
+
};
|
|
3672
|
+
function deterministicHash(input) {
|
|
3673
|
+
let h0 = 2166136261;
|
|
3674
|
+
let h1 = 3521423859;
|
|
3675
|
+
for (let i = 0; i < input.length; i++) {
|
|
3676
|
+
const c = input.charCodeAt(i);
|
|
3677
|
+
h0 = Math.imul(h0 ^ c, 16777619) >>> 0;
|
|
3678
|
+
h1 = Math.imul(h1 ^ c, 16777619) >>> 0;
|
|
3679
|
+
}
|
|
3680
|
+
const hex0 = h0.toString(16).padStart(8, "0");
|
|
3681
|
+
const hex1 = h1.toString(16).padStart(8, "0");
|
|
3682
|
+
const base = (hex0 + hex1).repeat(4).slice(0, 64);
|
|
3683
|
+
return base;
|
|
3684
|
+
}
|
|
3685
|
+
function computeMerkleRoot(anchors) {
|
|
3686
|
+
if (anchors.length === 0) return "0".repeat(64);
|
|
3687
|
+
const sorted = [...anchors].sort((a, b) => a.id.localeCompare(b.id));
|
|
3688
|
+
const bytes = new Uint8Array(32);
|
|
3689
|
+
for (const anchor of sorted) {
|
|
3690
|
+
const hash = anchor.provenanceHash.slice(0, 64).padEnd(64, "0");
|
|
3691
|
+
for (let i = 0; i < 32; i++) {
|
|
3692
|
+
const byteHex = hash.slice(i * 2, i * 2 + 2);
|
|
3693
|
+
bytes[i] ^= parseInt(byteHex, 16) || 0;
|
|
3694
|
+
}
|
|
3695
|
+
}
|
|
3696
|
+
return Array.from(bytes).map((b) => b.toString(16).padStart(2, "0")).join("");
|
|
3697
|
+
}
|
|
3698
|
+
function computeBounds(anchors) {
|
|
3699
|
+
if (anchors.length === 0) {
|
|
3700
|
+
return {
|
|
3701
|
+
min: { x: 0, y: 0, z: 0 },
|
|
3702
|
+
max: { x: 0, y: 0, z: 0 },
|
|
3703
|
+
center: { x: 0, y: 0, z: 0 },
|
|
3704
|
+
halfSize: 0
|
|
3705
|
+
};
|
|
3706
|
+
}
|
|
3707
|
+
let minX = Infinity, minY = Infinity, minZ = Infinity;
|
|
3708
|
+
let maxX = -Infinity, maxY = -Infinity, maxZ = -Infinity;
|
|
3709
|
+
for (const a of anchors) {
|
|
3710
|
+
const r = a.scale;
|
|
3711
|
+
minX = Math.min(minX, a.position[0] - r);
|
|
3712
|
+
minY = Math.min(minY, a.position[1] - r);
|
|
3713
|
+
minZ = Math.min(minZ, a.position[2] - r);
|
|
3714
|
+
maxX = Math.max(maxX, a.position[0] + r);
|
|
3715
|
+
maxY = Math.max(maxY, a.position[1] + r);
|
|
3716
|
+
maxZ = Math.max(maxZ, a.position[2] + r);
|
|
3717
|
+
}
|
|
3718
|
+
const cx = (minX + maxX) / 2;
|
|
3719
|
+
const cy = (minY + maxY) / 2;
|
|
3720
|
+
const cz = (minZ + maxZ) / 2;
|
|
3721
|
+
const halfSize = Math.max(
|
|
3722
|
+
(maxX - minX) / 2,
|
|
3723
|
+
(maxY - minY) / 2,
|
|
3724
|
+
(maxZ - minZ) / 2
|
|
3725
|
+
);
|
|
3726
|
+
return {
|
|
3727
|
+
min: { x: minX, y: minY, z: minZ },
|
|
3728
|
+
max: { x: maxX, y: maxY, z: maxZ },
|
|
3729
|
+
center: { x: cx, y: cy, z: cz },
|
|
3730
|
+
halfSize
|
|
3731
|
+
};
|
|
3732
|
+
}
|
|
3733
|
+
function sanitiseId(s) {
|
|
3734
|
+
return s.replace(/[^a-zA-Z0-9_]/g, "_").slice(0, 32);
|
|
3735
|
+
}
|
|
3736
|
+
function spatialPartition(composition, options) {
|
|
3737
|
+
return new SpatialPartitionPass(options).run(composition);
|
|
3738
|
+
}
|
|
3739
|
+
|
|
2918
3740
|
// src/types/effects.ts
|
|
2919
3741
|
function effectCategory(effect) {
|
|
2920
3742
|
return effect.split(":")[0];
|
|
@@ -3079,6 +3901,7 @@ var TRAIT_EFFECTS = {
|
|
|
3079
3901
|
// Audio traits
|
|
3080
3902
|
"@audio": ["audio:play"],
|
|
3081
3903
|
"@spatial_audio": ["audio:spatial"],
|
|
3904
|
+
"@gem_resonance": ["audio:spatial", "state:read"],
|
|
3082
3905
|
"@reverb": ["audio:reverb"],
|
|
3083
3906
|
"@music": ["audio:play", "audio:global"],
|
|
3084
3907
|
// State traits
|
|
@@ -3289,6 +4112,7 @@ var TRAIT_EFFECTS = {
|
|
|
3289
4112
|
"@mitosis": [],
|
|
3290
4113
|
"@mock": [],
|
|
3291
4114
|
"@model_load": [],
|
|
4115
|
+
"@modbus": ["io:network"],
|
|
3292
4116
|
"@motion_reduced": ["io:read", "io:write"],
|
|
3293
4117
|
"@mqtt_pub": ["io:network"],
|
|
3294
4118
|
"@mqtt_sink": ["io:network"],
|
|
@@ -3306,6 +4130,7 @@ var TRAIT_EFFECTS = {
|
|
|
3306
4130
|
"@object_tracking": ["state:read"],
|
|
3307
4131
|
"@occlusion": ["io:read", "io:write"],
|
|
3308
4132
|
"@openxr_hal": [],
|
|
4133
|
+
"@opc_ua": ["io:network"],
|
|
3309
4134
|
"@orbital": [],
|
|
3310
4135
|
"@package_signing": ["authority:own"],
|
|
3311
4136
|
"@pagerduty": [],
|
|
@@ -3498,7 +4323,9 @@ function inferFromTraits(traitNames) {
|
|
|
3498
4323
|
sources.set(e, existing);
|
|
3499
4324
|
}
|
|
3500
4325
|
} else {
|
|
3501
|
-
warnings.push(
|
|
4326
|
+
warnings.push(
|
|
4327
|
+
`Unknown trait '${normalized}': cannot infer effects, so the safety checker assumes pure. Register the trait in TRAIT_EFFECTS or add an explicit @effect declaration before relying on this inference.`
|
|
4328
|
+
);
|
|
3502
4329
|
}
|
|
3503
4330
|
}
|
|
3504
4331
|
return { row: new EffectRow(allEffects), sources, warnings };
|
|
@@ -3789,6 +4616,7 @@ var TRAIT_RESOURCE_COSTS = {
|
|
|
3789
4616
|
// ── Audio ──
|
|
3790
4617
|
"@audio": { audioSources: 1 },
|
|
3791
4618
|
"@spatial_audio": { audioSources: 1 },
|
|
4619
|
+
"@gem_resonance": { audioSources: 1 },
|
|
3792
4620
|
"@environmental_audio": { audioSources: 4, memoryMB: 2 },
|
|
3793
4621
|
"@voice_mesh": { audioSources: 1, networkMsgs: 10 },
|
|
3794
4622
|
"@voice_input": { audioSources: 1, memoryMB: 1 },
|
|
@@ -3801,6 +4629,8 @@ var TRAIT_RESOURCE_COSTS = {
|
|
|
3801
4629
|
"@lobby": { networkMsgs: 5, memoryMB: 2 },
|
|
3802
4630
|
"@mqtt_sink": { networkMsgs: 5 },
|
|
3803
4631
|
"@mqtt_source": { networkMsgs: 5 },
|
|
4632
|
+
"@modbus": { networkMsgs: 5 },
|
|
4633
|
+
"@opc_ua": { networkMsgs: 5 },
|
|
3804
4634
|
"@sync_tier": { networkMsgs: 2 },
|
|
3805
4635
|
"@crdt_room": { networkMsgs: 10, memoryMB: 4 },
|
|
3806
4636
|
"@shareplay": { networkMsgs: 5, memoryMB: 2 },
|
|
@@ -4514,6 +5344,7 @@ function quickSafetyCheck(traits, calls, options = {}) {
|
|
|
4514
5344
|
}
|
|
4515
5345
|
|
|
4516
5346
|
// src/compiler/platform/CrossRealityTraitRegistry.ts
|
|
5347
|
+
chunkAIA52I7T_cjs.init_PlatformConditional();
|
|
4517
5348
|
var CATEGORY_DEFAULT_EMBODIMENT = {
|
|
4518
5349
|
vr: "FullAvatar",
|
|
4519
5350
|
ar: "FloatingAgent",
|
|
@@ -4614,7 +5445,7 @@ var CrossRealityTraitRegistry = class {
|
|
|
4614
5445
|
if (trait.applicablePlatforms.length === 0 && trait.applicableCategories.length === 0)
|
|
4615
5446
|
return true;
|
|
4616
5447
|
if (trait.applicablePlatforms.includes(platform)) return true;
|
|
4617
|
-
const category = platformCategory(platform);
|
|
5448
|
+
const category = chunkAIA52I7T_cjs.platformCategory(platform);
|
|
4618
5449
|
return trait.applicableCategories.includes(category);
|
|
4619
5450
|
}
|
|
4620
5451
|
/** Resolve the default embodiment for a platform */
|
|
@@ -4622,13 +5453,13 @@ var CrossRealityTraitRegistry = class {
|
|
|
4622
5453
|
if (platform in PLATFORM_EMBODIMENT_OVERRIDES) {
|
|
4623
5454
|
return PLATFORM_EMBODIMENT_OVERRIDES[platform];
|
|
4624
5455
|
}
|
|
4625
|
-
const category = platformCategory(platform);
|
|
5456
|
+
const category = chunkAIA52I7T_cjs.platformCategory(platform);
|
|
4626
5457
|
return CATEGORY_DEFAULT_EMBODIMENT[category];
|
|
4627
5458
|
}
|
|
4628
5459
|
/** Validate a handoff path at compile time */
|
|
4629
5460
|
validateHandoffPath(from, to) {
|
|
4630
|
-
const fromCat = platformCategory(from);
|
|
4631
|
-
const toCat = platformCategory(to);
|
|
5461
|
+
const fromCat = chunkAIA52I7T_cjs.platformCategory(from);
|
|
5462
|
+
const toCat = chunkAIA52I7T_cjs.platformCategory(to);
|
|
4632
5463
|
if (fromCat === toCat) return { allowed: true, latencyBudgetMs: 100 };
|
|
4633
5464
|
const rule = HANDOFF_PATH_RULES.find((r) => r.from === fromCat && r.to === toCat);
|
|
4634
5465
|
if (!rule) return { allowed: true, latencyBudgetMs: 500 };
|
|
@@ -4641,7 +5472,7 @@ var CrossRealityTraitRegistry = class {
|
|
|
4641
5472
|
}
|
|
4642
5473
|
/** Get MVC budget for a target platform */
|
|
4643
5474
|
getMVCBudget(platform) {
|
|
4644
|
-
const category = platformCategory(platform);
|
|
5475
|
+
const category = chunkAIA52I7T_cjs.platformCategory(platform);
|
|
4645
5476
|
return MVC_BUDGET_CONSTRAINTS.find((b) => b.category === category) ?? MVC_BUDGET_CONSTRAINTS[0];
|
|
4646
5477
|
}
|
|
4647
5478
|
/** Get total registered trait count */
|
|
@@ -4801,6 +5632,7 @@ function createCrossRealityTraitRegistry() {
|
|
|
4801
5632
|
}
|
|
4802
5633
|
|
|
4803
5634
|
// src/compiler/platform/ModalitySelector.ts
|
|
5635
|
+
chunkAIA52I7T_cjs.init_PlatformConditional();
|
|
4804
5636
|
var EMBODIMENT_TO_TARGET = {
|
|
4805
5637
|
FullAvatar: { primary: "openxr", fallback: "r3f" },
|
|
4806
5638
|
FloatingAgent: { primary: "visionos", fallback: "r3f" },
|
|
@@ -4832,8 +5664,8 @@ var PLATFORM_TARGET_OVERRIDES = {
|
|
|
4832
5664
|
};
|
|
4833
5665
|
function selectModality(platform, options = {}) {
|
|
4834
5666
|
const reasoning = [];
|
|
4835
|
-
const capabilities = PLATFORM_CAPABILITIES[platform];
|
|
4836
|
-
const category = platformCategory(platform);
|
|
5667
|
+
const capabilities = chunkAIA52I7T_cjs.PLATFORM_CAPABILITIES[platform];
|
|
5668
|
+
const category = chunkAIA52I7T_cjs.platformCategory(platform);
|
|
4837
5669
|
let embodiment;
|
|
4838
5670
|
if (options.forceEmbodiment) {
|
|
4839
5671
|
embodiment = options.forceEmbodiment;
|
|
@@ -4890,16 +5722,16 @@ function selectModality(platform, options = {}) {
|
|
|
4890
5722
|
}
|
|
4891
5723
|
function selectModalityForAll(options = {}) {
|
|
4892
5724
|
const results = /* @__PURE__ */ new Map();
|
|
4893
|
-
for (const platform of Object.keys(PLATFORM_CAPABILITIES)) {
|
|
5725
|
+
for (const platform of Object.keys(chunkAIA52I7T_cjs.PLATFORM_CAPABILITIES)) {
|
|
4894
5726
|
results.set(platform, selectModality(platform, options));
|
|
4895
5727
|
}
|
|
4896
5728
|
return results;
|
|
4897
5729
|
}
|
|
4898
5730
|
function bestCategoryForTraits(requiredCapabilities) {
|
|
4899
5731
|
const categories = [];
|
|
4900
|
-
for (const [cat, platforms] of Object.entries(PLATFORM_CATEGORIES)) {
|
|
5732
|
+
for (const [cat, platforms] of Object.entries(chunkAIA52I7T_cjs.PLATFORM_CATEGORIES)) {
|
|
4901
5733
|
const canSupport = platforms.some((platform) => {
|
|
4902
|
-
const caps = PLATFORM_CAPABILITIES[platform];
|
|
5734
|
+
const caps = chunkAIA52I7T_cjs.PLATFORM_CAPABILITIES[platform];
|
|
4903
5735
|
return Object.entries(requiredCapabilities).every(([key, required]) => {
|
|
4904
5736
|
if (typeof required === "boolean")
|
|
4905
5737
|
return !required || caps[key] === true;
|
|
@@ -4926,7 +5758,7 @@ var CompilerBridge = class {
|
|
|
4926
5758
|
if (this.initialized) return;
|
|
4927
5759
|
try {
|
|
4928
5760
|
const [parserModule, compilerModule] = await Promise.all([
|
|
4929
|
-
import('./
|
|
5761
|
+
import('./HoloScriptPlusParser-WKHRIH6T.cjs'),
|
|
4930
5762
|
import('./compiler/r3f.cjs')
|
|
4931
5763
|
]);
|
|
4932
5764
|
this.modules = {
|
|
@@ -5055,6 +5887,16 @@ function getCompilerBridge() {
|
|
|
5055
5887
|
function json(value) {
|
|
5056
5888
|
return JSON.stringify(value, null, 2);
|
|
5057
5889
|
}
|
|
5890
|
+
function unsupportedPipelineStep(kind, type, name) {
|
|
5891
|
+
const typeLabel = type || "unknown";
|
|
5892
|
+
return `[PipelineNodeCompiler] Unsupported pipeline ${kind} type "${typeLabel}" (step: ${name}). PipelineNodeCompiler does not yet emit code for this type.`;
|
|
5893
|
+
}
|
|
5894
|
+
function unsupportedNodeThrow(kind, type, name) {
|
|
5895
|
+
return `(() => { throw new Error(${json(unsupportedPipelineStep(kind, type, name))}); })()`;
|
|
5896
|
+
}
|
|
5897
|
+
function unsupportedPythonRaise(kind, type, name) {
|
|
5898
|
+
return `raise NotImplementedError(${json(unsupportedPipelineStep(kind, type, name))})`;
|
|
5899
|
+
}
|
|
5058
5900
|
function emitSource(source) {
|
|
5059
5901
|
switch (source.type) {
|
|
5060
5902
|
case "rest":
|
|
@@ -5065,17 +5907,29 @@ function emitSource(source) {
|
|
|
5065
5907
|
case "list":
|
|
5066
5908
|
return json(source.items || []);
|
|
5067
5909
|
default:
|
|
5068
|
-
return "
|
|
5910
|
+
return unsupportedNodeThrow("source", source.type, source.name);
|
|
5069
5911
|
}
|
|
5070
5912
|
}
|
|
5071
5913
|
function emitFieldMappingTransform(t) {
|
|
5072
5914
|
const mappings = t.mappings || [];
|
|
5073
|
-
const
|
|
5074
|
-
|
|
5915
|
+
const unwrapMappings = mappings.filter((m) => m.from.endsWith("[]"));
|
|
5916
|
+
const valueMappings = mappings.filter((m) => !m.from.endsWith("[]"));
|
|
5917
|
+
const lines = [];
|
|
5918
|
+
for (const mapping of unwrapMappings) {
|
|
5919
|
+
lines.push(
|
|
5920
|
+
`data = data.flatMap((item) => unwrapPathValues(item, ${json(mapping.from)}).map((value) => ({ ...item, ${json(mapping.to)}: applyTransforms(value, ${json(mapping.transforms || [])}) })));`
|
|
5921
|
+
);
|
|
5922
|
+
}
|
|
5923
|
+
if (valueMappings.length === 0) {
|
|
5924
|
+
return lines.join("\n");
|
|
5925
|
+
}
|
|
5926
|
+
const mapExpr = valueMappings.map(
|
|
5927
|
+
(m) => `${json(m.to)}: applyTransforms(getPathValue(item, ${json(m.from)}), ${json(m.transforms || [])})`
|
|
5075
5928
|
).join(",\n ");
|
|
5076
|
-
|
|
5929
|
+
lines.push(`data = data.map((item) => ({
|
|
5077
5930
|
${mapExpr}
|
|
5078
|
-
}))
|
|
5931
|
+
}));`);
|
|
5932
|
+
return lines.join("\n");
|
|
5079
5933
|
}
|
|
5080
5934
|
function emitTransform(t) {
|
|
5081
5935
|
if ((t.type === "field_mapping" || !t.type) && t.mappings && t.mappings.length > 0) {
|
|
@@ -5107,11 +5961,11 @@ function emitSink(sink) {
|
|
|
5107
5961
|
return `await writeOutput(${json(sink.path || "./pipeline-output.jsonl")}, data, ${json(sink.format || "jsonl")}, ${json(Boolean(sink.append))});`;
|
|
5108
5962
|
case "rest":
|
|
5109
5963
|
case "webhook":
|
|
5110
|
-
return `await
|
|
5964
|
+
return `await postJSON(${json(sink.endpoint || "")}, data, { method: ${json(sink.method || "POST")} });`;
|
|
5111
5965
|
case "mcp":
|
|
5112
5966
|
return `console.warn(${json(`[${sink.name}] mcp sink requires host integration: ${sink.server || ""}/${sink.tool || ""}`)});`;
|
|
5113
5967
|
default:
|
|
5114
|
-
return
|
|
5968
|
+
return `${unsupportedNodeThrow("sink", sink.type, sink.name)};`;
|
|
5115
5969
|
}
|
|
5116
5970
|
}
|
|
5117
5971
|
function emitPythonSource(source) {
|
|
@@ -5124,7 +5978,7 @@ function emitPythonSource(source) {
|
|
|
5124
5978
|
case "list":
|
|
5125
5979
|
return `datasets[${json(source.name)}] = ${json(source.items || [])}`;
|
|
5126
5980
|
default:
|
|
5127
|
-
return
|
|
5981
|
+
return unsupportedPythonRaise("source", source.type, source.name);
|
|
5128
5982
|
}
|
|
5129
5983
|
}
|
|
5130
5984
|
function emitPythonFieldMappingTransform(t) {
|
|
@@ -5173,7 +6027,7 @@ function emitPythonSink(sink) {
|
|
|
5173
6027
|
case "mcp":
|
|
5174
6028
|
return `print(${json(`[${sink.name}] mcp sink requires host integration: ${sink.server || ""}/${sink.tool || ""}`)})`;
|
|
5175
6029
|
default:
|
|
5176
|
-
return
|
|
6030
|
+
return unsupportedPythonRaise("sink", sink.type, sink.name);
|
|
5177
6031
|
}
|
|
5178
6032
|
}
|
|
5179
6033
|
function compilePipelineToNode(pipeline, options = {}) {
|
|
@@ -5190,18 +6044,55 @@ function compilePipelineToNode(pipeline, options = {}) {
|
|
|
5190
6044
|
*/
|
|
5191
6045
|
|
|
5192
6046
|
import fs from 'node:fs/promises';
|
|
6047
|
+
import path from 'node:path';
|
|
6048
|
+
|
|
6049
|
+
const RUN_DATE = new Date().toISOString().slice(0, 10);
|
|
6050
|
+
|
|
6051
|
+
function resolveTemplate(value, context = {}) {
|
|
6052
|
+
if (typeof value !== 'string') return value;
|
|
6053
|
+
return value
|
|
6054
|
+
.replace(/\\$\\{date\\}/g, RUN_DATE)
|
|
6055
|
+
.replace(/\\$\\{env\\.([A-Za-z_][A-Za-z0-9_]*)\\}/g, (_match, name) => process.env[name] ?? '')
|
|
6056
|
+
.replace(/\\$\\{([A-Za-z_][A-Za-z0-9_.]*)\\}/g, (_match, key) => {
|
|
6057
|
+
const found = key.split('.').reduce((acc, part) => (acc && typeof acc === 'object' ? acc[part] : undefined), context);
|
|
6058
|
+
return found === undefined || found === null ? '' : String(found);
|
|
6059
|
+
});
|
|
6060
|
+
}
|
|
6061
|
+
|
|
6062
|
+
function normalizeOutputPath(rawPath, format) {
|
|
6063
|
+
const resolved = resolveTemplate(rawPath);
|
|
6064
|
+
if (!resolved) return format === 'json' ? './pipeline-output.json' : './pipeline-output.jsonl';
|
|
6065
|
+
if (path.extname(resolved)) return resolved;
|
|
6066
|
+
return path.join(resolved, format === 'json' ? 'pipeline-output.json' : 'pipeline-output.jsonl');
|
|
6067
|
+
}
|
|
5193
6068
|
|
|
5194
6069
|
async function fetchJSON(url, init) {
|
|
5195
|
-
|
|
5196
|
-
|
|
6070
|
+
const resolvedUrl = resolveTemplate(url);
|
|
6071
|
+
if (!resolvedUrl) return [];
|
|
6072
|
+
const res = await fetch(resolvedUrl, init);
|
|
5197
6073
|
if (!res.ok) throw new Error(\`Request failed: \${res.status} \${res.statusText}\`);
|
|
5198
6074
|
const body = await res.json();
|
|
5199
6075
|
return Array.isArray(body) ? body : [body];
|
|
5200
6076
|
}
|
|
5201
6077
|
|
|
6078
|
+
async function postJSON(url, data, init) {
|
|
6079
|
+
const resolvedUrl = resolveTemplate(url, { data });
|
|
6080
|
+
if (!resolvedUrl) {
|
|
6081
|
+
console.warn('[PipelineNodeCompiler] skipping empty webhook/rest sink endpoint');
|
|
6082
|
+
return;
|
|
6083
|
+
}
|
|
6084
|
+
const res = await fetch(resolvedUrl, {
|
|
6085
|
+
...init,
|
|
6086
|
+
headers: { 'content-type': 'application/json', ...(init?.headers || {}) },
|
|
6087
|
+
body: JSON.stringify(data),
|
|
6088
|
+
});
|
|
6089
|
+
if (!res.ok) throw new Error(\`Request failed: \${res.status} \${res.statusText}\`);
|
|
6090
|
+
}
|
|
6091
|
+
|
|
5202
6092
|
async function readJSONArray(filePath) {
|
|
5203
|
-
|
|
5204
|
-
|
|
6093
|
+
const resolvedPath = resolveTemplate(filePath);
|
|
6094
|
+
if (!resolvedPath) return [];
|
|
6095
|
+
const raw = await fs.readFile(resolvedPath, 'utf8');
|
|
5205
6096
|
const parsed = JSON.parse(raw);
|
|
5206
6097
|
return Array.isArray(parsed) ? parsed : [parsed];
|
|
5207
6098
|
}
|
|
@@ -5219,6 +6110,22 @@ function applyTransforms(value, transforms) {
|
|
|
5219
6110
|
return v;
|
|
5220
6111
|
}
|
|
5221
6112
|
|
|
6113
|
+
function getPathValue(item, pathExpr) {
|
|
6114
|
+
const cleanPath = String(pathExpr || '').replace(/\\[\\]$/, '');
|
|
6115
|
+
if (!cleanPath) return item;
|
|
6116
|
+
return cleanPath.split('.').reduce((acc, part) => {
|
|
6117
|
+
if (acc == null || typeof acc !== 'object') return undefined;
|
|
6118
|
+
return acc[part];
|
|
6119
|
+
}, item);
|
|
6120
|
+
}
|
|
6121
|
+
|
|
6122
|
+
function unwrapPathValues(item, pathExpr) {
|
|
6123
|
+
const value = getPathValue(item, pathExpr);
|
|
6124
|
+
if (Array.isArray(value)) return value;
|
|
6125
|
+
if (value == null) return [];
|
|
6126
|
+
return [value];
|
|
6127
|
+
}
|
|
6128
|
+
|
|
5222
6129
|
function evalCondition(item, condition) {
|
|
5223
6130
|
try {
|
|
5224
6131
|
const fn = new Function('item', \`with (item) { return (\${condition}); }\`);
|
|
@@ -5239,17 +6146,20 @@ function validateItem(item, fields) {
|
|
|
5239
6146
|
return true;
|
|
5240
6147
|
}
|
|
5241
6148
|
|
|
5242
|
-
async function writeOutput(
|
|
6149
|
+
async function writeOutput(rawPath, data, format, append) {
|
|
6150
|
+
const outputPath = normalizeOutputPath(rawPath, format);
|
|
6151
|
+
await fs.mkdir(path.dirname(outputPath), { recursive: true });
|
|
6152
|
+
|
|
5243
6153
|
if (format === 'json') {
|
|
5244
6154
|
const text = JSON.stringify(data, null, 2);
|
|
5245
|
-
if (append) await fs.appendFile(
|
|
5246
|
-
else await fs.writeFile(
|
|
6155
|
+
if (append) await fs.appendFile(outputPath, text + '\\n');
|
|
6156
|
+
else await fs.writeFile(outputPath, text);
|
|
5247
6157
|
return;
|
|
5248
6158
|
}
|
|
5249
6159
|
|
|
5250
6160
|
const lines = data.map((d) => JSON.stringify(d)).join('\\n') + '\\n';
|
|
5251
|
-
if (append) await fs.appendFile(
|
|
5252
|
-
else await fs.writeFile(
|
|
6161
|
+
if (append) await fs.appendFile(outputPath, lines);
|
|
6162
|
+
else await fs.writeFile(outputPath, lines);
|
|
5253
6163
|
}
|
|
5254
6164
|
|
|
5255
6165
|
export async function runPipeline() {
|
|
@@ -5438,7 +6348,7 @@ if __name__ == '__main__':
|
|
|
5438
6348
|
`;
|
|
5439
6349
|
}
|
|
5440
6350
|
function compilePipelineSourceToNode(source, options = {}) {
|
|
5441
|
-
const parsed = parsePipeline(source);
|
|
6351
|
+
const parsed = chunkKKFZ3B6J_cjs.parsePipeline(source);
|
|
5442
6352
|
if (!parsed.success || !parsed.pipeline) {
|
|
5443
6353
|
return {
|
|
5444
6354
|
success: false,
|
|
@@ -5451,7 +6361,7 @@ function compilePipelineSourceToNode(source, options = {}) {
|
|
|
5451
6361
|
};
|
|
5452
6362
|
}
|
|
5453
6363
|
function compilePipelineSourceToPython(source, options = {}) {
|
|
5454
|
-
const parsed = parsePipeline(source);
|
|
6364
|
+
const parsed = chunkKKFZ3B6J_cjs.parsePipeline(source);
|
|
5455
6365
|
if (!parsed.success || !parsed.pipeline) {
|
|
5456
6366
|
return {
|
|
5457
6367
|
success: false,
|
|
@@ -5472,31 +6382,31 @@ function compilePipelineSource(source, options = {}) {
|
|
|
5472
6382
|
}
|
|
5473
6383
|
|
|
5474
6384
|
exports.A2AAgentCardCompiler_exports = A2AAgentCardCompiler_exports;
|
|
5475
|
-
exports.ALL_PLATFORMS = ALL_PLATFORMS;
|
|
5476
6385
|
exports.BUILTIN_RESOURCES = BUILTIN_RESOURCES;
|
|
5477
6386
|
exports.CAPABILITY_HIERARCHY = CAPABILITY_HIERARCHY;
|
|
5478
6387
|
exports.CATEGORY_DEFAULT_EMBODIMENT = CATEGORY_DEFAULT_EMBODIMENT;
|
|
5479
6388
|
exports.CompilerBridge = CompilerBridge;
|
|
5480
6389
|
exports.CrossRealityTraitRegistry = CrossRealityTraitRegistry;
|
|
5481
|
-
exports.
|
|
6390
|
+
exports.EFFECTS_BY_CATEGORY = EFFECTS_BY_CATEGORY;
|
|
5482
6391
|
exports.EFFECT_TO_CAPABILITY = EFFECT_TO_CAPABILITY;
|
|
5483
6392
|
exports.EffectChecker = EffectChecker;
|
|
5484
6393
|
exports.EffectRow = EffectRow;
|
|
6394
|
+
exports.GaussianSplattingCompiler = GaussianSplattingCompiler;
|
|
5485
6395
|
exports.HANDOFF_PATH_RULES = HANDOFF_PATH_RULES;
|
|
5486
6396
|
exports.LinearTypeChecker = LinearTypeChecker;
|
|
5487
6397
|
exports.MVC_BUDGET_CONSTRAINTS = MVC_BUDGET_CONSTRAINTS;
|
|
5488
6398
|
exports.NIRCompiler_exports = NIRCompiler_exports;
|
|
5489
6399
|
exports.PLATFORM_BUDGETS = PLATFORM_BUDGETS;
|
|
5490
|
-
exports.PLATFORM_CAPABILITIES = PLATFORM_CAPABILITIES;
|
|
5491
|
-
exports.PLATFORM_CATEGORIES = PLATFORM_CATEGORIES;
|
|
5492
6400
|
exports.PLATFORM_EMBODIMENT_OVERRIDES = PLATFORM_EMBODIMENT_OVERRIDES;
|
|
5493
6401
|
exports.ResourceBudgetAnalyzer = ResourceBudgetAnalyzer;
|
|
6402
|
+
exports.SHARED_SORT_SHADER_PATH = SHARED_SORT_SHADER_PATH;
|
|
6403
|
+
exports.SpatialPartitionPass = SpatialPartitionPass;
|
|
5494
6404
|
exports.TRAIT_EFFECTS = TRAIT_EFFECTS;
|
|
5495
6405
|
exports.TRAIT_RESOURCE_COSTS = TRAIT_RESOURCE_COSTS;
|
|
5496
6406
|
exports.TRAIT_RESOURCE_MAP = TRAIT_RESOURCE_MAP;
|
|
5497
6407
|
exports.TRUST_LEVEL_CAPABILITIES = TRUST_LEVEL_CAPABILITIES;
|
|
6408
|
+
exports.ThreeJSCompiler_exports = ThreeJSCompiler_exports;
|
|
5498
6409
|
exports.USDZPipeline = USDZPipeline;
|
|
5499
|
-
exports.agentBudgetFor = agentBudgetFor;
|
|
5500
6410
|
exports.bestCategoryForTraits = bestCategoryForTraits;
|
|
5501
6411
|
exports.buildSafetyReport = buildSafetyReport;
|
|
5502
6412
|
exports.checkCapabilities = checkCapabilities;
|
|
@@ -5507,32 +6417,29 @@ exports.compilePipelineToNode = compilePipelineToNode;
|
|
|
5507
6417
|
exports.compilePipelineToPython = compilePipelineToPython;
|
|
5508
6418
|
exports.createCrossRealityTraitRegistry = createCrossRealityTraitRegistry;
|
|
5509
6419
|
exports.createEffectChecker = createEffectChecker;
|
|
6420
|
+
exports.createGaussianSplattingCompiler = createGaussianSplattingCompiler;
|
|
5510
6421
|
exports.dangerLevel = dangerLevel;
|
|
5511
6422
|
exports.deriveRequirements = deriveRequirements;
|
|
5512
|
-
exports.
|
|
6423
|
+
exports.detectMultiUserSharedSort = detectMultiUserSharedSort;
|
|
6424
|
+
exports.effectCategory = effectCategory;
|
|
5513
6425
|
exports.expandCapabilities = expandCapabilities;
|
|
5514
6426
|
exports.formatReport = formatReport;
|
|
5515
6427
|
exports.generateCertificate = generateCertificate;
|
|
5516
6428
|
exports.getCompilerBridge = getCompilerBridge;
|
|
5517
6429
|
exports.getCrossRealityTraitRegistry = getCrossRealityTraitRegistry;
|
|
5518
|
-
exports.hasCapability = hasCapability;
|
|
5519
6430
|
exports.inferFromBuiltins = inferFromBuiltins;
|
|
5520
6431
|
exports.inferFromTraits = inferFromTraits;
|
|
5521
6432
|
exports.init_A2AAgentCardCompiler = init_A2AAgentCardCompiler;
|
|
5522
6433
|
exports.init_NIRCompiler = init_NIRCompiler;
|
|
5523
|
-
exports.
|
|
6434
|
+
exports.init_ThreeJSCompiler = init_ThreeJSCompiler;
|
|
5524
6435
|
exports.isSafeTraitSet = isSafeTraitSet;
|
|
5525
6436
|
exports.knownBuiltins = knownBuiltins;
|
|
5526
6437
|
exports.knownTraits = knownTraits;
|
|
5527
|
-
exports.matchesPlatform = matchesPlatform;
|
|
5528
|
-
exports.parsePipeline = parsePipeline;
|
|
5529
|
-
exports.platformCategory = platformCategory;
|
|
5530
6438
|
exports.quickSafetyCheck = quickSafetyCheck;
|
|
5531
6439
|
exports.resetCrossRealityTraitRegistry = resetCrossRealityTraitRegistry;
|
|
5532
|
-
exports.resolvePlatforms = resolvePlatforms;
|
|
5533
6440
|
exports.runSafetyPass = runSafetyPass;
|
|
5534
|
-
exports.selectBlock = selectBlock;
|
|
5535
6441
|
exports.selectModality = selectModality;
|
|
5536
6442
|
exports.selectModalityForAll = selectModalityForAll;
|
|
5537
|
-
|
|
5538
|
-
//# sourceMappingURL=chunk-
|
|
6443
|
+
exports.spatialPartition = spatialPartition;
|
|
6444
|
+
//# sourceMappingURL=chunk-QWNQ523V.cjs.map
|
|
6445
|
+
//# sourceMappingURL=chunk-QWNQ523V.cjs.map
|