@eidos.space/just-bash 3.0.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/CHANGELOG.md +53 -0
- package/LICENSE +201 -0
- package/README.md +609 -0
- package/dist/AGENTS.md +325 -0
- package/dist/Bash.d.ts +257 -0
- package/dist/ast/types.d.ts +609 -0
- package/dist/banned-patterns-test.d.ts +1 -0
- package/dist/bin/chunks/alias-YRVAW27Y.js +3 -0
- package/dist/bin/chunks/awk2-RLMNTGI7.js +3 -0
- package/dist/bin/chunks/base64-RZRLGMB3.js +3 -0
- package/dist/bin/chunks/basename-F3AQ4KAQ.js +3 -0
- package/dist/bin/chunks/bash-CLP24TE2.js +3 -0
- package/dist/bin/chunks/cat-LQH5FSAR.js +3 -0
- package/dist/bin/chunks/chmod-S564JCJW.js +3 -0
- package/dist/bin/chunks/chunk-22HCD466.js +3 -0
- package/dist/bin/chunks/chunk-2AIXTPH2.js +9 -0
- package/dist/bin/chunks/chunk-2ETT4ELS.js +4 -0
- package/dist/bin/chunks/chunk-2GG3NVC4.js +10 -0
- package/dist/bin/chunks/chunk-2NRAWO6E.js +7 -0
- package/dist/bin/chunks/chunk-2SVX7I5P.js +14 -0
- package/dist/bin/chunks/chunk-3BYTCO2H.js +12 -0
- package/dist/bin/chunks/chunk-3MRB66F4.js +3 -0
- package/dist/bin/chunks/chunk-3UKQXBQ3.js +6 -0
- package/dist/bin/chunks/chunk-3WIMLJM7.js +8 -0
- package/dist/bin/chunks/chunk-47WZ2U6M.js +9 -0
- package/dist/bin/chunks/chunk-4KSZJAQK.js +6 -0
- package/dist/bin/chunks/chunk-5XSZHUEI.js +15 -0
- package/dist/bin/chunks/chunk-6FSBHK6H.js +22 -0
- package/dist/bin/chunks/chunk-6WJQNLR2.js +7 -0
- package/dist/bin/chunks/chunk-77MLOOQS.js +11 -0
- package/dist/bin/chunks/chunk-7AYT3UKI.js +6 -0
- package/dist/bin/chunks/chunk-7JZKVC3F.js +2 -0
- package/dist/bin/chunks/chunk-7NC4CPHS.js +20 -0
- package/dist/bin/chunks/chunk-7UU7KPEM.js +7 -0
- package/dist/bin/chunks/chunk-7VCQWCSH.js +15 -0
- package/dist/bin/chunks/chunk-AGKL4LDL.js +4 -0
- package/dist/bin/chunks/chunk-AJF3OBTR.js +4 -0
- package/dist/bin/chunks/chunk-ALVEEXFD.js +19 -0
- package/dist/bin/chunks/chunk-B2DRBHGQ.js +3 -0
- package/dist/bin/chunks/chunk-BE4PARL3.js +13 -0
- package/dist/bin/chunks/chunk-BGX3RW7H.js +10 -0
- package/dist/bin/chunks/chunk-BIJXTWZ4.js +3 -0
- package/dist/bin/chunks/chunk-BPZJYOUA.js +33 -0
- package/dist/bin/chunks/chunk-BZP56QBM.js +24 -0
- package/dist/bin/chunks/chunk-C7ISPH7Y.js +18 -0
- package/dist/bin/chunks/chunk-CAZ75E7E.js +3 -0
- package/dist/bin/chunks/chunk-D6CPXGKK.js +75 -0
- package/dist/bin/chunks/chunk-DJAX3ZRG.js +8 -0
- package/dist/bin/chunks/chunk-DYIBFLS3.js +17 -0
- package/dist/bin/chunks/chunk-EDTBGO7F.js +37 -0
- package/dist/bin/chunks/chunk-F3GKANW3.js +12 -0
- package/dist/bin/chunks/chunk-F3WNDKOC.js +3 -0
- package/dist/bin/chunks/chunk-FKVQZWJQ.js +10 -0
- package/dist/bin/chunks/chunk-FOUVACI7.js +16 -0
- package/dist/bin/chunks/chunk-FVRXEJYQ.js +141 -0
- package/dist/bin/chunks/chunk-G4AUMZUY.js +4 -0
- package/dist/bin/chunks/chunk-H7JTIXAO.js +4 -0
- package/dist/bin/chunks/chunk-HL4ZS7TX.js +6 -0
- package/dist/bin/chunks/chunk-HN2DCT7T.js +13 -0
- package/dist/bin/chunks/chunk-I4IRHQDW.js +3 -0
- package/dist/bin/chunks/chunk-IEXQTXU5.js +34 -0
- package/dist/bin/chunks/chunk-IZGLHVBB.js +8 -0
- package/dist/bin/chunks/chunk-J7TUF2VI.js +9 -0
- package/dist/bin/chunks/chunk-JNUX75OX.js +85 -0
- package/dist/bin/chunks/chunk-JXLDT4KX.js +4 -0
- package/dist/bin/chunks/chunk-JZW7NFK2.js +288 -0
- package/dist/bin/chunks/chunk-KFMPGSUT.js +9 -0
- package/dist/bin/chunks/chunk-KI54R2QB.js +3 -0
- package/dist/bin/chunks/chunk-KRRM5UCC.js +3 -0
- package/dist/bin/chunks/chunk-KUMHQGUR.js +3 -0
- package/dist/bin/chunks/chunk-L24QXM5S.js +34 -0
- package/dist/bin/chunks/chunk-LAHBP3FW.js +11 -0
- package/dist/bin/chunks/chunk-LC6D27QJ.js +3 -0
- package/dist/bin/chunks/chunk-LNNWMRCB.js +3 -0
- package/dist/bin/chunks/chunk-LNVSXNT7.js +3 -0
- package/dist/bin/chunks/chunk-LSQTB2QK.js +7 -0
- package/dist/bin/chunks/chunk-M65CQLJE.js +101 -0
- package/dist/bin/chunks/chunk-MLUOPG3W.js +3 -0
- package/dist/bin/chunks/chunk-MNWK4UIM.js +22 -0
- package/dist/bin/chunks/chunk-MROECM42.js +3 -0
- package/dist/bin/chunks/chunk-MUFNRCMY.js +24 -0
- package/dist/bin/chunks/chunk-N6YW4W3Z.js +29 -0
- package/dist/bin/chunks/chunk-NE4R2FVV.js +5 -0
- package/dist/bin/chunks/chunk-NXVG64T3.js +22 -0
- package/dist/bin/chunks/chunk-NYIPFY36.js +3 -0
- package/dist/bin/chunks/chunk-O2BCKSMK.js +3 -0
- package/dist/bin/chunks/chunk-OLEQNRKX.js +8 -0
- package/dist/bin/chunks/chunk-OPMLWMNH.js +17 -0
- package/dist/bin/chunks/chunk-PAYQNSZN.js +18 -0
- package/dist/bin/chunks/chunk-PBOVSFTJ.js +3 -0
- package/dist/bin/chunks/chunk-PXP4YYZA.js +13 -0
- package/dist/bin/chunks/chunk-PZQVSQX6.js +4 -0
- package/dist/bin/chunks/chunk-Q2GOPGDA.js +6 -0
- package/dist/bin/chunks/chunk-Q4UMTSRO.js +15 -0
- package/dist/bin/chunks/chunk-QL33F2W6.js +8 -0
- package/dist/bin/chunks/chunk-RVPTAYDS.js +4 -0
- package/dist/bin/chunks/chunk-SMSELHIY.js +12 -0
- package/dist/bin/chunks/chunk-UGJM7CKP.js +17 -0
- package/dist/bin/chunks/chunk-UO5LOD7U.js +12 -0
- package/dist/bin/chunks/chunk-UOMNSQEZ.js +10 -0
- package/dist/bin/chunks/chunk-UR4CEP4Y.js +3 -0
- package/dist/bin/chunks/chunk-V2RP73X4.js +15 -0
- package/dist/bin/chunks/chunk-VBDLSL7Y.js +10 -0
- package/dist/bin/chunks/chunk-VZK4FHWJ.js +3 -0
- package/dist/bin/chunks/chunk-WDWNEHHE.js +9 -0
- package/dist/bin/chunks/chunk-X4MX6EHF.js +6 -0
- package/dist/bin/chunks/chunk-XBB73LFB.js +5 -0
- package/dist/bin/chunks/chunk-XFFUAO3F.js +3 -0
- package/dist/bin/chunks/chunk-XHCCSVP6.js +9 -0
- package/dist/bin/chunks/chunk-XJ37N3S5.js +7 -0
- package/dist/bin/chunks/chunk-XPTYN6UE.js +8 -0
- package/dist/bin/chunks/chunk-XRUDFQG5.js +7 -0
- package/dist/bin/chunks/chunk-Y4FPH5DQ.js +64 -0
- package/dist/bin/chunks/chunk-YJ5OCPSK.js +7 -0
- package/dist/bin/chunks/chunk-YOIFOOGX.js +9 -0
- package/dist/bin/chunks/chunk-YOKQNNQO.js +6 -0
- package/dist/bin/chunks/chunk-YUZRUF5F.js +10 -0
- package/dist/bin/chunks/chunk-YY5PJR7O.js +7 -0
- package/dist/bin/chunks/chunk-ZFUVUYWG.js +15 -0
- package/dist/bin/chunks/clear-FGNEKYDU.js +3 -0
- package/dist/bin/chunks/column-AQB3A3PJ.js +3 -0
- package/dist/bin/chunks/comm-Q4VDF6ZO.js +3 -0
- package/dist/bin/chunks/cp-HYXTMN3D.js +3 -0
- package/dist/bin/chunks/curl-PLHETP4J.js +27 -0
- package/dist/bin/chunks/cut-ZI2HIAW7.js +3 -0
- package/dist/bin/chunks/date-JEZYSA4F.js +3 -0
- package/dist/bin/chunks/diff-YDJ42RKS.js +3 -0
- package/dist/bin/chunks/dirname-VCINTLPD.js +3 -0
- package/dist/bin/chunks/du-4LRQIGRG.js +3 -0
- package/dist/bin/chunks/echo-KCOHTNDF.js +3 -0
- package/dist/bin/chunks/env-NY32PQJM.js +3 -0
- package/dist/bin/chunks/expand-YYSO35NS.js +3 -0
- package/dist/bin/chunks/expansion-PPP6PD75.js +3 -0
- package/dist/bin/chunks/expr-7PLWSWZI.js +3 -0
- package/dist/bin/chunks/file-GRZLWDVH.js +3 -0
- package/dist/bin/chunks/find-P4DOE7CE.js +3 -0
- package/dist/bin/chunks/flag-coverage-RFKIBJ6L.js +3 -0
- package/dist/bin/chunks/fold-5MF7QZWQ.js +3 -0
- package/dist/bin/chunks/grep-VAYCFO4O.js +3 -0
- package/dist/bin/chunks/gzip-UGBQQKIH.js +3 -0
- package/dist/bin/chunks/head-QNC2ZYDO.js +3 -0
- package/dist/bin/chunks/help-CGUEOGXQ.js +3 -0
- package/dist/bin/chunks/history-AQQWW3QB.js +3 -0
- package/dist/bin/chunks/hostname-USNWOQCK.js +3 -0
- package/dist/bin/chunks/html-to-markdown-QEFY7XQR.js +3 -0
- package/dist/bin/chunks/join-EJ73DYTK.js +3 -0
- package/dist/bin/chunks/jq-GGTKKMEN.js +3 -0
- package/dist/bin/chunks/js-exec-BC6NI55L.js +98 -0
- package/dist/bin/chunks/js-exec-worker.js +4443 -0
- package/dist/bin/chunks/ln-LP4HMCSM.js +3 -0
- package/dist/bin/chunks/ls-KBNHNZWQ.js +3 -0
- package/dist/bin/chunks/md5sum-MCVDIB35.js +3 -0
- package/dist/bin/chunks/mkdir-P4DKRCDX.js +3 -0
- package/dist/bin/chunks/mv-QQK4FQX6.js +3 -0
- package/dist/bin/chunks/nl-KUPLVCTS.js +3 -0
- package/dist/bin/chunks/od-YQ5ZUI2H.js +3 -0
- package/dist/bin/chunks/paste-A5KKPWXX.js +3 -0
- package/dist/bin/chunks/printf-Z5C2UOI5.js +3 -0
- package/dist/bin/chunks/pwd-FCNDA467.js +3 -0
- package/dist/bin/chunks/python3-BQWDPUBM.js +13 -0
- package/dist/bin/chunks/readlink-25V57VOL.js +3 -0
- package/dist/bin/chunks/rev-PYHOZ4D4.js +3 -0
- package/dist/bin/chunks/rg-BGFMSIVK.js +3 -0
- package/dist/bin/chunks/rm-ECNUFR66.js +3 -0
- package/dist/bin/chunks/rmdir-DLOHIA7Q.js +3 -0
- package/dist/bin/chunks/sed-FWA634SN.js +3 -0
- package/dist/bin/chunks/seq-UXDJE6FB.js +3 -0
- package/dist/bin/chunks/sha1sum-4KF52U3Y.js +3 -0
- package/dist/bin/chunks/sha256sum-6YEPULPX.js +3 -0
- package/dist/bin/chunks/sleep-QHAPNY3Q.js +3 -0
- package/dist/bin/chunks/sort-4C6WOKNK.js +3 -0
- package/dist/bin/chunks/split-TV7NL7LA.js +3 -0
- package/dist/bin/chunks/sqlite3-W777NCI4.js +3 -0
- package/dist/bin/chunks/sqlite3-worker.js +1728 -0
- package/dist/bin/chunks/stat-BD6KT3BP.js +3 -0
- package/dist/bin/chunks/strings-MDD72LR6.js +3 -0
- package/dist/bin/chunks/tac-C2N4NQ6S.js +3 -0
- package/dist/bin/chunks/tail-BCB5W6JC.js +3 -0
- package/dist/bin/chunks/tar-DOO744MK.js +3 -0
- package/dist/bin/chunks/tee-UQHPO4OW.js +3 -0
- package/dist/bin/chunks/time-ZPY52VT2.js +3 -0
- package/dist/bin/chunks/timeout-5AX3ZS3X.js +3 -0
- package/dist/bin/chunks/touch-DFGSVIX7.js +3 -0
- package/dist/bin/chunks/tr-G7K6M6HP.js +3 -0
- package/dist/bin/chunks/tree-6D7SMPUR.js +3 -0
- package/dist/bin/chunks/true-SKL4L7JP.js +3 -0
- package/dist/bin/chunks/unexpand-QIR4EDPG.js +3 -0
- package/dist/bin/chunks/uniq-I7PVFJR4.js +3 -0
- package/dist/bin/chunks/wc-6NGWULAP.js +3 -0
- package/dist/bin/chunks/which-LCXKCLFC.js +3 -0
- package/dist/bin/chunks/whoami-TZDZDU7T.js +3 -0
- package/dist/bin/chunks/worker.js +3150 -0
- package/dist/bin/chunks/xan-KX4VPXUN.js +3 -0
- package/dist/bin/chunks/xan-view-JXOZLJ7S.js +3 -0
- package/dist/bin/chunks/xargs-UWHPYLY7.js +3 -0
- package/dist/bin/chunks/yq-GCDCJBKB.js +3 -0
- package/dist/bin/just-bash.js +755 -0
- package/dist/bin/shell/chunks/alias-YRVAW27Y.js +3 -0
- package/dist/bin/shell/chunks/awk2-RLMNTGI7.js +3 -0
- package/dist/bin/shell/chunks/base64-RZRLGMB3.js +3 -0
- package/dist/bin/shell/chunks/basename-F3AQ4KAQ.js +3 -0
- package/dist/bin/shell/chunks/bash-CLP24TE2.js +3 -0
- package/dist/bin/shell/chunks/cat-LQH5FSAR.js +3 -0
- package/dist/bin/shell/chunks/chmod-S564JCJW.js +3 -0
- package/dist/bin/shell/chunks/chunk-22HCD466.js +3 -0
- package/dist/bin/shell/chunks/chunk-2AIXTPH2.js +9 -0
- package/dist/bin/shell/chunks/chunk-2ETT4ELS.js +4 -0
- package/dist/bin/shell/chunks/chunk-2GG3NVC4.js +10 -0
- package/dist/bin/shell/chunks/chunk-2NRAWO6E.js +7 -0
- package/dist/bin/shell/chunks/chunk-2SVX7I5P.js +14 -0
- package/dist/bin/shell/chunks/chunk-3BYTCO2H.js +12 -0
- package/dist/bin/shell/chunks/chunk-3MRB66F4.js +3 -0
- package/dist/bin/shell/chunks/chunk-3UKQXBQ3.js +6 -0
- package/dist/bin/shell/chunks/chunk-3WIMLJM7.js +8 -0
- package/dist/bin/shell/chunks/chunk-47WZ2U6M.js +9 -0
- package/dist/bin/shell/chunks/chunk-4KSZJAQK.js +6 -0
- package/dist/bin/shell/chunks/chunk-5XSZHUEI.js +15 -0
- package/dist/bin/shell/chunks/chunk-6FSBHK6H.js +22 -0
- package/dist/bin/shell/chunks/chunk-6WJQNLR2.js +7 -0
- package/dist/bin/shell/chunks/chunk-77MLOOQS.js +11 -0
- package/dist/bin/shell/chunks/chunk-7AYT3UKI.js +6 -0
- package/dist/bin/shell/chunks/chunk-7JZKVC3F.js +2 -0
- package/dist/bin/shell/chunks/chunk-7NC4CPHS.js +20 -0
- package/dist/bin/shell/chunks/chunk-7UU7KPEM.js +7 -0
- package/dist/bin/shell/chunks/chunk-7VCQWCSH.js +15 -0
- package/dist/bin/shell/chunks/chunk-AGKL4LDL.js +4 -0
- package/dist/bin/shell/chunks/chunk-AJF3OBTR.js +4 -0
- package/dist/bin/shell/chunks/chunk-ALVEEXFD.js +19 -0
- package/dist/bin/shell/chunks/chunk-B2DRBHGQ.js +3 -0
- package/dist/bin/shell/chunks/chunk-BE4PARL3.js +13 -0
- package/dist/bin/shell/chunks/chunk-BGX3RW7H.js +10 -0
- package/dist/bin/shell/chunks/chunk-BIJXTWZ4.js +3 -0
- package/dist/bin/shell/chunks/chunk-BPZJYOUA.js +33 -0
- package/dist/bin/shell/chunks/chunk-BZP56QBM.js +24 -0
- package/dist/bin/shell/chunks/chunk-C7ISPH7Y.js +18 -0
- package/dist/bin/shell/chunks/chunk-CAZ75E7E.js +3 -0
- package/dist/bin/shell/chunks/chunk-D6CPXGKK.js +75 -0
- package/dist/bin/shell/chunks/chunk-DJAX3ZRG.js +8 -0
- package/dist/bin/shell/chunks/chunk-DYIBFLS3.js +17 -0
- package/dist/bin/shell/chunks/chunk-EDTBGO7F.js +37 -0
- package/dist/bin/shell/chunks/chunk-F3GKANW3.js +12 -0
- package/dist/bin/shell/chunks/chunk-F3WNDKOC.js +3 -0
- package/dist/bin/shell/chunks/chunk-FKVQZWJQ.js +10 -0
- package/dist/bin/shell/chunks/chunk-FOUVACI7.js +16 -0
- package/dist/bin/shell/chunks/chunk-FVRXEJYQ.js +141 -0
- package/dist/bin/shell/chunks/chunk-G4AUMZUY.js +4 -0
- package/dist/bin/shell/chunks/chunk-H7JTIXAO.js +4 -0
- package/dist/bin/shell/chunks/chunk-HL4ZS7TX.js +6 -0
- package/dist/bin/shell/chunks/chunk-HN2DCT7T.js +13 -0
- package/dist/bin/shell/chunks/chunk-I4IRHQDW.js +3 -0
- package/dist/bin/shell/chunks/chunk-IEXQTXU5.js +34 -0
- package/dist/bin/shell/chunks/chunk-IZGLHVBB.js +8 -0
- package/dist/bin/shell/chunks/chunk-J7TUF2VI.js +9 -0
- package/dist/bin/shell/chunks/chunk-JNUX75OX.js +85 -0
- package/dist/bin/shell/chunks/chunk-JXLDT4KX.js +4 -0
- package/dist/bin/shell/chunks/chunk-JZW7NFK2.js +288 -0
- package/dist/bin/shell/chunks/chunk-KFMPGSUT.js +9 -0
- package/dist/bin/shell/chunks/chunk-KI54R2QB.js +3 -0
- package/dist/bin/shell/chunks/chunk-KRRM5UCC.js +3 -0
- package/dist/bin/shell/chunks/chunk-KUMHQGUR.js +3 -0
- package/dist/bin/shell/chunks/chunk-L24QXM5S.js +34 -0
- package/dist/bin/shell/chunks/chunk-LAHBP3FW.js +11 -0
- package/dist/bin/shell/chunks/chunk-LC6D27QJ.js +3 -0
- package/dist/bin/shell/chunks/chunk-LNNWMRCB.js +3 -0
- package/dist/bin/shell/chunks/chunk-LNVSXNT7.js +3 -0
- package/dist/bin/shell/chunks/chunk-LSQTB2QK.js +7 -0
- package/dist/bin/shell/chunks/chunk-M65CQLJE.js +101 -0
- package/dist/bin/shell/chunks/chunk-MLUOPG3W.js +3 -0
- package/dist/bin/shell/chunks/chunk-MNWK4UIM.js +22 -0
- package/dist/bin/shell/chunks/chunk-MROECM42.js +3 -0
- package/dist/bin/shell/chunks/chunk-MUFNRCMY.js +24 -0
- package/dist/bin/shell/chunks/chunk-N6YW4W3Z.js +29 -0
- package/dist/bin/shell/chunks/chunk-NE4R2FVV.js +5 -0
- package/dist/bin/shell/chunks/chunk-NXVG64T3.js +22 -0
- package/dist/bin/shell/chunks/chunk-NYIPFY36.js +3 -0
- package/dist/bin/shell/chunks/chunk-O2BCKSMK.js +3 -0
- package/dist/bin/shell/chunks/chunk-OLEQNRKX.js +8 -0
- package/dist/bin/shell/chunks/chunk-OPMLWMNH.js +17 -0
- package/dist/bin/shell/chunks/chunk-PAYQNSZN.js +18 -0
- package/dist/bin/shell/chunks/chunk-PBOVSFTJ.js +3 -0
- package/dist/bin/shell/chunks/chunk-PXP4YYZA.js +13 -0
- package/dist/bin/shell/chunks/chunk-PZQVSQX6.js +4 -0
- package/dist/bin/shell/chunks/chunk-Q2GOPGDA.js +6 -0
- package/dist/bin/shell/chunks/chunk-Q4UMTSRO.js +15 -0
- package/dist/bin/shell/chunks/chunk-QL33F2W6.js +8 -0
- package/dist/bin/shell/chunks/chunk-RVPTAYDS.js +4 -0
- package/dist/bin/shell/chunks/chunk-SMSELHIY.js +12 -0
- package/dist/bin/shell/chunks/chunk-UGJM7CKP.js +17 -0
- package/dist/bin/shell/chunks/chunk-UO5LOD7U.js +12 -0
- package/dist/bin/shell/chunks/chunk-UOMNSQEZ.js +10 -0
- package/dist/bin/shell/chunks/chunk-UR4CEP4Y.js +3 -0
- package/dist/bin/shell/chunks/chunk-V2RP73X4.js +15 -0
- package/dist/bin/shell/chunks/chunk-VBDLSL7Y.js +10 -0
- package/dist/bin/shell/chunks/chunk-VZK4FHWJ.js +3 -0
- package/dist/bin/shell/chunks/chunk-WDWNEHHE.js +9 -0
- package/dist/bin/shell/chunks/chunk-X4MX6EHF.js +6 -0
- package/dist/bin/shell/chunks/chunk-XBB73LFB.js +5 -0
- package/dist/bin/shell/chunks/chunk-XFFUAO3F.js +3 -0
- package/dist/bin/shell/chunks/chunk-XHCCSVP6.js +9 -0
- package/dist/bin/shell/chunks/chunk-XJ37N3S5.js +7 -0
- package/dist/bin/shell/chunks/chunk-XPTYN6UE.js +8 -0
- package/dist/bin/shell/chunks/chunk-XRUDFQG5.js +7 -0
- package/dist/bin/shell/chunks/chunk-Y4FPH5DQ.js +64 -0
- package/dist/bin/shell/chunks/chunk-YJ5OCPSK.js +7 -0
- package/dist/bin/shell/chunks/chunk-YOIFOOGX.js +9 -0
- package/dist/bin/shell/chunks/chunk-YOKQNNQO.js +6 -0
- package/dist/bin/shell/chunks/chunk-YUZRUF5F.js +10 -0
- package/dist/bin/shell/chunks/chunk-YY5PJR7O.js +7 -0
- package/dist/bin/shell/chunks/chunk-ZFUVUYWG.js +15 -0
- package/dist/bin/shell/chunks/clear-FGNEKYDU.js +3 -0
- package/dist/bin/shell/chunks/column-AQB3A3PJ.js +3 -0
- package/dist/bin/shell/chunks/comm-Q4VDF6ZO.js +3 -0
- package/dist/bin/shell/chunks/cp-HYXTMN3D.js +3 -0
- package/dist/bin/shell/chunks/curl-PLHETP4J.js +27 -0
- package/dist/bin/shell/chunks/cut-ZI2HIAW7.js +3 -0
- package/dist/bin/shell/chunks/date-JEZYSA4F.js +3 -0
- package/dist/bin/shell/chunks/diff-YDJ42RKS.js +3 -0
- package/dist/bin/shell/chunks/dirname-VCINTLPD.js +3 -0
- package/dist/bin/shell/chunks/du-4LRQIGRG.js +3 -0
- package/dist/bin/shell/chunks/echo-KCOHTNDF.js +3 -0
- package/dist/bin/shell/chunks/env-NY32PQJM.js +3 -0
- package/dist/bin/shell/chunks/expand-YYSO35NS.js +3 -0
- package/dist/bin/shell/chunks/expansion-PPP6PD75.js +3 -0
- package/dist/bin/shell/chunks/expr-7PLWSWZI.js +3 -0
- package/dist/bin/shell/chunks/file-GRZLWDVH.js +3 -0
- package/dist/bin/shell/chunks/find-P4DOE7CE.js +3 -0
- package/dist/bin/shell/chunks/flag-coverage-RFKIBJ6L.js +3 -0
- package/dist/bin/shell/chunks/fold-5MF7QZWQ.js +3 -0
- package/dist/bin/shell/chunks/grep-VAYCFO4O.js +3 -0
- package/dist/bin/shell/chunks/gzip-UGBQQKIH.js +3 -0
- package/dist/bin/shell/chunks/head-QNC2ZYDO.js +3 -0
- package/dist/bin/shell/chunks/help-CGUEOGXQ.js +3 -0
- package/dist/bin/shell/chunks/history-AQQWW3QB.js +3 -0
- package/dist/bin/shell/chunks/hostname-USNWOQCK.js +3 -0
- package/dist/bin/shell/chunks/html-to-markdown-QEFY7XQR.js +3 -0
- package/dist/bin/shell/chunks/join-EJ73DYTK.js +3 -0
- package/dist/bin/shell/chunks/jq-GGTKKMEN.js +3 -0
- package/dist/bin/shell/chunks/js-exec-BC6NI55L.js +98 -0
- package/dist/bin/shell/chunks/ln-LP4HMCSM.js +3 -0
- package/dist/bin/shell/chunks/ls-KBNHNZWQ.js +3 -0
- package/dist/bin/shell/chunks/md5sum-MCVDIB35.js +3 -0
- package/dist/bin/shell/chunks/mkdir-P4DKRCDX.js +3 -0
- package/dist/bin/shell/chunks/mv-QQK4FQX6.js +3 -0
- package/dist/bin/shell/chunks/nl-KUPLVCTS.js +3 -0
- package/dist/bin/shell/chunks/od-YQ5ZUI2H.js +3 -0
- package/dist/bin/shell/chunks/paste-A5KKPWXX.js +3 -0
- package/dist/bin/shell/chunks/printf-Z5C2UOI5.js +3 -0
- package/dist/bin/shell/chunks/pwd-FCNDA467.js +3 -0
- package/dist/bin/shell/chunks/python3-BQWDPUBM.js +13 -0
- package/dist/bin/shell/chunks/readlink-25V57VOL.js +3 -0
- package/dist/bin/shell/chunks/rev-PYHOZ4D4.js +3 -0
- package/dist/bin/shell/chunks/rg-BGFMSIVK.js +3 -0
- package/dist/bin/shell/chunks/rm-ECNUFR66.js +3 -0
- package/dist/bin/shell/chunks/rmdir-DLOHIA7Q.js +3 -0
- package/dist/bin/shell/chunks/sed-FWA634SN.js +3 -0
- package/dist/bin/shell/chunks/seq-UXDJE6FB.js +3 -0
- package/dist/bin/shell/chunks/sha1sum-4KF52U3Y.js +3 -0
- package/dist/bin/shell/chunks/sha256sum-6YEPULPX.js +3 -0
- package/dist/bin/shell/chunks/sleep-QHAPNY3Q.js +3 -0
- package/dist/bin/shell/chunks/sort-4C6WOKNK.js +3 -0
- package/dist/bin/shell/chunks/split-TV7NL7LA.js +3 -0
- package/dist/bin/shell/chunks/sqlite3-W777NCI4.js +3 -0
- package/dist/bin/shell/chunks/stat-BD6KT3BP.js +3 -0
- package/dist/bin/shell/chunks/strings-MDD72LR6.js +3 -0
- package/dist/bin/shell/chunks/tac-C2N4NQ6S.js +3 -0
- package/dist/bin/shell/chunks/tail-BCB5W6JC.js +3 -0
- package/dist/bin/shell/chunks/tar-DOO744MK.js +3 -0
- package/dist/bin/shell/chunks/tee-UQHPO4OW.js +3 -0
- package/dist/bin/shell/chunks/time-ZPY52VT2.js +3 -0
- package/dist/bin/shell/chunks/timeout-5AX3ZS3X.js +3 -0
- package/dist/bin/shell/chunks/touch-DFGSVIX7.js +3 -0
- package/dist/bin/shell/chunks/tr-G7K6M6HP.js +3 -0
- package/dist/bin/shell/chunks/tree-6D7SMPUR.js +3 -0
- package/dist/bin/shell/chunks/true-SKL4L7JP.js +3 -0
- package/dist/bin/shell/chunks/unexpand-QIR4EDPG.js +3 -0
- package/dist/bin/shell/chunks/uniq-I7PVFJR4.js +3 -0
- package/dist/bin/shell/chunks/wc-6NGWULAP.js +3 -0
- package/dist/bin/shell/chunks/which-LCXKCLFC.js +3 -0
- package/dist/bin/shell/chunks/whoami-TZDZDU7T.js +3 -0
- package/dist/bin/shell/chunks/xan-KX4VPXUN.js +3 -0
- package/dist/bin/shell/chunks/xan-view-JXOZLJ7S.js +3 -0
- package/dist/bin/shell/chunks/xargs-UWHPYLY7.js +3 -0
- package/dist/bin/shell/chunks/yq-GCDCJBKB.js +3 -0
- package/dist/bin/shell/shell.js +734 -0
- package/dist/browser.d.ts +23 -0
- package/dist/bundle/browser.js +1515 -0
- package/dist/bundle/chunks/alias-RTYYYW3D.js +2 -0
- package/dist/bundle/chunks/awk2-LA3USKJP.js +2 -0
- package/dist/bundle/chunks/base64-C2AIWVNC.js +2 -0
- package/dist/bundle/chunks/basename-UB3CIYNI.js +2 -0
- package/dist/bundle/chunks/bash-YZ33HQZQ.js +2 -0
- package/dist/bundle/chunks/cat-TSFMZVYS.js +2 -0
- package/dist/bundle/chunks/chmod-TFEPA42X.js +2 -0
- package/dist/bundle/chunks/chunk-27JIFWUR.js +3 -0
- package/dist/bundle/chunks/chunk-2JIPICV3.js +13 -0
- package/dist/bundle/chunks/chunk-2SMD2AUA.js +3 -0
- package/dist/bundle/chunks/chunk-2VDTE5BV.js +14 -0
- package/dist/bundle/chunks/chunk-2VJJEDV2.js +8 -0
- package/dist/bundle/chunks/chunk-46RN27KI.js +100 -0
- package/dist/bundle/chunks/chunk-4I3HOE5Z.js +21 -0
- package/dist/bundle/chunks/chunk-4JLVZKHC.js +8 -0
- package/dist/bundle/chunks/chunk-4MZPEZTU.js +3 -0
- package/dist/bundle/chunks/chunk-4N6J7B5P.js +6 -0
- package/dist/bundle/chunks/chunk-4RUAZWKT.js +33 -0
- package/dist/bundle/chunks/chunk-4WKZNNJK.js +2 -0
- package/dist/bundle/chunks/chunk-5H5SCKJM.js +11 -0
- package/dist/bundle/chunks/chunk-6LASZU3O.js +5 -0
- package/dist/bundle/chunks/chunk-6SHYIICL.js +4 -0
- package/dist/bundle/chunks/chunk-6VAT5Z2D.js +5 -0
- package/dist/bundle/chunks/chunk-7AISL3XV.js +12 -0
- package/dist/bundle/chunks/chunk-7EUWTCWK.js +2 -0
- package/dist/bundle/chunks/chunk-7JHM3L42.js +6 -0
- package/dist/bundle/chunks/chunk-A4R2GWRF.js +9 -0
- package/dist/bundle/chunks/chunk-ACSZB4FE.js +11 -0
- package/dist/bundle/chunks/chunk-AQ6FYS2X.js +2 -0
- package/dist/bundle/chunks/chunk-BVKWRAS6.js +12 -0
- package/dist/bundle/chunks/chunk-BZUGFHVS.js +2 -0
- package/dist/bundle/chunks/chunk-CBJVD2XA.js +7 -0
- package/dist/bundle/chunks/chunk-CHFEPBH4.js +18 -0
- package/dist/bundle/chunks/chunk-CN5XGDNN.js +6 -0
- package/dist/bundle/chunks/chunk-DLL7UR66.js +2 -0
- package/dist/bundle/chunks/chunk-EBAPSGAO.js +9 -0
- package/dist/bundle/chunks/chunk-FAXLQUCQ.js +10 -0
- package/dist/bundle/chunks/chunk-FHC24QSK.js +7 -0
- package/dist/bundle/chunks/chunk-FJK43EBQ.js +14 -0
- package/dist/bundle/chunks/chunk-FOCWZZDE.js +2 -0
- package/dist/bundle/chunks/chunk-FW54FHZR.js +2 -0
- package/dist/bundle/chunks/chunk-FX4RBUYU.js +5 -0
- package/dist/bundle/chunks/chunk-FX7KQCEA.js +33 -0
- package/dist/bundle/chunks/chunk-FZRQOL3C.js +7 -0
- package/dist/bundle/chunks/chunk-G5EVRAOO.js +74 -0
- package/dist/bundle/chunks/chunk-GGC5NEPZ.js +8 -0
- package/dist/bundle/chunks/chunk-GIUR5SNU.js +15 -0
- package/dist/bundle/chunks/chunk-GJC3WVOW.js +2 -0
- package/dist/bundle/chunks/chunk-GSPYNYZA.js +6 -0
- package/dist/bundle/chunks/chunk-GTQIUQM6.js +5 -0
- package/dist/bundle/chunks/chunk-HBVMHTO5.js +2 -0
- package/dist/bundle/chunks/chunk-HDRAUQK2.js +2 -0
- package/dist/bundle/chunks/chunk-HJBTD7PY.js +21 -0
- package/dist/bundle/chunks/chunk-ICIEVHY5.js +36 -0
- package/dist/bundle/chunks/chunk-KATRCGLX.js +2 -0
- package/dist/bundle/chunks/chunk-KD3KENL6.js +11 -0
- package/dist/bundle/chunks/chunk-KWGBQNTV.js +32 -0
- package/dist/bundle/chunks/chunk-L2UW7DWF.js +2 -0
- package/dist/bundle/chunks/chunk-L64BMZUV.js +2 -0
- package/dist/bundle/chunks/chunk-LEKBROJD.js +6 -0
- package/dist/bundle/chunks/chunk-LNBPBRV4.js +21 -0
- package/dist/bundle/chunks/chunk-LPJEKUCB.js +8 -0
- package/dist/bundle/chunks/chunk-LSLPJOYM.js +3 -0
- package/dist/bundle/chunks/chunk-MFDPAVC6.js +14 -0
- package/dist/bundle/chunks/chunk-MLIO3BK2.js +7 -0
- package/dist/bundle/chunks/chunk-MQKGGNPS.js +16 -0
- package/dist/bundle/chunks/chunk-MZFCCXPZ.js +63 -0
- package/dist/bundle/chunks/chunk-N6DXJ2JN.js +287 -0
- package/dist/bundle/chunks/chunk-NRSASXYY.js +2 -0
- package/dist/bundle/chunks/chunk-OC35HPHG.js +2 -0
- package/dist/bundle/chunks/chunk-OGJ5CFPR.js +9 -0
- package/dist/bundle/chunks/chunk-OVGANXCG.js +8 -0
- package/dist/bundle/chunks/chunk-Q7H5W7YE.js +140 -0
- package/dist/bundle/chunks/chunk-QAYAQNCG.js +23 -0
- package/dist/bundle/chunks/chunk-QIQMJJZ4.js +4 -0
- package/dist/bundle/chunks/chunk-R4IFXNY5.js +28 -0
- package/dist/bundle/chunks/chunk-R74UQCKX.js +5 -0
- package/dist/bundle/chunks/chunk-S3LEJEPP.js +2 -0
- package/dist/bundle/chunks/chunk-S443BAN4.js +7 -0
- package/dist/bundle/chunks/chunk-SAI2SPQQ.js +8 -0
- package/dist/bundle/chunks/chunk-SBBYKIYU.js +3 -0
- package/dist/bundle/chunks/chunk-SETW5JBN.js +9 -0
- package/dist/bundle/chunks/chunk-SHKOQWO4.js +3 -0
- package/dist/bundle/chunks/chunk-SJYEXC2Z.js +14 -0
- package/dist/bundle/chunks/chunk-SO6R3ZKN.js +16 -0
- package/dist/bundle/chunks/chunk-STHBFACM.js +1 -0
- package/dist/bundle/chunks/chunk-SX2HC7SO.js +2 -0
- package/dist/bundle/chunks/chunk-T4TFLF3R.js +16 -0
- package/dist/bundle/chunks/chunk-TDD4NFYE.js +2 -0
- package/dist/bundle/chunks/chunk-TN7HHBQW.js +5 -0
- package/dist/bundle/chunks/chunk-U73A73IE.js +17 -0
- package/dist/bundle/chunks/chunk-UIJUTQPH.js +3 -0
- package/dist/bundle/chunks/chunk-UP6MSJGD.js +17 -0
- package/dist/bundle/chunks/chunk-VLCHOJWK.js +6 -0
- package/dist/bundle/chunks/chunk-VPADYNBD.js +10 -0
- package/dist/bundle/chunks/chunk-W5DWRFSU.js +2 -0
- package/dist/bundle/chunks/chunk-WM5IJFMP.js +8 -0
- package/dist/bundle/chunks/chunk-WNH3HOQA.js +2 -0
- package/dist/bundle/chunks/chunk-WPGQVBSY.js +6 -0
- package/dist/bundle/chunks/chunk-WVRWIZF5.js +23 -0
- package/dist/bundle/chunks/chunk-XCQWV4AU.js +12 -0
- package/dist/bundle/chunks/chunk-XDGLKIHR.js +9 -0
- package/dist/bundle/chunks/chunk-XHLMAZX2.js +5 -0
- package/dist/bundle/chunks/chunk-XRFHFXFP.js +2 -0
- package/dist/bundle/chunks/chunk-XUIHBHL5.js +5 -0
- package/dist/bundle/chunks/chunk-XYXUMFSU.js +14 -0
- package/dist/bundle/chunks/chunk-Y4LIDHSD.js +7 -0
- package/dist/bundle/chunks/chunk-YCLFEX4T.js +3 -0
- package/dist/bundle/chunks/chunk-YS4NUBYX.js +9 -0
- package/dist/bundle/chunks/chunk-ZDIT6ST5.js +7 -0
- package/dist/bundle/chunks/chunk-ZDPFA4L3.js +6 -0
- package/dist/bundle/chunks/chunk-ZZKH2ELC.js +11 -0
- package/dist/bundle/chunks/clear-HKGFEOF6.js +2 -0
- package/dist/bundle/chunks/column-XT6UFXNQ.js +2 -0
- package/dist/bundle/chunks/comm-VV2LDX2J.js +2 -0
- package/dist/bundle/chunks/cp-BISAAS7A.js +2 -0
- package/dist/bundle/chunks/curl-GRYA74XW.js +26 -0
- package/dist/bundle/chunks/cut-OKARJCCV.js +2 -0
- package/dist/bundle/chunks/date-UUUPW43J.js +2 -0
- package/dist/bundle/chunks/diff-MWJFIG7X.js +2 -0
- package/dist/bundle/chunks/dirname-MPHRFUTI.js +2 -0
- package/dist/bundle/chunks/du-572XNP42.js +2 -0
- package/dist/bundle/chunks/echo-NDWZZHPO.js +2 -0
- package/dist/bundle/chunks/env-36M5BO7M.js +2 -0
- package/dist/bundle/chunks/expand-JSPG6VOP.js +2 -0
- package/dist/bundle/chunks/expansion-R25BK4W3.js +2 -0
- package/dist/bundle/chunks/expr-5JAACS4X.js +2 -0
- package/dist/bundle/chunks/file-IPZJC3FQ.js +2 -0
- package/dist/bundle/chunks/find-INTH3OLC.js +2 -0
- package/dist/bundle/chunks/flag-coverage-XWSYNE72.js +2 -0
- package/dist/bundle/chunks/fold-4TQNYMSW.js +2 -0
- package/dist/bundle/chunks/grep-V3LQVMRQ.js +2 -0
- package/dist/bundle/chunks/gzip-O5ASJAFY.js +2 -0
- package/dist/bundle/chunks/head-442HYESI.js +2 -0
- package/dist/bundle/chunks/help-HZ6M2CKN.js +2 -0
- package/dist/bundle/chunks/history-WYYKSLSZ.js +2 -0
- package/dist/bundle/chunks/hostname-C4HQXXUP.js +2 -0
- package/dist/bundle/chunks/html-to-markdown-JW4MSQZO.js +2 -0
- package/dist/bundle/chunks/join-TBRGI3LQ.js +2 -0
- package/dist/bundle/chunks/jq-4XLYLOS5.js +2 -0
- package/dist/bundle/chunks/js-exec-N5KEZBH7.js +97 -0
- package/dist/bundle/chunks/js-exec-worker.js +4443 -0
- package/dist/bundle/chunks/ln-4LGSXXGD.js +2 -0
- package/dist/bundle/chunks/ls-ZJGQER7M.js +2 -0
- package/dist/bundle/chunks/md5sum-SPU24VSG.js +2 -0
- package/dist/bundle/chunks/mkdir-MEPGZOB6.js +2 -0
- package/dist/bundle/chunks/mv-W5BIQ646.js +2 -0
- package/dist/bundle/chunks/nl-WSDW7I4O.js +2 -0
- package/dist/bundle/chunks/od-WOKFDJTP.js +2 -0
- package/dist/bundle/chunks/paste-7JC6S4DX.js +2 -0
- package/dist/bundle/chunks/printf-TWGXF445.js +2 -0
- package/dist/bundle/chunks/pwd-WE6EN5AV.js +2 -0
- package/dist/bundle/chunks/python3-POMOR4OA.js +12 -0
- package/dist/bundle/chunks/readlink-OPJF4DL5.js +2 -0
- package/dist/bundle/chunks/rev-5EHFX4EJ.js +2 -0
- package/dist/bundle/chunks/rg-S4FXYXWB.js +2 -0
- package/dist/bundle/chunks/rm-SSGETQVQ.js +2 -0
- package/dist/bundle/chunks/rmdir-OC4ZLPYA.js +2 -0
- package/dist/bundle/chunks/sed-S5UIK574.js +2 -0
- package/dist/bundle/chunks/seq-M5EC7Q57.js +2 -0
- package/dist/bundle/chunks/sha1sum-2PTOAFR6.js +2 -0
- package/dist/bundle/chunks/sha256sum-NS7D3IXX.js +2 -0
- package/dist/bundle/chunks/sleep-X22JJINO.js +2 -0
- package/dist/bundle/chunks/sort-SW2YEO5B.js +2 -0
- package/dist/bundle/chunks/split-4KKZZXXE.js +2 -0
- package/dist/bundle/chunks/sqlite3-CGOEFJAO.js +2 -0
- package/dist/bundle/chunks/sqlite3-worker.js +1728 -0
- package/dist/bundle/chunks/stat-CD34IZ4P.js +2 -0
- package/dist/bundle/chunks/strings-6WDHLGMX.js +2 -0
- package/dist/bundle/chunks/tac-2STMMJYW.js +2 -0
- package/dist/bundle/chunks/tail-R4PCA2C4.js +2 -0
- package/dist/bundle/chunks/tar-STHHZTZ6.js +2 -0
- package/dist/bundle/chunks/tee-YUZ2FKCJ.js +2 -0
- package/dist/bundle/chunks/time-D4LNBSWX.js +2 -0
- package/dist/bundle/chunks/timeout-YDCRSLPQ.js +2 -0
- package/dist/bundle/chunks/touch-UA33VN3N.js +2 -0
- package/dist/bundle/chunks/tr-36LHWFRQ.js +2 -0
- package/dist/bundle/chunks/tree-YLD52CNT.js +2 -0
- package/dist/bundle/chunks/true-FHQXJXBE.js +2 -0
- package/dist/bundle/chunks/unexpand-CADSA4VO.js +2 -0
- package/dist/bundle/chunks/uniq-XSIZR6PB.js +2 -0
- package/dist/bundle/chunks/wc-LF7NU4LA.js +2 -0
- package/dist/bundle/chunks/which-XEM24D5D.js +2 -0
- package/dist/bundle/chunks/whoami-XMTX52VE.js +2 -0
- package/dist/bundle/chunks/worker.js +3150 -0
- package/dist/bundle/chunks/xan-Y6WF3IRG.js +2 -0
- package/dist/bundle/chunks/xan-view-HDVKHFC2.js +2 -0
- package/dist/bundle/chunks/xargs-MGZPH7AX.js +2 -0
- package/dist/bundle/chunks/yq-4QJW3EQG.js +2 -0
- package/dist/bundle/index.cjs +2178 -0
- package/dist/bundle/index.js +710 -0
- package/dist/commands/alias/alias.d.ts +6 -0
- package/dist/commands/awk/ast.d.ts +202 -0
- package/dist/commands/awk/awk2.d.ts +9 -0
- package/dist/commands/awk/builtins.d.ts +17 -0
- package/dist/commands/awk/interpreter/context.d.ts +75 -0
- package/dist/commands/awk/interpreter/expressions.d.ts +17 -0
- package/dist/commands/awk/interpreter/fields.d.ts +25 -0
- package/dist/commands/awk/interpreter/index.d.ts +8 -0
- package/dist/commands/awk/interpreter/interpreter.d.ts +54 -0
- package/dist/commands/awk/interpreter/statements.d.ts +11 -0
- package/dist/commands/awk/interpreter/type-coercion.d.ts +32 -0
- package/dist/commands/awk/interpreter/types.d.ts +13 -0
- package/dist/commands/awk/interpreter/variables.d.ts +35 -0
- package/dist/commands/awk/lexer.d.ts +100 -0
- package/dist/commands/awk/parser2-print.d.ts +35 -0
- package/dist/commands/awk/parser2.d.ts +81 -0
- package/dist/commands/base64/base64.d.ts +7 -0
- package/dist/commands/basename/basename.d.ts +4 -0
- package/dist/commands/bash/bash.d.ts +6 -0
- package/dist/commands/browser-excluded.d.ts +16 -0
- package/dist/commands/cat/cat.d.ts +4 -0
- package/dist/commands/chmod/chmod.d.ts +4 -0
- package/dist/commands/clear/clear.d.ts +4 -0
- package/dist/commands/column/column.d.ts +11 -0
- package/dist/commands/comm/comm.d.ts +12 -0
- package/dist/commands/cp/cp.d.ts +4 -0
- package/dist/commands/curl/curl.d.ts +8 -0
- package/dist/commands/curl/form.d.ts +21 -0
- package/dist/commands/curl/help.d.ts +9 -0
- package/dist/commands/curl/parse.d.ts +9 -0
- package/dist/commands/curl/response-formatting.d.ts +20 -0
- package/dist/commands/curl/types.d.ts +60 -0
- package/dist/commands/cut/cut.d.ts +4 -0
- package/dist/commands/date/date.d.ts +7 -0
- package/dist/commands/diff/diff.d.ts +7 -0
- package/dist/commands/dirname/dirname.d.ts +4 -0
- package/dist/commands/du/du.d.ts +4 -0
- package/dist/commands/duration.d.ts +5 -0
- package/dist/commands/echo/echo.d.ts +4 -0
- package/dist/commands/env/env.d.ts +6 -0
- package/dist/commands/expand/expand.d.ts +12 -0
- package/dist/commands/expand/unexpand.d.ts +12 -0
- package/dist/commands/expr/expr.d.ts +9 -0
- package/dist/commands/file/file.d.ts +9 -0
- package/dist/commands/find/find.d.ts +4 -0
- package/dist/commands/find/matcher.d.ts +69 -0
- package/dist/commands/find/parser.d.ts +2 -0
- package/dist/commands/find/types.d.ts +88 -0
- package/dist/commands/flag-coverage.d.ts +2 -0
- package/dist/commands/fold/fold.d.ts +12 -0
- package/dist/commands/format-mode.d.ts +4 -0
- package/dist/commands/fuzz-flags-types.d.ts +17 -0
- package/dist/commands/fuzz-flags.d.ts +8 -0
- package/dist/commands/grep/grep.d.ts +8 -0
- package/dist/commands/gzip/gzip.d.ts +13 -0
- package/dist/commands/head/head-tail-shared.d.ts +38 -0
- package/dist/commands/head/head.d.ts +4 -0
- package/dist/commands/help/help.d.ts +4 -0
- package/dist/commands/help.d.ts +16 -0
- package/dist/commands/history/history.d.ts +4 -0
- package/dist/commands/hostname/hostname.d.ts +11 -0
- package/dist/commands/html-to-markdown/html-to-markdown.d.ts +9 -0
- package/dist/commands/join/join.d.ts +12 -0
- package/dist/commands/jq/jq.d.ts +9 -0
- package/dist/commands/js-exec/fetch-polyfill.d.ts +6 -0
- package/dist/commands/js-exec/js-exec-worker.d.ts +32 -0
- package/dist/commands/js-exec/js-exec.d.ts +11 -0
- package/dist/commands/js-exec/module-shims.d.ts +29 -0
- package/dist/commands/js-exec/path-polyfill.d.ts +6 -0
- package/dist/commands/ln/ln.d.ts +4 -0
- package/dist/commands/ls/ls.d.ts +4 -0
- package/dist/commands/md5sum/checksum.d.ts +7 -0
- package/dist/commands/md5sum/md5sum.d.ts +4 -0
- package/dist/commands/md5sum/sha1sum.d.ts +4 -0
- package/dist/commands/md5sum/sha256sum.d.ts +4 -0
- package/dist/commands/mkdir/mkdir.d.ts +4 -0
- package/dist/commands/mv/mv.d.ts +4 -0
- package/dist/commands/nl/nl.d.ts +12 -0
- package/dist/commands/od/od.d.ts +12 -0
- package/dist/commands/paste/paste.d.ts +4 -0
- package/dist/commands/printf/escapes.d.ts +25 -0
- package/dist/commands/printf/printf.d.ts +4 -0
- package/dist/commands/printf/strftime.d.ts +9 -0
- package/dist/commands/pwd/pwd.d.ts +4 -0
- package/dist/commands/python3/python3.d.ts +16 -0
- package/dist/commands/python3/worker.d.ts +28 -0
- package/dist/commands/query-engine/builtins/array-builtins.d.ts +20 -0
- package/dist/commands/query-engine/builtins/control-builtins.d.ts +18 -0
- package/dist/commands/query-engine/builtins/date-builtins.d.ts +15 -0
- package/dist/commands/query-engine/builtins/format-builtins.d.ts +11 -0
- package/dist/commands/query-engine/builtins/index-builtins.d.ts +16 -0
- package/dist/commands/query-engine/builtins/index.d.ts +17 -0
- package/dist/commands/query-engine/builtins/math-builtins.d.ts +15 -0
- package/dist/commands/query-engine/builtins/navigation-builtins.d.ts +18 -0
- package/dist/commands/query-engine/builtins/object-builtins.d.ts +15 -0
- package/dist/commands/query-engine/builtins/path-builtins.d.ts +20 -0
- package/dist/commands/query-engine/builtins/sql-builtins.d.ts +16 -0
- package/dist/commands/query-engine/builtins/string-builtins.d.ts +15 -0
- package/dist/commands/query-engine/builtins/type-builtins.d.ts +11 -0
- package/dist/commands/query-engine/evaluator.d.ts +40 -0
- package/dist/commands/query-engine/index.d.ts +8 -0
- package/dist/commands/query-engine/parser-types.d.ts +171 -0
- package/dist/commands/query-engine/parser.d.ts +9 -0
- package/dist/commands/query-engine/path-operations.d.ts +15 -0
- package/dist/commands/query-engine/safe-object.d.ts +83 -0
- package/dist/commands/query-engine/value-operations.d.ts +41 -0
- package/dist/commands/readlink/readlink.d.ts +4 -0
- package/dist/commands/registry.d.ts +56 -0
- package/dist/commands/rev/rev.d.ts +13 -0
- package/dist/commands/rg/file-types.d.ts +49 -0
- package/dist/commands/rg/gitignore.d.ts +98 -0
- package/dist/commands/rg/rg-options.d.ts +61 -0
- package/dist/commands/rg/rg-parser.d.ts +20 -0
- package/dist/commands/rg/rg-search.d.ts +15 -0
- package/dist/commands/rg/rg.d.ts +14 -0
- package/dist/commands/rm/rm.d.ts +4 -0
- package/dist/commands/rmdir/rmdir.d.ts +4 -0
- package/dist/commands/search-engine/index.d.ts +10 -0
- package/dist/commands/search-engine/matcher.d.ts +66 -0
- package/dist/commands/search-engine/regex.d.ts +46 -0
- package/dist/commands/sed/executor.d.ts +7 -0
- package/dist/commands/sed/lexer.d.ts +86 -0
- package/dist/commands/sed/parser.d.ts +18 -0
- package/dist/commands/sed/sed-regex.d.ts +23 -0
- package/dist/commands/sed/sed.d.ts +4 -0
- package/dist/commands/sed/types.d.ts +216 -0
- package/dist/commands/seq/seq.d.ts +16 -0
- package/dist/commands/sleep/sleep.d.ts +4 -0
- package/dist/commands/sort/comparator.d.ts +9 -0
- package/dist/commands/sort/parser.d.ts +11 -0
- package/dist/commands/sort/sort.d.ts +4 -0
- package/dist/commands/sort/types.d.ts +30 -0
- package/dist/commands/split/split.d.ts +12 -0
- package/dist/commands/sqlite3/formatters.d.ts +15 -0
- package/dist/commands/sqlite3/sqlite3.d.ts +23 -0
- package/dist/commands/sqlite3/worker.d.ts +45 -0
- package/dist/commands/sqlite3/worker.js +1728 -0
- package/dist/commands/stat/stat.d.ts +4 -0
- package/dist/commands/strings/strings.d.ts +12 -0
- package/dist/commands/tac/tac.d.ts +11 -0
- package/dist/commands/tail/tail.d.ts +4 -0
- package/dist/commands/tar/archive.d.ts +135 -0
- package/dist/commands/tar/bzip2-compress.d.ts +17 -0
- package/dist/commands/tar/tar-options.d.ts +37 -0
- package/dist/commands/tar/tar.d.ts +10 -0
- package/dist/commands/tee/tee.d.ts +4 -0
- package/dist/commands/time/time.d.ts +27 -0
- package/dist/commands/timeout/timeout.d.ts +4 -0
- package/dist/commands/touch/touch.d.ts +4 -0
- package/dist/commands/tr/tr.d.ts +4 -0
- package/dist/commands/tree/tree.d.ts +4 -0
- package/dist/commands/true/true.d.ts +6 -0
- package/dist/commands/uniq/uniq.d.ts +4 -0
- package/dist/commands/wc/wc.d.ts +4 -0
- package/dist/commands/which/which.d.ts +4 -0
- package/dist/commands/whoami/whoami.d.ts +11 -0
- package/dist/commands/worker-bridge/bridge-handler.d.ts +73 -0
- package/dist/commands/worker-bridge/protocol.d.ts +141 -0
- package/dist/commands/worker-bridge/sync-backend.d.ts +86 -0
- package/dist/commands/xan/aggregation.d.ts +20 -0
- package/dist/commands/xan/column-selection.d.ts +19 -0
- package/dist/commands/xan/csv.d.ts +37 -0
- package/dist/commands/xan/moonblade-parser.d.ts +80 -0
- package/dist/commands/xan/moonblade-to-jq.d.ts +12 -0
- package/dist/commands/xan/moonblade-tokenizer.d.ts +25 -0
- package/dist/commands/xan/subcommands.d.ts +15 -0
- package/dist/commands/xan/xan-agg.d.ts +8 -0
- package/dist/commands/xan/xan-columns.d.ts +8 -0
- package/dist/commands/xan/xan-core.d.ts +10 -0
- package/dist/commands/xan/xan-data.d.ts +52 -0
- package/dist/commands/xan/xan-filter.d.ts +8 -0
- package/dist/commands/xan/xan-map.d.ts +11 -0
- package/dist/commands/xan/xan-reshape.d.ts +40 -0
- package/dist/commands/xan/xan-simple.d.ts +40 -0
- package/dist/commands/xan/xan-view.d.ts +12 -0
- package/dist/commands/xan/xan.d.ts +10 -0
- package/dist/commands/xargs/xargs.d.ts +4 -0
- package/dist/commands/yq/formats.d.ts +64 -0
- package/dist/commands/yq/yq.d.ts +13 -0
- package/dist/custom-commands.d.ts +42 -0
- package/dist/encoding.d.ts +115 -0
- package/dist/fs/encoding.d.ts +17 -0
- package/dist/fs/in-memory-fs/in-memory-fs.d.ts +75 -0
- package/dist/fs/in-memory-fs/index.d.ts +1 -0
- package/dist/fs/init.d.ts +22 -0
- package/dist/fs/interface.d.ts +251 -0
- package/dist/fs/mountable-fs/index.d.ts +1 -0
- package/dist/fs/mountable-fs/mountable-fs.d.ts +118 -0
- package/dist/fs/overlay-fs/index.d.ts +1 -0
- package/dist/fs/overlay-fs/overlay-fs.d.ts +165 -0
- package/dist/fs/path-utils.d.ts +46 -0
- package/dist/fs/read-write-fs/index.d.ts +1 -0
- package/dist/fs/read-write-fs/read-write-fs.d.ts +98 -0
- package/dist/fs/real-fs-utils.d.ts +90 -0
- package/dist/fs/sanitize-error.d.ts +19 -0
- package/dist/index.d.cts +29 -0
- package/dist/index.d.ts +29 -0
- package/dist/interpreter/alias-expansion.d.ts +23 -0
- package/dist/interpreter/arithmetic.d.ts +24 -0
- package/dist/interpreter/assignment-expansion.d.ts +24 -0
- package/dist/interpreter/builtin-dispatch.d.ts +39 -0
- package/dist/interpreter/builtins/break.d.ts +6 -0
- package/dist/interpreter/builtins/cd.d.ts +6 -0
- package/dist/interpreter/builtins/compgen.d.ts +26 -0
- package/dist/interpreter/builtins/complete.d.ts +17 -0
- package/dist/interpreter/builtins/compopt.d.ts +28 -0
- package/dist/interpreter/builtins/continue.d.ts +6 -0
- package/dist/interpreter/builtins/declare-array-parsing.d.ts +14 -0
- package/dist/interpreter/builtins/declare-print.d.ts +39 -0
- package/dist/interpreter/builtins/declare.d.ts +35 -0
- package/dist/interpreter/builtins/dirs.d.ts +29 -0
- package/dist/interpreter/builtins/eval.d.ts +9 -0
- package/dist/interpreter/builtins/exit.d.ts +5 -0
- package/dist/interpreter/builtins/export.d.ts +14 -0
- package/dist/interpreter/builtins/getopts.d.ts +18 -0
- package/dist/interpreter/builtins/hash.d.ts +19 -0
- package/dist/interpreter/builtins/help.d.ts +12 -0
- package/dist/interpreter/builtins/index.d.ts +45 -0
- package/dist/interpreter/builtins/let.d.ts +18 -0
- package/dist/interpreter/builtins/local.d.ts +6 -0
- package/dist/interpreter/builtins/mapfile.d.ts +17 -0
- package/dist/interpreter/builtins/read.d.ts +6 -0
- package/dist/interpreter/builtins/return.d.ts +6 -0
- package/dist/interpreter/builtins/set.d.ts +9 -0
- package/dist/interpreter/builtins/shift.d.ts +15 -0
- package/dist/interpreter/builtins/shopt.d.ts +7 -0
- package/dist/interpreter/builtins/source.d.ts +6 -0
- package/dist/interpreter/builtins/unset.d.ts +16 -0
- package/dist/interpreter/builtins/variable-assignment.d.ts +66 -0
- package/dist/interpreter/command-resolution.d.ts +43 -0
- package/dist/interpreter/conditionals.d.ts +17 -0
- package/dist/interpreter/control-flow.d.ts +21 -0
- package/dist/interpreter/defense-aware-command-context.d.ts +6 -0
- package/dist/interpreter/errors.d.ts +158 -0
- package/dist/interpreter/expansion/analysis.d.ts +37 -0
- package/dist/interpreter/expansion/arith-text-expansion.d.ts +20 -0
- package/dist/interpreter/expansion/array-pattern-ops.d.ts +21 -0
- package/dist/interpreter/expansion/array-prefix-suffix.d.ts +46 -0
- package/dist/interpreter/expansion/array-slice-transform.d.ts +36 -0
- package/dist/interpreter/expansion/array-word-expansion.d.ts +39 -0
- package/dist/interpreter/expansion/brace-range.d.ts +20 -0
- package/dist/interpreter/expansion/command-substitution.d.ts +23 -0
- package/dist/interpreter/expansion/glob-escape.d.ts +32 -0
- package/dist/interpreter/expansion/indirect-expansion.d.ts +42 -0
- package/dist/interpreter/expansion/parameter-ops.d.ts +113 -0
- package/dist/interpreter/expansion/pattern-expansion.d.ts +23 -0
- package/dist/interpreter/expansion/pattern-removal.d.ts +18 -0
- package/dist/interpreter/expansion/pattern.d.ts +23 -0
- package/dist/interpreter/expansion/positional-params.d.ts +59 -0
- package/dist/interpreter/expansion/prompt.d.ts +39 -0
- package/dist/interpreter/expansion/quoting.d.ts +13 -0
- package/dist/interpreter/expansion/tilde.d.ts +12 -0
- package/dist/interpreter/expansion/unquoted-expansion.d.ts +76 -0
- package/dist/interpreter/expansion/variable-attrs.d.ts +19 -0
- package/dist/interpreter/expansion/variable.d.ts +36 -0
- package/dist/interpreter/expansion/word-glob-expansion.d.ts +33 -0
- package/dist/interpreter/expansion/word-split.d.ts +29 -0
- package/dist/interpreter/expansion.d.ts +53 -0
- package/dist/interpreter/functions.d.ts +12 -0
- package/dist/interpreter/helpers/array.d.ts +43 -0
- package/dist/interpreter/helpers/condition.d.ts +22 -0
- package/dist/interpreter/helpers/errors.d.ts +8 -0
- package/dist/interpreter/helpers/file-tests.d.ts +33 -0
- package/dist/interpreter/helpers/ifs.d.ts +104 -0
- package/dist/interpreter/helpers/loop.d.ts +24 -0
- package/dist/interpreter/helpers/nameref.d.ts +65 -0
- package/dist/interpreter/helpers/numeric-compare.d.ts +13 -0
- package/dist/interpreter/helpers/quoting.d.ts +24 -0
- package/dist/interpreter/helpers/readonly.d.ts +45 -0
- package/dist/interpreter/helpers/regex.d.ts +8 -0
- package/dist/interpreter/helpers/result.d.ts +60 -0
- package/dist/interpreter/helpers/shell-constants.d.ts +25 -0
- package/dist/interpreter/helpers/shellopts.d.ts +28 -0
- package/dist/interpreter/helpers/statements.d.ts +20 -0
- package/dist/interpreter/helpers/string-compare.d.ts +24 -0
- package/dist/interpreter/helpers/string-tests.d.ts +13 -0
- package/dist/interpreter/helpers/tilde.d.ts +13 -0
- package/dist/interpreter/helpers/variable-tests.d.ts +9 -0
- package/dist/interpreter/helpers/word-matching.d.ts +26 -0
- package/dist/interpreter/helpers/word-parts.d.ts +22 -0
- package/dist/interpreter/helpers/xtrace.d.ts +18 -0
- package/dist/interpreter/index.d.ts +3 -0
- package/dist/interpreter/interpreter.d.ts +79 -0
- package/dist/interpreter/pipeline-execution.d.ts +16 -0
- package/dist/interpreter/redirections.d.ts +51 -0
- package/dist/interpreter/simple-command-assignments.d.ts +29 -0
- package/dist/interpreter/subshell-group.d.ts +32 -0
- package/dist/interpreter/type-command.d.ts +37 -0
- package/dist/interpreter/types.d.ts +349 -0
- package/dist/limits.d.ts +52 -0
- package/dist/network/allow-list/shared.d.ts +57 -0
- package/dist/network/allow-list.d.ts +59 -0
- package/dist/network/dns-pin.d.ts +43 -0
- package/dist/network/fetch.d.ts +25 -0
- package/dist/network/index.d.ts +7 -0
- package/dist/network/types.d.ts +155 -0
- package/dist/parser/arithmetic-parser.d.ts +23 -0
- package/dist/parser/arithmetic-primaries.d.ts +45 -0
- package/dist/parser/command-parser.d.ts +10 -0
- package/dist/parser/compound-parser.d.ts +28 -0
- package/dist/parser/conditional-parser.d.ts +8 -0
- package/dist/parser/expansion-parser.d.ts +16 -0
- package/dist/parser/lexer.d.ts +197 -0
- package/dist/parser/parser-substitution.d.ts +62 -0
- package/dist/parser/parser.d.ts +135 -0
- package/dist/parser/types.d.ts +25 -0
- package/dist/parser/word-parser.d.ts +33 -0
- package/dist/sandbox/Command.d.ts +35 -0
- package/dist/sandbox/Sandbox.d.ts +90 -0
- package/dist/sandbox/index.d.ts +2 -0
- package/dist/shell-metadata.d.ts +25 -0
- package/dist/timers.d.ts +4 -0
- package/dist/types.d.ts +247 -0
- package/dist/utils/args.d.ts +55 -0
- package/dist/utils/constants.d.ts +15 -0
- package/dist/utils/file-reader.d.ts +74 -0
- package/dist/utils/glob.d.ts +25 -0
- package/dist/vitest-setup.d.ts +1 -0
- package/package.json +127 -0
- package/vendor/cpython-emscripten/python.cjs +2 -0
- package/vendor/cpython-emscripten/python.wasm +0 -0
- package/vendor/cpython-emscripten/python313.zip +0 -0
|
@@ -0,0 +1,155 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Network configuration types
|
|
3
|
+
*
|
|
4
|
+
* Network access is disabled by default. To enable network access (e.g., for curl),
|
|
5
|
+
* you must explicitly configure allowed URLs.
|
|
6
|
+
*/
|
|
7
|
+
/**
|
|
8
|
+
* DNS lookup result used for private IP resolution checks
|
|
9
|
+
*/
|
|
10
|
+
export interface DnsLookupResult {
|
|
11
|
+
address: string;
|
|
12
|
+
family: number;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* HTTP methods that can be allowed
|
|
16
|
+
*/
|
|
17
|
+
export type HttpMethod = "GET" | "HEAD" | "POST" | "PUT" | "DELETE" | "PATCH" | "OPTIONS";
|
|
18
|
+
/**
|
|
19
|
+
* Header transform applied at the fetch boundary.
|
|
20
|
+
* Headers specified here override any user-supplied headers with the same name.
|
|
21
|
+
*/
|
|
22
|
+
export interface RequestTransform {
|
|
23
|
+
headers: Record<string, string>;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* An allowed URL entry with optional header transforms.
|
|
27
|
+
* Transforms are applied at the fetch boundary so secrets never enter the sandbox.
|
|
28
|
+
*/
|
|
29
|
+
export interface AllowedUrl {
|
|
30
|
+
url: string;
|
|
31
|
+
transform?: RequestTransform[];
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* An entry in the allowedUrlPrefixes list: either a plain URL string or
|
|
35
|
+
* an object with a URL and optional transforms.
|
|
36
|
+
*/
|
|
37
|
+
export type AllowedUrlEntry = string | AllowedUrl;
|
|
38
|
+
/**
|
|
39
|
+
* Configuration for network access
|
|
40
|
+
*/
|
|
41
|
+
export interface NetworkConfig {
|
|
42
|
+
/**
|
|
43
|
+
* List of allowed URL prefixes. Each entry must be a full origin (scheme + host),
|
|
44
|
+
* optionally followed by a path prefix:
|
|
45
|
+
* - An origin: "https://api.example.com" - allows all paths on this origin
|
|
46
|
+
* - An origin + path prefix: "https://api.example.com/v1/" - allows only paths starting with /v1/
|
|
47
|
+
*
|
|
48
|
+
* Entries can be plain strings or objects with transforms for credentials brokering:
|
|
49
|
+
* ```
|
|
50
|
+
* allowedUrlPrefixes: [
|
|
51
|
+
* "https://other-api.com",
|
|
52
|
+
* {
|
|
53
|
+
* url: "https://ai-gateway.vercel.sh",
|
|
54
|
+
* transform: [{ headers: { "Authorization": "Bearer secret" } }],
|
|
55
|
+
* },
|
|
56
|
+
* ]
|
|
57
|
+
* ```
|
|
58
|
+
*
|
|
59
|
+
* The check is performed on the full URL, so "https://api.example.com/v1" will allow:
|
|
60
|
+
* - https://api.example.com/v1
|
|
61
|
+
* - https://api.example.com/v1/users
|
|
62
|
+
* - https://api.example.com/v1/users/123
|
|
63
|
+
*
|
|
64
|
+
* But NOT:
|
|
65
|
+
* - https://api.example.com/v10
|
|
66
|
+
* - https://api.example.com/v1-admin
|
|
67
|
+
* - https://api.example.com/v2/users
|
|
68
|
+
* - https://api.example.org/v1/users (different origin)
|
|
69
|
+
* - URLs that rely on ambiguous encoded separators like %2f or %5c
|
|
70
|
+
*
|
|
71
|
+
* Invalid entries (missing scheme, missing host, relative paths) will throw an error.
|
|
72
|
+
*/
|
|
73
|
+
allowedUrlPrefixes?: AllowedUrlEntry[];
|
|
74
|
+
/**
|
|
75
|
+
* List of allowed HTTP methods. Defaults to ["GET", "HEAD"] for safety.
|
|
76
|
+
* dangerouslyAllowFullInternetAccess to enables all methods.
|
|
77
|
+
*/
|
|
78
|
+
allowedMethods?: HttpMethod[];
|
|
79
|
+
/**
|
|
80
|
+
* Bypass the allow-list and allow all URLs and methods.
|
|
81
|
+
* DANGEROUS: Only use this in trusted environments.
|
|
82
|
+
*/
|
|
83
|
+
dangerouslyAllowFullInternetAccess?: boolean;
|
|
84
|
+
/**
|
|
85
|
+
* Maximum number of redirects to follow (default: 20)
|
|
86
|
+
*/
|
|
87
|
+
maxRedirects?: number;
|
|
88
|
+
/**
|
|
89
|
+
* Request timeout in milliseconds (default: 30000)
|
|
90
|
+
*/
|
|
91
|
+
timeoutMs?: number;
|
|
92
|
+
/**
|
|
93
|
+
* Maximum response body size in bytes (default: 10MB).
|
|
94
|
+
* Responses larger than this will be rejected with ResponseTooLargeError.
|
|
95
|
+
*/
|
|
96
|
+
maxResponseSize?: number;
|
|
97
|
+
/**
|
|
98
|
+
* Reject URLs with private/loopback IP addresses as hostnames.
|
|
99
|
+
* Performs both lexical hostname checks and DNS resolution to catch
|
|
100
|
+
* domains that resolve to private IPs (e.g., DNS rebinding attacks).
|
|
101
|
+
* Useful for mitigating SSRF attacks. Default: false (opt-in).
|
|
102
|
+
*
|
|
103
|
+
* When enabled, the private IP check is enforced even when
|
|
104
|
+
* `dangerouslyAllowFullInternetAccess` is true, ensuring that
|
|
105
|
+
* internal/loopback addresses are never reachable.
|
|
106
|
+
*/
|
|
107
|
+
denyPrivateRanges?: boolean;
|
|
108
|
+
/**
|
|
109
|
+
* @internal Override DNS resolution for testing.
|
|
110
|
+
* When set, used instead of the default `dns.lookup` for the
|
|
111
|
+
* denyPrivateRanges DNS rebinding check.
|
|
112
|
+
*/
|
|
113
|
+
_dnsResolve?: (hostname: string) => Promise<DnsLookupResult[]>;
|
|
114
|
+
}
|
|
115
|
+
/**
|
|
116
|
+
* Result of a network fetch operation
|
|
117
|
+
*/
|
|
118
|
+
export interface FetchResult {
|
|
119
|
+
status: number;
|
|
120
|
+
statusText: string;
|
|
121
|
+
headers: Record<string, string>;
|
|
122
|
+
/** Raw response bytes (never decoded as UTF-8 text). */
|
|
123
|
+
body: Uint8Array;
|
|
124
|
+
url: string;
|
|
125
|
+
}
|
|
126
|
+
/**
|
|
127
|
+
* Error thrown when a URL is not allowed
|
|
128
|
+
*/
|
|
129
|
+
export declare class NetworkAccessDeniedError extends Error {
|
|
130
|
+
constructor(url: string, reason?: string);
|
|
131
|
+
}
|
|
132
|
+
/**
|
|
133
|
+
* Error thrown when too many redirects occur
|
|
134
|
+
*/
|
|
135
|
+
export declare class TooManyRedirectsError extends Error {
|
|
136
|
+
constructor(maxRedirects: number);
|
|
137
|
+
}
|
|
138
|
+
/**
|
|
139
|
+
* Error thrown when a redirect target is not allowed
|
|
140
|
+
*/
|
|
141
|
+
export declare class RedirectNotAllowedError extends Error {
|
|
142
|
+
constructor(url: string);
|
|
143
|
+
}
|
|
144
|
+
/**
|
|
145
|
+
* Error thrown when an HTTP method is not allowed
|
|
146
|
+
*/
|
|
147
|
+
export declare class MethodNotAllowedError extends Error {
|
|
148
|
+
constructor(method: string, allowedMethods: string[]);
|
|
149
|
+
}
|
|
150
|
+
/**
|
|
151
|
+
* Error thrown when a response body exceeds the maximum allowed size
|
|
152
|
+
*/
|
|
153
|
+
export declare class ResponseTooLargeError extends Error {
|
|
154
|
+
constructor(maxSize: number);
|
|
155
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Arithmetic Expression Parser
|
|
3
|
+
*
|
|
4
|
+
* Parses bash arithmetic expressions like:
|
|
5
|
+
* - $((1 + 2))
|
|
6
|
+
* - $((x++))
|
|
7
|
+
* - $((a ? b : c))
|
|
8
|
+
* - $((2#1010))
|
|
9
|
+
*
|
|
10
|
+
* All functions take a Parser instance as the first argument for shared state access.
|
|
11
|
+
*/
|
|
12
|
+
import type { ArithExpr, ArithmeticExpressionNode } from "../ast/types.js";
|
|
13
|
+
import { parseArithNumber } from "./arithmetic-primaries.js";
|
|
14
|
+
import type { Parser } from "./parser.js";
|
|
15
|
+
export { parseArithNumber };
|
|
16
|
+
/**
|
|
17
|
+
* Parse an arithmetic expression string into an AST node
|
|
18
|
+
*/
|
|
19
|
+
export declare function parseArithmeticExpression(_p: Parser, input: string): ArithmeticExpressionNode;
|
|
20
|
+
export declare function parseArithExpr(p: Parser, input: string, pos: number): {
|
|
21
|
+
expr: ArithExpr;
|
|
22
|
+
pos: number;
|
|
23
|
+
};
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Helper functions for parsing primary arithmetic expressions
|
|
3
|
+
*/
|
|
4
|
+
import type { ArithExpr } from "../ast/types.js";
|
|
5
|
+
import type { Parser } from "./parser.js";
|
|
6
|
+
/**
|
|
7
|
+
* Skip whitespace in arithmetic expression input.
|
|
8
|
+
* Also handles line continuations (backslash followed by newline).
|
|
9
|
+
*/
|
|
10
|
+
export declare function skipArithWhitespace(input: string, pos: number): number;
|
|
11
|
+
/**
|
|
12
|
+
* Assignment operators in arithmetic expressions
|
|
13
|
+
*/
|
|
14
|
+
export declare const ARITH_ASSIGN_OPS: readonly ["=", "+=", "-=", "*=", "/=", "%=", "<<=", ">>=", "&=", "|=", "^="];
|
|
15
|
+
/**
|
|
16
|
+
* Parse a number string with various bases (decimal, hex, octal, base#num)
|
|
17
|
+
* Returns NaN for invalid numbers.
|
|
18
|
+
*/
|
|
19
|
+
export declare function parseArithNumber(str: string): number;
|
|
20
|
+
/**
|
|
21
|
+
* Parse nested arithmetic expression: $((expr))
|
|
22
|
+
*/
|
|
23
|
+
export declare function parseNestedArithmetic(parseArithExpr: (p: Parser, input: string, pos: number) => {
|
|
24
|
+
expr: ArithExpr;
|
|
25
|
+
pos: number;
|
|
26
|
+
}, p: Parser, input: string, currentPos: number): {
|
|
27
|
+
expr: ArithExpr;
|
|
28
|
+
pos: number;
|
|
29
|
+
} | null;
|
|
30
|
+
/**
|
|
31
|
+
* Parse ANSI-C quoting: $'...'
|
|
32
|
+
* Returns the numeric value of the string content
|
|
33
|
+
*/
|
|
34
|
+
export declare function parseAnsiCQuoting(input: string, currentPos: number): {
|
|
35
|
+
expr: ArithExpr;
|
|
36
|
+
pos: number;
|
|
37
|
+
} | null;
|
|
38
|
+
/**
|
|
39
|
+
* Parse localization quoting: $"..."
|
|
40
|
+
* Returns the numeric value of the string content
|
|
41
|
+
*/
|
|
42
|
+
export declare function parseLocalizationQuoting(input: string, currentPos: number): {
|
|
43
|
+
expr: ArithExpr;
|
|
44
|
+
pos: number;
|
|
45
|
+
} | null;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Command Parser
|
|
3
|
+
*
|
|
4
|
+
* Handles parsing of simple commands, redirections, and assignments.
|
|
5
|
+
*/
|
|
6
|
+
import { type RedirectionNode, type SimpleCommandNode } from "../ast/types.js";
|
|
7
|
+
import type { Parser } from "./parser.js";
|
|
8
|
+
export declare function isRedirection(p: Parser): boolean;
|
|
9
|
+
export declare function parseRedirection(p: Parser): RedirectionNode;
|
|
10
|
+
export declare function parseSimpleCommand(p: Parser): SimpleCommandNode;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Compound Command Parser
|
|
3
|
+
*
|
|
4
|
+
* Handles parsing of compound commands: if, for, while, until, case, subshell, group.
|
|
5
|
+
*/
|
|
6
|
+
import { type CaseNode, type CStyleForNode, type ForNode, type GroupNode, type IfNode, type SubshellNode, type UntilNode, type WhileNode } from "../ast/types.js";
|
|
7
|
+
import type { Parser } from "./parser.js";
|
|
8
|
+
export declare function parseIf(p: Parser, options?: {
|
|
9
|
+
skipRedirections?: boolean;
|
|
10
|
+
}): IfNode;
|
|
11
|
+
export declare function parseFor(p: Parser, options?: {
|
|
12
|
+
skipRedirections?: boolean;
|
|
13
|
+
}): ForNode | CStyleForNode;
|
|
14
|
+
export declare function parseWhile(p: Parser, options?: {
|
|
15
|
+
skipRedirections?: boolean;
|
|
16
|
+
}): WhileNode;
|
|
17
|
+
export declare function parseUntil(p: Parser, options?: {
|
|
18
|
+
skipRedirections?: boolean;
|
|
19
|
+
}): UntilNode;
|
|
20
|
+
export declare function parseCase(p: Parser, options?: {
|
|
21
|
+
skipRedirections?: boolean;
|
|
22
|
+
}): CaseNode;
|
|
23
|
+
export declare function parseSubshell(p: Parser, options?: {
|
|
24
|
+
skipRedirections?: boolean;
|
|
25
|
+
}): SubshellNode | CStyleForNode;
|
|
26
|
+
export declare function parseGroup(p: Parser, options?: {
|
|
27
|
+
skipRedirections?: boolean;
|
|
28
|
+
}): GroupNode;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Conditional Expression Parser
|
|
3
|
+
*
|
|
4
|
+
* Handles parsing of [[ ... ]] conditional commands.
|
|
5
|
+
*/
|
|
6
|
+
import type { ConditionalExpressionNode } from "../ast/types.js";
|
|
7
|
+
import type { Parser } from "./parser.js";
|
|
8
|
+
export declare function parseConditionalExpression(p: Parser): ConditionalExpressionNode;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Expansion Parser
|
|
3
|
+
*
|
|
4
|
+
* Handles parsing of parameter expansions, arithmetic expansions, etc.
|
|
5
|
+
*/
|
|
6
|
+
import { type WordPart } from "../ast/types.js";
|
|
7
|
+
import type { Parser } from "./parser.js";
|
|
8
|
+
export declare function parseWordParts(p: Parser, value: string, quoted?: boolean, singleQuoted?: boolean, isAssignment?: boolean, hereDoc?: boolean,
|
|
9
|
+
/** When true, single quotes are treated as literal characters, not quote delimiters */
|
|
10
|
+
singleQuotesAreLiteral?: boolean,
|
|
11
|
+
/** When true, brace expansion is disabled (used in [[ ]] conditionals) */
|
|
12
|
+
noBraceExpansion?: boolean,
|
|
13
|
+
/** When true, all backslash escapes create Escaped nodes (for regex patterns in [[ =~ ]]) */
|
|
14
|
+
regexPattern?: boolean,
|
|
15
|
+
/** When true, \} is treated as escaped } (used in parameter expansion default values) */
|
|
16
|
+
inParameterExpansion?: boolean): WordPart[];
|
|
@@ -0,0 +1,197 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Lexer for Bash Scripts
|
|
3
|
+
*
|
|
4
|
+
* The lexer tokenizes input into a stream of tokens that the parser consumes.
|
|
5
|
+
* It handles:
|
|
6
|
+
* - Operators and delimiters
|
|
7
|
+
* - Words (with quoting rules)
|
|
8
|
+
* - Comments
|
|
9
|
+
* - Here-documents
|
|
10
|
+
* - Escape sequences
|
|
11
|
+
*/
|
|
12
|
+
export interface LexerOptions {
|
|
13
|
+
/** Maximum heredoc size in bytes (default: 10MB) */
|
|
14
|
+
maxHeredocSize?: number;
|
|
15
|
+
}
|
|
16
|
+
export declare enum TokenType {
|
|
17
|
+
EOF = "EOF",
|
|
18
|
+
NEWLINE = "NEWLINE",
|
|
19
|
+
SEMICOLON = "SEMICOLON",
|
|
20
|
+
AMP = "AMP",// &
|
|
21
|
+
PIPE = "PIPE",// |
|
|
22
|
+
PIPE_AMP = "PIPE_AMP",// |&
|
|
23
|
+
AND_AND = "AND_AND",// &&
|
|
24
|
+
OR_OR = "OR_OR",// ||
|
|
25
|
+
BANG = "BANG",// !
|
|
26
|
+
LESS = "LESS",// <
|
|
27
|
+
GREAT = "GREAT",// >
|
|
28
|
+
DLESS = "DLESS",// <<
|
|
29
|
+
DGREAT = "DGREAT",// >>
|
|
30
|
+
LESSAND = "LESSAND",// <&
|
|
31
|
+
GREATAND = "GREATAND",// >&
|
|
32
|
+
LESSGREAT = "LESSGREAT",// <>
|
|
33
|
+
DLESSDASH = "DLESSDASH",// <<-
|
|
34
|
+
CLOBBER = "CLOBBER",// >|
|
|
35
|
+
TLESS = "TLESS",// <<<
|
|
36
|
+
AND_GREAT = "AND_GREAT",// &>
|
|
37
|
+
AND_DGREAT = "AND_DGREAT",// &>>
|
|
38
|
+
LPAREN = "LPAREN",// (
|
|
39
|
+
RPAREN = "RPAREN",// )
|
|
40
|
+
LBRACE = "LBRACE",// {
|
|
41
|
+
RBRACE = "RBRACE",// }
|
|
42
|
+
DSEMI = "DSEMI",// ;;
|
|
43
|
+
SEMI_AND = "SEMI_AND",// ;&
|
|
44
|
+
SEMI_SEMI_AND = "SEMI_SEMI_AND",// ;;&
|
|
45
|
+
DBRACK_START = "DBRACK_START",// [[
|
|
46
|
+
DBRACK_END = "DBRACK_END",// ]]
|
|
47
|
+
DPAREN_START = "DPAREN_START",// ((
|
|
48
|
+
DPAREN_END = "DPAREN_END",// ))
|
|
49
|
+
IF = "IF",
|
|
50
|
+
THEN = "THEN",
|
|
51
|
+
ELSE = "ELSE",
|
|
52
|
+
ELIF = "ELIF",
|
|
53
|
+
FI = "FI",
|
|
54
|
+
FOR = "FOR",
|
|
55
|
+
WHILE = "WHILE",
|
|
56
|
+
UNTIL = "UNTIL",
|
|
57
|
+
DO = "DO",
|
|
58
|
+
DONE = "DONE",
|
|
59
|
+
CASE = "CASE",
|
|
60
|
+
ESAC = "ESAC",
|
|
61
|
+
IN = "IN",
|
|
62
|
+
FUNCTION = "FUNCTION",
|
|
63
|
+
SELECT = "SELECT",
|
|
64
|
+
TIME = "TIME",
|
|
65
|
+
COPROC = "COPROC",
|
|
66
|
+
WORD = "WORD",
|
|
67
|
+
NAME = "NAME",// Valid variable name
|
|
68
|
+
NUMBER = "NUMBER",// For redirections like 2>&1
|
|
69
|
+
ASSIGNMENT_WORD = "ASSIGNMENT_WORD",// VAR=value
|
|
70
|
+
FD_VARIABLE = "FD_VARIABLE",// {varname} before redirect operator
|
|
71
|
+
COMMENT = "COMMENT",
|
|
72
|
+
HEREDOC_CONTENT = "HEREDOC_CONTENT"
|
|
73
|
+
}
|
|
74
|
+
export interface Token {
|
|
75
|
+
type: TokenType;
|
|
76
|
+
value: string;
|
|
77
|
+
/** Original position in input */
|
|
78
|
+
start: number;
|
|
79
|
+
end: number;
|
|
80
|
+
line: number;
|
|
81
|
+
column: number;
|
|
82
|
+
/** For WORD tokens: quote information */
|
|
83
|
+
quoted?: boolean;
|
|
84
|
+
singleQuoted?: boolean;
|
|
85
|
+
}
|
|
86
|
+
/**
|
|
87
|
+
* Error thrown when the lexer encounters invalid input
|
|
88
|
+
*/
|
|
89
|
+
export declare class LexerError extends Error {
|
|
90
|
+
line: number;
|
|
91
|
+
column: number;
|
|
92
|
+
constructor(message: string, line: number, column: number);
|
|
93
|
+
}
|
|
94
|
+
/**
|
|
95
|
+
* Lexer class
|
|
96
|
+
*/
|
|
97
|
+
export declare class Lexer {
|
|
98
|
+
private input;
|
|
99
|
+
private pos;
|
|
100
|
+
private line;
|
|
101
|
+
private column;
|
|
102
|
+
private tokens;
|
|
103
|
+
private pendingHeredocs;
|
|
104
|
+
private dparenDepth;
|
|
105
|
+
private maxHeredocSize;
|
|
106
|
+
constructor(input: string, options?: LexerOptions);
|
|
107
|
+
/**
|
|
108
|
+
* Tokenize the entire input
|
|
109
|
+
*/
|
|
110
|
+
tokenize(): Token[];
|
|
111
|
+
private skipWhitespace;
|
|
112
|
+
private nextToken;
|
|
113
|
+
/**
|
|
114
|
+
* Look ahead from position after (( to determine if this is nested subshells
|
|
115
|
+
* like ((cmd) || (cmd2)) rather than arithmetic like ((1+2)).
|
|
116
|
+
*
|
|
117
|
+
* Returns true if it looks like nested subshells (command invocation).
|
|
118
|
+
*/
|
|
119
|
+
private looksLikeNestedSubshells;
|
|
120
|
+
private makeToken;
|
|
121
|
+
private readComment;
|
|
122
|
+
private readWord;
|
|
123
|
+
private readHeredocContent;
|
|
124
|
+
/**
|
|
125
|
+
* Register a here-document to be read after the next newline
|
|
126
|
+
*/
|
|
127
|
+
addPendingHeredoc(delimiter: string, stripTabs: boolean, quoted: boolean): void;
|
|
128
|
+
/**
|
|
129
|
+
* Look ahead from current position to find the here-doc delimiter
|
|
130
|
+
* and register it as a pending here-doc
|
|
131
|
+
*/
|
|
132
|
+
private registerHeredocFromLookahead;
|
|
133
|
+
/**
|
|
134
|
+
* Check if position is followed by word characters (not a word boundary).
|
|
135
|
+
* Used to determine if } should be literal or RBRACE token.
|
|
136
|
+
*/
|
|
137
|
+
private isWordCharFollowing;
|
|
138
|
+
/**
|
|
139
|
+
* Read a word that starts with a brace expansion.
|
|
140
|
+
* Includes the brace expansion plus any suffix characters and additional brace expansions.
|
|
141
|
+
*/
|
|
142
|
+
private readWordWithBraceExpansion;
|
|
143
|
+
/**
|
|
144
|
+
* Scan ahead to detect brace expansion pattern.
|
|
145
|
+
* Returns the full brace expansion string if found, null otherwise.
|
|
146
|
+
* Brace expansion must contain either:
|
|
147
|
+
* - A comma (e.g., {a,b,c})
|
|
148
|
+
* - A range with .. (e.g., {1..10})
|
|
149
|
+
*/
|
|
150
|
+
private scanBraceExpansion;
|
|
151
|
+
/**
|
|
152
|
+
* Scan a literal brace word like {foo} (no comma, no range).
|
|
153
|
+
* Returns the literal string if found, null otherwise.
|
|
154
|
+
* This is used when {} contains something but it's not a valid brace expansion.
|
|
155
|
+
*/
|
|
156
|
+
private scanLiteralBraceWord;
|
|
157
|
+
/**
|
|
158
|
+
* Scan an extglob pattern starting at the opening parenthesis.
|
|
159
|
+
* Extglob patterns are: @(...), *(...), +(...), ?(...), !(...)
|
|
160
|
+
* The operator (@, *, +, ?, !) is already consumed; we start at the (.
|
|
161
|
+
* Returns the content including parentheses, or null if not a valid extglob.
|
|
162
|
+
*/
|
|
163
|
+
private scanExtglobPattern;
|
|
164
|
+
/**
|
|
165
|
+
* Scan for FD variable syntax: {varname} immediately followed by a redirect operator.
|
|
166
|
+
* This is the bash 4.1+ feature where {fd}>file allocates an FD and stores it in variable.
|
|
167
|
+
* Returns the variable name and end position if found, null otherwise.
|
|
168
|
+
*
|
|
169
|
+
* Valid patterns:
|
|
170
|
+
* - {varname}>file, {varname}>>file, {varname}>|file
|
|
171
|
+
* - {varname}<file, {varname}<<word, {varname}<<<word
|
|
172
|
+
* - {varname}<>file
|
|
173
|
+
* - {varname}>&N, {varname}<&N
|
|
174
|
+
* - {varname}>&-, {varname}<&- (close FD)
|
|
175
|
+
*/
|
|
176
|
+
private scanFdVariable;
|
|
177
|
+
/**
|
|
178
|
+
* Scan ahead from a $(( position to determine if it should be treated as
|
|
179
|
+
* $( ( subshell ) ) instead of $(( arithmetic )).
|
|
180
|
+
* This handles cases like:
|
|
181
|
+
* echo $(( echo 1
|
|
182
|
+
* echo 2
|
|
183
|
+
* ) )
|
|
184
|
+
* which should be a command substitution containing a subshell, not arithmetic.
|
|
185
|
+
*
|
|
186
|
+
* @param startPos - position at the second ( (i.e., at input[startPos] === "(")
|
|
187
|
+
* @returns true if this is a subshell (closes with ) )), false if arithmetic (closes with )))
|
|
188
|
+
*/
|
|
189
|
+
private dollarDparenIsSubshell;
|
|
190
|
+
/**
|
|
191
|
+
* Scan ahead from a (( position to determine if it closes with ) ) (nested subshells)
|
|
192
|
+
* or )) (arithmetic). We need to track paren depth and quotes to find the matching close.
|
|
193
|
+
* @param startPos - position after the (( (i.e., at the first char of content)
|
|
194
|
+
* @returns true if it closes with ) ) (space between parens), false otherwise
|
|
195
|
+
*/
|
|
196
|
+
private dparenClosesWithSpacedParens;
|
|
197
|
+
}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Command and Arithmetic Substitution Parsing Helpers
|
|
3
|
+
*
|
|
4
|
+
* Contains pure string analysis functions and substitution parsing utilities
|
|
5
|
+
* extracted from the main parser.
|
|
6
|
+
*/
|
|
7
|
+
import { type CommandSubstitutionPart, type ScriptNode } from "../ast/types.js";
|
|
8
|
+
/**
|
|
9
|
+
* Type for a parser factory function that creates new parser instances.
|
|
10
|
+
* Used to avoid circular dependencies.
|
|
11
|
+
*/
|
|
12
|
+
export type ParserFactory = () => {
|
|
13
|
+
parse(input: string): ScriptNode;
|
|
14
|
+
};
|
|
15
|
+
/**
|
|
16
|
+
* Type for an error reporting function.
|
|
17
|
+
*/
|
|
18
|
+
export type ErrorFn = (message: string) => never;
|
|
19
|
+
/**
|
|
20
|
+
* Check if $(( at position `start` in `value` is a command substitution with nested
|
|
21
|
+
* subshell rather than arithmetic expansion. This uses similar logic to the lexer's
|
|
22
|
+
* dparenClosesWithSpacedParens but operates on a string within a word/expansion.
|
|
23
|
+
*
|
|
24
|
+
* The key heuristics are:
|
|
25
|
+
* 1. If it closes with `) )` (separated by whitespace or content), it's a subshell
|
|
26
|
+
* 2. If at depth 1 we see `||`, `&&`, or single `|`, it's a command context
|
|
27
|
+
* 3. If it closes with `))`, it's arithmetic
|
|
28
|
+
*
|
|
29
|
+
* @param value The string containing the expansion
|
|
30
|
+
* @param start Position of the `$` in `$((` (so `$((` is at start..start+2)
|
|
31
|
+
* @returns true if this should be parsed as command substitution, false for arithmetic
|
|
32
|
+
*/
|
|
33
|
+
export declare function isDollarDparenSubshell(value: string, start: number): boolean;
|
|
34
|
+
/**
|
|
35
|
+
* Parse a command substitution starting at the given position.
|
|
36
|
+
* Handles $(...) syntax with proper depth tracking for nested substitutions.
|
|
37
|
+
*
|
|
38
|
+
* @param value The string containing the substitution
|
|
39
|
+
* @param start Position of the `$` in `$(`
|
|
40
|
+
* @param createParser Factory function to create a new parser instance
|
|
41
|
+
* @param error Error reporting function
|
|
42
|
+
* @returns The parsed command substitution part and the ending index
|
|
43
|
+
*/
|
|
44
|
+
export declare function parseCommandSubstitutionFromString(value: string, start: number, createParser: ParserFactory, error: ErrorFn): {
|
|
45
|
+
part: CommandSubstitutionPart;
|
|
46
|
+
endIndex: number;
|
|
47
|
+
};
|
|
48
|
+
/**
|
|
49
|
+
* Parse a backtick command substitution starting at the given position.
|
|
50
|
+
* Handles `...` syntax with proper escape processing.
|
|
51
|
+
*
|
|
52
|
+
* @param value The string containing the substitution
|
|
53
|
+
* @param start Position of the opening backtick
|
|
54
|
+
* @param inDoubleQuotes Whether the backtick is inside double quotes
|
|
55
|
+
* @param createParser Factory function to create a new parser instance
|
|
56
|
+
* @param error Error reporting function
|
|
57
|
+
* @returns The parsed command substitution part and the ending index
|
|
58
|
+
*/
|
|
59
|
+
export declare function parseBacktickSubstitutionFromString(value: string, start: number, inDoubleQuotes: boolean, createParser: ParserFactory, error: ErrorFn): {
|
|
60
|
+
part: CommandSubstitutionPart;
|
|
61
|
+
endIndex: number;
|
|
62
|
+
};
|
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Recursive Descent Parser for Bash Scripts
|
|
3
|
+
*
|
|
4
|
+
* This parser consumes tokens from the lexer and produces an AST.
|
|
5
|
+
* It follows the bash grammar structure for correctness.
|
|
6
|
+
*
|
|
7
|
+
* Grammar (simplified):
|
|
8
|
+
* script ::= statement*
|
|
9
|
+
* statement ::= pipeline ((&&|'||') pipeline)* [&]
|
|
10
|
+
* pipeline ::= [!] command (| command)*
|
|
11
|
+
* command ::= simple_command | compound_command | function_def
|
|
12
|
+
* simple_cmd ::= (assignment)* [word] (word)* (redirection)*
|
|
13
|
+
* compound_cmd ::= if | for | while | until | case | subshell | group | (( | [[
|
|
14
|
+
*/
|
|
15
|
+
import { type ArithmeticExpansionPart, type ArithmeticExpressionNode, type CommandSubstitutionPart, type RedirectionNode, type ScriptNode, type StatementNode, type WordNode } from "../ast/types.js";
|
|
16
|
+
import { type LexerOptions, type Token, TokenType } from "./lexer.js";
|
|
17
|
+
export type { ParseError } from "./types.js";
|
|
18
|
+
export { ParseException } from "./types.js";
|
|
19
|
+
/**
|
|
20
|
+
* Parser class - transforms tokens into AST
|
|
21
|
+
*/
|
|
22
|
+
export declare class Parser {
|
|
23
|
+
private tokens;
|
|
24
|
+
private pos;
|
|
25
|
+
private pendingHeredocs;
|
|
26
|
+
private parseIterations;
|
|
27
|
+
private parseDepth;
|
|
28
|
+
private _input;
|
|
29
|
+
/**
|
|
30
|
+
* Get the raw input string being parsed.
|
|
31
|
+
* Used by conditional-parser for extracting exact whitespace in regex patterns.
|
|
32
|
+
*/
|
|
33
|
+
getInput(): string;
|
|
34
|
+
/**
|
|
35
|
+
* Check parse iteration limit to prevent infinite loops
|
|
36
|
+
*/
|
|
37
|
+
checkIterationLimit(): void;
|
|
38
|
+
/**
|
|
39
|
+
* Increment parse depth and check limit to prevent stack overflow
|
|
40
|
+
* from deeply nested constructs. Returns a function to decrement depth.
|
|
41
|
+
*/
|
|
42
|
+
enterDepth(): () => void;
|
|
43
|
+
/**
|
|
44
|
+
* Parse a bash script string
|
|
45
|
+
*/
|
|
46
|
+
parse(input: string, options?: LexerOptions): ScriptNode;
|
|
47
|
+
/**
|
|
48
|
+
* Parse from pre-tokenized input
|
|
49
|
+
*/
|
|
50
|
+
parseTokens(tokens: Token[]): ScriptNode;
|
|
51
|
+
current(): Token;
|
|
52
|
+
peek(offset?: number): Token;
|
|
53
|
+
advance(): Token;
|
|
54
|
+
getPos(): number;
|
|
55
|
+
/**
|
|
56
|
+
* Check if current token matches any of the given types.
|
|
57
|
+
* Optimized to avoid array allocation for common cases (1-4 args).
|
|
58
|
+
*/
|
|
59
|
+
check(t1: TokenType, t2?: TokenType, t3?: TokenType, t4?: TokenType, ...rest: TokenType[]): boolean;
|
|
60
|
+
expect(type: TokenType, message?: string): Token;
|
|
61
|
+
error(message: string): never;
|
|
62
|
+
skipNewlines(): void;
|
|
63
|
+
skipSeparators(includeCaseTerminators?: boolean): void;
|
|
64
|
+
addPendingHeredoc(redirect: RedirectionNode, delimiter: string, stripTabs: boolean, quoted: boolean): void;
|
|
65
|
+
private processHeredocs;
|
|
66
|
+
isStatementEnd(): boolean;
|
|
67
|
+
private isCommandStart;
|
|
68
|
+
private parseScript;
|
|
69
|
+
/**
|
|
70
|
+
* Check for unexpected tokens that can't appear at statement start.
|
|
71
|
+
* Returns a deferred error statement for tokens that should cause errors
|
|
72
|
+
* at execution time rather than parse time (to match bash's incremental behavior).
|
|
73
|
+
*/
|
|
74
|
+
private checkUnexpectedToken;
|
|
75
|
+
parseStatement(): StatementNode | null;
|
|
76
|
+
private parsePipeline;
|
|
77
|
+
private parseCommand;
|
|
78
|
+
/**
|
|
79
|
+
* Scan ahead from current DPAREN_START to determine if it closes with ) )
|
|
80
|
+
* (two separate RPAREN tokens) or )) (DPAREN_END token).
|
|
81
|
+
* Returns true if it closes with ) ) (nested subshells case).
|
|
82
|
+
*/
|
|
83
|
+
private dparenClosesWithSpacedParens;
|
|
84
|
+
/**
|
|
85
|
+
* Parse (( ... ) ) as nested subshells when we know it closes with ) ).
|
|
86
|
+
* We've already determined via dparenClosesWithSpacedParens() that this
|
|
87
|
+
* DPAREN_START should be treated as two LPAREN tokens.
|
|
88
|
+
*/
|
|
89
|
+
private parseNestedSubshellsFromDparen;
|
|
90
|
+
isWord(): boolean;
|
|
91
|
+
parseWord(): WordNode;
|
|
92
|
+
/**
|
|
93
|
+
* Parse a word without brace expansion (for [[ ]] conditionals).
|
|
94
|
+
* In bash, brace expansion does not occur inside [[ ]].
|
|
95
|
+
*/
|
|
96
|
+
parseWordNoBraceExpansion(): WordNode;
|
|
97
|
+
/**
|
|
98
|
+
* Parse a word for regex patterns (in [[ =~ ]]).
|
|
99
|
+
* All escaped characters create Escaped nodes so the backslash is preserved
|
|
100
|
+
* for the regex engine. For example, \$ creates Escaped("$") which becomes \$
|
|
101
|
+
* in the final regex pattern.
|
|
102
|
+
*/
|
|
103
|
+
parseWordForRegex(): WordNode;
|
|
104
|
+
parseWordFromString(value: string, quoted?: boolean, singleQuoted?: boolean, isAssignment?: boolean, hereDoc?: boolean, noBraceExpansion?: boolean, regexPattern?: boolean): WordNode;
|
|
105
|
+
parseCommandSubstitution(value: string, start: number): {
|
|
106
|
+
part: CommandSubstitutionPart;
|
|
107
|
+
endIndex: number;
|
|
108
|
+
};
|
|
109
|
+
parseBacktickSubstitution(value: string, start: number,
|
|
110
|
+
/** Whether the backtick is inside double quotes */
|
|
111
|
+
inDoubleQuotes?: boolean): {
|
|
112
|
+
part: CommandSubstitutionPart;
|
|
113
|
+
endIndex: number;
|
|
114
|
+
};
|
|
115
|
+
/**
|
|
116
|
+
* Check if $(( at position `start` in `value` is a command substitution with nested
|
|
117
|
+
* subshell rather than arithmetic expansion.
|
|
118
|
+
*/
|
|
119
|
+
isDollarDparenSubshell(value: string, start: number): boolean;
|
|
120
|
+
parseArithmeticExpansion(value: string, start: number): {
|
|
121
|
+
part: ArithmeticExpansionPart;
|
|
122
|
+
endIndex: number;
|
|
123
|
+
};
|
|
124
|
+
private parseArithmeticCommand;
|
|
125
|
+
private parseConditionalCommand;
|
|
126
|
+
private parseFunctionDef;
|
|
127
|
+
private parseCompoundCommandBody;
|
|
128
|
+
parseCompoundList(): StatementNode[];
|
|
129
|
+
parseOptionalRedirections(): RedirectionNode[];
|
|
130
|
+
parseArithmeticExpression(input: string): ArithmeticExpressionNode;
|
|
131
|
+
}
|
|
132
|
+
/**
|
|
133
|
+
* Convenience function to parse a bash script
|
|
134
|
+
*/
|
|
135
|
+
export declare function parse(input: string, options?: LexerOptions): ScriptNode;
|