just-bash 2.15.1-executor.0 → 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 +43 -0
- package/README.md +38 -2
- package/dist/Bash.d.ts +23 -84
- 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-63XSH3IT.js +2 -0
- package/dist/bin/{shell/chunks/chunk-N43DJTSI.js → chunks/chunk-6CW6ATOU.js} +1 -1
- package/dist/bin/chunks/chunk-6NYAJMTL.js +14 -0
- package/dist/bin/chunks/chunk-6ZKYK7PO.js +63 -0
- 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/{shell/chunks/chunk-XKPFI566.js → chunks/chunk-AM6HJVBI.js} +17 -17
- 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/chunks/{chunk-NLBRLRWD.js → chunk-B5DAHNDY.js} +1 -1
- package/dist/bin/chunks/chunk-BEWZWAXH.js +8 -0
- package/dist/bin/{shell/chunks/chunk-SE4C7FJY.js → chunks/chunk-C6FRS5UB.js} +13 -13
- 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/chunks/{chunk-SXB55JOI.js → chunk-DH7TPGPX.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-RMQC3GS7.js → chunk-NOGXKS2G.js} +23 -23
- package/dist/bin/chunks/chunk-NTW6IA45.js +2 -0
- package/dist/bin/{shell/chunks/chunk-7BORMNPQ.js → chunks/chunk-NWG67HAQ.js} +1 -1
- package/dist/bin/chunks/{chunk-A3HQTYHR.js → chunk-P43NQKUN.js} +1 -1
- package/dist/bin/chunks/chunk-PHZPFNDZ.js +287 -0
- package/dist/bin/chunks/chunk-RX22J4AC.js +14 -0
- package/dist/bin/chunks/chunk-S7KZBLGH.js +3 -0
- package/dist/bin/{shell/chunks/chunk-ZO5PSLKR.js → chunks/chunk-SDOJRQF5.js} +1 -1
- package/dist/bin/chunks/chunk-UFJFAFSS.js +28 -0
- package/dist/bin/chunks/chunk-UMYJNWPA.js +140 -0
- package/dist/bin/chunks/chunk-UO7ZJYDM.js +11 -0
- package/dist/bin/chunks/{chunk-THNL3XFF.js → 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-WLBA7L7U.js +23 -0
- package/dist/bin/{shell/chunks/chunk-SXRVLCZ4.js → chunks/chunk-WRYJHXRE.js} +1 -1
- package/dist/bin/chunks/chunk-XZEAAOBW.js +8 -0
- package/dist/bin/{shell/chunks/chunk-SDLWFYVT.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/{curl-SRTMGOVV.js → curl-2DCNBIKJ.js} +8 -8
- 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-2RO5M3QC.js → chunks/expansion-H3VFC532.js} +1 -1
- package/dist/bin/chunks/{expr-4CJYC4LY.js → expr-VPJ77DR7.js} +1 -1
- package/dist/bin/{shell/chunks/file-D5YKS5NV.js → chunks/file-MMSHRWCJ.js} +1 -1
- package/dist/bin/chunks/find-O2KKT6KZ.js +2 -0
- package/dist/bin/chunks/flag-coverage-FHFMNAV6.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-HYQ3KMGL.js +2 -0
- package/dist/bin/chunks/js-exec-LZPKIZ5V.js +97 -0
- package/dist/bin/chunks/js-exec-worker.js +27 -185
- package/dist/bin/chunks/{ls-G2PXHSNX.js → ls-WONXDVOX.js} +1 -1
- 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/{printf-P3QVL4IO.js → printf-NA7DYZBO.js} +1 -1
- 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 +28 -9
- package/dist/bin/chunks/xan-IHA7IHBM.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-LDGFI4EM.js +2 -0
- package/dist/bin/just-bash.js +292 -292
- 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-63XSH3IT.js +2 -0
- package/dist/bin/{chunks/chunk-N43DJTSI.js → shell/chunks/chunk-6CW6ATOU.js} +1 -1
- package/dist/bin/shell/chunks/chunk-6NYAJMTL.js +14 -0
- package/dist/bin/shell/chunks/chunk-6ZKYK7PO.js +63 -0
- 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/{chunks/chunk-XKPFI566.js → shell/chunks/chunk-AM6HJVBI.js} +17 -17
- 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/shell/chunks/{chunk-NLBRLRWD.js → chunk-B5DAHNDY.js} +1 -1
- package/dist/bin/shell/chunks/chunk-BEWZWAXH.js +8 -0
- package/dist/bin/{chunks/chunk-SE4C7FJY.js → shell/chunks/chunk-C6FRS5UB.js} +13 -13
- 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/shell/chunks/{chunk-SXB55JOI.js → chunk-DH7TPGPX.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-RMQC3GS7.js → chunk-NOGXKS2G.js} +23 -23
- package/dist/bin/shell/chunks/chunk-NTW6IA45.js +2 -0
- package/dist/bin/{chunks/chunk-7BORMNPQ.js → shell/chunks/chunk-NWG67HAQ.js} +1 -1
- package/dist/bin/shell/chunks/{chunk-A3HQTYHR.js → chunk-P43NQKUN.js} +1 -1
- package/dist/bin/shell/chunks/chunk-PHZPFNDZ.js +287 -0
- package/dist/bin/shell/chunks/chunk-RX22J4AC.js +14 -0
- package/dist/bin/shell/chunks/chunk-S7KZBLGH.js +3 -0
- package/dist/bin/{chunks/chunk-ZO5PSLKR.js → shell/chunks/chunk-SDOJRQF5.js} +1 -1
- package/dist/bin/shell/chunks/chunk-UFJFAFSS.js +28 -0
- package/dist/bin/shell/chunks/chunk-UMYJNWPA.js +140 -0
- package/dist/bin/shell/chunks/chunk-UO7ZJYDM.js +11 -0
- package/dist/bin/shell/chunks/{chunk-THNL3XFF.js → 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-WLBA7L7U.js +23 -0
- package/dist/bin/{chunks/chunk-SXRVLCZ4.js → shell/chunks/chunk-WRYJHXRE.js} +1 -1
- package/dist/bin/shell/chunks/chunk-XZEAAOBW.js +8 -0
- package/dist/bin/{chunks/chunk-SDLWFYVT.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/{curl-SRTMGOVV.js → curl-2DCNBIKJ.js} +8 -8
- 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-2RO5M3QC.js → shell/chunks/expansion-H3VFC532.js} +1 -1
- package/dist/bin/shell/chunks/{expr-4CJYC4LY.js → expr-VPJ77DR7.js} +1 -1
- package/dist/bin/{chunks/file-D5YKS5NV.js → shell/chunks/file-MMSHRWCJ.js} +1 -1
- package/dist/bin/shell/chunks/find-O2KKT6KZ.js +2 -0
- package/dist/bin/shell/chunks/flag-coverage-FHFMNAV6.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-HYQ3KMGL.js +2 -0
- package/dist/bin/shell/chunks/js-exec-LZPKIZ5V.js +97 -0
- package/dist/bin/shell/chunks/{ls-G2PXHSNX.js → ls-WONXDVOX.js} +1 -1
- 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/{printf-P3QVL4IO.js → printf-NA7DYZBO.js} +1 -1
- 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-IHA7IHBM.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-LDGFI4EM.js +2 -0
- package/dist/bin/shell/shell.js +274 -274
- package/dist/browser.d.ts +1 -0
- package/dist/bundle/browser.js +676 -674
- 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-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-YNYSPYQ5.js → chunk-B74TABJS.js} +13 -13
- package/dist/bundle/chunks/{chunk-QJ7O6ZN3.js → chunk-BAXBSHE5.js} +3 -3
- package/dist/bundle/chunks/{chunk-FEIOJCZD.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-CZYXTGMR.js +139 -0
- package/dist/bundle/chunks/{chunk-OL3S66CO.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-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-HL6NGDO2.js +22 -0
- 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-LPQPILI2.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-BBXLRYSX.js → chunk-KRBPSX3W.js} +1 -1
- 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-NUY2ZGZL.js +286 -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-R6VWJ2ZL.js +1 -0
- 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-J642UCRS.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-UKBVVIW7.js +62 -0
- package/dist/bundle/chunks/chunk-USP7VSKV.js +12 -0
- package/dist/bundle/chunks/{chunk-OARHFVLG.js → chunk-UTKQPLMD.js} +13 -13
- package/dist/bundle/chunks/{chunk-YFG2CMIF.js → chunk-V5MWI2OL.js} +1 -1
- 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-XUZRLD2X.js +35 -0
- package/dist/bundle/chunks/chunk-YDILEREV.js +7 -0
- package/dist/bundle/chunks/chunk-YXVMSFJA.js +13 -0
- package/dist/bundle/chunks/column-DCCLCHUR.js +1 -0
- package/dist/bundle/chunks/comm-AXP77KC4.js +1 -0
- package/dist/bundle/chunks/{curl-COE4TZE6.js → curl-47BFPSFW.js} +8 -8
- 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-ENLSRCXJ.js → expansion-VBDYWVZR.js} +1 -1
- package/dist/bundle/chunks/{expr-5T3UU5KE.js → expr-YYCVMXE3.js} +1 -1
- package/dist/bundle/chunks/{file-ZIGAJ4YS.js → file-IGDTDPLG.js} +1 -1
- package/dist/bundle/chunks/find-DH2ALKQS.js +1 -0
- package/dist/bundle/chunks/flag-coverage-WZWBNOJT.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-OKCSVTHN.js +1 -0
- package/dist/bundle/chunks/js-exec-2U7NEXAP.js +96 -0
- package/dist/bundle/chunks/js-exec-worker.js +27 -185
- 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 +28 -9
- package/dist/bundle/chunks/xan-74G4ZYYZ.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-4NJ2P5VT.js +1 -0
- package/dist/bundle/index.cjs +984 -985
- package/dist/bundle/index.js +271 -271
- package/dist/commands/js-exec/{worker.d.ts → js-exec-worker.d.ts} +4 -10
- package/dist/commands/js-exec/js-exec.d.ts +1 -19
- 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/tar/bzip2-compress.d.ts +17 -0
- package/dist/commands/worker-bridge/sync-backend.d.ts +2 -1
- 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 -7
- package/dist/interpreter/types.d.ts +3 -8
- package/dist/network/dns-pin.d.ts +43 -0
- package/dist/network/types.d.ts +2 -1
- package/dist/types.d.ts +48 -21
- package/dist/utils/file-reader.d.ts +12 -5
- package/package.json +36 -40
- package/vendor/cpython-emscripten/python.wasm +0 -0
- package/dist/bin/chunks/awk2-VTJMI54B.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-26NO42TF.js +0 -14
- 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-B3RU2PUI.js +0 -140
- 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-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-G43H2WGH.js +0 -17
- package/dist/bin/chunks/chunk-GO6FXSC4.js +0 -6
- package/dist/bin/chunks/chunk-GZHFXDDO.js +0 -10
- package/dist/bin/chunks/chunk-HJEHIH4P.js +0 -33
- package/dist/bin/chunks/chunk-JQBC3FXE.js +0 -8
- package/dist/bin/chunks/chunk-L2JBII6Z.js +0 -287
- package/dist/bin/chunks/chunk-LGJM5YFT.js +0 -17
- package/dist/bin/chunks/chunk-LMK6G2HH.js +0 -8
- package/dist/bin/chunks/chunk-MNMRGJJM.js +0 -11
- package/dist/bin/chunks/chunk-MRP4ZCD7.js +0 -6
- package/dist/bin/chunks/chunk-MXVNCVD6.js +0 -30
- package/dist/bin/chunks/chunk-MY5PY2PL.js +0 -2
- package/dist/bin/chunks/chunk-N5OTVT4F.js +0 -23
- package/dist/bin/chunks/chunk-OBI37ZY4.js +0 -9
- package/dist/bin/chunks/chunk-P6GNZPVW.js +0 -19
- 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-VHUYNUT7.js +0 -13
- package/dist/bin/chunks/chunk-WS6P4H4S.js +0 -63
- package/dist/bin/chunks/chunk-WWZVR5NN.js +0 -6
- package/dist/bin/chunks/chunk-YEKSVVRC.js +0 -11
- package/dist/bin/chunks/chunk-YFPDB4PH.js +0 -9
- 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-LE7GMFZD.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-GAYRV4IF.js +0 -2
- package/dist/bin/chunks/flag-coverage-LBMWMYOO.js +0 -2
- package/dist/bin/chunks/fold-XSVNTAWH.js +0 -2
- package/dist/bin/chunks/grep-OZJTRD4D.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-WVZA3MCP.js +0 -2
- package/dist/bin/chunks/join-Y4Q5WVVE.js +0 -2
- package/dist/bin/chunks/jq-FIV5Q5T4.js +0 -2
- package/dist/bin/chunks/js-exec-RGKNWHHL.js +0 -100
- 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-QOJU2POC.js +0 -12
- package/dist/bin/chunks/rev-UHEPS2UL.js +0 -2
- package/dist/bin/chunks/rg-C6KMBFNG.js +0 -2
- package/dist/bin/chunks/sed-HALRQZKY.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-TOWX2TDU.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-MOZFJGMY.js +0 -2
- package/dist/bin/chunks/xan-view-5SZBYPLG.js +0 -2
- package/dist/bin/chunks/xargs-SCYIFXOW.js +0 -2
- package/dist/bin/chunks/yq-Q47JUWL6.js +0 -2
- package/dist/bin/shell/chunks/awk2-VTJMI54B.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-26NO42TF.js +0 -14
- 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-B3RU2PUI.js +0 -140
- 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-D64U2VGQ.js +0 -2
- 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-G43H2WGH.js +0 -17
- package/dist/bin/shell/chunks/chunk-GO6FXSC4.js +0 -6
- package/dist/bin/shell/chunks/chunk-GZHFXDDO.js +0 -10
- package/dist/bin/shell/chunks/chunk-HJEHIH4P.js +0 -33
- package/dist/bin/shell/chunks/chunk-JQBC3FXE.js +0 -8
- package/dist/bin/shell/chunks/chunk-L2JBII6Z.js +0 -287
- 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-MNMRGJJM.js +0 -11
- package/dist/bin/shell/chunks/chunk-MRP4ZCD7.js +0 -6
- package/dist/bin/shell/chunks/chunk-MXVNCVD6.js +0 -30
- package/dist/bin/shell/chunks/chunk-N5OTVT4F.js +0 -23
- package/dist/bin/shell/chunks/chunk-OBI37ZY4.js +0 -9
- package/dist/bin/shell/chunks/chunk-P6GNZPVW.js +0 -19
- 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-VHUYNUT7.js +0 -13
- package/dist/bin/shell/chunks/chunk-WS6P4H4S.js +0 -63
- package/dist/bin/shell/chunks/chunk-WWZVR5NN.js +0 -6
- package/dist/bin/shell/chunks/chunk-YEKSVVRC.js +0 -11
- package/dist/bin/shell/chunks/chunk-YFPDB4PH.js +0 -9
- 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-LE7GMFZD.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-GAYRV4IF.js +0 -2
- package/dist/bin/shell/chunks/flag-coverage-LBMWMYOO.js +0 -2
- package/dist/bin/shell/chunks/fold-XSVNTAWH.js +0 -2
- package/dist/bin/shell/chunks/grep-OZJTRD4D.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-WVZA3MCP.js +0 -2
- package/dist/bin/shell/chunks/join-Y4Q5WVVE.js +0 -2
- package/dist/bin/shell/chunks/jq-FIV5Q5T4.js +0 -2
- package/dist/bin/shell/chunks/js-exec-DUGJM6RL.js +0 -100
- 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-O4VTP6TD.js +0 -12
- package/dist/bin/shell/chunks/rev-UHEPS2UL.js +0 -2
- package/dist/bin/shell/chunks/rg-C6KMBFNG.js +0 -2
- package/dist/bin/shell/chunks/sed-HALRQZKY.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-TOWX2TDU.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-MOZFJGMY.js +0 -2
- package/dist/bin/shell/chunks/xan-view-5SZBYPLG.js +0 -2
- package/dist/bin/shell/chunks/xargs-SCYIFXOW.js +0 -2
- package/dist/bin/shell/chunks/yq-Q47JUWL6.js +0 -2
- package/dist/bundle/chunks/awk2-POPGKRAI.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-7L36YK2X.js +0 -2
- package/dist/bundle/chunks/chunk-A7ICOL4V.js +0 -13
- package/dist/bundle/chunks/chunk-B6O2PIY4.js +0 -10
- package/dist/bundle/chunks/chunk-CR5AFCPT.js +0 -22
- package/dist/bundle/chunks/chunk-D4J545R4.js +0 -11
- package/dist/bundle/chunks/chunk-D6CWQ5DW.js +0 -5
- package/dist/bundle/chunks/chunk-EIZGF4BS.js +0 -8
- package/dist/bundle/chunks/chunk-F55TLFGB.js +0 -9
- 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-JVPRLUMK.js +0 -7
- package/dist/bundle/chunks/chunk-KMEYNNUA.js +0 -15
- 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-NYQYO467.js +0 -32
- package/dist/bundle/chunks/chunk-PP6PSHAB.js +0 -4
- 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-UNYNJIFU.js +0 -139
- package/dist/bundle/chunks/chunk-VJFXDYWH.js +0 -10
- package/dist/bundle/chunks/chunk-VLGZJRPG.js +0 -16
- package/dist/bundle/chunks/chunk-VYOJP4TV.js +0 -13
- package/dist/bundle/chunks/chunk-WKFATFPP.js +0 -4
- package/dist/bundle/chunks/chunk-XHM67O4N.js +0 -1
- package/dist/bundle/chunks/chunk-XORM457F.js +0 -286
- package/dist/bundle/chunks/chunk-YCFVLTST.js +0 -12
- package/dist/bundle/chunks/chunk-YS3AZT3J.js +0 -8
- package/dist/bundle/chunks/chunk-Z7JVV2SM.js +0 -12
- package/dist/bundle/chunks/chunk-ZXL7TQLN.js +0 -62
- 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-TPUOAIUQ.js +0 -1
- package/dist/bundle/chunks/flag-coverage-LMTH7T5F.js +0 -1
- package/dist/bundle/chunks/fold-LDSORVYE.js +0 -1
- package/dist/bundle/chunks/grep-3AIAIJVR.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-ODXZBPLY.js +0 -1
- package/dist/bundle/chunks/js-exec-LSIPMWTQ.js +0 -99
- 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-5F2XPEW4.js +0 -11
- package/dist/bundle/chunks/rev-XOSYPP45.js +0 -1
- package/dist/bundle/chunks/rg-FOQSCCX3.js +0 -1
- package/dist/bundle/chunks/sed-VFTTATXJ.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-232RCEFK.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-BXDXYEIB.js +0 -1
- package/dist/bundle/chunks/xan-view-ECQUO7AJ.js +0 -1
- package/dist/bundle/chunks/xargs-I6EZUCYF.js +0 -1
- package/dist/bundle/chunks/yq-MJMAR36V.js +0 -1
- package/dist/commands/js-exec/executor-adapter.d.ts +0 -66
- package/dist/executor-init.d.ts +0 -19
- package/vendor/executor/executor-sdk-bundle.d.mts +0 -18
- package/vendor/executor/executor-sdk-bundle.mjs +0 -512
- package/vendor/executor/openapi-extractor-wasm/openapi_extractor_bg.wasm +0 -0
- /package/dist/bin/chunks/{chunk-QSDVMMYI.js → chunk-4CFAYBLV.js} +0 -0
- /package/dist/bin/chunks/{chunk-ND23BJUM.js → chunk-LCDPWJBA.js} +0 -0
- /package/dist/bin/shell/chunks/{chunk-QSDVMMYI.js → chunk-4CFAYBLV.js} +0 -0
- /package/dist/bin/shell/chunks/{chunk-ND23BJUM.js → chunk-LCDPWJBA.js} +0 -0
- /package/dist/bundle/chunks/{chunk-SYMJJMQ4.js → chunk-PXTK5WE2.js} +0 -0
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import{a as c,b as u,c as d}from"./chunk-74CEPOFO.js";var p={name:"strings",summary:"print the sequences of printable characters in files",usage:"strings [OPTION]... [FILE]...",description:"For each FILE, print the printable character sequences that are at least MIN characters long. If no FILE is specified, standard input is read.",options:["-n MIN Print sequences of at least MIN characters (default: 4)","-t FORMAT Print offset before each string (o=octal, x=hex, d=decimal)","-a Scan the entire file (default behavior)","-e ENCODING Select character encoding (s=7-bit, S=8-bit)"],examples:["strings file.bin # Extract strings (min 4 chars)","strings -n 8 file.bin # Extract strings (min 8 chars)","strings -t x file.bin # Show hex offset","echo 'hello' | strings # Read from stdin"]};function x(n){return n>=32&&n<=126||n===9}function g(n,s){if(s===null)return"";switch(s){case"o":return`${n.toString(8).padStart(7," ")} `;case"x":return`${n.toString(16).padStart(7," ")} `;case"d":return`${n.toString(10).padStart(7," ")} `;default:return s}}function h(n,s){let o=[],r="",i=0,a=typeof n=="string"?new TextEncoder().encode(n):n;for(let l=0;l<a.length;l++){let t=a[l];if(x(t))r.length===0&&(i=l),r+=String.fromCharCode(t);else{if(r.length>=s.minLength){let e=g(i,s.offsetFormat);o.push(`${e}${r}`)}r=""}}if(r.length>=s.minLength){let l=g(i,s.offsetFormat);o.push(`${l}${r}`)}return o}var v={name:"strings",execute:async(n,s)=>{if(u(n))return c(p);let o={minLength:4,offsetFormat:null},r=[],i=0;for(;i<n.length;){let t=n[i];if(t==="-n"&&i+1<n.length){let e=Number.parseInt(n[i+1],10);if(Number.isNaN(e)||e<1)return{exitCode:1,stdout:"",stderr:`strings: invalid minimum string length: '${n[i+1]}'
|
|
2
|
+
`};o.minLength=e,i+=2}else if(t.match(/^-n\d+$/)){let e=Number.parseInt(t.slice(2),10);if(Number.isNaN(e)||e<1)return{exitCode:1,stdout:"",stderr:`strings: invalid minimum string length: '${t.slice(2)}'
|
|
3
|
+
`};o.minLength=e,i++}else if(t.match(/^-\d+$/)){let e=Number.parseInt(t.slice(1),10);if(Number.isNaN(e)||e<1)return{exitCode:1,stdout:"",stderr:`strings: invalid minimum string length: '${t.slice(1)}'
|
|
4
|
+
`};o.minLength=e,i++}else if(t==="-t"&&i+1<n.length){let e=n[i+1];if(e!=="o"&&e!=="x"&&e!=="d")return{exitCode:1,stdout:"",stderr:`strings: invalid radix: '${e}'
|
|
5
|
+
`};o.offsetFormat=e,i+=2}else if(t.startsWith("-t")&&t.length===3){let e=t[2];if(e!=="o"&&e!=="x"&&e!=="d")return{exitCode:1,stdout:"",stderr:`strings: invalid radix: '${e}'
|
|
6
|
+
`};o.offsetFormat=e,i++}else if(t==="-a"||t==="--all"||t==="-")t==="-"&&r.push(t),i++;else if(t==="-e"&&i+1<n.length){let e=n[i+1];if(e!=="s"&&e!=="S")return{exitCode:1,stdout:"",stderr:`strings: invalid encoding: '${e}'
|
|
7
|
+
`};i+=2}else if(t.startsWith("-e")&&t.length===3){let e=t[2];if(e!=="s"&&e!=="S")return{exitCode:1,stdout:"",stderr:`strings: invalid encoding: '${e}'
|
|
8
|
+
`};i++}else if(t==="--"){r.push(...n.slice(i+1));break}else{if(t.startsWith("-")&&t!=="-")return d("strings",t);r.push(t),i++}}let a="",l=()=>Uint8Array.from(s.stdin??"",t=>t.charCodeAt(0));if(r.length===0){let t=h(l(),o);a=t.length>0?`${t.join(`
|
|
9
|
+
`)}
|
|
10
|
+
`:""}else for(let t of r){let e;if(t==="-")e=l();else{let m=s.fs.resolvePath(s.cwd,t);try{e=await s.fs.readFileBuffer(m)}catch{return{exitCode:1,stdout:a,stderr:`strings: ${t}: No such file or directory
|
|
11
|
+
`}}}let f=h(e,o);f.length>0&&(a+=`${f.join(`
|
|
12
|
+
`)}
|
|
13
|
+
`)}return{exitCode:0,stdout:a,stderr:""}}},F={name:"strings",flags:[{flag:"-n",type:"value",valueHint:"number"},{flag:"-t",type:"value",valueHint:"string"},{flag:"-a",type:"boolean"},{flag:"-e",type:"value",valueHint:"string"}],stdinType:"text",needsFiles:!0};export{v as a,F as b};
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import{c as
|
|
1
|
+
import{c as p}from"./chunk-CWQS3NFK.js";import{a as g}from"./chunk-IPJHKYVM.js";import{a as h}from"./chunk-OJDRYQWQ.js";import{a as f}from"./chunk-3THT3N7L.js";var T={name:"time",async execute(r,s){let a="%e %M",o=null,u=!1,c=!1,t=0;for(;t<r.length;){let e=r[t];if(e==="-f"||e==="--format"){if(t++,t>=r.length)return{stdout:"",stderr:`time: missing argument to '-f'
|
|
2
2
|
`,exitCode:1};a=r[t],t++}else if(e==="-o"||e==="--output"){if(t++,t>=r.length)return{stdout:"",stderr:`time: missing argument to '-o'
|
|
3
|
-
`,exitCode:1};o=r[t],t++}else if(e==="-a"||e==="--append")
|
|
3
|
+
`,exitCode:1};o=r[t],t++}else if(e==="-a"||e==="--append")u=!0,t++;else if(e==="-v"||e==="--verbose")a=`Command being timed: %C
|
|
4
4
|
Elapsed (wall clock) time: %e seconds
|
|
5
|
-
Maximum resident set size (kbytes): %M`,t++;else if(e==="-p"||e==="--portability")c=!0,t++;else if(e==="--"){t++;break}else if(e.startsWith("-"))t++;else break}let l=r.slice(t);if(l.length===0)return{stdout:"",stderr:"",exitCode:0};let w=
|
|
6
|
-
`,exitCode:1};i=await s.exec(g([l[0]]),{env:h(s.env),cwd:s.cwd,stdin:s.stdin,signal:s.signal,args:l.slice(1)})}catch(e){i={stdout:"",stderr:`time: ${f(e.message)}
|
|
7
|
-
`,exitCode:127}}let m=(
|
|
5
|
+
Maximum resident set size (kbytes): %M`,t++;else if(e==="-p"||e==="--portability")c=!0,t++;else if(e==="--"){t++;break}else if(e.startsWith("-"))t++;else break}let l=r.slice(t);if(l.length===0)return{stdout:"",stderr:"",exitCode:0};let w=p(),C=l.join(" "),i;try{if(!s.exec)return{stdout:"",stderr:`time: exec not available
|
|
6
|
+
`,exitCode:1};i=await s.exec(g([l[0]]),{env:h(s.env),cwd:s.cwd,stdin:s.stdin,stdinKind:"bytes",signal:s.signal,args:l.slice(1)})}catch(e){i={stdout:"",stderr:`time: ${f(e.message)}
|
|
7
|
+
`,exitCode:127}}let m=(p()-w)/1e3,n;if(c?n=`real ${m.toFixed(2)}
|
|
8
8
|
user 0.00
|
|
9
9
|
sys 0.00
|
|
10
10
|
`:(n=a.replace(/%e/g,m.toFixed(2)).replace(/%E/g,F(m)).replace(/%M/g,"0").replace(/%S/g,"0.00").replace(/%U/g,"0.00").replace(/%P/g,"0%").replace(/%C/g,C),n.endsWith(`
|
|
11
11
|
`)||(n+=`
|
|
12
|
-
`)),o)try{let e=s.fs.resolvePath(s.cwd,o);if(
|
|
13
|
-
`,exitCode:i.exitCode}}else i={...i,stderr:i.stderr+n};return i}};function F(r){let s=Math.floor(r/3600),a=Math.floor(r%3600/60),o=r%60;return s>0?`${s}:${a.toString().padStart(2,"0")}:${o.toFixed(2).padStart(5,"0")}`:`${a}:${o.toFixed(2).padStart(5,"0")}`}var
|
|
12
|
+
`)),o)try{let e=s.fs.resolvePath(s.cwd,o);if(u&&await s.fs.exists(e)){let d=await s.fs.readFile(e);await s.fs.writeFile(e,d+n)}else await s.fs.writeFile(e,n)}catch(e){let d=f(e.message);return{stdout:i.stdout,stderr:i.stderr+`time: cannot write to '${o}': ${d}
|
|
13
|
+
`,exitCode:i.exitCode}}else i={...i,stderr:i.stderr+n};return i}};function F(r){let s=Math.floor(r/3600),a=Math.floor(r%3600/60),o=r%60;return s>0?`${s}:${a.toString().padStart(2,"0")}:${o.toFixed(2).padStart(5,"0")}`:`${a}:${o.toFixed(2).padStart(5,"0")}`}var k={name:"time",flags:[{flag:"-p",type:"boolean"}],needsArgs:!0};export{T as a,k as b};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import{c as U}from"./chunk-AH77CRWX.js";import{a as $,b as F,c as k}from"./chunk-74CEPOFO.js";var L=new Map([["sha1","SHA-1"],["sha256","SHA-256"]]);function D(n){function h(r,u){return r<<u|r>>>32-u}let g=new Uint32Array([3614090360,3905402710,606105819,3250441966,4118548399,1200080426,2821735955,4249261313,1770035416,2336552879,4294925233,2304563134,1804603682,4254626195,2792965006,1236535329,4129170786,3225465664,643717713,3921069994,3593408605,38016083,3634488961,3889429448,568446438,3275163606,4107603335,1163531501,2850285829,4243563512,1735328473,2368359562,4294588738,2272392833,1839030562,4259657740,2763975236,1272893353,4139469664,3200236656,681279174,3936430074,3572445317,76029189,3654602809,3873151461,530742520,3299628645,4096336452,1126891415,2878612391,4237533241,1700485571,2399980690,4293915773,2240044497,1873313359,4264355552,2734768916,1309151649,4149444226,3174756917,718787259,3951481745]),A=[7,12,17,22,7,12,17,22,7,12,17,22,7,12,17,22,5,9,14,20,5,9,14,20,5,9,14,20,5,9,14,20,4,11,16,23,4,11,16,23,4,11,16,23,4,11,16,23,6,10,15,21,6,10,15,21,6,10,15,21,6,10,15,21],b=n.length*8,c=(n.length%64<56?56:120)-n.length%64,s=new Uint8Array(n.length+c+8);s.set(n),s[n.length]=128;let d=new DataView(s.buffer);d.setUint32(s.length-8,b>>>0,!0),d.setUint32(s.length-4,Math.floor(b/4294967296),!0);let w=1732584193,l=4023233417,p=2562383102,e=271733878;for(let r=0;r<s.length;r+=64){let u=new Uint32Array(16);for(let t=0;t<16;t++)u[t]=d.getUint32(r+t*4,!0);let m=w,a=l,x=p,o=e;for(let t=0;t<64;t++){let i,y;t<16?(i=a&x|~a&o,y=t):t<32?(i=o&a|~o&x,y=(5*t+1)%16):t<48?(i=a^x^o,y=(3*t+5)%16):(i=x^(a|~o),y=7*t%16),i=i+m+g[t]+u[y]>>>0,m=o,o=x,x=a,a=a+h(i,A[t])>>>0}w=w+m>>>0,l=l+a>>>0,p=p+x>>>0,e=e+o>>>0}let f=new Uint8Array(16);return new DataView(f.buffer).setUint32(0,w,!0),new DataView(f.buffer).setUint32(4,l,!0),new DataView(f.buffer).setUint32(8,p,!0),new DataView(f.buffer).setUint32(12,e,!0),Array.from(f).map(r=>r.toString(16).padStart(2,"0")).join("")}async function C(n,h){if(n==="md5")return D(h);let g=L.get(n);if(!g)throw new Error(`Unknown algorithm: ${n}`);let A=await globalThis.crypto.subtle.digest(g,new Uint8Array(h).buffer);return Array.from(new Uint8Array(A)).map(b=>b.toString(16).padStart(2,"0")).join("")}function I(n,h,g){let A={name:n,summary:g,usage:`${n} [OPTION]... [FILE]...`,options:["-c, --check read checksums from FILEs and check them"," --help display this help and exit"]};return{name:n,async execute(b,c){if(F(b))return $(A);let s=!1,d=[];for(let e of b)if(e==="-c"||e==="--check")s=!0;else if(!(e==="-b"||e==="-t"||e==="--binary"||e==="--text")){if(e.startsWith("-")&&e!=="-")return k(n,e);d.push(e)}d.length===0&&d.push("-");let w=async e=>{if(e==="-")return Uint8Array.from(c.stdin,f=>f.charCodeAt(0));try{return await c.fs.readFileBuffer(c.fs.resolvePath(c.cwd,e))}catch{return null}};if(s){let e=0,f="";for(let r of d){let u=r==="-"?U(c.stdin):await c.fs.readFile(c.fs.resolvePath(c.cwd,r)).catch(()=>null);if(u===null)return{stdout:"",stderr:`${n}: ${r}: No such file or directory
|
|
2
|
+
`,exitCode:1};for(let m of u.split(`
|
|
3
|
+
`)){let a=m.match(/^([a-fA-F0-9]+)\s+[* ]?(.+)$/);if(!a)continue;let[,x,o]=a,t=await w(o);if(t===null){f+=`${o}: FAILED open or read
|
|
4
|
+
`,e++;continue}let i=await C(h,t)===x.toLowerCase();f+=`${o}: ${i?"OK":"FAILED"}
|
|
5
|
+
`,i||e++}}return e>0&&(f+=`${n}: WARNING: ${e} computed checksum${e>1?"s":""} did NOT match
|
|
6
|
+
`),{stdout:f,stderr:"",exitCode:e>0?1:0}}let l="",p=0;for(let e of d){let f=await w(e);if(f===null){l+=`${n}: ${e}: No such file or directory
|
|
7
|
+
`,p=1;continue}l+=`${await C(h,f)} ${e}
|
|
8
|
+
`}return{stdout:l,stderr:"",exitCode:p}}}}export{I as a};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as fe}from"./chunk-X2AJGDEF.js";import{a as Y}from"./chunk-
|
|
1
|
+
import{a as fe}from"./chunk-X2AJGDEF.js";import{a as Y}from"./chunk-SNN4IESC.js";import{a as ne}from"./chunk-IPJHKYVM.js";import{a as te}from"./chunk-B74TABJS.js";import{a as oe,b as pe,c as ce}from"./chunk-EEXR5ZDP.js";import{a as ie,b as le}from"./chunk-74CEPOFO.js";function k(e,t){switch(e.type){case"name":{let n=e.pattern,a=n.match(/^\*(\.[a-zA-Z0-9]+)$/);if(a){let s=a[1],o=t.name;if(e.ignoreCase){if(!o.toLowerCase().endsWith(s.toLowerCase()))return{matches:!1,pruned:!1,printed:!1}}else if(!o.endsWith(s))return{matches:!1,pruned:!1,printed:!1};return{matches:!0,pruned:!1,printed:!1}}return{matches:Y(t.name,n,e.ignoreCase),pruned:!1,printed:!1}}case"path":{let n=e.pattern,a=t.relativePath,s=n.split("/");for(let i=0;i<s.length-1;i++){let r=s[i];if(r&&r!=="."&&r!==".."&&!r.includes("*")&&!r.includes("?")&&!r.includes("[")){let p=`/${r}/`;if(e.ignoreCase){if(!a.toLowerCase().includes(p.toLowerCase()))return{matches:!1,pruned:!1,printed:!1}}else if(!a.includes(p))return{matches:!1,pruned:!1,printed:!1}}}let o=n.match(/\*(\.[a-zA-Z0-9]+)$/);if(o){let i=o[1];if(e.ignoreCase){if(!a.toLowerCase().endsWith(i.toLowerCase()))return{matches:!1,pruned:!1,printed:!1}}else if(!a.endsWith(i))return{matches:!1,pruned:!1,printed:!1}}return{matches:Y(a,n,e.ignoreCase),pruned:!1,printed:!1}}case"regex":try{let n=e.ignoreCase?"i":"";return{matches:te(e.pattern,n).test(t.relativePath),pruned:!1,printed:!1}}catch{return{matches:!1,pruned:!1,printed:!1}}case"type":return e.fileType==="f"?{matches:t.isFile,pruned:!1,printed:!1}:e.fileType==="d"?{matches:t.isDirectory,pruned:!1,printed:!1}:{matches:!1,pruned:!1,printed:!1};case"empty":return{matches:t.isEmpty,pruned:!1,printed:!1};case"mtime":{let a=(Date.now()-t.mtime)/(1e3*60*60*24),s;return e.comparison==="more"?s=a>e.days:e.comparison==="less"?s=a<e.days:s=Math.floor(a)===e.days,{matches:s,pruned:!1,printed:!1}}case"newer":{let n=t.newerRefTimes.get(e.refPath);return n===void 0?{matches:!1,pruned:!1,printed:!1}:{matches:t.mtime>n,pruned:!1,printed:!1}}case"size":{let n=e.value;switch(e.unit){case"c":n=e.value;break;case"k":n=e.value*1024;break;case"M":n=e.value*1024*1024;break;case"G":n=e.value*1024*1024*1024;break;case"b":n=e.value*512;break}let a;return e.comparison==="more"?a=t.size>n:e.comparison==="less"?a=t.size<n:e.unit==="b"?a=Math.ceil(t.size/512)===e.value:a=t.size===n,{matches:a,pruned:!1,printed:!1}}case"perm":{let n=t.mode&511,a=e.mode&511,s;return e.matchType==="exact"?s=n===a:e.matchType==="all"?s=(n&a)===a:s=(n&a)!==0,{matches:s,pruned:!1,printed:!1}}case"prune":return{matches:!0,pruned:!0,printed:!1};case"print":return{matches:!0,pruned:!1,printed:!0};case"not":{let n=k(e.expr,t);return{matches:!n.matches,pruned:n.pruned,printed:!1}}case"and":{let n=k(e.left,t);if(!n.matches)return{matches:!1,pruned:n.pruned,printed:!1};let a=k(e.right,t);return{matches:a.matches,pruned:n.pruned||a.pruned,printed:n.printed||a.printed}}case"or":{let n=k(e.left,t);if(n.matches)return n;let a=k(e.right,t);return{matches:a.matches,pruned:n.pruned||a.pruned,printed:a.printed}}}}function _(e){if(!e)return!1;switch(e.type){case"name":case"path":case"regex":case"type":case"prune":case"print":return!1;case"empty":case"mtime":case"newer":case"size":case"perm":return!0;case"not":return _(e.expr);case"and":case"or":return _(e.left)||_(e.right)}}function j(e){if(!e)return!1;switch(e.type){case"empty":return!0;case"not":return j(e.expr);case"and":case"or":return j(e.left)||j(e.right);default:return!1}}function ue(e){let t={terminalDirName:null,requiredExtension:null};if(!e)return t;let n=Ee(e);if(Me(e)&&n.length===1){let o=n[0].split("/").filter(i=>i.length>0);if(o.length>=2)for(let i=o.length-2;i>=0;i--){let r=o[i];if(!r.includes("*")&&!r.includes("?")&&!r.includes("[")&&r!=="."&&r!==".."){let p=o[i+1];if(p&&(p.includes("*")||p.includes("?"))){t.terminalDirName=r;let l=p.match(/^\*(\.[a-zA-Z0-9]+)$/);l&&(t.requiredExtension=l[1])}break}}}return t}function Ee(e){let t=[],n=a=>{a.type==="path"?t.push(a.pattern):a.type==="not"?n(a.expr):(a.type==="and"||a.type==="or")&&(n(a.left),n(a.right))};return n(e),t}function Me(e){let t=n=>n.type==="type"&&n.fileType==="f"?!0:n.type==="not"?t(n.expr):n.type==="and"||n.type==="or"?t(n.left)||t(n.right):!1;return t(e)}function he(e){let t=[],n=a=>{a&&(a.type==="newer"?t.push(a.refPath):a.type==="not"?n(a.expr):(a.type==="and"||a.type==="or")&&(n(a.left),n(a.right)))};return n(e),t}function J(e){if(!e)return!0;switch(e.type){case"name":case"path":case"regex":case"type":case"prune":case"print":return!0;case"empty":case"mtime":case"newer":case"size":case"perm":return!1;case"not":return J(e.expr);case"and":case"or":return J(e.left)&&J(e.right)}}function L(e,t,n,a,s){switch(e.type){case"name":{let o=e.pattern,i=o.match(/^\*(\.[a-zA-Z0-9]+)$/);if(i){let r=i[1];if(e.ignoreCase){if(!t.toLowerCase().endsWith(r.toLowerCase()))return{matches:!1,pruned:!1,printed:!1}}else if(!t.endsWith(r))return{matches:!1,pruned:!1,printed:!1};return{matches:!0,pruned:!1,printed:!1}}return{matches:Y(t,o,e.ignoreCase),pruned:!1,printed:!1}}case"path":{let o=e.pattern,i=o.split("/");for(let p=0;p<i.length-1;p++){let l=i[p];if(l&&l!=="."&&l!==".."&&!l.includes("*")&&!l.includes("?")&&!l.includes("[")){let d=`/${l}/`;if(e.ignoreCase){if(!n.toLowerCase().includes(d.toLowerCase()))return{matches:!1,pruned:!1,printed:!1}}else if(!n.includes(d))return{matches:!1,pruned:!1,printed:!1}}}let r=o.match(/\*(\.[a-zA-Z0-9]+)$/);if(r){let p=r[1];if(e.ignoreCase){if(!n.toLowerCase().endsWith(p.toLowerCase()))return{matches:!1,pruned:!1,printed:!1}}else if(!n.endsWith(p))return{matches:!1,pruned:!1,printed:!1}}return{matches:Y(n,o,e.ignoreCase),pruned:!1,printed:!1}}case"regex":try{let o=e.ignoreCase?"i":"";return{matches:te(e.pattern,o).test(n),pruned:!1,printed:!1}}catch{return{matches:!1,pruned:!1,printed:!1}}case"type":return e.fileType==="f"?{matches:a,pruned:!1,printed:!1}:e.fileType==="d"?{matches:s,pruned:!1,printed:!1}:{matches:!1,pruned:!1,printed:!1};case"prune":return{matches:!0,pruned:!0,printed:!1};case"print":return{matches:!0,pruned:!1,printed:!0};case"not":{let o=L(e.expr,t,n,a,s);return{matches:!o.matches,pruned:o.pruned,printed:!1}}case"and":{let o=L(e.left,t,n,a,s);if(!o.matches)return{matches:!1,pruned:o.pruned,printed:!1};let i=L(e.right,t,n,a,s);return{matches:i.matches,pruned:o.pruned||i.pruned,printed:o.printed||i.printed}}case"or":{let o=L(e.left,t,n,a,s);if(o.matches)return o;let i=L(e.right,t,n,a,s);return{matches:i.matches,pruned:o.pruned||i.pruned,printed:i.printed}}default:return{matches:!1,pruned:!1,printed:!1}}}function V(e){if(!e)return!1;switch(e.type){case"prune":return!0;case"not":return V(e.expr);case"and":case"or":return V(e.left)||V(e.right);default:return!1}}function z(e){switch(e.type){case"name":case"path":case"regex":case"type":case"prune":case"print":return!0;case"empty":case"mtime":case"newer":case"size":case"perm":return!1;case"not":return z(e.expr);case"and":case"or":return z(e.left)&&z(e.right)}}function de(e,t){if(!e||!t.isDirectory)return{shouldPrune:!1};if(!z(e))return se(e,t);let n={name:t.name,relativePath:t.relativePath,isFile:t.isFile,isDirectory:t.isDirectory,isEmpty:!1,mtime:0,size:0,mode:0,newerRefTimes:new Map};return{shouldPrune:k(e,n).pruned}}function se(e,t){switch(e.type){case"or":{if(z(e.left)){let n={name:t.name,relativePath:t.relativePath,isFile:t.isFile,isDirectory:t.isDirectory,isEmpty:!1,mtime:0,size:0,mode:0,newerRefTimes:new Map};if(k(e.left,n).pruned)return{shouldPrune:!0}}return se(e.right,t)}case"and":{if(z(e.left)&&z(e.right)){let n={name:t.name,relativePath:t.relativePath,isFile:t.isFile,isDirectory:t.isDirectory,isEmpty:!1,mtime:0,size:0,mode:0,newerRefTimes:new Map};return{shouldPrune:k(e,n).pruned}}if(z(e.left)){let n={name:t.name,relativePath:t.relativePath,isFile:t.isFile,isDirectory:t.isDirectory,isEmpty:!1,mtime:0,size:0,mode:0,newerRefTimes:new Map};return k(e.left,n).matches?se(e.right,t):{shouldPrune:!1}}return{shouldPrune:!1}}case"not":return{shouldPrune:!1};default:return{shouldPrune:!1}}}function me(e,t){let n=[],a=[],s=t;for(;s<e.length;){let i=e[s];if(i==="("||i==="\\("){n.push({type:"lparen"}),s++;continue}if(i===")"||i==="\\)"){n.push({type:"rparen"}),s++;continue}if(i==="-name"&&s+1<e.length)n.push({type:"expr",expr:{type:"name",pattern:e[++s]}});else if(i==="-iname"&&s+1<e.length)n.push({type:"expr",expr:{type:"name",pattern:e[++s],ignoreCase:!0}});else if(i==="-path"&&s+1<e.length)n.push({type:"expr",expr:{type:"path",pattern:e[++s]}});else if(i==="-ipath"&&s+1<e.length)n.push({type:"expr",expr:{type:"path",pattern:e[++s],ignoreCase:!0}});else if(i==="-regex"&&s+1<e.length)n.push({type:"expr",expr:{type:"regex",pattern:e[++s]}});else if(i==="-iregex"&&s+1<e.length)n.push({type:"expr",expr:{type:"regex",pattern:e[++s],ignoreCase:!0}});else if(i==="-type"&&s+1<e.length){let r=e[++s];if(r==="f"||r==="d")n.push({type:"expr",expr:{type:"type",fileType:r}});else return{expr:null,pathIndex:s,error:`find: Unknown argument to -type: ${r}
|
|
2
2
|
`,actions:[]}}else if(i==="-empty")n.push({type:"expr",expr:{type:"empty"}});else if(i==="-mtime"&&s+1<e.length){let r=e[++s],p="exact",l=r;r.startsWith("+")?(p="more",l=r.slice(1)):r.startsWith("-")&&(p="less",l=r.slice(1));let d=parseInt(l,10);Number.isNaN(d)||n.push({type:"expr",expr:{type:"mtime",days:d,comparison:p}})}else if(i==="-newer"&&s+1<e.length){let r=e[++s];n.push({type:"expr",expr:{type:"newer",refPath:r}})}else if(i==="-size"&&s+1<e.length){let r=e[++s],p="exact",l=r;r.startsWith("+")?(p="more",l=r.slice(1)):r.startsWith("-")&&(p="less",l=r.slice(1));let d=l.match(/^(\d+)([ckMGb])?$/);if(d){let O=parseInt(d[1],10),x=d[2]||"b";n.push({type:"expr",expr:{type:"size",value:O,unit:x,comparison:p}})}}else if(i==="-perm"&&s+1<e.length){let r=e[++s],p="exact",l=r;r.startsWith("-")?(p="all",l=r.slice(1)):r.startsWith("/")&&(p="any",l=r.slice(1));let d=parseInt(l,8);Number.isNaN(d)||n.push({type:"expr",expr:{type:"perm",mode:d,matchType:p}})}else if(i==="-prune")n.push({type:"expr",expr:{type:"prune"}});else if(i==="-not"||i==="!")n.push({type:"not"});else if(i==="-o"||i==="-or")n.push({type:"op",op:"or"});else if(i==="-a"||i==="-and")n.push({type:"op",op:"and"});else if(i==="-maxdepth"||i==="-mindepth")s++;else if(i!=="-depth")if(i==="-exec"){let r=[];for(s++;s<e.length&&e[s]!==";"&&e[s]!=="+";)r.push(e[s]),s++;if(s>=e.length)return{expr:null,pathIndex:s,error:"find: missing argument to `-exec'\n",actions:[]};let p=e[s]==="+";a.push({type:"exec",command:r,batchMode:p})}else if(i==="-print")n.push({type:"expr",expr:{type:"print"}}),a.push({type:"print"});else if(i==="-print0")a.push({type:"print0"});else if(i==="-printf"&&s+1<e.length){let r=e[++s];a.push({type:"printf",format:r})}else if(i==="-delete")a.push({type:"delete"});else{if(i.startsWith("-"))return{expr:null,pathIndex:s,error:`find: unknown predicate '${i}'
|
|
3
3
|
`,actions:[]};if(n.length===0){s++;continue}break}s++}if(n.length===0)return{expr:null,pathIndex:s,actions:a};let o=Fe(n);return o.error?{expr:null,pathIndex:s,error:o.error,actions:a}:{expr:o.expr,pathIndex:s,actions:a}}function Fe(e){let t=0;function n(){let r=a();if(!r)return null;for(;t<e.length;){let p=e[t];if(p.type==="op"&&p.op==="or"){t++;let l=a();if(!l)return r;r={type:"or",left:r,right:l}}else break}return r}function a(){let r=s();if(!r)return null;for(;t<e.length;){let p=e[t];if(p.type==="op"&&p.op==="and"){t++;let l=s();if(!l)return r;r={type:"and",left:r,right:l}}else if(p.type==="expr"||p.type==="not"||p.type==="lparen"){let l=s();if(!l)return r;r={type:"and",left:r,right:l}}else break}return r}function s(){if(t<e.length&&e[t].type==="not"){t++;let r=s();return r?{type:"not",expr:r}:null}return o()}function o(){if(t>=e.length)return null;let r=e[t];if(r.type==="lparen"){t++;let p=n();return t<e.length&&e[t].type==="rparen"&&t++,p}return r.type==="expr"?(t++,r.expr):(r.type==="rparen",null)}return{expr:n()}}var ye=500;function Ie(){return{readdirCalls:0,readdirTime:0,statCalls:0,statTime:0,evalCalls:0,evalTime:0,nodeCount:0,batchCount:0,batchTime:0,earlyPrunes:0}}function xe(e,t,n){e({category:"find",name:"summary",durationMs:n,details:{readdirCalls:t.readdirCalls,readdirTimeMs:t.readdirTime,statCalls:t.statCalls,statTimeMs:t.statTime,evalCalls:t.evalCalls,evalTimeMs:t.evalTime,nodeCount:t.nodeCount,batchCount:t.batchCount,batchTimeMs:t.batchTime,earlyPrunes:t.earlyPrunes,otherTimeMs:n-t.readdirTime-t.statTime-t.evalTime-t.batchTime}})}var $e={name:"find",summary:"search for files in a directory hierarchy",usage:"find [path...] [expression]",options:["-name PATTERN file name matches shell pattern PATTERN","-iname PATTERN like -name but case insensitive","-path PATTERN file path matches shell pattern PATTERN","-ipath PATTERN like -path but case insensitive","-regex PATTERN file path matches regular expression PATTERN","-iregex PATTERN like -regex but case insensitive","-type TYPE file is of type: f (regular file), d (directory)","-empty file is empty or directory is empty","-mtime N file's data was modified N*24 hours ago","-newer FILE file was modified more recently than FILE","-size N[ckMGb] file uses N units of space (c=bytes, k=KB, M=MB, G=GB, b=512B blocks)","-perm MODE file's permission bits are exactly MODE (octal)","-perm -MODE all permission bits MODE are set","-perm /MODE any permission bits MODE are set","-maxdepth LEVELS descend at most LEVELS directories","-mindepth LEVELS do not apply tests at levels less than LEVELS","-depth process directory contents before directory itself","-prune do not descend into this directory","-not, ! negate the following expression","-a, -and logical AND (default)","-o, -or logical OR","-exec CMD {} ; execute CMD on each file ({} is replaced by filename)","-exec CMD {} + execute CMD with multiple files at once","-print print the full file name (default action)","-print0 print the full file name followed by a null character","-printf FORMAT print FORMAT with directives: %f %h %p %P %s %d %m %M %t","-delete delete found files/directories"," --help display this help and exit"]},Re=new Set(["-name","-iname","-path","-ipath","-regex","-iregex","-type","-maxdepth","-mindepth","-mtime","-newer","-size","-perm"]),je={name:"find",async execute(e,t){if(le(e))return ie($e);let n=[],a=null,s=null,o=!1,i=!1;for(let c=0;c<e.length;c++){let f=e[c];if(f==="-maxdepth"&&c+1<e.length)i=!0,a=parseInt(e[++c],10);else if(f==="-mindepth"&&c+1<e.length)i=!0,s=parseInt(e[++c],10);else if(f==="-depth")i=!0,o=!0;else if(f==="-exec")for(i=!0,c++;c<e.length&&e[c]!==";"&&e[c]!=="+";)c++;else!f.startsWith("-")&&f!==";"&&f!=="+"&&f!=="("&&f!==")"&&f!=="\\("&&f!=="\\)"&&f!=="!"?i||n.push(f):Re.has(f)?(i=!0,c++):(f.startsWith("-")||f==="("||f==="\\("||f==="!")&&(i=!0)}n.length===0&&n.push(".");let{expr:r,error:p,actions:l}=me(e,0);if(p)return{stdout:"",stderr:p,exitCode:1};let d=l.some(c=>c.type==="print"),O=l.length===0,x=[],ge=l.some(c=>c.type==="printf"),re=[],B="",q=0,we=he(r),U=new Map;for(let c of we){let f=t.fs.resolvePath(t.cwd,c);try{let u=await t.fs.stat(f);U.set(c,u.mtime?.getTime()??Date.now())}catch{}}let De=l.some(c=>{if(c.type!=="printf")return!1;let f=c.format.replace(/%%/g,"");return/%[-+]?[0-9]*\.?[0-9]*(s|m|M|t|T)/.test(f)}),Te=_(r)||De,Ce=j(r),K=ue(r),ae=V(r),Pe=J(r),Se=typeof t.fs.readdirWithFileTypes=="function";for(let c of n){let G=function(h){let $=s===null||h.depth>=s,P=!1;if($&&r!==null){let S=Date.now(),y;if(Pe)y=L(r,h.name,h.relativePath,h.isFile,h.isDirectory);else{let m={name:h.name,relativePath:h.relativePath,isFile:h.isFile,isDirectory:h.isDirectory,isEmpty:h.isEmpty,mtime:h.stat?.mtime?.getTime()??Date.now(),size:h.stat?.size??0,mode:h.stat?.mode??420,newerRefTimes:U};y=k(r,m)}$=y.matches,P=d?y.printed:$,u.evalCalls++,u.evalTime+=Date.now()-S}else $&&(P=!0);return P?{print:!0,printfData:ge?{path:h.relativePath,name:h.name,size:h.stat?.size??0,mtime:h.stat?.mtime?.getTime()??Date.now(),mode:h.stat?.mode??420,isDirectory:h.isDirectory,depth:h.depth,startingPoint:c}:null}:{print:!1,printfData:null}};var We=G;c.length>1&&c.endsWith("/")&&(c=c.slice(0,-1));let f=t.fs.resolvePath(t.cwd,c);try{await t.fs.stat(f)}catch{B+=`find: ${c}: No such file or directory
|
|
4
4
|
`,q=1;continue}let u=Ie(),M=Date.now();async function N(h){let{path:b,depth:$,typeInfo:P}=h;if(u.nodeCount++,$>(a??256))return null;let v,S,y;if(P&&!Te)v=P.isFile,S=P.isDirectory;else{try{let A=Date.now();y=await t.fs.stat(b),u.statCalls++,u.statTime+=Date.now()-A}catch{return null}if(!y)return null;v=y.isFile,S=y.isDirectory}let m;b===f?m=c.split("/").pop()||c:m=b.split("/").pop()||"";let g=b===f?c:c==="."?`./${b.slice(f==="/"?f.length:f.length+1)}`:c+b.slice(f.length),T=[],C=null,w=null,D=!1;S&&ae&&!o&&(D=de(r,{name:m,relativePath:g,isFile:v,isDirectory:S}).shouldPrune,D&&u.earlyPrunes++);let F=$>=(a??256),I=K.terminalDirName!==null&&m===K.terminalDirName,Z=!F&&!I&&!D;if(S&&((Z||Ce||I)&&!D)){let A=Date.now();if(Se&&t.fs.readdirWithFileTypes){if(C=await t.fs.readdirWithFileTypes(b),w=C.map(E=>E.name),u.readdirCalls++,u.readdirTime+=Date.now()-A,Z)T=C.map((E,R)=>({path:b==="/"?`/${E.name}`:`${b}/${E.name}`,depth:$+1,typeInfo:{isFile:E.isFile,isDirectory:E.isDirectory},resultIndex:R}));else if(I){let E=K.requiredExtension;T=C.filter(R=>R.isFile&&(!E||R.name.endsWith(E))).map((R,ve)=>({path:b==="/"?`/${R.name}`:`${b}/${R.name}`,depth:$+1,typeInfo:{isFile:R.isFile,isDirectory:R.isDirectory},resultIndex:ve}))}}else w=await t.fs.readdir(b),u.readdirCalls++,u.readdirTime+=Date.now()-A,Z&&(T=w.map((E,R)=>({path:b==="/"?`/${E}`:`${b}/${E}`,depth:$+1,resultIndex:R})))}let Q=v?(y?.size??0)===0:w!==null&&w.length===0,H=D;if(!o&&r!==null&&!D&&ae){let A=Date.now(),E={name:m,relativePath:g,isFile:v,isDirectory:S,isEmpty:Q,mtime:y?.mtime?.getTime()??Date.now(),size:y?.size??0,mode:y?.mode??420,newerRefTimes:U};H=k(r,E).pruned,u.evalCalls++,u.evalTime+=Date.now()-A}return{relativePath:g,name:m,isFile:v,isDirectory:S,isEmpty:Q,stat:y,depth:$,children:H?[]:T,pruned:H}}async function be(){let h={paths:[],printfData:[]};if(o){let y=function(m){let g={paths:[],printfData:[]},T=P[m];if(!T)return g;for(let D of T.childIndices){let F=y(D);g.paths.push(...F.paths),g.printfData.push(...F.printfData)}let{print:C,printfData:w}=G(T.node);return C&&(g.paths.push(T.node.relativePath),w&&g.printfData.push(w)),g};var b=y;let P=[],v=[{item:{path:f,depth:0,resultIndex:0},parentIndex:-1,childOrderInParent:0}],S=new Map;for(;v.length>0;){let m=Date.now(),g=v.splice(0,ye),T=await Promise.all(g.map(C=>N(C.item)));u.batchCount++,u.batchTime+=Date.now()-m;for(let C=0;C<g.length;C++){let w=T[C],D=g[C];if(!w)continue;let F=P.length;if(D.parentIndex>=0){let I=S.get(D.parentIndex)||[];I.push(F),S.set(D.parentIndex,I)}P.push({node:w,parentIndex:D.parentIndex,childIndices:[]});for(let I=0;I<w.children.length;I++)v.push({item:w.children[I],parentIndex:F,childOrderInParent:I})}}for(let[m,g]of S)m>=0&&m<P.length&&(P[m].childIndices=g);if(P.length>0){let m=y(0);h.paths.push(...m.paths),h.printfData.push(...m.printfData)}}else{let m=function(g){let T=P.get(g);T&&(h.paths.push(T.path),T.printfData&&h.printfData.push(T.printfData));let C=y.get(g);if(C)for(let w of C)m(w)};var $=m;let P=new Map,v=0,S=[{item:{path:f,depth:0,resultIndex:0},orderIndex:v++}],y=new Map;for(;S.length>0;){let g=Date.now(),T=S.splice(0,ye),C=await Promise.all(T.map(async({item:w,orderIndex:D})=>{let F=await N(w);return F?{node:F,orderIndex:D}:null}));u.batchCount++,u.batchTime+=Date.now()-g;for(let w of C){if(!w)continue;let{node:D,orderIndex:F}=w,{print:I,printfData:Z}=G(D);if(I&&P.set(F,{path:D.relativePath,printfData:Z}),D.children.length>0){let ee=[];for(let Q of D.children){let H=v++;ee.push(H),S.push({item:Q,orderIndex:H})}y.set(F,ee)}}}m(0)}return h}let X=await be();if(x.push(...X.paths),re.push(...X.printfData),t.trace){let h=Date.now()-M;xe(t.trace,u,h),t.trace({category:"find",name:"searchPath",durationMs:h,details:{path:c,resultsFound:X.paths.length}})}}let W="";if(l.length>0)for(let c of l)switch(c.type){case"print":W+=x.length>0?`${x.join(`
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import{a as T}from"./chunk-DZCB42NK.js";import{c as b}from"./chunk-AH77CRWX.js";import{a as M}from"./chunk-HWKDQ44K.js";import{a as S,b as F}from"./chunk-74CEPOFO.js";var H={name:"wc",summary:"print newline, word, and byte counts for each file",usage:"wc [OPTION]... [FILE]...",options:["-c, --bytes print the byte counts","-m, --chars print the character counts","-l, --lines print the newline counts","-w, --words print the word counts"," --help display this help and exit"]},O={lines:{short:"l",long:"lines",type:"boolean"},words:{short:"w",long:"words",type:"boolean"},bytes:{short:"c",long:"bytes",type:"boolean"},chars:{short:"m",long:"chars",type:"boolean"}},N={name:"wc",async execute(a,f){if(F(a))return S(H);let s=M("wc",a,O);if(!s.ok)return s.error;let{lines:o,words:n}=s.result.flags,l=s.result.flags.bytes,e=s.result.flags.chars,t=s.result.positional;!o&&!n&&!l&&!e&&(o=n=l=!0);let c=l||e,i=await T(f,t,{cmdName:"wc",stopOnError:!1});if(t.length===0){let r=C(i.files[0].content,e);return{stdout:`${x(r,o,n,c,"",0)}
|
|
2
|
+
`,stderr:"",exitCode:0}}let d=[],m=0,g=0,u=0;for(let{filename:r,content:y}of i.files){let p=C(y,e);m+=p.lines,g+=p.words,u+=p.third,d.push({filename:r,stats:p})}let L=t.length>1?m:Math.max(...d.map(r=>r.stats.lines)),$=t.length>1?g:Math.max(...d.map(r=>r.stats.words)),B=t.length>1?u:Math.max(...d.map(r=>r.stats.third)),h=t.length>1?3:0;o&&(h=Math.max(h,String(L).length)),n&&(h=Math.max(h,String($).length)),c&&(h=Math.max(h,String(B).length));let w="";for(let{filename:r,stats:y}of d)w+=`${x(y,o,n,c,r,h)}
|
|
3
|
+
`;return t.length>1&&(w+=`${x({lines:m,words:g,third:u},o,n,c,"total",h)}
|
|
4
|
+
`),{stdout:w,stderr:i.stderr,exitCode:i.exitCode}}};function C(a,f){let s=a,o=s.length,n=f?Array.from(b(a)).length:o,l=0,e=0,t=!1;for(let c=0;c<o;c++){let i=s[c];i===`
|
|
5
|
+
`?(l++,t&&(e++,t=!1)):i===" "||i===" "||i==="\r"?t&&(e++,t=!1):t=!0}return t&&e++,{lines:l,words:e,third:n}}function x(a,f,s,o,n,l){let e=[];f&&e.push(String(a.lines).padStart(l)),s&&e.push(String(a.words).padStart(l)),o&&e.push(String(a.third).padStart(l));let t=e.join(" ");return n&&(t+=` ${n}`),t}var j={name:"wc",flags:[{flag:"-l",type:"boolean"},{flag:"-w",type:"boolean"},{flag:"-c",type:"boolean"},{flag:"-m",type:"boolean"}],stdinType:"text",needsFiles:!0};export{N as a,j as b};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import{c as j,d as y}from"./chunk-AH77CRWX.js";import{a as g,b as v,c as F}from"./chunk-74CEPOFO.js";var N={name:"join",summary:"join lines of two files on a common field",usage:"join [OPTION]... FILE1 FILE2",description:"For each pair of input lines with identical join fields, write a line to standard output. The default join field is the first, delimited by blanks.",options:["-1 FIELD Join on this FIELD of file 1 (default: 1)","-2 FIELD Join on this FIELD of file 2 (default: 1)","-t CHAR Use CHAR as input and output field separator","-a FILENUM Also print unpairable lines from file FILENUM (1 or 2)","-v FILENUM Like -a but only output unpairable lines","-e STRING Replace missing fields with STRING","-o FORMAT Output format (comma-separated list of FILENUM.FIELD)","-i Ignore case when comparing fields"],examples:["join file1 file2 # Join on first field","join -1 2 -2 1 file1 file2 # Join file1 col 2 with file2 col 1","join -t ',' file1.csv file2.csv # Join CSV files","join -a 1 file1 file2 # Left outer join"]};function I(i,s){return s?i.split(s):i.split(/[ \t]+/).filter(n=>n.length>0)}function L(i,s,n,f){let e=I(i,s),r=e[n-1]??"";return f&&(r=r.toLowerCase()),{fields:e,joinKey:r,original:i}}function m(i,s,n){let f=n.separator??" ";if(n.outputFormat){let l=[];for(let{file:c,field:p}of n.outputFormat){let a=c===1?i:s;a&&p===0?l.push(a.joinKey):a&&a.fields[p-1]!==void 0?l.push(a.fields[p-1]):l.push(n.emptyString)}return l.join(f)}let e=[],r=i?.joinKey??s?.joinKey??"";if(e.push(r),i)for(let l=0;l<i.fields.length;l++)l!==n.field1-1&&e.push(i.fields[l]);if(s)for(let l=0;l<s.fields.length;l++)l!==n.field2-1&&e.push(s.fields[l]);return e.join(f)}function U(i){let s=i.split(","),n=[];for(let f of s){let e=f.trim().match(/^(\d+)\.(\d+)$/);if(!e)return null;let r=Number.parseInt(e[1],10),l=Number.parseInt(e[2],10);if(r!==1&&r!==2)return null;n.push({file:r,field:l})}return n}var E={name:"join",execute:async(i,s)=>{if(v(i))return g(N);let n={field1:1,field2:1,separator:null,printUnpairable:new Set,onlyUnpairable:new Set,emptyString:"",outputFormat:null,ignoreCase:!1},f=[],e=0;for(;e<i.length;){let t=i[e];if(t==="-1"&&e+1<i.length){let o=Number.parseInt(i[e+1],10);if(Number.isNaN(o)||o<1)return{exitCode:1,stdout:"",stderr:`join: invalid field number: '${i[e+1]}'
|
|
2
|
+
`};n.field1=o,e+=2}else if(t==="-2"&&e+1<i.length){let o=Number.parseInt(i[e+1],10);if(Number.isNaN(o)||o<1)return{exitCode:1,stdout:"",stderr:`join: invalid field number: '${i[e+1]}'
|
|
3
|
+
`};n.field2=o,e+=2}else if((t==="-t"||t==="--field-separator")&&e+1<i.length)n.separator=i[e+1],e+=2;else if(t.startsWith("-t")&&t.length>2)n.separator=t.slice(2),e++;else if(t==="-a"&&e+1<i.length){let o=Number.parseInt(i[e+1],10);if(o!==1&&o!==2)return{exitCode:1,stdout:"",stderr:`join: invalid file number: '${i[e+1]}'
|
|
4
|
+
`};n.printUnpairable.add(o),e+=2}else if(t.match(/^-a[12]$/))n.printUnpairable.add(Number.parseInt(t[2],10)),e++;else if(t==="-v"&&e+1<i.length){let o=Number.parseInt(i[e+1],10);if(o!==1&&o!==2)return{exitCode:1,stdout:"",stderr:`join: invalid file number: '${i[e+1]}'
|
|
5
|
+
`};n.onlyUnpairable.add(o),e+=2}else if(t.match(/^-v[12]$/))n.onlyUnpairable.add(Number.parseInt(t[2],10)),e++;else if(t==="-e"&&e+1<i.length)n.emptyString=i[e+1],e+=2;else if(t==="-o"&&e+1<i.length){let o=U(i[e+1]);if(!o)return{exitCode:1,stdout:"",stderr:`join: invalid field spec: '${i[e+1]}'
|
|
6
|
+
`};n.outputFormat=o,e+=2}else if(t==="-i"||t==="--ignore-case")n.ignoreCase=!0,e++;else if(t==="--"){f.push(...i.slice(e+1));break}else{if(t.startsWith("-")&&t!=="-")return F("join",t);f.push(t),e++}}if(f.length!==2)return{exitCode:1,stdout:"",stderr:f.length<2?`join: missing file operand
|
|
7
|
+
`:`join: extra operand
|
|
8
|
+
`};let r=[];for(let t of f)if(t==="-")r.push(j(s.stdin)??"");else{let o=s.fs.resolvePath(s.cwd,t),u=await s.fs.readFile(o);if(u===null)return{exitCode:1,stdout:"",stderr:`join: ${t}: No such file or directory
|
|
9
|
+
`};r.push(u)}let l=(t,o)=>{let u=t.split(`
|
|
10
|
+
`);return t.endsWith(`
|
|
11
|
+
`)&&u[u.length-1]===""&&u.pop(),u.filter(h=>h.length>0).map(h=>L(h,n.separator,o,n.ignoreCase))},c=l(r[0],n.field1),p=l(r[1],n.field2),a=new Map;for(let t of p){let o=a.get(t.joinKey);o?o.push(t):a.set(t.joinKey,[t])}let d=[],b=new Set;for(let t of c){let o=a.get(t.joinKey);if(o&&o.length>0){if(b.add(t.joinKey),n.onlyUnpairable.size===0)for(let u of o)d.push(m(t,u,n))}else(n.printUnpairable.has(1)||n.onlyUnpairable.has(1))&&d.push(m(t,null,n))}if(n.printUnpairable.has(2)||n.onlyUnpairable.has(2))for(let t of p)b.has(t.joinKey)||d.push(m(null,t,n));return{exitCode:0,stdout:y(d.length>0?`${d.join(`
|
|
12
|
+
`)}
|
|
13
|
+
`:""),stderr:"",stdoutEncoding:"binary"}}},H={name:"join",flags:[{flag:"-1",type:"value",valueHint:"number"},{flag:"-2",type:"value",valueHint:"number"},{flag:"-t",type:"value",valueHint:"delimiter"},{flag:"-a",type:"value",valueHint:"number"},{flag:"-v",type:"value",valueHint:"number"},{flag:"-e",type:"value",valueHint:"string"},{flag:"-o",type:"value",valueHint:"format"},{flag:"-i",type:"boolean"}],needsArgs:!0,minArgs:2};export{E as a,H as b};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as g,b as A,c as T,d as at,e as E,g as O,h as G}from"./chunk-7TSDKFEO.js";import{a as X,c as lt}from"./chunk-OJDRYQWQ.js";import{a as yt}from"./chunk-24IMIIXA.js";import{a as R}from"./chunk-YNYSPYQ5.js";import{k as B}from"./chunk-GFQRA5P5.js";function W(t,r,e,n,p,o,u,c,s,f){switch(r){case"sort":return Array.isArray(t)?[[...t].sort(u)]:[null];case"sort_by":return!Array.isArray(t)||e.length===0?[null]:[[...t].sort((h,a)=>{let y=p(h,e[0],n)[0],l=p(a,e[0],n)[0];return u(y,l)})];case"bsearch":{if(!Array.isArray(t)){let h=t===null?"null":typeof t=="object"?"object":typeof t;throw new Error(`${h} (${JSON.stringify(t)}) cannot be searched from`)}return e.length===0?[null]:p(t,e[0],n).map(h=>{let a=0,y=t.length;for(;a<y;){let l=a+y>>>1;u(t[l],h)<0?a=l+1:y=l}return a<t.length&&u(t[a],h)===0?a:-a-1})}case"unique_by":{if(!Array.isArray(t)||e.length===0)return[null];let i=new Map;for(let a of t){let y=p(a,e[0],n)[0],l=JSON.stringify(y);i.has(l)||i.set(l,{item:a,key:y})}let h=[...i.values()];return h.sort((a,y)=>u(a.key,y.key)),[h.map(a=>a.item)]}case"group_by":{if(!Array.isArray(t)||e.length===0)return[null];let i=new Map;for(let h of t){let a=JSON.stringify(p(h,e[0],n)[0]);i.has(a)||i.set(a,[]),i.get(a)?.push(h)}return[[...i.values()]]}case"max":return Array.isArray(t)&&t.length>0?[t.reduce((i,h)=>u(i,h)>0?i:h)]:[null];case"max_by":return!Array.isArray(t)||t.length===0||e.length===0?[null]:[t.reduce((i,h)=>{let a=p(i,e[0],n)[0],y=p(h,e[0],n)[0];return u(a,y)>0?i:h})];case"min":return Array.isArray(t)&&t.length>0?[t.reduce((i,h)=>u(i,h)<0?i:h)]:[null];case"min_by":return!Array.isArray(t)||t.length===0||e.length===0?[null]:[t.reduce((i,h)=>{let a=p(i,e[0],n)[0],y=p(h,e[0],n)[0];return u(a,y)<0?i:h})];case"add":{let i=h=>{let a=h.filter(y=>y!==null);return a.length===0?null:a.every(y=>typeof y=="number")?a.reduce((y,l)=>y+l,0):a.every(y=>typeof y=="string")?a.join(""):a.every(y=>Array.isArray(y))?a.flat():a.every(y=>y&&typeof y=="object"&&!Array.isArray(y))?lt(...a):null};if(e.length>=1){let h=p(t,e[0],n);return[i(h)]}return Array.isArray(t)?[i(t)]:[null]}case"any":{if(e.length>=2){try{let i=o(t,e[0],n);for(let h of i)if(p(h,e[1],n).some(c))return[!0]}catch(i){if(i instanceof f)throw i}return[!1]}return e.length===1?Array.isArray(t)?[t.some(i=>c(p(i,e[0],n)[0]))]:[!1]:Array.isArray(t)?[t.some(c)]:[!1]}case"all":{if(e.length>=2){try{let i=o(t,e[0],n);for(let h of i)if(!p(h,e[1],n).some(c))return[!1]}catch(i){if(i instanceof f)throw i}return[!0]}return e.length===1?Array.isArray(t)?[t.every(i=>c(p(i,e[0],n)[0]))]:[!0]:Array.isArray(t)?[t.every(c)]:[!0]}case"select":return e.length===0?[t]:p(t,e[0],n).some(c)?[t]:[];case"map":return e.length===0||!Array.isArray(t)?[null]:[t.flatMap(h=>p(h,e[0],n))];case"map_values":{if(e.length===0)return[null];if(Array.isArray(t))return[t.flatMap(i=>p(i,e[0],n))];if(t&&typeof t=="object"){let i=Object.create(null);for(let[h,a]of Object.entries(t)){if(!g(h))continue;let y=p(a,e[0],n);y.length>0&&A(i,h,y[0])}return[i]}return[null]}case"has":{if(e.length===0)return[!1];let h=p(t,e[0],n)[0];return Array.isArray(t)&&typeof h=="number"?[h>=0&&h<t.length]:t&&typeof t=="object"&&typeof h=="string"?[T(t,h)]:[!1]}case"in":{if(e.length===0)return[!1];let h=p(t,e[0],n)[0];return Array.isArray(h)&&typeof t=="number"?[t>=0&&t<h.length]:h&&typeof h=="object"&&typeof t=="string"?[T(h,t)]:[!1]}case"contains":{if(e.length===0)return[!1];let i=p(t,e[0],n);return[s(t,i[0])]}case"inside":{if(e.length===0)return[!1];let i=p(t,e[0],n);return[s(i[0],t)]}default:return null}}function z(t,r,e,n,p,o,u,c){switch(r){case"first":if(e.length>0)try{let s=o(t,e[0],n);return s.length>0?[s[0]]:[]}catch(s){if(s instanceof c)throw s;return[]}return Array.isArray(t)&&t.length>0?[t[0]]:[null];case"last":if(e.length>0){let s=p(t,e[0],n);return s.length>0?[s[s.length-1]]:[]}return Array.isArray(t)&&t.length>0?[t[t.length-1]]:[null];case"nth":{if(e.length<1)return[null];let s=p(t,e[0],n);if(e.length>1){for(let i of s)if(i<0)throw new Error("nth doesn't support negative indices");let f;try{f=o(t,e[1],n)}catch(i){if(i instanceof c)throw i;f=[]}return s.flatMap(i=>{let h=i;return h<f.length?[f[h]]:[]})}return Array.isArray(t)?s.flatMap(f=>{let i=f;if(i<0)throw new Error("nth doesn't support negative indices");return i<t.length?[t[i]]:[null]}):[null]}case"range":{if(e.length===0)return[];let s=Math.max(n.limits.maxIterations*100,1e6),f=l=>l.length>=s,i=p(t,e[0],n);if(e.length===1){let l=[];for(let m of i){let b=m;for(let w=0;w<b;w++)if(l.push(w),f(l))return l}return l}let h=p(t,e[1],n);if(e.length===2){let l=[];for(let m of i)for(let b of h){let w=m,k=b;for(let N=w;N<k;N++)if(l.push(N),f(l))return l}return l}let a=p(t,e[2],n),y=[];for(let l of i)for(let m of h)for(let b of a){let w=l,k=m,N=b;if(N!==0){if(N>0){for(let C=w;C<k;C+=N)if(y.push(C),f(y))return y}else for(let C=w;C>k;C+=N)if(y.push(C),f(y))return y}}return y}case"limit":return e.length<2?[]:p(t,e[0],n).flatMap(f=>{let i=f;if(i<0)throw new Error("limit doesn't support negative count");if(i===0)return[];let h;try{h=o(t,e[1],n)}catch(a){if(a instanceof c)throw a;h=[]}return h.slice(0,i)});case"isempty":{if(e.length<1)return[!0];try{return[o(t,e[0],n).length===0]}catch(s){if(s instanceof c)throw s;return[!0]}}case"isvalid":{if(e.length<1)return[!0];try{return[p(t,e[0],n).length>0]}catch(s){if(s instanceof c)throw s;return[!1]}}case"skip":return e.length<2?[]:p(t,e[0],n).flatMap(f=>{let i=f;if(i<0)throw new Error("skip doesn't support negative count");return p(t,e[1],n).slice(i)});case"until":{if(e.length<2)return[t];let s=t,f=n.limits.maxIterations;for(let i=0;i<f;i++){if(p(s,e[0],n).some(u))return[s];let a=p(s,e[1],n);if(a.length===0)return[s];s=a[0]}throw new c(`jq until: too many iterations (${f}), increase executionLimits.maxJqIterations`,"iterations")}case"while":{if(e.length<2)return[t];let s=[],f=t,i=n.limits.maxIterations;for(let h=0;h<i&&p(f,e[0],n).some(u);h++){s.push(f);let y=p(f,e[1],n);if(y.length===0)break;f=y[0]}if(s.length>=i)throw new c(`jq while: too many iterations (${i}), increase executionLimits.maxJqIterations`,"iterations");return s}case"repeat":{if(e.length===0)return[t];let s=[],f=t,i=n.limits.maxIterations;for(let h=0;h<i;h++){s.push(f);let a=p(f,e[0],n);if(a.length===0)break;f=a[0]}if(s.length>=i)throw new c(`jq repeat: too many iterations (${i}), increase executionLimits.maxJqIterations`,"iterations");return s}default:return null}}function Z(t,r,e,n,p){switch(r){case"now":return[Date.now()/1e3];case"gmtime":{if(typeof t!="number")return[null];let o=new Date(t*1e3),u=o.getUTCFullYear(),c=o.getUTCMonth(),s=o.getUTCDate(),f=o.getUTCHours(),i=o.getUTCMinutes(),h=o.getUTCSeconds(),a=o.getUTCDay(),y=Date.UTC(u,0,1),l=Math.floor((o.getTime()-y)/(1440*60*1e3));return[[u,c,s,f,i,h,a,l]]}case"mktime":{if(!Array.isArray(t))throw new Error("mktime requires parsed datetime inputs");let[o,u,c,s=0,f=0,i=0]=t;if(typeof o!="number"||typeof u!="number")throw new Error("mktime requires parsed datetime inputs");let h=Date.UTC(o,u,c??1,s??0,f??0,i??0);return[Math.floor(h/1e3)]}case"strftime":{if(e.length===0)return[null];let u=p(t,e[0],n)[0];if(typeof u!="string")throw new Error("strftime/1 requires a string format");let c;if(typeof t=="number")c=new Date(t*1e3);else if(Array.isArray(t)){let[a,y,l,m=0,b=0,w=0]=t;if(typeof a!="number"||typeof y!="number")throw new Error("strftime/1 requires parsed datetime inputs");c=new Date(Date.UTC(a,y,l??1,m??0,b??0,w??0))}else throw new Error("strftime/1 requires parsed datetime inputs");let s=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],f=["January","February","March","April","May","June","July","August","September","October","November","December"],i=(a,y=2)=>String(a).padStart(y,"0");return[u.replace(/%Y/g,String(c.getUTCFullYear())).replace(/%m/g,i(c.getUTCMonth()+1)).replace(/%d/g,i(c.getUTCDate())).replace(/%H/g,i(c.getUTCHours())).replace(/%M/g,i(c.getUTCMinutes())).replace(/%S/g,i(c.getUTCSeconds())).replace(/%A/g,s[c.getUTCDay()]).replace(/%B/g,f[c.getUTCMonth()]).replace(/%Z/g,"UTC").replace(/%%/g,"%")]}case"strptime":{if(e.length===0)return[null];if(typeof t!="string")throw new Error("strptime/1 requires a string input");let u=p(t,e[0],n)[0];if(typeof u!="string")throw new Error("strptime/1 requires a string format");if(u==="%Y-%m-%dT%H:%M:%SZ"){let s=t.match(/^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2}):(\d{2})Z$/);if(s){let[,f,i,h,a,y,l]=s.map(Number),m=new Date(Date.UTC(f,i-1,h,a,y,l)),b=m.getUTCDay(),w=Date.UTC(f,0,1),k=Math.floor((m.getTime()-w)/(1440*60*1e3));return[[f,i-1,h,a,y,l,b,k]]}}let c=new Date(t);if(!Number.isNaN(c.getTime())){let s=c.getUTCFullYear(),f=c.getUTCMonth(),i=c.getUTCDate(),h=c.getUTCHours(),a=c.getUTCMinutes(),y=c.getUTCSeconds(),l=c.getUTCDay(),m=Date.UTC(s,0,1),b=Math.floor((c.getTime()-m)/(1440*60*1e3));return[[s,f,i,h,a,y,l,b]]}throw new Error(`Cannot parse date: ${t}`)}case"fromdate":{if(typeof t!="string")throw new Error("fromdate requires a string input");let o=new Date(t);if(Number.isNaN(o.getTime()))throw new Error(`date "${t}" does not match format "%Y-%m-%dT%H:%M:%SZ"`);return[Math.floor(o.getTime()/1e3)]}case"todate":{if(typeof t!="number")throw new Error("todate requires a number input");return[new Date(t*1e3).toISOString().replace(/\.\d{3}Z$/,"Z")]}default:return null}}function S(t){return t!==!1&&t!==null}function I(t,r){return JSON.stringify(t)===JSON.stringify(r)}function U(t,r){return typeof t=="number"&&typeof r=="number"?t-r:typeof t=="string"&&typeof r=="string"?t.localeCompare(r):0}function v(t,r){let e=O(t);for(let n of Object.keys(r)){if(!g(n))continue;let p=T(e,n)?E(e[n]):null,o=E(r[n]);p&&o?A(e,n,v(p,o)):A(e,n,r[n])}return e}function D(t,r=3e3){let e=0,n=t;for(;e<r;)if(Array.isArray(n)){if(n.length===0)return e+1;n=n[0],e++}else if(n!==null&&typeof n=="object"){let p=Object.keys(n);if(p.length===0)return e+1;n=n[p[0]],e++}else return e;return e}function $(t,r){let e=c=>c===null?0:typeof c=="boolean"?1:typeof c=="number"?2:typeof c=="string"?3:Array.isArray(c)?4:typeof c=="object"?5:6,n=e(t),p=e(r);if(n!==p)return n-p;if(typeof t=="number"&&typeof r=="number")return t-r;if(typeof t=="string"&&typeof r=="string")return t.localeCompare(r);if(typeof t=="boolean"&&typeof r=="boolean")return(t?1:0)-(r?1:0);if(Array.isArray(t)&&Array.isArray(r)){for(let c=0;c<Math.min(t.length,r.length);c++){let s=$(t[c],r[c]);if(s!==0)return s}return t.length-r.length}let o=E(t),u=E(r);if(o&&u){let c=Object.keys(o).sort(),s=Object.keys(u).sort();for(let f=0;f<Math.min(c.length,s.length);f++){let i=c[f].localeCompare(s[f]);if(i!==0)return i}if(c.length!==s.length)return c.length-s.length;for(let f of c){let i=$(o[f],u[f]);if(i!==0)return i}}return 0}function F(t,r){if(I(t,r))return!0;if(typeof t=="string"&&typeof r=="string")return t.includes(r);if(Array.isArray(t)&&Array.isArray(r))return r.every(p=>t.some(o=>F(o,p)));let e=E(t),n=E(r);return e&&n?Object.keys(n).every(p=>T(e,p)&&F(e[p],n[p])):!1}var Ot=2e3;function tt(t,r,e){switch(r){case"@base64":return typeof t=="string"?typeof Buffer<"u"?[Buffer.from(t,"utf-8").toString("base64")]:[btoa(t)]:[null];case"@base64d":return typeof t=="string"?typeof Buffer<"u"?[Buffer.from(t,"base64").toString("utf-8")]:[atob(t)]:[null];case"@uri":return typeof t=="string"?[encodeURIComponent(t).replace(/!/g,"%21").replace(/'/g,"%27").replace(/\(/g,"%28").replace(/\)/g,"%29").replace(/\*/g,"%2A")]:[null];case"@urid":return typeof t=="string"?[decodeURIComponent(t)]:[null];case"@csv":return Array.isArray(t)?[t.map(p=>{if(p===null)return"";if(typeof p=="boolean")return p?"true":"false";if(typeof p=="number")return String(p);let o=String(p);return o.includes(",")||o.includes('"')||o.includes(`
|
|
1
|
+
import{a as g,b as A,c as T,d as at,e as E,g as O,h as G}from"./chunk-7TSDKFEO.js";import{a as X,c as lt}from"./chunk-OJDRYQWQ.js";import{a as yt}from"./chunk-24IMIIXA.js";import{a as R}from"./chunk-B74TABJS.js";import{k as B}from"./chunk-GFQRA5P5.js";function W(t,r,e,n,p,o,u,c,s,f){switch(r){case"sort":return Array.isArray(t)?[[...t].sort(u)]:[null];case"sort_by":return!Array.isArray(t)||e.length===0?[null]:[[...t].sort((h,a)=>{let y=p(h,e[0],n)[0],l=p(a,e[0],n)[0];return u(y,l)})];case"bsearch":{if(!Array.isArray(t)){let h=t===null?"null":typeof t=="object"?"object":typeof t;throw new Error(`${h} (${JSON.stringify(t)}) cannot be searched from`)}return e.length===0?[null]:p(t,e[0],n).map(h=>{let a=0,y=t.length;for(;a<y;){let l=a+y>>>1;u(t[l],h)<0?a=l+1:y=l}return a<t.length&&u(t[a],h)===0?a:-a-1})}case"unique_by":{if(!Array.isArray(t)||e.length===0)return[null];let i=new Map;for(let a of t){let y=p(a,e[0],n)[0],l=JSON.stringify(y);i.has(l)||i.set(l,{item:a,key:y})}let h=[...i.values()];return h.sort((a,y)=>u(a.key,y.key)),[h.map(a=>a.item)]}case"group_by":{if(!Array.isArray(t)||e.length===0)return[null];let i=new Map;for(let h of t){let a=JSON.stringify(p(h,e[0],n)[0]);i.has(a)||i.set(a,[]),i.get(a)?.push(h)}return[[...i.values()]]}case"max":return Array.isArray(t)&&t.length>0?[t.reduce((i,h)=>u(i,h)>0?i:h)]:[null];case"max_by":return!Array.isArray(t)||t.length===0||e.length===0?[null]:[t.reduce((i,h)=>{let a=p(i,e[0],n)[0],y=p(h,e[0],n)[0];return u(a,y)>0?i:h})];case"min":return Array.isArray(t)&&t.length>0?[t.reduce((i,h)=>u(i,h)<0?i:h)]:[null];case"min_by":return!Array.isArray(t)||t.length===0||e.length===0?[null]:[t.reduce((i,h)=>{let a=p(i,e[0],n)[0],y=p(h,e[0],n)[0];return u(a,y)<0?i:h})];case"add":{let i=h=>{let a=h.filter(y=>y!==null);return a.length===0?null:a.every(y=>typeof y=="number")?a.reduce((y,l)=>y+l,0):a.every(y=>typeof y=="string")?a.join(""):a.every(y=>Array.isArray(y))?a.flat():a.every(y=>y&&typeof y=="object"&&!Array.isArray(y))?lt(...a):null};if(e.length>=1){let h=p(t,e[0],n);return[i(h)]}return Array.isArray(t)?[i(t)]:[null]}case"any":{if(e.length>=2){try{let i=o(t,e[0],n);for(let h of i)if(p(h,e[1],n).some(c))return[!0]}catch(i){if(i instanceof f)throw i}return[!1]}return e.length===1?Array.isArray(t)?[t.some(i=>c(p(i,e[0],n)[0]))]:[!1]:Array.isArray(t)?[t.some(c)]:[!1]}case"all":{if(e.length>=2){try{let i=o(t,e[0],n);for(let h of i)if(!p(h,e[1],n).some(c))return[!1]}catch(i){if(i instanceof f)throw i}return[!0]}return e.length===1?Array.isArray(t)?[t.every(i=>c(p(i,e[0],n)[0]))]:[!0]:Array.isArray(t)?[t.every(c)]:[!0]}case"select":return e.length===0?[t]:p(t,e[0],n).some(c)?[t]:[];case"map":return e.length===0||!Array.isArray(t)?[null]:[t.flatMap(h=>p(h,e[0],n))];case"map_values":{if(e.length===0)return[null];if(Array.isArray(t))return[t.flatMap(i=>p(i,e[0],n))];if(t&&typeof t=="object"){let i=Object.create(null);for(let[h,a]of Object.entries(t)){if(!g(h))continue;let y=p(a,e[0],n);y.length>0&&A(i,h,y[0])}return[i]}return[null]}case"has":{if(e.length===0)return[!1];let h=p(t,e[0],n)[0];return Array.isArray(t)&&typeof h=="number"?[h>=0&&h<t.length]:t&&typeof t=="object"&&typeof h=="string"?[T(t,h)]:[!1]}case"in":{if(e.length===0)return[!1];let h=p(t,e[0],n)[0];return Array.isArray(h)&&typeof t=="number"?[t>=0&&t<h.length]:h&&typeof h=="object"&&typeof t=="string"?[T(h,t)]:[!1]}case"contains":{if(e.length===0)return[!1];let i=p(t,e[0],n);return[s(t,i[0])]}case"inside":{if(e.length===0)return[!1];let i=p(t,e[0],n);return[s(i[0],t)]}default:return null}}function z(t,r,e,n,p,o,u,c){switch(r){case"first":if(e.length>0)try{let s=o(t,e[0],n);return s.length>0?[s[0]]:[]}catch(s){if(s instanceof c)throw s;return[]}return Array.isArray(t)&&t.length>0?[t[0]]:[null];case"last":if(e.length>0){let s=p(t,e[0],n);return s.length>0?[s[s.length-1]]:[]}return Array.isArray(t)&&t.length>0?[t[t.length-1]]:[null];case"nth":{if(e.length<1)return[null];let s=p(t,e[0],n);if(e.length>1){for(let i of s)if(i<0)throw new Error("nth doesn't support negative indices");let f;try{f=o(t,e[1],n)}catch(i){if(i instanceof c)throw i;f=[]}return s.flatMap(i=>{let h=i;return h<f.length?[f[h]]:[]})}return Array.isArray(t)?s.flatMap(f=>{let i=f;if(i<0)throw new Error("nth doesn't support negative indices");return i<t.length?[t[i]]:[null]}):[null]}case"range":{if(e.length===0)return[];let s=Math.max(n.limits.maxIterations*100,1e6),f=l=>l.length>=s,i=p(t,e[0],n);if(e.length===1){let l=[];for(let m of i){let b=m;for(let w=0;w<b;w++)if(l.push(w),f(l))return l}return l}let h=p(t,e[1],n);if(e.length===2){let l=[];for(let m of i)for(let b of h){let w=m,k=b;for(let N=w;N<k;N++)if(l.push(N),f(l))return l}return l}let a=p(t,e[2],n),y=[];for(let l of i)for(let m of h)for(let b of a){let w=l,k=m,N=b;if(N!==0){if(N>0){for(let C=w;C<k;C+=N)if(y.push(C),f(y))return y}else for(let C=w;C>k;C+=N)if(y.push(C),f(y))return y}}return y}case"limit":return e.length<2?[]:p(t,e[0],n).flatMap(f=>{let i=f;if(i<0)throw new Error("limit doesn't support negative count");if(i===0)return[];let h;try{h=o(t,e[1],n)}catch(a){if(a instanceof c)throw a;h=[]}return h.slice(0,i)});case"isempty":{if(e.length<1)return[!0];try{return[o(t,e[0],n).length===0]}catch(s){if(s instanceof c)throw s;return[!0]}}case"isvalid":{if(e.length<1)return[!0];try{return[p(t,e[0],n).length>0]}catch(s){if(s instanceof c)throw s;return[!1]}}case"skip":return e.length<2?[]:p(t,e[0],n).flatMap(f=>{let i=f;if(i<0)throw new Error("skip doesn't support negative count");return p(t,e[1],n).slice(i)});case"until":{if(e.length<2)return[t];let s=t,f=n.limits.maxIterations;for(let i=0;i<f;i++){if(p(s,e[0],n).some(u))return[s];let a=p(s,e[1],n);if(a.length===0)return[s];s=a[0]}throw new c(`jq until: too many iterations (${f}), increase executionLimits.maxJqIterations`,"iterations")}case"while":{if(e.length<2)return[t];let s=[],f=t,i=n.limits.maxIterations;for(let h=0;h<i&&p(f,e[0],n).some(u);h++){s.push(f);let y=p(f,e[1],n);if(y.length===0)break;f=y[0]}if(s.length>=i)throw new c(`jq while: too many iterations (${i}), increase executionLimits.maxJqIterations`,"iterations");return s}case"repeat":{if(e.length===0)return[t];let s=[],f=t,i=n.limits.maxIterations;for(let h=0;h<i;h++){s.push(f);let a=p(f,e[0],n);if(a.length===0)break;f=a[0]}if(s.length>=i)throw new c(`jq repeat: too many iterations (${i}), increase executionLimits.maxJqIterations`,"iterations");return s}default:return null}}function Z(t,r,e,n,p){switch(r){case"now":return[Date.now()/1e3];case"gmtime":{if(typeof t!="number")return[null];let o=new Date(t*1e3),u=o.getUTCFullYear(),c=o.getUTCMonth(),s=o.getUTCDate(),f=o.getUTCHours(),i=o.getUTCMinutes(),h=o.getUTCSeconds(),a=o.getUTCDay(),y=Date.UTC(u,0,1),l=Math.floor((o.getTime()-y)/(1440*60*1e3));return[[u,c,s,f,i,h,a,l]]}case"mktime":{if(!Array.isArray(t))throw new Error("mktime requires parsed datetime inputs");let[o,u,c,s=0,f=0,i=0]=t;if(typeof o!="number"||typeof u!="number")throw new Error("mktime requires parsed datetime inputs");let h=Date.UTC(o,u,c??1,s??0,f??0,i??0);return[Math.floor(h/1e3)]}case"strftime":{if(e.length===0)return[null];let u=p(t,e[0],n)[0];if(typeof u!="string")throw new Error("strftime/1 requires a string format");let c;if(typeof t=="number")c=new Date(t*1e3);else if(Array.isArray(t)){let[a,y,l,m=0,b=0,w=0]=t;if(typeof a!="number"||typeof y!="number")throw new Error("strftime/1 requires parsed datetime inputs");c=new Date(Date.UTC(a,y,l??1,m??0,b??0,w??0))}else throw new Error("strftime/1 requires parsed datetime inputs");let s=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],f=["January","February","March","April","May","June","July","August","September","October","November","December"],i=(a,y=2)=>String(a).padStart(y,"0");return[u.replace(/%Y/g,String(c.getUTCFullYear())).replace(/%m/g,i(c.getUTCMonth()+1)).replace(/%d/g,i(c.getUTCDate())).replace(/%H/g,i(c.getUTCHours())).replace(/%M/g,i(c.getUTCMinutes())).replace(/%S/g,i(c.getUTCSeconds())).replace(/%A/g,s[c.getUTCDay()]).replace(/%B/g,f[c.getUTCMonth()]).replace(/%Z/g,"UTC").replace(/%%/g,"%")]}case"strptime":{if(e.length===0)return[null];if(typeof t!="string")throw new Error("strptime/1 requires a string input");let u=p(t,e[0],n)[0];if(typeof u!="string")throw new Error("strptime/1 requires a string format");if(u==="%Y-%m-%dT%H:%M:%SZ"){let s=t.match(/^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2}):(\d{2})Z$/);if(s){let[,f,i,h,a,y,l]=s.map(Number),m=new Date(Date.UTC(f,i-1,h,a,y,l)),b=m.getUTCDay(),w=Date.UTC(f,0,1),k=Math.floor((m.getTime()-w)/(1440*60*1e3));return[[f,i-1,h,a,y,l,b,k]]}}let c=new Date(t);if(!Number.isNaN(c.getTime())){let s=c.getUTCFullYear(),f=c.getUTCMonth(),i=c.getUTCDate(),h=c.getUTCHours(),a=c.getUTCMinutes(),y=c.getUTCSeconds(),l=c.getUTCDay(),m=Date.UTC(s,0,1),b=Math.floor((c.getTime()-m)/(1440*60*1e3));return[[s,f,i,h,a,y,l,b]]}throw new Error(`Cannot parse date: ${t}`)}case"fromdate":{if(typeof t!="string")throw new Error("fromdate requires a string input");let o=new Date(t);if(Number.isNaN(o.getTime()))throw new Error(`date "${t}" does not match format "%Y-%m-%dT%H:%M:%SZ"`);return[Math.floor(o.getTime()/1e3)]}case"todate":{if(typeof t!="number")throw new Error("todate requires a number input");return[new Date(t*1e3).toISOString().replace(/\.\d{3}Z$/,"Z")]}default:return null}}function S(t){return t!==!1&&t!==null}function I(t,r){return JSON.stringify(t)===JSON.stringify(r)}function U(t,r){return typeof t=="number"&&typeof r=="number"?t-r:typeof t=="string"&&typeof r=="string"?t.localeCompare(r):0}function v(t,r){let e=O(t);for(let n of Object.keys(r)){if(!g(n))continue;let p=T(e,n)?E(e[n]):null,o=E(r[n]);p&&o?A(e,n,v(p,o)):A(e,n,r[n])}return e}function D(t,r=3e3){let e=0,n=t;for(;e<r;)if(Array.isArray(n)){if(n.length===0)return e+1;n=n[0],e++}else if(n!==null&&typeof n=="object"){let p=Object.keys(n);if(p.length===0)return e+1;n=n[p[0]],e++}else return e;return e}function $(t,r){let e=c=>c===null?0:typeof c=="boolean"?1:typeof c=="number"?2:typeof c=="string"?3:Array.isArray(c)?4:typeof c=="object"?5:6,n=e(t),p=e(r);if(n!==p)return n-p;if(typeof t=="number"&&typeof r=="number")return t-r;if(typeof t=="string"&&typeof r=="string")return t.localeCompare(r);if(typeof t=="boolean"&&typeof r=="boolean")return(t?1:0)-(r?1:0);if(Array.isArray(t)&&Array.isArray(r)){for(let c=0;c<Math.min(t.length,r.length);c++){let s=$(t[c],r[c]);if(s!==0)return s}return t.length-r.length}let o=E(t),u=E(r);if(o&&u){let c=Object.keys(o).sort(),s=Object.keys(u).sort();for(let f=0;f<Math.min(c.length,s.length);f++){let i=c[f].localeCompare(s[f]);if(i!==0)return i}if(c.length!==s.length)return c.length-s.length;for(let f of c){let i=$(o[f],u[f]);if(i!==0)return i}}return 0}function F(t,r){if(I(t,r))return!0;if(typeof t=="string"&&typeof r=="string")return t.includes(r);if(Array.isArray(t)&&Array.isArray(r))return r.every(p=>t.some(o=>F(o,p)));let e=E(t),n=E(r);return e&&n?Object.keys(n).every(p=>T(e,p)&&F(e[p],n[p])):!1}var Ot=2e3;function tt(t,r,e){switch(r){case"@base64":return typeof t=="string"?typeof Buffer<"u"?[Buffer.from(t,"utf-8").toString("base64")]:[btoa(t)]:[null];case"@base64d":return typeof t=="string"?typeof Buffer<"u"?[Buffer.from(t,"base64").toString("utf-8")]:[atob(t)]:[null];case"@uri":return typeof t=="string"?[encodeURIComponent(t).replace(/!/g,"%21").replace(/'/g,"%27").replace(/\(/g,"%28").replace(/\)/g,"%29").replace(/\*/g,"%2A")]:[null];case"@urid":return typeof t=="string"?[decodeURIComponent(t)]:[null];case"@csv":return Array.isArray(t)?[t.map(p=>{if(p===null)return"";if(typeof p=="boolean")return p?"true":"false";if(typeof p=="number")return String(p);let o=String(p);return o.includes(",")||o.includes('"')||o.includes(`
|
|
2
2
|
`)||o.includes("\r")?`"${o.replace(/"/g,'""')}"`:o}).join(",")]:[null];case"@tsv":return Array.isArray(t)?[t.map(n=>String(n??"").replace(/\t/g,"\\t").replace(/\n/g,"\\n")).join(" ")]:[null];case"@json":{let n=e??Ot;return D(t,n+1)>n?[null]:[JSON.stringify(t)]}case"@html":return typeof t=="string"?[t.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/'/g,"'").replace(/"/g,""")]:[null];case"@sh":return typeof t=="string"?[`'${t.replace(/'/g,"'\\''")}'`]:[null];case"@text":return typeof t=="string"?[t]:t==null?[""]:[String(t)];default:return null}}function et(t,r,e,n,p,o){switch(r){case"index":return e.length===0?[null]:p(t,e[0],n).map(c=>{if(typeof t=="string"&&typeof c=="string"){if(c===""&&t==="")return null;let s=t.indexOf(c);return s>=0?s:null}if(Array.isArray(t)){if(Array.isArray(c)){for(let f=0;f<=t.length-c.length;f++){let i=!0;for(let h=0;h<c.length;h++)if(!o(t[f+h],c[h])){i=!1;break}if(i)return f}return null}let s=t.findIndex(f=>o(f,c));return s>=0?s:null}return null});case"rindex":return e.length===0?[null]:p(t,e[0],n).map(c=>{if(typeof t=="string"&&typeof c=="string"){let s=t.lastIndexOf(c);return s>=0?s:null}if(Array.isArray(t)){if(Array.isArray(c)){for(let s=t.length-c.length;s>=0;s--){let f=!0;for(let i=0;i<c.length;i++)if(!o(t[s+i],c[i])){f=!1;break}if(f)return s}return null}for(let s=t.length-1;s>=0;s--)if(o(t[s],c))return s;return null}return null});case"indices":return e.length===0?[[]]:p(t,e[0],n).map(c=>{let s=[];if(typeof t=="string"&&typeof c=="string"){let f=t.indexOf(c);for(;f!==-1;)s.push(f),f=t.indexOf(c,f+1)}else if(Array.isArray(t))if(Array.isArray(c)){let f=c.length;if(f===0)for(let i=0;i<=t.length;i++)s.push(i);else for(let i=0;i<=t.length-f;i++){let h=!0;for(let a=0;a<f;a++)if(!o(t[i+a],c[a])){h=!1;break}h&&s.push(i)}}else for(let f=0;f<t.length;f++)o(t[f],c)&&s.push(f);return s});default:return null}}function rt(t,r,e,n,p){switch(r){case"fabs":case"abs":return typeof t=="number"?[Math.abs(t)]:typeof t=="string"?[t]:[null];case"exp10":return typeof t=="number"?[10**t]:[null];case"exp2":return typeof t=="number"?[2**t]:[null];case"pow":{if(e.length<2)return[null];let o=p(t,e[0],n),u=p(t,e[1],n),c=o[0],s=u[0];return typeof c!="number"||typeof s!="number"?[null]:[c**s]}case"atan2":{if(e.length<2)return[null];let o=p(t,e[0],n),u=p(t,e[1],n),c=o[0],s=u[0];return typeof c!="number"||typeof s!="number"?[null]:[Math.atan2(c,s)]}case"hypot":{if(typeof t!="number"||e.length===0)return[null];let o=p(t,e[0],n)[0];return[Math.hypot(t,o)]}case"fma":{if(typeof t!="number"||e.length<2)return[null];let o=p(t,e[0],n)[0],u=p(t,e[1],n)[0];return[t*o+u]}case"copysign":{if(typeof t!="number"||e.length===0)return[null];let o=p(t,e[0],n)[0];return[Math.sign(o)*Math.abs(t)]}case"drem":case"remainder":{if(typeof t!="number"||e.length===0)return[null];let o=p(t,e[0],n)[0];return[t-Math.round(t/o)*o]}case"fdim":{if(typeof t!="number"||e.length===0)return[null];let o=p(t,e[0],n)[0];return[Math.max(0,t-o)]}case"fmax":{if(typeof t!="number"||e.length===0)return[null];let o=p(t,e[0],n)[0];return[Math.max(t,o)]}case"fmin":{if(typeof t!="number"||e.length===0)return[null];let o=p(t,e[0],n)[0];return[Math.min(t,o)]}case"ldexp":{if(typeof t!="number"||e.length===0)return[null];let o=p(t,e[0],n)[0];return[t*2**o]}case"scalbn":case"scalbln":{if(typeof t!="number"||e.length===0)return[null];let o=p(t,e[0],n)[0];return[t*2**o]}case"nearbyint":return typeof t=="number"?[Math.round(t)]:[null];case"logb":return typeof t=="number"?[Math.floor(Math.log2(Math.abs(t)))]:[null];case"significand":if(typeof t=="number"){let o=Math.floor(Math.log2(Math.abs(t)));return[t/2**o]}return[null];case"frexp":if(typeof t=="number"){if(t===0)return[[0,0]];let o=Math.floor(Math.log2(Math.abs(t)))+1;return[[t/2**o,o]]}return[null];case"modf":if(typeof t=="number"){let o=Math.trunc(t);return[[t-o,o]]}return[null];default:return null}}function nt(t,r,e,n,p,o,u,c){switch(r){case"recurse":{if(e.length===0){let y=[],l=m=>{if(y.push(m),Array.isArray(m))for(let b of m)l(b);else if(m&&typeof m=="object")for(let b of Object.keys(m))l(m[b])};return l(t),y}let s=[],f=e.length>=2?e[1]:null,i=1e4,h=0,a=y=>{if(h++>i||f&&!p(y,f,n).some(o))return;s.push(y);let l=p(y,e[0],n);for(let m of l)m!=null&&a(m)};return a(t),s}case"recurse_down":return c(t,"recurse",e,n);case"walk":{if(e.length===0)return[t];let s=new WeakSet,f=i=>{if(i&&typeof i=="object"){if(s.has(i))return i;s.add(i)}let h;if(Array.isArray(i))h=i.map(f);else if(i&&typeof i=="object"){let y=Object.create(null);for(let[l,m]of Object.entries(i))g(l)&&A(y,l,f(m));h=y}else h=i;return p(h,e[0],n)[0]};return[f(t)]}case"transpose":{if(!Array.isArray(t))return[null];if(t.length===0)return[[]];let s=Math.max(...t.map(i=>Array.isArray(i)?i.length:0)),f=[];for(let i=0;i<s;i++)f.push(t.map(h=>Array.isArray(h)?h[i]:null));return[f]}case"combinations":{if(e.length>0){let h=p(t,e[0],n)[0];if(!Array.isArray(t)||h<0)return[];if(h===0)return[[]];let a=[],y=(l,m)=>{if(m===h){a.push([...l]);return}for(let b of t)l.push(b),y(l,m+1),l.pop()};return y([],0),a}if(!Array.isArray(t))return[];if(t.length===0)return[[]];for(let i of t)if(!Array.isArray(i))return[];let s=[],f=(i,h)=>{if(i===t.length){s.push([...h]);return}let a=t[i];for(let y of a)h.push(y),f(i+1,h),h.pop()};return f(0,[]),s}case"parent":{if(n.root===void 0||n.currentPath===void 0)return[];let s=n.currentPath;if(s.length===0)return[];let f=e.length>0?p(t,e[0],n)[0]:1;if(f>=0){if(f>s.length)return[];let i=s.slice(0,s.length-f);return[u(n.root,i)]}else{let i=-f-1;if(i>=s.length)return[t];let h=s.slice(0,i);return[u(n.root,h)]}}case"parents":{if(n.root===void 0||n.currentPath===void 0)return[[]];let s=n.currentPath,f=[];for(let i=s.length-1;i>=0;i--)f.push(u(n.root,s.slice(0,i)));return[f]}case"root":return n.root!==void 0?[n.root]:[];default:return null}}var Nt=2e3;function st(t,r,e,n,p){switch(r){case"keys":return Array.isArray(t)?[t.map((o,u)=>u)]:t&&typeof t=="object"?[Object.keys(t).sort()]:[null];case"keys_unsorted":return Array.isArray(t)?[t.map((o,u)=>u)]:t&&typeof t=="object"?[Object.keys(t)]:[null];case"length":return typeof t=="string"?[t.length]:Array.isArray(t)?[t.length]:t&&typeof t=="object"?[Object.keys(t).length]:t===null?[0]:typeof t=="number"?[Math.abs(t)]:[null];case"utf8bytelength":{if(typeof t=="string")return[new TextEncoder().encode(t).length];let o=t===null?"null":Array.isArray(t)?"array":typeof t,u=o==="array"||o==="object"?JSON.stringify(t):String(t);throw new Error(`${o} (${u}) only strings have UTF-8 byte length`)}case"to_entries":{let o=E(t);return o?[Object.entries(o).map(([u,c])=>({key:u,value:c}))]:[null]}case"from_entries":if(Array.isArray(t)){let o=Object.create(null);for(let u of t){let c=E(u);if(c){let s=c.key??c.Key??c.name??c.Name??c.k,f=c.value??c.Value??c.v;if(s!==void 0){let i=String(s);g(i)&&A(o,i,f)}}}return[o]}return[null];case"with_entries":{if(e.length===0)return[t];let o=E(t);if(o){let c=Object.entries(o).map(([f,i])=>({key:f,value:i})).flatMap(f=>p(f,e[0],n)),s=Object.create(null);for(let f of c){let i=E(f);if(i){let h=i.key??i.name??i.k,a=i.value??i.v;if(h!==void 0){let y=String(h);g(y)&&A(s,y,a)}}}return[s]}return[null]}case"reverse":return Array.isArray(t)?[[...t].reverse()]:typeof t=="string"?[t.split("").reverse().join("")]:[null];case"flatten":return Array.isArray(t)?(e.length>0?p(t,e[0],n):[Number.POSITIVE_INFINITY]).map(u=>{let c=u;if(c<0)throw new Error("flatten depth must not be negative");return t.flat(c)}):[null];case"unique":if(Array.isArray(t)){let o=new Set,u=[];for(let c of t){let s=JSON.stringify(c);o.has(s)||(o.add(s),u.push(c))}return[u]}return[null];case"tojson":case"tojsonstream":{let o=n.limits.maxDepth??Nt;return D(t,o+1)>o?[null]:[JSON.stringify(t)]}case"fromjson":{if(typeof t=="string"){let o=t.trim().toLowerCase();if(o==="nan")return[Number.NaN];if(o==="inf"||o==="infinity")return[Number.POSITIVE_INFINITY];if(o==="-inf"||o==="-infinity")return[Number.NEGATIVE_INFINITY];try{return[at(JSON.parse(t))]}catch{throw new Error(`Invalid JSON: ${t}`)}}return[t]}case"tostring":return typeof t=="string"?[t]:[JSON.stringify(t)];case"tonumber":if(typeof t=="number")return[t];if(typeof t=="string"){let o=Number(t);if(Number.isNaN(o))throw new Error(`${JSON.stringify(t)} cannot be parsed as a number`);return[o]}throw new Error(`${typeof t} cannot be parsed as a number`);case"toboolean":{if(typeof t=="boolean")return[t];if(typeof t=="string"){if(t==="true")return[!0];if(t==="false")return[!1];throw new Error(`string (${JSON.stringify(t)}) cannot be parsed as a boolean`)}let o=t===null?"null":Array.isArray(t)?"array":typeof t,u=o==="array"||o==="object"?JSON.stringify(t):String(t);throw new Error(`${o} (${u}) cannot be parsed as a boolean`)}case"tostream":{let o=[],u=(c,s)=>{if(c===null||typeof c!="object")o.push([s,c]);else if(Array.isArray(c))if(c.length===0)o.push([s,[]]);else for(let f=0;f<c.length;f++)u(c[f],[...s,f]);else{let f=Object.keys(c);if(f.length===0)o.push([s,Object.create(null)]);else for(let i of f)u(c[i],[...s,i])}};return u(t,[]),o.push([[]]),o}case"fromstream":{if(e.length===0)return[t];let o=p(t,e[0],n),u=null;for(let c of o){if(!Array.isArray(c)||c.length===1&&Array.isArray(c[0])&&c[0].length===0||c.length!==2)continue;let[s,f]=c;if(!Array.isArray(s))continue;if(s.length===0){u=f;continue}u===null&&(u=typeof s[0]=="number"?[]:Object.create(null));let i=u;for(let a=0;a<s.length-1;a++){let y=s[a],l=s[a+1];if(Array.isArray(i)&&typeof y=="number"){for(;i.length<=y;)i.push(null);i[y]===null&&(i[y]=typeof l=="number"?[]:Object.create(null)),i=i[y]}else{let m=E(i);if(m){let b=String(y);if(!g(b))continue;(m[b]===null||m[b]===void 0)&&A(m,b,typeof l=="number"?[]:Object.create(null)),i=m[b]}}}let h=s[s.length-1];if(Array.isArray(i)&&typeof h=="number"){for(;i.length<=h;)i.push(null);i[h]=f}else{let a=E(i);if(a){let y=String(h);g(y)&&A(a,y,f)}}}return[u]}case"truncate_stream":{let o=typeof t=="number"?Math.floor(t):0;if(e.length===0)return[];let u=[],c=p(t,e[0],n);for(let s of c)if(Array.isArray(s)){if(s.length===1&&Array.isArray(s[0])){let f=s[0];f.length>o&&u.push([f.slice(o)]);continue}if(s.length===2&&Array.isArray(s[0])){let f=s[0],i=s[1];f.length>o&&u.push([f.slice(o),i])}}return u}default:return null}}function it(t,r,e,n,p,o,u,c,s,f){switch(r){case"getpath":{if(e.length===0)return[null];let i=p(t,e[0],n),h=[];for(let a of i){let y=a,l=t;for(let m of y){if(l==null){l=null;break}if(Array.isArray(l)&&typeof m=="number")l=l[m];else if(typeof m=="string"){let b=E(l);if(!b||!Object.hasOwn(b,m)){l=null;break}l=b[m]}else{l=null;break}}h.push(l)}return h}case"setpath":{if(e.length<2)return[null];let h=p(t,e[0],n)[0],y=p(t,e[1],n)[0];return[u(t,h,y)]}case"delpaths":{if(e.length===0)return[t];let h=p(t,e[0],n)[0],a=t;for(let y of h.sort((l,m)=>m.length-l.length))a=c(a,y);return[a]}case"path":{if(e.length===0)return[[]];let i=[];return f(t,e[0],n,[],i),i}case"del":return e.length===0?[t]:[s(t,e[0],n)];case"pick":{if(e.length===0)return[null];let i=[];for(let a of e)f(t,a,n,[],i);let h=null;for(let a of i){for(let l of a)if(typeof l=="number"&&l<0)throw new Error("Out of bounds negative array index");let y=t;for(let l of a){if(y==null)break;if(Array.isArray(y)&&typeof l=="number")y=y[l];else if(typeof l=="string"){let m=E(y);if(!m||!Object.hasOwn(m,l)){y=null;break}y=m[l]}else{y=null;break}}h=u(h,a,y)}return[h]}case"paths":{let i=[],h=(a,y)=>{if(a&&typeof a=="object")if(Array.isArray(a))for(let l=0;l<a.length;l++)i.push([...y,l]),h(a[l],[...y,l]);else for(let l of Object.keys(a))i.push([...y,l]),h(a[l],[...y,l])};return h(t,[]),e.length>0?i.filter(a=>{let y=t;for(let m of a)if(Array.isArray(y)&&typeof m=="number")y=y[m];else if(typeof m=="string"){let b=E(y);if(!b||!Object.hasOwn(b,m))return!1;y=b[m]}else return!1;return p(y,e[0],n).some(o)}):i}case"leaf_paths":{let i=[],h=(a,y)=>{if(a===null||typeof a!="object")i.push(y);else if(Array.isArray(a))for(let l=0;l<a.length;l++)h(a[l],[...y,l]);else for(let l of Object.keys(a))h(a[l],[...y,l])};return h(t,[]),i}default:return null}}function ot(t,r,e,n,p,o){switch(r){case"IN":{if(e.length===0)return[!1];if(e.length===1){let f=p(t,e[0],n);for(let i of f)if(o(t,i))return[!0];return[!1]}let u=p(t,e[0],n),c=p(t,e[1],n),s=new Set(c.map(f=>JSON.stringify(f)));for(let f of u)if(s.has(JSON.stringify(f)))return[!0];return[!1]}case"INDEX":{if(e.length===0)return[Object.create(null)];if(e.length===1){let s=p(t,e[0],n),f=Object.create(null);for(let i of s){let h=String(i);g(h)&&A(f,h,i)}return[f]}if(e.length===2){let s=p(t,e[0],n),f=Object.create(null);for(let i of s){let h=p(i,e[1],n);if(h.length>0){let a=String(h[0]);g(a)&&A(f,a,i)}}return[f]}let u=p(t,e[0],n),c=Object.create(null);for(let s of u){let f=p(s,e[1],n),i=p(s,e[2],n);if(f.length>0&&i.length>0){let h=String(f[0]);g(h)&&A(c,h,i[0])}}return[c]}case"JOIN":{if(e.length<2)return[null];let u=E(p(t,e[0],n)[0]);if(!u)return[null];if(!Array.isArray(t))return[null];let c=[];for(let s of t){let f=p(s,e[1],n),i=f.length>0?String(f[0]):"",h=T(u,i)?u[i]:null;c.push([s,h])}return[c]}default:return null}}function ft(t,r,e,n,p){switch(r){case"join":{if(!Array.isArray(t))return[null];let o=e.length>0?p(t,e[0],n):[""];for(let u of t)if(Array.isArray(u)||u!==null&&typeof u=="object")throw new Error("cannot join: contains arrays or objects");return o.map(u=>t.map(c=>c===null?"":typeof c=="string"?c:String(c)).join(String(u)))}case"split":{if(typeof t!="string"||e.length===0)return[null];let o=p(t,e[0],n),u=String(o[0]);return[t.split(u)]}case"splits":{if(typeof t!="string"||e.length===0)return[];let o=p(t,e[0],n),u=String(o[0]);try{let c=e.length>1?String(p(t,e[1],n)[0]):"g";return R(u,c.includes("g")?c:`${c}g`).split(t)}catch{return[]}}case"scan":{if(typeof t!="string"||e.length===0)return[];let o=p(t,e[0],n),u=String(o[0]);try{let c=e.length>1?String(p(t,e[1],n)[0]):"";return[...R(u,c.includes("g")?c:`${c}g`).matchAll(t)].map(i=>i.length>1?i.slice(1):i[0])}catch{return[]}}case"test":{if(typeof t!="string"||e.length===0)return[!1];let o=p(t,e[0],n),u=String(o[0]);try{let c=e.length>1?String(p(t,e[1],n)[0]):"";return[R(u,c).test(t)]}catch{return[!1]}}case"match":{if(typeof t!="string"||e.length===0)return[null];let o=p(t,e[0],n),u=String(o[0]);try{let c=e.length>1?String(p(t,e[1],n)[0]):"",f=R(u,`${c}d`).exec(t);if(!f)return[];let i=f.indices;return[{offset:f.index,length:f[0].length,string:f[0],captures:f.slice(1).map((h,a)=>({offset:i?.[a+1]?.[0]??null,length:h?.length??0,string:h??"",name:null}))}]}catch{return[null]}}case"capture":{if(typeof t!="string"||e.length===0)return[null];let o=p(t,e[0],n),u=String(o[0]);try{let c=e.length>1?String(p(t,e[1],n)[0]):"",f=R(u,c).match(t);return!f||!f.groups?[Object.create(null)]:[f.groups]}catch{return[null]}}case"sub":{if(typeof t!="string"||e.length<2)return[null];let o=p(t,e[0],n),u=p(t,e[1],n),c=String(o[0]),s=String(u[0]);try{let f=e.length>2?String(p(t,e[2],n)[0]):"";return[R(c,f).replace(t,s)]}catch{return[t]}}case"gsub":{if(typeof t!="string"||e.length<2)return[null];let o=p(t,e[0],n),u=p(t,e[1],n),c=String(o[0]),s=String(u[0]);try{let f=e.length>2?String(p(t,e[2],n)[0]):"g",i=f.includes("g")?f:`${f}g`;return[R(c,i).replace(t,s)]}catch{return[t]}}case"ascii_downcase":return typeof t=="string"?[t.replace(/[A-Z]/g,o=>String.fromCharCode(o.charCodeAt(0)+32))]:[null];case"ascii_upcase":return typeof t=="string"?[t.replace(/[a-z]/g,o=>String.fromCharCode(o.charCodeAt(0)-32))]:[null];case"ltrimstr":{if(typeof t!="string"||e.length===0)return[t];let o=p(t,e[0],n),u=String(o[0]);return[t.startsWith(u)?t.slice(u.length):t]}case"rtrimstr":{if(typeof t!="string"||e.length===0)return[t];let o=p(t,e[0],n),u=String(o[0]);return u===""?[t]:[t.endsWith(u)?t.slice(0,-u.length):t]}case"trimstr":{if(typeof t!="string"||e.length===0)return[t];let o=p(t,e[0],n),u=String(o[0]);if(u==="")return[t];let c=t;return c.startsWith(u)&&(c=c.slice(u.length)),c.endsWith(u)&&(c=c.slice(0,-u.length)),[c]}case"trim":if(typeof t=="string")return[t.trim()];throw new Error("trim input must be a string");case"ltrim":if(typeof t=="string")return[t.trimStart()];throw new Error("trim input must be a string");case"rtrim":if(typeof t=="string")return[t.trimEnd()];throw new Error("trim input must be a string");case"startswith":{if(typeof t!="string"||e.length===0)return[!1];let o=p(t,e[0],n);return[t.startsWith(String(o[0]))]}case"endswith":{if(typeof t!="string"||e.length===0)return[!1];let o=p(t,e[0],n);return[t.endsWith(String(o[0]))]}case"ascii":return typeof t=="string"&&t.length>0?[t.charCodeAt(0)]:[null];case"explode":return typeof t=="string"?[Array.from(t).map(o=>o.codePointAt(0))]:[null];case"implode":if(!Array.isArray(t))throw new Error("implode input must be an array");return[t.map(c=>{if(typeof c=="string")throw new Error(`string (${JSON.stringify(c)}) can't be imploded, unicode codepoint needs to be numeric`);if(typeof c!="number"||Number.isNaN(c))throw new Error("number (null) can't be imploded, unicode codepoint needs to be numeric");let s=Math.trunc(c);return s<0||s>1114111||s>=55296&&s<=57343?String.fromCodePoint(65533):String.fromCodePoint(s)}).join("")];default:return null}}function ct(t,r){switch(r){case"type":return t===null?["null"]:Array.isArray(t)?["array"]:typeof t=="boolean"?["boolean"]:typeof t=="number"?["number"]:typeof t=="string"?["string"]:typeof t=="object"?["object"]:["null"];case"infinite":return[Number.POSITIVE_INFINITY];case"nan":return[Number.NaN];case"isinfinite":return[typeof t=="number"&&!Number.isFinite(t)];case"isnan":return[typeof t=="number"&&Number.isNaN(t)];case"isnormal":return[typeof t=="number"&&Number.isFinite(t)&&t!==0];case"isfinite":return[typeof t=="number"&&Number.isFinite(t)];case"numbers":return typeof t=="number"?[t]:[];case"strings":return typeof t=="string"?[t]:[];case"booleans":return typeof t=="boolean"?[t]:[];case"nulls":return t===null?[t]:[];case"arrays":return Array.isArray(t)?[t]:[];case"objects":return t&&typeof t=="object"&&!Array.isArray(t)?[t]:[];case"iterables":return Array.isArray(t)||t&&typeof t=="object"&&!Array.isArray(t)?[t]:[];case"scalars":return!Array.isArray(t)&&!(t&&typeof t=="object")?[t]:[];case"values":return t===null?[]:[t];case"not":return t===!1||t===null?[!0]:[!1];case"null":return[null];case"true":return[!0];case"false":return[!1];case"empty":return[];default:return null}}function K(t,r,e){if(r.length===0)return e;let[n,...p]=r;if(typeof n=="number"){if(t&&typeof t=="object"&&!Array.isArray(t))throw new Error("Cannot index object with number");if(n>536870911)throw new Error("Array index too large");if(n<0)throw new Error("Out of bounds negative array index");let f=Array.isArray(t)?[...t]:[];for(;f.length<=n;)f.push(null);return f[n]=K(f[n],p,e),f}if(Array.isArray(t))throw new Error("Cannot index array with string");if(!g(n))return t??Object.create(null);let o=E(t),u=o?O(o):Object.create(null),c=Object.hasOwn(u,n)?u[n]:void 0;return A(u,n,K(c,p,e)),u}function V(t,r){if(r.length===0)return null;if(r.length===1){let p=r[0];if(Array.isArray(t)&&typeof p=="number"){let o=[...t];return o.splice(p,1),o}if(t&&typeof t=="object"&&!Array.isArray(t)){let o=String(p);if(!g(o))return t;let u=O(t);return delete u[o],u}return t}let[e,...n]=r;if(Array.isArray(t)&&typeof e=="number"){let p=[...t];return p[e]=V(p[e],n),p}if(t&&typeof t=="object"&&!Array.isArray(t)){let p=String(e);if(!g(p))return t;let o=O(t);return Object.hasOwn(o,p)&&A(o,p,V(o[p],n)),o}return t}var P=class t extends Error{label;partialResults;constructor(r,e=[]){super(`break ${r}`),this.label=r,this.partialResults=e,this.name="BreakError"}withPrependedResults(r){return new t(this.label,[...r,...this.partialResults])}},H=class extends Error{value;constructor(r){super(typeof r=="string"?r:JSON.stringify(r)),this.value=r,this.name="JqError"}},St=1e4,bt=2e3,Ct=new Map([["floor",Math.floor],["ceil",Math.ceil],["round",Math.round],["sqrt",Math.sqrt],["log",Math.log],["log10",Math.log10],["log2",Math.log2],["exp",Math.exp],["sin",Math.sin],["cos",Math.cos],["tan",Math.tan],["asin",Math.asin],["acos",Math.acos],["atan",Math.atan],["sinh",Math.sinh],["cosh",Math.cosh],["tanh",Math.tanh],["asinh",Math.asinh],["acosh",Math.acosh],["atanh",Math.atanh],["cbrt",Math.cbrt],["expm1",Math.expm1],["log1p",Math.log1p],["trunc",Math.trunc]]);function Tt(t){return{vars:new Map,limits:{maxIterations:t?.limits?.maxIterations??St,maxDepth:t?.limits?.maxDepth??bt},env:t?.env,coverage:t?.coverage,requireDefenseContext:t?.requireDefenseContext,defenseContextChecked:!1}}function q(t,r,e){let n=new Map(t.vars);return n.set(r,e),{vars:n,limits:t.limits,env:t.env,requireDefenseContext:t.requireDefenseContext,defenseContextChecked:t.defenseContextChecked,root:t.root,currentPath:t.currentPath,funcs:t.funcs,labels:t.labels,coverage:t.coverage}}function L(t,r,e){switch(r.type){case"var":return q(t,r.name,e);case"array":{if(!Array.isArray(e))return null;let n=t;for(let p=0;p<r.elements.length;p++){let o=r.elements[p],u=p<e.length?e[p]:null,c=L(n,o,u);if(c===null)return null;n=c}return n}case"object":{let n=E(e);if(!n)return null;let p=t;for(let o of r.fields){let u;if(typeof o.key=="string")u=o.key;else{let f=d(e,o.key,t);if(f.length===0)return null;u=String(f[0])}let c=T(n,u)?n[u]:null;o.keyVar&&(p=q(p,o.keyVar,c));let s=L(p,o.pattern,c);if(s===null)return null;p=s}return p}}}function Rt(t,r){let e=t;for(let n of r)if(e&&typeof e=="object")if(Array.isArray(e))if(typeof n=="number")e=e[n];else return;else{let p=E(e);if(p&&typeof n=="string"&&Object.hasOwn(p,n))e=p[n];else return}else return;return e}function M(t){if(t.type==="Identity")return[];if(t.type==="Field"){let r=t.base?M(t.base):[];return r===null?null:[...r,t.name]}if(t.type==="Index"&&t.index.type==="Literal"){let r=t.base?M(t.base):[];if(r===null)return null;let e=t.index.value;return typeof e=="number"||typeof e=="string"?[...r,e]:null}if(t.type==="Pipe"){let r=M(t.left);return r===null?null:pt(r,t.right)}if(t.type==="Call"){if(t.name==="parent"||t.name==="root")return null;if(t.name==="first"&&t.args.length===0)return[0];if(t.name==="last"&&t.args.length===0)return[-1]}return null}function pt(t,r){if(r.type==="Call"){if(r.name==="parent"){let e=1;if(r.args.length>0&&r.args[0].type==="Literal"){let n=r.args[0].value;typeof n=="number"&&(e=n)}if(e>=0)return t.slice(0,Math.max(0,t.length-e));{let n=-e-1;return t.slice(0,Math.min(n,t.length))}}if(r.name==="root")return[]}if(r.type==="Field"){let e=M(r);if(e!==null)return[...t,...e]}if(r.type==="Index"&&r.index.type==="Literal"){let e=M(r);if(e!==null)return[...t,...e]}if(r.type==="Pipe"){let e=pt(t,r.left);return e===null?null:pt(e,r.right)}return r.type==="Identity"?t:null}function mt(t,r,e){if(r.type==="Comma"){let n=[];try{n.push(...d(t,r.left,e))}catch(p){if(p instanceof B)throw p;if(n.length>0)return n;throw new Error("evaluation failed")}try{n.push(...d(t,r.right,e))}catch(p){if(p instanceof B)throw p;return n}return n}return d(t,r,e)}function d(t,r,e){let n=e&&"vars"in e?e:Tt(e);switch(n.defenseContextChecked||(yt(n.requireDefenseContext,"query-engine","evaluation"),n={...n,defenseContextChecked:!0}),n.root===void 0&&(n={...n,root:t,currentPath:[]}),n.coverage?.hit(`jq:node:${r.type}`),r.type){case"Identity":return[t];case"Field":return(r.base?d(t,r.base,n):[t]).flatMap(o=>{let u=E(o);if(u){if(!Object.hasOwn(u,r.name))return[null];let s=u[r.name];return[s===void 0?null:s]}if(o===null)return[null];let c=Array.isArray(o)?"array":typeof o;throw new Error(`Cannot index ${c} with string "${r.name}"`)});case"Index":return(r.base?d(t,r.base,n):[t]).flatMap(o=>d(o,r.index,n).flatMap(c=>{if(typeof c=="number"&&Array.isArray(o)){if(Number.isNaN(c))return[null];let s=Math.trunc(c),f=s<0?o.length+s:s;return f>=0&&f<o.length?[o[f]]:[null]}if(typeof c=="string"){let s=E(o);return!s||!Object.hasOwn(s,c)?[null]:[s[c]]}return[null]}));case"Slice":return(r.base?d(t,r.base,n):[t]).flatMap(o=>{if(o===null)return[null];if(!Array.isArray(o)&&typeof o!="string")throw new Error(`Cannot slice ${typeof o} (${JSON.stringify(o)})`);let u=o.length,c=r.start?d(t,r.start,n):[0],s=r.end?d(t,r.end,n):[u];return c.flatMap(f=>s.map(i=>{let h=f,a=i,y=Number.isNaN(h)?0:Number.isInteger(h)?h:Math.floor(h),l=Number.isNaN(a)?u:Number.isInteger(a)?a:Math.ceil(a),m=dt(y,u),b=dt(l,u);return Array.isArray(o),o.slice(m,b)}))});case"Iterate":return(r.base?d(t,r.base,n):[t]).flatMap(o=>Array.isArray(o)?o:o&&typeof o=="object"?Object.values(o):[]);case"Pipe":{let p=d(t,r.left,n),o=M(r.left),u=[];for(let c of p)try{if(o!==null){let s={...n,currentPath:[...n.currentPath??[],...o]};u.push(...d(c,r.right,s))}else u.push(...d(c,r.right,n))}catch(s){throw s instanceof P?s.withPrependedResults(u):s}return u}case"Comma":{let p=d(t,r.left,n),o=d(t,r.right,n);return[...p,...o]}case"Literal":return[r.value];case"Array":return r.elements?[d(t,r.elements,n)]:[[]];case"Object":{let p=[Object.create(null)];for(let o of r.entries){let u=typeof o.key=="string"?[o.key]:d(t,o.key,n),c=d(t,o.value,n),s=[];for(let f of p)for(let i of u){if(typeof i!="string"){let h=i===null?"null":Array.isArray(i)?"array":typeof i;throw new Error(`Cannot use ${h} (${JSON.stringify(i)}) as object key`)}if(!g(i)){for(let h of c)s.push(O(f));continue}for(let h of c){let a=O(f);A(a,i,h),s.push(a)}}p.length=0,p.push(...s)}return p}case"Paren":return d(t,r.expr,n);case"BinaryOp":return xt(t,r.op,r.left,r.right,n);case"UnaryOp":return d(t,r.operand,n).map(o=>{if(r.op==="-"){if(typeof o=="number")return-o;if(typeof o=="string"){let u=c=>c.length>5?`"${c.slice(0,3)}...`:JSON.stringify(c);throw new Error(`string (${u(o)}) cannot be negated`)}return null}return r.op==="not"?!S(o):null});case"Cond":return d(t,r.cond,n).flatMap(o=>{if(S(o))return d(t,r.then,n);for(let u of r.elifs)if(d(t,u.cond,n).some(S))return d(t,u.then,n);return r.else?d(t,r.else,n):[t]});case"Try":try{return d(t,r.body,n)}catch(p){if(r.catch){let o=p instanceof H?p.value:p instanceof Error?p.message:String(p);return d(o,r.catch,n)}return[]}case"Call":return gt(t,r.name,r.args,n);case"VarBind":return d(t,r.value,n).flatMap(o=>{let u=null,c=[];r.pattern?c.push(r.pattern):r.name&&c.push({type:"var",name:r.name}),r.alternatives&&c.push(...r.alternatives);for(let s of c)if(u=L(n,s,o),u!==null)break;return u===null?[]:d(t,r.body,u)});case"VarRef":{if(r.name==="$ENV")return[n.env?X(n.env):Object.create(null)];let p=n.vars.get(r.name);return p!==void 0?[p]:[null]}case"Recurse":{let p=[],o=new WeakSet,u=c=>{if(c&&typeof c=="object"){if(o.has(c))return;o.add(c)}if(p.push(c),Array.isArray(c))for(let s of c)u(s);else if(c&&typeof c=="object")for(let s of Object.keys(c))u(c[s])};return u(t),p}case"Optional":try{return d(t,r.expr,n)}catch{return[]}case"StringInterp":return[r.parts.map(o=>typeof o=="string"?o:d(t,o,n).map(c=>typeof c=="string"?c:JSON.stringify(c)).join("")).join("")];case"UpdateOp":return[Mt(t,r.path,r.op,r.value,n)];case"Reduce":{let p=d(t,r.expr,n),o=d(t,r.init,n)[0],u=n.limits.maxDepth??bt;for(let c of p){let s;if(r.pattern){if(s=L(n,r.pattern,c),s===null)continue}else s=q(n,r.varName,c);if(o=d(o,r.update,s)[0],D(o,u+1)>u)return[null]}return[o]}case"Foreach":{let p=d(t,r.expr,n),o=d(t,r.init,n)[0],u=[];for(let c of p)try{let s;if(r.pattern){if(s=L(n,r.pattern,c),s===null)continue}else s=q(n,r.varName,c);if(o=d(o,r.update,s)[0],r.extract){let f=d(o,r.extract,s);u.push(...f)}else u.push(o)}catch(s){throw s instanceof P?s.withPrependedResults(u):s}return u}case"Label":try{return d(t,r.body,{...n,labels:new Set([...n.labels??[],r.name])})}catch(p){if(p instanceof P&&p.label===r.name)return p.partialResults;throw p}case"Break":throw new P(r.name);case"Def":{let p=new Map(n.funcs??[]),o=`${r.name}/${r.params.length}`;p.set(o,{params:r.params,body:r.funcBody,closure:new Map(n.funcs??[])});let u={...n,funcs:p};return d(t,r.body,u)}default:{let p=r;throw new Error(`Unknown AST node type: ${p.type}`)}}}function dt(t,r){return t<0?Math.max(0,r+t):Math.min(t,r)}function Mt(t,r,e,n,p){function o(s,f){switch(e){case"=":return f;case"|=":return d(s,n,p)[0]??null;case"+=":return typeof s=="number"&&typeof f=="number"||typeof s=="string"&&typeof f=="string"?s+f:Array.isArray(s)&&Array.isArray(f)?[...s,...f]:s&&f&&typeof s=="object"&&typeof f=="object"?G(s,f):f;case"-=":return typeof s=="number"&&typeof f=="number"?s-f:s;case"*=":return typeof s=="number"&&typeof f=="number"?s*f:s;case"/=":return typeof s=="number"&&typeof f=="number"?s/f:s;case"%=":return typeof s=="number"&&typeof f=="number"?s%f:s;case"//=":return s===null||s===!1?f:s;default:return f}}function u(s,f,i){switch(f.type){case"Identity":return i(s);case"Field":{if(!g(f.name))return s;if(f.base)return u(s,f.base,h=>{if(h&&typeof h=="object"&&!Array.isArray(h)){let a=O(h),y=Object.hasOwn(a,f.name)?a[f.name]:void 0;return A(a,f.name,i(y)),a}return h});if(s&&typeof s=="object"&&!Array.isArray(s)){let h=O(s),a=Object.hasOwn(h,f.name)?h[f.name]:void 0;return A(h,f.name,i(a)),h}return s}case"Index":{let a=d(t,f.index,p)[0];if(typeof a=="number"&&Number.isNaN(a))throw new Error("Cannot set array element at NaN index");if(typeof a=="number"&&!Number.isInteger(a)&&(a=Math.trunc(a)),f.base)return u(s,f.base,y=>{if(typeof a=="number"&&Array.isArray(y)){let l=[...y],m=a<0?l.length+a:a;if(m>=0){for(;l.length<=m;)l.push(null);l[m]=i(l[m])}return l}if(typeof a=="string"&&y&&typeof y=="object"&&!Array.isArray(y)){if(!g(a))return y;let l=O(y),m=Object.hasOwn(l,a)?l[a]:void 0;return A(l,a,i(m)),l}return y});if(typeof a=="number"){if(a>536870911)throw new Error("Array index too large");if(a<0&&(!s||!Array.isArray(s)))throw new Error("Out of bounds negative array index");if(Array.isArray(s)){let l=[...s],m=a<0?l.length+a:a;if(m>=0){for(;l.length<=m;)l.push(null);l[m]=i(l[m])}return l}if(s==null){let l=[];for(;l.length<=a;)l.push(null);return l[a]=i(null),l}return s}if(typeof a=="string"&&s&&typeof s=="object"&&!Array.isArray(s)){if(!g(a))return s;let y=O(s),l=Object.hasOwn(y,a)?y[a]:void 0;return A(y,a,i(l)),y}return s}case"Iterate":{let h=a=>{if(Array.isArray(a))return a.map(y=>i(y));if(a&&typeof a=="object"){let y=Object.create(null);for(let[l,m]of Object.entries(a))g(l)&&A(y,l,i(m));return y}return a};return f.base?u(s,f.base,h):h(s)}case"Pipe":{let h=u(s,f.left,a=>a);return u(h,f.right,i)}default:return i(s)}}return u(t,r,s=>{if(e==="|=")return o(s,s);let f=d(t,n,p);return o(s,f[0]??null)})}function jt(t,r,e){function n(o,u,c){switch(u.type){case"Identity":return c;case"Field":{if(!g(u.name))return o;if(u.base){let s=d(o,u.base,e)[0],f=n(s,{type:"Field",name:u.name},c);return n(o,u.base,f)}if(o&&typeof o=="object"&&!Array.isArray(o)){let s=O(o);return A(s,u.name,c),s}return o}case"Index":{if(u.base){let i=d(o,u.base,e)[0],h=n(i,{type:"Index",index:u.index},c);return n(o,u.base,h)}let f=d(t,u.index,e)[0];if(typeof f=="number"&&Array.isArray(o)){let i=[...o],h=f<0?i.length+f:f;return h>=0&&h<i.length&&(i[h]=c),i}if(typeof f=="string"&&o&&typeof o=="object"&&!Array.isArray(o)){if(!g(f))return o;let i=O(o);return A(i,f,c),i}return o}default:return o}}function p(o,u){switch(u.type){case"Identity":return null;case"Field":{if(!g(u.name))return o;if(u.base){let s=d(o,u.base,e)[0];if(s==null)return o;let f=p(s,{type:"Field",name:u.name});return n(o,u.base,f)}if(o&&typeof o=="object"&&!Array.isArray(o)){if(!g(u.name))return o;let s=O(o);return delete s[u.name],s}return o}case"Index":{if(u.base){let i=d(o,u.base,e)[0];if(i==null)return o;let h=p(i,{type:"Index",index:u.index});return n(o,u.base,h)}let f=d(t,u.index,e)[0];if(typeof f=="number"&&Array.isArray(o)){let i=[...o],h=f<0?i.length+f:f;return h>=0&&h<i.length&&i.splice(h,1),i}if(typeof f=="string"&&o&&typeof o=="object"&&!Array.isArray(o)){if(!g(f))return o;let i=O(o);return delete i[f],i}return o}case"Iterate":return Array.isArray(o)?[]:o&&typeof o=="object"?Object.create(null):o;case"Pipe":{let i=function(y,l,m){switch(l.type){case"Identity":return m;case"Field":{if(!g(l.name))return y;if(y&&typeof y=="object"&&!Array.isArray(y)){let b=O(y);return A(b,l.name,m),b}return y}case"Index":{let w=d(t,l.index,e)[0];if(typeof w=="number"&&Array.isArray(y)){let k=[...y],N=w<0?k.length+w:w;return N>=0&&N<k.length&&(k[N]=m),k}if(typeof w=="string"&&y&&typeof y=="object"&&!Array.isArray(y)){if(!g(w))return y;let k=O(y);return A(k,w,m),k}return y}case"Pipe":{let b=d(y,l.left,e)[0],w=i(b,l.right,m);return i(y,l.left,w)}default:return y}};var c=i;let s=u.left,f=u.right,h=d(o,s,e)[0];if(h==null)return o;let a=p(h,f);return i(o,s,a)}default:return o}}return p(t,r)}function xt(t,r,e,n,p){if(r==="and")return d(t,e,p).flatMap(s=>S(s)?d(t,n,p).map(i=>S(i)):[!1]);if(r==="or")return d(t,e,p).flatMap(s=>S(s)?[!0]:d(t,n,p).map(i=>S(i)));if(r==="//"){let s=d(t,e,p).filter(f=>f!=null&&f!==!1);return s.length>0?s:d(t,n,p)}let o=d(t,e,p),u=d(t,n,p);return o.flatMap(c=>u.map(s=>{switch(r){case"+":return c===null?s:s===null?c:typeof c=="number"&&typeof s=="number"||typeof c=="string"&&typeof s=="string"?c+s:Array.isArray(c)&&Array.isArray(s)?[...c,...s]:c&&s&&typeof c=="object"&&typeof s=="object"&&!Array.isArray(c)&&!Array.isArray(s)?G(c,s):null;case"-":if(typeof c=="number"&&typeof s=="number")return c-s;if(Array.isArray(c)&&Array.isArray(s)){let f=new Set(s.map(i=>JSON.stringify(i)));return c.filter(i=>!f.has(JSON.stringify(i)))}if(typeof c=="string"&&typeof s=="string"){let f=i=>i.length>10?`"${i.slice(0,10)}...`:JSON.stringify(i);throw new Error(`string (${f(c)}) and string (${f(s)}) cannot be subtracted`)}return null;case"*":if(typeof c=="number"&&typeof s=="number")return c*s;if(typeof c=="string"&&typeof s=="number")return c.repeat(s);{let f=E(c),i=E(s);if(f&&i)return v(f,i)}return null;case"/":if(typeof c=="number"&&typeof s=="number"){if(s===0)throw new Error(`number (${c}) and number (${s}) cannot be divided because the divisor is zero`);return c/s}return typeof c=="string"&&typeof s=="string"?c.split(s):null;case"%":if(typeof c=="number"&&typeof s=="number"){if(s===0)throw new Error(`number (${c}) and number (${s}) cannot be divided (remainder) because the divisor is zero`);return!Number.isFinite(c)&&!Number.isNaN(c)?!Number.isFinite(s)&&!Number.isNaN(s)&&c<0&&s>0?-1:0:c%s}return null;case"==":return I(c,s);case"!=":return!I(c,s);case"<":return U(c,s)<0;case"<=":return U(c,s)<=0;case">":return U(c,s)>0;case">=":return U(c,s)>=0;default:return null}}))}function gt(t,r,e,n){let p=Ct.get(r);if(p)return typeof t=="number"?[p(t)]:[null];let o=rt(t,r,e,n,d);if(o!==null)return o;let u=ft(t,r,e,n,d);if(u!==null)return u;let c=Z(t,r,e,n,d);if(c!==null)return c;let s=tt(t,r,n.limits.maxDepth);if(s!==null)return s;let f=ct(t,r);if(f!==null)return f;let i=st(t,r,e,n,d);if(i!==null)return i;let h=W(t,r,e,n,d,mt,$,S,F,B);if(h!==null)return h;let a=it(t,r,e,n,d,S,K,V,jt,J);if(a!==null)return a;let y=et(t,r,e,n,d,I);if(y!==null)return y;let l=z(t,r,e,n,d,mt,S,B);if(l!==null)return l;let m=nt(t,r,e,n,d,S,Rt,gt);if(m!==null)return m;let b=ot(t,r,e,n,d,I);if(b!==null)return b;switch(r){case"builtins":return[["add/0","all/0","all/1","all/2","any/0","any/1","any/2","arrays/0","ascii/0","ascii_downcase/0","ascii_upcase/0","booleans/0","bsearch/1","builtins/0","combinations/0","combinations/1","contains/1","debug/0","del/1","delpaths/1","empty/0","env/0","error/0","error/1","explode/0","first/0","first/1","flatten/0","flatten/1","floor/0","from_entries/0","fromdate/0","fromjson/0","getpath/1","gmtime/0","group_by/1","gsub/2","gsub/3","has/1","implode/0","IN/1","IN/2","INDEX/1","INDEX/2","index/1","indices/1","infinite/0","inside/1","isempty/1","isnan/0","isnormal/0","isvalid/1","iterables/0","join/1","keys/0","keys_unsorted/0","last/0","last/1","length/0","limit/2","ltrimstr/1","map/1","map_values/1","match/1","match/2","max/0","max_by/1","min/0","min_by/1","mktime/0","modulemeta/1","nan/0","not/0","nth/1","nth/2","null/0","nulls/0","numbers/0","objects/0","path/1","paths/0","paths/1","pick/1","range/1","range/2","range/3","recurse/0","recurse/1","recurse_down/0","repeat/1","reverse/0","rindex/1","rtrimstr/1","scalars/0","scan/1","scan/2","select/1","setpath/2","skip/2","sort/0","sort_by/1","split/1","splits/1","splits/2","sqrt/0","startswith/1","strftime/1","strings/0","strptime/1","sub/2","sub/3","test/1","test/2","to_entries/0","toboolean/0","todate/0","tojson/0","tostream/0","fromstream/1","truncate_stream/1","tonumber/0","tostring/0","transpose/0","trim/0","ltrim/0","rtrim/0","type/0","unique/0","unique_by/1","until/2","utf8bytelength/0","values/0","walk/1","while/2","with_entries/1"]];case"error":{let w=e.length>0?d(t,e[0],n)[0]:t;throw new H(w)}case"env":return[n.env?X(n.env):Object.create(null)];case"debug":return[t];case"input_line_number":return[1];default:{let w=`${r}/${e.length}`,k=n.funcs?.get(w);if(k){let N=k.closure??n.funcs??new Map,C=new Map(N);C.set(w,k);for(let _=0;_<k.params.length;_++){let kt=k.params[_],ht=e[_];if(ht){let j=d(t,ht,n),x;if(j.length===0)x={type:"Call",name:"empty",args:[]};else if(j.length===1)x={type:"Literal",value:j[0]};else{x={type:"Literal",value:j[j.length-1]};for(let Q=j.length-2;Q>=0;Q--)x={type:"Comma",left:{type:"Literal",value:j[Q]},right:x}}C.set(`${kt}/0`,{params:[],body:x})}}let wt={...n,funcs:C};return d(t,k.body,wt)}throw new Error(`Unknown function: ${r}`)}}}function J(t,r,e,n,p){if(r.type==="Comma"){let c=r;J(t,c.left,e,n,p),J(t,c.right,e,n,p);return}let o=M(r);if(o!==null){p.push([...n,...o]);return}if(r.type==="Iterate"){if(Array.isArray(t))for(let c=0;c<t.length;c++)p.push([...n,c]);else if(t&&typeof t=="object")for(let c of Object.keys(t))p.push([...n,c]);return}if(r.type==="Recurse"){let c=(s,f)=>{if(p.push([...n,...f]),s&&typeof s=="object")if(Array.isArray(s))for(let i=0;i<s.length;i++)c(s[i],[...f,i]);else for(let i of Object.keys(s))c(s[i],[...f,i])};c(t,[]);return}if(r.type==="Pipe"){let c=M(r.left);if(c!==null){let s=d(t,r.left,e);for(let f of s)J(f,r.right,e,[...n,...c],p);return}}d(t,r,e).length>0&&p.push(n)}var At=new Map([["and","AND"],["or","OR"],["not","NOT"],["if","IF"],["then","THEN"],["elif","ELIF"],["else","ELSE"],["end","END"],["as","AS"],["try","TRY"],["catch","CATCH"],["true","TRUE"],["false","FALSE"],["null","NULL"],["reduce","REDUCE"],["foreach","FOREACH"],["label","LABEL"],["break","BREAK"],["def","DEF"]]),Y=new Set(At.values());function Et(t){let r=[],e=0,n=(f=0)=>t[e+f],p=()=>t[e++],o=()=>e>=t.length,u=f=>f>="0"&&f<="9",c=f=>f>="a"&&f<="z"||f>="A"&&f<="Z"||f==="_",s=f=>c(f)||u(f);for(;!o();){let f=e,i=p();if(!(i===" "||i===" "||i===`
|
|
3
3
|
`||i==="\r")){if(i==="#"){for(;!o()&&n()!==`
|
|
4
4
|
`;)p();continue}if(i==="."&&n()==="."){p(),r.push({type:"DOTDOT",pos:f});continue}if(i==="="&&n()==="="){p(),r.push({type:"EQ",pos:f});continue}if(i==="!"&&n()==="="){p(),r.push({type:"NE",pos:f});continue}if(i==="<"&&n()==="="){p(),r.push({type:"LE",pos:f});continue}if(i===">"&&n()==="="){p(),r.push({type:"GE",pos:f});continue}if(i==="/"&&n()==="/"){p(),n()==="="?(p(),r.push({type:"UPDATE_ALT",pos:f})):r.push({type:"ALT",pos:f});continue}if(i==="+"&&n()==="="){p(),r.push({type:"UPDATE_ADD",pos:f});continue}if(i==="-"&&n()==="="){p(),r.push({type:"UPDATE_SUB",pos:f});continue}if(i==="*"&&n()==="="){p(),r.push({type:"UPDATE_MUL",pos:f});continue}if(i==="/"&&n()==="="){p(),r.push({type:"UPDATE_DIV",pos:f});continue}if(i==="%"&&n()==="="){p(),r.push({type:"UPDATE_MOD",pos:f});continue}if(i==="="&&n()!=="="){r.push({type:"ASSIGN",pos:f});continue}if(i==="."){r.push({type:"DOT",pos:f});continue}if(i==="|"){n()==="="?(p(),r.push({type:"UPDATE_PIPE",pos:f})):r.push({type:"PIPE",pos:f});continue}if(i===","){r.push({type:"COMMA",pos:f});continue}if(i===":"){r.push({type:"COLON",pos:f});continue}if(i===";"){r.push({type:"SEMICOLON",pos:f});continue}if(i==="("){r.push({type:"LPAREN",pos:f});continue}if(i===")"){r.push({type:"RPAREN",pos:f});continue}if(i==="["){r.push({type:"LBRACKET",pos:f});continue}if(i==="]"){r.push({type:"RBRACKET",pos:f});continue}if(i==="{"){r.push({type:"LBRACE",pos:f});continue}if(i==="}"){r.push({type:"RBRACE",pos:f});continue}if(i==="?"){r.push({type:"QUESTION",pos:f});continue}if(i==="+"){r.push({type:"PLUS",pos:f});continue}if(i==="-"){r.push({type:"MINUS",pos:f});continue}if(i==="*"){r.push({type:"STAR",pos:f});continue}if(i==="/"){r.push({type:"SLASH",pos:f});continue}if(i==="%"){r.push({type:"PERCENT",pos:f});continue}if(i==="<"){r.push({type:"LT",pos:f});continue}if(i===">"){r.push({type:"GT",pos:f});continue}if(u(i)){let h=i;for(;!o()&&(u(n())||n()==="."||n()==="e"||n()==="E");)(n()==="e"||n()==="E")&&(t[e+1]==="+"||t[e+1]==="-")&&(h+=p()),h+=p();r.push({type:"NUMBER",value:Number(h),pos:f});continue}if(i==='"'){let h="";for(;!o()&&n()!=='"';)if(n()==="\\"){if(p(),o())break;let a=p();switch(a){case"n":h+=`
|
|
@@ -28,4 +28,4 @@ When no FILE is given, or when FILE is -, read from standard input.`,options:["-
|
|
|
28
28
|
`,exitCode:1};try{return v(s,I(e)),r.verbose?{stdout:"",stderr:`${t}: OK
|
|
29
29
|
`,exitCode:0}:{stdout:"",stderr:"",exitCode:0}}catch(n){let a=n instanceof Error?n.message:"invalid";return{stdout:"",stderr:`${o}: ${t}: ${a}
|
|
30
30
|
`,exitCode:1}}}async function C(e,t,r){let o=r==="zcat"?D:r==="gunzip"?U:O;if(w(e))return z(o);let s=$(r,e,T);if(!s.ok)return s.error.stderr.includes("unrecognized option"),s.error;let n=s.result.flags,a=s.result.positional,f=r==="gunzip"||r==="zcat"||n.decompress||n.uncompress,p=r==="zcat"||n.stdout||n.toStdout;if(n.list){a.length===0&&(a=["-"]);let l=` compressed uncompressed ratio uncompressed_name
|
|
31
|
-
`,u="",g=0;for(let y of a){let h=await W(t,y,n,r);l+=h.stdout,u+=h.stderr,h.exitCode!==0&&(g=h.exitCode)}return{stdout:l,stderr:u,exitCode:g}}if(n.test){a.length===0&&(a=["-"]);let l="",u="",g=0;for(let y of a){let h=await A(t,y,n,r);l+=h.stdout,u+=h.stderr,h.exitCode!==0&&(g=h.exitCode)}return{stdout:l,stderr:u,exitCode:g}}a.length===0&&(a=["-"]);let d="",c="",i=0;for(let l of a){let u=await L(t,l,n,r,f,p);d+=u.stdout,c+=u.stderr,u.exitCode!==0&&(i=u.exitCode)}return{stdout:d,stderr:c,exitCode:i}}var
|
|
31
|
+
`,u="",g=0;for(let y of a){let h=await W(t,y,n,r);l+=h.stdout,u+=h.stderr,h.exitCode!==0&&(g=h.exitCode)}return{stdout:l,stderr:u,exitCode:g}}if(n.test){a.length===0&&(a=["-"]);let l="",u="",g=0;for(let y of a){let h=await A(t,y,n,r);l+=h.stdout,u+=h.stderr,h.exitCode!==0&&(g=h.exitCode)}return{stdout:l,stderr:u,exitCode:g}}a.length===0&&(a=["-"]);let d="",c="",i=0;for(let l of a){let u=await L(t,l,n,r,f,p);d+=u.stdout,c+=u.stderr,u.exitCode!==0&&(i=u.exitCode)}return{stdout:d,stderr:c,exitCode:i}}var Z={name:"gzip",async execute(e,t){return{...await C(e,t,"gzip"),stdoutEncoding:"binary"}}},R={name:"gunzip",async execute(e,t){return{...await C(e,t,"gunzip"),stdoutEncoding:"binary"}}},K={name:"zcat",async execute(e,t){return{...await C(e,t,"zcat"),stdoutEncoding:"binary"}}},j={name:"gzip",flags:[{flag:"-c",type:"boolean"},{flag:"-d",type:"boolean"},{flag:"-f",type:"boolean"},{flag:"-k",type:"boolean"},{flag:"-l",type:"boolean"},{flag:"-n",type:"boolean"},{flag:"-q",type:"boolean"},{flag:"-r",type:"boolean"},{flag:"-t",type:"boolean"},{flag:"-v",type:"boolean"},{flag:"-1",type:"boolean"},{flag:"-9",type:"boolean"}],stdinType:"binary",needsFiles:!0},J={name:"gunzip",flags:[{flag:"-c",type:"boolean"},{flag:"-f",type:"boolean"},{flag:"-k",type:"boolean"},{flag:"-q",type:"boolean"},{flag:"-v",type:"boolean"}],stdinType:"binary",needsFiles:!0},Q={name:"zcat",flags:[{flag:"-f",type:"boolean"},{flag:"-q",type:"boolean"},{flag:"-v",type:"boolean"}],stdinType:"binary",needsFiles:!0};export{Z as a,R as b,K as c,j as d,J as e,Q as f};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import{a as d}from"./chunk-OJDRYQWQ.js";import{a as f,b as m,c}from"./chunk-74CEPOFO.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(`
|
|
2
|
+
`)+(n.length>0?`
|
|
3
|
+
`:""),stderr:"",exitCode:0}}if(!i.exec)return{stdout:"",stderr:`env: command execution not supported in this context
|
|
4
|
+
`,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(`
|
|
5
|
+
`)+(t.length>0?`
|
|
6
|
+
`:""),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(`
|
|
7
|
+
`)+(r.length>0?`
|
|
8
|
+
`:""),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};
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import{f as G}from"./chunk-7TSDKFEO.js";import{a as z,b as E,c as U}from"./chunk-2TRDZQLB.js";import{a as q}from"./chunk-IPJHKYVM.js";import{a as $}from"./chunk-B74TABJS.js";import{c as L}from"./chunk-AH77CRWX.js";import{a as B,b as _,c as D}from"./chunk-74CEPOFO.js";var H=G({js:{extensions:[".js",".mjs",".cjs",".jsx"],globs:[]},ts:{extensions:[".ts",".tsx",".mts",".cts"],globs:[]},html:{extensions:[".html",".htm",".xhtml"],globs:[]},css:{extensions:[".css",".scss",".sass",".less"],globs:[]},json:{extensions:[".json",".jsonc",".json5"],globs:[]},xml:{extensions:[".xml",".xsl",".xslt"],globs:[]},c:{extensions:[".c",".h"],globs:[]},cpp:{extensions:[".cpp",".cc",".cxx",".hpp",".hh",".hxx",".h"],globs:[]},rust:{extensions:[".rs"],globs:[]},go:{extensions:[".go"],globs:[]},zig:{extensions:[".zig"],globs:[]},java:{extensions:[".java"],globs:[]},kotlin:{extensions:[".kt",".kts"],globs:[]},scala:{extensions:[".scala",".sc"],globs:[]},clojure:{extensions:[".clj",".cljc",".cljs",".edn"],globs:[]},py:{extensions:[".py",".pyi",".pyw"],globs:[]},rb:{extensions:[".rb",".rake",".gemspec"],globs:["Rakefile","Gemfile"]},php:{extensions:[".php",".phtml",".php3",".php4",".php5"],globs:[]},perl:{extensions:[".pl",".pm",".pod",".t"],globs:[]},lua:{extensions:[".lua"],globs:[]},sh:{extensions:[".sh",".bash",".zsh",".fish"],globs:[".bashrc",".zshrc",".profile"]},bat:{extensions:[".bat",".cmd"],globs:[]},ps:{extensions:[".ps1",".psm1",".psd1"],globs:[]},yaml:{extensions:[".yaml",".yml"],globs:[]},toml:{extensions:[".toml"],globs:["Cargo.toml","pyproject.toml"]},ini:{extensions:[".ini",".cfg",".conf"],globs:[]},csv:{extensions:[".csv",".tsv"],globs:[]},md:{extensions:[".md",".mdx",".markdown",".mdown",".mkd"],globs:[]},markdown:{extensions:[".md",".mdx",".markdown",".mdown",".mkd"],globs:[]},rst:{extensions:[".rst"],globs:[]},txt:{extensions:[".txt",".text"],globs:[]},tex:{extensions:[".tex",".ltx",".sty",".cls"],globs:[]},sql:{extensions:[".sql"],globs:[]},graphql:{extensions:[".graphql",".gql"],globs:[]},proto:{extensions:[".proto"],globs:[]},make:{extensions:[".mk",".mak"],globs:["Makefile","GNUmakefile","makefile"]},docker:{extensions:[],globs:["Dockerfile","Dockerfile.*","*.dockerfile"]},tf:{extensions:[".tf",".tfvars"],globs:[]}}),M=class{types;constructor(){this.types=new Map(Object.entries(H).map(([t,n])=>[t,{extensions:[...n.extensions],globs:[...n.globs]}]))}addType(t){let n=t.indexOf(":");if(n===-1)return;let s=t.slice(0,n),r=t.slice(n+1);if(r.startsWith("include:")){let l=r.slice(8),i=this.types.get(l);if(i){let a=this.types.get(s)||{extensions:[],globs:[]};a.extensions.push(...i.extensions),a.globs.push(...i.globs),this.types.set(s,a)}}else{let l=this.types.get(s)||{extensions:[],globs:[]};if(r.startsWith("*.")&&!r.slice(2).includes("*")){let i=r.slice(1);l.extensions.includes(i)||l.extensions.push(i)}else l.globs.includes(r)||l.globs.push(r);this.types.set(s,l)}}clearType(t){let n=this.types.get(t);n&&(n.extensions=[],n.globs=[])}getType(t){return this.types.get(t)}getAllTypes(){return this.types}matchesType(t,n){let s=t.toLowerCase();for(let r of n){if(r==="all"){if(this.matchesAnyType(t))return!0;continue}let l=this.types.get(r);if(l){for(let i of l.extensions)if(s.endsWith(i))return!0;for(let i of l.globs)if(i.includes("*")){let a=i.replace(/\./g,"\\.").replace(/\*/g,".*");if($(`^${a}$`,"i").test(t))return!0}else if(s===i.toLowerCase())return!0}}return!1}matchesAnyType(t){let n=t.toLowerCase();for(let s of this.types.values()){for(let r of s.extensions)if(n.endsWith(r))return!0;for(let r of s.globs)if(r.includes("*")){let l=r.replace(/\./g,"\\.").replace(/\*/g,".*");if($(`^${l}$`,"i").test(t))return!0}else if(n===r.toLowerCase())return!0}return!1}};function V(){let e=[];for(let[t,n]of Object.entries(H).sort()){let s=[];for(let r of n.extensions)s.push(`*${r}`);for(let r of n.globs)s.push(r);e.push(`${t}: ${s.join(", ")}`)}return`${e.join(`
|
|
2
|
+
`)}
|
|
3
|
+
`}function Z(){return{ignoreCase:!1,caseSensitive:!1,smartCase:!0,fixedStrings:!1,wordRegexp:!1,lineRegexp:!1,invertMatch:!1,multiline:!1,multilineDotall:!1,patterns:[],patternFiles:[],count:!1,countMatches:!1,files:!1,filesWithMatches:!1,filesWithoutMatch:!1,stats:!1,onlyMatching:!1,maxCount:0,lineNumber:!0,noFilename:!1,withFilename:!1,nullSeparator:!1,byteOffset:!1,column:!1,vimgrep:!1,replace:null,afterContext:0,beforeContext:0,contextSeparator:"--",quiet:!1,heading:!1,passthru:!1,includeZero:!1,sort:"path",json:!1,globs:[],iglobs:[],globCaseInsensitive:!1,types:[],typesNot:[],typeAdd:[],typeClear:[],hidden:!1,noIgnore:!1,noIgnoreDot:!1,noIgnoreVcs:!1,ignoreFiles:[],maxDepth:256,maxFilesize:0,followSymlinks:!1,searchZip:!1,searchBinary:!1,preprocessor:null,preprocessorGlobs:[]}}function se(e){let t=e.match(/^(\d+)([KMG])?$/i);if(!t)return 0;let n=parseInt(t[1],10);switch((t[2]||"").toUpperCase()){case"K":return n*1024;case"M":return n*1024*1024;case"G":return n*1024*1024*1024;default:return n}}function ne(e){return/^\d+[KMG]?$/i.test(e)?null:{stdout:"",stderr:`rg: invalid --max-filesize value: ${e}
|
|
4
|
+
`,exitCode:1}}function J(e){return null}var Y=[{short:"g",long:"glob",target:"globs",multi:!0},{long:"iglob",target:"iglobs",multi:!0},{short:"t",long:"type",target:"types",multi:!0,validate:J},{short:"T",long:"type-not",target:"typesNot",multi:!0,validate:J},{long:"type-add",target:"typeAdd",multi:!0},{long:"type-clear",target:"typeClear",multi:!0},{short:"m",long:"max-count",target:"maxCount",parse:parseInt},{short:"e",long:"regexp",target:"patterns",multi:!0},{short:"f",long:"file",target:"patternFiles",multi:!0},{short:"r",long:"replace",target:"replace"},{short:"d",long:"max-depth",target:"maxDepth",parse:parseInt},{long:"max-filesize",target:"maxFilesize",parse:se,validate:ne},{long:"context-separator",target:"contextSeparator"},{short:"j",long:"threads",ignored:!0},{long:"ignore-file",target:"ignoreFiles",multi:!0},{long:"pre",target:"preprocessor"},{long:"pre-glob",target:"preprocessorGlobs",multi:!0}],re=new Map([["i",e=>{e.ignoreCase=!0,e.caseSensitive=!1,e.smartCase=!1}],["--ignore-case",e=>{e.ignoreCase=!0,e.caseSensitive=!1,e.smartCase=!1}],["s",e=>{e.caseSensitive=!0,e.ignoreCase=!1,e.smartCase=!1}],["--case-sensitive",e=>{e.caseSensitive=!0,e.ignoreCase=!1,e.smartCase=!1}],["S",e=>{e.smartCase=!0,e.ignoreCase=!1,e.caseSensitive=!1}],["--smart-case",e=>{e.smartCase=!0,e.ignoreCase=!1,e.caseSensitive=!1}],["F",e=>{e.fixedStrings=!0}],["--fixed-strings",e=>{e.fixedStrings=!0}],["w",e=>{e.wordRegexp=!0}],["--word-regexp",e=>{e.wordRegexp=!0}],["x",e=>{e.lineRegexp=!0}],["--line-regexp",e=>{e.lineRegexp=!0}],["v",e=>{e.invertMatch=!0}],["--invert-match",e=>{e.invertMatch=!0}],["U",e=>{e.multiline=!0}],["--multiline",e=>{e.multiline=!0}],["--multiline-dotall",e=>{e.multilineDotall=!0,e.multiline=!0}],["c",e=>{e.count=!0}],["--count",e=>{e.count=!0}],["--count-matches",e=>{e.countMatches=!0}],["l",e=>{e.filesWithMatches=!0}],["--files",e=>{e.files=!0}],["--files-with-matches",e=>{e.filesWithMatches=!0}],["--files-without-match",e=>{e.filesWithoutMatch=!0}],["--stats",e=>{e.stats=!0}],["o",e=>{e.onlyMatching=!0}],["--only-matching",e=>{e.onlyMatching=!0}],["q",e=>{e.quiet=!0}],["--quiet",e=>{e.quiet=!0}],["N",e=>{e.lineNumber=!1}],["--no-line-number",e=>{e.lineNumber=!1}],["H",e=>{e.withFilename=!0}],["--with-filename",e=>{e.withFilename=!0}],["I",e=>{e.noFilename=!0}],["--no-filename",e=>{e.noFilename=!0}],["0",e=>{e.nullSeparator=!0}],["--null",e=>{e.nullSeparator=!0}],["b",e=>{e.byteOffset=!0}],["--byte-offset",e=>{e.byteOffset=!0}],["--column",e=>{e.column=!0,e.lineNumber=!0}],["--no-column",e=>{e.column=!1}],["--vimgrep",e=>{e.vimgrep=!0,e.column=!0,e.lineNumber=!0}],["--json",e=>{e.json=!0}],["--hidden",e=>{e.hidden=!0}],["--no-ignore",e=>{e.noIgnore=!0}],["--no-ignore-dot",e=>{e.noIgnoreDot=!0}],["--no-ignore-vcs",e=>{e.noIgnoreVcs=!0}],["L",e=>{e.followSymlinks=!0}],["--follow",e=>{e.followSymlinks=!0}],["z",e=>{e.searchZip=!0}],["--search-zip",e=>{e.searchZip=!0}],["a",e=>{e.searchBinary=!0}],["--text",e=>{e.searchBinary=!0}],["--heading",e=>{e.heading=!0}],["--passthru",e=>{e.passthru=!0}],["--include-zero",e=>{e.includeZero=!0}],["--glob-case-insensitive",e=>{e.globCaseInsensitive=!0}]]),ie=new Set(["n","--line-number"]);function le(e){e.hidden?e.searchBinary=!0:e.noIgnore?e.hidden=!0:e.noIgnore=!0}function oe(e,t,n){let s=e[t];for(let r of Y){if(s.startsWith(`--${r.long}=`)){let l=s.slice(`--${r.long}=`.length),i=P(n,r,l);return i?{newIndex:t,error:i}:{newIndex:t}}if(r.short&&s.startsWith(`-${r.short}`)&&s.length>2){let l=s.slice(2),i=P(n,r,l);return i?{newIndex:t,error:i}:{newIndex:t}}if(r.short&&s===`-${r.short}`||s===`--${r.long}`){if(t+1>=e.length)return null;let l=e[t+1],i=P(n,r,l);return i?{newIndex:t+1,error:i}:{newIndex:t+1}}}return null}function ae(e){return Y.find(t=>t.short===e)}function P(e,t,n){if(t.validate){let r=t.validate(n);if(r)return r}if(t.ignored||!t.target)return;let s=t.parse?t.parse(n):n;t.multi?e[t.target].push(s):e[t.target]=s}function ce(e,t){let n=e[t];if(n==="--sort"&&t+1<e.length){let s=e[t+1];if(s==="path"||s==="none")return{value:s,newIndex:t+1}}if(n.startsWith("--sort=")){let s=n.slice(7);if(s==="path"||s==="none")return{value:s,newIndex:t}}return null}function fe(e,t){let n=e[t],s=n.match(/^-([ABC])(\d+)$/);return s?{flag:s[1],value:parseInt(s[2],10),newIndex:t}:(n==="-A"||n==="-B"||n==="-C")&&t+1<e.length?{flag:n[1],value:parseInt(e[t+1],10),newIndex:t+1}:null}function ue(e){let t=e.match(/^-m(\d+)$/);return t?parseInt(t[1],10):null}function K(e){let t=Z(),n=null,s=[],r=-1,l=-1,i=-1,a=!1;for(let c=0;c<e.length;c++){let o=e[c];if(o.startsWith("-")&&o!=="-"){let u=fe(e,c);if(u){let{flag:f,value:x,newIndex:b}=u;f==="A"?r=Math.max(r,x):f==="B"?l=Math.max(l,x):i=x,c=b;continue}let d=ue(o);if(d!==null){t.maxCount=d;continue}let p=oe(e,c,t);if(p){if(p.error)return{success:!1,error:p.error};c=p.newIndex;continue}let g=ce(e,c);if(g){t.sort=g.value,c=g.newIndex;continue}let w=o.startsWith("--")?[o]:o.slice(1).split(""),m=!1;for(let f of w){if(ie.has(f)){t.lineNumber=!0,a=!0;continue}if(f==="u"||f==="--unrestricted"){le(t);continue}if(f==="P"||f==="--pcre2")return{success:!1,error:{stdout:"",stderr:`rg: PCRE2 is not supported. Use standard regex syntax instead.
|
|
5
|
+
`,exitCode:1}};if(f.length===1){let b=ae(f);if(b){if(c+1>=e.length)return{success:!1,error:D("rg",`-${f}`)};let h=P(t,b,e[c+1]);if(h)return{success:!1,error:h};c++,m=!0;continue}}let x=re.get(f);if(x){x(t);continue}if(f.startsWith("--"))return{success:!1,error:D("rg",f)};if(f.length===1)return{success:!1,error:D("rg",`-${f}`)}}}else n===null&&t.patterns.length===0&&t.patternFiles.length===0?n=o:s.push(o)}return(r>=0||i>=0)&&(t.afterContext=Math.max(r>=0?r:0,i>=0?i:0)),(l>=0||i>=0)&&(t.beforeContext=Math.max(l>=0?l:0,i>=0?i:0)),n!==null&&t.patterns.push(n),(t.column||t.vimgrep)&&(a=!0),{success:!0,options:t,paths:s,explicitLineNumbers:a}}import{gunzipSync as he}from"node:zlib";var T=class{patterns=[];basePath;constructor(t="/"){this.basePath=t}parse(t){let n=t.split(`
|
|
6
|
+
`);for(let s of n){let r=s.replace(/\s+$/,"");if(!r||r.startsWith("#"))continue;let l=!1;r.startsWith("!")&&(l=!0,r=r.slice(1));let i=!1;r.endsWith("/")&&(i=!0,r=r.slice(0,-1));let a=!1;r.startsWith("/")?(a=!0,r=r.slice(1)):r.includes("/")&&!r.startsWith("**/")&&(a=!0);let c=this.patternToRegex(r,a);this.patterns.push({pattern:s,regex:c,negated:l,directoryOnly:i,rooted:a})}}patternToRegex(t,n){let s="";n?s="^":s="(?:^|/)";let r=0;for(;r<t.length;){let l=t[r];if(l==="*")t[r+1]==="*"?t[r+2]==="/"?(s+="(?:.*/)?",r+=3):(r+2>=t.length,s+=".*",r+=2):(s+="[^/]*",r++);else if(l==="?")s+="[^/]",r++;else if(l==="["){let i=r+1;for(i<t.length&&t[i]==="!"&&i++,i<t.length&&t[i]==="]"&&i++;i<t.length&&t[i]!=="]";)i++;if(i<t.length){let a=t.slice(r,i+1);a.startsWith("[!")&&(a=`[^${a.slice(2)}`),s+=a,r=i+1}else s+="\\[",r++}else l==="/"?(s+="/",r++):(s+=l.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),r++)}return s+="(?:/.*)?$",$(s)}matches(t,n){let s=t.replace(/^\.\//,"");s=s.replace(/^\//,"");let r=!1;for(let l of this.patterns)l.directoryOnly&&!n||l.regex.test(s)&&(r=!l.negated);return r}isWhitelisted(t,n){let s=t.replace(/^\.\//,"");s=s.replace(/^\//,"");for(let r of this.patterns)if(!(r.directoryOnly&&!n)&&r.negated&&r.regex.test(s))return!0;return!1}getBasePath(){return this.basePath}},k=class{parsers=[];fs;skipDotIgnore;skipVcsIgnore;loadedDirs=new Set;constructor(t,n,s=!1,r=!1){this.fs=t,this.skipDotIgnore=s,this.skipVcsIgnore=r}async load(t){let n=[],s=t;for(;;){n.unshift(s);let l=this.fs.resolvePath(s,"..");if(l===s)break;s=l}let r=[];this.skipVcsIgnore||r.push(".gitignore"),this.skipDotIgnore||r.push(".rgignore",".ignore");for(let l of n){this.loadedDirs.add(l);for(let i of r){let a=this.fs.resolvePath(l,i);try{let c=await this.fs.readFile(a),o=new T(l);o.parse(c),this.parsers.push(o)}catch{}}}}async loadForDirectory(t){if(this.loadedDirs.has(t))return;this.loadedDirs.add(t);let n=[];this.skipVcsIgnore||n.push(".gitignore"),this.skipDotIgnore||n.push(".rgignore",".ignore");for(let s of n){let r=this.fs.resolvePath(t,s);try{let l=await this.fs.readFile(r),i=new T(t);i.parse(l),this.parsers.push(i)}catch{}}}addPatternsFromContent(t,n){let s=new T(n);s.parse(t),this.parsers.push(s)}matches(t,n){for(let s of this.parsers){let r=s.getBasePath();if(!t.startsWith(r))continue;let l=t.slice(r.length).replace(/^\//,"");if(s.matches(l,n))return!0}return!1}isWhitelisted(t,n){for(let s of this.parsers){let r=s.getBasePath();if(!t.startsWith(r))continue;let l=t.slice(r.length).replace(/^\//,"");if(s.isWhitelisted(l,n))return!0}return!1}static isCommonIgnored(t){return new Set(["node_modules",".git",".svn",".hg","__pycache__",".pytest_cache",".mypy_cache","venv",".venv",".next",".nuxt",".cargo"]).has(t)}};async function A(e,t,n=!1,s=!1,r=[]){let l=new k(e,t,n,s);await l.load(t);for(let i of r)try{let a=e.resolvePath(t,i),c=await e.readFile(a);l.addPatternsFromContent(c,t)}catch{}return l}function ge(e){return e.length>=2&&e[0]===31&&e[1]===139}function pe(e){let t=!1;for(let n=0;n<e.length;n++){let s=e[n];s==="["&&!t?t=!0:s==="]"&&t&&(t=!1)}return t?`rg: glob '${e}' has an unclosed character class`:null}async function X(e){let{ctx:t,options:n,paths:s,explicitLineNumbers:r}=e;for(let f of n.globs){let x=f.startsWith("!")?f.slice(1):f,b=pe(x);if(b)return{stdout:"",stderr:`${b}
|
|
7
|
+
`,exitCode:1}}if(n.files){let f=[...n.patterns,...s];return xe(t,f,n)}let l=[...n.patterns];for(let f of n.patternFiles)try{let x;if(f==="-")x=L(t.stdin);else{let h=t.fs.resolvePath(t.cwd,f);x=await t.fs.readFile(h)}let b=x.split(`
|
|
8
|
+
`).filter(h=>h.length>0);l.push(...b)}catch{return{stdout:"",stderr:`rg: ${f}: No such file or directory
|
|
9
|
+
`,exitCode:2}}if(l.length===0)return n.patternFiles.length>0?{stdout:"",stderr:"",exitCode:1}:{stdout:"",stderr:`rg: no pattern given
|
|
10
|
+
`,exitCode:2};let i=s.length===0?["."]:s,a=me(n,l),c,o;try{let f=de(l,n,a);c=f.regex,o=f.kResetGroup}catch{return{stdout:"",stderr:`rg: invalid regex: ${l.join(", ")}
|
|
11
|
+
`,exitCode:2}}let u=null;n.noIgnore||(u=await A(t.fs,t.cwd,n.noIgnoreDot,n.noIgnoreVcs,n.ignoreFiles));let d=new M;for(let f of n.typeClear)d.clearType(f);for(let f of n.typeAdd)d.addType(f);let{files:p,singleExplicitFile:g}=await Q(t,i,n,u,d);if(p.length===0)return{stdout:"",stderr:"",exitCode:1};let w=!n.noFilename&&(n.withFilename||!g||p.length>1),m=n.lineNumber;return r||(g&&p.length===1&&(m=!1),n.onlyMatching&&(m=!1)),we(t,p,c,n,w,m,o)}function me(e,t){return e.caseSensitive?!1:e.ignoreCase?!0:e.smartCase?!t.some(n=>/[A-Z]/.test(n)):!1}function de(e,t,n){let s;return e.length===1?s=e[0]:s=e.map(r=>t.fixedStrings?r.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"):`(?:${r})`).join("|"),E(s,{mode:t.fixedStrings&&e.length===1?"fixed":"perl",ignoreCase:n,wholeWord:t.wordRegexp,lineRegexp:t.lineRegexp,multiline:t.multiline,multilineDotall:t.multilineDotall})}async function Q(e,t,n,s,r){let l=[],i=0,a=0;for(let o of t){let u=e.fs.resolvePath(e.cwd,o);try{let d=await e.fs.stat(u);if(d.isFile){if(i++,n.maxFilesize>0&&d.size>n.maxFilesize)continue;te(o,n,s,u,r)&&l.push(o)}else d.isDirectory&&(a++,await ee(e,o,u,0,n,s,r,l))}catch{}}return{files:n.sort==="path"?l.sort():l,singleExplicitFile:i===1&&a===0}}async function ee(e,t,n,s,r,l,i,a){if(!(s>=r.maxDepth)){l&&await l.loadForDirectory(n);try{let c=e.fs.readdirWithFileTypes?await e.fs.readdirWithFileTypes(n):(await e.fs.readdir(n)).map(o=>({name:o,isFile:void 0}));for(let o of c){let u=o.name;if(!r.noIgnore&&k.isCommonIgnored(u))continue;let d=u.startsWith("."),p=t==="."?u:t==="./"?`./${u}`:t.endsWith("/")?`${t}${u}`:`${t}/${u}`,g=e.fs.resolvePath(n,u),w,m,f=!1;if(o.isFile!==void 0&&"isDirectory"in o){let h=o;if(f=h.isSymbolicLink===!0,f&&!r.followSymlinks)continue;if(f&&r.followSymlinks)try{let y=await e.fs.stat(g);w=y.isFile,m=y.isDirectory}catch{continue}else w=h.isFile,m=h.isDirectory}else try{let h=e.fs.lstat?await e.fs.lstat(g):await e.fs.stat(g);if(f=h.isSymbolicLink===!0,f&&!r.followSymlinks)continue;let y=f&&r.followSymlinks?await e.fs.stat(g):h;w=y.isFile,m=y.isDirectory}catch{continue}if(!l?.matches(g,m)&&!(d&&!r.hidden&&!l?.isWhitelisted(g,m))){if(m)await ee(e,p,g,s+1,r,l,i,a);else if(w){if(r.maxFilesize>0)try{if((await e.fs.stat(g)).size>r.maxFilesize)continue}catch{continue}te(p,r,l,g,i)&&a.push(p)}}}}catch{}}}function te(e,t,n,s,r){let l=e.split("/").pop()||e;if(n?.matches(s,!1)||t.types.length>0&&!r.matchesType(l,t.types)||t.typesNot.length>0&&r.matchesType(l,t.typesNot))return!1;if(t.globs.length>0){let i=t.globCaseInsensitive,a=t.globs.filter(o=>!o.startsWith("!")),c=t.globs.filter(o=>o.startsWith("!")).map(o=>o.slice(1));if(a.length>0){let o=!1;for(let u of a)if(v(l,u,i)||v(e,u,i)){o=!0;break}if(!o)return!1}for(let o of c)if(o.startsWith("/")){let u=o.slice(1);if(v(e,u,i))return!1}else if(v(l,o,i)||v(e,o,i))return!1}if(t.iglobs.length>0){let i=t.iglobs.filter(c=>!c.startsWith("!")),a=t.iglobs.filter(c=>c.startsWith("!")).map(c=>c.slice(1));if(i.length>0){let c=!1;for(let o of i)if(v(l,o,!0)||v(e,o,!0)){c=!0;break}if(!c)return!1}for(let c of a)if(c.startsWith("/")){let o=c.slice(1);if(v(e,o,!0))return!1}else if(v(l,c,!0)||v(e,c,!0))return!1}return!0}function v(e,t,n=!1){let s="^";for(let r=0;r<t.length;r++){let l=t[r];if(l==="*")t[r+1]==="*"?(s+=".*",r++):s+="[^/]*";else if(l==="?")s+="[^/]";else if(l==="["){let i=r+1;for(i<t.length&&t[i]==="!"&&i++,i<t.length&&t[i]==="]"&&i++;i<t.length&&t[i]!=="]";)i++;if(i<t.length){let a=t.slice(r,i+1);a.startsWith("[!")&&(a=`[^${a.slice(2)}`),s+=a,r=i}else s+="\\["}else s+=l.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}return s+="$",$(s,n?"i":"").test(e)}async function xe(e,t,n){let s=null;n.noIgnore||(s=await A(e.fs,e.cwd,n.noIgnoreDot,n.noIgnoreVcs,n.ignoreFiles));let r=new M;for(let o of n.typeClear)r.clearType(o);for(let o of n.typeAdd)r.addType(o);let l=t.length===0?["."]:t,{files:i}=await Q(e,l,n,s,r);if(i.length===0)return{stdout:"",stderr:"",exitCode:1};if(n.quiet)return{stdout:"",stderr:"",exitCode:0};let a=n.nullSeparator?"\0":`
|
|
12
|
+
`;return{stdout:i.map(o=>o+a).join(""),stderr:"",exitCode:0}}function ye(e,t){if(t.length===0)return!0;for(let n of t)if(v(e,n,!1))return!0;return!1}async function be(e,t,n,s){try{if(s.preprocessor&&e.exec){let i=n.split("/").pop()||n;if(ye(i,s.preprocessorGlobs)){let a=await e.exec(q([s.preprocessor]),{cwd:e.cwd,signal:e.signal,args:[t]});if(a.exitCode===0&&a.stdout){let c=L(a.stdout),o=c.slice(0,8192);return{content:c,isBinary:o.includes("\0")}}}}if(s.searchZip&&n.endsWith(".gz")){let i=await e.fs.readFileBuffer(t);if(ge(i))try{let a=he(i),c=new TextDecoder().decode(a),o=c.slice(0,8192);return{content:c,isBinary:o.includes("\0")}}catch{return null}}let r=await e.fs.readFile(t),l=r.slice(0,8192);return{content:r,isBinary:l.includes("\0")}}catch{return null}}async function we(e,t,n,s,r,l,i){let a="",c=!1,o=[],u=0,d=0,p=0,g=50;e:for(let f=0;f<t.length;f+=g){let x=t.slice(f,f+g),b=await Promise.all(x.map(async h=>{let y=e.fs.resolvePath(e.cwd,h),F=await be(e,y,h,s);if(!F)return null;let{content:C,isBinary:N}=F;if(p+=C.length,N&&!s.searchBinary)return null;let W=r&&!s.heading?h:"",S=z(C,n,{invertMatch:s.invertMatch,showLineNumbers:l,countOnly:s.count,countMatches:s.countMatches,filename:W,onlyMatching:s.onlyMatching,beforeContext:s.beforeContext,afterContext:s.afterContext,maxCount:s.maxCount,contextSeparator:s.contextSeparator,showColumn:s.column,vimgrep:s.vimgrep,showByteOffset:s.byteOffset,replace:s.replace!==null?U(s.replace):null,passthru:s.passthru,multiline:s.multiline,kResetGroup:i});return s.json&&S.matched?{file:h,result:S,content:C,isBinary:!1}:{file:h,result:S}}));for(let h of b){if(!h)continue;let{file:y,result:F}=h;if(F.matched){if(c=!0,d++,u+=F.matchCount,s.quiet&&!s.json)break e;if(s.json&&!s.quiet){let C=h.content||"";o.push(JSON.stringify({type:"begin",data:{path:{text:y}}}));let N=C.split(`
|
|
13
|
+
`);n.lastIndex=0;let W=0;for(let S=0;S<N.length;S++){let j=N[S];n.lastIndex=0;let O=[];for(let I=n.exec(j);I!==null;I=n.exec(j)){let R={match:{text:I[0]},start:I.index,end:I.index+I[0].length};s.replace!==null&&(R.replacement={text:s.replace}),O.push(R),I[0].length===0&&n.lastIndex++}if(O.length>0){let I={type:"match",data:{path:{text:y},lines:{text:`${j}
|
|
14
|
+
`},line_number:S+1,absolute_offset:W,submatches:O}};o.push(JSON.stringify(I))}W+=j.length+1}o.push(JSON.stringify({type:"end",data:{path:{text:y},binary_offset:null,stats:{elapsed:{secs:0,nanos:0,human:"0s"},searches:1,searches_with_match:1,bytes_searched:C.length,bytes_printed:0,matched_lines:F.matchCount,matches:F.matchCount}}}))}else if(s.filesWithMatches){let C=s.nullSeparator?"\0":`
|
|
15
|
+
`;a+=`${y}${C}`}else s.filesWithoutMatch||(s.heading&&!s.noFilename&&(a+=`${y}
|
|
16
|
+
`),a+=F.output)}else if(s.filesWithoutMatch){let C=s.nullSeparator?"\0":`
|
|
17
|
+
`;a+=`${y}${C}`}else s.includeZero&&(s.count||s.countMatches)&&(a+=F.output)}}s.json&&(o.push(JSON.stringify({type:"summary",data:{elapsed_total:{secs:0,nanos:0,human:"0s"},stats:{elapsed:{secs:0,nanos:0,human:"0s"},searches:t.length,searches_with_match:d,bytes_searched:p,bytes_printed:0,matched_lines:u,matches:u}}})),a=`${o.join(`
|
|
18
|
+
`)}
|
|
19
|
+
`);let w=s.quiet&&!s.json?"":a;if(s.stats&&!s.json){let f=["",`${u} matches`,`${u} matched lines`,`${d} files contained matches`,`${t.length} files searched`,`${p} bytes searched`].join(`
|
|
20
|
+
`);w+=`${f}
|
|
21
|
+
`}let m;return s.filesWithoutMatch?m=a.length>0?0:1:m=c?0:1,{stdout:w,stderr:"",exitCode:m}}var ve={name:"rg",summary:"recursively search for a pattern",usage:"rg [OPTIONS] PATTERN [PATH ...]",description:`rg (ripgrep) recursively searches directories for a regex pattern.
|
|
22
|
+
Unlike grep, rg is recursive by default and respects .gitignore files.
|
|
23
|
+
|
|
24
|
+
EXAMPLES:
|
|
25
|
+
rg foo Search for 'foo' in current directory
|
|
26
|
+
rg foo src/ Search in src/ directory
|
|
27
|
+
rg -i foo Case-insensitive search
|
|
28
|
+
rg -w foo Match whole words only
|
|
29
|
+
rg -t js foo Search only JavaScript files
|
|
30
|
+
rg -g '*.ts' foo Search files matching glob
|
|
31
|
+
rg --hidden foo Include hidden files
|
|
32
|
+
rg -l foo List files with matches only`,options:["-e, --regexp PATTERN search for PATTERN (can be used multiple times)","-f, --file FILE read patterns from FILE, one per line","-i, --ignore-case case-insensitive search","-s, --case-sensitive case-sensitive search (overrides smart-case)","-S, --smart-case smart case (default: case-insensitive unless pattern has uppercase)","-F, --fixed-strings treat pattern as literal string","-w, --word-regexp match whole words only","-x, --line-regexp match whole lines only","-v, --invert-match select non-matching lines","-r, --replace TEXT replace matches with TEXT","-c, --count print count of matching lines per file"," --count-matches print count of individual matches per file","-l, --files-with-matches print only file names with matches"," --files-without-match print file names without matches"," --files list files that would be searched","-o, --only-matching print only matching parts","-m, --max-count NUM stop after NUM matches per file","-q, --quiet suppress output, exit 0 on match"," --stats print search statistics","-n, --line-number print line numbers (default: on)","-N, --no-line-number do not print line numbers","-I, --no-filename suppress the prefixing of file names","-0, --null use NUL as filename separator","-b, --byte-offset show byte offset of each match"," --column show column number of first match"," --vimgrep show results in vimgrep format"," --json show results in JSON Lines format","-A NUM print NUM lines after each match","-B NUM print NUM lines before each match","-C NUM print NUM lines before and after each match"," --context-separator SEP separator for context groups (default: --)","-U, --multiline match patterns across lines","-z, --search-zip search in compressed files (gzip only)","-g, --glob GLOB include files matching GLOB","-t, --type TYPE only search files of TYPE (e.g., js, py, ts)","-T, --type-not TYPE exclude files of TYPE","-L, --follow follow symbolic links","-u, --unrestricted reduce filtering (-u: no ignore, -uu: +hidden, -uuu: +binary)","-a, --text search binary files as text"," --hidden search hidden files and directories"," --no-ignore don't respect .gitignore/.ignore files","-d, --max-depth NUM maximum search depth"," --sort TYPE sort files (path, none)"," --heading show file path above matches"," --passthru print all lines (non-matches use - separator)"," --include-zero include files with 0 matches in count output"," --type-list list all available file types"," --help display this help and exit"]},Ge={name:"rg",async execute(e,t){if(_(e))return B(ve);if(e.includes("--type-list"))return{stdout:V(),stderr:"",exitCode:0};let n=K(e);return n.success?X({ctx:t,options:n.options,paths:n.paths,explicitLineNumbers:n.explicitLineNumbers}):n.error}},qe={name:"rg",flags:[{flag:"-i",type:"boolean"},{flag:"-s",type:"boolean"},{flag:"-S",type:"boolean"},{flag:"-F",type:"boolean"},{flag:"-w",type:"boolean"},{flag:"-x",type:"boolean"},{flag:"-v",type:"boolean"},{flag:"-c",type:"boolean"},{flag:"-l",type:"boolean"},{flag:"-o",type:"boolean"},{flag:"-n",type:"boolean"},{flag:"-N",type:"boolean"},{flag:"--hidden",type:"boolean"},{flag:"--no-ignore",type:"boolean"},{flag:"-m",type:"value",valueHint:"number"},{flag:"-A",type:"value",valueHint:"number"},{flag:"-B",type:"value",valueHint:"number"},{flag:"-C",type:"value",valueHint:"number"},{flag:"-g",type:"value",valueHint:"pattern"},{flag:"-t",type:"value",valueHint:"string"},{flag:"-T",type:"value",valueHint:"string"}],needsArgs:!0};export{Ge as a,qe as b};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import{a as f}from"./chunk-DZCB42NK.js";import{a as d}from"./chunk-HWKDQ44K.js";import{a as m,b as p}from"./chunk-74CEPOFO.js";var b={name:"cat",summary:"concatenate files and print on the standard output",usage:"cat [OPTION]... [FILE]...",options:["-n, --number number all output lines"," --help display this help and exit"]},g={number:{short:"n",long:"number",type:"boolean"}},L={name:"cat",async execute(t,o){if(p(t))return m(b);let e=d("cat",t,g);if(!e.ok)return e.error;let r=e.result.flags.number,s=e.result.positional,a=await f(o,s,{cmdName:"cat",allowStdinMarker:!0,stopOnError:!1}),n="",l=1;for(let{content:i}of a.files){let u=i;if(r){let c=y(u,l);n+=c.content,l=c.nextLineNumber}else n+=u}return{stdout:n,stderr:a.stderr,exitCode:a.exitCode,stdoutEncoding:"binary"}}};function y(t,o){let e=t.split(`
|
|
2
|
+
`),r=t.endsWith(`
|
|
3
|
+
`),s=r?e.slice(0,-1):e;return{content:s.map((n,l)=>`${String(o+l).padStart(6," ")} ${n}`).join(`
|
|
4
|
+
`)+(r?`
|
|
5
|
+
`:""),nextLineNumber:o+s.length}}var T={name:"cat",flags:[{flag:"-n",type:"boolean"},{flag:"-A",type:"boolean"},{flag:"-b",type:"boolean"},{flag:"-s",type:"boolean"},{flag:"-v",type:"boolean"},{flag:"-e",type:"boolean"},{flag:"-t",type:"boolean"}],stdinType:"text",needsFiles:!0};export{L as a,T as b};
|