@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,5 +1,5 @@
|
|
|
1
|
-
import { ErrorRecovery, generateQuickFixes, enrichErrorWithSuggestions, LIFECYCLE_HOOKS, STRUCTURAL_DIRECTIVES } from './chunk-
|
|
2
|
-
import { VR_TRAITS } from './chunk-
|
|
1
|
+
import { ErrorRecovery, generateQuickFixes, enrichErrorWithSuggestions, LIFECYCLE_HOOKS, STRUCTURAL_DIRECTIVES } from './chunk-4N4SXXWF.js';
|
|
2
|
+
import { VR_TRAITS } from './chunk-2BSMSUCE.js';
|
|
3
3
|
import * as crypto from 'crypto';
|
|
4
4
|
|
|
5
5
|
// src/parser/HybridChunker.ts
|
|
@@ -660,6 +660,220 @@ var ParseCache = class {
|
|
|
660
660
|
};
|
|
661
661
|
var globalParseCache = new ParseCache();
|
|
662
662
|
|
|
663
|
+
// src/parser/IncrementalParser.ts
|
|
664
|
+
var ChunkBasedIncrementalParser = class {
|
|
665
|
+
constructor(cache = globalParseCache) {
|
|
666
|
+
this.lastSource = "";
|
|
667
|
+
this.lastChunks = /* @__PURE__ */ new Map();
|
|
668
|
+
this.cache = cache;
|
|
669
|
+
this.parser = new HoloScriptPlusParser({
|
|
670
|
+
enableVRTraits: true,
|
|
671
|
+
enableTypeScriptImports: true,
|
|
672
|
+
strict: false
|
|
673
|
+
});
|
|
674
|
+
}
|
|
675
|
+
/**
|
|
676
|
+
* Parse source with incremental caching
|
|
677
|
+
*/
|
|
678
|
+
parse(source) {
|
|
679
|
+
const startTime = Date.now();
|
|
680
|
+
let cached = 0;
|
|
681
|
+
let parsed = 0;
|
|
682
|
+
const changedChunks = [];
|
|
683
|
+
const currentChunks = this.detectChunks(source);
|
|
684
|
+
const chunkMap = new Map(currentChunks.map((c) => [c.id, c]));
|
|
685
|
+
const changedIds = this.identifyChangedChunks(currentChunks);
|
|
686
|
+
changedChunks.push(...changedIds);
|
|
687
|
+
const dependentIds = this.findDependents(changedIds, currentChunks);
|
|
688
|
+
const toParseIds = /* @__PURE__ */ new Set([...changedIds, ...dependentIds]);
|
|
689
|
+
const chunkNodes = /* @__PURE__ */ new Map();
|
|
690
|
+
for (const chunk of currentChunks) {
|
|
691
|
+
const hash = ParseCache.hash(chunk.content);
|
|
692
|
+
if (toParseIds.has(chunk.id)) {
|
|
693
|
+
const chunkNode = this.parseChunk(chunk);
|
|
694
|
+
if (chunkNode) {
|
|
695
|
+
chunkNodes.set(chunk.id, chunkNode);
|
|
696
|
+
this.cache.set(chunk.id, hash, chunkNode);
|
|
697
|
+
parsed++;
|
|
698
|
+
}
|
|
699
|
+
} else {
|
|
700
|
+
const cached_node = this.cache.get(chunk.id, hash);
|
|
701
|
+
if (cached_node) {
|
|
702
|
+
chunkNodes.set(chunk.id, cached_node);
|
|
703
|
+
cached++;
|
|
704
|
+
} else {
|
|
705
|
+
const chunkNode = this.parseChunk(chunk);
|
|
706
|
+
if (chunkNode) {
|
|
707
|
+
chunkNodes.set(chunk.id, chunkNode);
|
|
708
|
+
this.cache.set(chunk.id, hash, chunkNode);
|
|
709
|
+
parsed++;
|
|
710
|
+
}
|
|
711
|
+
}
|
|
712
|
+
}
|
|
713
|
+
}
|
|
714
|
+
const ast = this.assembleAST(chunkNodes, currentChunks);
|
|
715
|
+
this.lastSource = source;
|
|
716
|
+
this.lastChunks = chunkMap;
|
|
717
|
+
const duration = Date.now() - startTime;
|
|
718
|
+
return {
|
|
719
|
+
ast,
|
|
720
|
+
cached,
|
|
721
|
+
parsed,
|
|
722
|
+
duration,
|
|
723
|
+
changedChunks
|
|
724
|
+
};
|
|
725
|
+
}
|
|
726
|
+
/**
|
|
727
|
+
* Detects top-level chunks in the source
|
|
728
|
+
*/
|
|
729
|
+
detectChunks(source) {
|
|
730
|
+
return ChunkDetector.detect(source);
|
|
731
|
+
}
|
|
732
|
+
/**
|
|
733
|
+
* Identifies which chunks have changed by comparing hashes
|
|
734
|
+
*/
|
|
735
|
+
identifyChangedChunks(currentChunks) {
|
|
736
|
+
const changed = [];
|
|
737
|
+
for (const chunk of currentChunks) {
|
|
738
|
+
const hash = ParseCache.hash(chunk.content);
|
|
739
|
+
const lastChunk = this.lastChunks.get(chunk.id);
|
|
740
|
+
if (!lastChunk) {
|
|
741
|
+
changed.push(chunk.id);
|
|
742
|
+
} else {
|
|
743
|
+
const lastHash = ParseCache.hash(lastChunk.content);
|
|
744
|
+
if (hash !== lastHash) {
|
|
745
|
+
changed.push(chunk.id);
|
|
746
|
+
}
|
|
747
|
+
}
|
|
748
|
+
}
|
|
749
|
+
for (const [id, _lastChunk] of this.lastChunks.entries()) {
|
|
750
|
+
const currentChunk = this.detectChunks(this.lastSource).find((c) => c.id === id);
|
|
751
|
+
if (!currentChunk) {
|
|
752
|
+
changed.push(id);
|
|
753
|
+
}
|
|
754
|
+
}
|
|
755
|
+
return changed;
|
|
756
|
+
}
|
|
757
|
+
/**
|
|
758
|
+
* Finds chunks that depend on the changed ones
|
|
759
|
+
*/
|
|
760
|
+
findDependents(changedIds, chunks) {
|
|
761
|
+
const dependents = /* @__PURE__ */ new Set();
|
|
762
|
+
const changeSet = new Set(changedIds);
|
|
763
|
+
const references = /* @__PURE__ */ new Map();
|
|
764
|
+
for (const chunk of chunks) {
|
|
765
|
+
const refs = this.extractReferences(chunk.content);
|
|
766
|
+
if (refs.size > 0) {
|
|
767
|
+
references.set(chunk.id, refs);
|
|
768
|
+
}
|
|
769
|
+
}
|
|
770
|
+
for (const [chunkId, refs] of references.entries()) {
|
|
771
|
+
if (!changeSet.has(chunkId)) {
|
|
772
|
+
for (const ref of refs) {
|
|
773
|
+
if (changeSet.has(ref) || dependents.has(ref)) {
|
|
774
|
+
dependents.add(chunkId);
|
|
775
|
+
break;
|
|
776
|
+
}
|
|
777
|
+
}
|
|
778
|
+
}
|
|
779
|
+
}
|
|
780
|
+
return Array.from(dependents);
|
|
781
|
+
}
|
|
782
|
+
/**
|
|
783
|
+
* Extracts referenced identifiers from a chunk (templates, orbs, logic)
|
|
784
|
+
*/
|
|
785
|
+
extractReferences(content) {
|
|
786
|
+
const refs = /* @__PURE__ */ new Set();
|
|
787
|
+
const templateRefs = content.match(/using\s+"([^"]+)"/g);
|
|
788
|
+
if (templateRefs) {
|
|
789
|
+
templateRefs.forEach((ref) => {
|
|
790
|
+
const name = ref.match(/"([^"]+)"/)[1];
|
|
791
|
+
refs.add(`template:${name}`);
|
|
792
|
+
});
|
|
793
|
+
}
|
|
794
|
+
const spreadRefs = content.match(/\.\.\.\s*([a-zA-Z0-9_]+)/g);
|
|
795
|
+
if (spreadRefs) {
|
|
796
|
+
spreadRefs.forEach((ref) => {
|
|
797
|
+
const name = ref.replace(/\.\.\./, "").trim();
|
|
798
|
+
refs.add(`identifier:${name}`);
|
|
799
|
+
});
|
|
800
|
+
}
|
|
801
|
+
const compRefs = content.match(/@composition\s+"([^"]+)"/g);
|
|
802
|
+
if (compRefs) {
|
|
803
|
+
compRefs.forEach((ref) => {
|
|
804
|
+
const name = ref.match(/"([^"]+)"/)[1];
|
|
805
|
+
refs.add(`composition:${name}`);
|
|
806
|
+
});
|
|
807
|
+
}
|
|
808
|
+
return refs;
|
|
809
|
+
}
|
|
810
|
+
/**
|
|
811
|
+
* Parses a single chunk
|
|
812
|
+
*/
|
|
813
|
+
parseChunk(chunk) {
|
|
814
|
+
try {
|
|
815
|
+
const content = this.wrapChunkForParsing(chunk);
|
|
816
|
+
const result = this.parser.parse(content);
|
|
817
|
+
if (result.success && result.ast) {
|
|
818
|
+
return result.ast;
|
|
819
|
+
}
|
|
820
|
+
return null;
|
|
821
|
+
} catch (error) {
|
|
822
|
+
console.warn(`Failed to parse chunk ${chunk.id}:`, error);
|
|
823
|
+
return null;
|
|
824
|
+
}
|
|
825
|
+
}
|
|
826
|
+
/**
|
|
827
|
+
* Wraps chunk content to make it parseable in isolation
|
|
828
|
+
*/
|
|
829
|
+
wrapChunkForParsing(chunk) {
|
|
830
|
+
return chunk.content;
|
|
831
|
+
}
|
|
832
|
+
/**
|
|
833
|
+
* Assembles final AST from parsed chunks
|
|
834
|
+
*/
|
|
835
|
+
assembleAST(chunkNodes, chunks) {
|
|
836
|
+
const children = [];
|
|
837
|
+
for (const chunk of chunks) {
|
|
838
|
+
const node = chunkNodes.get(chunk.id);
|
|
839
|
+
if (node) {
|
|
840
|
+
children.push(node);
|
|
841
|
+
}
|
|
842
|
+
}
|
|
843
|
+
if (children.length === 1) {
|
|
844
|
+
return children[0];
|
|
845
|
+
}
|
|
846
|
+
return {
|
|
847
|
+
type: "fragment",
|
|
848
|
+
children,
|
|
849
|
+
properties: {},
|
|
850
|
+
directives: [],
|
|
851
|
+
traits: /* @__PURE__ */ new Map(),
|
|
852
|
+
loc: { start: { line: 1, column: 0 }, end: { line: 1, column: 0 } }
|
|
853
|
+
};
|
|
854
|
+
}
|
|
855
|
+
/**
|
|
856
|
+
* Clears the internal cache
|
|
857
|
+
*/
|
|
858
|
+
clearCache() {
|
|
859
|
+
this.cache.clear();
|
|
860
|
+
this.lastChunks.clear();
|
|
861
|
+
}
|
|
862
|
+
/**
|
|
863
|
+
* Gets cache statistics
|
|
864
|
+
*/
|
|
865
|
+
getCacheStats() {
|
|
866
|
+
return {
|
|
867
|
+
size: this.lastChunks.size,
|
|
868
|
+
maxSize: 500
|
|
869
|
+
};
|
|
870
|
+
}
|
|
871
|
+
};
|
|
872
|
+
function parseIncrementalChunks(source, cache = globalParseCache) {
|
|
873
|
+
const parser = new ChunkBasedIncrementalParser(cache);
|
|
874
|
+
return parser.parse(source);
|
|
875
|
+
}
|
|
876
|
+
|
|
663
877
|
// src/parser/RichErrors.ts
|
|
664
878
|
var HSPLUS_ERROR_CODES = {
|
|
665
879
|
// Syntax Errors (HSP001-HSP099)
|
|
@@ -1553,6 +1767,17 @@ var HoloScriptPlusParser = class {
|
|
|
1553
1767
|
this.hasControlFlow = false;
|
|
1554
1768
|
this.compiledExpressions = /* @__PURE__ */ new Map();
|
|
1555
1769
|
this.errorRecovery = new ErrorRecovery();
|
|
1770
|
+
/**
|
|
1771
|
+
* Internal incremental parser for parseIncremental.
|
|
1772
|
+
* Uses ChunkBasedIncrementalParser with AST-aware chunking and
|
|
1773
|
+
* dependency tracking — no fallback to full re-parse for unchanged chunks.
|
|
1774
|
+
*/
|
|
1775
|
+
this._incrementalParser = null;
|
|
1776
|
+
/**
|
|
1777
|
+
* Per-cache incremental parser map so callers can supply their own cache
|
|
1778
|
+
* and still get a dedicated ChunkBasedIncrementalParser instance.
|
|
1779
|
+
*/
|
|
1780
|
+
this._incrementalParserCache = /* @__PURE__ */ new Map();
|
|
1556
1781
|
this.options = {
|
|
1557
1782
|
enableVRTraits: true,
|
|
1558
1783
|
enableTypeScriptImports: true,
|
|
@@ -1617,9 +1842,33 @@ var HoloScriptPlusParser = class {
|
|
|
1617
1842
|
return this.buildResult(root);
|
|
1618
1843
|
}
|
|
1619
1844
|
/**
|
|
1620
|
-
* Performs an incremental parse using
|
|
1845
|
+
* Performs an incremental parse using ChunkBasedIncrementalParser with
|
|
1846
|
+
* AST-aware chunking, hash-based caching, and dependency tracking.
|
|
1847
|
+
*
|
|
1848
|
+
* Unchanged chunks are served from cache (zero re-parse cost). Only chunks
|
|
1849
|
+
* whose content hash changed — plus chunks that reference changed ones via
|
|
1850
|
+
* `using`, spread, or `@composition` — are re-parsed.
|
|
1851
|
+
*
|
|
1852
|
+
* Previous implementation fell back to a full re-parse per chunk because it
|
|
1853
|
+
* used `ChunkDetector.detect()` inline without the stateful comparison that
|
|
1854
|
+
* `ChunkBasedIncrementalParser` provides. This is now wired through the
|
|
1855
|
+
* superior engine (APL WIT audit gap #3, 2026-05-21).
|
|
1621
1856
|
*/
|
|
1622
1857
|
parseIncremental(source, cache = globalParseCache) {
|
|
1858
|
+
let incrementalParser = this._incrementalParserCache.get(cache);
|
|
1859
|
+
if (!incrementalParser) {
|
|
1860
|
+
incrementalParser = new ChunkBasedIncrementalParser(cache);
|
|
1861
|
+
this._incrementalParserCache.set(cache, incrementalParser);
|
|
1862
|
+
}
|
|
1863
|
+
const incrementalResult = incrementalParser.parse(source);
|
|
1864
|
+
const chunks = ChunkDetector.detect(source);
|
|
1865
|
+
const children = incrementalResult.ast.type === "fragment" ? incrementalResult.ast.children || [] : [incrementalResult.ast];
|
|
1866
|
+
for (let i = 0; i < children.length; i++) {
|
|
1867
|
+
const chunk = chunks[i];
|
|
1868
|
+
if (chunk && chunk.startLine > 1) {
|
|
1869
|
+
this.offsetNodeLoc(children[i], chunk.startLine - 1);
|
|
1870
|
+
}
|
|
1871
|
+
}
|
|
1623
1872
|
this.source = source;
|
|
1624
1873
|
this.errors = [];
|
|
1625
1874
|
this.warnings = [];
|
|
@@ -1628,46 +1877,43 @@ var HoloScriptPlusParser = class {
|
|
|
1628
1877
|
this.hasVRTraits = false;
|
|
1629
1878
|
this.hasControlFlow = false;
|
|
1630
1879
|
this.compiledExpressions = /* @__PURE__ */ new Map();
|
|
1631
|
-
const
|
|
1632
|
-
|
|
1633
|
-
|
|
1634
|
-
|
|
1635
|
-
|
|
1636
|
-
|
|
1637
|
-
|
|
1638
|
-
|
|
1639
|
-
|
|
1640
|
-
|
|
1641
|
-
|
|
1642
|
-
const chunkFeatures = chunkResult.features;
|
|
1643
|
-
if (chunkAst?.root) {
|
|
1644
|
-
const node = chunkAst.root;
|
|
1645
|
-
this.offsetNodeLoc(node, chunk.startLine - 1);
|
|
1646
|
-
topLevelNodes.push(node);
|
|
1647
|
-
cache.set(chunk.id, hash, node);
|
|
1648
|
-
this.hasState = this.hasState || !!chunkFeatures?.state;
|
|
1649
|
-
this.hasVRTraits = this.hasVRTraits || !!chunkFeatures?.vrTraits;
|
|
1650
|
-
this.hasControlFlow = this.hasControlFlow || !!chunkFeatures?.loops || !!chunkFeatures?.conditionals;
|
|
1651
|
-
this.imports.push(...chunkAst.imports);
|
|
1880
|
+
for (const node of children) {
|
|
1881
|
+
if (node && typeof node === "object") {
|
|
1882
|
+
const nodeAny = node;
|
|
1883
|
+
if (nodeAny.traits instanceof Map) {
|
|
1884
|
+
for (const [traitName] of nodeAny.traits) {
|
|
1885
|
+
const name = String(traitName);
|
|
1886
|
+
if (name === "state") this.hasState = true;
|
|
1887
|
+
if (name === "grabbable" || name === "throwable" || name === "hoverable" || name === "clickable" || name === "collidable") {
|
|
1888
|
+
this.hasVRTraits = true;
|
|
1889
|
+
}
|
|
1890
|
+
}
|
|
1652
1891
|
}
|
|
1653
|
-
this.errors.push(...chunkResult.errors);
|
|
1654
|
-
this.warnings.push(...chunkResult.warnings || []);
|
|
1655
1892
|
}
|
|
1656
1893
|
}
|
|
1657
|
-
const root = {
|
|
1894
|
+
const root = incrementalResult.ast.type === "fragment" ? incrementalResult.ast : {
|
|
1658
1895
|
type: "fragment",
|
|
1659
1896
|
id: "root",
|
|
1660
1897
|
properties: {},
|
|
1661
|
-
directives:
|
|
1662
|
-
children:
|
|
1898
|
+
directives: [],
|
|
1899
|
+
children: [incrementalResult.ast],
|
|
1663
1900
|
traits: /* @__PURE__ */ new Map(),
|
|
1664
|
-
loc: {
|
|
1665
|
-
|
|
1666
|
-
end: { line: chunks.length > 0 ? chunks[chunks.length - 1].endLine : 1, column: 1 }
|
|
1667
|
-
},
|
|
1668
|
-
body: topLevelNodes
|
|
1901
|
+
loc: incrementalResult.ast.loc || { start: { line: 1, column: 1 }, end: { line: 1, column: 1 } },
|
|
1902
|
+
body: [incrementalResult.ast]
|
|
1669
1903
|
};
|
|
1904
|
+
if (root.type === "fragment" && root.loc) {
|
|
1905
|
+
root.loc.start = { line: 1, column: 1 };
|
|
1906
|
+
if (chunks.length > 0) {
|
|
1907
|
+
root.loc.end = { line: chunks[chunks.length - 1].endLine, column: 1 };
|
|
1908
|
+
}
|
|
1909
|
+
}
|
|
1670
1910
|
const result = this.buildResult(root);
|
|
1911
|
+
result.incrementalMetrics = {
|
|
1912
|
+
cached: incrementalResult.cached,
|
|
1913
|
+
parsed: incrementalResult.parsed,
|
|
1914
|
+
duration: incrementalResult.duration,
|
|
1915
|
+
changedChunks: incrementalResult.changedChunks
|
|
1916
|
+
};
|
|
1671
1917
|
return result;
|
|
1672
1918
|
}
|
|
1673
1919
|
buildResult(root) {
|
|
@@ -1687,15 +1933,24 @@ var HoloScriptPlusParser = class {
|
|
|
1687
1933
|
}
|
|
1688
1934
|
}
|
|
1689
1935
|
if (version === void 0) version = "1.0";
|
|
1936
|
+
const children = isFragment ? root.children || [] : [root];
|
|
1937
|
+
const worlds = children.filter((c) => c.type === "world");
|
|
1938
|
+
const compositions = children.filter((c) => c.type === "composition");
|
|
1939
|
+
const templates = children.filter((c) => c.type === "template");
|
|
1940
|
+
const npcs = children.filter((c) => c.type === "npc");
|
|
1690
1941
|
const ast = {
|
|
1691
1942
|
type: "Program",
|
|
1692
1943
|
id: "root",
|
|
1693
1944
|
properties: isFragment ? root.properties || {} : {},
|
|
1694
1945
|
directives,
|
|
1695
|
-
children
|
|
1946
|
+
children,
|
|
1947
|
+
worlds,
|
|
1948
|
+
compositions,
|
|
1949
|
+
templates,
|
|
1950
|
+
npcs,
|
|
1696
1951
|
traits: isFragment ? root.traits || /* @__PURE__ */ new Map() : /* @__PURE__ */ new Map(),
|
|
1697
1952
|
loc: root.loc,
|
|
1698
|
-
body:
|
|
1953
|
+
body: children,
|
|
1699
1954
|
version,
|
|
1700
1955
|
migrations: migrations.length > 0 ? migrations : void 0,
|
|
1701
1956
|
root,
|
|
@@ -1780,14 +2035,14 @@ var HoloScriptPlusParser = class {
|
|
|
1780
2035
|
globalDirectives.push(...currentDirectives);
|
|
1781
2036
|
} else {
|
|
1782
2037
|
this.error(
|
|
1783
|
-
`Expected node after directives, got ${this.current().type}. Valid nodes: orb, template, logic, object, composition, scene, group`,
|
|
2038
|
+
`Expected node after directives, got ${this.current().type}. Valid nodes: orb, template, logic, object, world, composition, scene, group`,
|
|
1784
2039
|
"HSP003"
|
|
1785
2040
|
);
|
|
1786
2041
|
globalDirectives.push(...currentDirectives);
|
|
1787
2042
|
}
|
|
1788
2043
|
} else if (!this.check("EOF")) {
|
|
1789
2044
|
this.error(
|
|
1790
|
-
`Unexpected token ${this.current().type} "${this.current().value}" at top level. Expected: composition, object, template, logic, or @directive`,
|
|
2045
|
+
`Unexpected token ${this.current().type} "${this.current().value}" at top level. Expected: composition, object, world, template, logic, or @directive`,
|
|
1791
2046
|
"HSP001"
|
|
1792
2047
|
);
|
|
1793
2048
|
throw new Error("ParseError");
|
|
@@ -1976,7 +2231,7 @@ var HoloScriptPlusParser = class {
|
|
|
1976
2231
|
}
|
|
1977
2232
|
};
|
|
1978
2233
|
}
|
|
1979
|
-
if (type === "composition") {
|
|
2234
|
+
if (type === "composition" || type === "world") {
|
|
1980
2235
|
let id2;
|
|
1981
2236
|
if (this.check("HASH")) {
|
|
1982
2237
|
this.advance();
|
|
@@ -1989,14 +2244,25 @@ var HoloScriptPlusParser = class {
|
|
|
1989
2244
|
id2 = this.advance().value;
|
|
1990
2245
|
}
|
|
1991
2246
|
const compBody = this.parseCompositionBlock();
|
|
2247
|
+
const traits2 = /* @__PURE__ */ new Map();
|
|
2248
|
+
for (const child of compBody.children) {
|
|
2249
|
+
if (child.type === "fragment" && Array.isArray(child.directives)) {
|
|
2250
|
+
for (const d of child.directives) {
|
|
2251
|
+
if (d.type === "trait") {
|
|
2252
|
+
traits2.set(d.name, d.config);
|
|
2253
|
+
this.hasVRTraits = true;
|
|
2254
|
+
}
|
|
2255
|
+
}
|
|
2256
|
+
}
|
|
2257
|
+
}
|
|
1992
2258
|
return {
|
|
1993
|
-
type: "composition",
|
|
2259
|
+
type: type === "composition" ? "composition" : "world",
|
|
1994
2260
|
name: id2,
|
|
1995
2261
|
id: id2,
|
|
1996
2262
|
properties: compBody.properties || {},
|
|
1997
2263
|
directives: [],
|
|
1998
2264
|
children: compBody.children,
|
|
1999
|
-
traits:
|
|
2265
|
+
traits: traits2,
|
|
2000
2266
|
body: compBody,
|
|
2001
2267
|
loc: {
|
|
2002
2268
|
start: { line: startToken.line, column: startToken.column },
|
|
@@ -2148,7 +2414,7 @@ var HoloScriptPlusParser = class {
|
|
|
2148
2414
|
properties[key] = spreadNode;
|
|
2149
2415
|
} else {
|
|
2150
2416
|
const token = this.current();
|
|
2151
|
-
const isKeyToken = token.type === "IDENTIFIER" || token.type === "STRING" || token.type === "STATE" || token.type === "STATE_MACHINE" || token.type === "INITIAL" || token.type === "ON_ENTRY" || token.type === "ON_EXIT" || token.type === "TRANSITION";
|
|
2417
|
+
const isKeyToken = token.type === "IDENTIFIER" || token.type === "STRING" || token.type === "HASH" || token.type === "STATE" || token.type === "STATE_MACHINE" || token.type === "INITIAL" || token.type === "ON_ENTRY" || token.type === "ON_EXIT" || token.type === "TRANSITION";
|
|
2152
2418
|
if (isKeyToken) {
|
|
2153
2419
|
const saved = this.pos;
|
|
2154
2420
|
const name = this.advance().value;
|
|
@@ -2170,6 +2436,7 @@ var HoloScriptPlusParser = class {
|
|
|
2170
2436
|
"spatial_group",
|
|
2171
2437
|
"scene",
|
|
2172
2438
|
"group",
|
|
2439
|
+
"world",
|
|
2173
2440
|
"module",
|
|
2174
2441
|
"struct",
|
|
2175
2442
|
"orb",
|
|
@@ -2177,7 +2444,9 @@ var HoloScriptPlusParser = class {
|
|
|
2177
2444
|
"assert",
|
|
2178
2445
|
"transition",
|
|
2179
2446
|
"on_entry",
|
|
2180
|
-
"on_exit"
|
|
2447
|
+
"on_exit",
|
|
2448
|
+
"page",
|
|
2449
|
+
"include"
|
|
2181
2450
|
];
|
|
2182
2451
|
if (name === "transition" && this.check("STRING")) {
|
|
2183
2452
|
const event = this.advance().value;
|
|
@@ -2352,7 +2621,7 @@ var HoloScriptPlusParser = class {
|
|
|
2352
2621
|
} else if (this.check("LBRACE")) {
|
|
2353
2622
|
config2 = this.parseBlockContent();
|
|
2354
2623
|
}
|
|
2355
|
-
return { type: "trait", name, config: config2 };
|
|
2624
|
+
return this.parseTraitSumTail({ type: "trait", name, config: config2 });
|
|
2356
2625
|
}
|
|
2357
2626
|
if (LIFECYCLE_HOOKS.includes(name)) {
|
|
2358
2627
|
const params = [];
|
|
@@ -2690,7 +2959,35 @@ var HoloScriptPlusParser = class {
|
|
|
2690
2959
|
config.body = this.parseCodeBlock();
|
|
2691
2960
|
}
|
|
2692
2961
|
}
|
|
2693
|
-
return { type: "trait", name, config };
|
|
2962
|
+
return this.parseTraitSumTail({ type: "trait", name, config });
|
|
2963
|
+
}
|
|
2964
|
+
parseTraitSumTail(first) {
|
|
2965
|
+
if (!this.check("PLUS")) {
|
|
2966
|
+
return first;
|
|
2967
|
+
}
|
|
2968
|
+
const alternatives = [
|
|
2969
|
+
{ type: "trait_atom", name: first.name, config: first.config ?? {} }
|
|
2970
|
+
];
|
|
2971
|
+
while (this.check("PLUS")) {
|
|
2972
|
+
this.advance();
|
|
2973
|
+
alternatives.push(this.parseTraitAtom());
|
|
2974
|
+
}
|
|
2975
|
+
return {
|
|
2976
|
+
type: "trait_sum",
|
|
2977
|
+
operation: "additive",
|
|
2978
|
+
alternatives
|
|
2979
|
+
};
|
|
2980
|
+
}
|
|
2981
|
+
parseTraitAtom() {
|
|
2982
|
+
this.expect("AT", "Expected @ in trait sum alternative");
|
|
2983
|
+
const name = this.expect("IDENTIFIER", "Expected trait name in trait sum alternative").value;
|
|
2984
|
+
let config = {};
|
|
2985
|
+
if (this.check("LPAREN")) {
|
|
2986
|
+
config = this.parseTraitConfig();
|
|
2987
|
+
} else if (this.check("LBRACE")) {
|
|
2988
|
+
config = this.parseBlockContent();
|
|
2989
|
+
}
|
|
2990
|
+
return { type: "trait_atom", name, config };
|
|
2694
2991
|
}
|
|
2695
2992
|
/**
|
|
2696
2993
|
* Parse a string inside parentheses: ("name")
|
|
@@ -2878,6 +3175,7 @@ var HoloScriptPlusParser = class {
|
|
|
2878
3175
|
"spatial_group",
|
|
2879
3176
|
"scene",
|
|
2880
3177
|
"group",
|
|
3178
|
+
"world",
|
|
2881
3179
|
"module",
|
|
2882
3180
|
"struct",
|
|
2883
3181
|
"orb",
|
|
@@ -2891,7 +3189,9 @@ var HoloScriptPlusParser = class {
|
|
|
2891
3189
|
"light",
|
|
2892
3190
|
"npc",
|
|
2893
3191
|
"camera",
|
|
2894
|
-
"timeline"
|
|
3192
|
+
"timeline",
|
|
3193
|
+
"page",
|
|
3194
|
+
"include"
|
|
2895
3195
|
];
|
|
2896
3196
|
while (!this.check("RBRACE") && !this.check("EOF")) {
|
|
2897
3197
|
const currentDirectives = [];
|
|
@@ -2908,11 +3208,69 @@ var HoloScriptPlusParser = class {
|
|
|
2908
3208
|
if (isNodeStart) {
|
|
2909
3209
|
const token = this.current();
|
|
2910
3210
|
const next = this.peek(1);
|
|
2911
|
-
if (next.type === "
|
|
3211
|
+
if (token.type === "IDENTIFIER" && token.value === "system" && (next.type === "IDENTIFIER" || next.type === "STRING") && this.peek(2).type !== "LBRACE") {
|
|
3212
|
+
const startToken = this.advance();
|
|
3213
|
+
const name = this.advance().value;
|
|
3214
|
+
result.systems.push({
|
|
3215
|
+
type: "system",
|
|
3216
|
+
name,
|
|
3217
|
+
id: name,
|
|
3218
|
+
properties: {},
|
|
3219
|
+
directives: currentDirectives,
|
|
3220
|
+
children: [],
|
|
3221
|
+
traits: /* @__PURE__ */ new Map(),
|
|
3222
|
+
loc: {
|
|
3223
|
+
start: { line: startToken.line, column: startToken.column },
|
|
3224
|
+
end: { line: this.current().line, column: this.current().column }
|
|
3225
|
+
}
|
|
3226
|
+
});
|
|
3227
|
+
} else if (token.type === "IDENTIFIER" && token.value === "page" && next.type === "STRING") {
|
|
3228
|
+
const startToken = this.advance();
|
|
3229
|
+
const name = this.advance().value;
|
|
3230
|
+
const properties = {};
|
|
3231
|
+
if (this.check("LBRACE")) {
|
|
3232
|
+
this.advance();
|
|
3233
|
+
this.skipNewlines();
|
|
3234
|
+
while (!this.check("RBRACE") && !this.check("EOF")) {
|
|
3235
|
+
this.skipNewlines();
|
|
3236
|
+
if (this.check("RBRACE") || this.check("EOF")) break;
|
|
3237
|
+
if (this.check("IDENTIFIER")) {
|
|
3238
|
+
const key = this.advance().value;
|
|
3239
|
+
if (this.check("COLON") || this.check("EQUALS")) {
|
|
3240
|
+
this.advance();
|
|
3241
|
+
properties[key] = this.parseValue();
|
|
3242
|
+
} else if (this.check("STRING")) {
|
|
3243
|
+
properties[key] = this.advance().value;
|
|
3244
|
+
} else {
|
|
3245
|
+
properties[key] = true;
|
|
3246
|
+
}
|
|
3247
|
+
} else if (this.check("COMMA")) {
|
|
3248
|
+
this.advance();
|
|
3249
|
+
} else {
|
|
3250
|
+
this.advance();
|
|
3251
|
+
}
|
|
3252
|
+
this.skipNewlines();
|
|
3253
|
+
}
|
|
3254
|
+
this.expect("RBRACE", "Expected }");
|
|
3255
|
+
}
|
|
3256
|
+
result.children.push({
|
|
3257
|
+
type: "page",
|
|
3258
|
+
name,
|
|
3259
|
+
id: name,
|
|
3260
|
+
properties,
|
|
3261
|
+
directives: currentDirectives,
|
|
3262
|
+
children: [],
|
|
3263
|
+
traits: /* @__PURE__ */ new Map(),
|
|
3264
|
+
loc: {
|
|
3265
|
+
start: { line: startToken.line, column: startToken.column },
|
|
3266
|
+
end: { line: this.current().line, column: this.current().column }
|
|
3267
|
+
}
|
|
3268
|
+
});
|
|
3269
|
+
} else if (next.type === "COLON" || next.type === "EQUALS") {
|
|
2912
3270
|
const key = this.advance().value;
|
|
2913
3271
|
this.advance();
|
|
2914
3272
|
result.properties[key] = this.parseValue();
|
|
2915
|
-
} else if (childNodeKeywords.includes(token.value) && (next.type === "LBRACE" || next.type === "STRING" || next.type === "IDENTIFIER")) {
|
|
3273
|
+
} else if (childNodeKeywords.includes(token.value) && (next.type === "LBRACE" || next.type === "STRING" || next.type === "IDENTIFIER" || next.type === "HASH")) {
|
|
2916
3274
|
const keyword = this.current().value;
|
|
2917
3275
|
const node = this.parseNode();
|
|
2918
3276
|
node.directives = [...currentDirectives, ...node.directives || []];
|
|
@@ -2926,7 +3284,7 @@ var HoloScriptPlusParser = class {
|
|
|
2926
3284
|
} else if (!childNodeKeywords.includes(token.value) && (next.type === "STRING" || next.type === "NUMBER" || next.type === "BOOLEAN" || next.type === "NULL")) {
|
|
2927
3285
|
const key = this.advance().value;
|
|
2928
3286
|
result.properties[key] = this.parseValue();
|
|
2929
|
-
} else if (next.type === "LBRACE" || next.type === "IDENTIFIER" || next.type === "STRING") {
|
|
3287
|
+
} else if (next.type === "LBRACE" || next.type === "IDENTIFIER" || next.type === "STRING" || next.type === "HASH") {
|
|
2930
3288
|
const keyword = this.current().value;
|
|
2931
3289
|
const node = this.parseNode();
|
|
2932
3290
|
node.directives = [...currentDirectives, ...node.directives || []];
|
|
@@ -3022,6 +3380,7 @@ var HoloScriptPlusParser = class {
|
|
|
3022
3380
|
parseLogicBlock() {
|
|
3023
3381
|
const result = {
|
|
3024
3382
|
functions: [],
|
|
3383
|
+
actions: [],
|
|
3025
3384
|
eventHandlers: [],
|
|
3026
3385
|
tickHandlers: []
|
|
3027
3386
|
};
|
|
@@ -3057,6 +3416,32 @@ var HoloScriptPlusParser = class {
|
|
|
3057
3416
|
}
|
|
3058
3417
|
const body = this.parseCodeBlock();
|
|
3059
3418
|
result.functions.push({ name: funcName, params, body });
|
|
3419
|
+
} else if (keyword === "action") {
|
|
3420
|
+
this.advance();
|
|
3421
|
+
const actionName = this.check("IDENTIFIER") || this.check("STRING") ? this.advance().value : "anonymous";
|
|
3422
|
+
const params = [];
|
|
3423
|
+
if (this.check("LPAREN")) {
|
|
3424
|
+
this.advance();
|
|
3425
|
+
while (!this.check("RPAREN") && !this.check("EOF")) {
|
|
3426
|
+
if (this.check("IDENTIFIER")) {
|
|
3427
|
+
params.push(this.advance().value);
|
|
3428
|
+
if (this.check("COLON")) {
|
|
3429
|
+
this.advance();
|
|
3430
|
+
while (!this.check("COMMA") && !this.check("RPAREN") && !this.check("EOF")) {
|
|
3431
|
+
this.advance();
|
|
3432
|
+
}
|
|
3433
|
+
}
|
|
3434
|
+
if (this.check("COMMA")) {
|
|
3435
|
+
this.advance();
|
|
3436
|
+
}
|
|
3437
|
+
} else {
|
|
3438
|
+
this.advance();
|
|
3439
|
+
}
|
|
3440
|
+
}
|
|
3441
|
+
this.expect("RPAREN", "Expected )");
|
|
3442
|
+
}
|
|
3443
|
+
const body = this.check("LBRACE") ? this.parseCodeBlock() : "";
|
|
3444
|
+
result.actions.push({ name: actionName, params, body });
|
|
3060
3445
|
} else if (keyword === "on_tick") {
|
|
3061
3446
|
this.advance();
|
|
3062
3447
|
let interval = 1;
|
|
@@ -4457,6 +4842,6 @@ function parse(source, options) {
|
|
|
4457
4842
|
return parser.parse(source);
|
|
4458
4843
|
}
|
|
4459
4844
|
|
|
4460
|
-
export {
|
|
4461
|
-
//# sourceMappingURL=chunk-
|
|
4462
|
-
//# sourceMappingURL=chunk-
|
|
4845
|
+
export { ChunkBasedIncrementalParser, HSPLUS_ERROR_CODES, HoloScriptPlusParser, ParseCache, createKeywordError, createParser, createRichError, createTraitError, findSimilarKeyword, findSimilarTrait, formatRichError, formatRichErrors, getErrorCodeDocumentation, getSourceContext, globalParseCache, parse, parseIncrementalChunks };
|
|
4846
|
+
//# sourceMappingURL=chunk-YIMN575O.js.map
|
|
4847
|
+
//# sourceMappingURL=chunk-YIMN575O.js.map
|