@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,38 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared utilities for head and tail commands.
|
|
3
|
+
*/
|
|
4
|
+
import type { CommandContext, ExecResult } from "../../types.js";
|
|
5
|
+
export interface HeadTailOptions {
|
|
6
|
+
lines: number;
|
|
7
|
+
bytes: number | null;
|
|
8
|
+
quiet: boolean;
|
|
9
|
+
verbose: boolean;
|
|
10
|
+
files: string[];
|
|
11
|
+
/** tail-specific: start from line N instead of last N lines */
|
|
12
|
+
fromLine?: boolean;
|
|
13
|
+
}
|
|
14
|
+
export type HeadTailParseResult = {
|
|
15
|
+
ok: true;
|
|
16
|
+
options: HeadTailOptions;
|
|
17
|
+
} | {
|
|
18
|
+
ok: false;
|
|
19
|
+
error: ExecResult;
|
|
20
|
+
};
|
|
21
|
+
/**
|
|
22
|
+
* Parse head/tail command arguments.
|
|
23
|
+
* Both commands share most options, with tail having additional +N syntax.
|
|
24
|
+
*/
|
|
25
|
+
export declare function parseHeadTailArgs(args: string[], cmdName: "head" | "tail"): HeadTailParseResult;
|
|
26
|
+
/**
|
|
27
|
+
* Process files for head/tail commands.
|
|
28
|
+
* Handles stdin, multiple files, headers, and error handling.
|
|
29
|
+
*/
|
|
30
|
+
export declare function processHeadTailFiles(ctx: CommandContext, options: HeadTailOptions, cmdName: "head" | "tail", contentProcessor: (content: string) => string): Promise<ExecResult>;
|
|
31
|
+
/**
|
|
32
|
+
* Get the first N lines or bytes from content.
|
|
33
|
+
*/
|
|
34
|
+
export declare function getHead(content: string, lines: number, bytes: number | null): string;
|
|
35
|
+
/**
|
|
36
|
+
* Get the last N lines or bytes from content.
|
|
37
|
+
*/
|
|
38
|
+
export declare function getTail(content: string, lines: number, bytes: number | null, fromLine: boolean): string;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { ExecResult } from "../types.js";
|
|
2
|
+
export interface HelpInfo {
|
|
3
|
+
name: string;
|
|
4
|
+
summary: string;
|
|
5
|
+
usage: string;
|
|
6
|
+
description?: string | string[];
|
|
7
|
+
options?: string[];
|
|
8
|
+
examples?: string[];
|
|
9
|
+
notes?: string[];
|
|
10
|
+
}
|
|
11
|
+
export declare function showHelp(info: HelpInfo): ExecResult;
|
|
12
|
+
export declare function hasHelpFlag(args: string[]): boolean;
|
|
13
|
+
/**
|
|
14
|
+
* Returns an error result for an unknown option
|
|
15
|
+
*/
|
|
16
|
+
export declare function unknownOption(cmdName: string, option: string): ExecResult;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* hostname - show or set the system's host name
|
|
3
|
+
*
|
|
4
|
+
* Usage: hostname [NAME]
|
|
5
|
+
*
|
|
6
|
+
* In sandboxed environment, always returns "localhost".
|
|
7
|
+
*/
|
|
8
|
+
import type { Command } from "../../types.js";
|
|
9
|
+
export declare const hostname: Command;
|
|
10
|
+
import type { CommandFuzzInfo } from "../fuzz-flags-types.js";
|
|
11
|
+
export declare const flagsForFuzzing: CommandFuzzInfo;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* html-to-markdown - Convert HTML to Markdown using TurndownService
|
|
3
|
+
*
|
|
4
|
+
* This is a non-standard command that converts HTML from stdin to Markdown.
|
|
5
|
+
*/
|
|
6
|
+
import type { Command } from "../../types.js";
|
|
7
|
+
export declare const htmlToMarkdownCommand: Command;
|
|
8
|
+
import type { CommandFuzzInfo } from "../fuzz-flags-types.js";
|
|
9
|
+
export declare const flagsForFuzzing: CommandFuzzInfo;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* join - join lines of two files on a common field
|
|
3
|
+
*
|
|
4
|
+
* Usage: join [OPTION]... FILE1 FILE2
|
|
5
|
+
*
|
|
6
|
+
* For each pair of input lines with identical join fields, write a line to
|
|
7
|
+
* standard output. The default join field is the first, delimited by blanks.
|
|
8
|
+
*/
|
|
9
|
+
import type { Command } from "../../types.js";
|
|
10
|
+
export declare const join: Command;
|
|
11
|
+
import type { CommandFuzzInfo } from "../fuzz-flags-types.js";
|
|
12
|
+
export declare const flagsForFuzzing: CommandFuzzInfo;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* jq - Command-line JSON processor
|
|
3
|
+
*
|
|
4
|
+
* Full jq implementation with proper parser and evaluator.
|
|
5
|
+
*/
|
|
6
|
+
import type { Command } from "../../types.js";
|
|
7
|
+
export declare const jqCommand: Command;
|
|
8
|
+
import type { CommandFuzzInfo } from "../fuzz-flags-types.js";
|
|
9
|
+
export declare const flagsForFuzzing: CommandFuzzInfo;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Web Fetch API polyfill source for QuickJS.
|
|
3
|
+
* Exported as a string constant to be evaluated inside the sandbox.
|
|
4
|
+
* Provides URLSearchParams, URL, Headers, Response, Request, and fetch().
|
|
5
|
+
*/
|
|
6
|
+
export declare const FETCH_POLYFILL_SOURCE = "\n(function() {\n // --- URLSearchParams ---\n function URLSearchParams(init) {\n this._entries = [];\n if (!init) return;\n if (typeof init === 'string') {\n var s = init;\n if (s.charAt(0) === '?') s = s.slice(1);\n var pairs = s.split('&');\n for (var i = 0; i < pairs.length; i++) {\n var pair = pairs[i];\n if (pair === '') continue;\n var eq = pair.indexOf('=');\n if (eq === -1) {\n this._entries.push([decodeURIComponent(pair), '']);\n } else {\n this._entries.push([\n decodeURIComponent(pair.slice(0, eq)),\n decodeURIComponent(pair.slice(eq + 1))\n ]);\n }\n }\n } else if (typeof init === 'object' && init !== null) {\n if (init instanceof URLSearchParams) {\n this._entries = init._entries.slice();\n } else {\n var keys = Object.keys(init);\n for (var i = 0; i < keys.length; i++) {\n this._entries.push([keys[i], String(init[keys[i]])]);\n }\n }\n }\n }\n\n URLSearchParams.prototype.append = function(name, value) {\n this._entries.push([String(name), String(value)]);\n };\n\n URLSearchParams.prototype.delete = function(name) {\n var n = String(name);\n this._entries = this._entries.filter(function(e) { return e[0] !== n; });\n };\n\n URLSearchParams.prototype.get = function(name) {\n var n = String(name);\n for (var i = 0; i < this._entries.length; i++) {\n if (this._entries[i][0] === n) return this._entries[i][1];\n }\n return null;\n };\n\n URLSearchParams.prototype.getAll = function(name) {\n var n = String(name);\n var result = [];\n for (var i = 0; i < this._entries.length; i++) {\n if (this._entries[i][0] === n) result.push(this._entries[i][1]);\n }\n return result;\n };\n\n URLSearchParams.prototype.has = function(name) {\n var n = String(name);\n for (var i = 0; i < this._entries.length; i++) {\n if (this._entries[i][0] === n) return true;\n }\n return false;\n };\n\n URLSearchParams.prototype.set = function(name, value) {\n var n = String(name);\n var v = String(value);\n var found = false;\n var newEntries = [];\n for (var i = 0; i < this._entries.length; i++) {\n if (this._entries[i][0] === n) {\n if (!found) {\n newEntries.push([n, v]);\n found = true;\n }\n } else {\n newEntries.push(this._entries[i]);\n }\n }\n if (!found) newEntries.push([n, v]);\n this._entries = newEntries;\n };\n\n URLSearchParams.prototype.sort = function() {\n this._entries.sort(function(a, b) {\n if (a[0] < b[0]) return -1;\n if (a[0] > b[0]) return 1;\n return 0;\n });\n };\n\n URLSearchParams.prototype.toString = function() {\n return this._entries.map(function(e) {\n return encodeURIComponent(e[0]) + '=' + encodeURIComponent(e[1]);\n }).join('&');\n };\n\n URLSearchParams.prototype.forEach = function(callback, thisArg) {\n for (var i = 0; i < this._entries.length; i++) {\n callback.call(thisArg, this._entries[i][1], this._entries[i][0], this);\n }\n };\n\n URLSearchParams.prototype.entries = function() {\n var idx = 0;\n var entries = this._entries;\n return {\n next: function() {\n if (idx >= entries.length) return { done: true, value: undefined };\n return { done: false, value: entries[idx++].slice() };\n },\n [Symbol.iterator]: function() { return this; }\n };\n };\n\n URLSearchParams.prototype.keys = function() {\n var idx = 0;\n var entries = this._entries;\n return {\n next: function() {\n if (idx >= entries.length) return { done: true, value: undefined };\n return { done: false, value: entries[idx++][0] };\n },\n [Symbol.iterator]: function() { return this; }\n };\n };\n\n URLSearchParams.prototype.values = function() {\n var idx = 0;\n var entries = this._entries;\n return {\n next: function() {\n if (idx >= entries.length) return { done: true, value: undefined };\n return { done: false, value: entries[idx++][1] };\n },\n [Symbol.iterator]: function() { return this; }\n };\n };\n\n URLSearchParams.prototype[Symbol.iterator] = URLSearchParams.prototype.entries;\n\n Object.defineProperty(URLSearchParams.prototype, 'size', {\n get: function() { return this._entries.length; }\n });\n\n // --- URL ---\n var urlRegex = /^([a-zA-Z][a-zA-Z0-9+.-]*):(?:\\/\\/(?:([^:@/?#]*)(?::([^@/?#]*))?@)?([^:/?#]*)(?::([0-9]+))?)?(\\/[^?#]*)?(?:\\?([^#]*))?(?:#(.*))?$/;\n\n function URL(url, base) {\n var input = String(url);\n\n if (base !== undefined) {\n var baseUrl = (base instanceof URL) ? base : new URL(String(base));\n // Resolve relative URL against base\n if (/^[a-zA-Z][a-zA-Z0-9+.-]*:/.test(input)) {\n // Absolute URL - parse as-is\n } else if (input.charAt(0) === '/' && input.charAt(1) === '/') {\n // Protocol-relative\n input = baseUrl.protocol + input;\n } else if (input.charAt(0) === '/') {\n // Absolute path\n input = baseUrl.origin + input;\n } else if (input.charAt(0) === '?' || input.charAt(0) === '#') {\n // Query or hash only\n var basePath = baseUrl.protocol + '//' + baseUrl.host + baseUrl.pathname;\n if (input.charAt(0) === '#') {\n input = basePath + baseUrl.search + input;\n } else {\n input = basePath + input;\n }\n } else {\n // Relative path\n var basePath = baseUrl.protocol + '//' + baseUrl.host;\n var dirPath = baseUrl.pathname;\n var lastSlash = dirPath.lastIndexOf('/');\n if (lastSlash >= 0) dirPath = dirPath.slice(0, lastSlash + 1);\n else dirPath = '/';\n input = basePath + dirPath + input;\n }\n }\n\n var m = urlRegex.exec(input);\n if (!m) throw new TypeError(\"Invalid URL: \" + String(url));\n\n this.protocol = m[1].toLowerCase() + ':';\n this.username = m[2] ? decodeURIComponent(m[2]) : '';\n this.password = m[3] ? decodeURIComponent(m[3]) : '';\n this.hostname = m[4] || '';\n this.port = m[5] || '';\n this.pathname = m[6] || '/';\n this.hash = m[8] ? '#' + m[8] : '';\n\n // Normalize pathname (resolve . and ..)\n var parts = this.pathname.split('/');\n var resolved = [];\n for (var i = 0; i < parts.length; i++) {\n if (parts[i] === '..') { if (resolved.length > 1) resolved.pop(); }\n else if (parts[i] !== '.') resolved.push(parts[i]);\n }\n this.pathname = resolved.join('/') || '/';\n\n // searchParams is live\n this._searchParamsStr = m[7] || '';\n this.searchParams = new URLSearchParams(this._searchParamsStr);\n }\n\n Object.defineProperty(URL.prototype, 'search', {\n get: function() {\n var s = this.searchParams.toString();\n return s ? '?' + s : '';\n },\n set: function(v) {\n this.searchParams = new URLSearchParams(String(v));\n }\n });\n\n Object.defineProperty(URL.prototype, 'host', {\n get: function() {\n return this.port ? this.hostname + ':' + this.port : this.hostname;\n }\n });\n\n Object.defineProperty(URL.prototype, 'origin', {\n get: function() {\n return this.protocol + '//' + this.host;\n }\n });\n\n Object.defineProperty(URL.prototype, 'href', {\n get: function() {\n var auth = '';\n if (this.username) {\n auth = this.username;\n if (this.password) auth += ':' + this.password;\n auth += '@';\n }\n return this.protocol + '//' + auth + this.host + this.pathname + this.search + this.hash;\n },\n set: function(v) {\n var parsed = new URL(String(v));\n this.protocol = parsed.protocol;\n this.username = parsed.username;\n this.password = parsed.password;\n this.hostname = parsed.hostname;\n this.port = parsed.port;\n this.pathname = parsed.pathname;\n this.searchParams = parsed.searchParams;\n this.hash = parsed.hash;\n }\n });\n\n URL.prototype.toString = function() { return this.href; };\n URL.prototype.toJSON = function() { return this.href; };\n\n // --- Headers ---\n function Headers(init) {\n this._map = {};\n if (!init) return;\n if (init instanceof Headers) {\n var keys = Object.keys(init._map);\n for (var i = 0; i < keys.length; i++) {\n this._map[keys[i]] = init._map[keys[i]].slice();\n }\n } else if (typeof init === 'object') {\n var keys = Object.keys(init);\n for (var i = 0; i < keys.length; i++) {\n this._map[keys[i].toLowerCase()] = [String(init[keys[i]])];\n }\n }\n }\n\n Headers.prototype.append = function(name, value) {\n var key = String(name).toLowerCase();\n if (!this._map[key]) this._map[key] = [];\n this._map[key].push(String(value));\n };\n\n Headers.prototype.delete = function(name) {\n delete this._map[String(name).toLowerCase()];\n };\n\n Headers.prototype.get = function(name) {\n var vals = this._map[String(name).toLowerCase()];\n return vals ? vals.join(', ') : null;\n };\n\n Headers.prototype.has = function(name) {\n return String(name).toLowerCase() in this._map;\n };\n\n Headers.prototype.set = function(name, value) {\n this._map[String(name).toLowerCase()] = [String(value)];\n };\n\n Headers.prototype.forEach = function(callback, thisArg) {\n var keys = Object.keys(this._map).sort();\n for (var i = 0; i < keys.length; i++) {\n callback.call(thisArg, this._map[keys[i]].join(', '), keys[i], this);\n }\n };\n\n Headers.prototype.entries = function() {\n var keys = Object.keys(this._map).sort();\n var map = this._map;\n var idx = 0;\n return {\n next: function() {\n if (idx >= keys.length) return { done: true, value: undefined };\n var k = keys[idx++];\n return { done: false, value: [k, map[k].join(', ')] };\n },\n [Symbol.iterator]: function() { return this; }\n };\n };\n\n Headers.prototype.keys = function() {\n var keys = Object.keys(this._map).sort();\n var idx = 0;\n return {\n next: function() {\n if (idx >= keys.length) return { done: true, value: undefined };\n return { done: false, value: keys[idx++] };\n },\n [Symbol.iterator]: function() { return this; }\n };\n };\n\n Headers.prototype.values = function() {\n var keys = Object.keys(this._map).sort();\n var map = this._map;\n var idx = 0;\n return {\n next: function() {\n if (idx >= keys.length) return { done: true, value: undefined };\n return { done: false, value: map[keys[idx++]].join(', ') };\n },\n [Symbol.iterator]: function() { return this; }\n };\n };\n\n Headers.prototype[Symbol.iterator] = Headers.prototype.entries;\n\n // --- Response ---\n function Response(body, init) {\n if (init === undefined) init = {};\n this.status = init.status !== undefined ? init.status : 200;\n this.statusText = init.statusText !== undefined ? init.statusText : '';\n this.headers = init.headers instanceof Headers ? init.headers : new Headers(init.headers);\n this.body = body !== undefined && body !== null ? String(body) : '';\n this.ok = this.status >= 200 && this.status <= 299;\n this.url = '';\n this.redirected = false;\n this.type = 'basic';\n this.bodyUsed = false;\n }\n\n Response.prototype.text = function() {\n this.bodyUsed = true;\n return Promise.resolve(this.body);\n };\n\n Response.prototype.json = function() {\n this.bodyUsed = true;\n try {\n return Promise.resolve(JSON.parse(this.body));\n } catch (e) {\n return Promise.reject(e);\n }\n };\n\n Response.prototype.clone = function() {\n var r = new Response(this.body, {\n status: this.status,\n statusText: this.statusText,\n headers: new Headers(this.headers)\n });\n r.url = this.url;\n r.redirected = this.redirected;\n r.type = this.type;\n return r;\n };\n\n Response.json = function(data, init) {\n if (init === undefined) init = {};\n var headers = init.headers instanceof Headers ? init.headers : new Headers(init.headers);\n if (!headers.has('content-type')) {\n headers.set('content-type', 'application/json');\n }\n return new Response(JSON.stringify(data), {\n status: init.status !== undefined ? init.status : 200,\n statusText: init.statusText || '',\n headers: headers\n });\n };\n\n Response.error = function() {\n var r = new Response(null, { status: 0, statusText: '' });\n r.type = 'error';\n r.ok = false;\n return r;\n };\n\n Response.redirect = function(url, status) {\n if (status === undefined) status = 302;\n var r = new Response(null, {\n status: status,\n statusText: '',\n headers: new Headers({ location: String(url) })\n });\n r.redirected = true;\n return r;\n };\n\n // --- Request ---\n function Request(input, init) {\n if (init === undefined) init = {};\n if (input instanceof Request) {\n this.url = input.url;\n this.method = input.method;\n this.headers = new Headers(input.headers);\n this.body = input.body;\n } else {\n this.url = String(input);\n this.method = 'GET';\n this.headers = new Headers();\n this.body = null;\n }\n if (init.method !== undefined) this.method = String(init.method).toUpperCase();\n if (init.headers !== undefined) this.headers = init.headers instanceof Headers ? init.headers : new Headers(init.headers);\n if (init.body !== undefined) this.body = init.body !== null ? String(init.body) : null;\n }\n\n Request.prototype.clone = function() {\n return new Request(this);\n };\n\n // --- Assign to globalThis ---\n globalThis.URLSearchParams = URLSearchParams;\n globalThis.URL = URL;\n globalThis.Headers = Headers;\n globalThis.Response = Response;\n globalThis.Request = Request;\n\n // --- Wrap native fetch ---\n var _nativeFetch = globalThis[Symbol.for('jb:fetch')];\n globalThis.fetch = function fetch(input, init) {\n try {\n var url, method, headers, body;\n\n if (input instanceof Request) {\n url = input.url;\n method = input.method;\n headers = {};\n input.headers.forEach(function(v, k) { headers[k] = v; });\n body = input.body;\n } else {\n url = String(input);\n method = undefined;\n headers = undefined;\n body = undefined;\n }\n\n if (init) {\n if (init.method !== undefined) method = String(init.method).toUpperCase();\n if (init.headers !== undefined) {\n var h = init.headers instanceof Headers ? init.headers : new Headers(init.headers);\n headers = {};\n h.forEach(function(v, k) { headers[k] = v; });\n }\n if (init.body !== undefined) body = init.body !== null ? String(init.body) : undefined;\n }\n\n var opts = Object.create(null);\n if (method) opts.method = method;\n if (headers) opts.headers = headers;\n if (body) opts.body = body;\n\n var raw = _nativeFetch(url, opts);\n\n var respHeaders = new Headers(raw.headers || {});\n var response = new Response(raw.body, {\n status: raw.status,\n statusText: raw.statusText || '',\n headers: respHeaders\n });\n response.url = raw.url || url;\n\n return Promise.resolve(response);\n } catch (e) {\n return Promise.reject(new TypeError(e.message || 'fetch failed'));\n }\n };\n})();\n";
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Worker thread for JavaScript execution via QuickJS.
|
|
3
|
+
* Keeps QuickJS loaded and handles multiple execution requests.
|
|
4
|
+
*
|
|
5
|
+
* Defense-in-depth activates AFTER QuickJS loads (WASM init needs unrestricted JS).
|
|
6
|
+
* User JavaScript code runs inside the QuickJS sandbox with no access to Node.js globals.
|
|
7
|
+
*
|
|
8
|
+
* Build: Bundled to js-exec-worker.js via esbuild (see package.json "build:worker").
|
|
9
|
+
* Run: npx esbuild src/commands/js-exec/js-exec-worker.ts --bundle --platform=node --format=esm --outfile=src/commands/js-exec/js-exec-worker.js --external:quickjs-emscripten
|
|
10
|
+
*/
|
|
11
|
+
import { type WorkerDefenseStats } from "../../security/index.js";
|
|
12
|
+
export interface JsExecWorkerInput {
|
|
13
|
+
protocolToken: string;
|
|
14
|
+
sharedBuffer: SharedArrayBuffer;
|
|
15
|
+
jsCode: string;
|
|
16
|
+
cwd: string;
|
|
17
|
+
env: Record<string, string>;
|
|
18
|
+
args: string[];
|
|
19
|
+
scriptPath?: string;
|
|
20
|
+
bootstrapCode?: string;
|
|
21
|
+
isModule?: boolean;
|
|
22
|
+
stripTypes?: boolean;
|
|
23
|
+
timeoutMs?: number;
|
|
24
|
+
/** When true, the QuickJS guest gets a `tools` proxy that calls the host's invokeTool hook. */
|
|
25
|
+
hasInvokeTool?: boolean;
|
|
26
|
+
}
|
|
27
|
+
export interface JsExecWorkerOutput {
|
|
28
|
+
protocolToken?: string;
|
|
29
|
+
success: boolean;
|
|
30
|
+
error?: string;
|
|
31
|
+
defenseStats?: WorkerDefenseStats;
|
|
32
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* js-exec - Execute JavaScript code via QuickJS (WASM)
|
|
3
|
+
*
|
|
4
|
+
* Runs JavaScript code in an isolated worker thread with access to the
|
|
5
|
+
* virtual filesystem, HTTP, and sub-shell execution via SharedArrayBuffer bridge.
|
|
6
|
+
*
|
|
7
|
+
* This command is Node.js only (uses worker_threads).
|
|
8
|
+
*/
|
|
9
|
+
import type { Command } from "../../types.js";
|
|
10
|
+
export declare const jsExecCommand: Command;
|
|
11
|
+
export declare const nodeStubCommand: Command;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Node.js module shims for the QuickJS sandbox.
|
|
3
|
+
* Each is a JS source string evaluated inside the sandbox IIFE.
|
|
4
|
+
* They set up globals (e.g. globalThis[Symbol.for('jb:os')]) referenced by both
|
|
5
|
+
* require() and ESM VIRTUAL_MODULES.
|
|
6
|
+
*/
|
|
7
|
+
/** EventEmitter — pure JS, no dependencies. Must run before stream. */
|
|
8
|
+
export declare const EVENTS_MODULE_SOURCE = "\nvar EventEmitter = (function() {\n function EE() {\n this._events = {};\n this._maxListeners = 10;\n }\n EE.prototype.on = function(event, listener) {\n if (!this._events[event]) this._events[event] = [];\n this._events[event].push(listener);\n return this;\n };\n EE.prototype.addListener = EE.prototype.on;\n EE.prototype.once = function(event, listener) {\n var self = this;\n function wrapper() {\n self.removeListener(event, wrapper);\n listener.apply(this, arguments);\n }\n wrapper._original = listener;\n return this.on(event, wrapper);\n };\n EE.prototype.off = function(event, listener) {\n return this.removeListener(event, listener);\n };\n EE.prototype.removeListener = function(event, listener) {\n var list = this._events[event];\n if (list) {\n this._events[event] = list.filter(function(fn) {\n return fn !== listener && fn._original !== listener;\n });\n }\n return this;\n };\n EE.prototype.removeAllListeners = function(event) {\n if (event) delete this._events[event];\n else this._events = {};\n return this;\n };\n EE.prototype.emit = function(event) {\n var list = this._events[event];\n if (!list || list.length === 0) return false;\n var args = Array.prototype.slice.call(arguments, 1);\n var fns = list.slice();\n for (var i = 0; i < fns.length; i++) fns[i].apply(this, args);\n return true;\n };\n EE.prototype.listeners = function(event) {\n return (this._events[event] || []).slice();\n };\n EE.prototype.listenerCount = function(event) {\n return (this._events[event] || []).length;\n };\n EE.prototype.setMaxListeners = function(n) {\n this._maxListeners = n;\n return this;\n };\n EE.prototype.eventNames = function() {\n return Object.keys(this._events);\n };\n EE.prototype.prependListener = function(event, listener) {\n if (!this._events[event]) this._events[event] = [];\n this._events[event].unshift(listener);\n return this;\n };\n return EE;\n})();\nglobalThis[Symbol.for('jb:events')] = { EventEmitter: EventEmitter };\n";
|
|
9
|
+
/** OS module — hardcoded sandbox values */
|
|
10
|
+
export declare const OS_MODULE_SOURCE = "\nvar _os = {\n platform: function() { return globalThis.process.platform; },\n arch: function() { return globalThis.process.arch; },\n homedir: function() { return '/home/user'; },\n tmpdir: function() { return '/tmp'; },\n type: function() { return 'Linux'; },\n hostname: function() { return 'sandbox'; },\n EOL: '\\n',\n cpus: function() { return []; },\n totalmem: function() { return 0; },\n freemem: function() { return 0; },\n endianness: function() { return 'LE'; }\n};\nglobalThis[Symbol.for('jb:os')] = _os;\n";
|
|
11
|
+
/** URL module — wraps globalThis.URL/URLSearchParams from fetch polyfill */
|
|
12
|
+
export declare const URL_MODULE_SOURCE = "\nvar _urlMod = {\n URL: globalThis.URL,\n URLSearchParams: globalThis.URLSearchParams,\n parse: function(urlStr) {\n try {\n var u = new URL(urlStr);\n return {\n protocol: u.protocol, host: u.host, hostname: u.hostname,\n port: u.port, pathname: u.pathname, search: u.search,\n hash: u.hash, href: u.href, path: u.pathname + u.search\n };\n } catch(e) {\n return {\n protocol: null, host: null, hostname: null, port: null,\n pathname: urlStr, search: '', hash: '', href: urlStr, path: urlStr\n };\n }\n },\n format: function(obj) {\n if (typeof obj === 'string') return obj;\n if (obj instanceof URL) return obj.href;\n var auth = obj.auth ? obj.auth + '@' : '';\n var host = obj.host || ((obj.hostname || '') + (obj.port ? ':' + obj.port : ''));\n return (obj.protocol ? obj.protocol + '//' : '') + auth + host +\n (obj.pathname || '/') + (obj.search || '') + (obj.hash || '');\n }\n};\nglobalThis[Symbol.for('jb:url')] = _urlMod;\n";
|
|
13
|
+
/** Assert module — pure JS */
|
|
14
|
+
export declare const ASSERT_MODULE_SOURCE = "\nvar _deepEqual = function(a, b) {\n if (a === b) return true;\n if (a === null || b === null || typeof a !== 'object' || typeof b !== 'object') return false;\n if (Array.isArray(a) !== Array.isArray(b)) return false;\n var ka = Object.keys(a), kb = Object.keys(b);\n if (ka.length !== kb.length) return false;\n for (var i = 0; i < ka.length; i++) {\n if (!_deepEqual(a[ka[i]], b[ka[i]])) return false;\n }\n return true;\n};\nvar _assert = function(val, msg) {\n if (!val) throw new Error(msg || 'AssertionError: expected truthy value');\n};\n_assert.ok = _assert;\n_assert.equal = function(a, b, msg) {\n if (a != b) throw new Error(msg || 'AssertionError: ' + a + ' != ' + b);\n};\n_assert.notEqual = function(a, b, msg) {\n if (a == b) throw new Error(msg || 'AssertionError: ' + a + ' == ' + b);\n};\n_assert.strictEqual = function(a, b, msg) {\n if (a !== b) throw new Error(msg || 'AssertionError: ' + a + ' !== ' + b);\n};\n_assert.notStrictEqual = function(a, b, msg) {\n if (a === b) throw new Error(msg || 'AssertionError: ' + a + ' === ' + b);\n};\n_assert.deepEqual = function(a, b, msg) {\n if (!_deepEqual(a, b)) throw new Error(msg || 'AssertionError: objects not deep equal');\n};\n_assert.deepStrictEqual = _assert.deepEqual;\n_assert.notDeepEqual = function(a, b, msg) {\n if (_deepEqual(a, b)) throw new Error(msg || 'AssertionError: objects are deep equal');\n};\n_assert.throws = function(fn, expected, msg) {\n var threw = false;\n try { fn(); } catch(e) {\n threw = true;\n if (expected instanceof RegExp && !expected.test(e.message))\n throw new Error(msg || 'AssertionError: error message did not match');\n }\n if (!threw) throw new Error(msg || 'AssertionError: function did not throw');\n};\n_assert.doesNotThrow = function(fn, msg) {\n // @banned-pattern-ignore: sandbox-internal assertion helper; e.message is from user code inside QuickJS, not host details\n try { fn(); } catch(e) {\n throw new Error(msg || 'AssertionError: function threw: ' + e.message);\n }\n};\n_assert.fail = function(msg) {\n throw new Error(msg || 'AssertionError: assert.fail()');\n};\nglobalThis[Symbol.for('jb:assert')] = _assert;\n";
|
|
15
|
+
/** Util module — format, inspect, promisify, types */
|
|
16
|
+
export declare const UTIL_MODULE_SOURCE = "\nvar _util = {\n format: function() {\n var args = Array.prototype.slice.call(arguments);\n if (args.length === 0) return '';\n var fmt = args[0];\n if (typeof fmt !== 'string') {\n return args.map(function(a) {\n return typeof a === 'string' ? a : JSON.stringify(a);\n }).join(' ');\n }\n var i = 1;\n var str = fmt.replace(/%[sdjifoO%]/g, function(m) {\n if (m === '%%') return '%';\n if (i >= args.length) return m;\n var v = args[i++];\n if (m === '%s') return String(v);\n if (m === '%d') return Number(v).toString();\n if (m === '%i') { var n = Number(v); return (isNaN(n) ? 'NaN' : Math.trunc(n)).toString(); }\n if (m === '%j') return JSON.stringify(v);\n if (m === '%f') return parseFloat(v).toString();\n if (m === '%o' || m === '%O') return JSON.stringify(v);\n return m;\n });\n while (i < args.length) {\n str += ' ' + (typeof args[i] === 'string' ? args[i] : JSON.stringify(args[i]));\n i++;\n }\n return str;\n },\n inspect: function(obj, opts) {\n if (obj === null) return 'null';\n if (obj === undefined) return 'undefined';\n if (typeof obj === 'string') return \"'\" + obj + \"'\";\n if (typeof obj === 'function') return '[Function: ' + (obj.name || 'anonymous') + ']';\n var seen = [];\n try {\n return JSON.stringify(obj, function(key, val) {\n if (typeof val === 'object' && val !== null) {\n if (seen.indexOf(val) !== -1) return '[Circular]';\n seen.push(val);\n }\n return val;\n });\n } catch(e) { return String(obj); }\n },\n promisify: function(fn) {\n return function() {\n var args = Array.prototype.slice.call(arguments);\n return new Promise(function(resolve, reject) {\n args.push(function(err, val) { if (err) reject(err); else resolve(val); });\n fn.apply(null, args);\n });\n };\n },\n types: {\n isDate: function(v) { return v instanceof Date; },\n isRegExp: function(v) { return v instanceof RegExp; },\n isArray: function(v) { return Array.isArray(v); },\n isMap: function(v) { return typeof Map !== 'undefined' && v instanceof Map; },\n isSet: function(v) { return typeof Set !== 'undefined' && v instanceof Set; }\n },\n inherits: function(ctor, superCtor) {\n ctor.prototype = Object.create(superCtor.prototype);\n ctor.prototype.constructor = ctor;\n }\n};\nglobalThis[Symbol.for('jb:util')] = _util;\n";
|
|
17
|
+
/** Buffer module — wraps Uint8Array, pure-JS UTF-8 (no TextEncoder/TextDecoder) */
|
|
18
|
+
export declare const BUFFER_MODULE_SOURCE = "\nfunction _utf8Encode(str) {\n var bytes = [];\n for (var i = 0; i < str.length; i++) {\n var c = str.charCodeAt(i);\n if (c < 0x80) {\n bytes.push(c);\n } else if (c < 0x800) {\n bytes.push(0xC0 | (c >> 6), 0x80 | (c & 0x3F));\n } else if (c >= 0xD800 && c <= 0xDBFF && i + 1 < str.length) {\n var lo = str.charCodeAt(++i);\n var cp = ((c - 0xD800) * 0x400) + (lo - 0xDC00) + 0x10000;\n bytes.push(0xF0 | (cp >> 18), 0x80 | ((cp >> 12) & 0x3F), 0x80 | ((cp >> 6) & 0x3F), 0x80 | (cp & 0x3F));\n } else {\n bytes.push(0xE0 | (c >> 12), 0x80 | ((c >> 6) & 0x3F), 0x80 | (c & 0x3F));\n }\n }\n return bytes;\n}\nfunction _utf8Decode(bytes) {\n var str = '';\n var i = 0;\n while (i < bytes.length) {\n var b = bytes[i];\n if (b < 0x80) { str += String.fromCharCode(b); i++; }\n else if ((b & 0xE0) === 0xC0) { str += String.fromCharCode(((b & 0x1F) << 6) | (bytes[i+1] & 0x3F)); i += 2; }\n else if ((b & 0xF0) === 0xE0) { str += String.fromCharCode(((b & 0x0F) << 12) | ((bytes[i+1] & 0x3F) << 6) | (bytes[i+2] & 0x3F)); i += 3; }\n else if ((b & 0xF8) === 0xF0) { var cp = ((b & 0x07) << 18) | ((bytes[i+1] & 0x3F) << 12) | ((bytes[i+2] & 0x3F) << 6) | (bytes[i+3] & 0x3F); cp -= 0x10000; str += String.fromCharCode((cp >> 10) + 0xD800, (cp & 0x3FF) + 0xDC00); i += 4; }\n else { i++; }\n }\n return str;\n}\n// _utf8Encode/_utf8Decode are IIFE-local vars, available to all module shims\n\nfunction Buffer(arg) {\n if (typeof arg === 'number') {\n this._data = new Uint8Array(arg);\n } else if (arg instanceof ArrayBuffer) {\n this._data = new Uint8Array(arg);\n } else if (arg instanceof Uint8Array) {\n this._data = new Uint8Array(arg);\n } else if (Array.isArray(arg)) {\n this._data = new Uint8Array(arg);\n } else {\n this._data = new Uint8Array(0);\n }\n this.length = this._data.length;\n}\nBuffer.from = function(data, encoding) {\n if (typeof data === 'string') {\n return new Buffer(_utf8Encode(data));\n }\n if (data instanceof ArrayBuffer) return new Buffer(data);\n if (data instanceof Uint8Array) return new Buffer(data);\n if (Array.isArray(data)) return new Buffer(data);\n if (data && data._data) return new Buffer(data._data.slice());\n return new Buffer(0);\n};\nBuffer.alloc = function(size, fill) {\n var buf = new Buffer(size);\n if (fill !== undefined) {\n var fillByte = typeof fill === 'number' ? fill : 0;\n buf._data.fill(fillByte);\n }\n return buf;\n};\nBuffer.allocUnsafe = Buffer.alloc;\nBuffer.isBuffer = function(obj) { return obj instanceof Buffer; };\nBuffer.concat = function(list, totalLength) {\n if (!totalLength) {\n totalLength = 0;\n for (var i = 0; i < list.length; i++) totalLength += list[i].length;\n }\n var result = new Uint8Array(totalLength);\n var offset = 0;\n for (var i = 0; i < list.length; i++) {\n result.set(list[i]._data, offset);\n offset += list[i].length;\n }\n return new Buffer(result);\n};\nBuffer.byteLength = function(str) {\n return _utf8Encode(str).length;\n};\nBuffer.prototype.toString = function(encoding) {\n return _utf8Decode(this._data);\n};\nBuffer.prototype.toJSON = function() {\n return { type: 'Buffer', data: Array.from(this._data) };\n};\nBuffer.prototype.slice = function(start, end) {\n return new Buffer(this._data.slice(start, end));\n};\nBuffer.prototype.copy = function(target, targetStart, sourceStart, sourceEnd) {\n targetStart = targetStart || 0;\n sourceStart = sourceStart || 0;\n sourceEnd = sourceEnd || this.length;\n var sub = this._data.subarray(sourceStart, sourceEnd);\n target._data.set(sub, targetStart);\n return sub.length;\n};\nBuffer.prototype.write = function(str, offset) {\n var bytes = _utf8Encode(str);\n offset = offset || 0;\n this._data.set(bytes, offset);\n return bytes.length;\n};\nBuffer.prototype.fill = function(val, offset, end) {\n this._data.fill(typeof val === 'number' ? val : 0, offset, end);\n return this;\n};\nBuffer.prototype.equals = function(other) {\n if (this.length !== other.length) return false;\n for (var i = 0; i < this.length; i++) {\n if (this._data[i] !== other._data[i]) return false;\n }\n return true;\n};\nBuffer.prototype.readUInt8 = function(offset) { return this._data[offset]; };\nBuffer.prototype.writeUInt8 = function(value, offset) { this._data[offset] = value; return offset + 1; };\nglobalThis[Symbol.for('jb:buffer')] = { Buffer: Buffer };\nglobalThis.Buffer = Buffer;\n";
|
|
19
|
+
/** Stream module — minimal stubs based on EventEmitter */
|
|
20
|
+
export declare const STREAM_MODULE_SOURCE = "\nvar _EE = globalThis[Symbol.for('jb:events')].EventEmitter;\n\nfunction Stream() { _EE.call(this); }\nStream.prototype = Object.create(_EE.prototype);\nStream.prototype.constructor = Stream;\nStream.prototype.pipe = function(dest) {\n this.on('data', function(chunk) { dest.write(chunk); });\n this.on('end', function() { if (dest.end) dest.end(); });\n return dest;\n};\n\nfunction Readable(opts) {\n Stream.call(this);\n this.readable = true;\n this._readableState = { ended: false, buffer: [] };\n}\nReadable.prototype = Object.create(Stream.prototype);\nReadable.prototype.constructor = Readable;\nReadable.prototype.read = function() { return null; };\nReadable.prototype.push = function(chunk) {\n if (chunk === null) { this._readableState.ended = true; this.emit('end'); return false; }\n this.emit('data', chunk);\n return true;\n};\nReadable.prototype.destroy = function() { this.emit('close'); return this; };\n\nfunction Writable(opts) {\n Stream.call(this);\n this.writable = true;\n this._writableState = { ended: false };\n}\nWritable.prototype = Object.create(Stream.prototype);\nWritable.prototype.constructor = Writable;\nWritable.prototype.write = function(chunk) { return true; };\nWritable.prototype.end = function(chunk) {\n if (chunk) this.write(chunk);\n this._writableState.ended = true;\n this.emit('finish');\n return this;\n};\nWritable.prototype.destroy = function() { this.emit('close'); return this; };\n\nfunction Duplex(opts) {\n Readable.call(this, opts);\n Writable.call(this, opts);\n}\nDuplex.prototype = Object.create(Readable.prototype);\nvar _wKeys = Object.keys(Writable.prototype);\nfor (var _wi = 0; _wi < _wKeys.length; _wi++) {\n if (!Duplex.prototype[_wKeys[_wi]]) Duplex.prototype[_wKeys[_wi]] = Writable.prototype[_wKeys[_wi]];\n}\nDuplex.prototype.constructor = Duplex;\n\nfunction Transform(opts) { Duplex.call(this, opts); }\nTransform.prototype = Object.create(Duplex.prototype);\nTransform.prototype.constructor = Transform;\nTransform.prototype._transform = function(chunk, encoding, cb) { if (cb) cb(null, chunk); };\n\nfunction PassThrough(opts) { Transform.call(this, opts); }\nPassThrough.prototype = Object.create(Transform.prototype);\nPassThrough.prototype.constructor = PassThrough;\n\nfunction pipeline() {\n var streams = Array.prototype.slice.call(arguments);\n var cb = typeof streams[streams.length - 1] === 'function' ? streams.pop() : null;\n for (var i = 0; i < streams.length - 1; i++) streams[i].pipe(streams[i + 1]);\n if (cb) {\n var last = streams[streams.length - 1];\n last.on('finish', function() { cb(null); });\n last.on('error', function(e) { cb(e); });\n }\n return streams[streams.length - 1];\n}\n\nglobalThis[Symbol.for('jb:stream')] = {\n Stream: Stream, Readable: Readable, Writable: Writable,\n Duplex: Duplex, Transform: Transform, PassThrough: PassThrough,\n pipeline: pipeline\n};\n";
|
|
21
|
+
/** StringDecoder module — uses _utf8Decode from Buffer shim */
|
|
22
|
+
export declare const STRING_DECODER_MODULE_SOURCE = "\nfunction StringDecoder(encoding) {\n this.encoding = (encoding || 'utf-8').toLowerCase();\n if (this.encoding === 'utf8') this.encoding = 'utf-8';\n}\nStringDecoder.prototype.write = function(buf) {\n if (typeof buf === 'string') return buf;\n var data = buf instanceof Uint8Array ? buf : (buf && buf._data ? buf._data : new Uint8Array(0));\n return _utf8Decode(data);\n};\nStringDecoder.prototype.end = function(buf) {\n if (buf) return this.write(buf);\n return '';\n};\nglobalThis[Symbol.for('jb:string_decoder')] = { StringDecoder: StringDecoder };\n";
|
|
23
|
+
/** Querystring module — pure JS */
|
|
24
|
+
export declare const QUERYSTRING_MODULE_SOURCE = "\nvar _qs = {\n parse: function(str, sep, eq) {\n sep = sep || '&'; eq = eq || '=';\n var result = Object.create(null);\n if (!str || typeof str !== 'string') return result;\n var pairs = str.split(sep);\n for (var i = 0; i < pairs.length; i++) {\n var idx = pairs[i].indexOf(eq);\n var key, val;\n if (idx >= 0) {\n key = decodeURIComponent(pairs[i].slice(0, idx).replace(/\\+/g, ' '));\n val = decodeURIComponent(pairs[i].slice(idx + 1).replace(/\\+/g, ' '));\n } else {\n key = decodeURIComponent(pairs[i].replace(/\\+/g, ' '));\n val = '';\n }\n if (result[key] !== undefined) {\n if (Array.isArray(result[key])) result[key].push(val);\n else result[key] = [result[key], val];\n } else {\n result[key] = val;\n }\n }\n return result;\n },\n stringify: function(obj, sep, eq) {\n sep = sep || '&'; eq = eq || '=';\n var pairs = [];\n var keys = Object.keys(obj);\n for (var i = 0; i < keys.length; i++) {\n var key = keys[i];\n var val = obj[key];\n if (Array.isArray(val)) {\n for (var j = 0; j < val.length; j++) {\n pairs.push(encodeURIComponent(key) + eq + encodeURIComponent(val[j]));\n }\n } else {\n pairs.push(encodeURIComponent(key) + eq + encodeURIComponent(val));\n }\n }\n return pairs.join(sep);\n },\n escape: function(str) { return encodeURIComponent(str); },\n unescape: function(str) { return decodeURIComponent(str); }\n};\n_qs.decode = _qs.parse;\n_qs.encode = _qs.stringify;\nglobalThis[Symbol.for('jb:querystring')] = _qs;\n";
|
|
25
|
+
/**
|
|
26
|
+
* Unsupported Node.js modules — throw clear error at require/import time.
|
|
27
|
+
* Map of module name to hint message.
|
|
28
|
+
*/
|
|
29
|
+
export declare const UNSUPPORTED_MODULES: Record<string, string>;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Pure-JS POSIX path module source for QuickJS.
|
|
3
|
+
* Exported as a string constant to be evaluated inside the sandbox.
|
|
4
|
+
* Wrapped in an IIFE to avoid name conflicts with module-level exports.
|
|
5
|
+
*/
|
|
6
|
+
export declare const PATH_MODULE_SOURCE = "\n(function() {\n var sep = '/';\n var delimiter = ':';\n\n function normalize(p) {\n if (p === '') return '.';\n var isAbs = p.charCodeAt(0) === 47;\n var trailingSlash = p.charCodeAt(p.length - 1) === 47;\n var parts = p.split('/');\n var out = [];\n for (var i = 0; i < parts.length; i++) {\n var seg = parts[i];\n if (seg === '' || seg === '.') continue;\n if (seg === '..') {\n if (out.length > 0 && out[out.length - 1] !== '..') out.pop();\n else if (!isAbs) out.push('..');\n } else {\n out.push(seg);\n }\n }\n var result = out.join('/');\n if (isAbs) result = '/' + result;\n if (trailingSlash && result[result.length - 1] !== '/') result += '/';\n return result || (isAbs ? '/' : '.');\n }\n\n function join() {\n var joined = '';\n for (var i = 0; i < arguments.length; i++) {\n var arg = arguments[i];\n if (typeof arg !== 'string') throw new TypeError('Path must be a string');\n if (arg.length > 0) {\n if (joined.length > 0) joined += '/' + arg;\n else joined = arg;\n }\n }\n if (joined.length === 0) return '.';\n return normalize(joined);\n }\n\n function resolve() {\n var resolved = '';\n var resolvedAbsolute = false;\n for (var i = arguments.length - 1; i >= -1 && !resolvedAbsolute; i--) {\n var path = i >= 0 ? arguments[i] : globalThis.process.cwd();\n if (typeof path !== 'string') throw new TypeError('Path must be a string');\n if (path.length === 0) continue;\n if (resolved.length > 0) resolved = path + '/' + resolved;\n else resolved = path;\n resolvedAbsolute = path.charCodeAt(0) === 47;\n }\n resolved = normalize(resolved);\n if (resolvedAbsolute) return '/' + resolved.replace(/^\\/+/, '');\n return resolved.length > 0 ? resolved : '.';\n }\n\n function isAbsolute(p) {\n return typeof p === 'string' && p.length > 0 && p.charCodeAt(0) === 47;\n }\n\n function dirname(p) {\n if (p.length === 0) return '.';\n var hasRoot = p.charCodeAt(0) === 47;\n var end = -1;\n for (var i = p.length - 1; i >= 1; i--) {\n if (p.charCodeAt(i) === 47) { end = i; break; }\n }\n if (end === -1) return hasRoot ? '/' : '.';\n if (hasRoot && end === 0) return '/';\n return p.slice(0, end);\n }\n\n function basename(p, ext) {\n var start = 0;\n for (var i = p.length - 1; i >= 0; i--) {\n if (p.charCodeAt(i) === 47) { start = i + 1; break; }\n }\n var base = p.slice(start);\n if (ext && base.endsWith(ext)) {\n base = base.slice(0, base.length - ext.length);\n }\n return base;\n }\n\n function extname(p) {\n var startDot = -1;\n var startPart = 0;\n for (var i = p.length - 1; i >= 0; i--) {\n var code = p.charCodeAt(i);\n if (code === 47) { startPart = i + 1; break; }\n if (code === 46 && startDot === -1) startDot = i;\n }\n if (startDot === -1 || startDot === startPart ||\n (startDot === startPart + 1 && p.charCodeAt(startPart) === 46)) {\n return '';\n }\n return p.slice(startDot);\n }\n\n function relative(from, to) {\n if (from === to) return '';\n from = resolve(from);\n to = resolve(to);\n if (from === to) return '';\n var fromParts = from.split('/').filter(Boolean);\n var toParts = to.split('/').filter(Boolean);\n var common = 0;\n var length = Math.min(fromParts.length, toParts.length);\n for (var i = 0; i < length; i++) {\n if (fromParts[i] !== toParts[i]) break;\n common++;\n }\n var ups = [];\n for (var i = common; i < fromParts.length; i++) ups.push('..');\n return ups.concat(toParts.slice(common)).join('/') || '.';\n }\n\n function parse(p) {\n var root = p.charCodeAt(0) === 47 ? '/' : '';\n var dir = dirname(p);\n var base = basename(p);\n var ext = extname(p);\n var name = ext ? base.slice(0, base.length - ext.length) : base;\n return { root: root, dir: dir, base: base, ext: ext, name: name };\n }\n\n function format(obj) {\n var dir = obj.dir || obj.root || '';\n var base = obj.base || ((obj.name || '') + (obj.ext || ''));\n if (!dir) return base;\n if (dir === obj.root) return dir + base;\n return dir + '/' + base;\n }\n\n var posix = { sep: sep, delimiter: delimiter, join: join, resolve: resolve, normalize: normalize, isAbsolute: isAbsolute, dirname: dirname, basename: basename, extname: extname, relative: relative, parse: parse, format: format };\n posix.posix = posix;\n\n globalThis[Symbol.for('jb:path')] = posix;\n})();\n";
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared checksum utilities for md5sum, sha1sum, sha256sum
|
|
3
|
+
* Uses WebCrypto API for SHA algorithms, pure JS for MD5
|
|
4
|
+
*/
|
|
5
|
+
import type { Command } from "../../types.js";
|
|
6
|
+
export type HashAlgorithm = "md5" | "sha1" | "sha256";
|
|
7
|
+
export declare function createChecksumCommand(name: string, algorithm: HashAlgorithm, summary: string): Command;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* nl - number lines of files
|
|
3
|
+
*
|
|
4
|
+
* Usage: nl [OPTION]... [FILE]...
|
|
5
|
+
*
|
|
6
|
+
* Write each FILE to standard output, with line numbers added.
|
|
7
|
+
* If no FILE is specified, standard input is read.
|
|
8
|
+
*/
|
|
9
|
+
import type { Command } from "../../types.js";
|
|
10
|
+
export declare const nl: Command;
|
|
11
|
+
import type { CommandFuzzInfo } from "../fuzz-flags-types.js";
|
|
12
|
+
export declare const flagsForFuzzing: CommandFuzzInfo;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* od - dump files in octal and other formats
|
|
3
|
+
*
|
|
4
|
+
* Usage: od [OPTION]... [FILE]...
|
|
5
|
+
*
|
|
6
|
+
* Write an unambiguous representation, octal bytes by default,
|
|
7
|
+
* of FILE to standard output.
|
|
8
|
+
*/
|
|
9
|
+
import type { Command } from "../../types.js";
|
|
10
|
+
export declare const od: Command;
|
|
11
|
+
import type { CommandFuzzInfo } from "../fuzz-flags-types.js";
|
|
12
|
+
export declare const flagsForFuzzing: CommandFuzzInfo;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared escape sequence and formatting utilities
|
|
3
|
+
* Used by printf command and find -printf
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* Apply width and alignment to a string value
|
|
7
|
+
* Supports: width (right-justify), -width (left-justify), .precision (truncate)
|
|
8
|
+
* @param value - The string value to format
|
|
9
|
+
* @param width - The field width (negative for left-justify)
|
|
10
|
+
* @param precision - Maximum length (-1 for no limit)
|
|
11
|
+
*/
|
|
12
|
+
export declare function applyWidth(value: string, width: number, precision: number): string;
|
|
13
|
+
/**
|
|
14
|
+
* Parse a width/precision spec from a format directive
|
|
15
|
+
* Returns: [width, precision, charsConsumed]
|
|
16
|
+
* width: positive for right-justify, negative for left-justify
|
|
17
|
+
* precision: -1 if not specified
|
|
18
|
+
*/
|
|
19
|
+
export declare function parseWidthPrecision(format: string, startIndex: number): [number, number, number];
|
|
20
|
+
/**
|
|
21
|
+
* Process escape sequences in a string
|
|
22
|
+
* Handles: \n, \t, \r, \\, \a, \b, \f, \v, \e, \0NNN (octal), \xHH (hex),
|
|
23
|
+
* \uHHHH (unicode), \UHHHHHHHH (unicode)
|
|
24
|
+
*/
|
|
25
|
+
export declare function processEscapes(str: string): string;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Strftime Formatting Functions
|
|
3
|
+
*
|
|
4
|
+
* Handles date/time formatting for printf's %(...)T directive.
|
|
5
|
+
*/
|
|
6
|
+
/**
|
|
7
|
+
* Format a timestamp using strftime-like format string.
|
|
8
|
+
*/
|
|
9
|
+
export declare function formatStrftime(format: string, timestamp: number, tz?: string): string;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* python3 - Execute Python code via CPython Emscripten (Python in WebAssembly)
|
|
3
|
+
*
|
|
4
|
+
* Runs Python code in an isolated worker thread with access to the
|
|
5
|
+
* virtual filesystem via SharedArrayBuffer bridge.
|
|
6
|
+
*
|
|
7
|
+
* Security: CPython Emscripten has zero JS bridge code. `import js` fails
|
|
8
|
+
* with ModuleNotFoundError. No sandbox needed — isolation by construction.
|
|
9
|
+
*
|
|
10
|
+
* This command is Node.js only (uses worker_threads).
|
|
11
|
+
*/
|
|
12
|
+
import type { Command } from "../../types.js";
|
|
13
|
+
/** @internal Reset queue state — for tests only */
|
|
14
|
+
export declare function _resetExecutionQueue(): void;
|
|
15
|
+
export declare const python3Command: Command;
|
|
16
|
+
export declare const pythonCommand: Command;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Worker thread for Python execution via CPython Emscripten.
|
|
3
|
+
* Creates a fresh CPython WASM instance per execution (EXIT_RUNTIME).
|
|
4
|
+
*
|
|
5
|
+
* Security model: CPython Emscripten has zero JS bridge code.
|
|
6
|
+
* `import js` fails with `ModuleNotFoundError` — the module doesn't exist.
|
|
7
|
+
* `os.system()` is patched to no-op at Emscripten level.
|
|
8
|
+
* No sandbox code needed — isolation is by construction.
|
|
9
|
+
*
|
|
10
|
+
* Defense-in-depth activates BEFORE CPython loads to block dangerous Node.js APIs.
|
|
11
|
+
*/
|
|
12
|
+
import { type WorkerDefenseStats } from "../../security/index.js";
|
|
13
|
+
export interface WorkerInput {
|
|
14
|
+
protocolToken: string;
|
|
15
|
+
sharedBuffer: SharedArrayBuffer;
|
|
16
|
+
pythonCode: string;
|
|
17
|
+
cwd: string;
|
|
18
|
+
env: Record<string, string>;
|
|
19
|
+
args: string[];
|
|
20
|
+
scriptPath?: string;
|
|
21
|
+
timeoutMs?: number;
|
|
22
|
+
}
|
|
23
|
+
export interface WorkerOutput {
|
|
24
|
+
success: boolean;
|
|
25
|
+
error?: string;
|
|
26
|
+
/** Defense-in-depth stats if enabled */
|
|
27
|
+
defenseStats?: WorkerDefenseStats;
|
|
28
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Array-related jq builtins
|
|
3
|
+
*
|
|
4
|
+
* Handles array manipulation functions like sort, sort_by, group_by, max, min, add, etc.
|
|
5
|
+
*/
|
|
6
|
+
import type { EvalContext } from "../evaluator.js";
|
|
7
|
+
import type { AstNode } from "../parser.js";
|
|
8
|
+
import type { QueryValue } from "../value-operations.js";
|
|
9
|
+
type EvalFn = (value: QueryValue, ast: AstNode, ctx: EvalContext) => QueryValue[];
|
|
10
|
+
type EvalWithPartialFn = (value: QueryValue, ast: AstNode, ctx: EvalContext) => QueryValue[];
|
|
11
|
+
type CompareFn = (a: QueryValue, b: QueryValue) => number;
|
|
12
|
+
type IsTruthyFn = (v: QueryValue) => boolean;
|
|
13
|
+
type ContainsDeepFn = (a: QueryValue, b: QueryValue) => boolean;
|
|
14
|
+
type ExecutionLimitErrorClass = new (message: string, kind: "recursion" | "commands" | "iterations") => Error;
|
|
15
|
+
/**
|
|
16
|
+
* Handle array builtins that need evaluate function for arguments.
|
|
17
|
+
* Returns null if the builtin name is not an array builtin handled here.
|
|
18
|
+
*/
|
|
19
|
+
export declare function evalArrayBuiltin(value: QueryValue, name: string, args: AstNode[], ctx: EvalContext, evaluate: EvalFn, evaluateWithPartialResults: EvalWithPartialFn, compareJq: CompareFn, isTruthy: IsTruthyFn, containsDeep: ContainsDeepFn, ExecutionLimitError: ExecutionLimitErrorClass): QueryValue[] | null;
|
|
20
|
+
export {};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Control flow jq builtins
|
|
3
|
+
*
|
|
4
|
+
* Handles first, last, nth, range, limit, isempty, isvalid, skip, until, while, repeat.
|
|
5
|
+
*/
|
|
6
|
+
import type { EvalContext } from "../evaluator.js";
|
|
7
|
+
import type { AstNode } from "../parser.js";
|
|
8
|
+
import type { QueryValue } from "../value-operations.js";
|
|
9
|
+
type EvalFn = (value: QueryValue, ast: AstNode, ctx: EvalContext) => QueryValue[];
|
|
10
|
+
type EvalWithPartialFn = (value: QueryValue, ast: AstNode, ctx: EvalContext) => QueryValue[];
|
|
11
|
+
type IsTruthyFn = (v: QueryValue) => boolean;
|
|
12
|
+
type ExecutionLimitErrorClass = new (message: string, kind: "recursion" | "commands" | "iterations") => Error;
|
|
13
|
+
/**
|
|
14
|
+
* Handle control flow builtins.
|
|
15
|
+
* Returns null if the builtin name is not a control builtin handled here.
|
|
16
|
+
*/
|
|
17
|
+
export declare function evalControlBuiltin(value: QueryValue, name: string, args: AstNode[], ctx: EvalContext, evaluate: EvalFn, evaluateWithPartialResults: EvalWithPartialFn, isTruthy: IsTruthyFn, ExecutionLimitError: ExecutionLimitErrorClass): QueryValue[] | null;
|
|
18
|
+
export {};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Date/time-related jq builtins
|
|
3
|
+
*
|
|
4
|
+
* Handles date and time functions like now, gmtime, mktime, strftime, strptime, etc.
|
|
5
|
+
*/
|
|
6
|
+
import type { EvalContext } from "../evaluator.js";
|
|
7
|
+
import type { AstNode } from "../parser.js";
|
|
8
|
+
import type { QueryValue } from "../value-operations.js";
|
|
9
|
+
type EvalFn = (value: QueryValue, ast: AstNode, ctx: EvalContext) => QueryValue[];
|
|
10
|
+
/**
|
|
11
|
+
* Handle date builtins that need evaluate function for arguments.
|
|
12
|
+
* Returns null if the builtin name is not a date builtin handled here.
|
|
13
|
+
*/
|
|
14
|
+
export declare function evalDateBuiltin(value: QueryValue, name: string, args: AstNode[], ctx: EvalContext, evaluate: EvalFn): QueryValue[] | null;
|
|
15
|
+
export {};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Format-related jq builtins (@ prefixed)
|
|
3
|
+
*
|
|
4
|
+
* Handles encoding/formatting functions like @base64, @uri, @csv, @json, etc.
|
|
5
|
+
*/
|
|
6
|
+
import type { QueryValue } from "../value-operations.js";
|
|
7
|
+
/**
|
|
8
|
+
* Handle format builtins (those starting with @).
|
|
9
|
+
* Returns null if the builtin name is not a format builtin handled here.
|
|
10
|
+
*/
|
|
11
|
+
export declare function evalFormatBuiltin(value: QueryValue, name: string, maxDepth?: number): QueryValue[] | null;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Index-related jq builtins
|
|
3
|
+
*
|
|
4
|
+
* Handles index, rindex, and indices functions for finding positions in arrays/strings.
|
|
5
|
+
*/
|
|
6
|
+
import type { EvalContext } from "../evaluator.js";
|
|
7
|
+
import type { AstNode } from "../parser.js";
|
|
8
|
+
import type { QueryValue } from "../value-operations.js";
|
|
9
|
+
type EvalFn = (value: QueryValue, ast: AstNode, ctx: EvalContext) => QueryValue[];
|
|
10
|
+
type DeepEqualFn = (a: QueryValue, b: QueryValue) => boolean;
|
|
11
|
+
/**
|
|
12
|
+
* Handle index builtins that need evaluate function for arguments.
|
|
13
|
+
* Returns null if the builtin name is not an index builtin handled here.
|
|
14
|
+
*/
|
|
15
|
+
export declare function evalIndexBuiltin(value: QueryValue, name: string, args: AstNode[], ctx: EvalContext, evaluate: EvalFn, deepEqual: DeepEqualFn): QueryValue[] | null;
|
|
16
|
+
export {};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* jq builtin functions index
|
|
3
|
+
*
|
|
4
|
+
* Re-exports all builtin handlers from category-specific modules.
|
|
5
|
+
*/
|
|
6
|
+
export { evalArrayBuiltin } from "./array-builtins.js";
|
|
7
|
+
export { evalControlBuiltin } from "./control-builtins.js";
|
|
8
|
+
export { evalDateBuiltin } from "./date-builtins.js";
|
|
9
|
+
export { evalFormatBuiltin } from "./format-builtins.js";
|
|
10
|
+
export { evalIndexBuiltin } from "./index-builtins.js";
|
|
11
|
+
export { evalMathBuiltin } from "./math-builtins.js";
|
|
12
|
+
export { evalNavigationBuiltin } from "./navigation-builtins.js";
|
|
13
|
+
export { evalObjectBuiltin } from "./object-builtins.js";
|
|
14
|
+
export { evalPathBuiltin } from "./path-builtins.js";
|
|
15
|
+
export { evalSqlBuiltin } from "./sql-builtins.js";
|
|
16
|
+
export { evalStringBuiltin } from "./string-builtins.js";
|
|
17
|
+
export { evalTypeBuiltin } from "./type-builtins.js";
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Math-related jq builtins
|
|
3
|
+
*
|
|
4
|
+
* Handles mathematical functions like abs, pow, exp, trig functions, etc.
|
|
5
|
+
*/
|
|
6
|
+
import type { EvalContext } from "../evaluator.js";
|
|
7
|
+
import type { AstNode } from "../parser.js";
|
|
8
|
+
import type { QueryValue } from "../value-operations.js";
|
|
9
|
+
type EvalFn = (value: QueryValue, ast: AstNode, ctx: EvalContext) => QueryValue[];
|
|
10
|
+
/**
|
|
11
|
+
* Handle math builtins that need evaluate function for arguments.
|
|
12
|
+
* Returns null if the builtin name is not a math builtin handled here.
|
|
13
|
+
*/
|
|
14
|
+
export declare function evalMathBuiltin(value: QueryValue, name: string, args: AstNode[], ctx: EvalContext, evaluate: EvalFn): QueryValue[] | null;
|
|
15
|
+
export {};
|