just-bash-nx 2.14.5 → 3.0.0
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 +26 -2
- package/README.md +38 -2
- package/dist/Bash.d.ts +27 -0
- package/dist/bin/chunks/awk2-CKPJ75GN.js +2 -0
- package/dist/bin/chunks/base64-I3CXGD2Q.js +2 -0
- package/dist/bin/chunks/bash-UYSJL7VA.js +2 -0
- package/dist/bin/chunks/cat-3TMJDECR.js +2 -0
- package/dist/bin/chunks/chunk-24DJ4XAS.js +18 -0
- package/dist/bin/chunks/{chunk-DOXYBGNA.js → chunk-2ACK45YF.js} +4 -4
- package/dist/bin/chunks/chunk-2GZSSMV3.js +14 -0
- package/dist/bin/chunks/{chunk-WXMBDX4P.js → chunk-2TMMAY52.js} +7 -7
- package/dist/bin/chunks/chunk-575DV2PL.js +9 -0
- package/dist/bin/chunks/chunk-5DFR7VRU.js +13 -0
- package/dist/bin/chunks/chunk-5EPOBKNU.js +140 -0
- package/dist/bin/chunks/chunk-63XSH3IT.js +2 -0
- package/dist/bin/{shell/chunks/chunk-N43DJTSI.js → chunks/chunk-6CW6ATOU.js} +1 -1
- package/dist/bin/chunks/{chunk-ZUDPEMHG.js → chunk-6ZKYK7PO.js} +4 -4
- package/dist/bin/chunks/chunk-7FOU5QKD.js +11 -0
- package/dist/bin/chunks/chunk-7RSTZI3G.js +9 -0
- package/dist/bin/chunks/{chunk-SGA7Y45Z.js → chunk-A65XLABI.js} +5 -5
- package/dist/bin/chunks/{chunk-YLE2OYY6.js → chunk-A6CAHGYF.js} +1 -1
- package/dist/bin/chunks/{chunk-L6XUBS6H.js → chunk-AM6HJVBI.js} +16 -16
- package/dist/bin/chunks/chunk-AQBEVPZP.js +6 -0
- package/dist/bin/chunks/chunk-AX3QU3MP.js +6 -0
- package/dist/bin/chunks/chunk-B4CUXR3Q.js +33 -0
- package/dist/bin/{shell/chunks/chunk-BGGF3ELU.js → chunks/chunk-B5DAHNDY.js} +1 -1
- package/dist/bin/chunks/chunk-BEWZWAXH.js +8 -0
- package/dist/bin/{shell/chunks/chunk-JDNI5HBX.js → chunks/chunk-C6FRS5UB.js} +3 -3
- package/dist/bin/chunks/chunk-CUYKY2BK.js +5 -0
- package/dist/bin/chunks/chunk-D3JRD3JF.js +36 -0
- package/dist/bin/chunks/chunk-D6DORGK7.js +16 -0
- package/dist/bin/{shell/chunks/chunk-EONWONZV.js → chunks/chunk-DH7TPGPX.js} +1 -1
- package/dist/bin/chunks/{chunk-IO2FYBEM.js → chunk-F75VXASN.js} +1 -1
- package/dist/bin/chunks/chunk-FU7JHPYW.js +9 -0
- package/dist/bin/chunks/chunk-G36D7WFF.js +6 -0
- package/dist/bin/chunks/chunk-GQQLQPZG.js +7 -0
- package/dist/bin/chunks/chunk-HIVPP3AM.js +17 -0
- package/dist/bin/{shell/chunks/chunk-NAX7MTAR.js → chunks/chunk-I3X57RP5.js} +6 -6
- package/dist/bin/chunks/chunk-IZ3AT2KX.js +19 -0
- package/dist/bin/chunks/chunk-KHOBXZFG.js +12 -0
- package/dist/bin/chunks/chunk-KMFPV7SR.js +6 -0
- package/dist/bin/chunks/chunk-KX2PR2HV.js +16 -0
- package/dist/bin/chunks/{chunk-54G6AE72.js → chunk-LCJRVV55.js} +1 -1
- package/dist/bin/chunks/chunk-M33SULGQ.js +9 -0
- package/dist/bin/chunks/{chunk-3Y32LPNT.js → chunk-M3T6XOXC.js} +1 -1
- package/dist/bin/chunks/chunk-MWKPB24E.js +11 -0
- package/dist/bin/chunks/chunk-NN2DBOAZ.js +5 -0
- package/dist/bin/chunks/{chunk-PNI5NMXP.js → chunk-NOGXKS2G.js} +23 -23
- package/dist/bin/{shell/chunks/chunk-7BORMNPQ.js → chunks/chunk-NWG67HAQ.js} +1 -1
- package/dist/bin/{shell/chunks/chunk-OXHVTSNH.js → chunks/chunk-P43NQKUN.js} +1 -1
- package/dist/bin/chunks/chunk-RR4FBZRQ.js +16 -0
- package/dist/bin/chunks/{chunk-FIHFXGT6.js → chunk-RUJLEXBJ.js} +72 -72
- package/dist/bin/chunks/chunk-RX22J4AC.js +14 -0
- package/dist/bin/chunks/chunk-S7KZBLGH.js +3 -0
- package/dist/bin/chunks/chunk-UO7ZJYDM.js +11 -0
- package/dist/bin/{shell/chunks/chunk-S3QAKT3R.js → chunks/chunk-VECTAALH.js} +1 -1
- package/dist/bin/chunks/chunk-VRU3NTQB.js +3 -0
- package/dist/bin/chunks/chunk-WJ3HZK2S.js +5 -0
- package/dist/bin/chunks/{chunk-SXRVLCZ4.js → chunk-WRYJHXRE.js} +1 -1
- package/dist/bin/chunks/chunk-XZEAAOBW.js +8 -0
- package/dist/bin/{shell/chunks/chunk-EWDHVLQL.js → chunks/chunk-YMQY74O7.js} +13 -13
- package/dist/bin/chunks/chunk-ZNMFCOTS.js +10 -0
- package/dist/bin/chunks/{chunk-GOJZHH3L.js → chunk-ZO3PBKJB.js} +3 -3
- package/dist/bin/chunks/column-MTXKQLJH.js +2 -0
- package/dist/bin/chunks/comm-YZHVF2XN.js +2 -0
- package/dist/bin/chunks/cut-MWPHE25M.js +2 -0
- package/dist/bin/chunks/diff-EINZHDTZ.js +2 -0
- package/dist/bin/chunks/env-NK55NKL6.js +2 -0
- package/dist/bin/chunks/expand-47QQBMM5.js +2 -0
- package/dist/bin/{shell/chunks/expansion-QUT3FT7V.js → chunks/expansion-H3VFC532.js} +1 -1
- package/dist/bin/chunks/{expr-G4EF4POQ.js → expr-VPJ77DR7.js} +1 -1
- package/dist/bin/chunks/find-O2KKT6KZ.js +2 -0
- package/dist/bin/chunks/flag-coverage-K5GLIZKA.js +2 -0
- package/dist/bin/chunks/fold-QC27S46O.js +2 -0
- package/dist/bin/chunks/grep-3X5B47DW.js +2 -0
- package/dist/bin/chunks/gzip-VYBZGPTA.js +2 -0
- package/dist/bin/chunks/head-BM7J6BEI.js +2 -0
- package/dist/bin/chunks/html-to-markdown-G2FXKDLR.js +2 -0
- package/dist/bin/chunks/join-5J5VA3I7.js +2 -0
- package/dist/bin/chunks/jq-TUCIEKOF.js +2 -0
- package/dist/bin/chunks/{js-exec-RWEELTC2.js → js-exec-LZPKIZ5V.js} +11 -11
- package/dist/bin/chunks/js-exec-worker.js +70 -7
- package/dist/bin/chunks/md5sum-GVZ66MRR.js +2 -0
- package/dist/bin/chunks/nl-XLPXDHHK.js +2 -0
- package/dist/bin/chunks/od-CRBL7ZML.js +2 -0
- package/dist/bin/chunks/paste-7MEIW3PG.js +2 -0
- package/dist/bin/chunks/python3-BBQ4SVHU.js +12 -0
- package/dist/bin/chunks/rev-6LTZEDBA.js +2 -0
- package/dist/bin/chunks/rg-UPQTBQZR.js +2 -0
- package/dist/bin/chunks/sed-OKEUW2KT.js +2 -0
- package/dist/bin/chunks/sha1sum-HFI2SRA4.js +2 -0
- package/dist/bin/chunks/sha256sum-N44D3OCP.js +2 -0
- package/dist/bin/chunks/sort-ES3NRFJA.js +2 -0
- package/dist/bin/chunks/split-QFBCCUR5.js +2 -0
- package/dist/bin/chunks/sqlite3-V4SEWTIR.js +2 -0
- package/dist/bin/chunks/sqlite3-worker.js +1728 -0
- package/dist/bin/chunks/strings-YGI6HF5M.js +2 -0
- package/dist/bin/chunks/tac-HWXFWOGO.js +2 -0
- package/dist/bin/chunks/tail-YX6MELZ5.js +2 -0
- package/dist/bin/chunks/tar-UO62YC6N.js +2 -0
- package/dist/bin/chunks/tee-XKJM7HV7.js +2 -0
- package/dist/bin/chunks/time-RPVNTV72.js +2 -0
- package/dist/bin/chunks/timeout-4QMASFQG.js +2 -0
- package/dist/bin/chunks/tr-A6IXSBQX.js +2 -0
- package/dist/bin/chunks/unexpand-UCJETXUX.js +2 -0
- package/dist/bin/chunks/uniq-2KXDTNDX.js +2 -0
- package/dist/bin/chunks/wc-KTXPMRYY.js +2 -0
- package/dist/bin/chunks/worker.js +21 -7
- package/dist/bin/chunks/xan-BCGRY7KM.js +2 -0
- package/dist/bin/chunks/xan-view-JFFJAU35.js +2 -0
- package/dist/bin/chunks/xargs-EWL5DXR3.js +2 -0
- package/dist/bin/chunks/yq-TKCR3BPF.js +2 -0
- package/dist/bin/just-bash.js +296 -296
- package/dist/bin/shell/chunks/awk2-CKPJ75GN.js +2 -0
- package/dist/bin/shell/chunks/base64-I3CXGD2Q.js +2 -0
- package/dist/bin/shell/chunks/bash-UYSJL7VA.js +2 -0
- package/dist/bin/shell/chunks/cat-3TMJDECR.js +2 -0
- package/dist/bin/shell/chunks/chunk-24DJ4XAS.js +18 -0
- package/dist/bin/shell/chunks/{chunk-DOXYBGNA.js → chunk-2ACK45YF.js} +4 -4
- package/dist/bin/shell/chunks/chunk-2GZSSMV3.js +14 -0
- package/dist/bin/shell/chunks/{chunk-WXMBDX4P.js → chunk-2TMMAY52.js} +7 -7
- package/dist/bin/shell/chunks/chunk-575DV2PL.js +9 -0
- package/dist/bin/shell/chunks/chunk-5DFR7VRU.js +13 -0
- package/dist/bin/shell/chunks/chunk-5EPOBKNU.js +140 -0
- package/dist/bin/shell/chunks/chunk-63XSH3IT.js +2 -0
- package/dist/bin/{chunks/chunk-N43DJTSI.js → shell/chunks/chunk-6CW6ATOU.js} +1 -1
- package/dist/bin/shell/chunks/{chunk-ZUDPEMHG.js → chunk-6ZKYK7PO.js} +4 -4
- package/dist/bin/shell/chunks/chunk-7FOU5QKD.js +11 -0
- package/dist/bin/shell/chunks/chunk-7RSTZI3G.js +9 -0
- package/dist/bin/shell/chunks/{chunk-SGA7Y45Z.js → chunk-A65XLABI.js} +5 -5
- package/dist/bin/shell/chunks/{chunk-YLE2OYY6.js → chunk-A6CAHGYF.js} +1 -1
- package/dist/bin/shell/chunks/{chunk-L6XUBS6H.js → chunk-AM6HJVBI.js} +16 -16
- package/dist/bin/shell/chunks/chunk-AQBEVPZP.js +6 -0
- package/dist/bin/shell/chunks/chunk-AX3QU3MP.js +6 -0
- package/dist/bin/shell/chunks/chunk-B4CUXR3Q.js +33 -0
- package/dist/bin/{chunks/chunk-BGGF3ELU.js → shell/chunks/chunk-B5DAHNDY.js} +1 -1
- package/dist/bin/shell/chunks/chunk-BEWZWAXH.js +8 -0
- package/dist/bin/{chunks/chunk-JDNI5HBX.js → shell/chunks/chunk-C6FRS5UB.js} +3 -3
- package/dist/bin/shell/chunks/chunk-CUYKY2BK.js +5 -0
- package/dist/bin/shell/chunks/chunk-D3JRD3JF.js +36 -0
- package/dist/bin/shell/chunks/chunk-D6DORGK7.js +16 -0
- package/dist/bin/{chunks/chunk-EONWONZV.js → shell/chunks/chunk-DH7TPGPX.js} +1 -1
- package/dist/bin/shell/chunks/{chunk-IO2FYBEM.js → chunk-F75VXASN.js} +1 -1
- package/dist/bin/shell/chunks/chunk-FU7JHPYW.js +9 -0
- package/dist/bin/shell/chunks/chunk-G36D7WFF.js +6 -0
- package/dist/bin/shell/chunks/chunk-GQQLQPZG.js +7 -0
- package/dist/bin/shell/chunks/chunk-HIVPP3AM.js +17 -0
- package/dist/bin/{chunks/chunk-NAX7MTAR.js → shell/chunks/chunk-I3X57RP5.js} +6 -6
- package/dist/bin/shell/chunks/chunk-IZ3AT2KX.js +19 -0
- package/dist/bin/shell/chunks/chunk-KHOBXZFG.js +12 -0
- package/dist/bin/shell/chunks/chunk-KMFPV7SR.js +6 -0
- package/dist/bin/shell/chunks/chunk-KX2PR2HV.js +16 -0
- package/dist/bin/shell/chunks/{chunk-54G6AE72.js → chunk-LCJRVV55.js} +1 -1
- package/dist/bin/shell/chunks/chunk-M33SULGQ.js +9 -0
- package/dist/bin/shell/chunks/{chunk-3Y32LPNT.js → chunk-M3T6XOXC.js} +1 -1
- package/dist/bin/shell/chunks/chunk-MWKPB24E.js +11 -0
- package/dist/bin/shell/chunks/chunk-NN2DBOAZ.js +5 -0
- package/dist/bin/shell/chunks/{chunk-PNI5NMXP.js → chunk-NOGXKS2G.js} +23 -23
- package/dist/bin/{chunks/chunk-7BORMNPQ.js → shell/chunks/chunk-NWG67HAQ.js} +1 -1
- package/dist/bin/{chunks/chunk-OXHVTSNH.js → shell/chunks/chunk-P43NQKUN.js} +1 -1
- package/dist/bin/shell/chunks/chunk-RR4FBZRQ.js +16 -0
- package/dist/bin/shell/chunks/{chunk-FIHFXGT6.js → chunk-RUJLEXBJ.js} +72 -72
- package/dist/bin/shell/chunks/chunk-RX22J4AC.js +14 -0
- package/dist/bin/shell/chunks/chunk-S7KZBLGH.js +3 -0
- package/dist/bin/shell/chunks/chunk-UO7ZJYDM.js +11 -0
- package/dist/bin/{chunks/chunk-S3QAKT3R.js → shell/chunks/chunk-VECTAALH.js} +1 -1
- package/dist/bin/shell/chunks/chunk-VRU3NTQB.js +3 -0
- package/dist/bin/shell/chunks/chunk-WJ3HZK2S.js +5 -0
- package/dist/bin/shell/chunks/{chunk-SXRVLCZ4.js → chunk-WRYJHXRE.js} +1 -1
- package/dist/bin/shell/chunks/chunk-XZEAAOBW.js +8 -0
- package/dist/bin/{chunks/chunk-EWDHVLQL.js → shell/chunks/chunk-YMQY74O7.js} +13 -13
- package/dist/bin/shell/chunks/chunk-ZNMFCOTS.js +10 -0
- package/dist/bin/shell/chunks/{chunk-GOJZHH3L.js → chunk-ZO3PBKJB.js} +3 -3
- package/dist/bin/shell/chunks/column-MTXKQLJH.js +2 -0
- package/dist/bin/shell/chunks/comm-YZHVF2XN.js +2 -0
- package/dist/bin/shell/chunks/cut-MWPHE25M.js +2 -0
- package/dist/bin/shell/chunks/diff-EINZHDTZ.js +2 -0
- package/dist/bin/shell/chunks/env-NK55NKL6.js +2 -0
- package/dist/bin/shell/chunks/expand-47QQBMM5.js +2 -0
- package/dist/bin/{chunks/expansion-QUT3FT7V.js → shell/chunks/expansion-H3VFC532.js} +1 -1
- package/dist/bin/shell/chunks/{expr-G4EF4POQ.js → expr-VPJ77DR7.js} +1 -1
- package/dist/bin/shell/chunks/find-O2KKT6KZ.js +2 -0
- package/dist/bin/shell/chunks/flag-coverage-K5GLIZKA.js +2 -0
- package/dist/bin/shell/chunks/fold-QC27S46O.js +2 -0
- package/dist/bin/shell/chunks/grep-3X5B47DW.js +2 -0
- package/dist/bin/shell/chunks/gzip-VYBZGPTA.js +2 -0
- package/dist/bin/shell/chunks/head-BM7J6BEI.js +2 -0
- package/dist/bin/shell/chunks/html-to-markdown-G2FXKDLR.js +2 -0
- package/dist/bin/shell/chunks/join-5J5VA3I7.js +2 -0
- package/dist/bin/shell/chunks/jq-TUCIEKOF.js +2 -0
- package/dist/bin/shell/chunks/{js-exec-AKWY6BP5.js → js-exec-LZPKIZ5V.js} +11 -11
- package/dist/bin/shell/chunks/md5sum-GVZ66MRR.js +2 -0
- package/dist/bin/shell/chunks/nl-XLPXDHHK.js +2 -0
- package/dist/bin/shell/chunks/od-CRBL7ZML.js +2 -0
- package/dist/bin/shell/chunks/paste-7MEIW3PG.js +2 -0
- package/dist/bin/shell/chunks/python3-BBQ4SVHU.js +12 -0
- package/dist/bin/shell/chunks/rev-6LTZEDBA.js +2 -0
- package/dist/bin/shell/chunks/rg-UPQTBQZR.js +2 -0
- package/dist/bin/shell/chunks/sed-OKEUW2KT.js +2 -0
- package/dist/bin/shell/chunks/sha1sum-HFI2SRA4.js +2 -0
- package/dist/bin/shell/chunks/sha256sum-N44D3OCP.js +2 -0
- package/dist/bin/shell/chunks/sort-ES3NRFJA.js +2 -0
- package/dist/bin/shell/chunks/split-QFBCCUR5.js +2 -0
- package/dist/bin/shell/chunks/sqlite3-V4SEWTIR.js +2 -0
- package/dist/bin/shell/chunks/strings-YGI6HF5M.js +2 -0
- package/dist/bin/shell/chunks/tac-HWXFWOGO.js +2 -0
- package/dist/bin/shell/chunks/tail-YX6MELZ5.js +2 -0
- package/dist/bin/shell/chunks/tar-UO62YC6N.js +2 -0
- package/dist/bin/shell/chunks/tee-XKJM7HV7.js +2 -0
- package/dist/bin/shell/chunks/time-RPVNTV72.js +2 -0
- package/dist/bin/shell/chunks/timeout-4QMASFQG.js +2 -0
- package/dist/bin/shell/chunks/tr-A6IXSBQX.js +2 -0
- package/dist/bin/shell/chunks/unexpand-UCJETXUX.js +2 -0
- package/dist/bin/shell/chunks/uniq-2KXDTNDX.js +2 -0
- package/dist/bin/shell/chunks/wc-KTXPMRYY.js +2 -0
- package/dist/bin/shell/chunks/xan-BCGRY7KM.js +2 -0
- package/dist/bin/shell/chunks/xan-view-JFFJAU35.js +2 -0
- package/dist/bin/shell/chunks/xargs-EWL5DXR3.js +2 -0
- package/dist/bin/shell/chunks/yq-TKCR3BPF.js +2 -0
- package/dist/bin/shell/shell.js +284 -284
- package/dist/bundle/browser.js +712 -710
- package/dist/bundle/chunks/awk2-RXRC54TM.js +1 -0
- package/dist/bundle/chunks/base64-FJOOBRMC.js +1 -0
- package/dist/bundle/chunks/bash-4WLDO24C.js +1 -0
- package/dist/bundle/chunks/cat-VQEWZT5O.js +1 -0
- package/dist/bundle/chunks/{chunk-IVYA2HK4.js → chunk-2CDK4MMW.js} +72 -72
- package/dist/bundle/chunks/chunk-2TRDZQLB.js +17 -0
- package/dist/bundle/chunks/chunk-5DI2YNX7.js +10 -0
- package/dist/bundle/chunks/chunk-6N5CMDSQ.js +9 -0
- package/dist/bundle/chunks/{chunk-F23WWYKW.js → chunk-7P5JCWX5.js} +5 -5
- package/dist/bundle/chunks/chunk-7RIQPKJE.js +2 -0
- package/dist/bundle/chunks/{chunk-APT7OOP2.js → chunk-7ZUB672J.js} +1 -1
- package/dist/bundle/chunks/chunk-AH77CRWX.js +1 -0
- package/dist/bundle/chunks/{chunk-YSHZL3MF.js → chunk-B74TABJS.js} +3 -3
- package/dist/bundle/chunks/{chunk-QJ7O6ZN3.js → chunk-BAXBSHE5.js} +3 -3
- package/dist/bundle/chunks/{chunk-43RSSTFA.js → chunk-BGSUD5R5.js} +1 -1
- package/dist/bundle/chunks/chunk-CHRGJY5U.js +10 -0
- package/dist/bundle/chunks/chunk-CYJSRRNG.js +4 -0
- package/dist/bundle/chunks/{chunk-VBEY5J6R.js → chunk-DFS4EHCX.js} +23 -23
- package/dist/bundle/chunks/chunk-DIB23V32.js +8 -0
- package/dist/bundle/chunks/chunk-DMJSDIQO.js +6 -0
- package/dist/bundle/chunks/chunk-DRGAV7ST.js +11 -0
- package/dist/bundle/chunks/chunk-DZCB42NK.js +2 -0
- package/dist/bundle/chunks/{chunk-DCAAORBQ.js → chunk-EIUAYBIC.js} +1 -1
- package/dist/bundle/chunks/chunk-FGB5UXEW.js +15 -0
- package/dist/bundle/chunks/chunk-G22IYMH5.js +16 -0
- package/dist/bundle/chunks/chunk-GFPLGF6W.js +5 -0
- package/dist/bundle/chunks/chunk-HCKS7PTH.js +10 -0
- package/dist/bundle/chunks/{chunk-5V6VZH6T.js → chunk-HKY7IG73.js} +1 -1
- package/dist/bundle/chunks/chunk-IIJDG7QW.js +13 -0
- package/dist/bundle/chunks/{chunk-Z6LRHWXI.js → chunk-JKZMQVSS.js} +7 -7
- package/dist/bundle/chunks/chunk-JMNW4NXI.js +8 -0
- package/dist/bundle/chunks/{chunk-GJTDUJ5Q.js → chunk-K6LIBGJA.js} +1 -1
- package/dist/bundle/chunks/chunk-KBZ5NVXE.js +5 -0
- package/dist/bundle/chunks/chunk-KK2SFKTN.js +13 -0
- package/dist/bundle/chunks/{chunk-LTZRCH7N.js → chunk-LBUR6QMO.js} +1 -1
- package/dist/bundle/chunks/chunk-MBDW4C5R.js +8 -0
- package/dist/bundle/chunks/chunk-MIV7TH6W.js +32 -0
- package/dist/bundle/chunks/chunk-MOLNCDQJ.js +5 -0
- package/dist/bundle/chunks/chunk-OYFKMNOH.js +4 -0
- package/dist/bundle/chunks/{chunk-62RKD26F.js → chunk-Q7DN34BC.js} +6 -6
- package/dist/bundle/chunks/chunk-RGAX6VXO.js +6 -0
- package/dist/bundle/chunks/chunk-RHD3NWJY.js +15 -0
- package/dist/bundle/chunks/chunk-S7CS4O3M.js +5 -0
- package/dist/bundle/chunks/chunk-SFQDTSOG.js +8 -0
- package/dist/bundle/chunks/{chunk-BAQA74XA.js → chunk-SNN4IESC.js} +1 -1
- package/dist/bundle/chunks/{chunk-64BAICW3.js → chunk-T6RP4YO5.js} +1 -1
- package/dist/bundle/chunks/chunk-TWHVX65V.js +4 -0
- package/dist/bundle/chunks/chunk-U2ATS66X.js +4 -0
- package/dist/bundle/chunks/chunk-UGMTY5A7.js +15 -0
- package/dist/bundle/chunks/{chunk-XIZSGUXJ.js → chunk-UKBVVIW7.js} +4 -4
- package/dist/bundle/chunks/chunk-USP7VSKV.js +12 -0
- package/dist/bundle/chunks/{chunk-D6EWIDSU.js → chunk-UTKQPLMD.js} +13 -13
- package/dist/bundle/chunks/{chunk-5PYKJV42.js → chunk-V5MWI2OL.js} +1 -1
- package/dist/bundle/chunks/chunk-VQ7OTMJW.js +139 -0
- package/dist/bundle/chunks/{chunk-XKQRETAK.js → chunk-WEZK5ELQ.js} +1 -1
- package/dist/bundle/chunks/{chunk-YTNYSM6T.js → chunk-WURK7XMI.js} +4 -4
- package/dist/bundle/chunks/chunk-WZG5CB4V.js +7 -0
- package/dist/bundle/chunks/{chunk-VXBA5RYO.js → chunk-XDXPYGGJ.js} +1 -1
- package/dist/bundle/chunks/chunk-XUZRLD2X.js +35 -0
- package/dist/bundle/chunks/chunk-YDILEREV.js +7 -0
- package/dist/bundle/chunks/column-DCCLCHUR.js +1 -0
- package/dist/bundle/chunks/comm-AXP77KC4.js +1 -0
- package/dist/bundle/chunks/cut-RBX7IXC7.js +1 -0
- package/dist/bundle/chunks/diff-AYXX5MI5.js +1 -0
- package/dist/bundle/chunks/env-GBSZDQLS.js +1 -0
- package/dist/bundle/chunks/expand-UMGRCDTC.js +1 -0
- package/dist/bundle/chunks/{expansion-UGGADTZC.js → expansion-VBDYWVZR.js} +1 -1
- package/dist/bundle/chunks/{expr-DNFUYZGY.js → expr-YYCVMXE3.js} +1 -1
- package/dist/bundle/chunks/find-DH2ALKQS.js +1 -0
- package/dist/bundle/chunks/flag-coverage-FUTMQRVN.js +1 -0
- package/dist/bundle/chunks/fold-V23GDLZD.js +1 -0
- package/dist/bundle/chunks/grep-7CE2SS3X.js +1 -0
- package/dist/bundle/chunks/gzip-EVI6YRMT.js +1 -0
- package/dist/bundle/chunks/head-FG33BE3W.js +1 -0
- package/dist/bundle/chunks/html-to-markdown-AQHC3PHD.js +1 -0
- package/dist/bundle/chunks/join-TLHD7S7W.js +1 -0
- package/dist/bundle/chunks/jq-MOOFLU5X.js +1 -0
- package/dist/bundle/chunks/{js-exec-VXN6TZ7U.js → js-exec-2U7NEXAP.js} +11 -11
- package/dist/bundle/chunks/js-exec-worker.js +70 -7
- package/dist/bundle/chunks/md5sum-XMCB7L5Z.js +1 -0
- package/dist/bundle/chunks/nl-LBU6FPPF.js +1 -0
- package/dist/bundle/chunks/od-O6TPXWVX.js +1 -0
- package/dist/bundle/chunks/paste-HIF3YKHC.js +1 -0
- package/dist/bundle/chunks/python3-ZR6W2FR3.js +11 -0
- package/dist/bundle/chunks/rev-SKETTPXH.js +1 -0
- package/dist/bundle/chunks/rg-GMXITNCP.js +1 -0
- package/dist/bundle/chunks/sed-YRQXQDMQ.js +1 -0
- package/dist/bundle/chunks/sha1sum-ZHNS7PS4.js +1 -0
- package/dist/bundle/chunks/sha256sum-YWE2HB65.js +1 -0
- package/dist/bundle/chunks/sort-5KALNK6P.js +1 -0
- package/dist/bundle/chunks/split-4CXZNBGE.js +1 -0
- package/dist/bundle/chunks/sqlite3-FXN2MHWU.js +1 -0
- package/dist/bundle/chunks/sqlite3-worker.js +1728 -0
- package/dist/bundle/chunks/strings-7VYWRFIZ.js +1 -0
- package/dist/bundle/chunks/tac-74F3WHUM.js +1 -0
- package/dist/bundle/chunks/tail-EDLAF4WW.js +1 -0
- package/dist/bundle/chunks/tar-RKYTUGDT.js +1 -0
- package/dist/bundle/chunks/tee-DUMXETDQ.js +1 -0
- package/dist/bundle/chunks/time-U22WPHDM.js +1 -0
- package/dist/bundle/chunks/timeout-PWE4AOYD.js +1 -0
- package/dist/bundle/chunks/tr-2QSZN4JB.js +1 -0
- package/dist/bundle/chunks/unexpand-ZTD2RXS2.js +1 -0
- package/dist/bundle/chunks/uniq-DCP6SV3B.js +1 -0
- package/dist/bundle/chunks/wc-J6YO4AFR.js +1 -0
- package/dist/bundle/chunks/worker.js +21 -7
- package/dist/bundle/chunks/xan-CW6JZCU7.js +1 -0
- package/dist/bundle/chunks/xan-view-FLG5O7II.js +1 -0
- package/dist/bundle/chunks/xargs-LB2QOP6N.js +1 -0
- package/dist/bundle/chunks/yq-2NFJOC3M.js +1 -0
- package/dist/bundle/index.cjs +870 -868
- package/dist/bundle/index.js +250 -250
- package/dist/commands/js-exec/js-exec-worker.d.ts +2 -0
- package/dist/commands/search-engine/matcher.d.ts +6 -0
- package/dist/commands/search-engine/regex.d.ts +13 -0
- package/dist/commands/sqlite3/sqlite3.d.ts +1 -0
- package/dist/commands/sqlite3/worker.js +1728 -0
- package/dist/commands/worker-bridge/bridge-handler.d.ts +3 -1
- package/dist/commands/worker-bridge/protocol.d.ts +1 -0
- package/dist/commands/worker-bridge/sync-backend.d.ts +5 -0
- package/dist/encoding.d.ts +115 -0
- package/dist/fs/in-memory-fs/in-memory-fs.d.ts +2 -0
- package/dist/fs/interface.d.ts +23 -1
- package/dist/fs/mountable-fs/mountable-fs.d.ts +2 -0
- package/dist/fs/overlay-fs/overlay-fs.d.ts +2 -0
- package/dist/fs/read-write-fs/read-write-fs.d.ts +2 -0
- package/dist/index.d.cts +2 -0
- package/dist/index.d.ts +2 -0
- package/dist/interpreter/interpreter.d.ts +2 -0
- package/dist/interpreter/types.d.ts +5 -0
- package/dist/network/dns-pin.d.ts +43 -0
- package/dist/types.d.ts +50 -6
- package/dist/utils/file-reader.d.ts +12 -5
- package/package.json +6 -5
- package/dist/bin/chunks/awk2-RSUCURL4.js +0 -2
- package/dist/bin/chunks/base64-43M2R3GA.js +0 -2
- package/dist/bin/chunks/bash-6ZHZ6BX7.js +0 -2
- package/dist/bin/chunks/cat-XZIJZXKP.js +0 -2
- package/dist/bin/chunks/chunk-22NDZXS5.js +0 -33
- package/dist/bin/chunks/chunk-26NO42TF.js +0 -14
- package/dist/bin/chunks/chunk-2W2SCVT6.js +0 -140
- package/dist/bin/chunks/chunk-5G2VOPPJ.js +0 -7
- package/dist/bin/chunks/chunk-5WFYIUU2.js +0 -3
- package/dist/bin/chunks/chunk-AAW7UMPO.js +0 -9
- package/dist/bin/chunks/chunk-CGE2EHYP.js +0 -5
- package/dist/bin/chunks/chunk-CM4532DS.js +0 -36
- package/dist/bin/chunks/chunk-CQG2HEAL.js +0 -5
- package/dist/bin/chunks/chunk-E5BDLLK6.js +0 -15
- package/dist/bin/chunks/chunk-EUXCM6C4.js +0 -12
- package/dist/bin/chunks/chunk-F3LGZXLQ.js +0 -9
- package/dist/bin/chunks/chunk-FA2CHD73.js +0 -16
- package/dist/bin/chunks/chunk-FLPVVSN5.js +0 -5
- package/dist/bin/chunks/chunk-FSZWFMB4.js +0 -16
- package/dist/bin/chunks/chunk-GO6FXSC4.js +0 -6
- package/dist/bin/chunks/chunk-JQBC3FXE.js +0 -8
- package/dist/bin/chunks/chunk-KCMUAACL.js +0 -19
- package/dist/bin/chunks/chunk-LGJM5YFT.js +0 -17
- package/dist/bin/chunks/chunk-LMK6G2HH.js +0 -8
- package/dist/bin/chunks/chunk-MRP4ZCD7.js +0 -6
- package/dist/bin/chunks/chunk-OBI37ZY4.js +0 -9
- package/dist/bin/chunks/chunk-PXVBSPBE.js +0 -2
- package/dist/bin/chunks/chunk-RA3TG4UK.js +0 -9
- package/dist/bin/chunks/chunk-RBQGQWGV.js +0 -10
- package/dist/bin/chunks/chunk-RJSAGJQJ.js +0 -11
- package/dist/bin/chunks/chunk-ROJPSS6N.js +0 -3
- package/dist/bin/chunks/chunk-S7OHMN3F.js +0 -6
- package/dist/bin/chunks/chunk-TTNNO45C.js +0 -17
- package/dist/bin/chunks/chunk-WWZVR5NN.js +0 -6
- package/dist/bin/chunks/chunk-XXCTETRW.js +0 -11
- package/dist/bin/chunks/chunk-YEKSVVRC.js +0 -11
- package/dist/bin/chunks/chunk-ZA4HUKJ3.js +0 -13
- package/dist/bin/chunks/chunk-ZKC5HQYO.js +0 -14
- package/dist/bin/chunks/column-XGV32UPN.js +0 -2
- package/dist/bin/chunks/comm-R3F3Z5DX.js +0 -2
- package/dist/bin/chunks/cut-5EY2XPXX.js +0 -2
- package/dist/bin/chunks/diff-5NUI5BHG.js +0 -2
- package/dist/bin/chunks/env-NTPN5QYM.js +0 -2
- package/dist/bin/chunks/expand-26XPP5KB.js +0 -2
- package/dist/bin/chunks/find-7CVMEZBO.js +0 -2
- package/dist/bin/chunks/flag-coverage-OH2CJRFX.js +0 -2
- package/dist/bin/chunks/fold-XSVNTAWH.js +0 -2
- package/dist/bin/chunks/grep-7BJ7HFBM.js +0 -2
- package/dist/bin/chunks/gzip-LHOO65AN.js +0 -2
- package/dist/bin/chunks/head-YMNRW3F3.js +0 -2
- package/dist/bin/chunks/html-to-markdown-V6PK6S5U.js +0 -2
- package/dist/bin/chunks/join-Y4Q5WVVE.js +0 -2
- package/dist/bin/chunks/jq-4JWOFG7X.js +0 -2
- package/dist/bin/chunks/md5sum-NCLXV2S3.js +0 -2
- package/dist/bin/chunks/nl-XH3L75DR.js +0 -2
- package/dist/bin/chunks/od-52FBC34W.js +0 -2
- package/dist/bin/chunks/paste-3UVLMQ2K.js +0 -2
- package/dist/bin/chunks/python3-JUJKPBFB.js +0 -12
- package/dist/bin/chunks/rev-UHEPS2UL.js +0 -2
- package/dist/bin/chunks/rg-DK6FRF6Q.js +0 -2
- package/dist/bin/chunks/sed-WWXBUNG3.js +0 -2
- package/dist/bin/chunks/sha1sum-BHNJ5ALF.js +0 -2
- package/dist/bin/chunks/sha256sum-HJJ3NJ5L.js +0 -2
- package/dist/bin/chunks/sort-7GENYU2I.js +0 -2
- package/dist/bin/chunks/split-YWV64TJH.js +0 -2
- package/dist/bin/chunks/sqlite3-CVNFMP3Z.js +0 -2
- package/dist/bin/chunks/strings-XXKZCWY5.js +0 -2
- package/dist/bin/chunks/tac-T42SKDDI.js +0 -2
- package/dist/bin/chunks/tail-V537TDFR.js +0 -2
- package/dist/bin/chunks/tar-GTGFEWDS.js +0 -2
- package/dist/bin/chunks/tee-HK2SYCAR.js +0 -2
- package/dist/bin/chunks/time-5R4QWCYF.js +0 -2
- package/dist/bin/chunks/timeout-Z24MNWOP.js +0 -2
- package/dist/bin/chunks/tr-4FPGAEVB.js +0 -2
- package/dist/bin/chunks/unexpand-OYZ7KOYR.js +0 -2
- package/dist/bin/chunks/uniq-TMSAIZM3.js +0 -2
- package/dist/bin/chunks/wc-ZIV3TFVG.js +0 -2
- package/dist/bin/chunks/xan-FKXPSPE5.js +0 -2
- package/dist/bin/chunks/xan-view-6J5MMMQB.js +0 -2
- package/dist/bin/chunks/xargs-SCYIFXOW.js +0 -2
- package/dist/bin/chunks/yq-RGXFWYJN.js +0 -2
- package/dist/bin/shell/chunks/awk2-RSUCURL4.js +0 -2
- package/dist/bin/shell/chunks/base64-43M2R3GA.js +0 -2
- package/dist/bin/shell/chunks/bash-6ZHZ6BX7.js +0 -2
- package/dist/bin/shell/chunks/cat-XZIJZXKP.js +0 -2
- package/dist/bin/shell/chunks/chunk-22NDZXS5.js +0 -33
- package/dist/bin/shell/chunks/chunk-26NO42TF.js +0 -14
- package/dist/bin/shell/chunks/chunk-2W2SCVT6.js +0 -140
- package/dist/bin/shell/chunks/chunk-5G2VOPPJ.js +0 -7
- package/dist/bin/shell/chunks/chunk-5WFYIUU2.js +0 -3
- package/dist/bin/shell/chunks/chunk-AAW7UMPO.js +0 -9
- package/dist/bin/shell/chunks/chunk-CGE2EHYP.js +0 -5
- package/dist/bin/shell/chunks/chunk-CM4532DS.js +0 -36
- package/dist/bin/shell/chunks/chunk-CQG2HEAL.js +0 -5
- package/dist/bin/shell/chunks/chunk-E5BDLLK6.js +0 -15
- package/dist/bin/shell/chunks/chunk-EUXCM6C4.js +0 -12
- package/dist/bin/shell/chunks/chunk-F3LGZXLQ.js +0 -9
- package/dist/bin/shell/chunks/chunk-FA2CHD73.js +0 -16
- package/dist/bin/shell/chunks/chunk-FLPVVSN5.js +0 -5
- package/dist/bin/shell/chunks/chunk-FSZWFMB4.js +0 -16
- package/dist/bin/shell/chunks/chunk-GO6FXSC4.js +0 -6
- package/dist/bin/shell/chunks/chunk-HC7WB764.js +0 -2
- package/dist/bin/shell/chunks/chunk-JQBC3FXE.js +0 -8
- package/dist/bin/shell/chunks/chunk-KCMUAACL.js +0 -19
- package/dist/bin/shell/chunks/chunk-LGJM5YFT.js +0 -17
- package/dist/bin/shell/chunks/chunk-LMK6G2HH.js +0 -8
- package/dist/bin/shell/chunks/chunk-MRP4ZCD7.js +0 -6
- package/dist/bin/shell/chunks/chunk-OBI37ZY4.js +0 -9
- package/dist/bin/shell/chunks/chunk-RA3TG4UK.js +0 -9
- package/dist/bin/shell/chunks/chunk-RBQGQWGV.js +0 -10
- package/dist/bin/shell/chunks/chunk-RJSAGJQJ.js +0 -11
- package/dist/bin/shell/chunks/chunk-ROJPSS6N.js +0 -3
- package/dist/bin/shell/chunks/chunk-S7OHMN3F.js +0 -6
- package/dist/bin/shell/chunks/chunk-TTNNO45C.js +0 -17
- package/dist/bin/shell/chunks/chunk-WWZVR5NN.js +0 -6
- package/dist/bin/shell/chunks/chunk-XXCTETRW.js +0 -11
- package/dist/bin/shell/chunks/chunk-YEKSVVRC.js +0 -11
- package/dist/bin/shell/chunks/chunk-ZA4HUKJ3.js +0 -13
- package/dist/bin/shell/chunks/chunk-ZKC5HQYO.js +0 -14
- package/dist/bin/shell/chunks/column-XGV32UPN.js +0 -2
- package/dist/bin/shell/chunks/comm-R3F3Z5DX.js +0 -2
- package/dist/bin/shell/chunks/cut-5EY2XPXX.js +0 -2
- package/dist/bin/shell/chunks/diff-5NUI5BHG.js +0 -2
- package/dist/bin/shell/chunks/env-NTPN5QYM.js +0 -2
- package/dist/bin/shell/chunks/expand-26XPP5KB.js +0 -2
- package/dist/bin/shell/chunks/find-7CVMEZBO.js +0 -2
- package/dist/bin/shell/chunks/flag-coverage-OH2CJRFX.js +0 -2
- package/dist/bin/shell/chunks/fold-XSVNTAWH.js +0 -2
- package/dist/bin/shell/chunks/grep-7BJ7HFBM.js +0 -2
- package/dist/bin/shell/chunks/gzip-LHOO65AN.js +0 -2
- package/dist/bin/shell/chunks/head-YMNRW3F3.js +0 -2
- package/dist/bin/shell/chunks/html-to-markdown-V6PK6S5U.js +0 -2
- package/dist/bin/shell/chunks/join-Y4Q5WVVE.js +0 -2
- package/dist/bin/shell/chunks/jq-4JWOFG7X.js +0 -2
- package/dist/bin/shell/chunks/md5sum-NCLXV2S3.js +0 -2
- package/dist/bin/shell/chunks/nl-XH3L75DR.js +0 -2
- package/dist/bin/shell/chunks/od-52FBC34W.js +0 -2
- package/dist/bin/shell/chunks/paste-3UVLMQ2K.js +0 -2
- package/dist/bin/shell/chunks/python3-RRCCYJKA.js +0 -12
- package/dist/bin/shell/chunks/rev-UHEPS2UL.js +0 -2
- package/dist/bin/shell/chunks/rg-DK6FRF6Q.js +0 -2
- package/dist/bin/shell/chunks/sed-WWXBUNG3.js +0 -2
- package/dist/bin/shell/chunks/sha1sum-BHNJ5ALF.js +0 -2
- package/dist/bin/shell/chunks/sha256sum-HJJ3NJ5L.js +0 -2
- package/dist/bin/shell/chunks/sort-7GENYU2I.js +0 -2
- package/dist/bin/shell/chunks/split-YWV64TJH.js +0 -2
- package/dist/bin/shell/chunks/sqlite3-CVNFMP3Z.js +0 -2
- package/dist/bin/shell/chunks/strings-XXKZCWY5.js +0 -2
- package/dist/bin/shell/chunks/tac-T42SKDDI.js +0 -2
- package/dist/bin/shell/chunks/tail-V537TDFR.js +0 -2
- package/dist/bin/shell/chunks/tar-GTGFEWDS.js +0 -2
- package/dist/bin/shell/chunks/tee-HK2SYCAR.js +0 -2
- package/dist/bin/shell/chunks/time-5R4QWCYF.js +0 -2
- package/dist/bin/shell/chunks/timeout-Z24MNWOP.js +0 -2
- package/dist/bin/shell/chunks/tr-4FPGAEVB.js +0 -2
- package/dist/bin/shell/chunks/unexpand-OYZ7KOYR.js +0 -2
- package/dist/bin/shell/chunks/uniq-TMSAIZM3.js +0 -2
- package/dist/bin/shell/chunks/wc-ZIV3TFVG.js +0 -2
- package/dist/bin/shell/chunks/xan-FKXPSPE5.js +0 -2
- package/dist/bin/shell/chunks/xan-view-6J5MMMQB.js +0 -2
- package/dist/bin/shell/chunks/xargs-SCYIFXOW.js +0 -2
- package/dist/bin/shell/chunks/yq-RGXFWYJN.js +0 -2
- package/dist/bundle/chunks/awk2-JFGEGLFP.js +0 -1
- package/dist/bundle/chunks/base64-4YMZCVJ5.js +0 -1
- package/dist/bundle/chunks/bash-IJWYRKFO.js +0 -1
- package/dist/bundle/chunks/cat-RDUMLXKC.js +0 -1
- package/dist/bundle/chunks/chunk-55VFSPNA.js +0 -2
- package/dist/bundle/chunks/chunk-7ESWU5HP.js +0 -14
- package/dist/bundle/chunks/chunk-7L36YK2X.js +0 -2
- package/dist/bundle/chunks/chunk-A7ICOL4V.js +0 -13
- package/dist/bundle/chunks/chunk-B53Y5JFV.js +0 -8
- package/dist/bundle/chunks/chunk-D4J545R4.js +0 -11
- package/dist/bundle/chunks/chunk-D6CWQ5DW.js +0 -5
- package/dist/bundle/chunks/chunk-DBKNVD4L.js +0 -9
- package/dist/bundle/chunks/chunk-EIZGF4BS.js +0 -8
- package/dist/bundle/chunks/chunk-GXVXFKBA.js +0 -5
- package/dist/bundle/chunks/chunk-HDQ56CKY.js +0 -15
- package/dist/bundle/chunks/chunk-HWBSOZZR.js +0 -35
- package/dist/bundle/chunks/chunk-I57KEIP3.js +0 -10
- package/dist/bundle/chunks/chunk-JVPRLUMK.js +0 -7
- package/dist/bundle/chunks/chunk-KMEYNNUA.js +0 -15
- package/dist/bundle/chunks/chunk-KX3P26DQ.js +0 -1
- package/dist/bundle/chunks/chunk-LWEGUNWT.js +0 -7
- package/dist/bundle/chunks/chunk-MDLLFABN.js +0 -4
- package/dist/bundle/chunks/chunk-MHTUABJP.js +0 -8
- package/dist/bundle/chunks/chunk-MYE6AGBJ.js +0 -16
- package/dist/bundle/chunks/chunk-NAERJDUW.js +0 -8
- package/dist/bundle/chunks/chunk-P7UWRQ44.js +0 -139
- package/dist/bundle/chunks/chunk-PP6PSHAB.js +0 -4
- package/dist/bundle/chunks/chunk-PYDZ2LCK.js +0 -16
- package/dist/bundle/chunks/chunk-PYSFUGCK.js +0 -10
- package/dist/bundle/chunks/chunk-QCDB2VPH.js +0 -6
- package/dist/bundle/chunks/chunk-SDNKECQQ.js +0 -5
- package/dist/bundle/chunks/chunk-TLSUDHID.js +0 -6
- package/dist/bundle/chunks/chunk-TOMNU26N.js +0 -4
- package/dist/bundle/chunks/chunk-TXBZCHCQ.js +0 -5
- package/dist/bundle/chunks/chunk-U6NMAV24.js +0 -32
- package/dist/bundle/chunks/chunk-VJFXDYWH.js +0 -10
- package/dist/bundle/chunks/chunk-VYOJP4TV.js +0 -13
- package/dist/bundle/chunks/chunk-WKFATFPP.js +0 -4
- package/dist/bundle/chunks/chunk-Z7JVV2SM.js +0 -12
- package/dist/bundle/chunks/column-WLPMMSTS.js +0 -1
- package/dist/bundle/chunks/comm-5SLSESQG.js +0 -1
- package/dist/bundle/chunks/cut-OPC3VAGB.js +0 -1
- package/dist/bundle/chunks/diff-HJF2MPDN.js +0 -1
- package/dist/bundle/chunks/env-5EPCWSXR.js +0 -1
- package/dist/bundle/chunks/expand-DTNXU4LQ.js +0 -1
- package/dist/bundle/chunks/find-KNMMLVJD.js +0 -1
- package/dist/bundle/chunks/flag-coverage-3WZU3PW6.js +0 -1
- package/dist/bundle/chunks/fold-LDSORVYE.js +0 -1
- package/dist/bundle/chunks/grep-2UMHPO7Y.js +0 -1
- package/dist/bundle/chunks/gzip-AQXSGOVS.js +0 -1
- package/dist/bundle/chunks/head-HT2B6D2J.js +0 -1
- package/dist/bundle/chunks/html-to-markdown-TFCECAGV.js +0 -1
- package/dist/bundle/chunks/join-GG2LDHE5.js +0 -1
- package/dist/bundle/chunks/jq-CRLZNLQG.js +0 -1
- package/dist/bundle/chunks/md5sum-INMIK4DX.js +0 -1
- package/dist/bundle/chunks/nl-U5YJDM32.js +0 -1
- package/dist/bundle/chunks/od-VJEF2UR5.js +0 -1
- package/dist/bundle/chunks/paste-7N6AFSDS.js +0 -1
- package/dist/bundle/chunks/python3-BFV3N3GY.js +0 -11
- package/dist/bundle/chunks/rev-XOSYPP45.js +0 -1
- package/dist/bundle/chunks/rg-KYSTAD4Q.js +0 -1
- package/dist/bundle/chunks/sed-OFX3F4FE.js +0 -1
- package/dist/bundle/chunks/sha1sum-VJPNLNU6.js +0 -1
- package/dist/bundle/chunks/sha256sum-PI32XWXY.js +0 -1
- package/dist/bundle/chunks/sort-DCNRDA7U.js +0 -1
- package/dist/bundle/chunks/split-SITCSYCZ.js +0 -1
- package/dist/bundle/chunks/sqlite3-56UMWEY3.js +0 -1
- package/dist/bundle/chunks/strings-7PLOGTPD.js +0 -1
- package/dist/bundle/chunks/tac-SJGXQ4T2.js +0 -1
- package/dist/bundle/chunks/tail-S5ULNTJU.js +0 -1
- package/dist/bundle/chunks/tar-LYLTEJV3.js +0 -1
- package/dist/bundle/chunks/tee-O7VXZDCO.js +0 -1
- package/dist/bundle/chunks/time-DEUO3QV2.js +0 -1
- package/dist/bundle/chunks/timeout-VRKMCG72.js +0 -1
- package/dist/bundle/chunks/tr-2HXZRDSW.js +0 -1
- package/dist/bundle/chunks/unexpand-RGTMIGZM.js +0 -1
- package/dist/bundle/chunks/uniq-SUNANL47.js +0 -1
- package/dist/bundle/chunks/wc-TQB3VNOX.js +0 -1
- package/dist/bundle/chunks/xan-DHUKCGIW.js +0 -1
- package/dist/bundle/chunks/xan-view-OW2TB7Z3.js +0 -1
- package/dist/bundle/chunks/xargs-I6EZUCYF.js +0 -1
- package/dist/bundle/chunks/yq-NDDDSAXH.js +0 -1
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
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-ZNMFCOTS.js";import{a as st}from"./chunk-4CFAYBLV.js";import{a as $}from"./chunk-F75VXASN.js";import{f as qe,g as X}from"./chunk-V7ZOPVQS.js";import{a as J}from"./chunk-C6FRS5UB.js";import{a as _e}from"./chunk-S7KZBLGH.js";import{a as _}from"./chunk-63XSH3IT.js";import{a as D,b as G}from"./chunk-GTNBSMZR.js";import{b as We,d as et,e as tt,f as nt}from"./chunk-KGOUQS5A.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-JFFJAU35.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,2 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
var i=new TextDecoder("utf-8",{fatal:!0}),d=new TextEncoder;function y(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 a="";function f(t){let e="";for(let n=0;n<t.length;n++)e+=String.fromCharCode(t[n]);return e}async function x(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 l(t){return s(t)==="bytes"?t.stdout:c(t.stdout)}export{y as a,c as b,a as c,x as d,l as e};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import{a as s}from"./chunk-
|
|
2
|
+
import{a as s}from"./chunk-575DV2PL.js";var a=s("sha256sum","sha256","compute SHA256 message digest"),m={name:"sha256sum",flags:[{flag:"-c",type:"boolean"}],needsFiles:!0};export{a,m as b};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import{a as ye}from"./chunk-YMMJLYIX.js";import{b as Q}from"./chunk-YU6OGPZR.js";import{a as U}from"./chunk-
|
|
2
|
+
import{a as ye}from"./chunk-YMMJLYIX.js";import{b as Q}from"./chunk-YU6OGPZR.js";import{a as U}from"./chunk-C6FRS5UB.js";import{a as pe,b as ge,c as ee}from"./chunk-GTNBSMZR.js";var Ke="file",Je="link",Ve="symlink",ke="directory",Qe={file:"0",link:"1",symlink:"2","character-device":"3","block-device":"4",directory:"5",fifo:"6","pax-header":"x","pax-global-header":"g","gnu-long-name":"L","gnu-long-link-name":"K"},et={0:Ke,1:Je,2:Ve,3:"character-device",4:"block-device",5:ke,6:"fifo",x:"pax-header",g:"pax-global-header",L:"gnu-long-name",K:"gnu-long-link-name"},tt=new Uint8Array(512),_=new Uint8Array(0),T=new TextEncoder,ze=new TextDecoder;function P(e,t,i,r){r&&T.encodeInto(r,e.subarray(t,t+i))}function L(e,t,i,r){if(r===void 0)return;let n=r.toString(8).padStart(i-1,"0");T.encodeInto(n,e.subarray(t,t+i-1))}function S(e,t,i){let r=e.indexOf(0,t),n=r===-1||r>t+i?t+i:r;return ze.decode(e.subarray(t,n))}function ne(e,t,i){let r=0,n=t+i;for(let s=t;s<n;s++){let a=e[s];if(a===0)break;a!==32&&(r=r*8+(a-48))}return r}function W(e,t,i){if(e[t]&128){let r=0;r=e[t]&127;for(let n=1;n<i;n++)r=r*256+e[t+n];if(!Number.isSafeInteger(r))throw new Error("TAR number too large");return r}return ne(e,t,i)}var N=e=>e.type==="directory"||e.type==="symlink"||e.type==="link"||e.type==="character-device"||e.type==="block-device"||e.type==="fifo";async function Ce(e){if(e==null)return _;if(e instanceof Uint8Array)return e;if(typeof e=="string")return T.encode(e);if(e instanceof ArrayBuffer)return new Uint8Array(e);if(e instanceof Blob)return new Uint8Array(await e.arrayBuffer());throw new TypeError("Unsupported content type for entry body.")}var we=(e,t)=>{let i=e.split("/").filter(Boolean);return t>=i.length?"":i.slice(t).join("/")};function Ae(e,t){let{strip:i,filter:r,map:n}=t;if(!i&&!r&&!n)return e;let s={...e};if(i&&i>0){let o=we(s.name,i);if(!o)return null;if(s.name=s.type==="directory"&&!o.endsWith("/")?`${o}/`:o,s.linkname){let c=s.linkname.startsWith("/");if(c||s.type==="link"){let l=we(s.linkname,i);s.linkname=c?`/${l}`||"/":l}}}if(r?.(s)===!1)return null;let a=n?n(s):s;return a&&(!a.name||!a.name.trim()||a.name==="."||a.name==="/")?null:a}var re=32,rt=48;function nt(e){let t=ne(e,148,8),i=0;for(let r=0;r<e.length;r++)r>=148&&r<156?i+=re:i+=e[r];return t===i}function it(e){e.fill(re,148,156);let t=0;for(let i of e)t+=i;for(let i=153;i>=148;i--)e[i]=(t&7)+rt,t>>=3;e[154]=0,e[155]=re}var st=256;function ot(e){let t={};T.encode(e.name).length>100&&Ee(e.name)===null&&(t.path=e.name),e.linkname&&T.encode(e.linkname).length>100&&(t.linkpath=e.linkname),e.uname&&T.encode(e.uname).length>32&&(t.uname=e.uname),e.gname&&T.encode(e.gname).length>32&&(t.gname=e.gname),e.uid!=null&&e.uid>2097151&&(t.uid=String(e.uid)),e.gid!=null&&e.gid>2097151&&(t.gid=String(e.gid)),e.size!=null&&e.size>8589934591&&(t.size=String(e.size)),e.pax&&Object.assign(t,e.pax);let i=Object.entries(t);if(i.length===0)return null;let r=T.encode(i.map(([n,s])=>{let a=`${n}=${s}
|
|
3
3
|
`,o=T.encode(a).length+1,c=o+String(o).length;return c=o+String(c).length,`${c} ${a}`}).join(""));return{paxHeader:$e({name:ze.decode(T.encode(`PaxHeader/${e.name}`).slice(0,100)),size:r.length,type:"pax-header",mode:420,mtime:e.mtime,uname:e.uname,gname:e.gname,uid:e.uid,gid:e.gid}),paxBody:r}}function Ee(e){let t=T.encode(e).length;if(t<=100||t>st)return null;for(let i=e.length-1;i>0;i--){if(e[i]!=="/")continue;let r=e.slice(0,i),n=e.slice(i+1);if(T.encode(r).length<=155&&T.encode(n).length<=100)return{prefix:r,name:n}}return null}function $e(e){let t=new Uint8Array(512),i=N(e)?0:e.size??0,r=e.name,n="";if(!e.pax?.path){let s=Ee(r);s&&(r=s.name,n=s.prefix)}return P(t,0,100,r),L(t,100,8,e.mode??(e.type==="directory"?493:420)),L(t,108,8,e.uid??0),L(t,116,8,e.gid??0),L(t,124,12,i),L(t,136,12,Math.floor((e.mtime?.getTime()??Date.now())/1e3)),P(t,156,1,Qe[e.type??"file"]),P(t,157,100,e.linkname),P(t,257,6,"ustar\0"),P(t,263,2,"00"),P(t,265,32,e.uname),P(t,297,32,e.gname),P(t,345,155,n),it(t),t}function at(e,t){if(t&&!nt(e))throw new Error("Invalid tar header checksum.");let i=S(e,156,1),r={name:S(e,0,100),mode:ne(e,100,8),uid:W(e,108,8),gid:W(e,116,8),size:W(e,124,12),mtime:new Date(W(e,136,12)*1e3),type:et[i]||"file",linkname:S(e,157,100)},n=S(e,257,6);return N(r)&&(r.size=0),n.trim()==="ustar"&&(r.uname=S(e,265,32),r.gname=S(e,297,32)),n==="ustar"&&(r.prefix=S(e,345,155)),r}var be={path:["name",e=>e],linkpath:["linkname",e=>e],size:["size",e=>parseInt(e,10)],mtime:["mtime",parseFloat],uid:["uid",e=>parseInt(e,10)],gid:["gid",e=>parseInt(e,10)],uname:["uname",e=>e],gname:["gname",e=>e]};function lt(e){let t=new TextDecoder("utf-8"),i=Object.create(null),r=Object.create(null),n=0;for(;n<e.length;){let s=e.indexOf(32,n);if(s===-1)break;let a=parseInt(t.decode(e.subarray(n,s)),10);if(Number.isNaN(a)||a===0)break;let o=n+a,[c,l]=t.decode(e.subarray(s+1,o-1)).split("=",2);if(c&&l!==void 0&&(r[c]=l,Object.hasOwn(be,c))){let[f,u]=be[c],y=u(l);(typeof y=="string"||!Number.isNaN(y))&&(i[f]=y)}n=o}return Object.keys(r).length>0&&(i.pax=r),i}function xe(e,t){t.name!==void 0&&(e.name=t.name),t.linkname!==void 0&&(e.linkname=t.linkname),t.size!==void 0&&(e.size=t.size),t.mtime!==void 0&&(e.mtime=new Date(t.mtime*1e3)),t.uid!==void 0&&(e.uid=t.uid),t.gid!==void 0&&(e.gid=t.gid),t.uname!==void 0&&(e.uname=t.uname),t.gname!==void 0&&(e.gname=t.gname),t.pax&&(e.pax=Object.assign({},e.pax??{},t.pax))}function ct(e){switch(e){case"pax-global-header":case"pax-header":return lt;case"gnu-long-name":return t=>({name:S(t,0,t.length)});case"gnu-long-link-name":return t=>({linkname:S(t,0,t.length)});default:return}}function ft(e){let t=$e(e),i=ot(e);if(!i)return[t];let r=-i.paxBody.length&511,n=r>0?[tt.subarray(0,r)]:[];return[i.paxHeader,i.paxBody,...n,t]}var ut=new Uint8Array(512*2);function Be(e,t,i){let r=null,n=0,s=!1,a=o=>{let c=new Error(o);throw t(c),c};return{add(o){s&&a("No new tar entries after finalize."),r!==null&&a("Previous entry must be completed before adding a new one");let c=N(o)?0:o.size;(!Number.isSafeInteger(c)||c<0)&&a("Invalid tar entry size.");try{let l=ft({...o,size:c});for(let f of l)e(f);r={...o,size:c},n=0}catch(l){t(l)}},write(o){r||a("No active tar entry."),s&&a("Cannot write data after finalize.");let c=n+o.length;c>r.size&&a(`"${r.name}" exceeds given size of ${r.size} bytes.`);try{n=c,e(o)}catch(l){t(l)}},endEntry(){r||a("No active entry to end."),s&&a("Cannot end entry after finalize.");try{n!==r.size&&a(`Size mismatch for "${r.name}".`);let o=-r.size&511;o>0&&e(new Uint8Array(o)),r=null,n=0}catch(o){throw t(o),o}},finalize(){s&&a("Archive has already been finalized"),r!==null&&a("Cannot finalize while an entry is still active");try{e(ut),s=!0,i&&i()}catch(o){t(o)}}}}var j=256;function dt(){let e=new Array(j),t=e.length-1,i=0,r=0,n=0,s=o=>{let c=e[i];o===c.length?(e[i]=_,i=i+1&t):e[i]=c.subarray(o),n-=o,n===0&&e.length>j&&(e=new Array(j),t=j-1,i=0,r=0)};function a(o,c){if(c){let g=0,d=Math.min(o,n);for(;d>0;){let p=e[i],m=Math.min(d,p.length),x=m===p.length?p:p.subarray(0,m);if(s(m),d-=m,g+=m,!c(x))break}return g}if(n<o)return null;if(o===0)return _;let l=e[i];if(l.length>=o){let g=l.length===o?l:l.subarray(0,o);return s(o),g}let f=new Uint8Array(o),u=0,y=o;for(;y>0;){let g=e[i],d=Math.min(y,g.length);f.set(d===g.length?g:g.subarray(0,d),u),u+=d,y-=d,s(d)}return f}return{push:o=>{if(o.length===0)return;let c=r+1&t;if(c===i){let l=e.length,f=l*2,u=new Array(f),y=r-i+l&l-1;if(i<r)for(let g=0;g<y;g++)u[g]=e[i+g];else if(y>0){let g=l-i;for(let d=0;d<g;d++)u[d]=e[i+d];for(let d=0;d<r;d++)u[g+d]=e[d]}e=u,t=f-1,i=0,r=y,c=r+1&t}e[r]=o,r=c,n+=o.length},available:()=>n,peek:o=>{if(n<o)return null;if(o===0)return _;let c=e[i];if(c.length>=o)return c.length===o?c:c.subarray(0,o);let l=new Uint8Array(o),f=0,u=i;for(;f<o;){let y=e[u],g=Math.min(o-f,y.length);g===y.length?l.set(y,f):l.set(y.subarray(0,g),f),f+=g,u=u+1&t}return l},discard:o=>{if(o>n)throw new Error("Too many bytes consumed");if(o===0)return;let c=o;for(;c>0;){let l=e[i],f=Math.min(c,l.length);s(f),c-=f}},pull:a}}var te=0,D=1,H=new Error("Tar archive is truncated.");function Te(e={}){let t=e.strict??!1,{available:i,peek:r,push:n,discard:s,pull:a}=dt(),o=te,c=!1,l=!1,f=!1,u=null,y={},g={},d={isEntryActive:()=>o===D,isBodyComplete:()=>!u||u.remaining===0,canFinish:()=>!u||i()>=u.remaining+u.padding,write(p){if(c)throw new Error("Archive already ended.");n(p)},end(){c=!0},readHeader(){if(o!==te)throw new Error("Cannot read header while an entry is active");if(!l)for(;!l;){if(i()<512){if(c){if(i()>0&&t)throw H;l=!0;return}return null}let p=r(512);if(ve(p)){if(i()<512*2){if(c){if(t)throw H;l=!0;return}return null}if(ve(r(512*2).subarray(512))){s(512*2),l=!0,f=!0;return}if(t)throw new Error("Invalid tar header.");s(512);continue}let m;try{m=at(p,t)}catch(E){if(t)throw E;s(512);continue}let x=ct(m.type);if(x){let E=m.size+(-m.size&511);if(i()<512+E){if(c&&t)throw H;return null}s(512);let v=x(a(E).subarray(0,m.size)),$=m.type==="pax-global-header"?y:g;for(let z in v)$[z]=v[z];continue}s(512);let b=m;return m.prefix&&(b.name=`${m.prefix}/${b.name}`),xe(b,y),xe(b,g),b.name.endsWith("/")&&b.type==="file"&&(b.type=ke),g={},u={header:b,remaining:b.size,padding:-b.size&511},o=D,b}},streamBody(p){if(o!==D||!u||u.remaining===0)return 0;let m=Math.min(u.remaining,i());if(m===0)return 0;let x=a(m,p);return u.remaining-=x,x},skipPadding(){if(o!==D||!u)return!0;if(u.remaining>0)throw new Error("Body not fully consumed");return i()<u.padding?!1:(s(u.padding),u=null,o=te,!0)},skipEntry(){if(o!==D||!u)return!0;let p=Math.min(u.remaining,i());return p>0&&(s(p),u.remaining-=p),u.remaining>0?!1:d.skipPadding()},validateEOF(){if(t){if(!f)throw H;if(i()>0&&a(i()).some(p=>p!==0))throw new Error("Invalid EOF.")}}};return d}function ve(e){if(e.byteOffset%8===0){let t=new BigUint64Array(e.buffer,e.byteOffset,e.length/8);for(let i=0;i<t.length;i++)if(t[i]!==0n)return!1;return!0}for(let t=0;t<e.length;t++)if(e[t]!==0)return!1;return!0}function Fe(){return new CompressionStream("gzip")}function Ie(){return new DecompressionStream("gzip")}function mt(){let e,t;return{readable:new ReadableStream({start(i){e=i,t=Be(i.enqueue.bind(i),i.error.bind(i),i.close.bind(i))}}),controller:{add(i){let r=N(i);return t.add(i),r&&t.endEntry(),new WritableStream({write(n){t.write(n)},close(){r||t.endEntry()},abort(n){e.error(n)}})},finalize(){t.finalize()},error(i){e.error(i)}}}}async function Pe(e){let t=[],i=e.getReader(),r=0;try{for(;;){let{done:a,value:o}=await i.read();if(a)break;t.push(o),r+=o.length}let n=new Uint8Array(r),s=0;for(let a of t)n.set(a,s),s+=a.length;return n}finally{i.releaseLock()}}var Se=e=>e.pipeTo(new WritableStream);function ht(e={}){let t=Te(e),i=e.strict??!1,r=null,n=null,s=!1,a=!1,o=!1,c=!1,l=()=>{try{n?.close()}catch{}n=null},f=d=>{if(!c){c=!0;try{n?.error(d)}catch{}n=null;try{r.error(d)}catch{}r=null}},u=()=>{if(!c){c=!0,l();try{r.close()}catch{}r=null}},y=()=>{if(i)throw new Error("Tar archive is truncated.");u()},g=()=>{if(!(s||c||!r)){s=!0;try{for(;;){if(a){o&&(t.validateEOF(),u());break}if(t.isEntryActive()){if(o&&!t.canFinish()){y();break}if(n){if((n.desiredSize??1)<=0)break;if(t.streamBody(d=>(n.enqueue(d),(n.desiredSize??1)>0))===0&&!t.isBodyComplete()){o&&y();break}}else if(!t.skipEntry()){o&&y();break}if(t.isBodyComplete()&&(l(),!t.skipPadding())){o&&y();break}}else{if((r.desiredSize??0)<0)break;let d=t.readHeader();if(d===null){o&&u();break}if(d===void 0){if(o){t.validateEOF(),u();break}a=!0;break}r.enqueue({header:d,body:new ReadableStream({start(p){d.size===0?p.close():n=p},pull:g,cancel(){n=null,g()}})})}}}catch(d){throw f(d),d}finally{s=!1}}};return{readable:new ReadableStream({start(d){r=d},pull:g,cancel(d){d!==void 0?f(d):u()}},{highWaterMark:2}),writable:new WritableStream({write(d){try{if(a&&i&&d.some(p=>p!==0))throw new Error("Invalid EOF.");t.write(d),g()}catch(p){throw f(p),p}},close(){try{o=!0,t.end(),g()}catch(d){throw f(d),d}},abort(d){f(d)}})}}async function Oe(e){let{readable:t,controller:i}=mt();return await(async()=>{for(let r of e){let n=i.add(r.header),s="body"in r?r.body:r.data;if(!s){await n.close();continue}if(s instanceof ReadableStream)await s.pipeTo(n);else if(s instanceof Blob)await s.stream().pipeTo(n);else try{let a=await Ce(s);if(a.length>0){let o=n.getWriter();await o.write(a),await o.close()}else await n.close()}catch{throw new TypeError(`Unsupported content type for entry "${r.header.name}".`)}}})().then(()=>i.finalize()).catch(r=>i.error(r)),new Uint8Array(await Pe(t))}async function Ue(e,t={}){let i=e instanceof ReadableStream?e:new ReadableStream({start(s){s.enqueue(e instanceof Uint8Array?e:new Uint8Array(e)),s.close()}}),r=[],n=i.pipeThrough(ht(t));for await(let s of n){let a;try{a=Ae(s.header,t)}catch(o){throw await s.body.cancel(),o}if(a===null){await Se(s.body);continue}N(a)?(await Se(s.body),r.push({header:a})):r.push({header:a,data:await Pe(s.body)})}return r}import At from"seek-bzip";var pt=(()=>{let e=new Uint32Array(256);for(let t=0;t<256;t++){let i=t<<24;for(let r=0;r<8;r++)i=i&2147483648?i<<1^79764919:i<<1;e[t]=i>>>0}return e})();function gt(e,t){return(e<<8^pt[(e>>>24^t)&255])>>>0}var ie=class{buffer=[];current=0;bitCount=0;writeBits(t,i){for(let r=t-1;r>=0;r--)this.current=this.current<<1|i>>>r&1,this.bitCount++,this.bitCount===8&&(this.buffer.push(this.current),this.current=0,this.bitCount=0)}writeBit(t){this.current=this.current<<1|t&1,this.bitCount++,this.bitCount===8&&(this.buffer.push(this.current),this.current=0,this.bitCount=0)}finish(){return this.bitCount>0&&this.buffer.push(this.current<<8-this.bitCount),new Uint8Array(this.buffer)}};function yt(e){let t=[],i=0;for(;i<e.length;){let r=e[i],n=1;for(;i+n<e.length&&e[i+n]===r&&n<255;)n++;n>=4?(t.push(r,r,r,r),t.push(n-4),i+=n):(t.push(r),i++)}return new Uint8Array(t)}function wt(e){let t=e.length;if(t===0)return{transformed:new Uint8Array(0),pointer:0};let i=bt(e),r=new Uint8Array(t),n=0;for(let s=0;s<t;s++)i[s]===0?(n=s,r[s]=e[t-1]):r[s]=e[i[s]-1];return{transformed:r,pointer:n}}function bt(e){let t=e.length,i=new Int32Array(t),r=new Int32Array(t);for(let n=0;n<t;n++)i[n]=n,r[n]=e[n];for(let n=1;n<t;n*=2){let s=r.slice();i.sort((a,o)=>s[a]!==s[o]?s[a]-s[o]:s[(a+n)%t]-s[(o+n)%t]),r[i[0]]=0;for(let a=1;a<t;a++)s[i[a]]===s[i[a-1]]&&s[(i[a]+n)%t]===s[(i[a-1]+n)%t]?r[i[a]]=r[i[a-1]]:r[i[a]]=r[i[a-1]]+1;if(r[i[t-1]]===t-1)break}return i}function xt(e,t){let i=[];for(let a=0;a<256;a++)t[a]&&i.push(a);let r=new Array(256).fill(-1);for(let a=0;a<i.length;a++)r[i[a]]=a;let n=new Uint16Array(e.length),s=i.slice();for(let a=0;a<e.length;a++){let o=e[a],c=0;for(;s[c]!==o;)c++;if(n[a]=c,c>0){let l=s[c];for(let f=c;f>0;f--)s[f]=s[f-1];s[0]=l}}return{encoded:n,length:e.length}}function vt(e,t,i){let s=i+1,a=[],o=0;for(;o<t;)if(e[o]===0){let l=0;for(;o<t&&e[o]===0;)l++,o++;let f=l;for(;f>0;)f--,f&1?a.push(1):a.push(0),f>>>=1}else a.push(e[o]+1),o++;a.push(s);let c=new Uint16Array(a.length);for(let l=0;l<a.length;l++)c[l]=a[l];return{symbols:c,length:a.length,eob:s}}function Ne(e,t,i){if(t<=1){let l=new Array(e.length).fill(0);for(let f=0;f<e.length;f++)e[f]>0&&(l[f]=1);return{codeLengths:l,maxLen:1,minLen:1}}let r=[];for(let l=0;l<e.length;l++)e[l]>0&&r.push({freq:e[l],symbol:l,left:null,right:null});if(r.length===0)return{codeLengths:new Array(e.length).fill(0),maxLen:0,minLen:0};if(r.length===1){let l=new Array(e.length).fill(0);return l[r[0].symbol]=1,{codeLengths:l,maxLen:1,minLen:1}}for(;r.length>1;){r.sort((u,y)=>u.freq-y.freq);let l=r.shift(),f=r.shift();r.push({freq:l.freq+f.freq,symbol:-1,left:l,right:f})}let n=new Array(e.length).fill(0);function s(l,f){if(!l.left&&!l.right){n[l.symbol]=f;return}l.left&&s(l.left,f+1),l.right&&s(l.right,f+1)}s(r[0],0);let a=!0;for(;a;){a=!1;for(let l=0;l<n.length;l++)n[l]>i&&(n[l]=i,a=!0);if(a){let l=0;for(let f=0;f<n.length;f++)n[f]>0&&(l+=1/(1<<n[f]));if(l>1)for(let f=1;f<i&&l>1;f++)for(let u=0;u<n.length&&l>1;u++)n[u]===f&&(n[u]++,l-=1/(1<<f)-1/(1<<f+1));a=!1;for(let f=0;f<n.length;f++)if(n[f]>i){a=!0;break}}}let o=i,c=0;for(let l=0;l<n.length;l++)n[l]>0&&(n[l]<o&&(o=n[l]),n[l]>c&&(c=n[l]));return{codeLengths:n,maxLen:c,minLen:o}}function kt(e,t){let i=new Array(t).fill(0),r=e.slice(0,t),n=Math.max(...r,0),s=new Array(n+1).fill(0);for(let c=0;c<t;c++)r[c]>0&&s[r[c]]++;let a=new Array(n+1).fill(0),o=0;for(let c=1;c<=n;c++)o=o+s[c-1]<<1,a[c]=o;for(let c=0;c<t;c++)r[c]>0&&(i[c]=a[r[c]]++);return{codes:i,lengths:r}}function zt(e,t,i){e.writeBits(24,3227993),e.writeBits(24,2511705),e.writeBits(32,i),e.writeBit(0);let r=yt(t),{transformed:n,pointer:s}=wt(r);e.writeBits(24,s);let a=new Array(256).fill(!1);for(let h=0;h<n.length;h++)a[n[h]]=!0;let o=new Array(16).fill(!1);for(let h=0;h<16;h++)for(let w=0;w<16;w++)if(a[h*16+w]){o[h]=!0;break}for(let h=0;h<16;h++)e.writeBit(o[h]?1:0);for(let h=0;h<16;h++)if(o[h])for(let w=0;w<16;w++)e.writeBit(a[h*16+w]?1:0);let c=0;for(let h=0;h<256;h++)a[h]&&c++;let{encoded:l,length:f}=xt(n,a),{symbols:u,length:y}=vt(l,f,c),g=c+2,d=50,p=Math.ceil(y/d),m;y<200?m=2:y<600?m=3:y<1200?m=4:y<2400?m=5:m=6,m>p&&(m=Math.max(2,p));let x=[];for(let h=0;h<m;h++)x.push(new Array(g).fill(0));let b=new Int32Array(p);for(let h=0;h<p;h++)b[h]=h%m;for(let h=0;h<p;h++){let w=h*d,k=Math.min(w+d,y),B=b[h];for(let C=w;C<k;C++)x[B][u[C]]++}function E(h){for(let w=0;w<g;w++)h[w]<1&&(h[w]=1)}let v=[];for(let h=0;h<m;h++)E(x[h]),v.push(Ne(x[h],g,20));for(let h=0;h<4;h++){for(let w=0;w<m;w++)x[w].fill(0);for(let w=0;w<p;w++){let k=w*d,B=Math.min(k+d,y),C=0,M=1/0;for(let I=0;I<m;I++){let J=0;for(let V=k;V<B;V++)J+=v[I].codeLengths[u[V]]||20;J<M&&(M=J,C=I)}b[w]=C;for(let I=k;I<B;I++)x[C][u[I]]++}for(let w=0;w<m;w++)E(x[w]),v[w]=Ne(x[w],g,20)}e.writeBits(3,m),e.writeBits(15,p);let $=[],z=[];for(let h=0;h<m;h++)z.push(h);for(let h=0;h<p;h++){let w=b[h],k=0;for(;z[k]!==w;)k++;if($.push(k),k>0){let B=z[k];for(let C=k;C>0;C--)z[C]=z[C-1];z[0]=B}}for(let h=0;h<p;h++){for(let w=0;w<$[h];w++)e.writeBit(1);e.writeBit(0)}for(let h=0;h<m;h++){let w=v[h].codeLengths,k=w[0];e.writeBits(5,k);for(let B=0;B<g;B++){let C=w[B];for(;k<C;)e.writeBit(1),e.writeBit(0),k++;for(;k>C;)e.writeBit(1),e.writeBit(1),k--;e.writeBit(0)}}for(let h=0;h<m;h++){let{codes:w,lengths:k}=kt(v[h].codeLengths,g);v[h]=Object.assign(v[h],{_codes:w,_lengths:k})}let he=0,R=0;for(let h=0;h<y;h++){(R===0||R>=d)&&(h>0&&he++,R=0);let w=b[he],k=v[w],B=u[h],C=k._lengths[B],M=k._codes[B];C>0&&e.writeBits(C,M),R++}}var Ct=10*1024*1024;function Le(e,t=9,i=Ct){if(t<1||t>9)throw new Error("Block size level must be 1-9");if(e.length>i)throw new Error(`Input too large for bzip2 compression (${e.length} bytes, max ${i})`);let r=t*1e5,n=new ie;n.writeBits(8,66),n.writeBits(8,90),n.writeBits(8,104),n.writeBits(8,48+t);let s=0,a=0;for(;a<e.length;){let o=Math.min(a+r,e.length),c=e.subarray(a,o),l=4294967295;for(let f=0;f<c.length;f++)l=gt(l,c[f]);l=~l>>>0,s=(s<<1|s>>>31)>>>0,s=(s^l)>>>0,zt(n,c,l),a=o}return n.writeBits(24,1536581),n.writeBits(24,3690640),n.writeBits(32,s),n.finish()}var X=null,Z=null;async function Me(){if(X)return X;if(Z)throw Z;try{return X=await Q.runTrustedAsync(()=>import("node-liblzma")),X}catch{throw Z=new Error("xz compression requires node-liblzma which failed to load. Install liblzma-dev (apt) or xz (brew) and reinstall dependencies."),Z}}var G=null,q=null;async function We(){if(G)return G;if(q)throw q;try{return G=await Q.runTrustedAsync(()=>import("@mongodb-js/zstd")),G}catch{throw q=new Error("zstd compression requires @mongodb-js/zstd which is not installed. Install it with: npm install @mongodb-js/zstd"),q}}var A=100*1024*1024,De=512,Re=1e4;function Et(e){let t="file";e.isDirectory?t="directory":e.isSymlink&&(t="symlink");let i=e.name;e.isDirectory&&!i.endsWith("/")&&(i+="/");let r;e.content!==void 0&&(typeof e.content=="string"?r=new TextEncoder().encode(e.content):r=e.content);let n=e.isDirectory||e.isSymlink?0:r?.length??0;return{header:{name:i,mode:e.mode??(e.isDirectory?493:420),uid:e.uid??0,gid:e.gid??0,size:n,mtime:e.mtime??new Date,type:t,linkname:e.linkTarget??"",uname:"user",gname:"user"},body:r}}async function O(e){let t=e.map(Et);return Oe(t)}async function je(e){let t=await O(e),n=new ReadableStream({start(l){l.enqueue(t),l.close()}}).pipeThrough(Fe()).getReader(),s=[];for(;;){let{done:l,value:f}=await n.read();if(l)break;s.push(f)}let a=s.reduce((l,f)=>l+f.length,0),o=new Uint8Array(a),c=0;for(let l of s)o.set(l,c),c+=l.length;return o}async function F(e){if(e.length>A)return{entries:[],error:`Archive too large (max ${A} bytes)`};if(e.length<De||e.length%De!==0)return{entries:[],error:"Invalid tar archive format"};try{let t=await Ue(e),i=[];for(let r of t){if(i.length>=Re)return{entries:i,error:`Too many entries (max ${Re})`};let n="file";switch(r.header.type){case"directory":n="directory";break;case"symlink":n="symlink";break;case"link":n="hardlink";break;case"file":n="file";break;default:n="other"}i.push({name:r.header.name,mode:r.header.mode??420,uid:r.header.uid??0,gid:r.header.gid??0,size:r.header.size,mtime:r.header.mtime??new Date,type:n,linkTarget:r.header.linkname||void 0,content:r.data??new Uint8Array(0)})}return{entries:i}}catch(t){let i=t instanceof Error?t.message:"Unknown error";return{entries:[],error:i}}}async function se(e){if(e.length>A)return{entries:[],error:`Archive too large (max ${A} bytes)`};try{let r=new ReadableStream({start(c){c.enqueue(e),c.close()}}).pipeThrough(Ie()).getReader(),n=[],s=0;for(;;){let{done:c,value:l}=await r.read();if(c)break;if(s+=l.length,s>A)return await r.cancel(),{entries:[],error:`Decompressed archive too large (max ${A} bytes)`};n.push(l)}let a=new Uint8Array(s),o=0;for(let c of n)a.set(c,o),o+=c.length;return F(a)}catch(t){let i=t instanceof Error?t.message:"Unknown error";return{entries:[],error:`Decompression failed: ${i}`}}}function oe(e){return e.length>=2&&e[0]===31&&e[1]===139}function ae(e){return e.length>=3&&e[0]===66&&e[1]===90&&e[2]===104}function le(e){return e.length>=6&&e[0]===253&&e[1]===55&&e[2]===122&&e[3]===88&&e[4]===90&&e[5]===0}async function $t(e){let t=At.decode(Buffer.from(e));return new Uint8Array(t)}async function Bt(e){return Le(e,9)}async function Tt(e){let i=(await Me()).unxzSync(Buffer.from(e));return new Uint8Array(i)}async function St(e){let i=(await Me()).xzSync(Buffer.from(e));return new Uint8Array(i)}async function He(e){let t=await O(e);return Bt(t)}async function _e(e,t){if(!t?.allowNativeCodecs)throw new Error("xz compression is disabled by default (native codec risk). Pass { allowNativeCodecs: true } to opt in.");let i=await O(e);return St(i)}async function ce(e){if(e.length>A)return{entries:[],error:`Archive too large (max ${A} bytes)`};try{let t=await $t(e);return t.length>A?{entries:[],error:`Decompressed archive too large (max ${A} bytes)`}:F(t)}catch(t){let i=t instanceof Error?t.message:"Unknown error";return{entries:[],error:i}}}async function fe(e,t){if(!t?.allowNativeCodecs)return{entries:[],error:"xz decompression is disabled by default (native codec risk). Pass { allowNativeCodecs: true } to opt in, or decompress the archive externally before extraction."};if(e.length>A)return{entries:[],error:`Archive too large (max ${A} bytes)`};try{let i=await Tt(e);return i.length>A?{entries:[],error:`Decompressed archive too large (max ${A} bytes)`}:F(i)}catch(i){let r=i instanceof Error?i.message:"Unknown error";return{entries:[],error:r}}}function ue(e){return e.length>=4&&e[0]===40&&e[1]===181&&e[2]===47&&e[3]===253}async function Ft(e){let i=await(await We()).compress(Buffer.from(e),3);return new Uint8Array(i)}async function It(e){let i=await(await We()).decompress(Buffer.from(e));return new Uint8Array(i)}async function Xe(e,t){if(!t?.allowNativeCodecs)throw new Error("zstd compression is disabled by default (native codec risk). Pass { allowNativeCodecs: true } to opt in.");let i=await O(e);return Ft(i)}async function de(e,t){if(!t?.allowNativeCodecs)return{entries:[],error:"zstd decompression is disabled by default (native codec risk). Pass { allowNativeCodecs: true } to opt in, or decompress the archive externally before extraction."};if(e.length>A)return{entries:[],error:`Archive too large (max ${A} bytes)`};try{let i=await It(e);return i.length>A?{entries:[],error:`Decompressed archive too large (max ${A} bytes)`}:F(i)}catch(i){let r=i instanceof Error?i.message:"Unknown error";return{entries:[],error:r}}}function Ze(e){let t={create:!1,append:!1,update:!1,extract:!1,list:!1,file:"",autoCompress:!1,gzip:!1,bzip2:!1,xz:!1,zstd:!1,verbose:!1,toStdout:!1,keepOldFiles:!1,touch:!1,directory:"",preserve:!1,absoluteNames:!1,strip:0,exclude:[],filesFrom:"",excludeFrom:"",wildcards:!1},i=[],r=0;for(;r<e.length;){let n=e[r];if(n.startsWith("-")&&!n.startsWith("--")&&n.length>2){if(/^-\d+$/.test(n)){i.push(n),r++;continue}for(let s=1;s<n.length;s++){let a=n[s];switch(a){case"c":t.create=!0;break;case"r":t.append=!0;break;case"u":t.update=!0;break;case"x":t.extract=!0;break;case"t":t.list=!0;break;case"a":t.autoCompress=!0;break;case"z":t.gzip=!0;break;case"j":t.bzip2=!0;break;case"J":t.xz=!0;break;case"v":t.verbose=!0;break;case"O":t.toStdout=!0;break;case"k":t.keepOldFiles=!0;break;case"m":t.touch=!0;break;case"p":t.preserve=!0;break;case"P":t.absoluteNames=!0;break;case"f":if(s<n.length-1)t.file=n.substring(s+1),s=n.length;else{if(r++,r>=e.length)return{ok:!1,error:{stdout:"",stderr:`tar: option requires an argument -- 'f'
|
|
4
4
|
`,exitCode:2}};t.file=e[r]}break;case"C":if(s<n.length-1)t.directory=n.substring(s+1),s=n.length;else{if(r++,r>=e.length)return{ok:!1,error:{stdout:"",stderr:`tar: option requires an argument -- 'C'
|
|
5
5
|
`,exitCode:2}};t.directory=e[r]}break;case"T":if(s<n.length-1)t.filesFrom=n.substring(s+1),s=n.length;else{if(r++,r>=e.length)return{ok:!1,error:{stdout:"",stderr:`tar: option requires an argument -- 'T'
|
|
@@ -18,7 +18,7 @@ import{a as ye}from"./chunk-YMMJLYIX.js";import{b as Q}from"./chunk-YU6OGPZR.js"
|
|
|
18
18
|
`,exitCode:2}}let c="";if(t.file&&t.file!=="-"){let f=e.fs.resolvePath(e.cwd,t.file);try{await e.fs.writeFile(f,o)}catch(u){let y=u instanceof Error?u.message:"unknown error";return{stdout:"",stderr:`tar: ${t.file}: ${y}
|
|
19
19
|
`,exitCode:2}}}else c=Buffer.from(o).toString("latin1");let l=a;return s.length>0&&(l+=`${s.join(`
|
|
20
20
|
`)}
|
|
21
|
-
`),{stdout:c,stderr:l,exitCode:s.length>0?2:0}}async function Lt(e,t,i){if(!t.file||t.file==="-")return{stdout:"",stderr:`tar: Cannot append to stdin/stdout
|
|
21
|
+
`),{stdout:c,stderr:l,exitCode:s.length>0?2:0,stdoutKind:c.length>0?"bytes":"text"}}async function Lt(e,t,i){if(!t.file||t.file==="-")return{stdout:"",stderr:`tar: Cannot append to stdin/stdout
|
|
22
22
|
`,exitCode:2};if(i.length===0)return{stdout:"",stderr:`tar: Cowardly refusing to append nothing to archive
|
|
23
23
|
`,exitCode:2};let r=e.fs.resolvePath(e.cwd,t.file),n;try{n=await e.fs.readFileBuffer(r)}catch{return{stdout:"",stderr:`tar: ${t.file}: Cannot open: No such file or directory
|
|
24
24
|
`,exitCode:2}}let s=await F(n);if(s.error)return{stdout:"",stderr:`tar: ${s.error}
|
|
@@ -52,7 +52,7 @@ import{a as ye}from"./chunk-YMMJLYIX.js";import{b as Q}from"./chunk-YU6OGPZR.js"
|
|
|
52
52
|
`,exitCode:2}}}else r=Uint8Array.from(e.stdin,f=>f.charCodeAt(0));let n,s=t.gzip||oe(r),a=t.bzip2||ae(r),o=t.xz||le(r),c=t.zstd||ue(r);if(s?n=await se(r):a?n=await ce(r):o?n=await fe(r):c?n=await de(r):n=await F(r),n.error)return{stdout:"",stderr:`tar: ${n.error}
|
|
53
53
|
`,exitCode:2};let l="";for(let f of n.entries){let u=qe(f.name,t.strip);if(!u)continue;let y=u.endsWith("/")?u.slice(0,-1):u;if(i.length>0){let g;if(t.wildcards?g=i.some(d=>Y(u,d)||Y(y,d)||u.startsWith(`${d}/`)):g=i.some(d=>u===d||u.startsWith(`${d}/`)||y===d),!g)continue}if(!me(u,t.exclude))if(t.verbose){let g=f.type==="directory",d=ye(f.mode,g),p=`${f.uid}/${f.gid}`,m=f.size.toString().padStart(8," "),x=Ut(f.mtime),b=`${d} ${p.padEnd(10)} ${m} ${x} ${u}`;f.type==="symlink"&&f.linkTarget&&(b+=` -> ${f.linkTarget}`),l+=`${b}
|
|
54
54
|
`}else l+=`${u}
|
|
55
|
-
`}return{stdout:l,stderr:"",exitCode:0}}var
|
|
55
|
+
`}return{stdout:l,stderr:"",exitCode:0}}var sr={name:"tar",async execute(e,t){if(ge(e))return pe(Pt);let i=Ze(e);if(!i.ok)return i.error;let{options:r,files:n}=i,s=[r.create,r.append,r.update,r.extract,r.list].filter(Boolean).length;if(s===0)return{stdout:"",stderr:`tar: You must specify one of -c, -r, -u, -x, or -t
|
|
56
56
|
`,exitCode:2};if(s>1)return{stdout:"",stderr:`tar: You may not specify more than one of -c, -r, -u, -x, or -t
|
|
57
57
|
`,exitCode:2};if(r.autoCompress&&r.file&&r.create){let c=r.file.toLowerCase();c.endsWith(".tar.gz")||c.endsWith(".tgz")?r.gzip=!0:c.endsWith(".tar.bz2")||c.endsWith(".tbz2")?r.bzip2=!0:c.endsWith(".tar.xz")||c.endsWith(".txz")?r.xz=!0:(c.endsWith(".tar.zst")||c.endsWith(".tzst"))&&(r.zstd=!0)}let a=[r.gzip,r.bzip2,r.xz,r.zstd].filter(Boolean).length;if(a>1)return{stdout:"",stderr:`tar: You may not specify more than one compression option
|
|
58
58
|
`,exitCode:2};if((r.append||r.update)&&a>0)return{stdout:"",stderr:`tar: Cannot append/update compressed archives - decompress first
|
|
@@ -60,4 +60,4 @@ import{a as ye}from"./chunk-YMMJLYIX.js";import{b as Q}from"./chunk-YU6OGPZR.js"
|
|
|
60
60
|
`).map(u=>u.trim()).filter(u=>u.length>0&&!u.startsWith("#"));o=[...n,...f]}catch{return{stdout:"",stderr:`tar: ${r.filesFrom}: Cannot open: No such file or directory
|
|
61
61
|
`,exitCode:2}}}if(r.excludeFrom){let c=t.fs.resolvePath(t.cwd,r.excludeFrom);try{let f=(await t.fs.readFile(c)).split(`
|
|
62
62
|
`).map(u=>u.trim()).filter(u=>u.length>0&&!u.startsWith("#"));r.exclude.push(...f)}catch{return{stdout:"",stderr:`tar: ${r.excludeFrom}: Cannot open: No such file or directory
|
|
63
|
-
`,exitCode:2}}}return r.create?Nt(t,r,o):r.append?Lt(t,r,o):r.update?Dt(t,r,o):r.extract?Rt(t,r,o):Mt(t,r,o)}},
|
|
63
|
+
`,exitCode:2}}}return r.create?Nt(t,r,o):r.append?Lt(t,r,o):r.update?Dt(t,r,o):r.extract?Rt(t,r,o):Mt(t,r,o)}},or={name:"tar",flags:[{flag:"-c",type:"boolean"},{flag:"-x",type:"boolean"},{flag:"-t",type:"boolean"},{flag:"-f",type:"value",valueHint:"path"},{flag:"-z",type:"boolean"},{flag:"-j",type:"boolean"},{flag:"-v",type:"boolean"},{flag:"-C",type:"value",valueHint:"path"},{flag:"--strip-components",type:"value",valueHint:"number"},{flag:"--exclude",type:"value",valueHint:"pattern"}],needsArgs:!0};export{sr as a,or as b};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import{a as d}from"./chunk-63XSH3IT.js";import{a as f,b as c,c as u}from"./chunk-GTNBSMZR.js";var x={name:"expand",summary:"convert tabs to spaces",usage:"expand [OPTION]... [FILE]...",description:"Convert TABs in each FILE to spaces, writing to standard output. If no FILE is specified, standard input is read.",options:["-t N Use N spaces per tab (default: 8)","-t LIST Use comma-separated list of tab stops","-i Only convert leading tabs on each line"],examples:["expand file.txt # Convert all tabs to 8 spaces","expand -t 4 file.txt # Use 4-space tabs","expand -t 4,8,12 file.txt # Custom tab stops"]};function p(n){let i=n.split(",").map(o=>o.trim()),t=[];for(let o of i){let e=parseInt(o,10);if(Number.isNaN(e)||e<1)return null;t.push(e)}for(let o=1;o<t.length;o++)if(t[o]<=t[o-1])return null;return t}function g(n,i){if(i.length===1){let t=i[0];return t-n%t}for(let t of i)if(t>n)return t-n;if(i.length>=2){let t=i[i.length-1]-i[i.length-2],o=i[i.length-1],e=Math.floor((n-o)/t)+1;return o+e*t-n}return 1}function b(n,i){let{tabStops:t,leadingOnly:o}=i,e="",r=0,s=!0;for(let a of n)if(a===" ")if(o&&!s)e+=a,r++;else{let l=g(r,t);e+=" ".repeat(l),r+=l}else a!==" "&&a!==" "&&(s=!1),e+=a,r++;return e}function h(n,i){if(n==="")return"";let t=n.split(`
|
|
3
|
+
`),o=n.endsWith(`
|
|
4
|
+
`)&&t[t.length-1]==="";return o&&t.pop(),t.map(r=>b(r,i)).join(`
|
|
5
|
+
`)+(o?`
|
|
6
|
+
`:"")}var y={name:"expand",execute:async(n,i)=>{if(c(n))return f(x);let t={tabStops:[8],leadingOnly:!1},o=[],e=0;for(;e<n.length;){let s=n[e];if(s==="-t"&&e+1<n.length){let a=p(n[e+1]);if(!a)return{exitCode:1,stdout:"",stderr:`expand: invalid tab size: '${n[e+1]}'
|
|
7
|
+
`};t.tabStops=a,e+=2}else if(s.startsWith("-t")&&s.length>2){let a=p(s.slice(2));if(!a)return{exitCode:1,stdout:"",stderr:`expand: invalid tab size: '${s.slice(2)}'
|
|
8
|
+
`};t.tabStops=a,e++}else if(s==="--tabs"&&e+1<n.length){let a=p(n[e+1]);if(!a)return{exitCode:1,stdout:"",stderr:`expand: invalid tab size: '${n[e+1]}'
|
|
9
|
+
`};t.tabStops=a,e+=2}else if(s.startsWith("--tabs=")){let a=p(s.slice(7));if(!a)return{exitCode:1,stdout:"",stderr:`expand: invalid tab size: '${s.slice(7)}'
|
|
10
|
+
`};t.tabStops=a,e++}else if(s==="-i"||s==="--initial")t.leadingOnly=!0,e++;else if(s==="--"){o.push(...n.slice(e+1));break}else{if(s.startsWith("-")&&s!=="-")return u("expand",s);o.push(s),e++}}let r="";if(o.length===0){let s=d(i.stdin)??"";r=h(s,t)}else for(let s of o){let a=i.fs.resolvePath(i.cwd,s),l=await i.fs.readFile(a);if(l===null)return{exitCode:1,stdout:r,stderr:`expand: ${s}: No such file or directory
|
|
11
|
+
`};r+=h(l,t)}return{exitCode:0,stdout:r,stderr:""}}},C={name:"expand",flags:[{flag:"-t",type:"value",valueHint:"number"},{flag:"-i",type:"boolean"}],stdinType:"text",needsFiles:!0};export{y as a,C as b};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import{a as d}from"./chunk-4PRVMER6.js";import{a as f,b as m,c}from"./chunk-GTNBSMZR.js";var g={name:"env",summary:"run a program in a modified environment",usage:"env [OPTION]... [NAME=VALUE]... [COMMAND [ARG]...]",options:["-i, --ignore-environment start with an empty environment","-u NAME, --unset=NAME remove NAME from the environment"," --help display this help and exit"]},M={name:"env",async execute(o,i){if(m(o))return f(g);let a=!1,r=[],u=new Map,t=-1;for(let n=0;n<o.length;n++){let e=o[n];if(e==="-i"||e==="--ignore-environment")a=!0;else if(e==="-u"&&n+1<o.length)r.push(o[++n]);else if(e.startsWith("-u"))r.push(e.slice(2));else if(e.startsWith("--unset="))r.push(e.slice(8));else{if(e.startsWith("--")&&e!=="--")return c("env",e);if(e.startsWith("-")&&e!=="-"){for(let l of e.slice(1))if(l!=="i"&&l!=="u")return c("env",`-${l}`);e.includes("i")&&(a=!0)}else if(e.includes("=")&&t===-1){let l=e.indexOf("="),v=e.slice(0,l),h=e.slice(l+1);u.set(v,h)}else{t=n;break}}}let s;if(a)s=new Map(u);else{s=new Map(i.env);for(let n of r)s.delete(n);for(let[n,e]of u)s.set(n,e)}if(t===-1){let n=[];for(let[e,l]of s)n.push(`${e}=${l}`);return{stdout:n.join(`
|
|
3
|
+
`)+(n.length>0?`
|
|
4
|
+
`:""),stderr:"",exitCode:0}}if(!i.exec)return{stdout:"",stderr:`env: command execution not supported in this context
|
|
5
|
+
`,exitCode:1};let p=o.slice(t);return i.exec("command",{cwd:i.cwd,env:d(s),replaceEnv:!0,stdin:i.stdin,stdinKind:"bytes",signal:i.signal,args:p})}},y={name:"printenv",summary:"print all or part of environment",usage:"printenv [OPTION]... [VARIABLE]...",options:[" --help display this help and exit"]},N={name:"printenv",async execute(o,i){if(m(o))return f(y);let a=o.filter(t=>!t.startsWith("-"));if(a.length===0){let t=[];for(let[s,p]of i.env)t.push(`${s}=${p}`);return{stdout:t.join(`
|
|
6
|
+
`)+(t.length>0?`
|
|
7
|
+
`:""),stderr:"",exitCode:0}}let r=[],u=0;for(let t of a){let s=i.env.get(t);s!==void 0?r.push(s):u=1}return{stdout:r.join(`
|
|
8
|
+
`)+(r.length>0?`
|
|
9
|
+
`:""),stderr:"",exitCode:u}}},C={name:"env",flags:[{flag:"-i",type:"boolean"},{flag:"-u",type:"value",valueHint:"string"}]},F={name:"printenv",flags:[]};export{M as a,N as b,C as c,F as d};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import{a as f,b as
|
|
2
|
+
import{a as f}from"./chunk-63XSH3IT.js";import{a as m,b as c,c as b}from"./chunk-GTNBSMZR.js";var p={name:"nl",summary:"number lines of files",usage:"nl [OPTION]... [FILE]...",description:"Write each FILE to standard output, with line numbers added. If no FILE is specified, standard input is read.",options:["-b STYLE Body numbering style: a (all), t (non-empty), n (none)","-n FORMAT Number format: ln (left), rn (right), rz (right zeros)","-w WIDTH Number width (default: 6)","-s SEP Separator after number (default: TAB)","-v START Starting line number (default: 1)","-i INCR Line number increment (default: 1)"],examples:["nl file.txt # Number non-empty lines","nl -ba file.txt # Number all lines","nl -n rz -w 3 file.txt # Right-justified with zeros","nl -s ': ' file.txt # Use ': ' as separator"]};function N(r,s,i){let l=String(r);switch(s){case"ln":return l.padEnd(i);case"rn":return l.padStart(i);case"rz":return l.padStart(i,"0");default:return s}}function v(r,s){switch(s){case"a":return!0;case"t":return r.trim().length>0;case"n":return!1;default:return s}}function h(r,s,i){if(r==="")return{output:"",nextNumber:i};let l=r.split(`
|
|
3
3
|
`),t=[],u=i,a=r.endsWith(`
|
|
4
|
-
`)&&l[l.length-1]==="";a&&l.pop();for(let n of l)if(
|
|
4
|
+
`)&&l[l.length-1]==="";a&&l.pop();for(let n of l)if(v(n,s.bodyStyle)){let e=N(u,s.numberFormat,s.width);t.push(`${e}${s.separator}${n}`),u+=s.increment}else{let e=" ".repeat(s.width);t.push(`${e}${s.separator}${n}`)}return{output:t.join(`
|
|
5
5
|
`)+(a?`
|
|
6
|
-
`:""),nextNumber:u}}var
|
|
6
|
+
`:""),nextNumber:u}}var w={name:"nl",execute:async(r,s)=>{if(c(r))return m(p);let i={bodyStyle:"t",numberFormat:"rn",width:6,separator:" ",startNumber:1,increment:1},l=[],t=0;for(;t<r.length;){let n=r[t];if(n==="-b"&&t+1<r.length){let e=r[t+1];if(e!=="a"&&e!=="t"&&e!=="n")return{exitCode:1,stdout:"",stderr:`nl: invalid body numbering style: '${e}'
|
|
7
7
|
`};i.bodyStyle=e,t+=2}else if(n.startsWith("-b")){let e=n.slice(2);if(e!=="a"&&e!=="t"&&e!=="n")return{exitCode:1,stdout:"",stderr:`nl: invalid body numbering style: '${e}'
|
|
8
8
|
`};i.bodyStyle=e,t++}else if(n==="-n"&&t+1<r.length){let e=r[t+1];if(e!=="ln"&&e!=="rn"&&e!=="rz")return{exitCode:1,stdout:"",stderr:`nl: invalid line numbering format: '${e}'
|
|
9
9
|
`};i.numberFormat=e,t+=2}else if(n.startsWith("-n")){let e=n.slice(2);if(e!=="ln"&&e!=="rn"&&e!=="rz")return{exitCode:1,stdout:"",stderr:`nl: invalid line numbering format: '${e}'
|
|
@@ -13,5 +13,5 @@ import{a as f,b as m,c}from"./chunk-GTNBSMZR.js";var h={name:"nl",summary:"numbe
|
|
|
13
13
|
`};i.startNumber=e,t+=2}else if(n.startsWith("-v")){let e=parseInt(n.slice(2),10);if(Number.isNaN(e))return{exitCode:1,stdout:"",stderr:`nl: invalid starting line number: '${n.slice(2)}'
|
|
14
14
|
`};i.startNumber=e,t++}else if(n==="-i"&&t+1<r.length){let e=parseInt(r[t+1],10);if(Number.isNaN(e))return{exitCode:1,stdout:"",stderr:`nl: invalid line number increment: '${r[t+1]}'
|
|
15
15
|
`};i.increment=e,t+=2}else if(n.startsWith("-i")){let e=parseInt(n.slice(2),10);if(Number.isNaN(e))return{exitCode:1,stdout:"",stderr:`nl: invalid line number increment: '${n.slice(2)}'
|
|
16
|
-
`};i.increment=e,t++}else if(n==="--"){l.push(...r.slice(t+1));break}else{if(n.startsWith("-")&&n!=="-")return
|
|
17
|
-
`};let d=
|
|
16
|
+
`};i.increment=e,t++}else if(n==="--"){l.push(...r.slice(t+1));break}else{if(n.startsWith("-")&&n!=="-")return b("nl",n);l.push(n),t++}}let u="",a=i.startNumber;if(l.length===0){let n=f(s.stdin)??"";u=h(n,i,a).output}else for(let n of l){let e=s.fs.resolvePath(s.cwd,n),o=await s.fs.readFile(e);if(o===null)return{exitCode:1,stdout:u,stderr:`nl: ${n}: No such file or directory
|
|
17
|
+
`};let d=h(o,i,a);u+=d.output,a=d.nextNumber}return{exitCode:0,stdout:u,stderr:""}}},g={name:"nl",flags:[{flag:"-b",type:"value",valueHint:"string"},{flag:"-n",type:"value",valueHint:"string"},{flag:"-w",type:"value",valueHint:"number"},{flag:"-s",type:"value",valueHint:"string"},{flag:"-v",type:"value",valueHint:"number"},{flag:"-i",type:"value",valueHint:"number"}],stdinType:"text",needsFiles:!0};export{w as a,g as b};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import{a as l,b as n,d as s}from"./chunk-
|
|
2
|
+
import{a as l,b as n,d as s}from"./chunk-KX2PR2HV.js";import{a,b as i}from"./chunk-GTNBSMZR.js";var m={name:"tail",summary:"output the last part of files",usage:"tail [OPTION]... [FILE]...",options:["-c, --bytes=NUM print the last NUM bytes","-n, --lines=NUM print the last NUM lines (default 10)","-n +NUM print starting from line NUM","-q, --quiet never print headers giving file names","-v, --verbose always print headers giving file names"," --help display this help and exit"]},d={name:"tail",async execute(t,r){if(i(t))return a(m);let e=l(t,"tail");if(!e.ok)return e.error;let{lines:o,bytes:p,fromLine:f}=e.options;return n(r,e.options,"tail",u=>s(u,o,p,f??!1))}},c={name:"tail",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{d as a,c as b};
|