@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,2 @@
|
|
|
1
|
+
import{createRequire} from"node:module";const require=createRequire(import.meta.url);
|
|
2
|
+
var i=new TextDecoder("utf-8",{fatal:!0}),d=new TextEncoder;function y(t){return t}function a(t){return t}function x(t){let e=t;if(!e)return e;let n=!1;for(let r=0;r<e.length;r++){let u=e.charCodeAt(r);if(u>255)return e;u>127&&(n=!0)}if(!n)return e;let o=new Uint8Array(e.length);for(let r=0;r<e.length;r++)o[r]=e.charCodeAt(r);try{return i.decode(o)}catch{return e}}function c(t){if(!t)return t;let e=d.encode(t),n="";for(let o=0;o<e.length;o++)n+=String.fromCharCode(e[o]);return n}var l="";function f(t){let e="";for(let n=0;n<t.length;n++)e+=String.fromCharCode(t[n]);return e}async function p(t,e){return typeof t.readFileBytes=="function"?t.readFileBytes(e):f(await t.readFileBuffer(e))}function s(t){return t.stdoutKind?t.stdoutKind:t.stdoutEncoding==="binary"?"bytes":"text"}function h(t){return s(t)==="bytes"?t.stdout:c(t.stdout)}function B(t){return{stdout:t,stdoutKind:"text"}}function g(t){return{stdout:t,stdoutKind:"bytes",stdoutEncoding:"binary"}}export{y as a,a as b,x as c,c as d,l as e,p as f,s as g,h,B as i,g as j};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{createRequire} from"node:module";const require=createRequire(import.meta.url);
|
|
2
|
+
import{a as n,b as i,c as r}from"./chunk-SO6R3ZKN.js";import{a,b as s}from"./chunk-QAYAQNCG.js";var f={name:"head",summary:"output the first part of files",usage:"head [OPTION]... [FILE]...",options:["-c, --bytes=NUM print the first NUM bytes","-n, --lines=NUM print the first NUM lines (default 10)","-q, --quiet never print headers giving file names","-v, --verbose always print headers giving file names"," --help display this help and exit"]},m={name:"head",async execute(t,l){if(s(t))return a(f);let e=n(t,"head");if(!e.ok)return e.error;let{lines:o,bytes:p}=e.options;return i(l,e.options,"head",d=>r(d,o,p))}},g={name:"head",flags:[{flag:"-n",type:"value",valueHint:"number"},{flag:"-c",type:"value",valueHint:"number"},{flag:"-q",type:"boolean"},{flag:"-v",type:"boolean"}],stdinType:"text",needsFiles:!0};export{m as a,g as b};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import{createRequire} from"node:module";const require=createRequire(import.meta.url);
|
|
2
|
+
async function c(e,t){if(e.length>0&&e[0]!=="-"){let i=t.fs.resolvePath(t.cwd,e[0]);try{let o=(await t.fs.readFile(i)).split(`
|
|
3
|
+
`);o[o.length-1]===""&&o.pop();let r=o.reverse();return{stdout:r.length>0?`${r.join(`
|
|
4
|
+
`)}
|
|
5
|
+
`:"",stderr:"",exitCode:0}}catch{return{stdout:"",stderr:`tac: ${e[0]}: No such file or directory
|
|
6
|
+
`,exitCode:1}}}let n=t.stdin.split(`
|
|
7
|
+
`);n[n.length-1]===""&&n.pop();let s=n.reverse();return{stdout:s.length>0?`${s.join(`
|
|
8
|
+
`)}
|
|
9
|
+
`:"",stderr:"",exitCode:0}}var u={name:"tac",execute:c},f={name:"tac",flags:[],stdinType:"text",needsFiles:!0};export{u as a,f as b};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import{createRequire} from"node:module";const require=createRequire(import.meta.url);
|
|
2
|
+
import{c as y}from"./chunk-NRSASXYY.js";import{a as C}from"./chunk-QIQMJJZ4.js";import{a as F,b as x}from"./chunk-QAYAQNCG.js";var H={name:"column",summary:"columnate lists",usage:"column [OPTION]... [FILE]...",description:"Format input into multiple columns. By default, fills rows first. Use -t to create a table based on whitespace-delimited input.",options:["-t Create a table (determine columns from input)","-s SEP Input field delimiter (default: whitespace)","-o SEP Output field delimiter (default: two spaces)","-c WIDTH Output width for fill mode (default: 80)","-n Don't merge multiple adjacent delimiters"],examples:["ls | column # Fill columns with ls output","cat data | column -t # Format as table","column -t -s ',' file # Format CSV as table","column -c 40 file # Fill 40-char wide columns"]},I={table:{short:"t",long:"table",type:"boolean"},separator:{short:"s",type:"string"},outputSep:{short:"o",type:"string"},width:{short:"c",type:"number",default:80},noMerge:{short:"n",type:"boolean"}};function v(t,e,o){return e?o?t.split(e):t.split(e).filter(n=>n.length>0):o?t.split(/[ \t]/):t.split(/[ \t]+/).filter(n=>n.length>0)}function T(t){let e=[];for(let o of t)for(let n=0;n<o.length;n++){let l=o[n].length;(e[n]===void 0||l>e[n])&&(e[n]=l)}return e}function W(t,e){if(t.length===0)return"";let o=T(t),n=[];for(let l of t){let c=[];for(let s=0;s<l.length;s++)s===l.length-1?c.push(l[s]):c.push(l[s].padEnd(o[s]));n.push(c.join(e))}return n.join(`
|
|
3
|
+
`)}function j(t,e,o){if(t.length===0)return"";let n=Math.max(...t.map(a=>a.length)),l=o.length,c=n+l,s=Math.max(1,Math.floor((e+l)/c)),p=Math.ceil(t.length/s),d=[];for(let a=0;a<p;a++){let i=[];for(let r=0;r<s;r++){let m=r*p+a;m<t.length&&(r===s-1||(r+1)*p+a>=t.length?i.push(t[m]):i.push(t[m].padEnd(n)))}d.push(i.join(o))}return d.join(`
|
|
4
|
+
`)}var S={name:"column",execute:async(t,e)=>{if(x(t))return F(H);let o=C("column",t,I);if(!o.ok)return o.error;let{table:n,separator:l,outputSep:c,width:s,noMerge:p}=o.result.flags,d=o.result.positional,a=c??" ",i;if(d.length===0)i=y(e.stdin)??"";else{let u=[];for(let f of d)if(f==="-")u.push(y(e.stdin)??"");else{let w=e.fs.resolvePath(e.cwd,f),b=await e.fs.readFile(w);if(b===null)return{exitCode:1,stdout:"",stderr:`column: ${f}: No such file or directory
|
|
5
|
+
`};u.push(b)}i=u.join("")}if(i===""||i.trim()==="")return{exitCode:0,stdout:"",stderr:""};let r=i.split(`
|
|
6
|
+
`);i.endsWith(`
|
|
7
|
+
`)&&r[r.length-1]===""&&r.pop();let g=r.filter(u=>u.trim().length>0),h;if(n){let u=g.map(f=>v(f,l,p));h=W(u,a)}else{let u=[];for(let f of g){let w=v(f,l,p);u.push(...w)}h=j(u,s,a)}return h.length>0&&(h+=`
|
|
8
|
+
`),{exitCode:0,stdout:h,stderr:""}}},L={name:"column",flags:[{flag:"-t",type:"boolean"},{flag:"-s",type:"value",valueHint:"delimiter"},{flag:"-o",type:"value",valueHint:"string"},{flag:"-c",type:"value",valueHint:"number"},{flag:"-n",type:"boolean"}],stdinType:"text",needsFiles:!0};export{S as a,L as b};
|
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
import{createRequire} from"node:module";const require=createRequire(import.meta.url);
|
|
2
|
+
import{a as F,b,c as M,d as He,e as w,f as v,g as Y,h as Z}from"./chunk-VPADYNBD.js";import{a as st}from"./chunk-4I3HOE5Z.js";import{a as $}from"./chunk-LEKBROJD.js";import{f as qe,g as X}from"./chunk-4WKZNNJK.js";import{a as J}from"./chunk-4RUAZWKT.js";import{a as _e}from"./chunk-YCLFEX4T.js";import{c as _}from"./chunk-NRSASXYY.js";import{a as D,b as G}from"./chunk-QAYAQNCG.js";import{b as We,d as et,e as tt,f as nt}from"./chunk-BZUGFHVS.js";var q,Je=We(()=>{"use strict";q=class{input;pos=0;tokens=[];constructor(n){this.input=n}tokenize(){for(;this.pos<this.input.length&&(this.skipWhitespace(),!(this.pos>=this.input.length));){let n=this.nextToken();n&&this.tokens.push(n)}return this.tokens.push({type:"eof",value:"",pos:this.pos}),this.tokens}skipWhitespace(){for(;this.pos<this.input.length;){let n=this.input[this.pos];if(n===" "||n===" "||n===`
|
|
3
|
+
`||n==="\r")this.pos++;else if(n==="#")for(;this.pos<this.input.length&&this.input[this.pos]!==`
|
|
4
|
+
`;)this.pos++;else break}}nextToken(){let n=this.pos,t=this.input[this.pos];if(t>="0"&&t<="9")return this.readNumber();if(t==='"'||t==="'"||t==="`")return this.readString(t);if(t==="b"&&this.pos+1<this.input.length){let o=this.input[this.pos+1];if(o==='"'||o==="'"||o==="`")return this.pos++,this.readString(o)}if(t==="/"){let o=this.tokens[this.tokens.length-1];return o&&(o.type==="int"||o.type==="float"||o.type==="string"||o.type==="ident"||o.type===")"||o.type==="]")?this.input[this.pos+1]==="/"?(this.pos+=2,{type:"//",value:"//",pos:n}):(this.pos++,{type:"/",value:"/",pos:n}):this.readRegex()}if(this.match("not in"))return{type:"not in",value:"not in",pos:n};if(this.match("=>"))return{type:"=>",value:"=>",pos:n};if(this.match("**"))return{type:"**",value:"**",pos:n};if(this.match("++"))return{type:"++",value:"++",pos:n};if(this.match("//"))return{type:"//",value:"//",pos:n};if(this.match("=="))return{type:"==",value:"==",pos:n};if(this.match("!="))return{type:"!=",value:"!=",pos:n};if(this.match("<="))return{type:"<=",value:"<=",pos:n};if(this.match(">="))return{type:">=",value:">=",pos:n};if(this.match("&&"))return{type:"&&",value:"&&",pos:n};if(this.match("||"))return{type:"||",value:"||",pos:n};let r=new Map([["(","("],[")",")"],["[","["],["]","]"],["{","{"],["}","}"],[",",","],[":",":"],[";",";"],["+","+"],["-","-"],["*","*"],["%","%"],["<","<"],[">",">"],["!","!"],[".","."],["|","|"],["=","="]]).get(t);if(r!==void 0)return this.pos++,{type:r,value:t,pos:n};if(this.isIdentStart(t))return this.readIdentifier();throw new Error(`Unexpected character '${t}' at position ${this.pos}`)}match(n){if(this.input.slice(this.pos,this.pos+n.length)===n){if(/^[a-zA-Z]/.test(n)){let t=this.input[this.pos+n.length];if(t&&this.isIdentChar(t))return!1}return this.pos+=n.length,!0}return!1}isIdentStart(n){return n>="a"&&n<="z"||n>="A"&&n<="Z"||n==="_"}isIdentChar(n){return this.isIdentStart(n)||n>="0"&&n<="9"}readNumber(){let n=this.pos,t=!1,s=!1;for(;this.pos<this.input.length;){let o=this.input[this.pos];if(o>="0"&&o<="9")this.pos++;else if(o==="_")this.pos++;else if(o==="."&&!t&&!s)t=!0,this.pos++;else if((o==="e"||o==="E")&&!s)s=!0,t=!0,this.pos++,this.pos<this.input.length&&(this.input[this.pos]==="+"||this.input[this.pos]==="-")&&this.pos++;else break}let r=this.input.slice(n,this.pos).replace(/_/g,"");return{type:t?"float":"int",value:r,pos:n}}readString(n){let t=this.pos;this.pos++;let s="";for(;this.pos<this.input.length;){let r=this.input[this.pos];if(r===n)return this.pos++,{type:"string",value:s,pos:t};if(r==="\\"){if(this.pos++,this.pos<this.input.length){let o=this.input[this.pos];switch(o){case"n":s+=`
|
|
5
|
+
`;break;case"r":s+="\r";break;case"t":s+=" ";break;case"\\":s+="\\";break;case'"':s+='"';break;case"'":s+="'";break;case"`":s+="`";break;case"0":s+="\0";break;default:s+=o}this.pos++}}else s+=r,this.pos++}throw new Error(`Unterminated string starting at position ${t}`)}readRegex(){let n=this.pos;this.pos++;let t="",s="";for(;this.pos<this.input.length;){let r=this.input[this.pos];if(r==="/"){for(this.pos++;this.pos<this.input.length&&this.input[this.pos]==="i";)s+=this.input[this.pos],this.pos++;return{type:"regex",value:t+(s?`/${s}`:""),pos:n}}r==="\\"?(t+=r,this.pos++,this.pos<this.input.length&&(t+=this.input[this.pos],this.pos++)):(t+=r,this.pos++)}throw new Error(`Unterminated regex starting at position ${n}`)}readIdentifier(){let n=this.pos;for(;this.pos<this.input.length&&this.isIdentChar(this.input[this.pos]);)this.pos++;let t=!1;this.pos<this.input.length&&this.input[this.pos]==="?"&&(t=!0,this.pos++);let s=this.input.slice(n,t?this.pos-1:this.pos);t&&(s+="?");let r=new Map([["true","true"],["false","false"],["null","null"],["and","and"],["or","or"],["eq","eq"],["ne","ne"],["lt","lt"],["le","le"],["gt","gt"],["ge","ge"],["in","in"],["as","as"],["_","_"]]),o=s.replace(/\?$/,""),a=r.get(o);return a!==void 0&&!t?{type:a,value:o,pos:n}:{type:"ident",value:s,pos:n}}}});var ze={};et(ze,{parseMoonblade:()=>H,parseNamedExpressions:()=>U});function U(e){let n=[],s=new q(e).tokenize(),r=0,o=()=>s[r]||{type:"eof",value:"",pos:0},a=()=>s[r++];for(;o().type!=="eof";){if(o().type===","&&n.length>0){a();continue}let d=[],u=0,p=r;for(;o().type!=="eof";){let i=o();if((i.type===","||i.type==="as")&&u===0)break;(i.type==="("||i.type==="["||i.type==="{")&&u++,(i.type===")"||i.type==="]"||i.type==="}")&&u--,d.push(a())}d.push({type:"eof",value:"",pos:0});let h=new z(d).parse(),l;if(o().type==="as")if(a(),o().type==="("){a();let i=[];for(;o().type!==")"&&o().type!=="eof";)(o().type==="ident"||o().type==="string")&&(i.push(o().value),a()),o().type===","&&a();o().type===")"&&a(),l=i}else if(o().type==="ident"||o().type==="string")l=o().value,a();else throw new Error(`Expected name after 'as', got ${o().type}`);else l=e.slice(s[p].pos,s[r-1]?.pos||e.length).trim(),h.type==="identifier"&&(l=h.name);n.push({expr:h,name:l})}return n}function H(e){let t=new q(e).tokenize();return new z(t).parse()}var R,z,V=We(()=>{"use strict";Je();R={PIPE:1,OR:2,AND:3,EQUALITY:4,COMPARISON:5,ADDITIVE:6,MULTIPLICATIVE:7,POWER:8,UNARY:9,POSTFIX:10},z=class{pos=0;tokens;constructor(n){this.tokens=n}parse(){let n=this.parseExpr(0);if(this.peek().type!=="eof")throw new Error(`Unexpected token: ${this.peek().value}`);return n}parseExpr(n){let t=this.parsePrefix();for(;;){let s=this.peek(),r=this.getInfixPrec(s.type);if(r<n)break;t=this.parseInfix(t,r)}return t}parsePrefix(){let n=this.peek();switch(n.type){case"int":return this.advance(),{type:"int",value:Number.parseInt(n.value,10)};case"float":return this.advance(),{type:"float",value:Number.parseFloat(n.value)};case"string":return this.advance(),{type:"string",value:n.value};case"regex":{this.advance();let t=n.value.split("/"),s=t.length>1?t[t.length-1]:"";return{type:"regex",pattern:t.slice(0,-1).join("/")||n.value,caseInsensitive:s.includes("i")}}case"true":return this.advance(),{type:"bool",value:!0};case"false":return this.advance(),{type:"bool",value:!1};case"null":return this.advance(),{type:"null"};case"_":return this.advance(),{type:"underscore"};case"ident":{let t=n.value,s=t.endsWith("?"),r=s?t.slice(0,-1):t;if(this.advance(),this.peek().type==="(")return this.parseFunctionCall(r);if(this.peek().type==="=>"){this.advance();let o=this.parseExpr(0);return this.bindLambdaArgs({type:"lambda",params:[r],body:o},[r])}return{type:"identifier",name:r,unsure:s}}case"(":{this.advance();let t=this.pos;if(this.peek().type===")"){if(this.advance(),this.peek().type==="=>"){this.advance();let r=this.parseExpr(0);return{type:"lambda",params:[],body:r}}throw new Error("Empty parentheses not allowed")}if(this.peek().type==="ident"){let r=[this.peek().value];this.advance();let o=!0;for(;this.peek().type===",";)if(this.advance(),this.peek().type==="ident")r.push(this.peek().value),this.advance();else{o=!1;break}if(o&&this.peek().type===")"&&this.peekAt(1).type==="=>"){this.advance(),this.advance();let a=this.parseExpr(0);return this.bindLambdaArgs({type:"lambda",params:r,body:a},r)}this.pos=t}let s=this.parseExpr(0);return this.expect(")"),s}case"[":return this.parseList();case"{":return this.parseMap();case"-":{this.advance();let t=this.parseExpr(R.UNARY);return t.type==="int"?{type:"int",value:-t.value}:t.type==="float"?{type:"float",value:-t.value}:{type:"func",name:"neg",args:[{expr:t}]}}case"!":return this.advance(),{type:"func",name:"not",args:[{expr:this.parseExpr(R.UNARY)}]};default:throw new Error(`Unexpected token: ${n.type} (${n.value})`)}}parseFunctionCall(n){this.expect("(");let t=[];if(this.peek().type!==")")do{t.length>0&&this.peek().type===","&&this.advance();let s;if(this.peek().type==="ident"){let o=this.peek().value,a=this.pos+1;a<this.tokens.length&&this.tokens[a].type==="="&&(s=o,this.advance(),this.advance())}let r=this.parseExpr(0);t.push({name:s,expr:r})}while(this.peek().type===",");return this.expect(")"),{type:"func",name:n.toLowerCase(),args:t}}parseList(){this.expect("[");let n=[];if(this.peek().type!=="]")do n.length>0&&this.peek().type===","&&this.advance(),n.push(this.parseExpr(0));while(this.peek().type===",");return this.expect("]"),{type:"list",elements:n}}parseMap(){this.expect("{");let n=[];if(this.peek().type!=="}")do{n.length>0&&this.peek().type===","&&this.advance();let t;if(this.peek().type==="ident")t=this.peek().value,this.advance();else if(this.peek().type==="string")t=this.peek().value,this.advance();else throw new Error(`Expected map key, got ${this.peek().type}`);this.expect(":");let s=this.parseExpr(0);n.push({key:t,value:s})}while(this.peek().type===",");return this.expect("}"),{type:"map",entries:n}}parseInfix(n,t){let s=this.peek(),o=new Map([["+","add"],["-","sub"],["*","mul"],["/","div"],["//","idiv"],["%","mod"],["**","pow"],["++","concat"],["==","=="],["!=","!="],["<","<"],["<=","<="],[">",">"],[">=",">="],["eq","eq"],["ne","ne"],["lt","lt"],["le","le"],["gt","gt"],["ge","ge"],["&&","and"],["and","and"],["||","or"],["or","or"]]).get(s.type);if(o!==void 0){this.advance();let a=this.parseExpr(t+(this.isRightAssoc(s.type)?0:1));return{type:"func",name:o,args:[{expr:n},{expr:a}]}}if(s.type==="|"){this.advance();let a=this.parseExpr(t);return this.handlePipe(n,a)}if(s.type===".")return this.advance(),this.handleDot(n);if(s.type==="[")return this.advance(),this.handleIndexing(n);if(s.type==="in")return this.advance(),{type:"func",name:"contains",args:[{expr:this.parseExpr(t+1)},{expr:n}]};if(s.type==="not in")return this.advance(),{type:"func",name:"not",args:[{expr:{type:"func",name:"contains",args:[{expr:this.parseExpr(t+1)},{expr:n}]}}]};throw new Error(`Unexpected infix token: ${s.type}`)}handlePipe(n,t){if(t.type==="identifier")return{type:"func",name:t.name,args:[{expr:n}]};if(t.type==="func"){let s=this.countUnderscores(t);return s===0?t:s===1?this.fillUnderscore(t,n):{type:"pipeline",exprs:[n,t]}}return this.countUnderscores(t)===1?this.fillUnderscore(t,n):t}handleDot(n){let t=this.peek();if(t.type==="ident"){let s=t.value;if(this.advance(),this.peek().type==="("){let r=this.parseFunctionCall(s);return r.type==="func"&&r.args.unshift({expr:n}),r}return{type:"func",name:"get",args:[{expr:n},{expr:{type:"string",value:s}}]}}if(t.type==="int"){let s=Number.parseInt(t.value,10);return this.advance(),{type:"func",name:"get",args:[{expr:n},{expr:{type:"int",value:s}}]}}if(t.type==="string"){let s=t.value;return this.advance(),{type:"func",name:"get",args:[{expr:n},{expr:{type:"string",value:s}}]}}throw new Error(`Expected identifier, number, or string after dot, got ${t.type}`)}handleIndexing(n){if(this.peek().type===":"){if(this.advance(),this.peek().type==="]")return this.advance(),{type:"func",name:"slice",args:[{expr:n}]};let s=this.parseExpr(0);return this.expect("]"),{type:"func",name:"slice",args:[{expr:n},{expr:{type:"int",value:0}},{expr:s}]}}let t=this.parseExpr(0);if(this.peek().type===":"){if(this.advance(),this.peek().type==="]")return this.advance(),{type:"func",name:"slice",args:[{expr:n},{expr:t}]};let s=this.parseExpr(0);return this.expect("]"),{type:"func",name:"slice",args:[{expr:n},{expr:t},{expr:s}]}}return this.expect("]"),{type:"func",name:"get",args:[{expr:n},{expr:t}]}}countUnderscores(n){return n.type==="underscore"?1:n.type==="func"?n.args.reduce((t,s)=>t+this.countUnderscores(s.expr),0):n.type==="list"?n.elements.reduce((t,s)=>t+this.countUnderscores(s),0):n.type==="map"?n.entries.reduce((t,s)=>t+this.countUnderscores(s.value),0):0}fillUnderscore(n,t){return n.type==="underscore"?t:n.type==="func"?{...n,args:n.args.map(s=>({...s,expr:this.fillUnderscore(s.expr,t)}))}:n.type==="list"?{...n,elements:n.elements.map(s=>this.fillUnderscore(s,t))}:n.type==="map"?{...n,entries:n.entries.map(s=>({...s,value:this.fillUnderscore(s.value,t)}))}:n}bindLambdaArgs(n,t){return{...n,body:this.bindLambdaArgsInExpr(n.body,t)}}bindLambdaArgsInExpr(n,t){return n.type==="identifier"&&t.includes(n.name)?{type:"lambdaBinding",name:n.name}:n.type==="func"?{...n,args:n.args.map(s=>({...s,expr:this.bindLambdaArgsInExpr(s.expr,t)}))}:n.type==="list"?{...n,elements:n.elements.map(s=>this.bindLambdaArgsInExpr(s,t))}:n.type==="map"?{...n,entries:n.entries.map(s=>({...s,value:this.bindLambdaArgsInExpr(s.value,t)}))}:n}getInfixPrec(n){switch(n){case"|":return R.PIPE;case"||":case"or":return R.OR;case"&&":case"and":return R.AND;case"==":case"!=":case"eq":case"ne":return R.EQUALITY;case"<":case"<=":case">":case">=":case"lt":case"le":case"gt":case"ge":case"in":case"not in":return R.COMPARISON;case"+":case"-":case"++":return R.ADDITIVE;case"*":case"/":case"//":case"%":return R.MULTIPLICATIVE;case"**":return R.POWER;case".":case"[":return R.POSTFIX;default:return-1}}isRightAssoc(n){return n==="**"}peek(){return this.tokens[this.pos]||{type:"eof",value:"",pos:0}}peekAt(n){return this.tokens[this.pos+n]||{type:"eof",value:"",pos:0}}advance(){return this.tokens[this.pos++]}expect(n){let t=this.peek();if(t.type!==n)throw new Error(`Expected ${n}, got ${t.type}`);return this.advance()}}});V();function E(e,n){return n.length===0?I(e,[]):n.length===1?{type:"Pipe",left:n[0],right:I(e,[])}:{type:"Pipe",left:n[0],right:I(e,n.slice(1))}}var K={add:e=>S("+",e[0],e[1]),sub:e=>S("-",e[0],e[1]),mul:e=>S("*",e[0],e[1]),div:e=>S("/",e[0],e[1]),mod:e=>S("%",e[0],e[1]),idiv:e=>I("floor",[S("/",e[0],e[1])]),pow:e=>E("pow",e),neg:e=>({type:"UnaryOp",op:"-",operand:e[0]}),"==":e=>S("==",e[0],e[1]),"!=":e=>S("!=",e[0],e[1]),"<":e=>S("<",e[0],e[1]),"<=":e=>S("<=",e[0],e[1]),">":e=>S(">",e[0],e[1]),">=":e=>S(">=",e[0],e[1]),eq:e=>S("==",P(e[0]),P(e[1])),ne:e=>S("!=",P(e[0]),P(e[1])),lt:e=>S("<",P(e[0]),P(e[1])),le:e=>S("<=",P(e[0]),P(e[1])),gt:e=>S(">",P(e[0]),P(e[1])),ge:e=>S(">=",P(e[0]),P(e[1])),and:e=>S("and",e[0],e[1]),or:e=>S("or",e[0],e[1]),not:e=>({type:"UnaryOp",op:"not",operand:e[0]}),len:e=>E("length",e),length:e=>E("length",e),upper:e=>E("ascii_upcase",e),lower:e=>E("ascii_downcase",e),trim:e=>E("trim",e),ltrim:e=>e.length===0?I("ltrimstr",[{type:"Literal",value:" "}]):{type:"Pipe",left:e[0],right:I("ltrimstr",[{type:"Literal",value:" "}])},rtrim:e=>e.length===0?I("rtrimstr",[{type:"Literal",value:" "}]):{type:"Pipe",left:e[0],right:I("rtrimstr",[{type:"Literal",value:" "}])},split:e=>E("split",e),join:e=>e.length===1?I("join",[{type:"Literal",value:""}]):E("join",e),concat:e=>S("+",e[0],e[1]),startswith:e=>E("startswith",e),endswith:e=>E("endswith",e),contains:e=>E("contains",e),replace:e=>E("gsub",e),substr:e=>e.length===2?{type:"Slice",base:e[0],start:e[1]}:{type:"Slice",base:e[0],start:e[1],end:S("+",e[1],e[2])},abs:e=>E("fabs",e),floor:e=>E("floor",e),ceil:e=>E("ceil",e),round:e=>E("round",e),sqrt:e=>E("sqrt",e),log:e=>E("log",e),log10:e=>E("log10",e),log2:e=>E("log2",e),exp:e=>E("exp",e),sin:e=>E("sin",e),cos:e=>E("cos",e),tan:e=>E("tan",e),asin:e=>E("asin",e),acos:e=>E("acos",e),atan:e=>E("atan",e),min:e=>E("min",e),max:e=>E("max",e),first:e=>e.length===0?{type:"Index",index:{type:"Literal",value:0}}:{type:"Index",index:{type:"Literal",value:0},base:e[0]},last:e=>e.length===0?{type:"Index",index:{type:"Literal",value:-1}}:{type:"Index",index:{type:"Literal",value:-1},base:e[0]},get:e=>e.length===1?{type:"Index",index:e[0]}:{type:"Index",index:e[1],base:e[0]},slice:e=>e.length===1?{type:"Slice",base:e[0]}:e.length===2?{type:"Slice",base:e[0],start:e[1]}:{type:"Slice",base:e[0],start:e[1],end:e[2]},keys:"keys",values:"values",entries:e=>I("to_entries",e),from_entries:"from_entries",reverse:"reverse",sort:"sort",sort_by:"sort_by",group_by:"group_by",unique:"unique",unique_by:"unique_by",flatten:"flatten",map:e=>({type:"Pipe",left:e[0],right:{type:"Array",elements:e[1]}}),select:e=>I("select",e),empty:()=>I("empty",[]),count:()=>I("length",[]),sum:e=>e.length===0?I("add",[]):{type:"Pipe",left:{type:"Array",elements:e[0]},right:I("add",[])},mean:e=>e.length===0?{type:"Pipe",left:{type:"Identity"},right:S("/",I("add",[]),I("length",[]))}:{type:"Pipe",left:{type:"Array",elements:e[0]},right:S("/",I("add",[]),I("length",[]))},avg:e=>e.length===0?{type:"Pipe",left:{type:"Identity"},right:S("/",I("add",[]),I("length",[]))}:{type:"Pipe",left:{type:"Array",elements:e[0]},right:S("/",I("add",[]),I("length",[]))},type:"type",isnull:e=>e.length===0?S("==",{type:"Identity"},{type:"Literal",value:null}):S("==",e[0],{type:"Literal",value:null}),isempty:e=>e.length===0?S("==",{type:"Identity"},{type:"Literal",value:""}):S("==",e[0],{type:"Literal",value:""}),tonumber:e=>e.length===0?I("tonumber",[]):I("tonumber",e),tostring:e=>e.length===0?I("tostring",[]):I("tostring",e),if:e=>Ke(e[0],e[1],e[2]),coalesce:e=>{if(e.length===0)return{type:"Literal",value:null};if(e.length===1)return e[0];let[n,...t]=e,s=S("and",S("!=",n,{type:"Literal",value:null}),S("!=",n,{type:"Literal",value:""}));return Ke(s,n,t.length===1?t[0]:K.coalesce(t))},index:()=>({type:"Field",name:"_row_index"}),now:()=>I("now",[]),fmt:e=>I("tostring",e),format:e=>I("tostring",e)};Object.setPrototypeOf(K,null);function S(e,n,t){return{type:"BinaryOp",op:e,left:n,right:t}}function I(e,n){return{type:"Call",name:e,args:n}}var rt="then";function Ke(e,n,t){let s=qe({type:"Cond",cond:e,elifs:[],else:t||{type:"Literal",value:null}});return s[rt]=n,s}function P(e){return{type:"Pipe",left:e,right:{type:"Call",name:"tostring",args:[]}}}function O(e,n=!0){switch(e.type){case"int":case"float":return{type:"Literal",value:e.value};case"string":return{type:"Literal",value:e.value};case"bool":return{type:"Literal",value:e.value};case"null":return{type:"Literal",value:null};case"underscore":return{type:"Index",base:{type:"Identity"},index:{type:"Literal",value:"_"}};case"identifier":return n?{type:"Field",name:e.name}:{type:"VarRef",name:e.name};case"lambdaBinding":return{type:"VarRef",name:e.name};case"func":{let t=e.args.map(r=>O(r.expr,n)),s=Object.hasOwn(K,e.name)?K[e.name]:void 0;return typeof s=="function"?s(t):I(typeof s=="string"?s:e.name,t)}case"list":return e.elements.length===0?{type:"Array"}:{type:"Array",elements:e.elements.reduce((t,s,r)=>{let o=O(s,n);return r===0?o:{type:"Comma",left:t,right:o}},null)};case"map":return{type:"Object",entries:e.entries.map(t=>({key:t.key,value:O(t.value,n)}))};case"regex":return{type:"Literal",value:e.pattern};case"slice":return{type:"Slice",start:e.start?O(e.start,n):void 0,end:e.end?O(e.end,n):void 0};case"lambda":return O(e.body,n);case"pipeline":return{type:"Identity"};default:throw new Error(`Unknown moonblade expression type: ${e.type}`)}}function ee(e){let n=[],t=0;for(;t<e.length;){for(;t<e.length&&(e[t]===" "||e[t]===",");)t++;if(t>=e.length)break;let s=t;for(;t<e.length&&/\w/.test(e[t]);)t++;let r=e.slice(s,t);for(;t<e.length&&e[t]===" ";)t++;if(e[t]!=="(")break;t++;let o=1,a=t;for(;t<e.length&&o>0;)e[t]==="("?o++:e[t]===")"&&o--,o>0&&t++;let d=e.slice(a,t).trim();for(t++;t<e.length&&e[t]===" ";)t++;let u="";if(e.slice(t,t+3).toLowerCase()==="as "){for(t+=3;t<e.length&&e[t]===" ";)t++;let p=t;for(;t<e.length&&/\w/.test(e[t]);)t++;u=e.slice(p,t)}u||(u=d?`${r}(${d})`:`${r}()`),n.push({func:r,expr:d,alias:u})}return n}function Be(e){return/^\w+$/.test(e)}function Q(e,n,t){let s=O(H(n)),r=$(e,s,t);return r.length>0?r[0]:null}function te(e,n,t={}){let{func:s,expr:r}=n;if(s==="count"&&!r)return e.length;let o;switch(Be(r)?o=e.map(a=>a[r]).filter(a=>a!=null):o=e.map(a=>Q(a,r,t)).filter(a=>a!=null),s){case"count":return Be(r)?o.length:o.filter(a=>!!a).length;case"sum":return o.map(d=>typeof d=="number"?d:Number.parseFloat(String(d))).reduce((d,u)=>d+u,0);case"mean":case"avg":{let a=o.map(d=>typeof d=="number"?d:Number.parseFloat(String(d)));return a.length>0?a.reduce((d,u)=>d+u,0)/a.length:0}case"min":{let a=o.map(d=>typeof d=="number"?d:Number.parseFloat(String(d)));return a.length>0?Math.min(...a):null}case"max":{let a=o.map(d=>typeof d=="number"?d:Number.parseFloat(String(d)));return a.length>0?Math.max(...a):null}case"first":return o.length>0?o[0]:null;case"last":return o.length>0?o[o.length-1]:null;case"median":{let a=o.map(u=>typeof u=="number"?u:Number.parseFloat(String(u))).filter(u=>!Number.isNaN(u)).sort((u,p)=>u-p);if(a.length===0)return null;let d=Math.floor(a.length/2);return a.length%2===0?(a[d-1]+a[d])/2:a[d]}case"mode":{let a=new Map;for(let p of o){let c=String(p);a.set(c,(a.get(c)||0)+1)}let d=0,u=null;for(let[p,c]of a)c>d&&(d=c,u=p);return u}case"cardinality":return new Set(o.map(d=>String(d))).size;case"values":return o.map(a=>String(a)).join("|");case"distinct_values":return[...new Set(o.map(d=>String(d)))].sort().join("|");case"all":{if(e.length===0)return!0;for(let a of e)if(!Q(a,r,t))return!1;return!0}case"any":{for(let a of e)if(Q(a,r,t))return!0;return!1}default:return null}}function Ge(e,n,t={}){let s=F();for(let r of n)b(s,r.alias,te(e,r,t));return s}async function ne(e,n){let t="",s=[];for(let c of e)c.startsWith("-")||(t?s.push(c):t=c);if(!t)return{stdout:"",stderr:`xan agg: no aggregation expression
|
|
6
|
+
`,exitCode:1};let{data:r,error:o}=await v(s,n);if(o)return o;let a={limits:n.limits?{maxIterations:n.limits.maxJqIterations}:void 0},d=ee(t),u=d.map(c=>c.alias),p=Ge(r,d,a);return{stdout:w(u,[p]),stderr:"",exitCode:0}}async function se(e,n){let t="",s="",r=[];for(let f=0;f<e.length;f++){let m=e[f];m==="--sorted"||m.startsWith("-")||(t?s?r.push(m):s=m:t=m)}if(!t||!s)return{stdout:"",stderr:`xan groupby: usage: xan groupby COLS EXPR [FILE]
|
|
7
|
+
`,exitCode:1};let{data:o,error:a}=await v(r,n);if(a)return a;let d={limits:n.limits?{maxIterations:n.limits.maxJqIterations}:void 0},u=t.split(","),p=ee(s),c=[],h=new Map;for(let f of o){let m=u.map(g=>String(f[g])).join("\0");h.has(m)||(h.set(m,[]),c.push(m)),h.get(m)?.push(f)}let l=[...u,...p.map(f=>f.alias)],i=[];for(let f of c){let m=h.get(f);if(!m)continue;let g=F();for(let y of u)b(g,y,m[0][y]);for(let y of p)b(g,y.alias,te(m,y,d));i.push(g)}return{stdout:w(l,i),stderr:"",exitCode:0}}async function re(e,n){let t=[],s="",r=10,o=!1,a=[];for(let i=0;i<e.length;i++){let f=e[i];(f==="-s"||f==="--select")&&i+1<e.length?t=e[++i].split(","):(f==="-g"||f==="--groupby")&&i+1<e.length?s=e[++i]:(f==="-l"||f==="--limit")&&i+1<e.length?r=Number.parseInt(e[++i],10):f==="--no-extra"?o=!0:f==="-A"||f==="--all"?r=0:f.startsWith("-")||a.push(f)}let{headers:d,data:u,error:p}=await v(a,n);if(p)return p;let c=t.length>0?t:d.filter(i=>i!==s);s&&t.length===0&&(c=d.filter(i=>i!==s));let h=[],l=s?["field",s,"value","count"]:["field","value","count"];if(s){let i=new Map;for(let f of u){let m=String(f[s]??"");i.has(m)||i.set(m,[]),i.get(m)?.push(f)}for(let f of c)for(let[m,g]of i){let y=new Map;for(let k of g){let N=k[f],C=N===""||N===null||N===void 0?"":String(N);y.set(C,(y.get(C)||0)+1)}let x=[...y.entries()].sort((k,N)=>N[1]!==k[1]?N[1]-k[1]:k[0].localeCompare(N[0]));o&&(x=x.filter(([k])=>k!=="")),r>0&&(x=x.slice(0,r));for(let[k,N]of x)h.push({field:f,[s]:m,value:k===""?"<empty>":k,count:N})}}else for(let i of c){let f=new Map;for(let g of u){let y=g[i],x=y===""||y===null||y===void 0?"":String(y);f.set(x,(f.get(x)||0)+1)}let m=[...f.entries()].sort((g,y)=>y[1]!==g[1]?y[1]-g[1]:g[0].localeCompare(y[0]));o&&(m=m.filter(([g])=>g!=="")),r>0&&(m=m.slice(0,r));for(let[g,y]of m)h.push({field:i,value:g===""?"<empty>":g,count:y})}return{stdout:w(l,h),stderr:"",exitCode:0}}async function oe(e,n){let t=[],s=[];for(let c=0;c<e.length;c++){let h=e[c];h==="-s"&&c+1<e.length?t=e[++c].split(","):h.startsWith("-")||s.push(h)}let{headers:r,data:o,error:a}=await v(s,n);if(a)return a;let d=t.length>0?t:r,u=["field","type","count","min","max","mean"],p=[];for(let c of d){let h=o.map(f=>f[c]).filter(f=>f!=null),l=h.map(f=>typeof f=="number"?f:Number.parseFloat(String(f))).filter(f=>!Number.isNaN(f)),i=l.length===h.length&&l.length>0;p.push({field:c,type:i?"Number":"String",count:h.length,min:i?Math.min(...l):"",max:i?Math.max(...l):"",mean:i?Math.round(l.reduce((f,m)=>f+m,0)/l.length*1e10)/1e10:""})}return{stdout:w(u,p),stderr:"",exitCode:0}}V();function Xe(e){let n=H(e);return O(n)}function ot(e){let t=e.replace(/[.+?^${}()|[\]\\]/g,"\\$&").replace(/\*/g,".*");return J(`^${t}$`)}function B(e,n){let t=[],s=new Set;for(let r of e.split(",")){let o=r.trim();if(o.startsWith("!")){let p=o.slice(1),c=B(p,n);for(let h of c)s.add(h);continue}if(o==="*"){for(let p of n)t.includes(p)||t.push(p);continue}if(o.includes("*")){let p=ot(o);for(let c of n)p.test(c)&&!t.includes(c)&&t.push(c);continue}let a=o.match(/^([^:]*):([^:]*)$/);if(a&&(a[1]||a[2])){let p=a[1],c=a[2],h=p?n.indexOf(p):0,l=c?n.indexOf(c):n.length-1;if(h!==-1&&l!==-1){let i=h<=l?1:-1;for(let f=h;i>0?f<=l:f>=l;f+=i)t.includes(n[f])||t.push(n[f])}continue}let d=o.match(/^(\d+)-(\d+)$/);if(d){let p=Number.parseInt(d[1],10),c=Number.parseInt(d[2],10);for(let h=p;h<=c&&h<n.length;h++)t.push(n[h]);continue}let u=Number.parseInt(o,10);if(!Number.isNaN(u)&&u>=0&&u<n.length){t.push(n[u]);continue}n.includes(o)&&t.push(o)}return s.size>0?t.filter(r=>!s.has(r)):t}async function ie(e,n){let t="",s=[];for(let p of e)p.startsWith("-")||(t?s.push(p):t=p);if(!t)return{stdout:"",stderr:`xan select: no columns specified
|
|
8
|
+
`,exitCode:1};let{headers:r,data:o,error:a}=await v(s,n);if(a)return a;let d=B(t,r),u=o.map(p=>{let c=F();for(let h of d)b(c,h,p[h]);return c});return{stdout:w(d,u),stderr:"",exitCode:0}}async function ae(e,n){let t="",s=[];for(let c of e)c.startsWith("-")||(t?s.push(c):t=c);if(!t)return{stdout:"",stderr:`xan drop: no columns specified
|
|
9
|
+
`,exitCode:1};let{headers:r,data:o,error:a}=await v(s,n);if(a)return a;let d=new Set(B(t,r)),u=r.filter(c=>!d.has(c)),p=o.map(c=>{let h=F();for(let l of u)b(h,l,c[l]);return h});return{stdout:w(u,p),stderr:"",exitCode:0}}async function le(e,n){let t="",s="",r=[];for(let c=0;c<e.length;c++){let h=e[c];h==="-s"&&c+1<e.length?s=e[++c]:h.startsWith("-")||(t?r.push(h):t=h)}if(!t)return{stdout:"",stderr:`xan rename: no new name(s) specified
|
|
10
|
+
`,exitCode:1};let{headers:o,data:a,error:d}=await v(r,n);if(d)return d;let u;if(s){let c=s.split(","),h=t.split(","),l=new Map;for(let i=0;i<c.length&&i<h.length;i++)l.set(c[i],h[i]);u=o.map(i=>l.get(i)||i)}else{let c=t.split(",");u=o.map((h,l)=>l<c.length?c[l]:h)}let p=a.map(c=>{let h=F();for(let l=0;l<o.length;l++)b(h,u[l],c[o[l]]);return h});return{stdout:w(u,p),stderr:"",exitCode:0}}async function ue(e,n){let t="index",s=[];for(let p=0;p<e.length;p++)e[p]==="-c"&&p+1<e.length?t=e[++p]:s.push(e[p]);let{headers:r,data:o,error:a}=await v(s,n);if(a)return a;let d=[t,...r],u=o.map((p,c)=>{let h=F();b(h,t,c);for(let l of r)b(h,l,p[l]);return h});return{stdout:w(d,u),stderr:"",exitCode:0}}async function ce(e,n){let t=e.includes("-j")||e.includes("--just-names"),{headers:s,error:r}=await v(e.filter(a=>a!=="-j"&&a!=="--just-names"),n);return r||{stdout:t?`${s.map(a=>a).join(`
|
|
11
|
+
`)}
|
|
12
|
+
`:`${s.map((a,d)=>`${d} ${a}`).join(`
|
|
13
|
+
`)}
|
|
14
|
+
`,stderr:"",exitCode:0}}async function pe(e,n){let{data:t,error:s}=await v(e,n);return s||{stdout:`${t.length}
|
|
15
|
+
`,stderr:"",exitCode:0}}async function fe(e,n){let t=10,s=[];for(let u=0;u<e.length;u++)(e[u]==="-l"||e[u]==="-n")&&u+1<e.length?t=Number.parseInt(e[++u],10):s.push(e[u]);let{headers:r,data:o,error:a}=await v(s,n);if(a)return a;let d=o.slice(0,t);return{stdout:w(r,d),stderr:"",exitCode:0}}async function de(e,n){let t=10,s=[];for(let u=0;u<e.length;u++)(e[u]==="-l"||e[u]==="-n")&&u+1<e.length?t=Number.parseInt(e[++u],10):s.push(e[u]);let{headers:r,data:o,error:a}=await v(s,n);if(a)return a;let d=o.slice(-t);return{stdout:w(r,d),stderr:"",exitCode:0}}async function he(e,n){let t,s,r,o=[];for(let l=0;l<e.length;l++){let i=e[l];(i==="-s"||i==="--start")&&l+1<e.length?t=Number.parseInt(e[++l],10):(i==="-e"||i==="--end")&&l+1<e.length?s=Number.parseInt(e[++l],10):(i==="-l"||i==="--len")&&l+1<e.length?r=Number.parseInt(e[++l],10):i.startsWith("-")||o.push(i)}let{headers:a,data:d,error:u}=await v(o,n);if(u)return u;let p=t??0,c;r!==void 0?c=p+r:s!==void 0?c=s:c=d.length;let h=d.slice(p,c);return{stdout:w(a,h),stderr:"",exitCode:0}}async function me(e,n){let{headers:t,data:s,error:r}=await v(e,n);if(r)return r;let o=[...s].reverse();return{stdout:w(t,o),stderr:"",exitCode:0}}var ge=tt(st(),1);async function ye(e,n){let t=e.filter(p=>!p.startsWith("-")),{headers:s,data:r,error:o}=await v(t,n);if(o)return o;if(r.length===0){let p=["column"],c=s.map(h=>({column:h}));return{stdout:w(p,c),stderr:"",exitCode:0}}let a=s[0],d=[a,...r.map((p,c)=>String(p[a]??`row_${c}`))],u=[];for(let p=1;p<s.length;p++){let c=s[p],h=F();b(h,a,c);for(let l=0;l<r.length;l++)b(h,d[l+1],r[l][c]);u.push(h)}return{stdout:w(d,u),stderr:"",exitCode:0}}async function xe(e,n){let t=null,s=[];for(let c=0;c<e.length;c++){let h=e[c];h==="--seed"&&c+1<e.length?t=Number.parseInt(e[++c],10):h.startsWith("-")||s.push(h)}let{headers:r,data:o,error:a}=await v(s,n);if(a)return a;let d=t!==null?t:Date.now(),u=()=>(d=d*1103515245+12345&2147483647,d/2147483647),p=[...o];for(let c=p.length-1;c>0;c--){let h=Math.floor(u()*(c+1));[p[c],p[h]]=[p[h],p[c]]}return{stdout:w(r,p),stderr:"",exitCode:0}}async function we(e,n){let t=null,s="",r=[];for(let i=0;i<e.length;i++){let f=e[i];(f==="-l"||f==="--length")&&i+1<e.length?t=Number.parseInt(e[++i],10):(f==="-d"||f==="--default")&&i+1<e.length?s=e[++i]:f.startsWith("-")||r.push(f)}let o=r[0],a;if(!o||o==="-")a=_(n.stdin);else try{let i=n.fs.resolvePath(n.cwd,o);a=await n.fs.readFile(i)}catch{return{stdout:"",stderr:`xan fixlengths: ${o}: No such file or directory
|
|
16
|
+
`,exitCode:1}}let u=ge.default.parse(a.trim(),{header:!1,skipEmptyLines:!0}).data;if(u.length===0)return{stdout:"",stderr:"",exitCode:0};let p=Math.max(...u.map(i=>i.length)),c=t??p,h=u.map(i=>i.length===c?i:i.length<c?[...i,...Array(c-i.length).fill(s)]:i.slice(0,c));return{stdout:`${ge.default.unparse(h).replace(/\r\n/g,`
|
|
17
|
+
`)}
|
|
18
|
+
`,stderr:"",exitCode:0}}async function ve(e,n){let t=null,s=null,r=".",o=[];for(let l=0;l<e.length;l++){let i=e[l];(i==="-c"||i==="--chunks")&&l+1<e.length?t=Number.parseInt(e[++l],10):(i==="-S"||i==="--size")&&l+1<e.length?s=Number.parseInt(e[++l],10):(i==="-o"||i==="--output")&&l+1<e.length?r=e[++l]:i.startsWith("-")||o.push(i)}if(!t&&!s)return{stdout:"",stderr:`xan split: must specify -c or -S
|
|
19
|
+
`,exitCode:1};let{headers:a,data:d,error:u}=await v(o,n);if(u)return u;let p=[];if(t){let l=Math.ceil(d.length/t);for(let i=0;i<t;i++)p.push(d.slice(i*l,(i+1)*l))}else if(s)for(let l=0;l<d.length;l+=s)p.push(d.slice(l,l+s));let c=p.filter(l=>l.length>0),h=o[0]?.replace(/\.csv$/,"")||"part";try{let l=n.fs.resolvePath(n.cwd,r);for(let i=0;i<c.length;i++){let f=`${h}_${String(i+1).padStart(3,"0")}.csv`,m=n.fs.resolvePath(l,f);await n.fs.writeFile(m,w(a,c[i]))}return{stdout:`Split into ${c.length} parts
|
|
20
|
+
`,stderr:"",exitCode:0}}catch{return{stdout:`${c.map((i,f)=>`Part ${f+1}: ${i.length} rows`).join(`
|
|
21
|
+
`)}
|
|
22
|
+
`,stderr:"",exitCode:0}}}function Ye(e){return e.replace(/[^a-zA-Z0-9_-]/g,"_")||"empty"}function it(e){let n=2166136261;for(let t=0;t<e.length;t++)n=(n^e.charCodeAt(t))*16777619>>>0;return n.toString(36).padStart(6,"0").slice(0,6)}async function Ce(e,n){let t="",s=".",r=[];for(let l=0;l<e.length;l++){let i=e[l];(i==="-o"||i==="--output")&&l+1<e.length?s=e[++l]:i.startsWith("-")||(t?r.push(i):t=i)}if(!t)return{stdout:"",stderr:`xan partition: usage: xan partition COLUMN [FILE]
|
|
23
|
+
`,exitCode:1};let{headers:o,data:a,error:d}=await v(r,n);if(d)return d;if(!o.includes(t))return{stdout:"",stderr:`xan partition: column '${t}' not found
|
|
24
|
+
`,exitCode:1};let u=new Map;for(let l of a){let i=String(l[t]??"");u.has(i)||u.set(i,[]),u.get(i)?.push(l)}let p=new Map;for(let l of u.keys()){let i=Ye(l);p.set(i,(p.get(i)??0)+1)}let c=new Set,h=new Map;for(let l of u.keys()){let i=Ye(l),m=(p.get(i)??0)>1?`${i}_${it(l)}`:i,g=`${m}.csv`,y=1;for(;c.has(g);)g=`${m}_${y}.csv`,y++;c.add(g),h.set(l,g)}try{let l=n.fs.resolvePath(n.cwd,s);for(let[i,f]of u){let m=h.get(i);if(!m)continue;let g=n.fs.resolvePath(l,m);await n.fs.writeFile(g,w(o,f))}return{stdout:`Partitioned into ${u.size} files by '${t}'
|
|
25
|
+
`,stderr:"",exitCode:0}}catch{return{stdout:`${Array.from(u.entries()).map(([i,f])=>`${i}: ${f.length} rows`).join(`
|
|
26
|
+
`)}
|
|
27
|
+
`,stderr:"",exitCode:0}}}async function be(e,n){if(e.length===0)return{stdout:"",stderr:`xan to: usage: xan to <format> [FILE]
|
|
28
|
+
`,exitCode:1};let t=e[0],s=e.slice(1);return t==="json"?at(s,n):{stdout:"",stderr:`xan to: unsupported format '${t}'
|
|
29
|
+
`,exitCode:1}}async function at(e,n){let t=e.filter(a=>!a.startsWith("-")),{data:s,error:r}=await v(t,n);return r||{stdout:`${JSON.stringify(s,null,2)}
|
|
30
|
+
`,stderr:"",exitCode:0}}async function Se(e,n){let t="",s=[];for(let r=0;r<e.length;r++){let o=e[r];(o==="-f"||o==="--format")&&r+1<e.length?t=e[++r]:o.startsWith("-")||s.push(o)}return t?t==="json"?lt(s,n):{stdout:"",stderr:`xan from: unsupported format '${t}'
|
|
31
|
+
`,exitCode:1}:{stdout:"",stderr:`xan from: usage: xan from -f <format> [FILE]
|
|
32
|
+
`,exitCode:1}}async function lt(e,n){let t=e[0],s;if(!t||t==="-")s=_(n.stdin);else try{let r=n.fs.resolvePath(n.cwd,t);s=await n.fs.readFile(r)}catch{return{stdout:"",stderr:`xan from: ${t}: No such file or directory
|
|
33
|
+
`,exitCode:1}}try{let r=JSON.parse(s.trim());if(!Array.isArray(r))return{stdout:"",stderr:`xan from: JSON input must be an array
|
|
34
|
+
`,exitCode:1};if(r.length===0)return{stdout:`
|
|
35
|
+
`,stderr:"",exitCode:0};if(Array.isArray(r[0])){let[a,...d]=r,u=d.map(p=>{let c=F();for(let h=0;h<a.length;h++)b(c,a[h],p[h]);return c});return{stdout:w(a,u),stderr:"",exitCode:0}}let o=Object.keys(r[0]).sort();return{stdout:w(o,r),stderr:"",exitCode:0}}catch{return{stdout:"",stderr:`xan from: invalid JSON input
|
|
36
|
+
`,exitCode:1}}}async function ke(e,n){let t=!1,s=0,r="",o=[];for(let l=0;l<e.length;l++){let i=e[l];if(i==="-v"||i==="--invert")t=!0;else if((i==="-l"||i==="--limit")&&l+1<e.length)s=Number.parseInt(e[++l],10);else{if(i==="--help")return D({name:"xan filter",summary:"Filter rows by expression",usage:"xan filter [OPTIONS] EXPR [FILE]",description:"Filter CSV rows using moonblade expressions.",options:["-v, --invert invert match","-l, --limit N limit output to N rows"," --help display help"]});i.startsWith("-")||(r?o.push(i):r=i)}}if(!r)return{stdout:"",stderr:`xan filter: no expression specified
|
|
37
|
+
`,exitCode:1};let{headers:a,data:d,error:u}=await v(o,n);if(u)return u;let p={limits:n.limits?{maxIterations:n.limits.maxJqIterations}:void 0},c=Xe(r),h=[];for(let l of d){if(s>0&&h.length>=s)break;let i=$(l,c,p),f=i.length>0&&i.some(m=>!!m);(t?!f:f)&&h.push(l)}return{stdout:w(a,h),stderr:"",exitCode:0}}async function Ie(e,n){let t="",s=!1,r=!1,o=[];for(let c=0;c<e.length;c++){let h=e[c];h==="-N"||h==="--numeric"?s=!0:h==="-R"||h==="-r"||h==="--reverse"?r=!0:h==="-s"&&c+1<e.length?t=e[++c]:h.startsWith("-")||o.push(h)}let{headers:a,data:d,error:u}=await v(o,n);if(u)return u;!t&&a.length>0&&(t=a[0]);let p=[...d].sort((c,h)=>{let l=c[t],i=h[t],f;if(s){let m=typeof l=="number"?l:Number.parseFloat(String(l)),g=typeof i=="number"?i:Number.parseFloat(String(i));f=m-g}else f=String(l).localeCompare(String(i));return r?-f:f});return{stdout:w(a,p),stderr:"",exitCode:0}}async function Ne(e,n){let t="",s=[];for(let p=0;p<e.length;p++){let c=e[p];c==="-s"&&p+1<e.length?t=e[++p]:c.startsWith("-")||s.push(c)}let{headers:r,data:o,error:a}=await v(s,n);if(a)return a;let d=new Set,u=o.filter(p=>{let c=t?String(p[t]):JSON.stringify(p);return d.has(c)?!1:(d.add(c),!0)});return{stdout:w(r,u),stderr:"",exitCode:0}}async function Ee(e,n){let t=10,s="",r=!1,o=[];for(let h=0;h<e.length;h++){let l=e[h];(l==="-l"||l==="-n")&&h+1<e.length?t=Number.parseInt(e[++h],10):l==="-R"||l==="-r"||l==="--reverse"?r=!0:l.startsWith("-")||(s?o.push(l):s=l)}let{headers:a,data:d,error:u}=await v(o,n);if(u)return u;!s&&a.length>0&&(s=a[0]);let c=[...d].sort((h,l)=>{let i=h[s],f=l[s],m=typeof i=="number"?i:Number.parseFloat(String(i)),g=typeof f=="number"?f:Number.parseFloat(String(f));return r?m-g:g-m}).slice(0,t);return{stdout:w(a,c),stderr:"",exitCode:0}}V();async function Ae(e,n){let t="",s=!1,r=!1,o=[];for(let f=0;f<e.length;f++){let m=e[f];m==="-O"||m==="--overwrite"?s=!0:m==="--filter"?r=!0:m.startsWith("-")||(t?o.push(m):t=m)}if(!t)return{stdout:"",stderr:`xan map: no expression specified
|
|
38
|
+
`,exitCode:1};let{headers:a,data:d,error:u}=await v(o,n);if(u)return u;let c=U(t).map(({expr:f,name:m})=>({alias:typeof m=="string"?m:m[0],ast:O(f)})),h={limits:n.limits?{maxIterations:n.limits.maxJqIterations}:void 0},l;if(s){l=[...a];for(let f of c)a.includes(f.alias)||l.push(f.alias)}else l=[...a,...c.map(f=>f.alias)];let i=[];for(let f=0;f<d.length;f++){let m=d[f],g=M(m),y=!1,x=Object.assign(X(m),{_row_index:f});for(let k of c){let N=$(x,k.ast,h),C=N.length>0?N[0]:null;if(r&&C==null){y=!0;break}b(g,k.alias,C)}y||i.push(g)}return{stdout:w(l,i),stderr:"",exitCode:0}}async function Fe(e,n){let t="",s="",r="",o=[];for(let m=0;m<e.length;m++){let g=e[m];(g==="-r"||g==="--rename")&&m+1<e.length?r=e[++m]:g.startsWith("-")||(t?s?o.push(g):s=g:t=g)}if(!t||!s)return{stdout:"",stderr:`xan transform: usage: xan transform COLUMN EXPR [FILE]
|
|
39
|
+
`,exitCode:1};let{headers:a,data:d,error:u}=await v(o,n);if(u)return u;let p=t.split(",").map(m=>m.trim()),c=r?r.split(",").map(m=>m.trim()):[];for(let m of p)if(!a.includes(m))return{stdout:"",stderr:`xan transform: column '${m}' not found
|
|
40
|
+
`,exitCode:1};let h=O(U(s)[0]?.expr||(V(),nt(ze)).parseMoonblade(s)),l={limits:n.limits?{maxIterations:n.limits.maxJqIterations}:void 0},i=a.map(m=>{let g=p.indexOf(m);return g!==-1&&c[g]?c[g]:m}),f=[];for(let m of d){let g=M(m);for(let y=0;y<p.length;y++){let x=p[y],k=Object.assign(X(m),{_:m[x]}),N=$(k,h,l),C=N.length>0?N[0]:null,A=c[y]||x;A!==x&&delete g[x],b(g,A,C)}f.push(g)}return{stdout:w(i,f),stderr:"",exitCode:0}}async function Oe(e,n){let t="",s="|",r=!1,o="",a=[];for(let i=0;i<e.length;i++){let f=e[i];(f==="-s"||f==="--separator")&&i+1<e.length?s=e[++i]:f==="--drop-empty"?r=!0:(f==="-r"||f==="--rename")&&i+1<e.length?o=e[++i]:f.startsWith("-")||(t?a.push(f):t=f)}if(!t)return{stdout:"",stderr:`xan explode: usage: xan explode COLUMN [FILE]
|
|
41
|
+
`,exitCode:1};let{headers:d,data:u,error:p}=await v(a,n);if(p)return p;if(!d.includes(t))return{stdout:"",stderr:`xan explode: column '${t}' not found
|
|
42
|
+
`,exitCode:1};let c=o?d.map(i=>i===t?o:i):d,h=o||t,l=[];for(let i of u){let f=i[t],m=f==null?"":String(f);if(m===""){if(!r){let g=M(i);o&&(delete g[t],b(g,h,"")),l.push(g)}}else{let g=m.split(s);for(let y of g){let x=M(i);o&&delete x[t],b(x,h,y),l.push(x)}}}return{stdout:w(c,l),stderr:"",exitCode:0}}async function Le(e,n){let t="",s="|",r="",o=[];for(let g=0;g<e.length;g++){let y=e[g];(y==="-s"||y==="--sep")&&g+1<e.length?s=e[++g]:(y==="-r"||y==="--rename")&&g+1<e.length?r=e[++g]:y.startsWith("-")||(t?o.push(y):t=y)}if(!t)return{stdout:"",stderr:`xan implode: usage: xan implode COLUMN [FILE]
|
|
43
|
+
`,exitCode:1};let{headers:a,data:d,error:u}=await v(o,n);if(u)return u;if(!a.includes(t))return{stdout:"",stderr:`xan implode: column '${t}' not found
|
|
44
|
+
`,exitCode:1};let p=a.filter(g=>g!==t),c=r?a.map(g=>g===t?r:g):a,h=r||t,l=[],i=null,f=[],m=null;for(let g of d){let y=p.map(N=>String(g[N]??"")).join("\0"),x=g[t],k=x==null?"":String(x);if(y!==i){if(m!==null){let N=M(m);r&&delete N[t],b(N,h,f.join(s)),l.push(N)}i=y,f=[k],m=g}else f.push(k)}if(m!==null){let g=M(m);r&&delete g[t],b(g,h,f.join(s)),l.push(g)}return{stdout:w(c,l),stderr:"",exitCode:0}}async function Pe(e,n){let t="",s="",r="",o="",a="inner",d="",u=0;for(let C=0;C<e.length;C++){let A=e[C];A==="--left"?a="left":A==="--right"?a="right":A==="--full"?a="full":(A==="-D"||A==="--default")&&C+1<e.length?d=e[++C]:A.startsWith("-")||(u++,u===1?t=A:u===2?s=A:u===3?r=A:u===4&&(o=A))}if(!t||!s||!r||!o)return{stdout:"",stderr:`xan join: usage: xan join KEY1 FILE1 KEY2 FILE2 [OPTIONS]
|
|
45
|
+
`,exitCode:1};let p=await v([s],n);if(p.error)return p.error;let c=await v([o],n);if(c.error)return c.error;let{headers:h,data:l}=p,{headers:i,data:f}=c;if(!h.includes(t))return{stdout:"",stderr:`xan join: column '${t}' not found in first file
|
|
46
|
+
`,exitCode:1};if(!i.includes(r))return{stdout:"",stderr:`xan join: column '${r}' not found in second file
|
|
47
|
+
`,exitCode:1};let m=new Map;for(let C of f){let A=String(C[r]??"");m.has(A)||m.set(A,[]),m.get(A)?.push(C)}let g=new Set(h),y=i.filter(C=>!g.has(C)),x=[...h,...y],k=[],N=new Set;for(let C of l){let A=String(C[t]??""),j=m.get(A);if(j&&j.length>0){N.add(A);for(let L of j){let T=F();for(let W of h)b(T,W,C[W]);for(let W of y)b(T,W,L[W]);k.push(T)}}else if(a==="left"||a==="full"){let L=F();for(let T of h)b(L,T,C[T]);for(let T of y)b(L,T,d);k.push(L)}}if(a==="right"||a==="full")for(let C of f){let A=String(C[r]??"");if(!N.has(A)){let j=F();for(let L of h)b(j,L,i.includes(L)?C[L]:d);for(let L of y)b(j,L,C[L]);k.push(j)}}return{stdout:w(x,k),stderr:"",exitCode:0}}async function Re(e,n){let t="",s="",r=[],o=[];for(let y=0;y<e.length;y++){let x=e[y];(x==="-g"||x==="--groupby")&&y+1<e.length?r=e[++y].split(",").map(k=>k.trim()):x.startsWith("-")||(t?s?o.push(x):s=x:t=x)}if(!t||!s)return{stdout:"",stderr:`xan pivot: usage: xan pivot COLUMN AGG_EXPR [OPTIONS] [FILE]
|
|
48
|
+
`,exitCode:1};let{headers:a,data:d,error:u}=await v(o,n);if(u)return u;if(!a.includes(t))return{stdout:"",stderr:`xan pivot: column '${t}' not found
|
|
49
|
+
`,exitCode:1};let p=s.match(/^(\w+)\((\w+)\)$/);if(!p)return{stdout:"",stderr:`xan pivot: invalid aggregation expression '${s}'
|
|
50
|
+
`,exitCode:1};let[,c,h]=p;r.length===0&&(r=a.filter(y=>y!==t&&y!==h));let l=[];for(let y of d){let x=String(y[t]??"");l.includes(x)||l.push(x)}let i=new Map,f=[];for(let y of d){let x=r.map(A=>String(y[A]??"")).join("\0"),k=String(y[t]??""),N=y[h];i.has(x)||(i.set(x,new Map),f.push(x));let C=i.get(x);C&&(C.has(k)||C.set(k,[]),C.get(k)?.push(N))}let m=[...r,...l],g=[];for(let y of f){let x=y.split("\0"),k=i.get(y);if(!k)continue;let N=F();for(let C=0;C<r.length;C++)b(N,r[C],x[C]);for(let C of l){let A=k.get(C)||[];b(N,C,ut(c,A))}g.push(N)}return{stdout:w(m,g),stderr:"",exitCode:0}}function ut(e,n){let t=n.filter(s=>s!=null).map(s=>typeof s=="number"?s:Number.parseFloat(String(s))).filter(s=>!Number.isNaN(s));switch(e){case"count":return n.length;case"sum":return t.reduce((s,r)=>s+r,0);case"mean":case"avg":return t.length>0?t.reduce((s,r)=>s+r,0)/t.length:null;case"min":return t.length>0?Math.min(...t):null;case"max":return t.length>0?Math.max(...t):null;case"first":return n.length>0?String(n[0]??""):null;case"last":return n.length>0?String(n[n.length-1]??""):null;default:return null}}async function Me(e,n){let t="",s=[];for(let d=0;d<e.length;d++){let u=e[d];(u==="-s"||u==="--sort")&&d+1<e.length?t=e[++d]:u.startsWith("-")||s.push(u)}if(s.length<2)return{stdout:"",stderr:`xan merge: usage: xan merge [OPTIONS] FILE1 FILE2 ...
|
|
51
|
+
`,exitCode:1};let r=[],o=null;for(let d of s){let u=await v([d],n);if(u.error)return u.error;if(o===null)o=u.headers;else if(JSON.stringify(o)!==JSON.stringify(u.headers))return{stdout:"",stderr:`xan merge: all files must have the same headers
|
|
52
|
+
`,exitCode:1};r.push({headers:u.headers,data:u.data})}if(!o)return{stdout:"",stderr:"",exitCode:0};let a=[];for(let{data:d}of r)a=a.concat(d);if(t){if(!o.includes(t))return{stdout:"",stderr:`xan merge: column '${t}' not found
|
|
53
|
+
`,exitCode:1};a.sort((d,u)=>{let p=d[t],c=u[t],h=typeof p=="number"?p:Number.parseFloat(String(p)),l=typeof c=="number"?c:Number.parseFloat(String(c));return!Number.isNaN(h)&&!Number.isNaN(l)?h-l:String(p??"").localeCompare(String(c??""))})}return{stdout:w(o,a),stderr:"",exitCode:0}}V();async function $e(e,n){let t=e.filter(u=>!u.startsWith("-")),{headers:s,data:r,error:o}=await v(t,n);return o||(r.length===0?{stdout:"",stderr:"",exitCode:0}:{stdout:r.map(u=>s.map(p=>u[p])).map(u=>u.map(p=>ct(p)).join(",")).join(`
|
|
54
|
+
`)+`
|
|
55
|
+
`,stderr:"",exitCode:0})}function ct(e){if(e==null)return"";let n=String(e);return n.includes(",")||n.includes('"')||n.includes(`
|
|
56
|
+
`)?`"${n.replace(/"/g,'""')}"`:n}async function Te(e,n){let t=null,s=null,r=[];for(let l=0;l<e.length;l++){let i=e[l];if(i==="--seed"&&l+1<e.length)s=Number.parseInt(e[++l],10);else if(!i.startsWith("-")){let f=Number.parseInt(i,10);t===null&&!Number.isNaN(f)&&f>0?t=f:r.push(i)}}if(t===null)return{stdout:"",stderr:`xan sample: usage: xan sample <sample-size> [FILE]
|
|
57
|
+
`,exitCode:1};let{headers:o,data:a,error:d}=await v(r,n);if(d)return d;if(a.length<=t)return{stdout:w(o,a),stderr:"",exitCode:0};let u=s!==null?s:Date.now(),p=()=>(u=u*1103515245+12345&2147483647,u/2147483647),c=a.map((l,i)=>i);for(let l=c.length-1;l>0;l--){let i=Math.floor(p()*(l+1));[c[l],c[i]]=[c[i],c[l]]}let h=c.slice(0,t).sort((l,i)=>l-i).map(l=>a[l]);return{stdout:w(o,h),stderr:"",exitCode:0}}async function je(e,n){let t=!1,s=[];for(let u=0;u<e.length;u++){let p=e[u];p==="-p"||p==="--pad"?t=!0:p.startsWith("-")||s.push(p)}if(s.length===0)return{stdout:"",stderr:`xan cat: no files specified
|
|
58
|
+
`,exitCode:1};let r=await _e(n,s,{cmdName:"xan cat",stopOnError:!0});if(r.exitCode!==0)return{stdout:"",stderr:r.stderr,exitCode:r.exitCode};let o=[],a=[];for(let{content:u}of r.files){let{headers:p,data:c}=He(_(u));o.push({headers:p,data:c});for(let h of p)a.includes(h)||a.push(h)}if(!t){let u=JSON.stringify(o[0].headers);for(let p=1;p<o.length;p++)if(JSON.stringify(o[p].headers)!==u)return{stdout:"",stderr:`xan cat: headers do not match (use -p to pad)
|
|
59
|
+
`,exitCode:1};a=o[0].headers}let d=[];for(let{headers:u,data:p}of o)for(let c of p){let h=F();for(let l of a)b(h,l,u.includes(l)?c[l]:"");d.push(h)}return{stdout:w(a,d),stderr:"",exitCode:0}}async function De(e,n){let t="",s=[],r=!1,o=!1,a=[];for(let i=0;i<e.length;i++){let f=e[i];(f==="-s"||f==="--select")&&i+1<e.length?s=e[++i].split(","):f==="-v"||f==="--invert"?r=!0:f==="-i"||f==="--ignore-case"?o=!0:f==="-r"||f==="--regex"||f.startsWith("-")||(t?a.push(f):t=f)}if(!t)return{stdout:"",stderr:`xan search: no pattern specified
|
|
60
|
+
`,exitCode:1};let{headers:d,data:u,error:p}=await v(a,n);if(p)return p;let c=s.length>0?s:d,h;try{h=J(t,o?"i":"")}catch{return{stdout:"",stderr:`xan search: invalid regex pattern '${t}'
|
|
61
|
+
`,exitCode:1}}let l=u.filter(i=>{let f=c.some(m=>{let g=i[m];return g!=null&&h.test(String(g))});return r?!f:f});return{stdout:w(d,l),stderr:"",exitCode:0}}async function Ue(e,n){let t="",s=[];for(let l of e)l.startsWith("-")||(t?s.push(l):t=l);if(!t)return{stdout:"",stderr:`xan flatmap: no expression specified
|
|
62
|
+
`,exitCode:1};let{headers:r,data:o,error:a}=await v(s,n);if(a)return a;let u=U(t).map(({expr:l,name:i})=>({alias:typeof i=="string"?i:i[0],ast:O(l)})),p={limits:n.limits?{maxIterations:n.limits.maxJqIterations}:void 0},c=[...r,...u.map(l=>l.alias)],h=[];for(let l of o){let i=[],f=1;for(let m of u){let g=$(l,m.ast,p),y=g.length>0&&Array.isArray(g[0])?g[0]:g;i.push(y),f=Math.max(f,y.length)}for(let m=0;m<f;m++){let g=M(l);for(let y=0;y<u.length;y++){let x=i[y][m]??null;b(g,u[y].alias,x)}h.push(g)}}return{stdout:w(c,h),stderr:"",exitCode:0}}async function Ve(e,n){let{cmdView:t}=await import("./xan-view-HDVKHFC2.js");return t(e,n)}var Qe=new Set(["fuzzy-join","glob","hist","input","parallel","plot","progress","range","scrape","tokenize","union-find"]),pt=new Set(["agg","behead","cat","count","dedup","drop","enum","explode","f","filter","fixlengths","flatmap","flatten","fmt","frequency","freq","from","groupby","head","headers","implode","join","map","merge","partition","pivot","rename","reverse","sample","search","select","shuffle","slice","sort","split","stats","tail","to","top","transform","transpose","view",...Qe]),Ze={name:"xan",summary:"CSV toolkit for data manipulation",usage:"xan <COMMAND> [OPTIONS] [FILE]",description:`xan is a collection of commands for working with CSV data.
|
|
63
|
+
It provides a simple, ergonomic interface for common data operations.
|
|
64
|
+
|
|
65
|
+
COMMANDS:
|
|
66
|
+
Core:
|
|
67
|
+
headers Show column names
|
|
68
|
+
count Count rows
|
|
69
|
+
head Show first N rows
|
|
70
|
+
tail Show last N rows
|
|
71
|
+
slice Extract row range
|
|
72
|
+
reverse Reverse row order
|
|
73
|
+
behead Remove header row
|
|
74
|
+
sample Random sample of rows
|
|
75
|
+
|
|
76
|
+
Column operations:
|
|
77
|
+
select Select columns (supports glob, ranges, negation)
|
|
78
|
+
drop Drop columns
|
|
79
|
+
rename Rename columns
|
|
80
|
+
enum Add row index column
|
|
81
|
+
|
|
82
|
+
Row operations:
|
|
83
|
+
filter Filter rows by expression
|
|
84
|
+
search Filter rows by regex match
|
|
85
|
+
sort Sort rows
|
|
86
|
+
dedup Remove duplicates
|
|
87
|
+
top Get top N by column
|
|
88
|
+
|
|
89
|
+
Transformations:
|
|
90
|
+
map Add computed columns
|
|
91
|
+
transform Modify existing columns
|
|
92
|
+
explode Split column into multiple rows
|
|
93
|
+
implode Combine rows, join column values
|
|
94
|
+
flatmap Map returning multiple rows
|
|
95
|
+
pivot Reshape rows into columns
|
|
96
|
+
transpose Swap rows and columns
|
|
97
|
+
|
|
98
|
+
Aggregation:
|
|
99
|
+
agg Aggregate values
|
|
100
|
+
groupby Group and aggregate
|
|
101
|
+
frequency Count value occurrences
|
|
102
|
+
stats Show column statistics
|
|
103
|
+
|
|
104
|
+
Multi-file:
|
|
105
|
+
cat Concatenate CSV files
|
|
106
|
+
join Join two CSV files on key
|
|
107
|
+
merge Merge sorted CSV files
|
|
108
|
+
split Split into multiple files
|
|
109
|
+
partition Split by column value
|
|
110
|
+
|
|
111
|
+
Data conversion:
|
|
112
|
+
to Convert CSV to other formats (json)
|
|
113
|
+
from Convert other formats to CSV (json)
|
|
114
|
+
shuffle Randomly reorder rows
|
|
115
|
+
fixlengths Fix ragged CSV files
|
|
116
|
+
|
|
117
|
+
Output:
|
|
118
|
+
view Pretty print as table
|
|
119
|
+
flatten Display records vertically (alias: f)
|
|
120
|
+
fmt Format output
|
|
121
|
+
|
|
122
|
+
EXAMPLES:
|
|
123
|
+
xan headers data.csv
|
|
124
|
+
xan count data.csv
|
|
125
|
+
xan head -n 5 data.csv
|
|
126
|
+
xan select name,email data.csv
|
|
127
|
+
xan select 'vec_*' data.csv # glob pattern
|
|
128
|
+
xan select 'a:c' data.csv # column range
|
|
129
|
+
xan filter 'age > 30' data.csv
|
|
130
|
+
xan search -r '^foo' data.csv
|
|
131
|
+
xan sort -N price data.csv
|
|
132
|
+
xan agg 'sum(amount) as total' data.csv
|
|
133
|
+
xan groupby region 'count() as n' data.csv
|
|
134
|
+
xan explode tags data.csv
|
|
135
|
+
xan join id file1.csv id file2.csv
|
|
136
|
+
xan pivot year 'sum(sales)' data.csv`,options:[" --help display this help and exit"]},ft={headers:{name:"xan headers",summary:"Show column names",usage:"xan headers [OPTIONS] [FILE]",description:"Display column names from a CSV file.",options:["-j, --just-names show names only (no index)"]},count:{name:"xan count",summary:"Count rows",usage:"xan count [FILE]",description:"Count the number of data rows (excluding header).",options:[]},filter:{name:"xan filter",summary:"Filter rows by expression",usage:"xan filter [OPTIONS] EXPR [FILE]",description:"Filter CSV rows using moonblade expressions.",options:["-v, --invert invert match","-l, --limit N limit output rows"]},search:{name:"xan search",summary:"Filter rows by regex",usage:"xan search [OPTIONS] PATTERN [FILE]",description:"Filter CSV rows by regex match on columns.",options:["-s, --select COLS search only these columns","-v, --invert invert match","-i, --ignore-case case insensitive"]},select:{name:"xan select",summary:"Select columns",usage:"xan select COLS [FILE]",description:"Select columns by name, index, glob, or range.",options:["Supports: col names, indices (0,1), ranges (a:c), globs (vec_*), negation (!col)"]},explode:{name:"xan explode",summary:"Split column into rows",usage:"xan explode COLUMN [OPTIONS] [FILE]",description:"Split delimited column values into multiple rows.",options:["-s, --separator SEP separator (default: |)","--drop-empty drop empty values","-r, --rename NAME rename column"]},implode:{name:"xan implode",summary:"Combine rows",usage:"xan implode COLUMN [OPTIONS] [FILE]",description:"Combine consecutive rows, joining column values.",options:["-s, --sep SEP separator (default: |)","-r, --rename NAME rename column"]},join:{name:"xan join",summary:"Join CSV files",usage:"xan join KEY1 FILE1 KEY2 FILE2 [OPTIONS]",description:"Join two CSV files on key columns.",options:["--left left outer join","--right right outer join","--full full outer join","-D, --default VAL default for missing"]},pivot:{name:"xan pivot",summary:"Reshape to columns",usage:"xan pivot COLUMN AGG_EXPR [OPTIONS] [FILE]",description:"Turn row values into columns.",options:["-g, --groupby COLS group by columns"]}},yn={name:"xan",async execute(e,n){if(e.length===0||G(e))return D(Ze);let t=e[0],s=e.slice(1);if(G(s)){let r=ft[t];return r?D(r):D(Ze)}if(Qe.has(t))return{stdout:"",stderr:`xan ${t}: not yet implemented
|
|
137
|
+
`,exitCode:1};switch(t){case"headers":return ce(s,n);case"count":return pe(s,n);case"head":return fe(s,n);case"tail":return de(s,n);case"slice":return he(s,n);case"reverse":return me(s,n);case"behead":return $e(s,n);case"sample":return Te(s,n);case"select":return ie(s,n);case"drop":return ae(s,n);case"rename":return le(s,n);case"enum":return ue(s,n);case"filter":return ke(s,n);case"search":return De(s,n);case"sort":return Ie(s,n);case"dedup":return Ne(s,n);case"top":return Ee(s,n);case"map":return Ae(s,n);case"transform":return Fe(s,n);case"explode":return Oe(s,n);case"implode":return Le(s,n);case"flatmap":return Ue(s,n);case"pivot":return Re(s,n);case"agg":return ne(s,n);case"groupby":return se(s,n);case"frequency":case"freq":return re(s,n);case"stats":return oe(s,n);case"cat":return je(s,n);case"join":return Pe(s,n);case"merge":return Me(s,n);case"split":return ve(s,n);case"partition":return Ce(s,n);case"to":return be(s,n);case"from":return Se(s,n);case"transpose":return ye(s,n);case"shuffle":return xe(s,n);case"fixlengths":return we(s,n);case"view":return Z(s,n);case"flatten":case"f":return Y(s,n);case"fmt":return Ve(s,n);default:return pt.has(t)?{stdout:"",stderr:`xan ${t}: not yet implemented
|
|
138
|
+
`,exitCode:1}:{stdout:"",stderr:`xan: unknown command '${t}'
|
|
139
|
+
Run 'xan --help' for usage.
|
|
140
|
+
`,exitCode:1}}}},xn={name:"xan",flags:[],stdinType:"text",needsArgs:!0};export{yn as a,xn as b};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import{createRequire} from"node:module";const require=createRequire(import.meta.url);
|
|
2
|
+
function s(t){let e=`${t.name} - ${t.summary}
|
|
3
|
+
|
|
4
|
+
`;if(e+=`Usage: ${t.usage}
|
|
5
|
+
`,t.description){if(e+=`
|
|
6
|
+
Description:
|
|
7
|
+
`,typeof t.description=="string")for(let n of t.description.split(`
|
|
8
|
+
`))e+=n?` ${n}
|
|
9
|
+
`:`
|
|
10
|
+
`;else if(t.description.length>0)for(let n of t.description)e+=n?` ${n}
|
|
11
|
+
`:`
|
|
12
|
+
`}if(t.options&&t.options.length>0){e+=`
|
|
13
|
+
Options:
|
|
14
|
+
`;for(let n of t.options)e+=` ${n}
|
|
15
|
+
`}if(t.examples&&t.examples.length>0){e+=`
|
|
16
|
+
Examples:
|
|
17
|
+
`;for(let n of t.examples)e+=` ${n}
|
|
18
|
+
`}if(t.notes&&t.notes.length>0){e+=`
|
|
19
|
+
Notes:
|
|
20
|
+
`;for(let n of t.notes)e+=` ${n}
|
|
21
|
+
`}return{stdout:e,stderr:"",exitCode:0}}function o(t){return t.includes("--help")}function r(t,e){return{stdout:"",stderr:e.startsWith("--")?`${t}: unrecognized option '${e}'
|
|
22
|
+
`:`${t}: invalid option -- '${e.replace(/^-/,"")}'
|
|
23
|
+
`,exitCode:1}}export{s as a,o as b,r as c};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import{createRequire} from"node:module";const require=createRequire(import.meta.url);
|
|
2
|
+
import{c as p}from"./chunk-QAYAQNCG.js";function x(a,i,d){let g=new Map,h=new Map;for(let[t,e]of Object.entries(d)){let n={name:t,type:e.type};e.short&&g.set(e.short,n),e.long&&h.set(e.long,n)}let s=Object.create(null);for(let[t,e]of Object.entries(d))e.default!==void 0?s[t]=e.default:e.type==="boolean"&&(s[t]=!1);let b=[],k=!1;for(let t=0;t<i.length;t++){let e=i[t];if(k||!e.startsWith("-")||e==="-"){b.push(e);continue}if(e==="--"){k=!0;continue}if(e.startsWith("--")){let n=e.indexOf("="),o,r;n!==-1?(o=e.slice(2,n),r=e.slice(n+1)):o=e.slice(2);let l=h.get(o);if(!l)return{ok:!1,error:p(a,e)};let{name:f,type:u}=l;if(u==="boolean")s[f]=!0;else{if(r===void 0){if(t+1>=i.length)return{ok:!1,error:{stdout:"",stderr:`${a}: option '--${o}' requires an argument
|
|
3
|
+
`,exitCode:1}};r=i[++t]}s[f]=u==="number"?parseInt(r,10):r}}else{let n=e.slice(1);for(let o=0;o<n.length;o++){let r=n[o],l=g.get(r);if(!l)return{ok:!1,error:p(a,`-${r}`)};let{name:f,type:u}=l;if(u==="boolean")s[f]=!0;else{let c;if(o+1<n.length)c=n.slice(o+1);else if(t+1<i.length)c=i[++t];else return{ok:!1,error:{stdout:"",stderr:`${a}: option requires an argument -- '${r}'
|
|
4
|
+
`,exitCode:1}};s[f]=u==="number"?parseInt(c,10):c;break}}}}return{ok:!0,result:{flags:s,positional:b}}}export{x as a};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import{createRequire} from"node:module";const require=createRequire(import.meta.url);
|
|
2
|
+
import{a as H}from"./chunk-QIQMJJZ4.js";import{a as x,b as E}from"./chunk-QAYAQNCG.js";import{minimatch as R}from"minimatch";function M(n){if(n<1024)return String(n);if(n<1024*1024){let c=n/1024;return c<10?`${c.toFixed(1)}K`:`${Math.round(c)}K`}if(n<1024*1024*1024){let c=n/1048576;return c<10?`${c.toFixed(1)}M`:`${Math.round(c)}M`}let s=n/(1024*1024*1024);return s<10?`${s.toFixed(1)}G`:`${Math.round(s)}G`}function T(n){let c=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"][n.getMonth()],w=String(n.getDate()).padStart(2," "),S=new Date,y=new Date(S.getTime()-4320*60*60*1e3);if(n>y){let b=String(n.getHours()).padStart(2,"0"),g=String(n.getMinutes()).padStart(2,"0");return`${c} ${w} ${b}:${g}`}let P=n.getFullYear();return`${c} ${w} ${P}`}function C(n){return n.isDirectory?"/":n.isSymbolicLink?"@":(n.mode&73)!==0?"*":""}var k={name:"ls",summary:"list directory contents",usage:"ls [OPTION]... [FILE]...",options:["-a, --all do not ignore entries starting with .","-A, --almost-all do not list . and ..","-d, --directory list directories themselves, not their contents","-F, --classify append indicator (one of */=>@) to entries","-h, --human-readable with -l, print sizes like 1K 234M 2G etc.","-l use a long listing format","-r, --reverse reverse order while sorting","-R, --recursive list subdirectories recursively","-S sort by file size, largest first","-t sort by time, newest first","-1 list one file per line"," --help display this help and exit"]},G={showAll:{short:"a",long:"all",type:"boolean"},showAlmostAll:{short:"A",long:"almost-all",type:"boolean"},longFormat:{short:"l",type:"boolean"},humanReadable:{short:"h",long:"human-readable",type:"boolean"},recursive:{short:"R",long:"recursive",type:"boolean"},reverse:{short:"r",long:"reverse",type:"boolean"},sortBySize:{short:"S",type:"boolean"},classifyFiles:{short:"F",long:"classify",type:"boolean"},directoryOnly:{short:"d",long:"directory",type:"boolean"},sortByTime:{short:"t",type:"boolean"},onePerLine:{short:"1",type:"boolean"}},Z={name:"ls",async execute(n,s){if(E(n))return x(k);let c=H("ls",n,G);if(!c.ok)return c.error;let w=c.result.flags.showAll,S=c.result.flags.showAlmostAll,y=c.result.flags.longFormat,P=c.result.flags.humanReadable,b=c.result.flags.recursive,g=c.result.flags.reverse,v=c.result.flags.sortBySize,$=c.result.flags.classifyFiles,A=c.result.flags.directoryOnly,p=c.result.flags.sortByTime;c.result.flags.onePerLine;let r=c.result.positional;r.length===0&&r.push(".");let a="",l="",u=0;for(let f=0;f<r.length;f++){let o=r[f];if(f>0&&a&&!a.endsWith(`
|
|
3
|
+
|
|
4
|
+
`)&&(a+=`
|
|
5
|
+
`),A){let i=s.fs.resolvePath(s.cwd,o);try{let t=await s.fs.stat(i);if(y){let e=t.isDirectory?"drwxr-xr-x":"-rw-r--r--",d=$?C(await s.fs.lstat(i)):t.isDirectory?"/":"",h=t.size??0,m=P?M(h).padStart(5):String(h).padStart(5),z=t.mtime??new Date(0),F=T(z);a+=`${e} 1 user user ${m} ${F} ${o}${d}
|
|
6
|
+
`}else{let e=$?C(await s.fs.lstat(i)):"";a+=`${o}${e}
|
|
7
|
+
`}}catch{l+=`ls: cannot access '${o}': No such file or directory
|
|
8
|
+
`,u=2}continue}if(o.includes("*")||o.includes("?")||o.includes("[")){let i=await _(o,s,w,S,y,g,P,v,$);a+=i.stdout,l+=i.stderr,i.exitCode!==0&&(u=i.exitCode)}else{let i=await O(o,s,w,S,y,b,r.length>1,g,P,v,$);a+=i.stdout,l+=i.stderr,i.exitCode!==0&&(u=i.exitCode)}}return{stdout:a,stderr:l,exitCode:u}}};async function _(n,s,c,w,S,y=!1,P=!1,b=!1,g=!1){let v=c||w,$=s.fs.getAllPaths(),A=s.fs.resolvePath(s.cwd,"."),p=[];for(let r of $){let a=r.startsWith(A)&&r.slice(A.length+1)||r;if(R(a,n)||R(r,n)){let l=a.split("/").pop()||a;if(!v&&l.startsWith("."))continue;p.push(a||r)}}if(p.length===0)return{stdout:"",stderr:`ls: ${n}: No such file or directory
|
|
9
|
+
`,exitCode:2};if(b){let r=[];for(let a of p){let l=s.fs.resolvePath(s.cwd,a);try{let u=await s.fs.stat(l);r.push({path:a,size:u.size??0})}catch{r.push({path:a,size:0})}}r.sort((a,l)=>l.size-a.size),p.length=0,p.push(...r.map(a=>a.path))}else p.sort();if(y&&p.reverse(),S){let r=[];for(let a of p){let l=s.fs.resolvePath(s.cwd,a);try{let u=await s.fs.stat(l),f=u.isDirectory?"drwxr-xr-x":"-rw-r--r--",o=g?C(await s.fs.lstat(l)):u.isDirectory?"/":"",i=u.size??0,t=P?M(i).padStart(5):String(i).padStart(5),e=u.mtime??new Date(0),d=T(e);r.push(`${f} 1 user user ${t} ${d} ${a}${o}`)}catch{r.push(`-rw-r--r-- 1 user user 0 Jan 1 00:00 ${a}`)}}return{stdout:`${r.join(`
|
|
10
|
+
`)}
|
|
11
|
+
`,stderr:"",exitCode:0}}if(g){let r=[];for(let a of p){let l=s.fs.resolvePath(s.cwd,a);try{let u=await s.fs.lstat(l);r.push(`${a}${C(u)}`)}catch{r.push(a)}}return{stdout:`${r.join(`
|
|
12
|
+
`)}
|
|
13
|
+
`,stderr:"",exitCode:0}}return{stdout:`${p.join(`
|
|
14
|
+
`)}
|
|
15
|
+
`,stderr:"",exitCode:0}}async function O(n,s,c,w,S,y,P,b=!1,g=!1,v=!1,$=!1,A=!1){let p=c||w,r=s.fs.resolvePath(s.cwd,n);try{let a=await s.fs.stat(r);if(!a.isDirectory){let f=$?C(await s.fs.lstat(r)):"";if(S){let o=a.size??0,i=g?M(o).padStart(5):String(o).padStart(5),t=a.mtime??new Date(0),e=T(t);return{stdout:`-rw-r--r-- 1 user user ${i} ${e} ${n}${f}
|
|
16
|
+
`,stderr:"",exitCode:0}}return{stdout:`${n}${f}
|
|
17
|
+
`,stderr:"",exitCode:0}}let l=await s.fs.readdir(r);if(p||(l=l.filter(f=>!f.startsWith("."))),v){let f=[];for(let o of l){let i=r==="/"?`/${o}`:`${r}/${o}`;try{let t=await s.fs.stat(i);f.push({name:o,size:t.size??0})}catch{f.push({name:o,size:0})}}f.sort((o,i)=>i.size-o.size),l=f.map(o=>o.name)}else l.sort();c&&(l=[".","..",...l]),b&&l.reverse();let u="";if((y||P)&&(u+=`${n}:
|
|
18
|
+
`),S){u+=`total ${l.length}
|
|
19
|
+
`;let f=l.filter(e=>e==="."||e===".."),o=l.filter(e=>e!=="."&&e!=="..");for(let e of f)u+=`drwxr-xr-x 1 user user 0 Jan 1 00:00 ${e}
|
|
20
|
+
`;let i=[];for(let e=0;e<o.length;e+=100){let d=o.slice(e,e+100),h=await Promise.all(d.map(async m=>{let z=r==="/"?`/${m}`:`${r}/${m}`;try{let F=await s.fs.stat(z),B=F.isDirectory?"drwxr-xr-x":"-rw-r--r--",J=$?C(await s.fs.lstat(z)):F.isDirectory?"/":"",W=F.size??0,j=g?M(W).padStart(5):String(W).padStart(5),L=F.mtime??new Date(0),N=T(L);return{name:m,line:`${B} 1 user user ${j} ${N} ${m}${J}
|
|
21
|
+
`}}catch{return{name:m,line:`-rw-r--r-- 1 user user 0 Jan 1 00:00 ${m}
|
|
22
|
+
`}}}));i.push(...h)}let t=new Map(o.map((e,d)=>[e,d]));i.sort((e,d)=>(t.get(e.name)??0)-(t.get(d.name)??0));for(let{line:e}of i)u+=e}else if($){let f=[],o=l.filter(t=>t!=="."&&t!==".."),i=l.filter(t=>t==="."||t==="..");for(let t of i)f.push(`${t}/`);for(let t=0;t<o.length;t+=100){let e=o.slice(t,t+100),d=await Promise.all(e.map(async h=>{let m=r==="/"?`/${h}`:`${r}/${h}`;try{let z=await s.fs.lstat(m);return`${h}${C(z)}`}catch{return h}}));f.push(...d)}u+=f.join(`
|
|
23
|
+
`)+(f.length?`
|
|
24
|
+
`:"")}else u+=l.join(`
|
|
25
|
+
`)+(l.length?`
|
|
26
|
+
`:"");if(y){let f=l.filter(t=>t!=="."&&t!==".."),o=[];if(s.fs.readdirWithFileTypes)o=(await s.fs.readdirWithFileTypes(r)).filter(e=>e.isDirectory&&f.includes(e.name)).map(e=>({name:e.name,isDirectory:!0}));else for(let t=0;t<f.length;t+=100){let e=f.slice(t,t+100),d=await Promise.all(e.map(async h=>{let m=r==="/"?`/${h}`:`${r}/${h}`;try{let z=await s.fs.stat(m);return{name:h,isDirectory:z.isDirectory}}catch{return{name:h,isDirectory:!1}}}));o.push(...d.filter(h=>h.isDirectory))}o.sort((t,e)=>t.name.localeCompare(e.name)),b&&o.reverse();let i=[];for(let t=0;t<o.length;t+=100){let e=o.slice(t,t+100),d=await Promise.all(e.map(async h=>{let m=n==="."?`./${h.name}`:`${n}/${h.name}`,z=await O(m,s,c,w,S,y,!1,b,g,v,$,!0);return{name:h.name,result:z}}));i.push(...d)}i.sort((t,e)=>t.name.localeCompare(e.name)),b&&i.reverse();for(let{result:t}of i)u+=`
|
|
27
|
+
`,u+=t.stdout}return{stdout:u,stderr:"",exitCode:0}}catch{return{stdout:"",stderr:`ls: ${n}: No such file or directory
|
|
28
|
+
`,exitCode:2}}}var q={name:"ls",flags:[{flag:"-a",type:"boolean"},{flag:"-A",type:"boolean"},{flag:"-l",type:"boolean"},{flag:"-h",type:"boolean"},{flag:"-R",type:"boolean"},{flag:"-r",type:"boolean"},{flag:"-S",type:"boolean"},{flag:"-F",type:"boolean"},{flag:"-d",type:"boolean"},{flag:"-t",type:"boolean"},{flag:"-1",type:"boolean"}],needsFiles:!0};export{Z as a,q as b};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import{createRequire} from"node:module";const require=createRequire(import.meta.url);
|
|
2
|
+
import{c}from"./chunk-NRSASXYY.js";import{a as u,b as f,c as h}from"./chunk-QAYAQNCG.js";import p from"turndown";var w={name:"html-to-markdown",summary:"convert HTML to Markdown (BashEnv extension)",usage:"html-to-markdown [OPTION]... [FILE]",description:["Convert HTML content to Markdown format using the turndown library.","This is a non-standard BashEnv extension command, not available in regular bash.","","Read HTML from FILE or standard input and output Markdown to standard output.","Commonly used with curl to convert web pages:"," curl -s https://example.com | html-to-markdown","","Supported HTML elements:"," - Headings (h1-h6) \u2192 # Markdown headings"," - Paragraphs (p) \u2192 Plain text with blank lines"," - Links (a) \u2192 [text](url)"," - Images (img) \u2192 "," - Bold/Strong \u2192 **text**"," - Italic/Em \u2192 _text_"," - Code (code, pre) \u2192 `inline` or fenced blocks"," - Lists (ul, ol, li) \u2192 - or 1. items"," - Blockquotes \u2192 > quoted text"," - Horizontal rules (hr) \u2192 ---"],options:["-b, --bullet=CHAR bullet character for unordered lists (-, +, or *)","-c, --code=FENCE fence style for code blocks (``` or ~~~)","-r, --hr=STRING string for horizontal rules (default: ---)"," --heading-style=STYLE"," heading style: 'atx' for # headings (default),"," 'setext' for underlined headings (h1/h2 only)"," --help display this help and exit"],examples:["echo '<h1>Hello</h1><p>World</p>' | html-to-markdown","html-to-markdown page.html","curl -s https://example.com | html-to-markdown > page.md"]},y={name:"html-to-markdown",async execute(r,n){if(f(r))return u(w);let s="-",a="```",i="---",m="atx",o=[];for(let e=0;e<r.length;e++){let t=r[e];if(t==="-b"||t==="--bullet")s=r[++e]??"-";else if(t.startsWith("--bullet="))s=t.slice(9);else if(t==="-c"||t==="--code")a=r[++e]??"```";else if(t.startsWith("--code="))a=t.slice(7);else if(t==="-r"||t==="--hr")i=r[++e]??"---";else if(t.startsWith("--hr="))i=t.slice(5);else if(t.startsWith("--heading-style=")){let d=t.slice(16);(d==="setext"||d==="atx")&&(m=d)}else if(t==="-")o.push("-");else{if(t.startsWith("--"))return h("html-to-markdown",t);if(t.startsWith("-"))return h("html-to-markdown",t);o.push(t)}}let l;if(o.length===0||o.length===1&&o[0]==="-")l=c(n.stdin);else try{let e=n.fs.resolvePath(n.cwd,o[0]);l=await n.fs.readFile(e)}catch{return{stdout:"",stderr:`html-to-markdown: ${o[0]}: No such file or directory
|
|
3
|
+
`,exitCode:1}}if(!l.trim())return{stdout:"",stderr:"",exitCode:0};try{let e=new p({bulletListMarker:s,codeBlockStyle:"fenced",fence:a,hr:i,headingStyle:m});return e.remove(["script","style","footer"]),{stdout:`${e.turndown(l).trim()}
|
|
4
|
+
`,stderr:"",exitCode:0}}catch(e){return{stdout:"",stderr:`html-to-markdown: conversion error: ${e.message}
|
|
5
|
+
`,exitCode:1}}}},b={name:"html-to-markdown",flags:[],stdinType:"text"};export{y as a,b};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import{createRequire} from"node:module";const require=createRequire(import.meta.url);
|
|
2
|
+
import{c as f}from"./chunk-NRSASXYY.js";import{a,b as c,c as d}from"./chunk-QAYAQNCG.js";var u={name:"rev",summary:"reverse lines characterwise",usage:"rev [file ...]",description:"Copies the specified files to standard output, reversing the order of characters in every line. If no files are specified, standard input is read.",examples:["echo 'hello' | rev # Output: olleh","rev file.txt # Reverse each line in file"]};function p(r){return Array.from(r).reverse().join("")}var g={name:"rev",execute:async(r,s)=>{if(c(r))return a(u);let o=[];for(let e of r)if(e==="--"){let t=r.indexOf(e);o.push(...r.slice(t+1));break}else{if(e.startsWith("-")&&e!=="-")return d("rev",e);o.push(e)}let n="",l=e=>{let t=e.split(`
|
|
3
|
+
`),i=e.endsWith(`
|
|
4
|
+
`)&&t[t.length-1]==="";return i&&t.pop(),t.map(p).join(`
|
|
5
|
+
`)+(i?`
|
|
6
|
+
`:"")};if(o.length===0){let e=f(s.stdin)??"";n=l(e)}else for(let e of o)if(e==="-"){let t=f(s.stdin)??"";n+=l(t)}else{let t=s.fs.resolvePath(s.cwd,e),i=await s.fs.readFile(t);if(i===null)return{exitCode:1,stdout:n,stderr:`rev: ${e}: No such file or directory
|
|
7
|
+
`};n+=l(i)}return{exitCode:0,stdout:n,stderr:""}}},y={name:"rev",flags:[],stdinType:"text",needsFiles:!0};export{g as a,y as b};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import{createRequire} from"node:module";const require=createRequire(import.meta.url);
|
|
2
|
+
var n=class extends Error{stdout;stderr;constructor(t,s="",e=""){super(t),this.stdout=s,this.stderr=e}prependOutput(t,s){this.stdout=t+this.stdout,this.stderr=s+this.stderr}},c=class extends n{levels;name="BreakError";constructor(t=1,s="",e=""){super("break",s,e),this.levels=t}},a=class extends n{levels;name="ContinueError";constructor(t=1,s="",e=""){super("continue",s,e),this.levels=t}},i=class extends n{exitCode;name="ReturnError";constructor(t=0,s="",e=""){super("return",s,e),this.exitCode=t}},u=class extends n{exitCode;name="ErrexitError";constructor(t,s="",e=""){super(`errexit: command exited with status ${t}`,s,e),this.exitCode=t}},x=class extends n{varName;name="NounsetError";constructor(t,s=""){super(`${t}: unbound variable`,s,`bash: ${t}: unbound variable
|
|
3
|
+
`),this.varName=t}},d=class extends n{exitCode;name="ExitError";constructor(t,s="",e=""){super("exit",s,e),this.exitCode=t}},p=class extends n{name="ArithmeticError";fatal;constructor(t,s="",e="",o=!1){super(t,s,e),this.stderr=e||`bash: ${t}
|
|
4
|
+
`,this.fatal=o}},l=class extends n{name="BadSubstitutionError";constructor(t,s="",e=""){super(t,s,e),this.stderr=e||`bash: ${t}: bad substitution
|
|
5
|
+
`}},h=class extends n{name="GlobError";constructor(t,s="",e=""){super(`no match: ${t}`,s,e),this.stderr=e||`bash: no match: ${t}
|
|
6
|
+
`}},m=class extends n{name="BraceExpansionError";constructor(t,s="",e=""){super(t,s,e),this.stderr=e||`bash: ${t}
|
|
7
|
+
`}},b=class extends n{limitType;name="ExecutionLimitError";static EXIT_CODE=126;constructor(t,s,e="",o=""){super(t,e,o),this.limitType=s,this.stderr=o||`bash: ${t}
|
|
8
|
+
`}},$=class extends n{name="ExecutionAbortedError";constructor(t="",s=""){super("execution aborted",t,s)}},f=class extends n{name="SubshellExitError";constructor(t="",s=""){super("subshell exit",t,s)}};function v(r){return r instanceof c||r instanceof a||r instanceof i}var C=class extends n{exitCode;name="PosixFatalError";constructor(t,s="",e=""){super("posix fatal error",s,e),this.exitCode=t}};export{c as a,a as b,i as c,u as d,x as e,d as f,p as g,l as h,h as i,m as j,b as k,$ as l,f as m,v as n,C as o};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import{createRequire} from"node:module";const require=createRequire(import.meta.url);
|
|
2
|
+
import{a as i}from"./chunk-TDD4NFYE.js";import{a as u}from"./chunk-QIQMJJZ4.js";import{a as g,b as m}from"./chunk-QAYAQNCG.js";var S={name:"stat",summary:"display file or file system status",usage:"stat [OPTION]... FILE...",options:["-c FORMAT use the specified FORMAT instead of the default"," --help display this help and exit"]},$={format:{short:"c",type:"string"}},A={name:"stat",async execute(n,a){if(m(n))return g(S);let o=u("stat",n,$);if(!o.ok)return o.error;let c=o.result.flags.format??null,f=o.result.positional;if(f.length===0)return{stdout:"",stderr:`stat: missing operand
|
|
3
|
+
`,exitCode:1};let r="",p="",d=!1;for(let s of f){let h=a.fs.resolvePath(a.cwd,s);try{let e=await a.fs.stat(h);if(c){let t=c,l=e.mode.toString(8),y=i(e.mode,e.isDirectory);t=t.replace(/%n/g,s),t=t.replace(/%N/g,`'${s}'`),t=t.replace(/%s/g,String(e.size)),t=t.replace(/%F/g,e.isDirectory?"directory":"regular file"),t=t.replace(/%a/g,l),t=t.replace(/%A/g,y),t=t.replace(/%u/g,"1000"),t=t.replace(/%U/g,"user"),t=t.replace(/%g/g,"1000"),t=t.replace(/%G/g,"group"),r+=`${t}
|
|
4
|
+
`}else{let t=e.mode.toString(8).padStart(4,"0"),l=i(e.mode,e.isDirectory);r+=` File: ${s}
|
|
5
|
+
`,r+=` Size: ${e.size} Blocks: ${Math.ceil(e.size/512)}
|
|
6
|
+
`,r+=`Access: (${t}/${l})
|
|
7
|
+
`,r+=`Modify: ${e.mtime.toISOString()}
|
|
8
|
+
`}}catch{p+=`stat: cannot stat '${s}': No such file or directory
|
|
9
|
+
`,d=!0}}return{stdout:r,stderr:p,exitCode:d?1:0}}},M={name:"stat",flags:[{flag:"-c",type:"value",valueHint:"format"},{flag:"-L",type:"boolean"}],needsArgs:!0};export{A as a,M as b};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import{createRequire} from"node:module";const require=createRequire(import.meta.url);
|
|
2
|
+
var o={name:"pwd",async execute(l,a){let t=!1;for(let e of l)if(e==="-P")t=!0;else if(e==="-L")t=!1;else{if(e==="--")break;e.startsWith("-")}let s=a.cwd;if(t)try{s=await a.fs.realpath(a.cwd)}catch{}return{stdout:`${s}
|
|
3
|
+
`,stderr:"",exitCode:0}}},f={name:"pwd",flags:[{flag:"-P",type:"boolean"},{flag:"-L",type:"boolean"}]};export{o as a,f as b};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import{createRequire} from"node:module";const require=createRequire(import.meta.url);
|
|
2
|
+
import{a as p}from"./chunk-QIQMJJZ4.js";import{a as g}from"./chunk-W5DWRFSU.js";var x=`Usage: rmdir [-pv] DIRECTORY...
|
|
3
|
+
Remove empty directories.
|
|
4
|
+
|
|
5
|
+
Options:
|
|
6
|
+
-p, --parents Remove DIRECTORY and its ancestors
|
|
7
|
+
-v, --verbose Output a diagnostic for every directory processed`,y={parents:{short:"p",long:"parents",type:"boolean"},verbose:{short:"v",long:"verbose",type:"boolean"},help:{long:"help",type:"boolean"}},D={name:"rmdir",async execute(t,r){let e=p("rmdir",t,y);if(!e.ok)return e.error;if(e.result.flags.help)return{stdout:`${x}
|
|
8
|
+
`,stderr:"",exitCode:0};let a=e.result.flags.parents,o=e.result.flags.verbose,s=e.result.positional;if(s.length===0)return{stdout:"",stderr:`rmdir: missing operand
|
|
9
|
+
`,exitCode:1};let c="",n="",i=0;for(let u of s){let d=await b(r,u,a,o);c+=d.stdout,n+=d.stderr,d.exitCode!==0&&(i=d.exitCode)}return{stdout:c,stderr:n,exitCode:i}}};async function b(t,r,e,a){let o="",s="",n=t.fs.resolvePath(t.cwd,r),i=await v(t,n,r,a);if(o+=i.stdout,s+=i.stderr,i.exitCode!==0)return{stdout:o,stderr:s,exitCode:i.exitCode};if(e){let u=n,d=r;for(;;){let l=C(u),f=C(d);if(l===u||l==="/"||l==="."||f==="."||f==="")break;let m=await v(t,l,f,a);if(o+=m.stdout,m.exitCode!==0)break;u=l,d=f}}return{stdout:o,stderr:s,exitCode:0}}async function v(t,r,e,a){try{if(!await t.fs.exists(r))return{stdout:"",stderr:`rmdir: failed to remove '${e}': No such file or directory
|
|
10
|
+
`,exitCode:1};if(!(await t.fs.stat(r)).isDirectory)return{stdout:"",stderr:`rmdir: failed to remove '${e}': Not a directory
|
|
11
|
+
`,exitCode:1};if((await t.fs.readdir(r)).length>0)return{stdout:"",stderr:`rmdir: failed to remove '${e}': Directory not empty
|
|
12
|
+
`,exitCode:1};await t.fs.rm(r,{recursive:!1,force:!1});let n="";return a&&(n=`rmdir: removing directory, '${e}'
|
|
13
|
+
`),{stdout:n,stderr:"",exitCode:0}}catch(o){let s=g(o);return{stdout:"",stderr:`rmdir: failed to remove '${e}': ${s}
|
|
14
|
+
`,exitCode:1}}}function C(t){let r=t.replace(/\/+$/,""),e=r.lastIndexOf("/");return e===-1?".":e===0?"/":r.substring(0,e)}var $={name:"rmdir",flags:[{flag:"-p",type:"boolean"},{flag:"-v",type:"boolean"}],needsArgs:!0};export{D as a,$ as b};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import{createRequire} from"node:module";const require=createRequire(import.meta.url);
|
|
2
|
+
import{c}from"./chunk-QAYAQNCG.js";function $(t,i){let r=10,s=null,o=!1,l=!1,n=!1,u=[];for(let f=0;f<t.length;f++){let e=t[f];if(e==="-n"&&f+1<t.length){let a=t[++f];i==="tail"&&a.startsWith("+")?(n=!0,r=parseInt(a.slice(1),10)):r=parseInt(a,10)}else if(i==="tail"&&e.startsWith("-n+"))n=!0,r=parseInt(e.slice(3),10);else if(e.startsWith("-n"))r=parseInt(e.slice(2),10);else if(e==="-c"&&f+1<t.length)s=parseInt(t[++f],10);else if(e.startsWith("-c"))s=parseInt(e.slice(2),10);else if(e.startsWith("--bytes="))s=parseInt(e.slice(8),10);else if(e.startsWith("--lines="))r=parseInt(e.slice(8),10);else if(e==="-q"||e==="--quiet"||e==="--silent")o=!0;else if(e==="-v"||e==="--verbose")l=!0;else if(e.match(/^-\d+$/))r=parseInt(e.slice(1),10);else{if(e.startsWith("--"))return{ok:!1,error:c(i,e)};if(e.startsWith("-")&&e!=="-")return{ok:!1,error:c(i,e)};u.push(e)}}return s!==null&&(Number.isNaN(s)||s<0)?{ok:!1,error:{stdout:"",stderr:`${i}: invalid number of bytes
|
|
3
|
+
`,exitCode:1}}:Number.isNaN(r)||r<0?{ok:!1,error:{stdout:"",stderr:`${i}: invalid number of lines
|
|
4
|
+
`,exitCode:1}}:{ok:!0,options:{lines:r,bytes:s,quiet:o,verbose:l,files:u,fromLine:n}}}async function g(t,i,r,s){let{quiet:o,verbose:l,files:n}=i;if(n.length===0)return{stdout:s(t.stdin),stderr:"",exitCode:0};let u="",f="",e=0,a=l||!o&&n.length>1,h=0;for(let p=0;p<n.length;p++){let d=n[p];try{let b=t.fs.resolvePath(t.cwd,d),x=await t.fs.readFile(b);a&&(h>0&&(u+=`
|
|
5
|
+
`),u+=`==> ${d} <==
|
|
6
|
+
`),u+=s(x),h++}catch{f+=`${r}: ${d}: No such file or directory
|
|
7
|
+
`,e=1}}return{stdout:u,stderr:f,exitCode:e}}function k(t,i,r){if(r!==null)return t.slice(0,r);if(i===0)return"";let s=0,o=0,l=t.length;for(;s<l&&o<i;){let n=t.indexOf(`
|
|
8
|
+
`,s);if(n===-1)return`${t}
|
|
9
|
+
`;o++,s=n+1}return s>0?t.slice(0,s):""}function v(t,i,r,s){if(r!==null)return t.slice(-r);let o=t.length;if(o===0)return"";if(s){let f=0,e=1;for(;f<o&&e<i;){let h=t.indexOf(`
|
|
10
|
+
`,f);if(h===-1)break;e++,f=h+1}let a=t.slice(f);return a.endsWith(`
|
|
11
|
+
`)?a:`${a}
|
|
12
|
+
`}if(i===0)return"";let l=o-1;t[l]===`
|
|
13
|
+
`&&l--;let n=0;for(;l>=0&&n<i;){if(t[l]===`
|
|
14
|
+
`&&(n++,n===i)){l++;break}l--}l<0&&(l=0);let u=t.slice(l);return t[o-1]===`
|
|
15
|
+
`?u:`${u}
|
|
16
|
+
`}export{$ as a,g as b,k as c,v as d};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{createRequire} from"node:module";const require=createRequire(import.meta.url);
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{createRequire} from"node:module";const require=createRequire(import.meta.url);
|
|
2
|
+
function n(e){let r=e.match(/^(\d+\.?\d*)(s|m|h|d)?$/);if(!r)return null;let t=parseFloat(r[1]);switch(r[2]||"s"){case"s":return t*1e3;case"m":return t*60*1e3;case"h":return t*60*60*1e3;case"d":return t*24*60*60*1e3;default:return null}}export{n as a};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import{createRequire} from"node:module";const require=createRequire(import.meta.url);
|
|
2
|
+
import{b as O}from"./chunk-YCLFEX4T.js";import{c as F}from"./chunk-NRSASXYY.js";import{a as N,b as w,c as k}from"./chunk-QAYAQNCG.js";var P=new Map([["",1],["k",1024],["m",1048576],["g",1073741824],["t",1099511627776],["p",0x4000000000000],["e",1152921504606847e3]]),D=new Map([["jan",1],["feb",2],["mar",3],["apr",4],["may",5],["jun",6],["jul",7],["aug",8],["sep",9],["oct",10],["nov",11],["dec",12]]);function x(u){let r=u.trim(),e=r.match(/^([+-]?\d*\.?\d+)\s*([kmgtpeKMGTPE])?[iI]?[bB]?$/);if(!e){let n=parseFloat(r);return Number.isNaN(n)?0:n}let l=parseFloat(e[1]),s=(e[2]||"").toLowerCase(),i=P.get(s)??1;return l*i}function M(u){let r=u.trim().toLowerCase().slice(0,3);return D.get(r)??0}function q(u,r){let e=u.split(/(\d+)/),l=r.split(/(\d+)/),s=Math.max(e.length,l.length);for(let i=0;i<s;i++){let n=e[i]||"",d=l[i]||"",o=/^\d+$/.test(n)?parseInt(n,10):null,c=/^\d+$/.test(d)?parseInt(d,10):null;if(o!==null&&c!==null){if(o!==c)return o-c}else if(n!==d)return n.localeCompare(d)}return 0}function L(u){return u.replace(/[^a-zA-Z0-9\s]/g,"")}function v(u,r,e){let l=e!==null?e:/\s+/,s=u.split(l),i=r.startField-1;if(i>=s.length)return"";if(r.endField===void 0){let o=s[i]||"";return r.startChar!==void 0&&(o=o.slice(r.startChar-1)),r.ignoreLeading&&(o=o.trimStart()),o}let n=Math.min(r.endField-1,s.length-1),d="";for(let o=i;o<=n&&o<s.length;o++){let c=s[o]||"";if(o===i&&r.startChar!==void 0&&(c=c.slice(r.startChar-1)),o===n&&r.endChar!==void 0){let t=o===i&&r.startChar!==void 0?r.endChar-r.startChar+1:r.endChar;c=c.slice(0,t)}o>i&&(d+=e||" "),d+=c}return r.ignoreLeading&&(d=d.trimStart()),d}function I(u,r,e){let l=u,s=r;if(e.dictionaryOrder&&(l=L(l),s=L(s)),e.ignoreCase&&(l=l.toLowerCase(),s=s.toLowerCase()),e.monthSort){let i=M(l),n=M(s);return i-n}if(e.humanNumeric){let i=x(l),n=x(s);return i-n}if(e.versionSort)return q(l,s);if(e.numeric){let i=parseFloat(l)||0,n=parseFloat(s)||0;return i-n}return l.localeCompare(s)}function B(u){let{keys:r,fieldDelimiter:e,numeric:l,ignoreCase:s,reverse:i,humanNumeric:n,versionSort:d,dictionaryOrder:o,monthSort:c,ignoreLeadingBlanks:t,stable:a}=u;return(f,C)=>{let g=f,b=C;if(t&&(g=g.trimStart(),b=b.trimStart()),r.length===0){let h=I(g,b,{numeric:l,ignoreCase:s,humanNumeric:n,versionSort:d,dictionaryOrder:o,monthSort:c});if(h!==0)return i?-h:h;if(!a){let p=f.localeCompare(C);return i?-p:p}return 0}for(let m of r){let h=v(g,m,e),p=v(b,m,e);m.ignoreLeading&&(h=h.trimStart(),p=p.trimStart());let V={numeric:m.numeric??l,ignoreCase:m.ignoreCase??s,humanNumeric:m.humanNumeric??n,versionSort:m.versionSort??d,dictionaryOrder:m.dictionaryOrder??o,monthSort:m.monthSort??c},A=m.reverse??i,S=I(h,p,V);if(S!==0)return A?-S:S}if(!a){let m=f.localeCompare(C);return i?-m:m}return 0}}function E(u,r){if(r.keys.length===0){if(r.ignoreCase){let s=new Set;return u.filter(i=>{let n=i.toLowerCase();return s.has(n)?!1:(s.add(n),!0)})}return[...new Set(u)]}let e=r.keys[0],l=new Set;return u.filter(s=>{let i=v(s,e,r.fieldDelimiter);return(e.ignoreCase??r.ignoreCase)&&(i=i.toLowerCase()),l.has(i)?!1:(l.add(i),!0)})}function y(u){let r={startField:1},e="",l=u,s=l.match(/([bdfhMnrV]+)$/);s&&(e=s[1],l=l.slice(0,-e.length)),e.includes("n")&&(r.numeric=!0),e.includes("r")&&(r.reverse=!0),e.includes("f")&&(r.ignoreCase=!0),e.includes("b")&&(r.ignoreLeading=!0),e.includes("h")&&(r.humanNumeric=!0),e.includes("V")&&(r.versionSort=!0),e.includes("d")&&(r.dictionaryOrder=!0),e.includes("M")&&(r.monthSort=!0);let i=l.split(",");if(i.length===0||i[0]==="")return null;let n=i[0].split("."),d=parseInt(n[0],10);if(Number.isNaN(d)||d<1)return null;if(r.startField=d,n.length>1&&n[1]){let o=parseInt(n[1],10);!Number.isNaN(o)&&o>=1&&(r.startChar=o)}if(i.length>1&&i[1]){let o=i[1],c=o.match(/([bdfhMnrV]+)$/);if(c){let a=c[1];a.includes("n")&&(r.numeric=!0),a.includes("r")&&(r.reverse=!0),a.includes("f")&&(r.ignoreCase=!0),a.includes("b")&&(r.ignoreLeading=!0),a.includes("h")&&(r.humanNumeric=!0),a.includes("V")&&(r.versionSort=!0),a.includes("d")&&(r.dictionaryOrder=!0),a.includes("M")&&(r.monthSort=!0),o=o.slice(0,-a.length)}let t=o.split(".");if(t[0]){let a=parseInt(t[0],10);if(!Number.isNaN(a)&&a>=1&&(r.endField=a),t.length>1&&t[1]){let f=parseInt(t[1],10);!Number.isNaN(f)&&f>=1&&(r.endChar=f)}}}return r}var H={name:"sort",summary:"sort lines of text files",usage:"sort [OPTION]... [FILE]...",options:["-b, --ignore-leading-blanks ignore leading blanks","-d, --dictionary-order consider only blanks and alphanumeric characters","-f, --ignore-case fold lower case to upper case characters","-h, --human-numeric-sort compare human readable numbers (e.g., 2K 1G)","-M, --month-sort compare (unknown) < 'JAN' < ... < 'DEC'","-n, --numeric-sort compare according to string numerical value","-r, --reverse reverse the result of comparisons","-V, --version-sort natural sort of (version) numbers within text","-c, --check check for sorted input; do not sort","-o, --output=FILE write result to FILE instead of stdout","-s, --stable stabilize sort by disabling last-resort comparison","-u, --unique output only unique lines","-k, --key=KEYDEF sort via a key; KEYDEF gives location and type","-t, --field-separator=SEP use SEP as field separator"," --help display this help and exit"],description:`KEYDEF is F[.C][OPTS][,F[.C][OPTS]]
|
|
3
|
+
F is a field number (1-indexed)
|
|
4
|
+
C is a character position within the field (1-indexed)
|
|
5
|
+
OPTS can be: b d f h M n r V (per-key modifiers)
|
|
6
|
+
|
|
7
|
+
Examples:
|
|
8
|
+
-k1 sort by first field
|
|
9
|
+
-k2,2 sort by second field only
|
|
10
|
+
-k1.3 sort by first field starting at 3rd character
|
|
11
|
+
-k1,2n sort by fields 1-2 numerically
|
|
12
|
+
-k2 -k1 sort by field 2, then by field 1`},R={name:"sort",async execute(u,r){if(w(u))return N(H);let e={reverse:!1,numeric:!1,unique:!1,ignoreCase:!1,humanNumeric:!1,versionSort:!1,dictionaryOrder:!1,monthSort:!1,ignoreLeadingBlanks:!1,stable:!1,checkOnly:!1,outputFile:null,keys:[],fieldDelimiter:null},l=[];for(let c=0;c<u.length;c++){let t=u[c];if(t==="-r"||t==="--reverse")e.reverse=!0;else if(t==="-n"||t==="--numeric-sort")e.numeric=!0;else if(t==="-u"||t==="--unique")e.unique=!0;else if(t==="-f"||t==="--ignore-case")e.ignoreCase=!0;else if(t==="-h"||t==="--human-numeric-sort")e.humanNumeric=!0;else if(t==="-V"||t==="--version-sort")e.versionSort=!0;else if(t==="-d"||t==="--dictionary-order")e.dictionaryOrder=!0;else if(t==="-M"||t==="--month-sort")e.monthSort=!0;else if(t==="-b"||t==="--ignore-leading-blanks")e.ignoreLeadingBlanks=!0;else if(t==="-s"||t==="--stable")e.stable=!0;else if(t==="-c"||t==="--check")e.checkOnly=!0;else if(t==="-o"||t==="--output")e.outputFile=u[++c]||null;else if(t.startsWith("-o"))e.outputFile=t.slice(2)||null;else if(t.startsWith("--output="))e.outputFile=t.slice(9)||null;else if(t==="-t"||t==="--field-separator")e.fieldDelimiter=u[++c]||null;else if(t.startsWith("-t"))e.fieldDelimiter=t.slice(2)||null;else if(t.startsWith("--field-separator="))e.fieldDelimiter=t.slice(18)||null;else if(t==="-k"||t==="--key"){let a=u[++c];if(a){let f=y(a);f&&e.keys.push(f)}}else if(t.startsWith("-k")){let a=y(t.slice(2));a&&e.keys.push(a)}else if(t.startsWith("--key=")){let a=y(t.slice(6));a&&e.keys.push(a)}else{if(t.startsWith("--"))return k("sort",t);if(t.startsWith("-")&&!t.startsWith("--")){let a=!1;for(let f of t.slice(1))if(f==="r")e.reverse=!0;else if(f==="n")e.numeric=!0;else if(f==="u")e.unique=!0;else if(f==="f")e.ignoreCase=!0;else if(f==="h")e.humanNumeric=!0;else if(f==="V")e.versionSort=!0;else if(f==="d")e.dictionaryOrder=!0;else if(f==="M")e.monthSort=!0;else if(f==="b")e.ignoreLeadingBlanks=!0;else if(f==="s")e.stable=!0;else if(f==="c")e.checkOnly=!0;else{a=!0;break}if(a)return k("sort",t)}else l.push(t)}}let s=await O(r,l,{cmdName:"sort"});if(!s.ok)return s.error;let n=F(s.content).split(`
|
|
13
|
+
`);n.length>0&&n[n.length-1]===""&&n.pop();let d=B(e);if(e.checkOnly){let c=l.length>0?l[0]:"-";for(let t=1;t<n.length;t++)if(d(n[t-1],n[t])>0)return{stdout:"",stderr:`sort: ${c}:${t+1}: disorder: ${n[t]}
|
|
14
|
+
`,exitCode:1};return{stdout:"",stderr:"",exitCode:0}}n.sort(d),e.unique&&(n=E(n,e));let o=n.length>0?`${n.join(`
|
|
15
|
+
`)}
|
|
16
|
+
`:"";if(e.outputFile){let c=r.fs.resolvePath(r.cwd,e.outputFile);return await r.fs.writeFile(c,o),{stdout:"",stderr:"",exitCode:0}}return{stdout:o,stderr:"",exitCode:0}}},Y={name:"sort",flags:[{flag:"-r",type:"boolean"},{flag:"-n",type:"boolean"},{flag:"-u",type:"boolean"},{flag:"-f",type:"boolean"},{flag:"-h",type:"boolean"},{flag:"-V",type:"boolean"},{flag:"-d",type:"boolean"},{flag:"-M",type:"boolean"},{flag:"-b",type:"boolean"},{flag:"-s",type:"boolean"},{flag:"-c",type:"boolean"},{flag:"-k",type:"value",valueHint:"string"},{flag:"-t",type:"value",valueHint:"delimiter"},{flag:"-o",type:"value",valueHint:"path"}],stdinType:"text",needsFiles:!0};export{R as a,Y as b};
|