just-binary 2.9.9 → 3.0.1
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/README.md +12 -3
- package/dist/Bash.d.ts +5 -2
- package/dist/bin/chunks/alias-DRSSCAUM.js +2 -0
- package/dist/bin/chunks/awk2-GM5WBRLU.js +2 -0
- package/dist/bin/chunks/base64-KLZ4B6VS.js +2 -0
- package/dist/bin/chunks/basename-XCXGYZPS.js +2 -0
- package/dist/bin/chunks/bash-U2E2FSIE.js +2 -0
- package/dist/bin/chunks/bytes-C34BYEMS.js +2 -0
- package/dist/bin/chunks/cat-D4E4FTXJ.js +2 -0
- package/dist/bin/chunks/chmod-OY5CP5QF.js +2 -0
- package/dist/bin/chunks/chunk-23CC4423.js +287 -0
- package/dist/bin/chunks/chunk-23EV7RYO.js +10 -0
- package/dist/bin/chunks/chunk-2IOUIOWE.js +12 -0
- package/dist/bin/chunks/chunk-3VDZW42W.js +5 -0
- package/dist/bin/chunks/chunk-444WPTN5.js +8 -0
- package/dist/bin/chunks/chunk-446TXLPR.js +9 -0
- package/dist/bin/chunks/chunk-44ROJVH3.js +6 -0
- package/dist/bin/chunks/chunk-463VWH7H.js +2 -0
- package/dist/bin/chunks/chunk-4VVLCPRH.js +8 -0
- package/dist/bin/chunks/chunk-4W52T6KS.js +63 -0
- package/dist/bin/chunks/chunk-4Y3GINAY.js +33 -0
- package/dist/bin/chunks/chunk-5IL5CXJC.js +3 -0
- package/dist/bin/chunks/chunk-5KQNIOZS.js +84 -0
- package/dist/bin/chunks/chunk-66PXNTAV.js +2 -0
- package/dist/bin/chunks/chunk-67SBKZZD.js +9 -0
- package/dist/bin/chunks/chunk-6U6CK6V4.js +16 -0
- package/dist/bin/chunks/chunk-7J7OY2YE.js +12 -0
- package/dist/bin/chunks/chunk-7VWUKGDV.js +4 -0
- package/dist/bin/chunks/chunk-7YOACDUK.js +140 -0
- package/dist/bin/chunks/chunk-AN2KBMAK.js +12 -0
- package/dist/bin/chunks/chunk-ASU2EQWZ.js +32 -0
- package/dist/bin/chunks/chunk-AZQ66C5R.js +14 -0
- package/dist/bin/chunks/chunk-B4GXMUCA.js +20 -0
- package/dist/bin/chunks/chunk-BXOX2H2G.js +22 -0
- package/dist/bin/chunks/chunk-CAXM2HMK.js +2 -0
- package/dist/bin/chunks/chunk-CD3NCHIB.js +7 -0
- package/dist/bin/chunks/chunk-CE2ILL65.js +9 -0
- package/dist/bin/chunks/chunk-D34QBGQ3.js +7 -0
- package/dist/bin/chunks/chunk-D44C6YVE.js +6 -0
- package/dist/bin/chunks/chunk-DFAHK2EQ.js +23 -0
- package/dist/bin/chunks/chunk-DMTOGHTU.js +6 -0
- package/dist/bin/chunks/chunk-ECBMSCPX.js +5 -0
- package/dist/bin/chunks/chunk-EHJW6FCX.js +36 -0
- package/dist/bin/chunks/chunk-EXCMJ23H.js +100 -0
- package/dist/bin/chunks/chunk-FVFLR7NF.js +21 -0
- package/dist/bin/chunks/chunk-GIVPKQT5.js +16 -0
- package/dist/bin/chunks/chunk-GUZJZK5O.js +2 -0
- package/dist/bin/chunks/chunk-HEO6EBJ2.js +14 -0
- package/dist/bin/chunks/chunk-HT4IVOYZ.js +7 -0
- package/dist/bin/chunks/chunk-HY6WUGWS.js +10 -0
- package/dist/bin/chunks/chunk-HZM5PBQF.js +8 -0
- package/dist/bin/chunks/chunk-I2N72LXH.js +9 -0
- package/dist/bin/chunks/chunk-IAUA3FL7.js +8 -0
- package/dist/bin/chunks/chunk-IPWJZ22H.js +14 -0
- package/dist/bin/chunks/chunk-IQY3I4OH.js +2 -0
- package/dist/bin/chunks/chunk-JU5KTPFP.js +17 -0
- package/dist/bin/chunks/chunk-KAWPUEQM.js +3 -0
- package/dist/bin/chunks/chunk-L2KFCEBW.js +13 -0
- package/dist/bin/chunks/chunk-LVSKOXVG.js +5 -0
- package/dist/bin/chunks/chunk-MPX22C7Y.js +5 -0
- package/dist/bin/chunks/chunk-N7P3SUNH.js +6 -0
- package/dist/bin/chunks/chunk-NNVWOCET.js +2 -0
- package/dist/bin/chunks/chunk-NSSLXYEG.js +8 -0
- package/dist/bin/chunks/chunk-OH3VVXF7.js +3 -0
- package/dist/bin/chunks/chunk-PKKBPSVJ.js +7 -0
- package/dist/bin/chunks/chunk-PRQYRYWV.js +3 -0
- package/dist/bin/chunks/chunk-PZ46XEZ4.js +2 -0
- package/dist/bin/chunks/chunk-Q2BKN6MV.js +11 -0
- package/dist/bin/chunks/chunk-QFPJQSDK.js +7 -0
- package/dist/bin/chunks/chunk-QKQUVK53.js +10 -0
- package/dist/bin/chunks/chunk-QXOUI5BS.js +11 -0
- package/dist/bin/chunks/chunk-RAL2LVDX.js +7 -0
- package/dist/bin/chunks/chunk-RAUBS6MJ.js +2 -0
- package/dist/bin/chunks/chunk-RFIBBYTO.js +6 -0
- package/dist/bin/chunks/chunk-RIV3HSPK.js +19 -0
- package/dist/bin/chunks/chunk-RMG637UR.js +26 -0
- package/dist/bin/chunks/chunk-RUNWFUUE.js +7 -0
- package/dist/bin/chunks/chunk-RX4PT2U7.js +9 -0
- package/dist/bin/chunks/chunk-RZ6FAJ25.js +18 -0
- package/dist/bin/chunks/chunk-SDTTNNEH.js +23 -0
- package/dist/bin/chunks/chunk-SL4D2YES.js +4 -0
- package/dist/bin/chunks/chunk-SZM4GZ4H.js +2 -0
- package/dist/bin/chunks/chunk-TACNCKUC.js +21 -0
- package/dist/bin/chunks/chunk-U4LP6WPJ.js +11 -0
- package/dist/bin/chunks/chunk-UAZICDKU.js +5 -0
- package/dist/bin/chunks/chunk-V3N6H3L5.js +9 -0
- package/dist/bin/chunks/chunk-VWJBSJYM.js +2 -0
- package/dist/bin/chunks/chunk-WXI44VNZ.js +5 -0
- package/dist/bin/chunks/chunk-X7PEK6W7.js +13 -0
- package/dist/bin/chunks/chunk-XB426ZI7.js +3 -0
- package/dist/bin/chunks/chunk-XILOLP4K.js +8 -0
- package/dist/bin/chunks/chunk-XRZNW2KP.js +7 -0
- package/dist/bin/chunks/chunk-YER5PEKD.js +2 -0
- package/dist/bin/chunks/chunk-YG67AAKF.js +5 -0
- package/dist/bin/chunks/chunk-YGAHXCGB.js +13 -0
- package/dist/bin/chunks/chunk-YJFLWG5Q.js +73 -0
- package/dist/bin/chunks/chunk-Z72PSRMX.js +3 -0
- package/dist/bin/chunks/chunk-Z73LISDU.js +16 -0
- package/dist/bin/chunks/chunk-ZZPPBMHW.js +14 -0
- package/dist/bin/chunks/clear-P5EG7Z6I.js +2 -0
- package/dist/bin/chunks/column-5CUPANJY.js +2 -0
- package/dist/bin/chunks/comm-LMDA7QZC.js +2 -0
- package/dist/bin/chunks/cp-7TMSGOID.js +2 -0
- package/dist/bin/chunks/curl-P6DHVAKR.js +26 -0
- package/dist/bin/chunks/cut-P6LPALWP.js +2 -0
- package/dist/bin/chunks/date-KYJ2OPHH.js +2 -0
- package/dist/bin/chunks/diff-SGBANTKE.js +2 -0
- package/dist/bin/chunks/dirname-3LHNBKNB.js +2 -0
- package/dist/bin/chunks/du-DEYTW2KI.js +2 -0
- package/dist/bin/chunks/echo-5EBIR54T.js +2 -0
- package/dist/bin/chunks/env-PWRJFDWL.js +2 -0
- package/dist/bin/chunks/expand-672ZQYZF.js +2 -0
- package/dist/bin/chunks/expansion-OPTOOC4Q.js +2 -0
- package/dist/bin/chunks/expr-SWYNZXDP.js +2 -0
- package/dist/bin/chunks/file-MIXTZ4NP.js +2 -0
- package/dist/bin/chunks/find-BXGQE44U.js +2 -0
- package/dist/bin/chunks/flag-coverage-JBJRZ3PO.js +2 -0
- package/dist/bin/chunks/fold-SK55D7OX.js +2 -0
- package/dist/bin/chunks/grep-6OXCYWRV.js +2 -0
- package/dist/bin/chunks/gzip-AKQBQW7Y.js +2 -0
- package/dist/bin/chunks/head-YZQN4BHR.js +2 -0
- package/dist/bin/chunks/help-R7JNUPU2.js +2 -0
- package/dist/bin/chunks/history-W57S3E3C.js +2 -0
- package/dist/bin/chunks/hostname-NPAYFT3O.js +2 -0
- package/dist/bin/chunks/html-to-markdown-2AHE4ET2.js +2 -0
- package/dist/bin/chunks/join-ZK67SMQ3.js +2 -0
- package/dist/bin/chunks/jq-2BGA6KZ3.js +2 -0
- package/dist/bin/chunks/ln-PZ7JHGH2.js +2 -0
- package/dist/bin/chunks/ls-SLO257WP.js +2 -0
- package/dist/bin/chunks/md5sum-WYOOUOWI.js +2 -0
- package/dist/bin/chunks/mkdir-EOATYYLD.js +2 -0
- package/dist/bin/chunks/mv-QUAFQDCT.js +2 -0
- package/dist/bin/chunks/nl-WZC4GKMG.js +2 -0
- package/dist/bin/chunks/od-IMVAQQIR.js +2 -0
- package/dist/bin/chunks/paste-6XYPZQXQ.js +2 -0
- package/dist/bin/chunks/printf-OCMANWQ5.js +2 -0
- package/dist/bin/chunks/pwd-PQGDLYLZ.js +2 -0
- package/dist/bin/chunks/python3-HNLPOBYQ.js +14 -0
- package/dist/bin/chunks/readlink-F66ORZVY.js +2 -0
- package/dist/bin/chunks/rev-67WGH7WN.js +2 -0
- package/dist/bin/chunks/rg-LTQYHOCO.js +2 -0
- package/dist/bin/chunks/rm-BZWDOVUX.js +2 -0
- package/dist/bin/chunks/rmdir-5MNK2AUK.js +2 -0
- package/dist/bin/chunks/sed-HN3E3YFB.js +2 -0
- package/dist/bin/chunks/seq-6C6VEGIG.js +2 -0
- package/dist/bin/chunks/sha1sum-Y2J25KOM.js +2 -0
- package/dist/bin/chunks/sha256sum-NFAAGL44.js +2 -0
- package/dist/bin/chunks/sleep-CPJ3WJE7.js +2 -0
- package/dist/bin/chunks/sort-FT4OVPSS.js +2 -0
- package/dist/bin/chunks/split-AXXLODUK.js +2 -0
- package/dist/bin/chunks/sqlite3-DUARNSNG.js +2 -0
- package/dist/bin/chunks/stat-6QXPS4BF.js +2 -0
- package/dist/bin/chunks/strings-7CJI5ESD.js +2 -0
- package/dist/bin/chunks/tac-Q5VNKVXE.js +2 -0
- package/dist/bin/chunks/tail-EI24LQBP.js +2 -0
- package/dist/bin/chunks/tar-M7QCUJ4B.js +2 -0
- package/dist/bin/chunks/tee-6TEQ3DXN.js +2 -0
- package/dist/bin/chunks/time-GJWZLHLN.js +2 -0
- package/dist/bin/chunks/timeout-LPVVIBNB.js +2 -0
- package/dist/bin/chunks/touch-J6X4OW3P.js +2 -0
- package/dist/bin/chunks/tr-2C3Q77EZ.js +2 -0
- package/dist/bin/chunks/tree-RLXLQJVI.js +2 -0
- package/dist/bin/chunks/true-ZPDUMWHQ.js +2 -0
- package/dist/bin/chunks/unexpand-AUQHJMGI.js +2 -0
- package/dist/bin/chunks/uniq-C3ZUQTF4.js +2 -0
- package/dist/bin/chunks/wc-NNQHXBLM.js +2 -0
- package/dist/bin/chunks/which-QKNHOQPQ.js +2 -0
- package/dist/bin/chunks/whoami-KIB3RVBF.js +2 -0
- package/dist/bin/chunks/worker.js +5 -1
- package/dist/bin/chunks/xan-BGDVQKRZ.js +2 -0
- package/dist/bin/chunks/xan-view-GTANKIPW.js +2 -0
- package/dist/bin/chunks/xargs-I7QRUR36.js +2 -0
- package/dist/bin/chunks/yq-W7OKSS7Z.js +2 -0
- package/dist/bin/just-bash.js +290 -290
- package/dist/bin/shell/chunks/alias-DRSSCAUM.js +2 -0
- package/dist/bin/shell/chunks/awk2-GM5WBRLU.js +2 -0
- package/dist/bin/shell/chunks/base64-KLZ4B6VS.js +2 -0
- package/dist/bin/shell/chunks/basename-XCXGYZPS.js +2 -0
- package/dist/bin/shell/chunks/bash-U2E2FSIE.js +2 -0
- package/dist/bin/shell/chunks/bytes-C34BYEMS.js +2 -0
- package/dist/bin/shell/chunks/cat-D4E4FTXJ.js +2 -0
- package/dist/bin/shell/chunks/chmod-OY5CP5QF.js +2 -0
- package/dist/bin/shell/chunks/chunk-23CC4423.js +287 -0
- package/dist/bin/shell/chunks/chunk-23EV7RYO.js +10 -0
- package/dist/bin/shell/chunks/chunk-2IOUIOWE.js +12 -0
- package/dist/bin/shell/chunks/chunk-3VDZW42W.js +5 -0
- package/dist/bin/shell/chunks/chunk-444WPTN5.js +8 -0
- package/dist/bin/shell/chunks/chunk-446TXLPR.js +9 -0
- package/dist/bin/shell/chunks/chunk-44ROJVH3.js +6 -0
- package/dist/bin/shell/chunks/chunk-463VWH7H.js +2 -0
- package/dist/bin/shell/chunks/chunk-4VVLCPRH.js +8 -0
- package/dist/bin/shell/chunks/chunk-4W52T6KS.js +63 -0
- package/dist/bin/shell/chunks/chunk-4Y3GINAY.js +33 -0
- package/dist/bin/shell/chunks/chunk-5IL5CXJC.js +3 -0
- package/dist/bin/shell/chunks/chunk-5KQNIOZS.js +84 -0
- package/dist/bin/shell/chunks/chunk-66PXNTAV.js +2 -0
- package/dist/bin/shell/chunks/chunk-67SBKZZD.js +9 -0
- package/dist/bin/shell/chunks/chunk-6U6CK6V4.js +16 -0
- package/dist/bin/shell/chunks/chunk-7J7OY2YE.js +12 -0
- package/dist/bin/shell/chunks/chunk-7VWUKGDV.js +4 -0
- package/dist/bin/shell/chunks/chunk-7YOACDUK.js +140 -0
- package/dist/bin/shell/chunks/chunk-AN2KBMAK.js +12 -0
- package/dist/bin/shell/chunks/chunk-ASU2EQWZ.js +32 -0
- package/dist/bin/shell/chunks/chunk-AZQ66C5R.js +14 -0
- package/dist/bin/shell/chunks/chunk-B4GXMUCA.js +20 -0
- package/dist/bin/shell/chunks/chunk-BXOX2H2G.js +22 -0
- package/dist/bin/shell/chunks/chunk-CAXM2HMK.js +2 -0
- package/dist/bin/shell/chunks/chunk-CD3NCHIB.js +7 -0
- package/dist/bin/shell/chunks/chunk-CE2ILL65.js +9 -0
- package/dist/bin/shell/chunks/chunk-D34QBGQ3.js +7 -0
- package/dist/bin/shell/chunks/chunk-D44C6YVE.js +6 -0
- package/dist/bin/shell/chunks/chunk-DFAHK2EQ.js +23 -0
- package/dist/bin/shell/chunks/chunk-DMTOGHTU.js +6 -0
- package/dist/bin/shell/chunks/chunk-ECBMSCPX.js +5 -0
- package/dist/bin/shell/chunks/chunk-EHJW6FCX.js +36 -0
- package/dist/bin/shell/chunks/chunk-EXCMJ23H.js +100 -0
- package/dist/bin/shell/chunks/chunk-FVFLR7NF.js +21 -0
- package/dist/bin/shell/chunks/chunk-GIVPKQT5.js +16 -0
- package/dist/bin/shell/chunks/chunk-GUZJZK5O.js +2 -0
- package/dist/bin/shell/chunks/chunk-HEO6EBJ2.js +14 -0
- package/dist/bin/shell/chunks/chunk-HT4IVOYZ.js +7 -0
- package/dist/bin/shell/chunks/chunk-HY6WUGWS.js +10 -0
- package/dist/bin/shell/chunks/chunk-HZM5PBQF.js +8 -0
- package/dist/bin/shell/chunks/chunk-I2N72LXH.js +9 -0
- package/dist/bin/shell/chunks/chunk-IAUA3FL7.js +8 -0
- package/dist/bin/shell/chunks/chunk-IPWJZ22H.js +14 -0
- package/dist/bin/shell/chunks/chunk-IQY3I4OH.js +2 -0
- package/dist/bin/shell/chunks/chunk-JU5KTPFP.js +17 -0
- package/dist/bin/shell/chunks/chunk-KAWPUEQM.js +3 -0
- package/dist/bin/shell/chunks/chunk-L2KFCEBW.js +13 -0
- package/dist/bin/shell/chunks/chunk-LVSKOXVG.js +5 -0
- package/dist/bin/shell/chunks/chunk-MPX22C7Y.js +5 -0
- package/dist/bin/shell/chunks/chunk-N7P3SUNH.js +6 -0
- package/dist/bin/shell/chunks/chunk-NNVWOCET.js +2 -0
- package/dist/bin/shell/chunks/chunk-NSSLXYEG.js +8 -0
- package/dist/bin/shell/chunks/chunk-OH3VVXF7.js +3 -0
- package/dist/bin/shell/chunks/chunk-PKKBPSVJ.js +7 -0
- package/dist/bin/shell/chunks/chunk-PRQYRYWV.js +3 -0
- package/dist/bin/shell/chunks/chunk-PZ46XEZ4.js +2 -0
- package/dist/bin/shell/chunks/chunk-Q2BKN6MV.js +11 -0
- package/dist/bin/shell/chunks/chunk-QFPJQSDK.js +7 -0
- package/dist/bin/shell/chunks/chunk-QKQUVK53.js +10 -0
- package/dist/bin/shell/chunks/chunk-QXOUI5BS.js +11 -0
- package/dist/bin/shell/chunks/chunk-RAL2LVDX.js +7 -0
- package/dist/bin/shell/chunks/chunk-RAUBS6MJ.js +2 -0
- package/dist/bin/shell/chunks/chunk-RFIBBYTO.js +6 -0
- package/dist/bin/shell/chunks/chunk-RIV3HSPK.js +19 -0
- package/dist/bin/shell/chunks/chunk-RMG637UR.js +26 -0
- package/dist/bin/shell/chunks/chunk-RUNWFUUE.js +7 -0
- package/dist/bin/shell/chunks/chunk-RX4PT2U7.js +9 -0
- package/dist/bin/shell/chunks/chunk-RZ6FAJ25.js +18 -0
- package/dist/bin/shell/chunks/chunk-SDTTNNEH.js +23 -0
- package/dist/bin/shell/chunks/chunk-SL4D2YES.js +4 -0
- package/dist/bin/shell/chunks/chunk-SZM4GZ4H.js +2 -0
- package/dist/bin/shell/chunks/chunk-TACNCKUC.js +21 -0
- package/dist/bin/shell/chunks/chunk-U4LP6WPJ.js +11 -0
- package/dist/bin/shell/chunks/chunk-UAZICDKU.js +5 -0
- package/dist/bin/shell/chunks/chunk-V3N6H3L5.js +9 -0
- package/dist/bin/shell/chunks/chunk-VWJBSJYM.js +2 -0
- package/dist/bin/shell/chunks/chunk-WXI44VNZ.js +5 -0
- package/dist/bin/shell/chunks/chunk-X7PEK6W7.js +13 -0
- package/dist/bin/shell/chunks/chunk-XB426ZI7.js +3 -0
- package/dist/bin/shell/chunks/chunk-XILOLP4K.js +8 -0
- package/dist/bin/shell/chunks/chunk-XRZNW2KP.js +7 -0
- package/dist/bin/shell/chunks/chunk-YER5PEKD.js +2 -0
- package/dist/bin/shell/chunks/chunk-YG67AAKF.js +5 -0
- package/dist/bin/shell/chunks/chunk-YGAHXCGB.js +13 -0
- package/dist/bin/shell/chunks/chunk-YJFLWG5Q.js +73 -0
- package/dist/bin/shell/chunks/chunk-Z72PSRMX.js +3 -0
- package/dist/bin/shell/chunks/chunk-Z73LISDU.js +16 -0
- package/dist/bin/shell/chunks/chunk-ZZPPBMHW.js +14 -0
- package/dist/bin/shell/chunks/clear-P5EG7Z6I.js +2 -0
- package/dist/bin/shell/chunks/column-5CUPANJY.js +2 -0
- package/dist/bin/shell/chunks/comm-LMDA7QZC.js +2 -0
- package/dist/bin/shell/chunks/cp-7TMSGOID.js +2 -0
- package/dist/bin/shell/chunks/curl-P6DHVAKR.js +26 -0
- package/dist/bin/shell/chunks/cut-P6LPALWP.js +2 -0
- package/dist/bin/shell/chunks/date-KYJ2OPHH.js +2 -0
- package/dist/bin/shell/chunks/diff-SGBANTKE.js +2 -0
- package/dist/bin/shell/chunks/dirname-3LHNBKNB.js +2 -0
- package/dist/bin/shell/chunks/du-DEYTW2KI.js +2 -0
- package/dist/bin/shell/chunks/echo-5EBIR54T.js +2 -0
- package/dist/bin/shell/chunks/env-PWRJFDWL.js +2 -0
- package/dist/bin/shell/chunks/expand-672ZQYZF.js +2 -0
- package/dist/bin/shell/chunks/expansion-OPTOOC4Q.js +2 -0
- package/dist/bin/shell/chunks/expr-SWYNZXDP.js +2 -0
- package/dist/bin/shell/chunks/file-MIXTZ4NP.js +2 -0
- package/dist/bin/shell/chunks/find-BXGQE44U.js +2 -0
- package/dist/bin/shell/chunks/flag-coverage-JBJRZ3PO.js +2 -0
- package/dist/bin/shell/chunks/fold-SK55D7OX.js +2 -0
- package/dist/bin/shell/chunks/grep-6OXCYWRV.js +2 -0
- package/dist/bin/shell/chunks/gzip-AKQBQW7Y.js +2 -0
- package/dist/bin/shell/chunks/head-YZQN4BHR.js +2 -0
- package/dist/bin/shell/chunks/help-R7JNUPU2.js +2 -0
- package/dist/bin/shell/chunks/history-W57S3E3C.js +2 -0
- package/dist/bin/shell/chunks/hostname-NPAYFT3O.js +2 -0
- package/dist/bin/shell/chunks/html-to-markdown-2AHE4ET2.js +2 -0
- package/dist/bin/shell/chunks/join-ZK67SMQ3.js +2 -0
- package/dist/bin/shell/chunks/jq-2BGA6KZ3.js +2 -0
- package/dist/bin/shell/chunks/ln-PZ7JHGH2.js +2 -0
- package/dist/bin/shell/chunks/ls-SLO257WP.js +2 -0
- package/dist/bin/shell/chunks/md5sum-WYOOUOWI.js +2 -0
- package/dist/bin/shell/chunks/mkdir-EOATYYLD.js +2 -0
- package/dist/bin/shell/chunks/mv-QUAFQDCT.js +2 -0
- package/dist/bin/shell/chunks/nl-WZC4GKMG.js +2 -0
- package/dist/bin/shell/chunks/od-IMVAQQIR.js +2 -0
- package/dist/bin/shell/chunks/paste-6XYPZQXQ.js +2 -0
- package/dist/bin/shell/chunks/printf-OCMANWQ5.js +2 -0
- package/dist/bin/shell/chunks/pwd-PQGDLYLZ.js +2 -0
- package/dist/bin/shell/chunks/python3-HNLPOBYQ.js +14 -0
- package/dist/bin/shell/chunks/readlink-F66ORZVY.js +2 -0
- package/dist/bin/shell/chunks/rev-67WGH7WN.js +2 -0
- package/dist/bin/shell/chunks/rg-LTQYHOCO.js +2 -0
- package/dist/bin/shell/chunks/rm-BZWDOVUX.js +2 -0
- package/dist/bin/shell/chunks/rmdir-5MNK2AUK.js +2 -0
- package/dist/bin/shell/chunks/sed-HN3E3YFB.js +2 -0
- package/dist/bin/shell/chunks/seq-6C6VEGIG.js +2 -0
- package/dist/bin/shell/chunks/sha1sum-Y2J25KOM.js +2 -0
- package/dist/bin/shell/chunks/sha256sum-NFAAGL44.js +2 -0
- package/dist/bin/shell/chunks/sleep-CPJ3WJE7.js +2 -0
- package/dist/bin/shell/chunks/sort-FT4OVPSS.js +2 -0
- package/dist/bin/shell/chunks/split-AXXLODUK.js +2 -0
- package/dist/bin/shell/chunks/sqlite3-DUARNSNG.js +2 -0
- package/dist/bin/shell/chunks/stat-6QXPS4BF.js +2 -0
- package/dist/bin/shell/chunks/strings-7CJI5ESD.js +2 -0
- package/dist/bin/shell/chunks/tac-Q5VNKVXE.js +2 -0
- package/dist/bin/shell/chunks/tail-EI24LQBP.js +2 -0
- package/dist/bin/shell/chunks/tar-M7QCUJ4B.js +2 -0
- package/dist/bin/shell/chunks/tee-6TEQ3DXN.js +2 -0
- package/dist/bin/shell/chunks/time-GJWZLHLN.js +2 -0
- package/dist/bin/shell/chunks/timeout-LPVVIBNB.js +2 -0
- package/dist/bin/shell/chunks/touch-J6X4OW3P.js +2 -0
- package/dist/bin/shell/chunks/tr-2C3Q77EZ.js +2 -0
- package/dist/bin/shell/chunks/tree-RLXLQJVI.js +2 -0
- package/dist/bin/shell/chunks/true-ZPDUMWHQ.js +2 -0
- package/dist/bin/shell/chunks/unexpand-AUQHJMGI.js +2 -0
- package/dist/bin/shell/chunks/uniq-C3ZUQTF4.js +2 -0
- package/dist/bin/shell/chunks/wc-NNQHXBLM.js +2 -0
- package/dist/bin/shell/chunks/which-QKNHOQPQ.js +2 -0
- package/dist/bin/shell/chunks/whoami-KIB3RVBF.js +2 -0
- package/dist/bin/shell/chunks/xan-BGDVQKRZ.js +2 -0
- package/dist/bin/shell/chunks/xan-view-GTANKIPW.js +2 -0
- package/dist/bin/shell/chunks/xargs-I7QRUR36.js +2 -0
- package/dist/bin/shell/chunks/yq-W7OKSS7Z.js +2 -0
- package/dist/bin/shell/shell.js +286 -286
- package/dist/browser.d.ts +4 -0
- package/dist/bundle/browser.js +841 -833
- package/dist/bundle/chunks/alias-JHV3WNPA.js +1 -0
- package/dist/bundle/chunks/awk2-LA5EZ6UJ.js +1 -0
- package/dist/bundle/chunks/base64-DP3BVL7J.js +1 -0
- package/dist/bundle/chunks/basename-NCIQLNXY.js +1 -0
- package/dist/bundle/chunks/bash-CN3UUJ3N.js +1 -0
- package/dist/bundle/chunks/bytes-JUNATFIO.js +1 -0
- package/dist/bundle/chunks/cat-KHANCARN.js +1 -0
- package/dist/bundle/chunks/chmod-A3HCFC4L.js +1 -0
- package/dist/bundle/chunks/chunk-26DNZXYZ.js +23 -0
- package/dist/bundle/chunks/chunk-26VNLF3H.js +6 -0
- package/dist/bundle/chunks/chunk-2AMXQD57.js +11 -0
- package/dist/bundle/chunks/chunk-2OIUNVMP.js +10 -0
- package/dist/bundle/chunks/chunk-2V4QPJXQ.js +19 -0
- package/dist/bundle/chunks/chunk-2WN53CVO.js +15 -0
- package/dist/bundle/chunks/chunk-3ANOKDIL.js +5 -0
- package/dist/bundle/chunks/chunk-3P5XOPF6.js +1 -0
- package/dist/bundle/chunks/chunk-4PFDHMBC.js +8 -0
- package/dist/bundle/chunks/chunk-53I2XH4A.js +9 -0
- package/dist/bundle/chunks/chunk-5BF5Z7CI.js +1 -0
- package/dist/bundle/chunks/chunk-5J57FRET.js +4 -0
- package/dist/bundle/chunks/chunk-5PIFIDMP.js +13 -0
- package/dist/bundle/chunks/chunk-5PV2QBWC.js +5 -0
- package/dist/bundle/chunks/chunk-6V537K6X.js +1 -0
- package/dist/bundle/chunks/chunk-72YPFG2Z.js +5 -0
- package/dist/bundle/chunks/chunk-7USKQKOT.js +1 -0
- package/dist/bundle/chunks/chunk-ATPJVO6F.js +8 -0
- package/dist/bundle/chunks/chunk-BJQMZYH3.js +22 -0
- package/dist/bundle/chunks/chunk-BQFHZOZH.js +99 -0
- package/dist/bundle/chunks/chunk-BTTTDUMD.js +1 -0
- package/dist/bundle/chunks/chunk-BXVXYDEI.js +286 -0
- package/dist/bundle/chunks/chunk-C325X4RB.js +7 -0
- package/dist/bundle/chunks/chunk-C44B5265.js +2 -0
- package/dist/bundle/chunks/chunk-D3IE6KOV.js +21 -0
- package/dist/bundle/chunks/chunk-D4LWWAJ2.js +6 -0
- package/dist/bundle/chunks/chunk-DEQBZDPB.js +1 -0
- package/dist/bundle/chunks/chunk-DNPCEBCN.js +2 -0
- package/dist/bundle/chunks/chunk-EHRCEDXN.js +13 -0
- package/dist/bundle/chunks/chunk-EHY6GWKP.js +8 -0
- package/dist/bundle/chunks/chunk-F77E6PCM.js +7 -0
- package/dist/bundle/chunks/chunk-GET3OC3O.js +8 -0
- package/dist/bundle/chunks/chunk-GMCBEP44.js +16 -0
- package/dist/bundle/chunks/chunk-GNXHG75U.js +1 -0
- package/dist/bundle/chunks/chunk-GQSJJXDG.js +3 -0
- package/dist/bundle/chunks/chunk-H5X25CTO.js +6 -0
- package/dist/bundle/chunks/chunk-IAFRFK2O.js +9 -0
- package/dist/bundle/chunks/chunk-INJTM5VR.js +5 -0
- package/dist/bundle/chunks/chunk-J7YL5K5B.js +2 -0
- package/dist/bundle/chunks/chunk-JJ5E4XJI.js +13 -0
- package/dist/bundle/chunks/chunk-JMFP263D.js +1 -0
- package/dist/bundle/chunks/chunk-JSLN56GJ.js +7 -0
- package/dist/bundle/chunks/chunk-K374E7Q4.js +8 -0
- package/dist/bundle/chunks/chunk-K7ZRPFN6.js +6 -0
- package/dist/bundle/chunks/chunk-KBCEHRTU.js +4 -0
- package/dist/bundle/chunks/chunk-KM46TYGR.js +4 -0
- package/dist/bundle/chunks/chunk-KRXVUD4L.js +4 -0
- package/dist/bundle/chunks/chunk-LBJIRX7Z.js +6 -0
- package/dist/bundle/chunks/chunk-M5Z2PSET.js +31 -0
- package/dist/bundle/chunks/chunk-MOCB6GPI.js +62 -0
- package/dist/bundle/chunks/chunk-NDPSDM3Q.js +32 -0
- package/dist/bundle/chunks/chunk-OYIATQ5V.js +6 -0
- package/dist/bundle/chunks/chunk-OZ76IUC5.js +10 -0
- package/dist/bundle/chunks/chunk-PEPBD26Q.js +2 -0
- package/dist/bundle/chunks/chunk-PES2WOIM.js +15 -0
- package/dist/bundle/chunks/chunk-PLMPLLOW.js +12 -0
- package/dist/bundle/chunks/chunk-PQPG4QOY.js +22 -0
- package/dist/bundle/chunks/chunk-PUUP54QP.js +9 -0
- package/dist/bundle/chunks/chunk-Q5XZ24VX.js +6 -0
- package/dist/bundle/chunks/chunk-QOFUETQV.js +4 -0
- package/dist/bundle/chunks/chunk-QPHABKP3.js +11 -0
- package/dist/bundle/chunks/chunk-RTGKIAVM.js +6 -0
- package/dist/bundle/chunks/chunk-RZ4GSKWY.js +7 -0
- package/dist/bundle/chunks/chunk-SF2462OV.js +3 -0
- package/dist/bundle/chunks/chunk-SJ7F47VW.js +6 -0
- package/dist/bundle/chunks/chunk-SMOO4IXI.js +1 -0
- package/dist/bundle/chunks/chunk-SPETXYUM.js +20 -0
- package/dist/bundle/chunks/chunk-SYTEZ2Y4.js +5 -0
- package/dist/bundle/chunks/chunk-TOK4OQFP.js +13 -0
- package/dist/bundle/chunks/chunk-U5Z7TJRO.js +11 -0
- package/dist/bundle/chunks/chunk-U6GF4IJH.js +72 -0
- package/dist/bundle/chunks/chunk-UBLR5ACC.js +1 -0
- package/dist/bundle/chunks/chunk-ULK572PS.js +7 -0
- package/dist/bundle/chunks/chunk-URMOT4S7.js +4 -0
- package/dist/bundle/chunks/chunk-USGCTFXK.js +2 -0
- package/dist/bundle/chunks/chunk-VKPVP3LD.js +4 -0
- package/dist/bundle/chunks/chunk-W4YQKIRV.js +35 -0
- package/dist/bundle/chunks/chunk-WMCZEPWH.js +8 -0
- package/dist/bundle/chunks/chunk-WTT2UCIA.js +20 -0
- package/dist/bundle/chunks/chunk-WVUVOYGQ.js +10 -0
- package/dist/bundle/chunks/chunk-XXS34VJC.js +12 -0
- package/dist/bundle/chunks/chunk-XZMBEDQL.js +7 -0
- package/dist/bundle/chunks/chunk-XZZ3XIZH.js +15 -0
- package/dist/bundle/chunks/chunk-YJHMB6QD.js +17 -0
- package/dist/bundle/chunks/chunk-YR4NQYT4.js +1 -0
- package/dist/bundle/chunks/chunk-YZPQ2W3A.js +139 -0
- package/dist/bundle/chunks/chunk-Z6DABRIE.js +12 -0
- package/dist/bundle/chunks/chunk-ZEHOKNGQ.js +2 -0
- package/dist/bundle/chunks/chunk-ZILSBZZ6.js +4 -0
- package/dist/bundle/chunks/clear-7SIFUXVD.js +1 -0
- package/dist/bundle/chunks/column-OUJRIWLX.js +1 -0
- package/dist/bundle/chunks/comm-47FVEMHB.js +1 -0
- package/dist/bundle/chunks/cp-FD6I3O6B.js +1 -0
- package/dist/bundle/chunks/curl-3MHMRKXA.js +25 -0
- package/dist/bundle/chunks/cut-LQZW2NZP.js +1 -0
- package/dist/bundle/chunks/date-MHLQVLQZ.js +1 -0
- package/dist/bundle/chunks/diff-7ZYMEVUP.js +1 -0
- package/dist/bundle/chunks/dirname-IVA4YYRE.js +1 -0
- package/dist/bundle/chunks/du-H4GJHM4R.js +1 -0
- package/dist/bundle/chunks/echo-ZPFMTGPQ.js +1 -0
- package/dist/bundle/chunks/env-ZCKP6263.js +1 -0
- package/dist/bundle/chunks/expand-Y7EMR5BJ.js +1 -0
- package/dist/bundle/chunks/expansion-GYIQOAHW.js +1 -0
- package/dist/bundle/chunks/expr-WDFXVU43.js +1 -0
- package/dist/bundle/chunks/file-7WSECN2B.js +1 -0
- package/dist/bundle/chunks/find-BYG3GTNV.js +1 -0
- package/dist/bundle/chunks/flag-coverage-FK7Z2EY4.js +1 -0
- package/dist/bundle/chunks/fold-6O4H3AW4.js +1 -0
- package/dist/bundle/chunks/grep-KLQ4A2OH.js +1 -0
- package/dist/bundle/chunks/gzip-BYGAV4XY.js +1 -0
- package/dist/bundle/chunks/head-CIKXFGO5.js +1 -0
- package/dist/bundle/chunks/help-B2UCSYQN.js +1 -0
- package/dist/bundle/chunks/history-N2VRLHEO.js +1 -0
- package/dist/bundle/chunks/hostname-W7U3GOEK.js +1 -0
- package/dist/bundle/chunks/html-to-markdown-ZDG5GHHM.js +1 -0
- package/dist/bundle/chunks/join-CFMKSF44.js +1 -0
- package/dist/bundle/chunks/jq-BE76GAFF.js +1 -0
- package/dist/bundle/chunks/ln-N3OWFM3J.js +1 -0
- package/dist/bundle/chunks/ls-JAO4QNWZ.js +1 -0
- package/dist/bundle/chunks/md5sum-ZK2D5HMO.js +1 -0
- package/dist/bundle/chunks/mkdir-O74MZREV.js +1 -0
- package/dist/bundle/chunks/mv-66ALAQRO.js +1 -0
- package/dist/bundle/chunks/nl-JSPXHHOM.js +1 -0
- package/dist/bundle/chunks/od-NUINXLUX.js +1 -0
- package/dist/bundle/chunks/paste-Y7CG4TKC.js +1 -0
- package/dist/bundle/chunks/printf-223LFYZL.js +1 -0
- package/dist/bundle/chunks/pwd-BP6H5JPD.js +1 -0
- package/dist/bundle/chunks/python3-2KEMASKS.js +13 -0
- package/dist/bundle/chunks/readlink-JL7TKP5U.js +1 -0
- package/dist/bundle/chunks/rev-UN4ZHPP5.js +1 -0
- package/dist/bundle/chunks/rg-RA3U4BVJ.js +1 -0
- package/dist/bundle/chunks/rm-NIZVTCU7.js +1 -0
- package/dist/bundle/chunks/rmdir-LGJXG7S3.js +1 -0
- package/dist/bundle/chunks/sed-JJ3WRWYT.js +1 -0
- package/dist/bundle/chunks/seq-UCWX6HDA.js +1 -0
- package/dist/bundle/chunks/sha1sum-BB464H3H.js +1 -0
- package/dist/bundle/chunks/sha256sum-PPJUHZ6A.js +1 -0
- package/dist/bundle/chunks/sleep-YQMDXMVK.js +1 -0
- package/dist/bundle/chunks/sort-BNPU2P3T.js +1 -0
- package/dist/bundle/chunks/split-SVMZIFGF.js +1 -0
- package/dist/bundle/chunks/sqlite3-PZGLI6XB.js +1 -0
- package/dist/bundle/chunks/stat-2CKLARLN.js +1 -0
- package/dist/bundle/chunks/strings-LG7URPXR.js +1 -0
- package/dist/bundle/chunks/tac-NXGTFB5T.js +1 -0
- package/dist/bundle/chunks/tail-GJ536HFQ.js +1 -0
- package/dist/bundle/chunks/tar-3KCFO6WZ.js +1 -0
- package/dist/bundle/chunks/tee-PJ6B6JJF.js +1 -0
- package/dist/bundle/chunks/time-IENYNVU4.js +1 -0
- package/dist/bundle/chunks/timeout-SXUKTL7R.js +1 -0
- package/dist/bundle/chunks/touch-7BNOFP74.js +1 -0
- package/dist/bundle/chunks/tr-TB6CSIUV.js +1 -0
- package/dist/bundle/chunks/tree-4XRVONUX.js +1 -0
- package/dist/bundle/chunks/true-4UI5ZW75.js +1 -0
- package/dist/bundle/chunks/unexpand-LDC3OTY4.js +1 -0
- package/dist/bundle/chunks/uniq-ZHYLWEFM.js +1 -0
- package/dist/bundle/chunks/wc-PWYVRT3X.js +1 -0
- package/dist/bundle/chunks/which-EIT2IJGG.js +1 -0
- package/dist/bundle/chunks/whoami-QZJHAL2R.js +1 -0
- package/dist/bundle/chunks/worker.js +5 -1
- package/dist/bundle/chunks/xan-JDD2TEQH.js +1 -0
- package/dist/bundle/chunks/xan-view-WKPGEZFG.js +1 -0
- package/dist/bundle/chunks/xargs-CB3LOKW5.js +1 -0
- package/dist/bundle/chunks/yq-JFXSVU6G.js +1 -0
- package/dist/bundle/index.js +289 -289
- package/dist/commands/head/head-tail-shared.d.ts +4 -3
- package/dist/commands/search-engine/index.d.ts +1 -0
- package/dist/commands/search-engine/stream-matcher.d.ts +31 -0
- package/dist/fs/encoding.d.ts +23 -7
- package/dist/fs/in-memory-fs/in-memory-fs.d.ts +9 -25
- package/dist/fs/interface.d.ts +24 -117
- package/dist/fs/mountable-fs/mountable-fs.d.ts +3 -2
- package/dist/fs/overlay-fs/overlay-fs.d.ts +10 -4
- package/dist/fs/read-write-fs/read-write-fs.d.ts +4 -4
- package/dist/index.d.ts +2 -0
- package/dist/interpreter/builtin-dispatch.d.ts +5 -4
- package/dist/interpreter/builtins/eval.d.ts +2 -1
- package/dist/interpreter/builtins/mapfile.d.ts +1 -1
- package/dist/interpreter/builtins/read.d.ts +1 -1
- package/dist/interpreter/control-flow.d.ts +2 -1
- package/dist/interpreter/errors.d.ts +20 -25
- package/dist/interpreter/functions.d.ts +2 -1
- package/dist/interpreter/helpers/loop.d.ts +4 -3
- package/dist/interpreter/helpers/result.d.ts +18 -32
- package/dist/interpreter/helpers/statements.d.ts +4 -3
- package/dist/interpreter/interpreter.d.ts +2 -4
- package/dist/interpreter/pipeline-execution.d.ts +2 -1
- package/dist/interpreter/subshell-group.d.ts +4 -3
- package/dist/interpreter/types.d.ts +4 -3
- package/dist/test-utils.d.ts +2 -3
- package/dist/types.d.ts +19 -91
- package/dist/utils/bytes.d.ts +0 -2
- package/dist/utils/stream.d.ts +65 -0
- package/package.json +1 -1
- package/dist/bin/chunks/alias-23G4Q2RS.js +0 -2
- package/dist/bin/chunks/awk2-Z6VRXKAK.js +0 -2
- package/dist/bin/chunks/base64-XCZKQZ7Z.js +0 -2
- package/dist/bin/chunks/basename-MPQ7M4RF.js +0 -2
- package/dist/bin/chunks/bash-OQ32Y5I6.js +0 -2
- package/dist/bin/chunks/bytes-6YUZMX3P.js +0 -2
- package/dist/bin/chunks/cat-CL5ISR5P.js +0 -2
- package/dist/bin/chunks/chmod-R6IWRSKZ.js +0 -2
- package/dist/bin/chunks/chunk-227L3ACM.js +0 -23
- package/dist/bin/chunks/chunk-2QA4P6HI.js +0 -12
- package/dist/bin/chunks/chunk-3MFM4GSH.js +0 -36
- package/dist/bin/chunks/chunk-3UP5LXDO.js +0 -3
- package/dist/bin/chunks/chunk-47P7JSQI.js +0 -2
- package/dist/bin/chunks/chunk-4KBTPDQB.js +0 -3
- package/dist/bin/chunks/chunk-4UK2MV3F.js +0 -13
- package/dist/bin/chunks/chunk-563AO4OL.js +0 -7
- package/dist/bin/chunks/chunk-5HDWUXRX.js +0 -7
- package/dist/bin/chunks/chunk-5MCFI6LE.js +0 -5
- package/dist/bin/chunks/chunk-6FNFX5GG.js +0 -5
- package/dist/bin/chunks/chunk-6NYIHYDY.js +0 -7
- package/dist/bin/chunks/chunk-6Y4TKR73.js +0 -16
- package/dist/bin/chunks/chunk-7C7WEK46.js +0 -23
- package/dist/bin/chunks/chunk-7TNGQWY6.js +0 -6
- package/dist/bin/chunks/chunk-7UAWRBQS.js +0 -9
- package/dist/bin/chunks/chunk-ARGU3OIG.js +0 -17
- package/dist/bin/chunks/chunk-BA3A5BYZ.js +0 -3
- package/dist/bin/chunks/chunk-BB7T22CF.js +0 -140
- package/dist/bin/chunks/chunk-BY24LKGP.js +0 -8
- package/dist/bin/chunks/chunk-ELZHJGI7.js +0 -10
- package/dist/bin/chunks/chunk-F46CSMUF.js +0 -2
- package/dist/bin/chunks/chunk-FQX4G5RH.js +0 -7
- package/dist/bin/chunks/chunk-G43H2WGH.js +0 -17
- package/dist/bin/chunks/chunk-GMJWC3MC.js +0 -12
- package/dist/bin/chunks/chunk-HVDU57EV.js +0 -16
- package/dist/bin/chunks/chunk-HWGK3XW7.js +0 -6
- package/dist/bin/chunks/chunk-HYR7G7KS.js +0 -3
- package/dist/bin/chunks/chunk-I2225JSU.js +0 -14
- package/dist/bin/chunks/chunk-I2FUQZXU.js +0 -11
- package/dist/bin/chunks/chunk-IBHPKKIT.js +0 -10
- package/dist/bin/chunks/chunk-IKNNFJNZ.js +0 -14
- package/dist/bin/chunks/chunk-INPUJM7Y.js +0 -8
- package/dist/bin/chunks/chunk-IOBKPMWJ.js +0 -9
- package/dist/bin/chunks/chunk-IYSA2L6A.js +0 -13
- package/dist/bin/chunks/chunk-JMLNX7GE.js +0 -287
- package/dist/bin/chunks/chunk-K6DD7NH3.js +0 -9
- package/dist/bin/chunks/chunk-KFLJ4EMB.js +0 -4
- package/dist/bin/chunks/chunk-KOMDAXHM.js +0 -7
- package/dist/bin/chunks/chunk-KV7ZTM2R.js +0 -11
- package/dist/bin/chunks/chunk-LCCVVEJA.js +0 -10
- package/dist/bin/chunks/chunk-LUPJK5US.js +0 -84
- package/dist/bin/chunks/chunk-LWF3XDOC.js +0 -32
- package/dist/bin/chunks/chunk-LXNARM2C.js +0 -9
- package/dist/bin/chunks/chunk-LXZS3X5T.js +0 -9
- package/dist/bin/chunks/chunk-M4ICSCXT.js +0 -100
- package/dist/bin/chunks/chunk-MEBZXRGE.js +0 -5
- package/dist/bin/chunks/chunk-MSPSS36S.js +0 -16
- package/dist/bin/chunks/chunk-N335RIGZ.js +0 -20
- package/dist/bin/chunks/chunk-N5KGQWJH.js +0 -5
- package/dist/bin/chunks/chunk-NDHTQE5T.js +0 -8
- package/dist/bin/chunks/chunk-NF5G7X3O.js +0 -7
- package/dist/bin/chunks/chunk-NGKNJ6V2.js +0 -11
- package/dist/bin/chunks/chunk-OKQ6RACF.js +0 -73
- package/dist/bin/chunks/chunk-PBY7XGZ6.js +0 -8
- package/dist/bin/chunks/chunk-PHHNNFRS.js +0 -6
- package/dist/bin/chunks/chunk-PO6Y7TWQ.js +0 -6
- package/dist/bin/chunks/chunk-Q4TLKLIZ.js +0 -12
- package/dist/bin/chunks/chunk-QS6LP3E3.js +0 -6
- package/dist/bin/chunks/chunk-QT2GMJRJ.js +0 -8
- package/dist/bin/chunks/chunk-QUVW3R4I.js +0 -5
- package/dist/bin/chunks/chunk-QUYWT2TY.js +0 -21
- package/dist/bin/chunks/chunk-QWUII542.js +0 -2
- package/dist/bin/chunks/chunk-R5EQDD5Y.js +0 -13
- package/dist/bin/chunks/chunk-RQSPCXDR.js +0 -2
- package/dist/bin/chunks/chunk-RTC6C5QW.js +0 -2
- package/dist/bin/chunks/chunk-S23TISYL.js +0 -6
- package/dist/bin/chunks/chunk-S5W2KVHC.js +0 -2
- package/dist/bin/chunks/chunk-SDXDICI4.js +0 -2
- package/dist/bin/chunks/chunk-SX7TI7Q2.js +0 -3
- package/dist/bin/chunks/chunk-TDJ55L4A.js +0 -16
- package/dist/bin/chunks/chunk-TNPUAMV3.js +0 -8
- package/dist/bin/chunks/chunk-TSGSFBQI.js +0 -14
- package/dist/bin/chunks/chunk-U5ZE562V.js +0 -2
- package/dist/bin/chunks/chunk-UIMH6I3G.js +0 -33
- package/dist/bin/chunks/chunk-UXPY5T2P.js +0 -9
- package/dist/bin/chunks/chunk-V5I6PHN2.js +0 -14
- package/dist/bin/chunks/chunk-VOTJNR36.js +0 -5
- package/dist/bin/chunks/chunk-W5XFREQC.js +0 -3
- package/dist/bin/chunks/chunk-X2MOXVGO.js +0 -26
- package/dist/bin/chunks/chunk-XOGQUO62.js +0 -2
- package/dist/bin/chunks/chunk-Y57BDPQ5.js +0 -6
- package/dist/bin/chunks/chunk-YE6KXFFU.js +0 -2
- package/dist/bin/chunks/chunk-YEPWKN4F.js +0 -3
- package/dist/bin/chunks/chunk-ZD5OTNAU.js +0 -63
- package/dist/bin/chunks/chunk-ZEDWVSUZ.js +0 -19
- package/dist/bin/chunks/chunk-ZI4TTZL5.js +0 -21
- package/dist/bin/chunks/chunk-ZZVIGHYS.js +0 -7
- package/dist/bin/chunks/clear-27OP2FQZ.js +0 -2
- package/dist/bin/chunks/column-FJNKONCJ.js +0 -2
- package/dist/bin/chunks/comm-5FNEJE7X.js +0 -2
- package/dist/bin/chunks/cp-LVKHKFHQ.js +0 -2
- package/dist/bin/chunks/curl-S4FJSZA5.js +0 -26
- package/dist/bin/chunks/cut-UXU6PNTT.js +0 -2
- package/dist/bin/chunks/date-GGPTXVUT.js +0 -2
- package/dist/bin/chunks/diff-3V3FOITV.js +0 -2
- package/dist/bin/chunks/dirname-455JDV2M.js +0 -2
- package/dist/bin/chunks/du-WUEAQO2W.js +0 -2
- package/dist/bin/chunks/echo-HBXOI5TQ.js +0 -2
- package/dist/bin/chunks/env-MXFHTVHS.js +0 -2
- package/dist/bin/chunks/expand-F4FM4ML2.js +0 -2
- package/dist/bin/chunks/expansion-7AYBVOIQ.js +0 -2
- package/dist/bin/chunks/expr-5ZKR5ER5.js +0 -2
- package/dist/bin/chunks/file-BFN7BKUR.js +0 -2
- package/dist/bin/chunks/find-W4BCEJEC.js +0 -2
- package/dist/bin/chunks/flag-coverage-RODPAQVH.js +0 -2
- package/dist/bin/chunks/fold-AE57YLOS.js +0 -2
- package/dist/bin/chunks/grep-I63BWUKL.js +0 -2
- package/dist/bin/chunks/gzip-X5IDXWZE.js +0 -2
- package/dist/bin/chunks/head-TBQETLQX.js +0 -2
- package/dist/bin/chunks/help-HGMKZ2GW.js +0 -2
- package/dist/bin/chunks/history-2DYRIL3U.js +0 -2
- package/dist/bin/chunks/hostname-RWEPTCXH.js +0 -2
- package/dist/bin/chunks/html-to-markdown-2VQWCEKU.js +0 -2
- package/dist/bin/chunks/join-TRRWQBEU.js +0 -2
- package/dist/bin/chunks/jq-NFKKH27D.js +0 -2
- package/dist/bin/chunks/ln-BSEVUP2J.js +0 -2
- package/dist/bin/chunks/ls-IJLTWVOI.js +0 -2
- package/dist/bin/chunks/md5sum-ZIQHOC4K.js +0 -2
- package/dist/bin/chunks/mkdir-KYFAO2SF.js +0 -2
- package/dist/bin/chunks/mv-TWM2PA7Q.js +0 -2
- package/dist/bin/chunks/nl-XLF2HFST.js +0 -2
- package/dist/bin/chunks/od-BOM6JPTH.js +0 -2
- package/dist/bin/chunks/paste-FUGXVGJX.js +0 -2
- package/dist/bin/chunks/printf-XUGNJ3QM.js +0 -2
- package/dist/bin/chunks/pwd-RZG6GZEU.js +0 -2
- package/dist/bin/chunks/python3-PIXJS3YM.js +0 -14
- package/dist/bin/chunks/readlink-4SOSIDHE.js +0 -2
- package/dist/bin/chunks/rev-5E5UGSUZ.js +0 -2
- package/dist/bin/chunks/rg-4YJSQZN7.js +0 -2
- package/dist/bin/chunks/rm-3PFOF4E3.js +0 -2
- package/dist/bin/chunks/rmdir-CSK7CGH5.js +0 -2
- package/dist/bin/chunks/sed-XBCUZMEP.js +0 -2
- package/dist/bin/chunks/seq-H7ID4VMK.js +0 -2
- package/dist/bin/chunks/sha1sum-EDQNYXXH.js +0 -2
- package/dist/bin/chunks/sha256sum-APTG6DO2.js +0 -2
- package/dist/bin/chunks/sleep-PNT7KILS.js +0 -2
- package/dist/bin/chunks/sort-ELAGZUES.js +0 -2
- package/dist/bin/chunks/split-QGXYUWBC.js +0 -2
- package/dist/bin/chunks/sqlite3-ELLMKNNJ.js +0 -2
- package/dist/bin/chunks/stat-Q2TZRKO3.js +0 -2
- package/dist/bin/chunks/strings-IGEGP5QX.js +0 -2
- package/dist/bin/chunks/tac-VOEDJLLG.js +0 -2
- package/dist/bin/chunks/tail-JOQASWMV.js +0 -2
- package/dist/bin/chunks/tar-IQNZQP7E.js +0 -2
- package/dist/bin/chunks/tee-IQLEDZOQ.js +0 -2
- package/dist/bin/chunks/time-VRCJK2LI.js +0 -2
- package/dist/bin/chunks/timeout-A36YWZWR.js +0 -2
- package/dist/bin/chunks/touch-5ECNQNBP.js +0 -2
- package/dist/bin/chunks/tr-AVALLN54.js +0 -2
- package/dist/bin/chunks/tree-UFM5EDXS.js +0 -2
- package/dist/bin/chunks/true-BU5JSAAW.js +0 -2
- package/dist/bin/chunks/unexpand-TDRWZW5F.js +0 -2
- package/dist/bin/chunks/uniq-IKBUNAMN.js +0 -2
- package/dist/bin/chunks/wc-2R4RS2SX.js +0 -2
- package/dist/bin/chunks/which-6UVGMXDF.js +0 -2
- package/dist/bin/chunks/whoami-N6TLTETT.js +0 -2
- package/dist/bin/chunks/xan-JX5QUK32.js +0 -2
- package/dist/bin/chunks/xan-view-NFMUMJ7Z.js +0 -2
- package/dist/bin/chunks/xargs-4MYN4U3C.js +0 -2
- package/dist/bin/chunks/yq-EHDQVD7S.js +0 -2
- package/dist/bin/shell/chunks/alias-23G4Q2RS.js +0 -2
- package/dist/bin/shell/chunks/awk2-Z6VRXKAK.js +0 -2
- package/dist/bin/shell/chunks/base64-XCZKQZ7Z.js +0 -2
- package/dist/bin/shell/chunks/basename-MPQ7M4RF.js +0 -2
- package/dist/bin/shell/chunks/bash-OQ32Y5I6.js +0 -2
- package/dist/bin/shell/chunks/bytes-6YUZMX3P.js +0 -2
- package/dist/bin/shell/chunks/cat-CL5ISR5P.js +0 -2
- package/dist/bin/shell/chunks/chmod-R6IWRSKZ.js +0 -2
- package/dist/bin/shell/chunks/chunk-227L3ACM.js +0 -23
- package/dist/bin/shell/chunks/chunk-2QA4P6HI.js +0 -12
- package/dist/bin/shell/chunks/chunk-3MFM4GSH.js +0 -36
- package/dist/bin/shell/chunks/chunk-3UP5LXDO.js +0 -3
- package/dist/bin/shell/chunks/chunk-47P7JSQI.js +0 -2
- package/dist/bin/shell/chunks/chunk-4KBTPDQB.js +0 -3
- package/dist/bin/shell/chunks/chunk-4UK2MV3F.js +0 -13
- package/dist/bin/shell/chunks/chunk-563AO4OL.js +0 -7
- package/dist/bin/shell/chunks/chunk-5HDWUXRX.js +0 -7
- package/dist/bin/shell/chunks/chunk-5MCFI6LE.js +0 -5
- package/dist/bin/shell/chunks/chunk-6FNFX5GG.js +0 -5
- package/dist/bin/shell/chunks/chunk-6NYIHYDY.js +0 -7
- package/dist/bin/shell/chunks/chunk-6Y4TKR73.js +0 -16
- package/dist/bin/shell/chunks/chunk-7C7WEK46.js +0 -23
- package/dist/bin/shell/chunks/chunk-7TNGQWY6.js +0 -6
- package/dist/bin/shell/chunks/chunk-7UAWRBQS.js +0 -9
- package/dist/bin/shell/chunks/chunk-ARGU3OIG.js +0 -17
- package/dist/bin/shell/chunks/chunk-BA3A5BYZ.js +0 -3
- package/dist/bin/shell/chunks/chunk-BB7T22CF.js +0 -140
- package/dist/bin/shell/chunks/chunk-BY24LKGP.js +0 -8
- package/dist/bin/shell/chunks/chunk-ELZHJGI7.js +0 -10
- package/dist/bin/shell/chunks/chunk-F46CSMUF.js +0 -2
- package/dist/bin/shell/chunks/chunk-FQX4G5RH.js +0 -7
- package/dist/bin/shell/chunks/chunk-G43H2WGH.js +0 -17
- package/dist/bin/shell/chunks/chunk-GMJWC3MC.js +0 -12
- package/dist/bin/shell/chunks/chunk-HVDU57EV.js +0 -16
- package/dist/bin/shell/chunks/chunk-HWGK3XW7.js +0 -6
- package/dist/bin/shell/chunks/chunk-HYR7G7KS.js +0 -3
- package/dist/bin/shell/chunks/chunk-I2225JSU.js +0 -14
- package/dist/bin/shell/chunks/chunk-I2FUQZXU.js +0 -11
- package/dist/bin/shell/chunks/chunk-IBHPKKIT.js +0 -10
- package/dist/bin/shell/chunks/chunk-IKNNFJNZ.js +0 -14
- package/dist/bin/shell/chunks/chunk-INPUJM7Y.js +0 -8
- package/dist/bin/shell/chunks/chunk-IOBKPMWJ.js +0 -9
- package/dist/bin/shell/chunks/chunk-IYSA2L6A.js +0 -13
- package/dist/bin/shell/chunks/chunk-JMLNX7GE.js +0 -287
- package/dist/bin/shell/chunks/chunk-K6DD7NH3.js +0 -9
- package/dist/bin/shell/chunks/chunk-KFLJ4EMB.js +0 -4
- package/dist/bin/shell/chunks/chunk-KOMDAXHM.js +0 -7
- package/dist/bin/shell/chunks/chunk-KV7ZTM2R.js +0 -11
- package/dist/bin/shell/chunks/chunk-LCCVVEJA.js +0 -10
- package/dist/bin/shell/chunks/chunk-LUPJK5US.js +0 -84
- package/dist/bin/shell/chunks/chunk-LWF3XDOC.js +0 -32
- package/dist/bin/shell/chunks/chunk-LXNARM2C.js +0 -9
- package/dist/bin/shell/chunks/chunk-LXZS3X5T.js +0 -9
- package/dist/bin/shell/chunks/chunk-M4ICSCXT.js +0 -100
- package/dist/bin/shell/chunks/chunk-MEBZXRGE.js +0 -5
- package/dist/bin/shell/chunks/chunk-MSPSS36S.js +0 -16
- package/dist/bin/shell/chunks/chunk-N335RIGZ.js +0 -20
- package/dist/bin/shell/chunks/chunk-N5KGQWJH.js +0 -5
- package/dist/bin/shell/chunks/chunk-NDHTQE5T.js +0 -8
- package/dist/bin/shell/chunks/chunk-NF5G7X3O.js +0 -7
- package/dist/bin/shell/chunks/chunk-NGKNJ6V2.js +0 -11
- package/dist/bin/shell/chunks/chunk-OKQ6RACF.js +0 -73
- package/dist/bin/shell/chunks/chunk-PBY7XGZ6.js +0 -8
- package/dist/bin/shell/chunks/chunk-PHHNNFRS.js +0 -6
- package/dist/bin/shell/chunks/chunk-PO6Y7TWQ.js +0 -6
- package/dist/bin/shell/chunks/chunk-Q4TLKLIZ.js +0 -12
- package/dist/bin/shell/chunks/chunk-QS6LP3E3.js +0 -6
- package/dist/bin/shell/chunks/chunk-QT2GMJRJ.js +0 -8
- package/dist/bin/shell/chunks/chunk-QUVW3R4I.js +0 -5
- package/dist/bin/shell/chunks/chunk-QUYWT2TY.js +0 -21
- package/dist/bin/shell/chunks/chunk-QWUII542.js +0 -2
- package/dist/bin/shell/chunks/chunk-R5EQDD5Y.js +0 -13
- package/dist/bin/shell/chunks/chunk-RQSPCXDR.js +0 -2
- package/dist/bin/shell/chunks/chunk-RTC6C5QW.js +0 -2
- package/dist/bin/shell/chunks/chunk-S23TISYL.js +0 -6
- package/dist/bin/shell/chunks/chunk-S5W2KVHC.js +0 -2
- package/dist/bin/shell/chunks/chunk-SDXDICI4.js +0 -2
- package/dist/bin/shell/chunks/chunk-SX7TI7Q2.js +0 -3
- package/dist/bin/shell/chunks/chunk-TDJ55L4A.js +0 -16
- package/dist/bin/shell/chunks/chunk-TNPUAMV3.js +0 -8
- package/dist/bin/shell/chunks/chunk-TSGSFBQI.js +0 -14
- package/dist/bin/shell/chunks/chunk-U5ZE562V.js +0 -2
- package/dist/bin/shell/chunks/chunk-UIMH6I3G.js +0 -33
- package/dist/bin/shell/chunks/chunk-UXPY5T2P.js +0 -9
- package/dist/bin/shell/chunks/chunk-V5I6PHN2.js +0 -14
- package/dist/bin/shell/chunks/chunk-VOTJNR36.js +0 -5
- package/dist/bin/shell/chunks/chunk-W5XFREQC.js +0 -3
- package/dist/bin/shell/chunks/chunk-X2MOXVGO.js +0 -26
- package/dist/bin/shell/chunks/chunk-XOGQUO62.js +0 -2
- package/dist/bin/shell/chunks/chunk-Y57BDPQ5.js +0 -6
- package/dist/bin/shell/chunks/chunk-YE6KXFFU.js +0 -2
- package/dist/bin/shell/chunks/chunk-YEPWKN4F.js +0 -3
- package/dist/bin/shell/chunks/chunk-ZD5OTNAU.js +0 -63
- package/dist/bin/shell/chunks/chunk-ZEDWVSUZ.js +0 -19
- package/dist/bin/shell/chunks/chunk-ZI4TTZL5.js +0 -21
- package/dist/bin/shell/chunks/chunk-ZZVIGHYS.js +0 -7
- package/dist/bin/shell/chunks/clear-27OP2FQZ.js +0 -2
- package/dist/bin/shell/chunks/column-FJNKONCJ.js +0 -2
- package/dist/bin/shell/chunks/comm-5FNEJE7X.js +0 -2
- package/dist/bin/shell/chunks/cp-LVKHKFHQ.js +0 -2
- package/dist/bin/shell/chunks/curl-S4FJSZA5.js +0 -26
- package/dist/bin/shell/chunks/cut-UXU6PNTT.js +0 -2
- package/dist/bin/shell/chunks/date-GGPTXVUT.js +0 -2
- package/dist/bin/shell/chunks/diff-3V3FOITV.js +0 -2
- package/dist/bin/shell/chunks/dirname-455JDV2M.js +0 -2
- package/dist/bin/shell/chunks/du-WUEAQO2W.js +0 -2
- package/dist/bin/shell/chunks/echo-HBXOI5TQ.js +0 -2
- package/dist/bin/shell/chunks/env-MXFHTVHS.js +0 -2
- package/dist/bin/shell/chunks/expand-F4FM4ML2.js +0 -2
- package/dist/bin/shell/chunks/expansion-7AYBVOIQ.js +0 -2
- package/dist/bin/shell/chunks/expr-5ZKR5ER5.js +0 -2
- package/dist/bin/shell/chunks/file-BFN7BKUR.js +0 -2
- package/dist/bin/shell/chunks/find-W4BCEJEC.js +0 -2
- package/dist/bin/shell/chunks/flag-coverage-RODPAQVH.js +0 -2
- package/dist/bin/shell/chunks/fold-AE57YLOS.js +0 -2
- package/dist/bin/shell/chunks/grep-I63BWUKL.js +0 -2
- package/dist/bin/shell/chunks/gzip-X5IDXWZE.js +0 -2
- package/dist/bin/shell/chunks/head-TBQETLQX.js +0 -2
- package/dist/bin/shell/chunks/help-HGMKZ2GW.js +0 -2
- package/dist/bin/shell/chunks/history-2DYRIL3U.js +0 -2
- package/dist/bin/shell/chunks/hostname-RWEPTCXH.js +0 -2
- package/dist/bin/shell/chunks/html-to-markdown-2VQWCEKU.js +0 -2
- package/dist/bin/shell/chunks/join-TRRWQBEU.js +0 -2
- package/dist/bin/shell/chunks/jq-NFKKH27D.js +0 -2
- package/dist/bin/shell/chunks/ln-BSEVUP2J.js +0 -2
- package/dist/bin/shell/chunks/ls-IJLTWVOI.js +0 -2
- package/dist/bin/shell/chunks/md5sum-ZIQHOC4K.js +0 -2
- package/dist/bin/shell/chunks/mkdir-KYFAO2SF.js +0 -2
- package/dist/bin/shell/chunks/mv-TWM2PA7Q.js +0 -2
- package/dist/bin/shell/chunks/nl-XLF2HFST.js +0 -2
- package/dist/bin/shell/chunks/od-BOM6JPTH.js +0 -2
- package/dist/bin/shell/chunks/paste-FUGXVGJX.js +0 -2
- package/dist/bin/shell/chunks/printf-XUGNJ3QM.js +0 -2
- package/dist/bin/shell/chunks/pwd-RZG6GZEU.js +0 -2
- package/dist/bin/shell/chunks/python3-PIXJS3YM.js +0 -14
- package/dist/bin/shell/chunks/readlink-4SOSIDHE.js +0 -2
- package/dist/bin/shell/chunks/rev-5E5UGSUZ.js +0 -2
- package/dist/bin/shell/chunks/rg-4YJSQZN7.js +0 -2
- package/dist/bin/shell/chunks/rm-3PFOF4E3.js +0 -2
- package/dist/bin/shell/chunks/rmdir-CSK7CGH5.js +0 -2
- package/dist/bin/shell/chunks/sed-XBCUZMEP.js +0 -2
- package/dist/bin/shell/chunks/seq-H7ID4VMK.js +0 -2
- package/dist/bin/shell/chunks/sha1sum-EDQNYXXH.js +0 -2
- package/dist/bin/shell/chunks/sha256sum-APTG6DO2.js +0 -2
- package/dist/bin/shell/chunks/sleep-PNT7KILS.js +0 -2
- package/dist/bin/shell/chunks/sort-ELAGZUES.js +0 -2
- package/dist/bin/shell/chunks/split-QGXYUWBC.js +0 -2
- package/dist/bin/shell/chunks/sqlite3-ELLMKNNJ.js +0 -2
- package/dist/bin/shell/chunks/stat-Q2TZRKO3.js +0 -2
- package/dist/bin/shell/chunks/strings-IGEGP5QX.js +0 -2
- package/dist/bin/shell/chunks/tac-VOEDJLLG.js +0 -2
- package/dist/bin/shell/chunks/tail-JOQASWMV.js +0 -2
- package/dist/bin/shell/chunks/tar-IQNZQP7E.js +0 -2
- package/dist/bin/shell/chunks/tee-IQLEDZOQ.js +0 -2
- package/dist/bin/shell/chunks/time-VRCJK2LI.js +0 -2
- package/dist/bin/shell/chunks/timeout-A36YWZWR.js +0 -2
- package/dist/bin/shell/chunks/touch-5ECNQNBP.js +0 -2
- package/dist/bin/shell/chunks/tr-AVALLN54.js +0 -2
- package/dist/bin/shell/chunks/tree-UFM5EDXS.js +0 -2
- package/dist/bin/shell/chunks/true-BU5JSAAW.js +0 -2
- package/dist/bin/shell/chunks/unexpand-TDRWZW5F.js +0 -2
- package/dist/bin/shell/chunks/uniq-IKBUNAMN.js +0 -2
- package/dist/bin/shell/chunks/wc-2R4RS2SX.js +0 -2
- package/dist/bin/shell/chunks/which-6UVGMXDF.js +0 -2
- package/dist/bin/shell/chunks/whoami-N6TLTETT.js +0 -2
- package/dist/bin/shell/chunks/xan-JX5QUK32.js +0 -2
- package/dist/bin/shell/chunks/xan-view-NFMUMJ7Z.js +0 -2
- package/dist/bin/shell/chunks/xargs-4MYN4U3C.js +0 -2
- package/dist/bin/shell/chunks/yq-EHDQVD7S.js +0 -2
- package/dist/bundle/chunks/alias-T2KDAHDL.js +0 -1
- package/dist/bundle/chunks/awk2-UIH6CPHX.js +0 -1
- package/dist/bundle/chunks/base64-5E5MPPWD.js +0 -1
- package/dist/bundle/chunks/basename-QT55QR7O.js +0 -1
- package/dist/bundle/chunks/bash-BZZ6TUGW.js +0 -1
- package/dist/bundle/chunks/bytes-W6ESHQ7F.js +0 -1
- package/dist/bundle/chunks/cat-WUR2OJUG.js +0 -1
- package/dist/bundle/chunks/chmod-LTQYKUUW.js +0 -1
- package/dist/bundle/chunks/chunk-24BT6QUB.js +0 -11
- package/dist/bundle/chunks/chunk-274QVGRQ.js +0 -2
- package/dist/bundle/chunks/chunk-2IKXAFP4.js +0 -11
- package/dist/bundle/chunks/chunk-2IO54DPD.js +0 -1
- package/dist/bundle/chunks/chunk-2VAJD54D.js +0 -13
- package/dist/bundle/chunks/chunk-34P4G5H7.js +0 -5
- package/dist/bundle/chunks/chunk-3R6EWKMD.js +0 -13
- package/dist/bundle/chunks/chunk-3SPSXVPQ.js +0 -2
- package/dist/bundle/chunks/chunk-43RXAZRC.js +0 -7
- package/dist/bundle/chunks/chunk-47LWQIG6.js +0 -15
- package/dist/bundle/chunks/chunk-4L3Y4LKT.js +0 -5
- package/dist/bundle/chunks/chunk-4LYDOEQ6.js +0 -4
- package/dist/bundle/chunks/chunk-4Q5DFBVQ.js +0 -6
- package/dist/bundle/chunks/chunk-4R5AUIZ4.js +0 -6
- package/dist/bundle/chunks/chunk-4UTZCT3W.js +0 -2
- package/dist/bundle/chunks/chunk-5FDLF2FN.js +0 -5
- package/dist/bundle/chunks/chunk-5HJSZMTG.js +0 -1
- package/dist/bundle/chunks/chunk-5NR6JZM4.js +0 -12
- package/dist/bundle/chunks/chunk-5PL72KVW.js +0 -7
- package/dist/bundle/chunks/chunk-6BM2WKUH.js +0 -23
- package/dist/bundle/chunks/chunk-6HLDZZOT.js +0 -4
- package/dist/bundle/chunks/chunk-7VHVF5PX.js +0 -20
- package/dist/bundle/chunks/chunk-A3YV3X3J.js +0 -6
- package/dist/bundle/chunks/chunk-AJNR4FJT.js +0 -8
- package/dist/bundle/chunks/chunk-AMQM5ZPF.js +0 -1
- package/dist/bundle/chunks/chunk-BCDE2QUY.js +0 -1
- package/dist/bundle/chunks/chunk-BVFIC7R6.js +0 -4
- package/dist/bundle/chunks/chunk-CC4HUWHZ.js +0 -4
- package/dist/bundle/chunks/chunk-CNCKROJZ.js +0 -10
- package/dist/bundle/chunks/chunk-CSFZQCAK.js +0 -139
- package/dist/bundle/chunks/chunk-CU7G2LMR.js +0 -1
- package/dist/bundle/chunks/chunk-CZP7PMAG.js +0 -4
- package/dist/bundle/chunks/chunk-D2OUCFAU.js +0 -8
- package/dist/bundle/chunks/chunk-DQTFPKDH.js +0 -5
- package/dist/bundle/chunks/chunk-DQXLKPVQ.js +0 -7
- package/dist/bundle/chunks/chunk-E6IR6BWV.js +0 -286
- package/dist/bundle/chunks/chunk-ELZ2RVIZ.js +0 -11
- package/dist/bundle/chunks/chunk-EVNUXIEZ.js +0 -2
- package/dist/bundle/chunks/chunk-F6FQRFZU.js +0 -6
- package/dist/bundle/chunks/chunk-FAECBHMR.js +0 -2
- package/dist/bundle/chunks/chunk-FBOLGXN4.js +0 -16
- package/dist/bundle/chunks/chunk-FNIOXBJW.js +0 -9
- package/dist/bundle/chunks/chunk-GD5SDRL7.js +0 -5
- package/dist/bundle/chunks/chunk-GEAGCSIY.js +0 -31
- package/dist/bundle/chunks/chunk-GI2KN5IL.js +0 -22
- package/dist/bundle/chunks/chunk-GOG2LNAH.js +0 -9
- package/dist/bundle/chunks/chunk-H2ENJVUI.js +0 -10
- package/dist/bundle/chunks/chunk-HDNR2KMO.js +0 -13
- package/dist/bundle/chunks/chunk-HJ37IXKX.js +0 -12
- package/dist/bundle/chunks/chunk-I36BZMR3.js +0 -1
- package/dist/bundle/chunks/chunk-I6YSZMB6.js +0 -15
- package/dist/bundle/chunks/chunk-IXD4Z54Z.js +0 -8
- package/dist/bundle/chunks/chunk-J44PYBAW.js +0 -2
- package/dist/bundle/chunks/chunk-JDREUEBG.js +0 -9
- package/dist/bundle/chunks/chunk-KA244HSE.js +0 -5
- package/dist/bundle/chunks/chunk-KKZJ6K7R.js +0 -8
- package/dist/bundle/chunks/chunk-KZ3P3SVS.js +0 -22
- package/dist/bundle/chunks/chunk-LIVSDOY2.js +0 -1
- package/dist/bundle/chunks/chunk-LX7SQKLW.js +0 -15
- package/dist/bundle/chunks/chunk-M5O5DYR7.js +0 -1
- package/dist/bundle/chunks/chunk-MML7K3J2.js +0 -6
- package/dist/bundle/chunks/chunk-NPZMNEW5.js +0 -6
- package/dist/bundle/chunks/chunk-O7N2RCS7.js +0 -1
- package/dist/bundle/chunks/chunk-OSYLT4VG.js +0 -4
- package/dist/bundle/chunks/chunk-OXRHP7HO.js +0 -3
- package/dist/bundle/chunks/chunk-OZOS3R6K.js +0 -99
- package/dist/bundle/chunks/chunk-OZQ4AW5X.js +0 -8
- package/dist/bundle/chunks/chunk-PNGAWBIZ.js +0 -10
- package/dist/bundle/chunks/chunk-PPUKM2B7.js +0 -13
- package/dist/bundle/chunks/chunk-PTELGM2J.js +0 -7
- package/dist/bundle/chunks/chunk-Q3TLRYBC.js +0 -72
- package/dist/bundle/chunks/chunk-Q5AOYNOX.js +0 -6
- package/dist/bundle/chunks/chunk-QEKGAAIL.js +0 -1
- package/dist/bundle/chunks/chunk-QIL3FXIC.js +0 -6
- package/dist/bundle/chunks/chunk-QNZEO23C.js +0 -8
- package/dist/bundle/chunks/chunk-R4IVADTA.js +0 -7
- package/dist/bundle/chunks/chunk-RK57WTFF.js +0 -12
- package/dist/bundle/chunks/chunk-RU5M6ZRS.js +0 -4
- package/dist/bundle/chunks/chunk-SBVBPPEQ.js +0 -5
- package/dist/bundle/chunks/chunk-SP22LBKJ.js +0 -20
- package/dist/bundle/chunks/chunk-UKS3AEEA.js +0 -32
- package/dist/bundle/chunks/chunk-UYR5HJI6.js +0 -7
- package/dist/bundle/chunks/chunk-V6ANTLBA.js +0 -15
- package/dist/bundle/chunks/chunk-VLGZJRPG.js +0 -16
- package/dist/bundle/chunks/chunk-VZUQMDOT.js +0 -2
- package/dist/bundle/chunks/chunk-XDQU6V6S.js +0 -19
- package/dist/bundle/chunks/chunk-XRVUJRYI.js +0 -35
- package/dist/bundle/chunks/chunk-ZCZOV2DS.js +0 -62
- package/dist/bundle/chunks/clear-NLKZY76S.js +0 -1
- package/dist/bundle/chunks/column-S7P64XRJ.js +0 -1
- package/dist/bundle/chunks/comm-FPLN4BYY.js +0 -1
- package/dist/bundle/chunks/cp-W5HXJH5J.js +0 -1
- package/dist/bundle/chunks/curl-UFR6W4B6.js +0 -25
- package/dist/bundle/chunks/cut-VNFQFCA7.js +0 -1
- package/dist/bundle/chunks/date-EDSSFONA.js +0 -1
- package/dist/bundle/chunks/diff-RR5VJXIT.js +0 -1
- package/dist/bundle/chunks/dirname-V7Z24BGZ.js +0 -1
- package/dist/bundle/chunks/du-QKRPQIMY.js +0 -1
- package/dist/bundle/chunks/echo-TR3BM2AJ.js +0 -1
- package/dist/bundle/chunks/env-SVQBHVZF.js +0 -1
- package/dist/bundle/chunks/expand-ZVCJ72RF.js +0 -1
- package/dist/bundle/chunks/expansion-OBOJBZTH.js +0 -1
- package/dist/bundle/chunks/expr-QRA5KFYV.js +0 -1
- package/dist/bundle/chunks/file-TORG4IVZ.js +0 -1
- package/dist/bundle/chunks/find-NAGPRRQ7.js +0 -1
- package/dist/bundle/chunks/flag-coverage-LGRO7HFL.js +0 -1
- package/dist/bundle/chunks/fold-L4U6GS2N.js +0 -1
- package/dist/bundle/chunks/grep-D6AI423Z.js +0 -1
- package/dist/bundle/chunks/gzip-4EFUBHN7.js +0 -1
- package/dist/bundle/chunks/head-KBQT2JAC.js +0 -1
- package/dist/bundle/chunks/help-F3TJS3LS.js +0 -1
- package/dist/bundle/chunks/history-OKEAINJD.js +0 -1
- package/dist/bundle/chunks/hostname-AGIPNJOC.js +0 -1
- package/dist/bundle/chunks/html-to-markdown-P2LSCPVF.js +0 -1
- package/dist/bundle/chunks/join-FTSZAZYU.js +0 -1
- package/dist/bundle/chunks/jq-TNIKCGGT.js +0 -1
- package/dist/bundle/chunks/ln-BWYUCELO.js +0 -1
- package/dist/bundle/chunks/ls-6BM6G675.js +0 -1
- package/dist/bundle/chunks/md5sum-ALFVDB3W.js +0 -1
- package/dist/bundle/chunks/mkdir-I3BZBLTZ.js +0 -1
- package/dist/bundle/chunks/mv-76WRD5SE.js +0 -1
- package/dist/bundle/chunks/nl-77Q7V2GV.js +0 -1
- package/dist/bundle/chunks/od-AA6TIC6A.js +0 -1
- package/dist/bundle/chunks/paste-C6JKQOHO.js +0 -1
- package/dist/bundle/chunks/printf-WOYMDX2I.js +0 -1
- package/dist/bundle/chunks/pwd-BE3B3ZPG.js +0 -1
- package/dist/bundle/chunks/python3-QFUFNW7I.js +0 -13
- package/dist/bundle/chunks/readlink-QI6K7ZZX.js +0 -1
- package/dist/bundle/chunks/rev-2FZQEIQG.js +0 -1
- package/dist/bundle/chunks/rg-CNS6SD3V.js +0 -1
- package/dist/bundle/chunks/rm-JMWEKCU4.js +0 -1
- package/dist/bundle/chunks/rmdir-5HDB4IQ7.js +0 -1
- package/dist/bundle/chunks/sed-CSUGXVBJ.js +0 -1
- package/dist/bundle/chunks/seq-UP62NDEL.js +0 -1
- package/dist/bundle/chunks/sha1sum-XXYTWQIW.js +0 -1
- package/dist/bundle/chunks/sha256sum-GD6AFWG3.js +0 -1
- package/dist/bundle/chunks/sleep-225KIGXI.js +0 -1
- package/dist/bundle/chunks/sort-BIWEEIVX.js +0 -1
- package/dist/bundle/chunks/split-QUFGLTTX.js +0 -1
- package/dist/bundle/chunks/sqlite3-3ZFEGTQ7.js +0 -1
- package/dist/bundle/chunks/stat-DIMPSC6S.js +0 -1
- package/dist/bundle/chunks/strings-LECMRXOT.js +0 -1
- package/dist/bundle/chunks/tac-A6JKZKWL.js +0 -1
- package/dist/bundle/chunks/tail-YGDXZZGG.js +0 -1
- package/dist/bundle/chunks/tar-K64VDNWF.js +0 -1
- package/dist/bundle/chunks/tee-J4MBDQJZ.js +0 -1
- package/dist/bundle/chunks/time-CVS7ESWV.js +0 -1
- package/dist/bundle/chunks/timeout-UX2PSLYJ.js +0 -1
- package/dist/bundle/chunks/touch-ATQADRUQ.js +0 -1
- package/dist/bundle/chunks/tr-QVFN4YWH.js +0 -1
- package/dist/bundle/chunks/tree-IY7WNFVF.js +0 -1
- package/dist/bundle/chunks/true-AKKYE7WM.js +0 -1
- package/dist/bundle/chunks/unexpand-2WTX7UPB.js +0 -1
- package/dist/bundle/chunks/uniq-XS6VGRO2.js +0 -1
- package/dist/bundle/chunks/wc-22EISCPD.js +0 -1
- package/dist/bundle/chunks/which-IWHCX6SW.js +0 -1
- package/dist/bundle/chunks/whoami-HCON4D7C.js +0 -1
- package/dist/bundle/chunks/xan-XDECJHII.js +0 -1
- package/dist/bundle/chunks/xan-view-IJ4EABH7.js +0 -1
- package/dist/bundle/chunks/xargs-5MMN7C6P.js +0 -1
- package/dist/bundle/chunks/yq-LQX5YIGM.js +0 -1
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import{a as v}from"./chunk-7VWUKGDV.js";import{a as T,b as C}from"./chunk-DFAHK2EQ.js";import{b as w,e as y,g as b}from"./chunk-RAUBS6MJ.js";import{k as x}from"./chunk-463VWH7H.js";var j={name:"column",summary:"columnate lists",usage:"column [OPTION]... [FILE]...",description:"Format input into multiple columns. By default, fills rows first. Use -t to create a table based on whitespace-delimited input.",options:["-t Create a table (determine columns from input)","-s SEP Input field delimiter (default: whitespace)","-o SEP Output field delimiter (default: two spaces)","-c WIDTH Output width for fill mode (default: 80)","-n Don't merge multiple adjacent delimiters"],examples:["ls | column # Fill columns with ls output","cat data | column -t # Format as table","column -t -s ',' file # Format CSV as table","column -c 40 file # Fill 40-char wide columns"]},E={table:{short:"t",long:"table",type:"boolean"},separator:{short:"s",type:"string"},outputSep:{short:"o",type:"string"},width:{short:"c",type:"number",default:80},noMerge:{short:"n",type:"boolean"}};function H(e,n,o){return n?o?e.split(n):e.split(n).filter(t=>t.length>0):o?e.split(/[ \t]/):e.split(/[ \t]+/).filter(t=>t.length>0)}function M(e){let n=[];for(let o of e)for(let t=0;t<o.length;t++){let l=o[t].length;(n[t]===void 0||l>n[t])&&(n[t]=l)}return n}function P(e,n){if(e.length===0)return"";let o=M(e),t=[];for(let l of e){let u=[];for(let s=0;s<l.length;s++)s===l.length-1?u.push(l[s]):u.push(l[s].padEnd(o[s]));t.push(u.join(n))}return t.join(`
|
|
3
|
+
`)}function L(e,n,o){if(e.length===0)return"";let t=Math.max(...e.map(a=>a.length)),l=o.length,u=t+l,s=Math.max(1,Math.floor((n+l)/u)),m=Math.ceil(e.length/s),d=[];for(let a=0;a<m;a++){let p=[];for(let i=0;i<s;i++){let c=i*m+a;c<e.length&&(i===s-1||(i+1)*m+a>=e.length?p.push(e[c]):p.push(e[c].padEnd(t)))}d.push(p.join(o))}return d.join(`
|
|
4
|
+
`)}var z={name:"column",execute:async(e,n)=>{let o=x(e);if(C(o))return T(j);let t=v("column",o,E);if(!t.ok)return t.error;let{table:l,separator:u,outputSep:s,width:m,noMerge:d}=t.result.flags,a=t.result.positional,p=s??" ",i;if(a.length===0)i=await b(n.stdin);else{let r=[],f=null;for(let g of a)if(g==="-")f===null&&(f=await b(n.stdin)),r.push(f);else{let S=n.fs.resolvePath(n.cwd,g);try{let W=await n.fs.readFileText(S);r.push(W)}catch{return{exitCode:1,stdout:w(),stderr:y(`column: ${g}: No such file or directory
|
|
5
|
+
`)}}}i=r.join("")}if(i===""||i.trim()==="")return{exitCode:0,stdout:w(),stderr:w()};let c=i.split(`
|
|
6
|
+
`);i.endsWith(`
|
|
7
|
+
`)&&c[c.length-1]===""&&c.pop();let F=c.filter(r=>r.trim().length>0),h;if(l){let r=F.map(f=>H(f,u,d));h=P(r,p)}else{let r=[];for(let f of F){let g=H(f,u,d);r.push(...g)}h=L(r,m,p)}return h.length>0&&(h+=`
|
|
8
|
+
`),{exitCode:0,stdout:y(h),stderr:w()}}},k={name:"column",flags:[{flag:"-t",type:"boolean"},{flag:"-s",type:"value",valueHint:"delimiter"},{flag:"-o",type:"value",valueHint:"string"},{flag:"-c",type:"value",valueHint:"number"},{flag:"-n",type:"boolean"}],stdinType:"text",needsFiles:!0};export{z as a,k as b};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import{a as y}from"./chunk-4VDEBYW7.js";import{a as x}from"./chunk-7VWUKGDV.js";import{b as u,e,g as l}from"./chunk-RAUBS6MJ.js";import{k as C}from"./chunk-463VWH7H.js";var h=`Usage: rmdir [-pv] DIRECTORY...
|
|
3
|
+
Remove empty directories.
|
|
4
|
+
|
|
5
|
+
Options:
|
|
6
|
+
-p, --parents Remove DIRECTORY and its ancestors
|
|
7
|
+
-v, --verbose Output a diagnostic for every directory processed`,D={parents:{short:"p",long:"parents",type:"boolean"},verbose:{short:"v",long:"verbose",type:"boolean"},help:{long:"help",type:"boolean"}},E={name:"rmdir",async execute(t,r){let o=C(t),s=x("rmdir",o,D);if(!s.ok)return s.error;if(s.result.flags.help)return{stdout:e(`${h}
|
|
8
|
+
`),stderr:u(),exitCode:0};let n=s.result.flags.parents,a=s.result.flags.verbose,m=s.result.positional;if(m.length===0)return{stdout:u(),stderr:e(`rmdir: missing operand
|
|
9
|
+
`),exitCode:1};let d="",c="",f=0;for(let p of m){let i=await $(r,p,n,a);d+=await l(i.stdout),c+=await l(i.stderr),i.exitCode!==0&&(f=i.exitCode)}return{stdout:e(d),stderr:e(c),exitCode:f}}};async function $(t,r,o,s){let n="",a="",d=t.fs.resolvePath(t.cwd,r),c=await w(t,d,r,s);if(n+=await l(c.stdout),a+=await l(c.stderr),c.exitCode!==0)return{stdout:e(n),stderr:e(a),exitCode:c.exitCode};if(o){let f=d,p=r;for(;;){let i=b(f),g=b(p);if(i===f||i==="/"||i==="."||g==="."||g==="")break;let v=await w(t,i,g,s);if(n+=await l(v.stdout),v.exitCode!==0)break;f=i,p=g}}return{stdout:e(n),stderr:e(a),exitCode:0}}async function w(t,r,o,s){try{if(!await t.fs.exists(r))return{stdout:u(),stderr:e(`rmdir: failed to remove '${o}': No such file or directory
|
|
10
|
+
`),exitCode:1};if(!(await t.fs.stat(r)).isDirectory)return{stdout:u(),stderr:e(`rmdir: failed to remove '${o}': Not a directory
|
|
11
|
+
`),exitCode:1};if((await t.fs.readdir(r)).length>0)return{stdout:u(),stderr:e(`rmdir: failed to remove '${o}': Directory not empty
|
|
12
|
+
`),exitCode:1};await t.fs.rm(r,{recursive:!1,force:!1});let d="";return s&&(d=`rmdir: removing directory, '${o}'
|
|
13
|
+
`),{stdout:e(d),stderr:u(),exitCode:0}}catch(n){let a=y(n);return{stdout:u(),stderr:e(`rmdir: failed to remove '${o}': ${a}
|
|
14
|
+
`),exitCode:1}}}function b(t){let r=t.replace(/\/+$/,""),o=r.lastIndexOf("/");return o===-1?".":o===0?"/":r.substring(0,o)}var k={name:"rmdir",flags:[{flag:"-p",type:"boolean"},{flag:"-v",type:"boolean"}],needsArgs:!0};export{E as a,k as b};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import{a as r,b as i,c as o}from"./chunk-RZ6FAJ25.js";import{a as s,b as n}from"./chunk-DFAHK2EQ.js";import{k as a}from"./chunk-463VWH7H.js";var u={name:"head",summary:"output the first part of files",usage:"head [OPTION]... [FILE]...",options:["-c, --bytes=NUM print the first NUM bytes","-n, --lines=NUM print the first NUM lines (default 10)","-q, --quiet never print headers giving file names","-v, --verbose always print headers giving file names"," --help display this help and exit"]},y={name:"head",async execute(l,p){let t=a(l);if(n(t))return s(u);let e=r(t,"head");if(!e.ok)return e.error;let{lines:d,bytes:f}=e.options;return i(p,e.options,"head",h=>o(h,d,f))}},v={name:"head",flags:[{flag:"-n",type:"value",valueHint:"number"},{flag:"-c",type:"value",valueHint:"number"},{flag:"-q",type:"boolean"},{flag:"-v",type:"boolean"}],stdinType:"text",needsFiles:!0};export{y as a,v as b};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import{a as h,b as g,c as N}from"./chunk-DFAHK2EQ.js";import{b as a,e as l,g as p}from"./chunk-RAUBS6MJ.js";import{k as b}from"./chunk-463VWH7H.js";var y={name:"nl",summary:"number lines of files",usage:"nl [OPTION]... [FILE]...",description:"Write each FILE to standard output, with line numbers added. If no FILE is specified, standard input is read.",options:["-b STYLE Body numbering style: a (all), t (non-empty), n (none)","-n FORMAT Number format: ln (left), rn (right), rz (right zeros)","-w WIDTH Number width (default: 6)","-s SEP Separator after number (default: TAB)","-v START Starting line number (default: 1)","-i INCR Line number increment (default: 1)"],examples:["nl file.txt # Number non-empty lines","nl -ba file.txt # Number all lines","nl -n rz -w 3 file.txt # Right-justified with zeros","nl -s ': ' file.txt # Use ': ' as separator"]};function x(u,s,r){let i=String(u);switch(s){case"ln":return i.padEnd(r);case"rn":return i.padStart(r);case"rz":return i.padStart(r,"0");default:return s}}function w(u,s){switch(s){case"a":return!0;case"t":return u.trim().length>0;case"n":return!1;default:return s}}function v(u,s,r){if(u==="")return{output:"",nextNumber:r};let i=u.split(`
|
|
3
|
+
`),o=[],t=r,d=u.endsWith(`
|
|
4
|
+
`)&&i[i.length-1]==="";d&&i.pop();for(let f of i)if(w(f,s.bodyStyle)){let n=x(t,s.numberFormat,s.width);o.push(`${n}${s.separator}${f}`),t+=s.increment}else{let n=" ".repeat(s.width);o.push(`${n}${s.separator}${f}`)}return{output:o.join(`
|
|
5
|
+
`)+(d?`
|
|
6
|
+
`:""),nextNumber:t}}var F={name:"nl",execute:async(u,s)=>{let r=b(u);if(g(r))return h(y);let i={bodyStyle:"t",numberFormat:"rn",width:6,separator:" ",startNumber:1,increment:1},o=[],t=0;for(;t<r.length;){let n=r[t];if(n==="-b"&&t+1<r.length){let e=r[t+1];if(e!=="a"&&e!=="t"&&e!=="n")return{exitCode:1,stdout:a(),stderr:l(`nl: invalid body numbering style: '${e}'
|
|
7
|
+
`)};i.bodyStyle=e,t+=2}else if(n.startsWith("-b")){let e=n.slice(2);if(e!=="a"&&e!=="t"&&e!=="n")return{exitCode:1,stdout:a(),stderr:l(`nl: invalid body numbering style: '${e}'
|
|
8
|
+
`)};i.bodyStyle=e,t++}else if(n==="-n"&&t+1<r.length){let e=r[t+1];if(e!=="ln"&&e!=="rn"&&e!=="rz")return{exitCode:1,stdout:a(),stderr:l(`nl: invalid line numbering format: '${e}'
|
|
9
|
+
`)};i.numberFormat=e,t+=2}else if(n.startsWith("-n")){let e=n.slice(2);if(e!=="ln"&&e!=="rn"&&e!=="rz")return{exitCode:1,stdout:a(),stderr:l(`nl: invalid line numbering format: '${e}'
|
|
10
|
+
`)};i.numberFormat=e,t++}else if(n==="-w"&&t+1<r.length){let e=parseInt(r[t+1],10);if(Number.isNaN(e)||e<1)return{exitCode:1,stdout:a(),stderr:l(`nl: invalid line number field width: '${r[t+1]}'
|
|
11
|
+
`)};i.width=e,t+=2}else if(n.startsWith("-w")){let e=parseInt(n.slice(2),10);if(Number.isNaN(e)||e<1)return{exitCode:1,stdout:a(),stderr:l(`nl: invalid line number field width: '${n.slice(2)}'
|
|
12
|
+
`)};i.width=e,t++}else if(n==="-s"&&t+1<r.length)i.separator=r[t+1],t+=2;else if(n.startsWith("-s"))i.separator=n.slice(2),t++;else if(n==="-v"&&t+1<r.length){let e=parseInt(r[t+1],10);if(Number.isNaN(e))return{exitCode:1,stdout:a(),stderr:l(`nl: invalid starting line number: '${r[t+1]}'
|
|
13
|
+
`)};i.startNumber=e,t+=2}else if(n.startsWith("-v")){let e=parseInt(n.slice(2),10);if(Number.isNaN(e))return{exitCode:1,stdout:a(),stderr:l(`nl: invalid starting line number: '${n.slice(2)}'
|
|
14
|
+
`)};i.startNumber=e,t++}else if(n==="-i"&&t+1<r.length){let e=parseInt(r[t+1],10);if(Number.isNaN(e))return{exitCode:1,stdout:a(),stderr:l(`nl: invalid line number increment: '${r[t+1]}'
|
|
15
|
+
`)};i.increment=e,t+=2}else if(n.startsWith("-i")){let e=parseInt(n.slice(2),10);if(Number.isNaN(e))return{exitCode:1,stdout:a(),stderr:l(`nl: invalid line number increment: '${n.slice(2)}'
|
|
16
|
+
`)};i.increment=e,t++}else if(n==="--"){o.push(...r.slice(t+1));break}else{if(n.startsWith("-")&&n!=="-")return N("nl",n);o.push(n),t++}}let d="",f=i.startNumber;if(o.length===0){let n=await p(s.stdin);d=v(n,i,f).output}else for(let n of o){let e=s.fs.resolvePath(s.cwd,n),m;try{m=await s.fs.readFileText(e)}catch{return{exitCode:1,stdout:l(d),stderr:l(`nl: ${n}: No such file or directory
|
|
17
|
+
`)}}let c=v(m,i,f);d+=c.output,f=c.nextNumber}return{exitCode:0,stdout:l(d),stderr:a()}}},I={name:"nl",flags:[{flag:"-b",type:"value",valueHint:"string"},{flag:"-n",type:"value",valueHint:"string"},{flag:"-w",type:"value",valueHint:"number"},{flag:"-s",type:"value",valueHint:"string"},{flag:"-v",type:"value",valueHint:"number"},{flag:"-i",type:"value",valueHint:"number"}],stdinType:"text",needsFiles:!0};export{F as a,I as b};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import{a as V,c as Q}from"./chunk-K2K4KPOQ.js";import{k as P}from"./chunk-XILOLP4K.js";import{a as R}from"./chunk-4VDEBYW7.js";import{a as G,b as H}from"./chunk-DFAHK2EQ.js";import{b as v,c as X,e as k}from"./chunk-RAUBS6MJ.js";import{c as de,e as pe,g as L,h as W,j as Y,k as q,l as z,m as O}from"./chunk-463VWH7H.js";var K=de(C=>{(function(){"use strict";var e={not_string:/[^s]/,not_bool:/[^t]/,not_type:/[^T]/,not_primitive:/[^v]/,number:/[diefg]/,numeric_arg:/[bcdiefguxX]/,json:/[j]/,not_json:/[^j]/,text:/^[^\x25]+/,modulo:/^\x25{2}/,placeholder:/^\x25(?:([1-9]\d*)\$|\(([^)]+)\))?(\+)?(0|'[^$])?(-)?(\d+)?(?:\.(\d+))?([b-gijostTuvxX])/,key:/^([a-z_][a-z_\d]*)/i,key_access:/^\.([a-z_][a-z_\d]*)/i,index_access:/^\[(\d+)\]/,sign:/^[+-]/};function c(r){return t(s(r),arguments)}function n(r,i){return c.apply(null,[r].concat(i||[]))}function t(r,i){var u=1,l=r.length,o,h="",d,p,f,m,y,w,x,g;for(d=0;d<l;d++)if(typeof r[d]=="string")h+=r[d];else if(typeof r[d]=="object"){if(f=r[d],f.keys)for(o=i[u],p=0;p<f.keys.length;p++){if(o==null)throw new Error(c('[sprintf] Cannot access property "%s" of undefined value "%s"',f.keys[p],f.keys[p-1]));o=o[f.keys[p]]}else f.param_no?o=i[f.param_no]:o=i[u++];if(e.not_type.test(f.type)&&e.not_primitive.test(f.type)&&o instanceof Function&&(o=o()),e.numeric_arg.test(f.type)&&typeof o!="number"&&isNaN(o))throw new TypeError(c("[sprintf] expecting number but found %T",o));switch(e.number.test(f.type)&&(x=o>=0),f.type){case"b":o=parseInt(o,10).toString(2);break;case"c":o=String.fromCharCode(parseInt(o,10));break;case"d":case"i":o=parseInt(o,10);break;case"j":o=JSON.stringify(o,null,f.width?parseInt(f.width):0);break;case"e":o=f.precision?parseFloat(o).toExponential(f.precision):parseFloat(o).toExponential();break;case"f":o=f.precision?parseFloat(o).toFixed(f.precision):parseFloat(o);break;case"g":o=f.precision?String(Number(o.toPrecision(f.precision))):parseFloat(o);break;case"o":o=(parseInt(o,10)>>>0).toString(8);break;case"s":o=String(o),o=f.precision?o.substring(0,f.precision):o;break;case"t":o=String(!!o),o=f.precision?o.substring(0,f.precision):o;break;case"T":o=Object.prototype.toString.call(o).slice(8,-1).toLowerCase(),o=f.precision?o.substring(0,f.precision):o;break;case"u":o=parseInt(o,10)>>>0;break;case"v":o=o.valueOf(),o=f.precision?o.substring(0,f.precision):o;break;case"x":o=(parseInt(o,10)>>>0).toString(16);break;case"X":o=(parseInt(o,10)>>>0).toString(16).toUpperCase();break}e.json.test(f.type)?h+=o:(e.number.test(f.type)&&(!x||f.sign)?(g=x?"+":"-",o=o.toString().replace(e.sign,"")):g="",y=f.pad_char?f.pad_char==="0"?"0":f.pad_char.charAt(1):" ",w=f.width-(g+o).length,m=f.width&&w>0?y.repeat(w):"",h+=f.align?g+o+m:y==="0"?g+m+o:m+g+o)}return h}var a=Object.create(null);function s(r){if(a[r])return a[r];for(var i=r,u,l=[],o=0;i;){if((u=e.text.exec(i))!==null)l.push(u[0]);else if((u=e.modulo.exec(i))!==null)l.push("%");else if((u=e.placeholder.exec(i))!==null){if(u[2]){o|=1;var h=[],d=u[2],p=[];if((p=e.key.exec(d))!==null)for(h.push(p[1]);(d=d.substring(p[0].length))!=="";)if((p=e.key_access.exec(d))!==null)h.push(p[1]);else if((p=e.index_access.exec(d))!==null)h.push(p[1]);else throw new SyntaxError("[sprintf] failed to parse named argument key");else throw new SyntaxError("[sprintf] failed to parse named argument key");u[2]=h}else o|=2;if(o===3)throw new Error("[sprintf] mixing positional and named placeholders is not (yet) supported");l.push({placeholder:u[0],param_no:u[1],keys:u[2],sign:u[3],pad_char:u[4],align:u[5],width:u[6],precision:u[7],type:u[8]})}else throw new SyntaxError("[sprintf] unexpected placeholder");i=i.substring(u[0].length)}return a[r]=l}typeof C<"u"&&(C.sprintf=c,C.vsprintf=n),typeof window<"u"&&(window.sprintf=c,window.vsprintf=n,typeof define=="function"&&define.amd&&define(function(){return{sprintf:c,vsprintf:n}}))})()});var M=pe(K(),1);function re(e,c,n){let t=new Date(c*1e3),a="",s=0;for(;s<e.length;)if(e[s]==="%"&&s+1<e.length){let r=e[s+1],i=ge(t,r,n);i!==null?(a+=i,s+=2):(a+=e[s],s++)}else a+=e[s],s++;return a}function he(e,c){let n={year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",weekday:"short",hour12:!1,timeZone:c};try{let a=new Intl.DateTimeFormat("en-US",n).formatToParts(e),s=u=>a.find(l=>l.type===u)?.value??"",r=new Map([["Sun",0],["Mon",1],["Tue",2],["Wed",3],["Thu",4],["Fri",5],["Sat",6]]),i=s("weekday");return{year:Number.parseInt(s("year"),10)||e.getFullYear(),month:Number.parseInt(s("month"),10)||e.getMonth()+1,day:Number.parseInt(s("day"),10)||e.getDate(),hour:Number.parseInt(s("hour"),10)||e.getHours(),minute:Number.parseInt(s("minute"),10)||e.getMinutes(),second:Number.parseInt(s("second"),10)||e.getSeconds(),weekday:r.get(i)??e.getDay()}}catch{return{year:e.getFullYear(),month:e.getMonth()+1,day:e.getDate(),hour:e.getHours(),minute:e.getMinutes(),second:e.getSeconds(),weekday:e.getDay()}}}function ge(e,c,n){let t=he(e,n),a=(u,l=2)=>String(u).padStart(l,"0"),s=ne(t.year,t.month,t.day),r=ee(t.year,t.month,t.day,t.weekday,0),i=ee(t.year,t.month,t.day,t.weekday,1);switch(c){case"a":return["Sun","Mon","Tue","Wed","Thu","Fri","Sat"][t.weekday];case"A":return["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"][t.weekday];case"b":case"h":return["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"][t.month-1];case"B":return["January","February","March","April","May","June","July","August","September","October","November","December"][t.month-1];case"c":return`${["Sun","Mon","Tue","Wed","Thu","Fri","Sat"][t.weekday]} ${["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"][t.month-1]} ${String(t.day).padStart(2," ")} ${a(t.hour)}:${a(t.minute)}:${a(t.second)} ${t.year}`;case"C":return a(Math.floor(t.year/100));case"d":return a(t.day);case"D":return`${a(t.month)}/${a(t.day)}/${a(t.year%100)}`;case"e":return String(t.day).padStart(2," ");case"F":return`${t.year}-${a(t.month)}-${a(t.day)}`;case"g":return a(te(t.year,t.month,t.day)%100);case"G":return String(te(t.year,t.month,t.day));case"H":return a(t.hour);case"I":return a(t.hour%12||12);case"j":return String(s).padStart(3,"0");case"k":return String(t.hour).padStart(2," ");case"l":return String(t.hour%12||12).padStart(2," ");case"m":return a(t.month);case"M":return a(t.minute);case"n":return`
|
|
3
|
+
`;case"N":return"000000000";case"p":return t.hour<12?"AM":"PM";case"P":return t.hour<12?"am":"pm";case"r":return`${a(t.hour%12||12)}:${a(t.minute)}:${a(t.second)} ${t.hour<12?"AM":"PM"}`;case"R":return`${a(t.hour)}:${a(t.minute)}`;case"s":return String(Math.floor(e.getTime()/1e3));case"S":return a(t.second);case"t":return" ";case"T":return`${a(t.hour)}:${a(t.minute)}:${a(t.second)}`;case"u":return String(t.weekday===0?7:t.weekday);case"U":return a(r);case"V":return a(xe(t.year,t.month,t.day));case"w":return String(t.weekday);case"W":return a(i);case"x":return`${a(t.month)}/${a(t.day)}/${a(t.year%100)}`;case"X":return`${a(t.hour)}:${a(t.minute)}:${a(t.second)}`;case"y":return a(t.year%100);case"Y":return String(t.year);case"z":return me(e,n);case"Z":return ye(e,n);case"%":return"%";default:return null}}function me(e,c){if(!c){let r=-e.getTimezoneOffset(),i=r>=0?"+":"-",u=Math.floor(Math.abs(r)/60),l=Math.abs(r)%60;return`${i}${String(u).padStart(2,"0")}${String(l).padStart(2,"0")}`}try{let u=new Intl.DateTimeFormat("en-US",{timeZone:c,timeZoneName:"longOffset"}).formatToParts(e).find(l=>l.type==="timeZoneName");if(u){let l=u.value.match(/GMT([+-])(\d{2}):(\d{2})/);if(l)return`${l[1]}${l[2]}${l[3]}`;if(u.value==="GMT"||u.value==="UTC")return"+0000"}}catch{}let n=-e.getTimezoneOffset(),t=n>=0?"+":"-",a=Math.floor(Math.abs(n)/60),s=Math.abs(n)%60;return`${t}${String(a).padStart(2,"0")}${String(s).padStart(2,"0")}`}function ye(e,c){try{return new Intl.DateTimeFormat("en-US",{timeZone:c,timeZoneName:"short"}).formatToParts(e).find(s=>s.type==="timeZoneName")?.value??"UTC"}catch{return"UTC"}}function ne(e,c,n){let t=[31,28,31,30,31,30,31,31,30,31,30,31];(e%4===0&&e%100!==0||e%400===0)&&(t[1]=29);let s=n;for(let r=0;r<c-1;r++)s+=t[r];return s}function ee(e,c,n,t,a){let s=ne(e,c,n),u=(new Date(e,0,1).getDay()-a+7)%7,l=(t-a+7)%7,o=s-1+u;return Math.floor((o-l+7)/7)}function xe(e,c,n){let t=new Date(e,c-1,n,12,0,0);t.setDate(t.getDate()+3-(t.getDay()+6)%7);let a=new Date(t.getFullYear(),0,4);a.setDate(a.getDate()+3-(a.getDay()+6)%7);let s=t.getTime()-a.getTime();return 1+Math.round(s/(10080*60*1e3))}function te(e,c,n){let t=new Date(e,c-1,n,12,0,0);return t.setDate(t.getDate()+3-(t.getDay()+6)%7),t.getFullYear()}var I=new TextEncoder;function N(e,c){for(let n=0;n<c.length;n++)e.push(c[n])}function E(e,c){N(e,I.encode(c))}var Se={name:"printf",summary:"format and print data",usage:"printf [-v var] FORMAT [ARGUMENT...]",options:[" -v var assign the output to shell variable VAR rather than display it"," --help display this help and exit"],notes:["FORMAT controls the output like in C printf.","Escape sequences: \\n (newline), \\t (tab), \\\\ (backslash)","Format specifiers: %s (string), %d (integer), %f (float), %x (hex), %o (octal), %% (literal %)","Width and precision: %10s (width 10), %.2f (2 decimal places), %010d (zero-padded)","Flags: %- (left-justify), %+ (show sign), %0 (zero-pad)"]},Oe={name:"printf",async execute(e,c){let n=q(e);if(H(n))return G(Se);if(n.length===0)return{stdout:v(),stderr:k(`printf: usage: printf format [arguments]
|
|
4
|
+
`),exitCode:2};let t=null,a=0;for(;a<n.length;){let u=n[a];if(u==="--"){a++;break}if(u==="-v"){if(a+1>=n.length)return{stdout:v(),stderr:k(`printf: -v: option requires an argument
|
|
5
|
+
`),exitCode:1};if(t=n[a+1],!/^[a-zA-Z_][a-zA-Z0-9_]*(\[[^\]]+\])?$/.test(t))return{stdout:v(),stderr:k(`printf: \`${t}': not a valid identifier
|
|
6
|
+
`),exitCode:2};a+=2}else{if(u.startsWith("-")&&u!=="-")break;break}}if(a>=n.length)return{stdout:v(),stderr:k(`printf: usage: printf format [arguments]
|
|
7
|
+
`),exitCode:1};let s=n[a],r=n.slice(a+1),i=e.slice(a+1);try{let u=Q(s),l=L,o=0,h=!1,d="",p=z(c.env,"TZ")||void 0,f=c.limits?.maxStringLength;do{let{result:m,argsConsumed:y,error:w,errMsg:x,stopped:g}=be(u,r,o,p,i);if(l=Y(l,m),f!==void 0&&f>0&&l.length>f)throw new P(`printf: output size limit exceeded (${f} bytes)`,"string_length");if(o+=y,w&&(h=!0,x&&(d=x)),g)break}while(o<r.length&&o>0);if(o===0&&r.length>0,t){let m=new TextDecoder().decode(l),y=t.match(/^([a-zA-Z_][a-zA-Z0-9_]*)\[(['"]?)(.+?)\2\]$/);if(y){let w=y[1],x=y[3];x=x.replace(/\$([a-zA-Z_][a-zA-Z0-9_]*)/g,(g,T)=>z(c.env,T)),O(c.env,`${w}_${x}`,m)}else O(c.env,t,m);return{stdout:v(),stderr:k(d),exitCode:h?1:0}}return{stdout:X(l),stderr:k(d),exitCode:h?1:0}}catch(u){if(u instanceof P)throw u;return{stdout:v(),stderr:k(`printf: ${R(u)}
|
|
8
|
+
`),exitCode:1}}}};function we(e){return String.fromCharCode(e)}function se(e){return e>=48&&e<=57}function be(e,c,n,t,a){let s=[],r=0,i=0,u=!1,l="";for(;r<e.length;)if(e[r]===37&&r+1<e.length){let o=r;if(r++,e[r]===37){s.push(37),r++;continue}let d=new TextDecoder().decode(e.subarray(o)).match(/^%(-?\d*)(?:\.(\d+))?\(([^)]*)\)T/);if(d){let $=d[1]?parseInt(d[1],10):0,_=d[2]?parseInt(d[2],10):-1,le=d[3],fe=I.encode(d[0]),F=c[n+i]||"";i++;let A;F===""||F==="-1"||F==="-2"?A=Math.floor(Date.now()/1e3):A=parseInt(F,10)||0;let b=re(le,A,t);if(_>=0&&b.length>_&&(b=b.slice(0,_)),$!==0){let j=Math.abs($);b.length<j&&($<0?b=b.padEnd(j," "):b=b.padStart(j," "))}E(s,b),r=o+fe.length;continue}for(;r<e.length&&(e[r]===43||e[r]===45||e[r]===48||e[r]===32||e[r]===35||e[r]===39);)r++;let p=!1;if(e[r]===42)p=!0,r++;else for(;r<e.length&&se(e[r]);)r++;let f=!1;if(e[r]===46)if(r++,e[r]===42)f=!0,r++;else for(;r<e.length&&se(e[r]);)r++;r<e.length&&(e[r]===104||e[r]===108||e[r]===76)&&r++;let m=r<e.length?e[r]:0,y=m?we(m):"";r++;let w=e.subarray(o,r),g=new TextDecoder().decode(w);if(p){let $=parseInt(c[n+i]||"0",10);i++,g=g.replace("*",String($))}if(f){let $=parseInt(c[n+i]||"0",10);i++,g=g.replace(".*",`.${$}`)}let T=n+i,Z=c[T]||"",ie=a?.[T]??W(Z);i++;let{value:oe,rawBytes:B,parseError:ce,parseErrMsg:J,stopped:ue}=ke(g,y,Z,ie);if(B?N(s,B):E(s,oe),ce&&(u=!0,J&&(l=J)),ue)return{result:new Uint8Array(s),argsConsumed:i,error:u,errMsg:l,stopped:!0}}else s.push(e[r]),r++;return{result:new Uint8Array(s),argsConsumed:i,error:u,errMsg:l,stopped:!1}}function ke(e,c,n,t){let a=!1,s="";switch(c){case"d":case"i":{let r=D(n);return a=S,a&&(s=`printf: ${n}: invalid number
|
|
9
|
+
`),{value:ae(e,r),parseError:a,parseErrMsg:s}}case"o":{let r=D(n);return a=S,a&&(s=`printf: ${n}: invalid number
|
|
10
|
+
`),{value:$e(e,r),parseError:a,parseErrMsg:s}}case"u":{let r=D(n);a=S,a&&(s=`printf: ${n}: invalid number
|
|
11
|
+
`);let i=r<0?r>>>0:r;return{value:ae(e.replace("u","d"),i),parseError:a,parseErrMsg:s}}case"x":case"X":{let r=D(n);return a=S,a&&(s=`printf: ${n}: invalid number
|
|
12
|
+
`),{value:ve(e,r),parseError:a,parseErrMsg:s}}case"e":case"E":case"f":case"F":case"g":case"G":{let r=parseFloat(n)||0;return{value:Te(e,c,r),parseError:!1,parseErrMsg:""}}case"c":{if(n==="")return{value:"",parseError:!1,parseErrMsg:""};let r=I.encode(n);return{value:"",rawBytes:new Uint8Array([r[0]]),parseError:!1,parseErrMsg:""}}case"s":return{value:Ee(e,n),parseError:!1,parseErrMsg:""};case"q":return{value:Ie(e,t??W(n)),parseError:!1,parseErrMsg:""};case"b":{let r=Fe(n);return{value:"",rawBytes:r.value,parseError:!1,parseErrMsg:"",stopped:r.stopped}}default:try{return{value:(0,M.sprintf)(e,n),parseError:!1,parseErrMsg:""}}catch{return{value:"",parseError:!0,parseErrMsg:`printf: [sprintf] unexpected placeholder
|
|
13
|
+
`}}}}var S=!1;function D(e){S=!1;let c=e.trimStart(),n=c!==c.trimEnd();if(e=c.trimEnd(),e.startsWith("'")&&e.length>=2||e.startsWith('"')&&e.length>=2)return e.charCodeAt(1);if(e.startsWith("\\'")&&e.length>=3||e.startsWith('\\"')&&e.length>=3)return e.charCodeAt(2);if(e.startsWith("+")&&(e=e.slice(1)),e.startsWith("0x")||e.startsWith("0X")){let t=parseInt(e,16);return Number.isNaN(t)?(S=!0,0):(n&&(S=!0),t)}if(e.startsWith("0")&&e.length>1&&/^-?0[0-7]+$/.test(e))return n&&(S=!0),parseInt(e,8)||0;if(/^\d+#/.test(e)){S=!0;let t=e.match(/^(\d+)#/);return t?parseInt(t[1],10):0}if(e!==""&&!/^-?\d+$/.test(e)){S=!0;let t=parseInt(e,10);return Number.isNaN(t)?0:t}return n&&(S=!0),parseInt(e,10)||0}function ae(e,c){let n=e.match(/^%([- +#0']*)(\d*)(\.(\d*))?[diu]$/);if(!n)return(0,M.sprintf)(e.replace(/\.\d*/,""),c);let t=n[1]||"",a=n[2]?parseInt(n[2],10):0,s=n[3]!==void 0?n[4]?parseInt(n[4],10):0:-1,r=c<0,i=Math.abs(c),u=String(i);s>=0&&(u=u.padStart(s,"0"));let l="";r?l="-":t.includes("+")?l="+":t.includes(" ")&&(l=" ");let o=l+u;return a>o.length&&(t.includes("-")?o=o.padEnd(a," "):t.includes("0")&&s<0?o=l+u.padStart(a-l.length,"0"):o=o.padStart(a," ")),o}function $e(e,c){let n=e.match(/^%([- +#0']*)(\d*)(\.(\d*))?o$/);if(!n)return(0,M.sprintf)(e,c);let t=n[1]||"",a=n[2]?parseInt(n[2],10):0,s=n[3]!==void 0?n[4]?parseInt(n[4],10):0:-1,r=Math.abs(c).toString(8);s>=0&&(r=r.padStart(s,"0")),t.includes("#")&&!r.startsWith("0")&&(r=`0${r}`);let i=r;return a>i.length&&(t.includes("-")?i=i.padEnd(a," "):t.includes("0")&&s<0?i=i.padStart(a,"0"):i=i.padStart(a," ")),i}function ve(e,c){let n=e.includes("X"),t=e.match(/^%([- +#0']*)(\d*)(\.(\d*))?[xX]$/);if(!t)return(0,M.sprintf)(e,c);let a=t[1]||"",s=t[2]?parseInt(t[2],10):0,r=t[3]!==void 0?t[4]?parseInt(t[4],10):0:-1,i=Math.abs(c).toString(16);n&&(i=i.toUpperCase()),r>=0&&(i=i.padStart(r,"0"));let u="";a.includes("#")&&c!==0&&(u=n?"0X":"0x");let l=u+i;return s>l.length&&(a.includes("-")?l=l.padEnd(s," "):a.includes("0")&&r<0?l=u+i.padStart(s-u.length,"0"):l=l.padStart(s," ")),l}function U(e){return e<128?1:(e&224)===192?2:(e&240)===224?3:(e&248)===240?4:0}function Me(e){if(e.length===0)return"''";let c=!0;for(let s=0;s<e.length;s++){let r=e[s];if(!(r>=97&&r<=122||r>=65&&r<=90||r>=48&&r<=57||r===46||r===95||r===47||r===45)){c=!1;break}}if(c)return new TextDecoder().decode(e);let n=!1;for(let s=0;s<e.length;s++){let r=e[s];if(r<32||r===127){n=!0;break}if(r>=128){let i=U(r);if(i===0||s+i>e.length){n=!0;break}let u=!0;for(let l=1;l<i;l++)if((e[s+l]&192)!==128){u=!1;break}if(!u){n=!0;break}s+=i-1}}if(n){let s="$'";for(let r=0;r<e.length;r++){let i=e[r];if(i===39)s+="\\'";else if(i===92)s+="\\\\";else if(i===10)s+="\\n";else if(i===9)s+="\\t";else if(i===13)s+="\\r";else if(i===7)s+="\\a";else if(i===8)s+="\\b";else if(i===12)s+="\\f";else if(i===11)s+="\\v";else if(i===27)s+="\\E";else if(i<32||i===127)s+=`\\${i.toString(8).padStart(3,"0")}`;else if(i>=128){let u=U(i),l=u>0&&r+u<=e.length;if(l){for(let o=1;o<u;o++)if((e[r+o]&192)!==128){l=!1;break}}if(l){let o=new TextDecoder().decode(e.subarray(r,r+u));s+=o,r+=u-1}else s+=`\\${i.toString(8).padStart(3,"0")}`}else i===34?s+='\\"':s+=String.fromCharCode(i)}return s+="'",s}let t=new Set(" |&;<>()$`\\\"'*?[#~=%!{}".split("").map(s=>s.charCodeAt(0))),a="";for(let s=0;s<e.length;s++){let r=e[s];if(r>=128){let i=U(r),u=new TextDecoder().decode(e.subarray(s,s+i));a+=u,s+=i-1}else t.has(r)?a+=`\\${String.fromCharCode(r)}`:a+=String.fromCharCode(r)}return a}function Ee(e,c){let n=e.match(/^%(-?)(\d*)(\.(\d*))?s$/);if(!n)return(0,M.sprintf)(e.replace(/0+(?=\d)/,""),c);let t=n[1]==="-",a=n[2]?parseInt(n[2],10):0,s=n[3]!==void 0?n[4]?parseInt(n[4],10):0:-1,r=t?-a:a;return V(c,r,s)}function Ie(e,c){let n=Me(c),t=e.match(/^%(-?)(\d*)q$/);if(!t)return n;let a=t[1]==="-",s=t[2]?parseInt(t[2],10):0,r=n;return s>r.length&&(a?r=r.padEnd(s," "):r=r.padStart(s," ")),r}function Te(e,c,n){let t=e.match(/^%([- +#0']*)(\d*)(\.(\d*))?[eEfFgG]$/);if(!t)return(0,M.sprintf)(e,n);let a=t[1]||"",s=t[2]?parseInt(t[2],10):0,r=t[3]!==void 0?t[4]?parseInt(t[4],10):0:6,i,u=c.toLowerCase();if(u==="e"?(i=n.toExponential(r),i=i.replace(/e([+-])(\d)$/,"e$10$2"),c==="E"&&(i=i.toUpperCase())):u==="f"?(i=n.toFixed(r),a.includes("#")&&r===0&&!i.includes(".")&&(i+=".")):u==="g"?(i=n.toPrecision(r||1),a.includes("#")||(i=i.replace(/\.?0+$/,""),i=i.replace(/\.?0+e/,"e")),i=i.replace(/e([+-])(\d)$/,"e$10$2"),c==="G"&&(i=i.toUpperCase())):i=n.toString(),n>=0&&(a.includes("+")?i=`+${i}`:a.includes(" ")&&(i=` ${i}`)),s>i.length)if(a.includes("-"))i=i.padEnd(s," ");else if(a.includes("0")){let l=i.match(/^[+ -]/)?.[0]||"",o=l?i.slice(1):i;i=l+o.padStart(s-l.length,"0")}else i=i.padStart(s," ");return i}function Fe(e){let c=[],n=0;for(;n<e.length;)if(e[n]==="\\"&&n+1<e.length)switch(e[n+1]){case"n":c.push(10),n+=2;break;case"t":c.push(9),n+=2;break;case"r":c.push(13),n+=2;break;case"\\":c.push(92),n+=2;break;case"a":c.push(7),n+=2;break;case"b":c.push(8),n+=2;break;case"f":c.push(12),n+=2;break;case"v":c.push(11),n+=2;break;case"c":return{value:new Uint8Array(c),stopped:!0};case"x":{let a=n,s=!1;for(;a+1<e.length&&e[a]==="\\"&&e[a+1]==="x";){let r="",i=a+2;for(;i<e.length&&i<a+4&&/[0-9a-fA-F]/.test(e[i]);)r+=e[i],i++;if(r)c.push(parseInt(r,16)),a=i,s=!0;else break}s?n=a:(E(c,"\\x"),n+=2);break}case"u":{let a="",s=n+2;for(;s<e.length&&s<n+6&&/[0-9a-fA-F]/.test(e[s]);)a+=e[s],s++;a?(N(c,I.encode(String.fromCodePoint(parseInt(a,16)))),n=s):(E(c,"\\u"),n+=2);break}case"0":{let a="",s=n+2;for(;s<e.length&&s<n+5&&/[0-7]/.test(e[s]);)a+=e[s],s++;a?c.push(parseInt(a,8)&255):c.push(0),n=s;break}case"1":case"2":case"3":case"4":case"5":case"6":case"7":{let a="",s=n+1;for(;s<e.length&&s<n+4&&/[0-7]/.test(e[s]);)a+=e[s],s++;c.push(parseInt(a,8)&255),n=s;break}default:E(c,e[n]),n++}else{let t=e.charCodeAt(n);if(t<128)c.push(t),n++;else{let a=t>=55296&&t<=56319&&n+1<e.length?e.slice(n,n+2):e[n];N(c,I.encode(a)),n+=a.length}}return{value:new Uint8Array(c),stopped:!1}}var Ue={name:"printf",flags:[{flag:"-v",type:"value",valueHint:"string"}],stdinType:"none",needsArgs:!0};export{Oe as a,Ue as b};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import{a as S}from"./chunk-7VWUKGDV.js";import{a as C,b as T}from"./chunk-DFAHK2EQ.js";import{b as d,e as p,k as x}from"./chunk-RAUBS6MJ.js";import{k as O}from"./chunk-463VWH7H.js";var U={name:"uniq",summary:"report or omit repeated lines",usage:"uniq [OPTION]... [INPUT [OUTPUT]]",options:["-c, --count prefix lines by the number of occurrences","-d, --repeated only print duplicate lines","-i, --ignore-case ignore case when comparing","-u, --unique only print unique lines"," --help display this help and exit"]},v={count:{short:"c",long:"count",type:"boolean"},duplicatesOnly:{short:"d",long:"repeated",type:"boolean"},uniqueOnly:{short:"u",long:"unique",type:"boolean"},ignoreCase:{short:"i",long:"ignore-case",type:"boolean"}},R={name:"uniq",async execute(F,t){let f=O(F);if(T(f))return C(U);let s=S("uniq",f,v);if(!s.ok)return s.error;let{count:I,duplicatesOnly:P,uniqueOnly:$,ignoreCase:k}=s.result.flags,y=s.result.positional,l,g="";if(y.length===0)l=t.stdin;else{let e=y[0];if(e==="-")l=t.stdin;else try{l=await t.fs.readFile(t.fs.resolvePath(t.cwd,e))}catch{return{stdout:d(),stderr:p(`uniq: ${e}: No such file or directory
|
|
3
|
+
`),exitCode:1}}}let H=new TextDecoder,m=new TextEncoder,h=(e,i)=>P&&i<=1||$&&i!==1?"":I?`${String(i).padStart(4)} ${e}
|
|
4
|
+
`:`${e}
|
|
5
|
+
`,L=e=>k?e.toLowerCase():e,o=null,n=null,u="",r=0,q=!1;return{stdout:new ReadableStream({async pull(e){for(o===null&&(o=x(l)[Symbol.asyncIterator]());;){let{done:i,value:N}=await o.next();if(i){if(!q&&n!==null){q=!0;let w=h(n,r);if(w.length>0){e.enqueue(m.encode(w));return}}e.close();return}let a=H.decode(N),c=L(a);if(n===null){n=a,u=c,r=1;continue}if(c===u){r++;continue}let b=h(n,r);if(n=a,u=c,r=1,b.length>0){e.enqueue(m.encode(b));return}}},async cancel(){if(o?.return)try{await o.return()}catch{}}}),stderr:g.length>0?p(g):d(),exitCode:0}}},j={name:"uniq",flags:[{flag:"-c",type:"boolean"},{flag:"-d",type:"boolean"},{flag:"-u",type:"boolean"},{flag:"-i",type:"boolean"}],stdinType:"text",needsFiles:!0};export{R as a,j as b};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import{a as L,b as T,c as I}from"./chunk-DFAHK2EQ.js";import{b as m,e as w,k as S}from"./chunk-RAUBS6MJ.js";import{k as x}from"./chunk-463VWH7H.js";var D={name:"cut",summary:"remove sections from each line of files",usage:"cut [OPTION]... [FILE]...",options:["-c LIST select only these characters","-d DELIM use DELIM instead of TAB for field delimiter","-f LIST select only these fields","-s, --only-delimited do not print lines without delimiters"," --help display this help and exit"]};function E(c){let l=[],n=c.split(",");for(let t of n)if(t.includes("-")){let[r,i]=t.split("-");l.push({start:r?parseInt(r,10):1,end:i?parseInt(i,10):null})}else{let r=parseInt(t,10);l.push({start:r,end:r})}return l}function k(c,l){let n=[];for(let t of l){let r=t.start-1,i=t.end===null?c.length:t.end;for(let o=r;o<i&&o<c.length;o++)o>=0&&!n.includes(c[o])&&n.push(c[o])}return n}var z={name:"cut",async execute(c,l){let n=x(c);if(T(n))return L(D);let t=" ",r=null,i=null,o=!1,u=[];for(let s=0;s<n.length;s++){let e=n[s];if(e==="-d")t=n[++s]||" ";else if(e.startsWith("-d"))t=e.slice(2);else if(e==="-f")r=n[++s];else if(e.startsWith("-f"))r=e.slice(2);else if(e==="-c")i=n[++s];else if(e.startsWith("-c"))i=e.slice(2);else if(e==="-s"||e==="--only-delimited")o=!0;else{if(e.startsWith("--"))return I("cut",e);if(e.startsWith("-")){let d=!1;for(let a of e.slice(1))if(a==="s")o=!0;else if(!"dfc".includes(a)){d=!0;break}if(d)return I("cut",e)}else u.push(e)}}if(!r&&!i)return{stdout:m(),stderr:w(`cut: you must specify a list of bytes, characters, or fields
|
|
3
|
+
`),exitCode:1};let g;if(u.length===0||u[0]==="-")g=l.stdin;else try{g=await l.fs.readFile(l.fs.resolvePath(l.cwd,u[0]))}catch{return{stdout:m(),stderr:w(`cut: ${u[0]}: No such file or directory
|
|
4
|
+
`),exitCode:1}}let v=E(r||i||"1"),F=new TextDecoder,H=new TextEncoder,b=s=>{if(i){let a=s.split(""),p=[];for(let y of v){let W=y.start-1,C=y.end===null?a.length:y.end;for(let h=W;h<C&&h<a.length;h++)h>=0&&p.push(a[h])}return p.join("")}if(o&&!s.includes(t))return null;let e=s.split(t);return k(e,v).join(t)},f=null;return{stdout:new ReadableStream({async pull(s){for(f===null&&(f=S(g)[Symbol.asyncIterator]());;){let{done:e,value:d}=await f.next();if(e){s.close();return}let a=F.decode(d),p=b(a);if(p!==null){s.enqueue(H.encode(`${p}
|
|
5
|
+
`));return}}},async cancel(){if(f?.return)try{await f.return()}catch{}}}),stderr:m(),exitCode:0}}},B={name:"cut",flags:[{flag:"-d",type:"value",valueHint:"delimiter"},{flag:"-f",type:"value",valueHint:"string"},{flag:"-c",type:"value",valueHint:"string"},{flag:"-s",type:"boolean"}],stdinType:"text",needsFiles:!0};export{z as a,B as b};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import{a as b,b as g,c as O,d as k,e as X}from"./chunk-UYBH3FNE.js";import{a as G,c as ht}from"./chunk-CAXM2HMK.js";import{a as S}from"./chunk-SE4C7FJY.js";import{k as P}from"./chunk-XILOLP4K.js";function W(t,r,e,n,p,i,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,y)=>{let a=p(h,e[0],n)[0],l=p(y,e[0],n)[0];return u(a,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 y=0,a=t.length;for(;y<a;){let l=y+a>>>1;u(t[l],h)<0?y=l+1:a=l}return y<t.length&&u(t[y],h)===0?y:-y-1})}case"unique_by":{if(!Array.isArray(t)||e.length===0)return[null];let o=new Map;for(let y of t){let a=p(y,e[0],n)[0],l=JSON.stringify(a);o.has(l)||o.set(l,{item:y,key:a})}let h=[...o.values()];return h.sort((y,a)=>u(y.key,a.key)),[h.map(y=>y.item)]}case"group_by":{if(!Array.isArray(t)||e.length===0)return[null];let o=new Map;for(let h of t){let y=JSON.stringify(p(h,e[0],n)[0]);o.has(y)||o.set(y,[]),o.get(y)?.push(h)}return[[...o.values()]]}case"max":return Array.isArray(t)&&t.length>0?[t.reduce((o,h)=>u(o,h)>0?o:h)]:[null];case"max_by":return!Array.isArray(t)||t.length===0||e.length===0?[null]:[t.reduce((o,h)=>{let y=p(o,e[0],n)[0],a=p(h,e[0],n)[0];return u(y,a)>0?o:h})];case"min":return Array.isArray(t)&&t.length>0?[t.reduce((o,h)=>u(o,h)<0?o:h)]:[null];case"min_by":return!Array.isArray(t)||t.length===0||e.length===0?[null]:[t.reduce((o,h)=>{let y=p(o,e[0],n)[0],a=p(h,e[0],n)[0];return u(y,a)<0?o:h})];case"add":{let o=h=>{let y=h.filter(a=>a!==null);return y.length===0?null:y.every(a=>typeof a=="number")?y.reduce((a,l)=>a+l,0):y.every(a=>typeof a=="string")?y.join(""):y.every(a=>Array.isArray(a))?y.flat():y.every(a=>a&&typeof a=="object"&&!Array.isArray(a))?ht(...y):null};if(e.length>=1){let h=p(t,e[0],n);return[o(h)]}return Array.isArray(t)?[o(t)]:[null]}case"any":{if(e.length>=2){try{let o=i(t,e[0],n);for(let h of o)if(p(h,e[1],n).some(c))return[!0]}catch(o){if(o instanceof f)throw o}return[!1]}return e.length===1?Array.isArray(t)?[t.some(o=>c(p(o,e[0],n)[0]))]:[!1]:Array.isArray(t)?[t.some(c)]:[!1]}case"all":{if(e.length>=2){try{let o=i(t,e[0],n);for(let h of o)if(!p(h,e[1],n).some(c))return[!1]}catch(o){if(o instanceof f)throw o}return[!0]}return e.length===1?Array.isArray(t)?[t.every(o=>c(p(o,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(o=>p(o,e[0],n))];if(t&&typeof t=="object"){let o=Object.create(null);for(let[h,y]of Object.entries(t)){if(!b(h))continue;let a=p(y,e[0],n);a.length>0&&g(o,h,a[0])}return[o]}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"?[O(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"?[O(h,t)]:[!1]}case"contains":{if(e.length===0)return[!1];let o=p(t,e[0],n);return[s(t,o[0])]}case"inside":{if(e.length===0)return[!1];let o=p(t,e[0],n);return[s(o[0],t)]}default:return null}}function Q(t,r,e,n,p,i,u,c){switch(r){case"first":if(e.length>0)try{let s=i(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 o of s)if(o<0)throw new Error("nth doesn't support negative indices");let f;try{f=i(t,e[1],n)}catch(o){if(o instanceof c)throw o;f=[]}return s.flatMap(o=>{let h=o;return h<f.length?[f[h]]:[]})}return Array.isArray(t)?s.flatMap(f=>{let o=f;if(o<0)throw new Error("nth doesn't support negative indices");return o<t.length?[t[o]]:[null]}):[null]}case"range":{if(e.length===0)return[];let s=p(t,e[0],n);if(e.length===1){let y=[];for(let a of s){let l=a;for(let m=0;m<l;m++)y.push(m)}return y}let f=p(t,e[1],n);if(e.length===2){let y=[];for(let a of s)for(let l of f){let m=a,A=l;for(let E=m;E<A;E++)y.push(E)}return y}let o=p(t,e[2],n),h=[];for(let y of s)for(let a of f)for(let l of o){let m=y,A=a,E=l;if(E!==0)if(E>0)for(let w=m;w<A;w+=E)h.push(w);else for(let w=m;w>A;w+=E)h.push(w)}return h}case"limit":return e.length<2?[]:p(t,e[0],n).flatMap(f=>{let o=f;if(o<0)throw new Error("limit doesn't support negative count");if(o===0)return[];let h;try{h=i(t,e[1],n)}catch(y){if(y instanceof c)throw y;h=[]}return h.slice(0,o)});case"isempty":{if(e.length<1)return[!0];try{return[i(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 o=f;if(o<0)throw new Error("skip doesn't support negative count");return p(t,e[1],n).slice(o)});case"until":{if(e.length<2)return[t];let s=t,f=n.limits.maxIterations;for(let o=0;o<f;o++){if(p(s,e[0],n).some(u))return[s];let y=p(s,e[1],n);if(y.length===0)return[s];s=y[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,o=n.limits.maxIterations;for(let h=0;h<o&&p(f,e[0],n).some(u);h++){s.push(f);let a=p(f,e[1],n);if(a.length===0)break;f=a[0]}if(s.length>=o)throw new c(`jq while: too many iterations (${o}), increase executionLimits.maxJqIterations`,"iterations");return s}case"repeat":{if(e.length===0)return[t];let s=[],f=t,o=n.limits.maxIterations;for(let h=0;h<o;h++){s.push(f);let y=p(f,e[0],n);if(y.length===0)break;f=y[0]}if(s.length>=o)throw new c(`jq repeat: too many iterations (${o}), 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 i=new Date(t*1e3),u=i.getUTCFullYear(),c=i.getUTCMonth(),s=i.getUTCDate(),f=i.getUTCHours(),o=i.getUTCMinutes(),h=i.getUTCSeconds(),y=i.getUTCDay(),a=Date.UTC(u,0,1),l=Math.floor((i.getTime()-a)/(1440*60*1e3));return[[u,c,s,f,o,h,y,l]]}case"mktime":{if(!Array.isArray(t))throw new Error("mktime requires parsed datetime inputs");let[i,u,c,s=0,f=0,o=0]=t;if(typeof i!="number"||typeof u!="number")throw new Error("mktime requires parsed datetime inputs");let h=Date.UTC(i,u,c??1,s??0,f??0,o??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[y,a,l,m=0,A=0,E=0]=t;if(typeof y!="number"||typeof a!="number")throw new Error("strftime/1 requires parsed datetime inputs");c=new Date(Date.UTC(y,a,l??1,m??0,A??0,E??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"],o=(y,a=2)=>String(y).padStart(a,"0");return[u.replace(/%Y/g,String(c.getUTCFullYear())).replace(/%m/g,o(c.getUTCMonth()+1)).replace(/%d/g,o(c.getUTCDate())).replace(/%H/g,o(c.getUTCHours())).replace(/%M/g,o(c.getUTCMinutes())).replace(/%S/g,o(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,o,h,y,a,l]=s.map(Number),m=new Date(Date.UTC(f,o-1,h,y,a,l)),A=m.getUTCDay(),E=Date.UTC(f,0,1),w=Math.floor((m.getTime()-E)/(1440*60*1e3));return[[f,o-1,h,y,a,l,A,w]]}}let c=new Date(t);if(!Number.isNaN(c.getTime())){let s=c.getUTCFullYear(),f=c.getUTCMonth(),o=c.getUTCDate(),h=c.getUTCHours(),y=c.getUTCMinutes(),a=c.getUTCSeconds(),l=c.getUTCDay(),m=Date.UTC(s,0,1),A=Math.floor((c.getTime()-m)/(1440*60*1e3));return[[s,f,o,h,y,a,l,A]]}throw new Error(`Cannot parse date: ${t}`)}case"fromdate":{if(typeof t!="string")throw new Error("fromdate requires a string input");let i=new Date(t);if(Number.isNaN(i.getTime()))throw new Error(`date "${t}" does not match format "%Y-%m-%dT%H:%M:%SZ"`);return[Math.floor(i.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 N(t){return t!==!1&&t!==null}function R(t,r){return JSON.stringify(t)===JSON.stringify(r)}function D(t,r){return typeof t=="number"&&typeof r=="number"?t-r:typeof t=="string"&&typeof r=="string"?t.localeCompare(r):0}function z(t,r){let e=k(t);for(let n of Object.keys(r))b(n)&&(O(e,n)&&e[n]&&typeof e[n]=="object"&&!Array.isArray(e[n])&&r[n]&&typeof r[n]=="object"&&!Array.isArray(r[n])?g(e,n,z(e[n],r[n])):g(e,n,r[n]));return e}function M(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 L(t,r){let e=i=>i===null?0:typeof i=="boolean"?1:typeof i=="number"?2:typeof i=="string"?3:Array.isArray(i)?4:typeof i=="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 i=0;i<Math.min(t.length,r.length);i++){let u=L(t[i],r[i]);if(u!==0)return u}return t.length-r.length}if(t&&r&&typeof t=="object"&&typeof r=="object"){let i=t,u=r,c=Object.keys(i).sort(),s=Object.keys(u).sort();for(let f=0;f<Math.min(c.length,s.length);f++){let o=c[f].localeCompare(s[f]);if(o!==0)return o}if(c.length!==s.length)return c.length-s.length;for(let f of c){let o=L(i[f],u[f]);if(o!==0)return o}}return 0}function _(t,r){if(R(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(e=>t.some(n=>_(n,e)));if(t&&r&&typeof t=="object"&&typeof r=="object"&&!Array.isArray(t)&&!Array.isArray(r)){let e=t,n=r;return Object.keys(n).every(p=>O(e,p)&&_(e[p],n[p]))}return!1}var Et=2e3;function v(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 i=String(p);return i.includes(",")||i.includes('"')||i.includes(`
|
|
3
|
+
`)||i.includes("\r")?`"${i.replace(/"/g,'""')}"`:i}).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??Et;return M(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 tt(t,r,e,n,p,i){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 o=!0;for(let h=0;h<c.length;h++)if(!i(t[f+h],c[h])){o=!1;break}if(o)return f}return null}let s=t.findIndex(f=>i(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 o=0;o<c.length;o++)if(!i(t[s+o],c[o])){f=!1;break}if(f)return s}return null}for(let s=t.length-1;s>=0;s--)if(i(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 o=0;o<=t.length;o++)s.push(o);else for(let o=0;o<=t.length-f;o++){let h=!0;for(let y=0;y<f;y++)if(!i(t[o+y],c[y])){h=!1;break}h&&s.push(o)}}else for(let f=0;f<t.length;f++)i(t[f],c)&&s.push(f);return s});default:return null}}function et(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 i=p(t,e[0],n),u=p(t,e[1],n),c=i[0],s=u[0];return typeof c!="number"||typeof s!="number"?[null]:[c**s]}case"atan2":{if(e.length<2)return[null];let i=p(t,e[0],n),u=p(t,e[1],n),c=i[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 i=p(t,e[0],n)[0];return[Math.hypot(t,i)]}case"fma":{if(typeof t!="number"||e.length<2)return[null];let i=p(t,e[0],n)[0],u=p(t,e[1],n)[0];return[t*i+u]}case"copysign":{if(typeof t!="number"||e.length===0)return[null];let i=p(t,e[0],n)[0];return[Math.sign(i)*Math.abs(t)]}case"drem":case"remainder":{if(typeof t!="number"||e.length===0)return[null];let i=p(t,e[0],n)[0];return[t-Math.round(t/i)*i]}case"fdim":{if(typeof t!="number"||e.length===0)return[null];let i=p(t,e[0],n)[0];return[Math.max(0,t-i)]}case"fmax":{if(typeof t!="number"||e.length===0)return[null];let i=p(t,e[0],n)[0];return[Math.max(t,i)]}case"fmin":{if(typeof t!="number"||e.length===0)return[null];let i=p(t,e[0],n)[0];return[Math.min(t,i)]}case"ldexp":{if(typeof t!="number"||e.length===0)return[null];let i=p(t,e[0],n)[0];return[t*2**i]}case"scalbn":case"scalbln":{if(typeof t!="number"||e.length===0)return[null];let i=p(t,e[0],n)[0];return[t*2**i]}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 i=Math.floor(Math.log2(Math.abs(t)));return[t/2**i]}return[null];case"frexp":if(typeof t=="number"){if(t===0)return[[0,0]];let i=Math.floor(Math.log2(Math.abs(t)))+1;return[[t/2**i,i]]}return[null];case"modf":if(typeof t=="number"){let i=Math.trunc(t);return[[t-i,i]]}return[null];default:return null}}function rt(t,r,e,n,p,i,u,c){switch(r){case"recurse":{if(e.length===0){let a=[],l=m=>{if(a.push(m),Array.isArray(m))for(let A of m)l(A);else if(m&&typeof m=="object")for(let A of Object.keys(m))l(m[A])};return l(t),a}let s=[],f=e.length>=2?e[1]:null,o=1e4,h=0,y=a=>{if(h++>o||f&&!p(a,f,n).some(i))return;s.push(a);let l=p(a,e[0],n);for(let m of l)m!=null&&y(m)};return y(t),s}case"recurse_down":return c(t,"recurse",e,n);case"walk":{if(e.length===0)return[t];let s=new WeakSet,f=o=>{if(o&&typeof o=="object"){if(s.has(o))return o;s.add(o)}let h;if(Array.isArray(o))h=o.map(f);else if(o&&typeof o=="object"){let a=Object.create(null);for(let[l,m]of Object.entries(o))b(l)&&g(a,l,f(m));h=a}else h=o;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(o=>Array.isArray(o)?o.length:0)),f=[];for(let o=0;o<s;o++)f.push(t.map(h=>Array.isArray(h)?h[o]: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 y=[],a=(l,m)=>{if(m===h){y.push([...l]);return}for(let A of t)l.push(A),a(l,m+1),l.pop()};return a([],0),y}if(!Array.isArray(t))return[];if(t.length===0)return[[]];for(let o of t)if(!Array.isArray(o))return[];let s=[],f=(o,h)=>{if(o===t.length){s.push([...h]);return}let y=t[o];for(let a of y)h.push(a),f(o+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 o=s.slice(0,s.length-f);return[u(n.root,o)]}else{let o=-f-1;if(o>=s.length)return[t];let h=s.slice(0,o);return[u(n.root,h)]}}case"parents":{if(n.root===void 0||n.currentPath===void 0)return[[]];let s=n.currentPath,f=[];for(let o=s.length-1;o>=0;o--)f.push(u(n.root,s.slice(0,o)));return[f]}case"root":return n.root!==void 0?[n.root]:[];default:return null}}var wt=2e3;function nt(t,r,e,n,p){switch(r){case"keys":return Array.isArray(t)?[t.map((i,u)=>u)]:t&&typeof t=="object"?[Object.keys(t).sort()]:[null];case"keys_unsorted":return Array.isArray(t)?[t.map((i,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 i=t===null?"null":Array.isArray(t)?"array":typeof t,u=i==="array"||i==="object"?JSON.stringify(t):String(t);throw new Error(`${i} (${u}) only strings have UTF-8 byte length`)}case"to_entries":return t&&typeof t=="object"&&!Array.isArray(t)?[Object.entries(t).map(([i,u])=>({key:i,value:u}))]:[null];case"from_entries":if(Array.isArray(t)){let i=Object.create(null);for(let u of t)if(u&&typeof u=="object"){let c=u,s=c.key??c.Key??c.name??c.Name??c.k,f=c.value??c.Value??c.v;if(s!==void 0){let o=String(s);b(o)&&g(i,o,f)}}return[i]}return[null];case"with_entries":{if(e.length===0)return[t];if(t&&typeof t=="object"&&!Array.isArray(t)){let u=Object.entries(t).map(([s,f])=>({key:s,value:f})).flatMap(s=>p(s,e[0],n)),c=Object.create(null);for(let s of u)if(s&&typeof s=="object"){let f=s,o=f.key??f.name??f.k,h=f.value??f.v;if(o!==void 0){let y=String(o);b(y)&&g(c,y,h)}}return[c]}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 i=new Set,u=[];for(let c of t){let s=JSON.stringify(c);i.has(s)||(i.add(s),u.push(c))}return[u]}return[null];case"tojson":case"tojsonstream":{let i=n.limits.maxDepth??wt;return M(t,i+1)>i?[null]:[JSON.stringify(t)]}case"fromjson":{if(typeof t=="string"){let i=t.trim().toLowerCase();if(i==="nan")return[Number.NaN];if(i==="inf"||i==="infinity")return[Number.POSITIVE_INFINITY];if(i==="-inf"||i==="-infinity")return[Number.NEGATIVE_INFINITY];try{return[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 i=Number(t);if(Number.isNaN(i))throw new Error(`${JSON.stringify(t)} cannot be parsed as a number`);return[i]}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 i=t===null?"null":Array.isArray(t)?"array":typeof t,u=i==="array"||i==="object"?JSON.stringify(t):String(t);throw new Error(`${i} (${u}) cannot be parsed as a boolean`)}case"tostream":{let i=[],u=(c,s)=>{if(c===null||typeof c!="object")i.push([s,c]);else if(Array.isArray(c))if(c.length===0)i.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)i.push([s,Object.create(null)]);else for(let o of f)u(c[o],[...s,o])}};return u(t,[]),i.push([[]]),i}case"fromstream":{if(e.length===0)return[t];let i=p(t,e[0],n),u=null;for(let c of i){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"?[]:{});let o=u;for(let y=0;y<s.length-1;y++){let a=s[y],l=s[y+1];if(Array.isArray(o)&&typeof a=="number"){for(;o.length<=a;)o.push(null);o[a]===null&&(o[a]=typeof l=="number"?[]:{}),o=o[a]}else if(o&&typeof o=="object"&&!Array.isArray(o)){let m=String(a);if(!b(m))continue;let A=o;(A[m]===null||A[m]===void 0)&&g(A,m,typeof l=="number"?[]:{}),o=A[m]}}let h=s[s.length-1];if(Array.isArray(o)&&typeof h=="number"){for(;o.length<=h;)o.push(null);o[h]=f}else if(o&&typeof o=="object"&&!Array.isArray(o)){let y=String(h);b(y)&&g(o,y,f)}}return[u]}case"truncate_stream":{let i=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>i&&u.push([f.slice(i)]);continue}if(s.length===2&&Array.isArray(s[0])){let f=s[0],o=s[1];f.length>i&&u.push([f.slice(i),o])}}return u}default:return null}}function st(t,r,e,n,p,i,u,c,s,f){switch(r){case"getpath":{if(e.length===0)return[null];let o=p(t,e[0],n),h=[];for(let y of o){let a=y,l=t;for(let m of a){if(l==null){l=null;break}if(Array.isArray(l)&&typeof m=="number")l=l[m];else if(typeof l=="object"&&typeof m=="string"){let A=l;if(!Object.hasOwn(A,m)){l=null;break}l=A[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],a=p(t,e[1],n)[0];return[u(t,h,a)]}case"delpaths":{if(e.length===0)return[t];let h=p(t,e[0],n)[0],y=t;for(let a of h.sort((l,m)=>m.length-l.length))y=c(y,a);return[y]}case"path":{if(e.length===0)return[[]];let o=[];return f(t,e[0],n,[],o),o}case"del":return e.length===0?[t]:[s(t,e[0],n)];case"pick":{if(e.length===0)return[null];let o=[];for(let y of e)f(t,y,n,[],o);let h=null;for(let y of o){for(let l of y)if(typeof l=="number"&&l<0)throw new Error("Out of bounds negative array index");let a=t;for(let l of y){if(a==null)break;if(Array.isArray(a)&&typeof l=="number")a=a[l];else if(typeof a=="object"&&typeof l=="string"){let m=a;if(!Object.hasOwn(m,l)){a=null;break}a=m[l]}else{a=null;break}}h=u(h,y,a)}return[h]}case"paths":{let o=[],h=(y,a)=>{if(y&&typeof y=="object")if(Array.isArray(y))for(let l=0;l<y.length;l++)o.push([...a,l]),h(y[l],[...a,l]);else for(let l of Object.keys(y))o.push([...a,l]),h(y[l],[...a,l])};return h(t,[]),e.length>0?o.filter(y=>{let a=t;for(let m of y)if(Array.isArray(a)&&typeof m=="number")a=a[m];else if(a&&typeof a=="object"&&typeof m=="string"){let A=a;if(!Object.hasOwn(A,m))return!1;a=A[m]}else return!1;return p(a,e[0],n).some(i)}):o}case"leaf_paths":{let o=[],h=(y,a)=>{if(y===null||typeof y!="object")o.push(a);else if(Array.isArray(y))for(let l=0;l<y.length;l++)h(y[l],[...a,l]);else for(let l of Object.keys(y))h(y[l],[...a,l])};return h(t,[]),o}default:return null}}function it(t,r,e,n,p,i){switch(r){case"IN":{if(e.length===0)return[!1];if(e.length===1){let f=p(t,e[0],n);for(let o of f)if(i(t,o))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[{}];if(e.length===1){let s=p(t,e[0],n),f=Object.create(null);for(let o of s){let h=String(o);b(h)&&g(f,h,o)}return[f]}if(e.length===2){let s=p(t,e[0],n),f=Object.create(null);for(let o of s){let h=p(o,e[1],n);if(h.length>0){let y=String(h[0]);b(y)&&g(f,y,o)}}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),o=p(s,e[2],n);if(f.length>0&&o.length>0){let h=String(f[0]);b(h)&&g(c,h,o[0])}}return[c]}case"JOIN":{if(e.length<2)return[null];let u=p(t,e[0],n)[0];if(!u||typeof u!="object"||Array.isArray(u))return[null];let c=u;if(!Array.isArray(t))return[null];let s=[];for(let f of t){let o=p(f,e[1],n),h=o.length>0?String(o[0]):"",y=O(c,h)?c[h]:null;s.push([f,y])}return[s]}default:return null}}function ot(t,r,e,n,p){switch(r){case"join":{if(!Array.isArray(t))return[null];let i=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 i.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 i=p(t,e[0],n),u=String(i[0]);return[t.split(u)]}case"splits":{if(typeof t!="string"||e.length===0)return[];let i=p(t,e[0],n),u=String(i[0]);try{let c=e.length>1?String(p(t,e[1],n)[0]):"g";return S(u,c.includes("g")?c:`${c}g`).split(t)}catch{return[]}}case"scan":{if(typeof t!="string"||e.length===0)return[];let i=p(t,e[0],n),u=String(i[0]);try{let c=e.length>1?String(p(t,e[1],n)[0]):"";return[...S(u,c.includes("g")?c:`${c}g`).matchAll(t)].map(o=>o.length>1?o.slice(1):o[0])}catch{return[]}}case"test":{if(typeof t!="string"||e.length===0)return[!1];let i=p(t,e[0],n),u=String(i[0]);try{let c=e.length>1?String(p(t,e[1],n)[0]):"";return[S(u,c).test(t)]}catch{return[!1]}}case"match":{if(typeof t!="string"||e.length===0)return[null];let i=p(t,e[0],n),u=String(i[0]);try{let c=e.length>1?String(p(t,e[1],n)[0]):"",f=S(u,`${c}d`).exec(t);if(!f)return[];let o=f.indices;return[{offset:f.index,length:f[0].length,string:f[0],captures:f.slice(1).map((h,y)=>({offset:o?.[y+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 i=p(t,e[0],n),u=String(i[0]);try{let c=e.length>1?String(p(t,e[1],n)[0]):"",f=S(u,c).match(t);return!f||!f.groups?[{}]:[f.groups]}catch{return[null]}}case"sub":{if(typeof t!="string"||e.length<2)return[null];let i=p(t,e[0],n),u=p(t,e[1],n),c=String(i[0]),s=String(u[0]);try{let f=e.length>2?String(p(t,e[2],n)[0]):"";return[S(c,f).replace(t,s)]}catch{return[t]}}case"gsub":{if(typeof t!="string"||e.length<2)return[null];let i=p(t,e[0],n),u=p(t,e[1],n),c=String(i[0]),s=String(u[0]);try{let f=e.length>2?String(p(t,e[2],n)[0]):"g",o=f.includes("g")?f:`${f}g`;return[S(c,o).replace(t,s)]}catch{return[t]}}case"ascii_downcase":return typeof t=="string"?[t.replace(/[A-Z]/g,i=>String.fromCharCode(i.charCodeAt(0)+32))]:[null];case"ascii_upcase":return typeof t=="string"?[t.replace(/[a-z]/g,i=>String.fromCharCode(i.charCodeAt(0)-32))]:[null];case"ltrimstr":{if(typeof t!="string"||e.length===0)return[t];let i=p(t,e[0],n),u=String(i[0]);return[t.startsWith(u)?t.slice(u.length):t]}case"rtrimstr":{if(typeof t!="string"||e.length===0)return[t];let i=p(t,e[0],n),u=String(i[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 i=p(t,e[0],n),u=String(i[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 i=p(t,e[0],n);return[t.startsWith(String(i[0]))]}case"endswith":{if(typeof t!="string"||e.length===0)return[!1];let i=p(t,e[0],n);return[t.endsWith(String(i[0]))]}case"ascii":return typeof t=="string"&&t.length>0?[t.charCodeAt(0)]:[null];case"explode":return typeof t=="string"?[Array.from(t).map(i=>i.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 ft(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 $(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 s=Array.isArray(t)?[...t]:[];for(;s.length<=n;)s.push(null);return s[n]=$(s[n],p,e),s}if(Array.isArray(t))throw new Error("Cannot index array with string");if(!b(n))return t??Object.create(null);let i=t&&typeof t=="object"&&!Array.isArray(t)?k(t):Object.create(null),u=Object.hasOwn(i,n)?i[n]:void 0;return g(i,n,$(u,p,e)),i}function F(t,r){if(r.length===0)return null;if(r.length===1){let p=r[0];if(Array.isArray(t)&&typeof p=="number"){let i=[...t];return i.splice(p,1),i}if(t&&typeof t=="object"&&!Array.isArray(t)){let i=String(p);if(!b(i))return t;let u=k(t);return delete u[i],u}return t}let[e,...n]=r;if(Array.isArray(t)&&typeof e=="number"){let p=[...t];return p[e]=F(p[e],n),p}if(t&&typeof t=="object"&&!Array.isArray(t)){let p=String(e);if(!b(p))return t;let i=k(t);return Object.hasOwn(i,p)&&g(i,p,F(i[p],n)),i}return t}var I=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])}},V=class extends Error{value;constructor(r){super(typeof r=="string"?r:JSON.stringify(r)),this.value=r,this.name="JqError"}},kt=1e4,lt=2e3,Nt=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 Ot(t){return{vars:new Map,limits:{maxIterations:t?.limits?.maxIterations??kt,maxDepth:t?.limits?.maxDepth??lt},env:t?.env,coverage:t?.coverage}}function J(t,r,e){let n=new Map(t.vars);return n.set(r,e),{vars:n,limits:t.limits,env:t.env,root:t.root,currentPath:t.currentPath,funcs:t.funcs,labels:t.labels,coverage:t.coverage}}function B(t,r,e){switch(r.type){case"var":return J(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 i=r.elements[p],u=p<e.length?e[p]:null,c=B(n,i,u);if(c===null)return null;n=c}return n}case"object":{if(e===null||typeof e!="object"||Array.isArray(e))return null;let n=e,p=t;for(let i of r.fields){let u;if(typeof i.key=="string")u=i.key;else{let f=d(e,i.key,t);if(f.length===0)return null;u=String(f[0])}let c=O(n,u)?n[u]:null;i.keyVar&&(p=J(p,i.keyVar,c));let s=B(p,i.pattern,c);if(s===null)return null;p=s}return p}}}function St(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;if(typeof n=="string"&&Object.hasOwn(p,n))e=p[n];else return}else return;return e}function T(t){if(t.type==="Identity")return[];if(t.type==="Field"){let r=t.base?T(t.base):[];return r===null?null:[...r,t.name]}if(t.type==="Index"&&t.index.type==="Literal"){let r=t.base?T(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=T(t.left);return r===null?null:ct(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 ct(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=T(r);if(e!==null)return[...t,...e]}if(r.type==="Index"&&r.index.type==="Literal"){let e=T(r);if(e!==null)return[...t,...e]}if(r.type==="Pipe"){let e=ct(t,r.left);return e===null?null:ct(e,r.right)}return r.type==="Identity"?t:null}function yt(t,r,e){if(r.type==="Comma"){let n=[];try{n.push(...d(t,r.left,e))}catch(p){if(p instanceof P)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 P)throw p;return n}return n}return d(t,r,e)}function d(t,r,e){let n=e&&"vars"in e?e:Ot(e);switch(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(i=>{if(i&&typeof i=="object"&&!Array.isArray(i)){let c=i;if(!Object.hasOwn(c,r.name))return[null];let s=c[r.name];return[s===void 0?null:s]}if(i===null)return[null];let u=Array.isArray(i)?"array":typeof i;throw new Error(`Cannot index ${u} with string "${r.name}"`)});case"Index":return(r.base?d(t,r.base,n):[t]).flatMap(i=>d(i,r.index,n).flatMap(c=>{if(typeof c=="number"&&Array.isArray(i)){if(Number.isNaN(c))return[null];let s=Math.trunc(c),f=s<0?i.length+s:s;return f>=0&&f<i.length?[i[f]]:[null]}if(typeof c=="string"&&i&&typeof i=="object"&&!Array.isArray(i)){let s=i;return Object.hasOwn(s,c)?[s[c]]:[null]}return[null]}));case"Slice":return(r.base?d(t,r.base,n):[t]).flatMap(i=>{if(i===null)return[null];if(!Array.isArray(i)&&typeof i!="string")throw new Error(`Cannot slice ${typeof i} (${JSON.stringify(i)})`);let u=i.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(o=>{let h=f,y=o,a=Number.isNaN(h)?0:Number.isInteger(h)?h:Math.floor(h),l=Number.isNaN(y)?u:Number.isInteger(y)?y:Math.ceil(y),m=at(a,u),A=at(l,u);return Array.isArray(i),i.slice(m,A)}))});case"Iterate":return(r.base?d(t,r.base,n):[t]).flatMap(i=>Array.isArray(i)?i:i&&typeof i=="object"?Object.values(i):[]);case"Pipe":{let p=d(t,r.left,n),i=T(r.left),u=[];for(let c of p)try{if(i!==null){let s={...n,currentPath:[...n.currentPath??[],...i]};u.push(...d(c,r.right,s))}else u.push(...d(c,r.right,n))}catch(s){throw s instanceof I?s.withPrependedResults(u):s}return u}case"Comma":{let p=d(t,r.left,n),i=d(t,r.right,n);return[...p,...i]}case"Literal":return[r.value];case"Array":return r.elements?[d(t,r.elements,n)]:[[]];case"Object":{let p=[Object.create(null)];for(let i of r.entries){let u=typeof i.key=="string"?[i.key]:d(t,i.key,n),c=d(t,i.value,n),s=[];for(let f of p)for(let o of u){if(typeof o!="string"){let h=o===null?"null":Array.isArray(o)?"array":typeof o;throw new Error(`Cannot use ${h} (${JSON.stringify(o)}) as object key`)}if(!b(o)){for(let h of c)s.push(k(f));continue}for(let h of c){let y=k(f);g(y,o,h),s.push(y)}}p.length=0,p.push(...s)}return p}case"Paren":return d(t,r.expr,n);case"BinaryOp":return jt(t,r.op,r.left,r.right,n);case"UnaryOp":return d(t,r.operand,n).map(i=>{if(r.op==="-"){if(typeof i=="number")return-i;if(typeof i=="string"){let u=c=>c.length>5?`"${c.slice(0,3)}...`:JSON.stringify(c);throw new Error(`string (${u(i)}) cannot be negated`)}return null}return r.op==="not"?!N(i):null});case"Cond":return d(t,r.cond,n).flatMap(i=>{if(N(i))return d(t,r.then,n);for(let u of r.elifs)if(d(t,u.cond,n).some(N))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 i=p instanceof V?p.value:p instanceof Error?p.message:String(p);return d(i,r.catch,n)}return[]}case"Call":return mt(t,r.name,r.args,n);case"VarBind":return d(t,r.value,n).flatMap(i=>{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=B(n,s,i),u!==null)break;return u===null?[]:d(t,r.body,u)});case"VarRef":{if(r.name==="$ENV")return[n.env?G(n.env):Object.create(null)];let p=n.vars.get(r.name);return p!==void 0?[p]:[null]}case"Recurse":{let p=[],i=new WeakSet,u=c=>{if(c&&typeof c=="object"){if(i.has(c))return;i.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(i=>typeof i=="string"?i:d(t,i,n).map(c=>typeof c=="string"?c:JSON.stringify(c)).join("")).join("")];case"UpdateOp":return[Tt(t,r.path,r.op,r.value,n)];case"Reduce":{let p=d(t,r.expr,n),i=d(t,r.init,n)[0],u=n.limits.maxDepth??lt;for(let c of p){let s;if(r.pattern){if(s=B(n,r.pattern,c),s===null)continue}else s=J(n,r.varName,c);if(i=d(i,r.update,s)[0],M(i,u+1)>u)return[null]}return[i]}case"Foreach":{let p=d(t,r.expr,n),i=d(t,r.init,n)[0],u=[];for(let c of p)try{let s;if(r.pattern){if(s=B(n,r.pattern,c),s===null)continue}else s=J(n,r.varName,c);if(i=d(i,r.update,s)[0],r.extract){let f=d(i,r.extract,s);u.push(...f)}else u.push(i)}catch(s){throw s instanceof I?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 I&&p.label===r.name)return p.partialResults;throw p}case"Break":throw new I(r.name);case"Def":{let p=new Map(n.funcs??[]),i=`${r.name}/${r.params.length}`;p.set(i,{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 at(t,r){return t<0?Math.max(0,r+t):Math.min(t,r)}function Tt(t,r,e,n,p){function i(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"?X(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,o){switch(f.type){case"Identity":return o(s);case"Field":{if(!b(f.name))return s;if(f.base)return u(s,f.base,h=>{if(h&&typeof h=="object"&&!Array.isArray(h)){let y=k(h),a=Object.hasOwn(y,f.name)?y[f.name]:void 0;return g(y,f.name,o(a)),y}return h});if(s&&typeof s=="object"&&!Array.isArray(s)){let h=k(s),y=Object.hasOwn(h,f.name)?h[f.name]:void 0;return g(h,f.name,o(y)),h}return s}case"Index":{let y=d(t,f.index,p)[0];if(typeof y=="number"&&Number.isNaN(y))throw new Error("Cannot set array element at NaN index");if(typeof y=="number"&&!Number.isInteger(y)&&(y=Math.trunc(y)),f.base)return u(s,f.base,a=>{if(typeof y=="number"&&Array.isArray(a)){let l=[...a],m=y<0?l.length+y:y;if(m>=0){for(;l.length<=m;)l.push(null);l[m]=o(l[m])}return l}if(typeof y=="string"&&a&&typeof a=="object"&&!Array.isArray(a)){if(!b(y))return a;let l=k(a),m=Object.hasOwn(l,y)?l[y]:void 0;return g(l,y,o(m)),l}return a});if(typeof y=="number"){if(y>536870911)throw new Error("Array index too large");if(y<0&&(!s||!Array.isArray(s)))throw new Error("Out of bounds negative array index");if(Array.isArray(s)){let l=[...s],m=y<0?l.length+y:y;if(m>=0){for(;l.length<=m;)l.push(null);l[m]=o(l[m])}return l}if(s==null){let l=[];for(;l.length<=y;)l.push(null);return l[y]=o(null),l}return s}if(typeof y=="string"&&s&&typeof s=="object"&&!Array.isArray(s)){if(!b(y))return s;let a=k(s),l=Object.hasOwn(a,y)?a[y]:void 0;return g(a,y,o(l)),a}return s}case"Iterate":{let h=y=>{if(Array.isArray(y))return y.map(a=>o(a));if(y&&typeof y=="object"){let a=Object.create(null);for(let[l,m]of Object.entries(y))b(l)&&g(a,l,o(m));return a}return y};return f.base?u(s,f.base,h):h(s)}case"Pipe":{let h=u(s,f.left,y=>y);return u(h,f.right,o)}default:return o(s)}}return u(t,r,s=>{if(e==="|=")return i(s,s);let f=d(t,n,p);return i(s,f[0]??null)})}function Ct(t,r,e){function n(i,u,c){switch(u.type){case"Identity":return c;case"Field":{if(!b(u.name))return i;if(u.base){let s=d(i,u.base,e)[0],f=n(s,{type:"Field",name:u.name},c);return n(i,u.base,f)}if(i&&typeof i=="object"&&!Array.isArray(i)){let s=k(i);return g(s,u.name,c),s}return i}case"Index":{if(u.base){let o=d(i,u.base,e)[0],h=n(o,{type:"Index",index:u.index},c);return n(i,u.base,h)}let f=d(t,u.index,e)[0];if(typeof f=="number"&&Array.isArray(i)){let o=[...i],h=f<0?o.length+f:f;return h>=0&&h<o.length&&(o[h]=c),o}if(typeof f=="string"&&i&&typeof i=="object"&&!Array.isArray(i)){if(!b(f))return i;let o=k(i);return g(o,f,c),o}return i}default:return i}}function p(i,u){switch(u.type){case"Identity":return null;case"Field":{if(!b(u.name))return i;if(u.base){let s=d(i,u.base,e)[0];if(s==null)return i;let f=p(s,{type:"Field",name:u.name});return n(i,u.base,f)}if(i&&typeof i=="object"&&!Array.isArray(i)){if(!b(u.name))return i;let s=k(i);return delete s[u.name],s}return i}case"Index":{if(u.base){let o=d(i,u.base,e)[0];if(o==null)return i;let h=p(o,{type:"Index",index:u.index});return n(i,u.base,h)}let f=d(t,u.index,e)[0];if(typeof f=="number"&&Array.isArray(i)){let o=[...i],h=f<0?o.length+f:f;return h>=0&&h<o.length&&o.splice(h,1),o}if(typeof f=="string"&&i&&typeof i=="object"&&!Array.isArray(i)){if(!b(f))return i;let o=k(i);return delete o[f],o}return i}case"Iterate":return Array.isArray(i)?[]:i&&typeof i=="object"?Object.create(null):i;case"Pipe":{let o=function(a,l,m){switch(l.type){case"Identity":return m;case"Field":{if(!b(l.name))return a;if(a&&typeof a=="object"&&!Array.isArray(a)){let A=k(a);return g(A,l.name,m),A}return a}case"Index":{let E=d(t,l.index,e)[0];if(typeof E=="number"&&Array.isArray(a)){let w=[...a],x=E<0?w.length+E:E;return x>=0&&x<w.length&&(w[x]=m),w}if(typeof E=="string"&&a&&typeof a=="object"&&!Array.isArray(a)){if(!b(E))return a;let w=k(a);return g(w,E,m),w}return a}case"Pipe":{let A=d(a,l.left,e)[0],E=o(A,l.right,m);return o(a,l.left,E)}default:return a}};var c=o;let s=u.left,f=u.right,h=d(i,s,e)[0];if(h==null)return i;let y=p(h,f);return o(i,s,y)}default:return i}}return p(t,r)}function jt(t,r,e,n,p){if(r==="and")return d(t,e,p).flatMap(s=>N(s)?d(t,n,p).map(o=>N(o)):[!1]);if(r==="or")return d(t,e,p).flatMap(s=>N(s)?[!0]:d(t,n,p).map(o=>N(o)));if(r==="//"){let s=d(t,e,p).filter(f=>f!=null&&f!==!1);return s.length>0?s:d(t,n,p)}let i=d(t,e,p),u=d(t,n,p);return i.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)?X(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(o=>JSON.stringify(o)));return c.filter(o=>!f.has(JSON.stringify(o)))}if(typeof c=="string"&&typeof s=="string"){let f=o=>o.length>10?`"${o.slice(0,10)}...`:JSON.stringify(o);throw new Error(`string (${f(c)}) and string (${f(s)}) cannot be subtracted`)}return null;case"*":return typeof c=="number"&&typeof s=="number"?c*s:typeof c=="string"&&typeof s=="number"?c.repeat(s):c&&s&&typeof c=="object"&&typeof s=="object"&&!Array.isArray(c)&&!Array.isArray(s)?z(c,s):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 R(c,s);case"!=":return!R(c,s);case"<":return D(c,s)<0;case"<=":return D(c,s)<=0;case">":return D(c,s)>0;case">=":return D(c,s)>=0;default:return null}}))}function mt(t,r,e,n){let p=Nt.get(r);if(p)return typeof t=="number"?[p(t)]:[null];let i=et(t,r,e,n,d);if(i!==null)return i;let u=ot(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=v(t,r,n.limits.maxDepth);if(s!==null)return s;let f=ft(t,r);if(f!==null)return f;let o=nt(t,r,e,n,d);if(o!==null)return o;let h=W(t,r,e,n,d,yt,L,N,_,P);if(h!==null)return h;let y=st(t,r,e,n,d,N,$,F,Ct,K);if(y!==null)return y;let a=tt(t,r,e,n,d,R);if(a!==null)return a;let l=Q(t,r,e,n,d,yt,N,P);if(l!==null)return l;let m=rt(t,r,e,n,d,N,St,mt);if(m!==null)return m;let A=it(t,r,e,n,d,R);if(A!==null)return A;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 E=e.length>0?d(t,e[0],n)[0]:t;throw new V(E)}case"env":return[n.env?G(n.env):Object.create(null)];case"debug":return[t];case"input_line_number":return[1];default:{let E=`${r}/${e.length}`,w=n.funcs?.get(E);if(w){let x=w.closure??n.funcs??new Map,Y=new Map(x);Y.set(E,w);for(let U=0;U<w.params.length;U++){let gt=w.params[U],ut=e[U];if(ut){let C=d(t,ut,n),j;if(C.length===0)j={type:"Call",name:"empty",args:[]};else if(C.length===1)j={type:"Literal",value:C[0]};else{j={type:"Literal",value:C[C.length-1]};for(let q=C.length-2;q>=0;q--)j={type:"Comma",left:{type:"Literal",value:C[q]},right:j}}Y.set(`${gt}/0`,{params:[],body:j})}}let bt={...n,funcs:Y};return d(t,w.body,bt)}throw new Error(`Unknown function: ${r}`)}}}function K(t,r,e,n,p){if(r.type==="Comma"){let c=r;K(t,c.left,e,n,p),K(t,c.right,e,n,p);return}let i=T(r);if(i!==null){p.push([...n,...i]);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 o=0;o<s.length;o++)c(s[o],[...f,o]);else for(let o of Object.keys(s))c(s[o],[...f,o])};c(t,[]);return}if(r.type==="Pipe"){let c=T(r.left);if(c!==null){let s=d(t,r.left,e);for(let f of s)K(f,r.right,e,[...n,...c],p);return}}d(t,r,e).length>0&&p.push(n)}var dt=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"]]),H=new Set(dt.values());function At(t){let r=[],e=0,n=(f=0)=>t[e+f],p=()=>t[e++],i=()=>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(;!i();){let f=e,o=p();if(!(o===" "||o===" "||o===`
|
|
4
|
+
`||o==="\r")){if(o==="#"){for(;!i()&&n()!==`
|
|
5
|
+
`;)p();continue}if(o==="."&&n()==="."){p(),r.push({type:"DOTDOT",pos:f});continue}if(o==="="&&n()==="="){p(),r.push({type:"EQ",pos:f});continue}if(o==="!"&&n()==="="){p(),r.push({type:"NE",pos:f});continue}if(o==="<"&&n()==="="){p(),r.push({type:"LE",pos:f});continue}if(o===">"&&n()==="="){p(),r.push({type:"GE",pos:f});continue}if(o==="/"&&n()==="/"){p(),n()==="="?(p(),r.push({type:"UPDATE_ALT",pos:f})):r.push({type:"ALT",pos:f});continue}if(o==="+"&&n()==="="){p(),r.push({type:"UPDATE_ADD",pos:f});continue}if(o==="-"&&n()==="="){p(),r.push({type:"UPDATE_SUB",pos:f});continue}if(o==="*"&&n()==="="){p(),r.push({type:"UPDATE_MUL",pos:f});continue}if(o==="/"&&n()==="="){p(),r.push({type:"UPDATE_DIV",pos:f});continue}if(o==="%"&&n()==="="){p(),r.push({type:"UPDATE_MOD",pos:f});continue}if(o==="="&&n()!=="="){r.push({type:"ASSIGN",pos:f});continue}if(o==="."){r.push({type:"DOT",pos:f});continue}if(o==="|"){n()==="="?(p(),r.push({type:"UPDATE_PIPE",pos:f})):r.push({type:"PIPE",pos:f});continue}if(o===","){r.push({type:"COMMA",pos:f});continue}if(o===":"){r.push({type:"COLON",pos:f});continue}if(o===";"){r.push({type:"SEMICOLON",pos:f});continue}if(o==="("){r.push({type:"LPAREN",pos:f});continue}if(o===")"){r.push({type:"RPAREN",pos:f});continue}if(o==="["){r.push({type:"LBRACKET",pos:f});continue}if(o==="]"){r.push({type:"RBRACKET",pos:f});continue}if(o==="{"){r.push({type:"LBRACE",pos:f});continue}if(o==="}"){r.push({type:"RBRACE",pos:f});continue}if(o==="?"){r.push({type:"QUESTION",pos:f});continue}if(o==="+"){r.push({type:"PLUS",pos:f});continue}if(o==="-"){r.push({type:"MINUS",pos:f});continue}if(o==="*"){r.push({type:"STAR",pos:f});continue}if(o==="/"){r.push({type:"SLASH",pos:f});continue}if(o==="%"){r.push({type:"PERCENT",pos:f});continue}if(o==="<"){r.push({type:"LT",pos:f});continue}if(o===">"){r.push({type:"GT",pos:f});continue}if(u(o)){let h=o;for(;!i()&&(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(o==='"'){let h="";for(;!i()&&n()!=='"';)if(n()==="\\"){if(p(),i())break;let y=p();switch(y){case"n":h+=`
|
|
6
|
+
`;break;case"r":h+="\r";break;case"t":h+=" ";break;case"\\":h+="\\";break;case'"':h+='"';break;case"(":h+="\\(";break;default:h+=y}}else h+=p();i()||p(),r.push({type:"STRING",value:h,pos:f});continue}if(c(o)||o==="$"||o==="@"){let h=o;for(;!i()&&s(n());)h+=p();let y=dt.get(h);y?r.push({type:y,value:h,pos:f}):r.push({type:"IDENT",value:h,pos:f});continue}throw new Error(`Unexpected character '${o}' at position ${f}`)}}return r.push({type:"EOF",pos:e}),r}var pt=class t{tokens;pos=0;constructor(r){this.tokens=r}peek(r=0){return this.tokens[this.pos+r]??{type:"EOF",pos:-1}}advance(){return this.tokens[this.pos++]}check(r){return this.peek().type===r}match(...r){for(let e of r)if(this.check(e))return this.advance();return null}expect(r,e){if(!this.check(r))throw new Error(`${e} at position ${this.peek().pos}, got ${this.peek().type}`);return this.advance()}isFieldNameAfterDot(r=0){let e=this.peek(r),n=this.peek(r+1);return n.type==="STRING"?!0:n.type==="IDENT"||H.has(n.type)?n.pos===e.pos+1:!1}isIdentLike(){let r=this.peek().type;return r==="IDENT"||H.has(r)}consumeFieldNameAfterDot(r){let e=this.peek();return e.type==="STRING"?this.advance().value:(e.type==="IDENT"||H.has(e.type))&&e.pos===r.pos+1?this.advance().value:null}parse(){let r=this.parseExpr();if(!this.check("EOF"))throw new Error(`Unexpected token ${this.peek().type} at position ${this.peek().pos}`);return r}parseExpr(){return this.parsePipe()}parsePattern(){if(this.match("LBRACKET")){let n=[];if(!this.check("RBRACKET"))for(n.push(this.parsePattern());this.match("COMMA")&&!this.check("RBRACKET");)n.push(this.parsePattern());return this.expect("RBRACKET","Expected ']' after array pattern"),{type:"array",elements:n}}if(this.match("LBRACE")){let n=[];if(!this.check("RBRACE"))for(n.push(this.parsePatternField());this.match("COMMA")&&!this.check("RBRACE");)n.push(this.parsePatternField());return this.expect("RBRACE","Expected '}' after object pattern"),{type:"object",fields:n}}let r=this.expect("IDENT","Expected variable name in pattern"),e=r.value;if(!e.startsWith("$"))throw new Error(`Variable name must start with $ at position ${r.pos}`);return{type:"var",name:e}}parsePatternField(){if(this.match("LPAREN")){let e=this.parseExpr();this.expect("RPAREN","Expected ')' after computed key"),this.expect("COLON","Expected ':' after computed key");let n=this.parsePattern();return{key:e,pattern:n}}let r=this.peek();if(r.type==="IDENT"||H.has(r.type)){let e=r.value;if(e.startsWith("$")){if(this.advance(),this.match("COLON")){let n=this.parsePattern();return{key:e.slice(1),pattern:n,keyVar:e}}return{key:e.slice(1),pattern:{type:"var",name:e}}}if(this.advance(),this.match("COLON")){let n=this.parsePattern();return{key:e,pattern:n}}return{key:e,pattern:{type:"var",name:`$${e}`}}}throw new Error(`Expected field name in object pattern at position ${r.pos}`)}parsePipe(){let r=this.parseComma();for(;this.match("PIPE");){let e=this.parseComma();r={type:"Pipe",left:r,right:e}}return r}parseComma(){let r=this.parseVarBind();for(;this.match("COMMA");){let e=this.parseVarBind();r={type:"Comma",left:r,right:e}}return r}parseVarBind(){let r=this.parseUpdate();if(this.match("AS")){let e=this.parsePattern(),n=[];for(;this.check("QUESTION")&&this.peekAhead(1)?.type==="ALT";)this.advance(),this.advance(),n.push(this.parsePattern());this.expect("PIPE","Expected '|' after variable binding");let p=this.parseExpr();return e.type==="var"&&n.length===0?{type:"VarBind",name:e.name,value:r,body:p}:{type:"VarBind",name:e.type==="var"?e.name:"",value:r,body:p,pattern:e.type!=="var"?e:void 0,alternatives:n.length>0?n:void 0}}return r}peekAhead(r){let e=this.pos+r;return e<this.tokens.length?this.tokens[e]:void 0}parseUpdate(){let r=this.parseAlt(),e=new Map([["ASSIGN","="],["UPDATE_ADD","+="],["UPDATE_SUB","-="],["UPDATE_MUL","*="],["UPDATE_DIV","/="],["UPDATE_MOD","%="],["UPDATE_ALT","//="],["UPDATE_PIPE","|="]]),n=this.match("ASSIGN","UPDATE_ADD","UPDATE_SUB","UPDATE_MUL","UPDATE_DIV","UPDATE_MOD","UPDATE_ALT","UPDATE_PIPE");if(n){let p=this.parseVarBind(),i=e.get(n.type);if(i)return{type:"UpdateOp",op:i,path:r,value:p}}return r}parseAlt(){let r=this.parseOr();for(;this.match("ALT");){let e=this.parseOr();r={type:"BinaryOp",op:"//",left:r,right:e}}return r}parseOr(){let r=this.parseAnd();for(;this.match("OR");){let e=this.parseAnd();r={type:"BinaryOp",op:"or",left:r,right:e}}return r}parseAnd(){let r=this.parseNot();for(;this.match("AND");){let e=this.parseNot();r={type:"BinaryOp",op:"and",left:r,right:e}}return r}parseNot(){return this.parseComparison()}parseComparison(){let r=this.parseAddSub(),e=new Map([["EQ","=="],["NE","!="],["LT","<"],["LE","<="],["GT",">"],["GE",">="]]),n=this.match("EQ","NE","LT","LE","GT","GE");if(n){let p=e.get(n.type);if(p){let i=this.parseAddSub();r={type:"BinaryOp",op:p,left:r,right:i}}}return r}parseAddSub(){let r=this.parseMulDiv();for(;;)if(this.match("PLUS")){let e=this.parseMulDiv();r={type:"BinaryOp",op:"+",left:r,right:e}}else if(this.match("MINUS")){let e=this.parseMulDiv();r={type:"BinaryOp",op:"-",left:r,right:e}}else break;return r}parseMulDiv(){let r=this.parseUnary();for(;;)if(this.match("STAR")){let e=this.parseUnary();r={type:"BinaryOp",op:"*",left:r,right:e}}else if(this.match("SLASH")){let e=this.parseUnary();r={type:"BinaryOp",op:"/",left:r,right:e}}else if(this.match("PERCENT")){let e=this.parseUnary();r={type:"BinaryOp",op:"%",left:r,right:e}}else break;return r}parseUnary(){return this.match("MINUS")?{type:"UnaryOp",op:"-",operand:this.parseUnary()}:this.parsePostfix()}parsePostfix(){let r=this.parsePrimary();for(;;)if(this.match("QUESTION"))r={type:"Optional",expr:r};else if(this.check("DOT")&&this.isFieldNameAfterDot())this.advance(),r={type:"Field",name:this.advance().value,base:r};else if(this.check("LBRACKET"))if(this.advance(),this.match("RBRACKET"))r={type:"Iterate",base:r};else if(this.check("COLON")){this.advance();let e=this.check("RBRACKET")?void 0:this.parseExpr();this.expect("RBRACKET","Expected ']'"),r={type:"Slice",end:e,base:r}}else{let e=this.parseExpr();if(this.match("COLON")){let n=this.check("RBRACKET")?void 0:this.parseExpr();this.expect("RBRACKET","Expected ']'"),r={type:"Slice",start:e,end:n,base:r}}else this.expect("RBRACKET","Expected ']'"),r={type:"Index",index:e,base:r}}else break;return r}parsePrimary(){if(this.match("DOTDOT"))return{type:"Recurse"};if(this.check("DOT")){let r=this.advance();if(this.check("LBRACKET")){if(this.advance(),this.match("RBRACKET"))return{type:"Iterate"};if(this.check("COLON")){this.advance();let p=this.check("RBRACKET")?void 0:this.parseExpr();return this.expect("RBRACKET","Expected ']'"),{type:"Slice",end:p}}let n=this.parseExpr();if(this.match("COLON")){let p=this.check("RBRACKET")?void 0:this.parseExpr();return this.expect("RBRACKET","Expected ']'"),{type:"Slice",start:n,end:p}}return this.expect("RBRACKET","Expected ']'"),{type:"Index",index:n}}let e=this.consumeFieldNameAfterDot(r);return e!==null?{type:"Field",name:e}:{type:"Identity"}}if(this.match("TRUE"))return{type:"Literal",value:!0};if(this.match("FALSE"))return{type:"Literal",value:!1};if(this.match("NULL"))return{type:"Literal",value:null};if(this.check("NUMBER"))return{type:"Literal",value:this.advance().value};if(this.check("STRING")){let e=this.advance().value;return e.includes("\\(")?this.parseStringInterpolation(e):{type:"Literal",value:e}}if(this.match("LBRACKET")){if(this.match("RBRACKET"))return{type:"Array"};let r=this.parseExpr();return this.expect("RBRACKET","Expected ']'"),{type:"Array",elements:r}}if(this.match("LBRACE"))return this.parseObjectConstruction();if(this.match("LPAREN")){let r=this.parseExpr();return this.expect("RPAREN","Expected ')'"),{type:"Paren",expr:r}}if(this.match("IF"))return this.parseIf();if(this.match("TRY")){let r=this.parsePostfix(),e;return this.match("CATCH")&&(e=this.parsePostfix()),{type:"Try",body:r,catch:e}}if(this.match("REDUCE")){let r=this.parseAddSub();this.expect("AS","Expected 'as' after reduce expression");let e=this.parsePattern();this.expect("LPAREN","Expected '(' after variable");let n=this.parseExpr();this.expect("SEMICOLON","Expected ';' after init expression");let p=this.parseExpr();this.expect("RPAREN","Expected ')' after update expression");let i=e.type==="var"?e.name:"";return{type:"Reduce",expr:r,varName:i,init:n,update:p,pattern:e.type!=="var"?e:void 0}}if(this.match("FOREACH")){let r=this.parseAddSub();this.expect("AS","Expected 'as' after foreach expression");let e=this.parsePattern();this.expect("LPAREN","Expected '(' after variable");let n=this.parseExpr();this.expect("SEMICOLON","Expected ';' after init expression");let p=this.parseExpr(),i;this.match("SEMICOLON")&&(i=this.parseExpr()),this.expect("RPAREN","Expected ')' after expressions");let u=e.type==="var"?e.name:"";return{type:"Foreach",expr:r,varName:u,init:n,update:p,extract:i,pattern:e.type!=="var"?e:void 0}}if(this.match("LABEL")){let r=this.expect("IDENT","Expected label name (e.g., $out)"),e=r.value;if(!e.startsWith("$"))throw new Error(`Label name must start with $ at position ${r.pos}`);this.expect("PIPE","Expected '|' after label name");let n=this.parseExpr();return{type:"Label",name:e,body:n}}if(this.match("BREAK")){let r=this.expect("IDENT","Expected label name to break to"),e=r.value;if(!e.startsWith("$"))throw new Error(`Break label must start with $ at position ${r.pos}`);return{type:"Break",name:e}}if(this.match("DEF")){let e=this.expect("IDENT","Expected function name after def").value,n=[];if(this.match("LPAREN")){if(!this.check("RPAREN")){let u=this.expect("IDENT","Expected parameter name");for(n.push(u.value);this.match("SEMICOLON");){let c=this.expect("IDENT","Expected parameter name");n.push(c.value)}}this.expect("RPAREN","Expected ')' after parameters")}this.expect("COLON","Expected ':' after function name");let p=this.parseExpr();this.expect("SEMICOLON","Expected ';' after function body");let i=this.parseExpr();return{type:"Def",name:e,params:n,funcBody:p,body:i}}if(this.match("NOT"))return{type:"Call",name:"not",args:[]};if(this.check("IDENT")){let e=this.advance().value;if(e.startsWith("$"))return{type:"VarRef",name:e};if(this.match("LPAREN")){let n=[];if(!this.check("RPAREN"))for(n.push(this.parseExpr());this.match("SEMICOLON");)n.push(this.parseExpr());return this.expect("RPAREN","Expected ')'"),{type:"Call",name:e,args:n}}return{type:"Call",name:e,args:[]}}throw new Error(`Unexpected token ${this.peek().type} at position ${this.peek().pos}`)}parseObjectConstruction(){let r=[];if(!this.check("RBRACE"))do{let e,n;if(this.match("LPAREN"))e=this.parseExpr(),this.expect("RPAREN","Expected ')'"),this.expect("COLON","Expected ':'"),n=this.parseObjectValue();else if(this.isIdentLike()){let p=this.advance().value;this.match("COLON")?(e=p,n=this.parseObjectValue()):(e=p,n={type:"Field",name:p})}else if(this.check("STRING"))e=this.advance().value,this.expect("COLON","Expected ':'"),n=this.parseObjectValue();else throw new Error(`Expected object key at position ${this.peek().pos}`);r.push({key:e,value:n})}while(this.match("COMMA"));return this.expect("RBRACE","Expected '}'"),{type:"Object",entries:r}}parseObjectValue(){let r=this.parseVarBind();for(;this.match("PIPE");){let e=this.parseVarBind();r={type:"Pipe",left:r,right:e}}return r}parseIf(){let r=this.parseExpr();this.expect("THEN","Expected 'then'");let e=this.parseExpr(),n=[];for(;this.match("ELIF");){let i=this.parseExpr();this.expect("THEN","Expected 'then' after elif");let u=this.parseExpr();n.push({cond:i,then:u})}let p;return this.match("ELSE")&&(p=this.parseExpr()),this.expect("END","Expected 'end'"),{type:"Cond",cond:r,then:e,elifs:n,else:p}}parseStringInterpolation(r){let e=[],n="",p=0;for(;p<r.length;)if(r[p]==="\\"&&r[p+1]==="("){n&&(e.push(n),n=""),p+=2;let i=1,u="";for(;p<r.length&&i>0;)r[p]==="("?i++:r[p]===")"&&i--,i>0&&(u+=r[p]),p++;let c=At(u),s=new t(c);e.push(s.parse())}else n+=r[p],p++;return n&&e.push(n),{type:"StringInterp",parts:e}}};function ge(t){let r=At(t);return new pt(r).parse()}export{d as a,ge as b};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import{a as g}from"./chunk-4VDEBYW7.js";import{a as d}from"./chunk-7VWUKGDV.js";import{b as a,e as l}from"./chunk-RAUBS6MJ.js";import{k as p}from"./chunk-463VWH7H.js";var h={recursive:{short:"r",long:"recursive",type:"boolean"},recursiveUpper:{short:"R",type:"boolean"},force:{short:"f",long:"force",type:"boolean"},verbose:{short:"v",long:"verbose",type:"boolean"}},N={name:"rm",async execute(v,s){let y=p(v),e=d("rm",y,h);if(!e.ok)return e.error;let f=e.result.flags.recursive||e.result.flags.recursiveUpper,c=e.result.flags.force,b=e.result.flags.verbose,m=e.result.positional;if(m.length===0)return c?{stdout:a(),stderr:a(),exitCode:0}:{stdout:a(),stderr:l(`rm: missing operand
|
|
3
|
+
`),exitCode:1};let u="",t="",i=0;for(let r of m)try{let n=s.fs.resolvePath(s.cwd,r);if((await s.fs.stat(n)).isDirectory&&!f){t+=`rm: cannot remove '${r}': Is a directory
|
|
4
|
+
`,i=1;continue}await s.fs.rm(n,{recursive:f,force:c}),b&&(u+=`removed '${r}'
|
|
5
|
+
`)}catch(n){if(!c){let o=g(n);o.includes("ENOENT")||o.includes("no such file")?t+=`rm: cannot remove '${r}': No such file or directory
|
|
6
|
+
`:o.includes("ENOTEMPTY")||o.includes("not empty")?t+=`rm: cannot remove '${r}': Directory not empty
|
|
7
|
+
`:t+=`rm: cannot remove '${r}': ${o}
|
|
8
|
+
`,i=1}}return{stdout:l(u),stderr:l(t),exitCode:i}}},x={name:"rm",flags:[{flag:"-r",type:"boolean"},{flag:"-R",type:"boolean"},{flag:"-f",type:"boolean"},{flag:"-v",type:"boolean"}],needsArgs:!0};export{N as a,x as b};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import{b as s,e as f}from"./chunk-RAUBS6MJ.js";import{k as r}from"./chunk-463VWH7H.js";var d={name:"pwd",async execute(l,t){let n=r(l),a=!1;for(let e of n)if(e==="-P")a=!0;else if(e==="-L")a=!1;else{if(e==="--")break;e.startsWith("-")}let o=t.cwd;if(a)try{o=await t.fs.realpath(t.cwd)}catch{}return{stdout:f(`${o}
|
|
3
|
+
`),stderr:s(),exitCode:0}}},m={name:"pwd",flags:[{flag:"-P",type:"boolean"},{flag:"-L",type:"boolean"}]};export{d as a,m as b};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import{a as S}from"./chunk-Z72PSRMX.js";import{a as L}from"./chunk-7VWUKGDV.js";import{a as k,b as F}from"./chunk-DFAHK2EQ.js";import{b as x,e as p}from"./chunk-RAUBS6MJ.js";import{i as w,k as N}from"./chunk-463VWH7H.js";var T={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"]},v={number:{short:"n",long:"number",type:"boolean"}},z={name:"cat",async execute(c,t){let l=N(c);if(F(l))return k(T);let r=L("cat",l,v);if(!r.ok)return r.error;let u=r.result.flags.number,d=r.result.positional;if(u){let e=await S(t,d,{cmdName:"cat",allowStdinMarker:!0,stopOnError:!1}),n="",f=1;for(let{content:i}of e.files){let b=w(i),y=A(b,f);n+=y.content,f=y.nextLineNumber}return{stdout:p(n),stderr:p(e.stderr),exitCode:e.exitCode}}let s=[],a="",m=0,C=d.length===0?["-"]:d;for(let e of C){if(e==="-"){s.push({name:"-",kind:"stdin"});continue}try{let n=t.fs.resolvePath(t.cwd,e);await t.fs.stat(n),s.push({name:n,kind:"file"})}catch{a+=`cat: ${e}: No such file or directory
|
|
3
|
+
`,m=1}}let o=null,g=0,R=async()=>{for(;g<s.length;){let e=s[g++];return o=(e.kind==="stdin"?t.stdin:await t.fs.readFile(e.name)).getReader(),!0}return!1},h=new ReadableStream({async pull(e){for(;;){if(o===null&&!await R()){e.close();return}let n=o,{done:f,value:i}=await n.read();if(f){n.releaseLock(),o=null;continue}if(i&&i.length>0){e.enqueue(i);return}}},cancel(){if(o){try{o.releaseLock()}catch{}o=null}}});return{stdout:(a.length===0&&m===0,h),stderr:a.length>0?p(a):x(),exitCode:m}}};function A(c,t){let l=c.split(`
|
|
4
|
+
`),r=c.endsWith(`
|
|
5
|
+
`),u=r?l.slice(0,-1):l;return{content:u.map((s,a)=>`${String(t+a).padStart(6," ")} ${s}`).join(`
|
|
6
|
+
`)+(r?`
|
|
7
|
+
`:""),nextLineNumber:t+u.length}}var E={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{z as a,E as b};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import{b as x,c as i}from"./chunk-RAUBS6MJ.js";import{g as p,j as d,k as b}from"./chunk-463VWH7H.js";var l=new TextEncoder;function h(o,s){for(let e=0;e<s.length;e++)o.push(s[e])}function w(o){let s=[],e=0;for(;e<o.length;)if(o[e]==="\\"){if(e+1>=o.length){s.push(92);break}let a=o[e+1];switch(a){case"\\":s.push(92),e+=2;break;case"n":s.push(10),e+=2;break;case"t":s.push(9),e+=2;break;case"r":s.push(13),e+=2;break;case"a":s.push(7),e+=2;break;case"b":s.push(8),e+=2;break;case"f":s.push(12),e+=2;break;case"v":s.push(11),e+=2;break;case"e":case"E":s.push(27),e+=2;break;case"c":return{output:new Uint8Array(s),stop:!0};case"0":{let r="",t=e+2;for(;t<o.length&&t<e+5&&/[0-7]/.test(o[t]);)r+=o[t],t++;r.length===0?s.push(0):s.push(parseInt(r,8)%256),e=t;break}case"x":{let r="",t=e+2;for(;t<o.length&&t<e+4&&/[0-9a-fA-F]/.test(o[t]);)r+=o[t],t++;r.length===0?(s.push(92,120),e+=2):(s.push(parseInt(r,16)),e=t);break}case"u":{let r="",t=e+2;for(;t<o.length&&t<e+6&&/[0-9a-fA-F]/.test(o[t]);)r+=o[t],t++;if(r.length===0)h(s,l.encode("\\u")),e+=2;else{let f=parseInt(r,16);h(s,l.encode(String.fromCodePoint(f))),e=t}break}case"U":{let r="",t=e+2;for(;t<o.length&&t<e+10&&/[0-9a-fA-F]/.test(o[t]);)r+=o[t],t++;if(r.length===0)h(s,l.encode("\\U")),e+=2;else{let f=parseInt(r,16);try{h(s,l.encode(String.fromCodePoint(f)))}catch{h(s,l.encode(`\\U${r}`))}e=t}break}default:h(s,l.encode(`\\${a}`)),e+=2}}else{let a=o.charCodeAt(e);if(a<128)s.push(a),e++;else{let r=a>=55296&&a<=56319&&e+1<o.length?o.slice(e,e+2):o[e];h(s,l.encode(r)),e+=r.length}}return{output:new Uint8Array(s),stop:!1}}var m={name:"echo",async execute(o,s){let e=b(o),a=!1,r=s.xpgEcho??!1,t=0;for(;t<e.length;){let n=e[t];if(n==="-n")a=!0,t++;else if(n==="-e")r=!0,t++;else if(n==="-E")r=!1,t++;else if(n==="-ne"||n==="-en")a=!0,r=!0,t++;else break}if(r){let n=e.slice(t).join(" "),u=w(n);return u.stop?{stdout:i(u.output),stderr:x(),exitCode:0}:{stdout:i(a?u.output:d(u.output,new Uint8Array([10]))),stderr:x(),exitCode:0}}let f=new Uint8Array([32]),k=new Uint8Array([10]),g=o.slice(t),c=p;for(let n=0;n<g.length;n++)n>0&&(c=d(c,f)),c=d(c,g[n]);return a||(c=d(c,k)),{stdout:i(c),stderr:x(),exitCode:0}}},E={name:"echo",flags:[{flag:"-n",type:"boolean"},{flag:"-e",type:"boolean"},{flag:"-E",type:"boolean"}],stdinType:"none",needsArgs:!0};export{m as a,E as b};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import{a as C,b as k,c as w}from"./chunk-DFAHK2EQ.js";import{b as d,e as p,g as v}from"./chunk-RAUBS6MJ.js";import{k as b}from"./chunk-463VWH7H.js";var T={name:"unexpand",summary:"convert spaces to tabs",usage:"unexpand [OPTION]... [FILE]...",description:"Convert blanks in each FILE to TABs, writing to standard output. If no FILE is specified, standard input is read.",options:["-t N Use N spaces per tab (default: 8)","-t LIST Use comma-separated list of tab stops","-a Convert all sequences of blanks (not just leading)"],examples:["unexpand file.txt # Convert leading spaces to tabs","unexpand -a file.txt # Convert all space sequences","unexpand -t 4 file.txt # Use 4-space tabs"]};function h(o){let a=o.split(",").map(n=>n.trim()),e=[];for(let n of a){let r=parseInt(n,10);if(Number.isNaN(r)||r<1)return null;e.push(r)}for(let n=1;n<e.length;n++)if(e[n]<=e[n-1])return null;return e}function L(o,a){if(a.length===1){let e=a[0];return o+(e-o%e)}for(let e of a)if(e>o)return e;if(a.length>=2){let e=a[a.length-1]-a[a.length-2],n=a[a.length-1],r=Math.floor((o-n)/e)+1;return n+r*e}return-1}function y(o,a){let{tabStops:e,allBlanks:n}=a,r="",s=0,l="",t=0,i=!0,f=()=>{if(l.length===0)return;let u=t+l.length;if(!n&&!i){r+=l,l="";return}let c=t,x="";for(;c<u;){let g=L(c,e);if(g<=u&&g>c)x+=" ",c=g;else break}let m=u-c;m>0&&(x+=" ".repeat(m)),r+=x,l=""};for(let u of o)u===" "?(l.length===0&&(t=s),l+=u,s++):u===" "?(f(),r+=u,s=L(s,e)):(f(),r+=u,s++,i=!1);return f(),r}function N(o,a){if(o==="")return"";let e=o.split(`
|
|
3
|
+
`),n=o.endsWith(`
|
|
4
|
+
`)&&e[e.length-1]==="";return n&&e.pop(),e.map(s=>y(s,a)).join(`
|
|
5
|
+
`)+(n?`
|
|
6
|
+
`:"")}var z={name:"unexpand",execute:async(o,a)=>{let e=b(o);if(k(e))return C(T);let n={tabStops:[8],allBlanks:!1},r=[],s=0;for(;s<e.length;){let t=e[s];if(t==="-t"&&s+1<e.length){let i=h(e[s+1]);if(!i)return{exitCode:1,stdout:d(),stderr:p(`unexpand: invalid tab size: '${e[s+1]}'
|
|
7
|
+
`)};n.tabStops=i,s+=2}else if(t.startsWith("-t")&&t.length>2){let i=h(t.slice(2));if(!i)return{exitCode:1,stdout:d(),stderr:p(`unexpand: invalid tab size: '${t.slice(2)}'
|
|
8
|
+
`)};n.tabStops=i,s++}else if(t==="--tabs"&&s+1<e.length){let i=h(e[s+1]);if(!i)return{exitCode:1,stdout:d(),stderr:p(`unexpand: invalid tab size: '${e[s+1]}'
|
|
9
|
+
`)};n.tabStops=i,s+=2}else if(t.startsWith("--tabs=")){let i=h(t.slice(7));if(!i)return{exitCode:1,stdout:d(),stderr:p(`unexpand: invalid tab size: '${t.slice(7)}'
|
|
10
|
+
`)};n.tabStops=i,s++}else if(t==="-a"||t==="--all")n.allBlanks=!0,s++;else if(t==="--"){r.push(...e.slice(s+1));break}else{if(t.startsWith("-")&&t!=="-")return w("unexpand",t);r.push(t),s++}}let l="";if(r.length===0){let t=await v(a.stdin);l=N(t,n)}else for(let t of r){let i=a.fs.resolvePath(a.cwd,t),f;try{f=await a.fs.readFileText(i)}catch{return{exitCode:1,stdout:p(l),stderr:p(`unexpand: ${t}: No such file or directory
|
|
11
|
+
`)}}l+=N(f,n)}return{exitCode:0,stdout:p(l),stderr:d()}}},B={name:"unexpand",flags:[{flag:"-t",type:"value",valueHint:"number"},{flag:"-a",type:"boolean"}],stdinType:"text",needsFiles:!0};export{z as a,B as b};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import{a as p,b as u}from"./chunk-DFAHK2EQ.js";import{b as i,e as l}from"./chunk-RAUBS6MJ.js";import{k as h}from"./chunk-463VWH7H.js";var b={name:"readlink",summary:"print resolved symbolic links or canonical file names",usage:"readlink [OPTIONS] FILE...",options:["-f canonicalize by following every symlink in every component of the given name recursively"," --help display this help and exit"]},x={name:"readlink",async execute(k,r){let a=h(k);if(u(a))return p(b);let o=!1,t=0;for(;t<a.length&&a[t].startsWith("-");){let n=a[t];if(n==="-f"||n==="--canonicalize")o=!0,t++;else if(n==="--"){t++;break}else return{stdout:i(),stderr:l(`readlink: invalid option -- '${n.slice(1)}'
|
|
3
|
+
`),exitCode:1}}let c=a.slice(t);if(c.length===0)return{stdout:i(),stderr:l(`readlink: missing operand
|
|
4
|
+
`),exitCode:1};let s="",m=!1;for(let n of c){let d=r.fs.resolvePath(r.cwd,n);try{if(o){let e=d,g=new Set;for(;!g.has(e);){g.add(e);try{let f=await r.fs.readlink(e);if(f.startsWith("/"))e=f;else{let y=e.substring(0,e.lastIndexOf("/"))||"/";e=r.fs.resolvePath(y,f)}}catch{break}}s+=`${e}
|
|
5
|
+
`}else{let e=await r.fs.readlink(d);s+=`${e}
|
|
6
|
+
`}}catch{o?s+=`${d}
|
|
7
|
+
`:m=!0}}return{stdout:l(s),stderr:i(),exitCode:m?1:0}}},P={name:"readlink",flags:[{flag:"-f",type:"boolean"},{flag:"-e",type:"boolean"}],needsArgs:!0};export{x as a,P as b};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import{a as h,b as y}from"./chunk-DFAHK2EQ.js";import{b as i,e as n}from"./chunk-RAUBS6MJ.js";import{k as p}from"./chunk-463VWH7H.js";var k={name:"ln",summary:"make links between files",usage:"ln [OPTIONS] TARGET LINK_NAME",options:["-s create a symbolic link instead of a hard link","-f remove existing destination files","-n treat LINK_NAME as a normal file if it is a symbolic link to a directory","-v print name of each linked file"," --help display this help and exit"]},$={name:"ln",async execute(b,s){let r=p(b);if(y(r))return h(k);let o=!1,d=!1,c=!1,t=0;for(;t<r.length&&r[t].startsWith("-");){let e=r[t];if(e==="-s"||e==="--symbolic")o=!0,t++;else if(e==="-f"||e==="--force")d=!0,t++;else if(e==="-v"||e==="--verbose")c=!0,t++;else if(e==="-n"||e==="--no-dereference")t++;else if(/^-[sfvn]+$/.test(e))e.includes("s")&&(o=!0),e.includes("f")&&(d=!0),e.includes("v")&&(c=!0),t++;else if(e==="--"){t++;break}else return{stdout:i(),stderr:n(`ln: invalid option -- '${e.slice(1)}'
|
|
3
|
+
`),exitCode:1}}let m=r.slice(t);if(m.length<2)return{stdout:i(),stderr:n(`ln: missing file operand
|
|
4
|
+
`),exitCode:1};let l=m[0],a=m[1],f=s.fs.resolvePath(s.cwd,a);if(await s.fs.exists(f))if(d)try{await s.fs.rm(f,{force:!0})}catch{return{stdout:i(),stderr:n(`ln: cannot remove '${a}': Permission denied
|
|
5
|
+
`),exitCode:1}}else return{stdout:i(),stderr:n(`ln: failed to create ${o?"symbolic ":""}link '${a}': File exists
|
|
6
|
+
`),exitCode:1};try{if(o)await s.fs.symlink(l,f);else{let e=s.fs.resolvePath(s.cwd,l);if(!await s.fs.exists(e))return{stdout:i(),stderr:n(`ln: failed to access '${l}': No such file or directory
|
|
7
|
+
`),exitCode:1};await s.fs.link(e,f)}}catch(e){let g=e;return g.message.includes("EPERM")?{stdout:i(),stderr:n(`ln: '${l}': hard link not allowed for directory
|
|
8
|
+
`),exitCode:1}:{stdout:i(),stderr:n(`ln: ${g.message}
|
|
9
|
+
`),exitCode:1}}let u="";return c&&(u=`'${a}' -> '${l}'
|
|
10
|
+
`),{stdout:n(u),stderr:i(),exitCode:0}}},C={name:"ln",flags:[{flag:"-s",type:"boolean"},{flag:"-f",type:"boolean"},{flag:"-n",type:"boolean"},{flag:"-v",type:"boolean"}],needsArgs:!0,minArgs:2};export{$ as a,C as b};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import{a as _}from"./chunk-GIFF636B.js";import{a as ae}from"./chunk-SE4C7FJY.js";import{a as ue,b as he,d as de}from"./chunk-K2K4KPOQ.js";import{a as pe,b as fe}from"./chunk-DFAHK2EQ.js";import{b as re,e as Z,g as Y}from"./chunk-RAUBS6MJ.js";import{k as ce}from"./chunk-463VWH7H.js";function k(e,t){switch(e.type){case"name":{let n=e.pattern,r=n.match(/^\*(\.[a-zA-Z0-9]+)$/);if(r){let s=r[1],c=t.name;if(e.ignoreCase){if(!c.toLowerCase().endsWith(s.toLowerCase()))return{matches:!1,pruned:!1,printed:!1}}else if(!c.endsWith(s))return{matches:!1,pruned:!1,printed:!1};return{matches:!0,pruned:!1,printed:!1}}return{matches:_(t.name,n,e.ignoreCase),pruned:!1,printed:!1}}case"path":{let n=e.pattern,r=t.relativePath,s=n.split("/");for(let i=0;i<s.length-1;i++){let a=s[i];if(a&&a!=="."&&a!==".."&&!a.includes("*")&&!a.includes("?")&&!a.includes("[")){let l=`/${a}/`;if(e.ignoreCase){if(!r.toLowerCase().includes(l.toLowerCase()))return{matches:!1,pruned:!1,printed:!1}}else if(!r.includes(l))return{matches:!1,pruned:!1,printed:!1}}}let c=n.match(/\*(\.[a-zA-Z0-9]+)$/);if(c){let i=c[1];if(e.ignoreCase){if(!r.toLowerCase().endsWith(i.toLowerCase()))return{matches:!1,pruned:!1,printed:!1}}else if(!r.endsWith(i))return{matches:!1,pruned:!1,printed:!1}}return{matches:_(r,n,e.ignoreCase),pruned:!1,printed:!1}}case"regex":try{let n=e.ignoreCase?"i":"";return{matches:ae(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 r=(Date.now()-t.mtime)/(1e3*60*60*24),s;return e.comparison==="more"?s=r>e.days:e.comparison==="less"?s=r<e.days:s=Math.floor(r)===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 r;return e.comparison==="more"?r=t.size>n:e.comparison==="less"?r=t.size<n:e.unit==="b"?r=Math.ceil(t.size/512)===e.value:r=t.size===n,{matches:r,pruned:!1,printed:!1}}case"perm":{let n=t.mode&511,r=e.mode&511,s;return e.matchType==="exact"?s=n===r:e.matchType==="all"?s=(n&r)===r:s=(n&r)!==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 r=k(e.right,t);return{matches:r.matches,pruned:n.pruned||r.pruned,printed:n.printed||r.printed}}case"or":{let n=k(e.left,t);if(n.matches)return n;let r=k(e.right,t);return{matches:r.matches,pruned:n.pruned||r.pruned,printed:r.printed}}}}function V(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 V(e.expr);case"and":case"or":return V(e.left)||V(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 me(e){let t={terminalDirName:null,requiredExtension:null};if(!e)return t;let n=Fe(e);if(Ie(e)&&n.length===1){let c=n[0].split("/").filter(i=>i.length>0);if(c.length>=2)for(let i=c.length-2;i>=0;i--){let a=c[i];if(!a.includes("*")&&!a.includes("?")&&!a.includes("[")&&a!=="."&&a!==".."){let l=c[i+1];if(l&&(l.includes("*")||l.includes("?"))){t.terminalDirName=a;let o=l.match(/^\*(\.[a-zA-Z0-9]+)$/);o&&(t.requiredExtension=o[1])}break}}}return t}function Fe(e){let t=[],n=r=>{r.type==="path"?t.push(r.pattern):r.type==="not"?n(r.expr):(r.type==="and"||r.type==="or")&&(n(r.left),n(r.right))};return n(e),t}function Ie(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 ye(e){let t=[],n=r=>{r&&(r.type==="newer"?t.push(r.refPath):r.type==="not"?n(r.expr):(r.type==="and"||r.type==="or")&&(n(r.left),n(r.right)))};return n(e),t}function Q(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 Q(e.expr);case"and":case"or":return Q(e.left)&&Q(e.right)}}function H(e,t,n,r,s){switch(e.type){case"name":{let c=e.pattern,i=c.match(/^\*(\.[a-zA-Z0-9]+)$/);if(i){let a=i[1];if(e.ignoreCase){if(!t.toLowerCase().endsWith(a.toLowerCase()))return{matches:!1,pruned:!1,printed:!1}}else if(!t.endsWith(a))return{matches:!1,pruned:!1,printed:!1};return{matches:!0,pruned:!1,printed:!1}}return{matches:_(t,c,e.ignoreCase),pruned:!1,printed:!1}}case"path":{let c=e.pattern,i=c.split("/");for(let l=0;l<i.length-1;l++){let o=i[l];if(o&&o!=="."&&o!==".."&&!o.includes("*")&&!o.includes("?")&&!o.includes("[")){let u=`/${o}/`;if(e.ignoreCase){if(!n.toLowerCase().includes(u.toLowerCase()))return{matches:!1,pruned:!1,printed:!1}}else if(!n.includes(u))return{matches:!1,pruned:!1,printed:!1}}}let a=c.match(/\*(\.[a-zA-Z0-9]+)$/);if(a){let l=a[1];if(e.ignoreCase){if(!n.toLowerCase().endsWith(l.toLowerCase()))return{matches:!1,pruned:!1,printed:!1}}else if(!n.endsWith(l))return{matches:!1,pruned:!1,printed:!1}}return{matches:_(n,c,e.ignoreCase),pruned:!1,printed:!1}}case"regex":try{let c=e.ignoreCase?"i":"";return{matches:ae(e.pattern,c).test(n),pruned:!1,printed:!1}}catch{return{matches:!1,pruned:!1,printed:!1}}case"type":return e.fileType==="f"?{matches:r,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 c=H(e.expr,t,n,r,s);return{matches:!c.matches,pruned:c.pruned,printed:!1}}case"and":{let c=H(e.left,t,n,r,s);if(!c.matches)return{matches:!1,pruned:c.pruned,printed:!1};let i=H(e.right,t,n,r,s);return{matches:i.matches,pruned:c.pruned||i.pruned,printed:c.printed||i.printed}}case"or":{let c=H(e.left,t,n,r,s);if(c.matches)return c;let i=H(e.right,t,n,r,s);return{matches:i.matches,pruned:c.pruned||i.pruned,printed:i.printed}}default:return{matches:!1,pruned:!1,printed:!1}}}function U(e){if(!e)return!1;switch(e.type){case"prune":return!0;case"not":return U(e.expr);case"and":case"or":return U(e.left)||U(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 ge(e,t){if(!e||!t.isDirectory)return{shouldPrune:!1};if(!z(e))return ie(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 ie(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 ie(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?ie(e.right,t):{shouldPrune:!1}}return{shouldPrune:!1}}case"not":return{shouldPrune:!1};default:return{shouldPrune:!1}}}function we(e,t){let n=[],r=[],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 a=e[++s];if(a==="f"||a==="d")n.push({type:"expr",expr:{type:"type",fileType:a}});else return{expr:null,pathIndex:s,error:`find: Unknown argument to -type: ${a}
|
|
3
|
+
`,actions:[]}}else if(i==="-empty")n.push({type:"expr",expr:{type:"empty"}});else if(i==="-mtime"&&s+1<e.length){let a=e[++s],l="exact",o=a;a.startsWith("+")?(l="more",o=a.slice(1)):a.startsWith("-")&&(l="less",o=a.slice(1));let u=parseInt(o,10);Number.isNaN(u)||n.push({type:"expr",expr:{type:"mtime",days:u,comparison:l}})}else if(i==="-newer"&&s+1<e.length){let a=e[++s];n.push({type:"expr",expr:{type:"newer",refPath:a}})}else if(i==="-size"&&s+1<e.length){let a=e[++s],l="exact",o=a;a.startsWith("+")?(l="more",o=a.slice(1)):a.startsWith("-")&&(l="less",o=a.slice(1));let u=o.match(/^(\d+)([ckMGb])?$/);if(u){let B=parseInt(u[1],10),X=u[2]||"b";n.push({type:"expr",expr:{type:"size",value:B,unit:X,comparison:l}})}}else if(i==="-perm"&&s+1<e.length){let a=e[++s],l="exact",o=a;a.startsWith("-")?(l="all",o=a.slice(1)):a.startsWith("/")&&(l="any",o=a.slice(1));let u=parseInt(o,8);Number.isNaN(u)||n.push({type:"expr",expr:{type:"perm",mode:u,matchType:l}})}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 a=[];for(s++;s<e.length&&e[s]!==";"&&e[s]!=="+";)a.push(e[s]),s++;if(s>=e.length)return{expr:null,pathIndex:s,error:"find: missing argument to `-exec'\n",actions:[]};let l=e[s]==="+";r.push({type:"exec",command:a,batchMode:l})}else if(i==="-print")n.push({type:"expr",expr:{type:"print"}}),r.push({type:"print"});else if(i==="-print0")r.push({type:"print0"});else if(i==="-printf"&&s+1<e.length){let a=e[++s];r.push({type:"printf",format:a})}else if(i==="-delete")r.push({type:"delete"});else{if(i.startsWith("-"))return{expr:null,pathIndex:s,error:`find: unknown predicate '${i}'
|
|
4
|
+
`,actions:[]};if(n.length===0){s++;continue}break}s++}if(n.length===0)return{expr:null,pathIndex:s,actions:r};let c=$e(n);return c.error?{expr:null,pathIndex:s,error:c.error,actions:r}:{expr:c.expr,pathIndex:s,actions:r}}function $e(e){let t=0;function n(){let a=r();if(!a)return null;for(;t<e.length;){let l=e[t];if(l.type==="op"&&l.op==="or"){t++;let o=r();if(!o)return a;a={type:"or",left:a,right:o}}else break}return a}function r(){let a=s();if(!a)return null;for(;t<e.length;){let l=e[t];if(l.type==="op"&&l.op==="and"){t++;let o=s();if(!o)return a;a={type:"and",left:a,right:o}}else if(l.type==="expr"||l.type==="not"||l.type==="lparen"){let o=s();if(!o)return a;a={type:"and",left:a,right:o}}else break}return a}function s(){if(t<e.length&&e[t].type==="not"){t++;let a=s();return a?{type:"not",expr:a}:null}return c()}function c(){if(t>=e.length)return null;let a=e[t];if(a.type==="lparen"){t++;let l=n();return t<e.length&&e[t].type==="rparen"&&t++,l}return a.type==="expr"?(t++,a.expr):(a.type==="rparen",null)}return{expr:n()}}var De=500;function Re(){return{readdirCalls:0,readdirTime:0,statCalls:0,statTime:0,evalCalls:0,evalTime:0,nodeCount:0,batchCount:0,batchTime:0,earlyPrunes:0}}function ke(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 Ne={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"]},We=new Set(["-name","-iname","-path","-ipath","-regex","-iregex","-type","-maxdepth","-mindepth","-mtime","-newer","-size","-perm"]),Qe={name:"find",async execute(e,t){let n=ce(e);if(fe(n))return pe(Ne);let r=[],s=null,c=null,i=!1,a=!1;for(let p=0;p<n.length;p++){let f=n[p];if(f==="-maxdepth"&&p+1<n.length)a=!0,s=parseInt(n[++p],10);else if(f==="-mindepth"&&p+1<n.length)a=!0,c=parseInt(n[++p],10);else if(f==="-depth")a=!0,i=!0;else if(f==="-exec")for(a=!0,p++;p<n.length&&n[p]!==";"&&n[p]!=="+";)p++;else!f.startsWith("-")&&f!==";"&&f!=="+"&&f!=="("&&f!==")"&&f!=="\\("&&f!=="\\)"&&f!=="!"?a||r.push(f):We.has(f)?(a=!0,p++):(f.startsWith("-")||f==="("||f==="\\("||f==="!")&&(a=!0)}r.length===0&&r.push(".");let{expr:l,error:o,actions:u}=we(n,0);if(o)return{stdout:re(),stderr:Z(o),exitCode:1};let B=u.some(p=>p.type==="print"),X=u.length===0,N=[],Te=u.some(p=>p.type==="printf"),le=[],q="",G=0,Se=ye(l),ee=new Map;for(let p of Se){let f=t.fs.resolvePath(t.cwd,p);try{let d=await t.fs.stat(f);ee.set(p,d.mtime?.getTime()??Date.now())}catch{}}let Ce=u.some(p=>{if(p.type!=="printf")return!1;let f=p.format.replace(/%%/g,"");return/%[-+]?[0-9]*\.?[0-9]*(s|m|M|t|T)/.test(f)}),Pe=V(l)||Ce,be=J(l),te=me(l),oe=U(l),ve=Q(l),Ee=typeof t.fs.readdirWithFileTypes=="function";for(let p of r){let W=function(h){let $=c===null||h.depth>=c,C=!1;if($&&l!==null){let P=Date.now(),y;if(ve)y=H(l,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:ee};y=k(l,m)}$=y.matches,C=B?y.printed:$,d.evalCalls++,d.evalTime+=Date.now()-P}else $&&(C=!0);return C?{print:!0,printfData:Te?{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:p}:null}:{print:!1,printfData:null}};var Oe=W;p.length>1&&p.endsWith("/")&&(p=p.slice(0,-1));let f=t.fs.resolvePath(t.cwd,p);try{await t.fs.stat(f)}catch{q+=`find: ${p}: No such file or directory
|
|
5
|
+
`,G=1;continue}let d=Re(),I=Date.now();async function b(h){let{path:v,depth:$,typeInfo:C}=h;if(d.nodeCount++,s!==null&&$>s)return null;let E,P,y;if(C&&!Pe)E=C.isFile,P=C.isDirectory;else{try{let L=Date.now();y=await t.fs.stat(v),d.statCalls++,d.statTime+=Date.now()-L}catch{return null}if(!y)return null;E=y.isFile,P=y.isDirectory}let m;v===f?m=p.split("/").pop()||p:m=v.split("/").pop()||"";let g=v===f?p:p==="."?`./${v.slice(f==="/"?f.length:f.length+1)}`:p+v.slice(f.length),T=[],S=null,w=null,D=!1;P&&oe&&!i&&(D=ge(l,{name:m,relativePath:g,isFile:E,isDirectory:P}).shouldPrune,D&&d.earlyPrunes++);let x=s!==null&&$>=s,F=te.terminalDirName!==null&&m===te.terminalDirName,j=!x&&!F&&!D;if(P&&((j||be||F)&&!D)){let L=Date.now();if(Ee&&t.fs.readdirWithFileTypes){if(S=await t.fs.readdirWithFileTypes(v),w=S.map(M=>M.name),d.readdirCalls++,d.readdirTime+=Date.now()-L,j)T=S.map((M,R)=>({path:v==="/"?`/${M.name}`:`${v}/${M.name}`,depth:$+1,typeInfo:{isFile:M.isFile,isDirectory:M.isDirectory},resultIndex:R}));else if(F){let M=te.requiredExtension;T=S.filter(R=>R.isFile&&(!M||R.name.endsWith(M))).map((R,xe)=>({path:v==="/"?`/${R.name}`:`${v}/${R.name}`,depth:$+1,typeInfo:{isFile:R.isFile,isDirectory:R.isDirectory},resultIndex:xe}))}}else w=await t.fs.readdir(v),d.readdirCalls++,d.readdirTime+=Date.now()-L,j&&(T=w.map((M,R)=>({path:v==="/"?`/${M}`:`${v}/${M}`,depth:$+1,resultIndex:R})))}let K=E?(y?.size??0)===0:w!==null&&w.length===0,O=D;if(!i&&l!==null&&!D&&oe){let L=Date.now(),M={name:m,relativePath:g,isFile:E,isDirectory:P,isEmpty:K,mtime:y?.mtime?.getTime()??Date.now(),size:y?.size??0,mode:y?.mode??420,newerRefTimes:ee};O=k(l,M).pruned,d.evalCalls++,d.evalTime+=Date.now()-L}return{relativePath:g,name:m,isFile:E,isDirectory:P,isEmpty:K,stat:y,depth:$,children:O?[]:T,pruned:O}}async function Me(){let h={paths:[],printfData:[]};if(i){let y=function(m){let g={paths:[],printfData:[]},T=C[m];if(!T)return g;for(let D of T.childIndices){let x=y(D);g.paths.push(...x.paths),g.printfData.push(...x.printfData)}let{print:S,printfData:w}=W(T.node);return S&&(g.paths.push(T.node.relativePath),w&&g.printfData.push(w)),g};var v=y;let C=[],E=[{item:{path:f,depth:0,resultIndex:0},parentIndex:-1,childOrderInParent:0}],P=new Map;for(;E.length>0;){let m=Date.now(),g=E.splice(0,De),T=await Promise.all(g.map(S=>b(S.item)));d.batchCount++,d.batchTime+=Date.now()-m;for(let S=0;S<g.length;S++){let w=T[S],D=g[S];if(!w)continue;let x=C.length;if(D.parentIndex>=0){let F=P.get(D.parentIndex)||[];F.push(x),P.set(D.parentIndex,F)}C.push({node:w,parentIndex:D.parentIndex,childIndices:[]});for(let F=0;F<w.children.length;F++)E.push({item:w.children[F],parentIndex:x,childOrderInParent:F})}}for(let[m,g]of P)m>=0&&m<C.length&&(C[m].childIndices=g);if(C.length>0){let m=y(0);h.paths.push(...m.paths),h.printfData.push(...m.printfData)}}else{let m=function(g){let T=C.get(g);T&&(h.paths.push(T.path),T.printfData&&h.printfData.push(T.printfData));let S=y.get(g);if(S)for(let w of S)m(w)};var $=m;let C=new Map,E=0,P=[{item:{path:f,depth:0,resultIndex:0},orderIndex:E++}],y=new Map;for(;P.length>0;){let g=Date.now(),T=P.splice(0,De),S=await Promise.all(T.map(async({item:w,orderIndex:D})=>{let x=await b(w);return x?{node:x,orderIndex:D}:null}));d.batchCount++,d.batchTime+=Date.now()-g;for(let w of S){if(!w)continue;let{node:D,orderIndex:x}=w,{print:F,printfData:j}=W(D);if(F&&C.set(x,{path:D.relativePath,printfData:j}),D.children.length>0){let se=[];for(let K of D.children){let O=E++;se.push(O),P.push({item:K,orderIndex:O})}y.set(x,se)}}}m(0)}return h}let ne=await Me();if(N.push(...ne.paths),le.push(...ne.printfData),t.trace){let h=Date.now()-I;ke(t.trace,d,h),t.trace({category:"find",name:"searchPath",durationMs:h,details:{path:p,resultsFound:ne.paths.length}})}}let A="";if(u.length>0)for(let p of u)switch(p.type){case"print":A+=N.length>0?`${N.join(`
|
|
6
|
+
`)}
|
|
7
|
+
`:"";break;case"print0":A+=N.length>0?`${N.join("\0")}\0`:"";break;case"delete":{let f=[...N].sort((d,I)=>I.length-d.length);for(let d of f){let I=t.fs.resolvePath(t.cwd,d);try{await t.fs.rm(I,{recursive:!1})}catch(b){let W=b instanceof Error?b.message:String(b);q+=`find: cannot delete '${d}': ${W}
|
|
8
|
+
`,G=1}}break}case"printf":for(let f of le)A+=ze(p.format,f);break;case"exec":if(!t.exec)return{stdout:re(),stderr:Z(`find: -exec not supported in this context
|
|
9
|
+
`),exitCode:1};if(p.batchMode){let f=[];for(let b of p.command)b==="{}"?f.push(...N):f.push(b);let d=f.map(b=>`"${b}"`).join(" "),I=await t.exec(d,{cwd:t.cwd});A+=await Y(I.stdout),q+=await Y(I.stderr),I.exitCode!==0&&(G=I.exitCode)}else for(let f of N){let I=p.command.map(W=>W==="{}"?f:W).map(W=>`"${W}"`).join(" "),b=await t.exec(I,{cwd:t.cwd});A+=await Y(b.stdout),q+=await Y(b.stderr),b.exitCode!==0&&(G=b.exitCode)}break}else X&&(A=N.length>0?`${N.join(`
|
|
10
|
+
`)}
|
|
11
|
+
`:"");return{stdout:Z(A),stderr:Z(q),exitCode:G}}};function ze(e,t){let n=de(e),r="",s=0;for(;s<n.length;)if(n[s]==="%"&&s+1<n.length){if(s++,n[s]==="%"){r+="%",s++;continue}let[c,i,a]=he(n,s);if(s+=a,s>=n.length){r+="%";break}let l=n[s],o;switch(l){case"f":o=t.name,s++;break;case"h":{let u=t.path.lastIndexOf("/");o=u>0?t.path.slice(0,u):".",s++;break}case"p":o=t.path,s++;break;case"P":{let u=t.startingPoint;t.path===u?o="":t.path.startsWith(`${u}/`)?o=t.path.slice(u.length+1):u==="."&&t.path.startsWith("./")?o=t.path.slice(2):o=t.path,s++;break}case"s":o=String(t.size),s++;break;case"d":o=String(t.depth),s++;break;case"m":o=(t.mode&511).toString(8),s++;break;case"M":o=Ae(t.mode,t.isDirectory),s++;break;case"t":{let u=new Date(t.mtime);o=Le(u),s++;break}case"T":{if(s+1<n.length){let u=n[s+1],B=new Date(t.mtime);o=He(B,u),s+=2}else o="%T",s++;break}default:r+=`%${c!==0||i!==-1?`${c}.${i}`:""}${l}`,s++;continue}r+=ue(o,c,i)}else r+=n[s],s++;return r}function Ae(e,t){let n=e&511,r=t?"d":"-";return r+=n&256?"r":"-",r+=n&128?"w":"-",r+=n&64?"x":"-",r+=n&32?"r":"-",r+=n&16?"w":"-",r+=n&8?"x":"-",r+=n&4?"r":"-",r+=n&2?"w":"-",r+=n&1?"x":"-",r}function Le(e){let t=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],n=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],r=t[e.getDay()],s=n[e.getMonth()],c=String(e.getDate()).padStart(2," "),i=String(e.getHours()).padStart(2,"0"),a=String(e.getMinutes()).padStart(2,"0"),l=String(e.getSeconds()).padStart(2,"0"),o=e.getFullYear();return`${r} ${s} ${c} ${i}:${a}:${l} ${o}`}function He(e,t){switch(t){case"@":return String(e.getTime()/1e3);case"Y":return String(e.getFullYear());case"m":return String(e.getMonth()+1).padStart(2,"0");case"d":return String(e.getDate()).padStart(2,"0");case"H":return String(e.getHours()).padStart(2,"0");case"M":return String(e.getMinutes()).padStart(2,"0");case"S":return String(e.getSeconds()).padStart(2,"0");case"T":return`${String(e.getHours()).padStart(2,"0")}:${String(e.getMinutes()).padStart(2,"0")}:${String(e.getSeconds()).padStart(2,"0")}`;case"F":return`${e.getFullYear()}-${String(e.getMonth()+1).padStart(2,"0")}-${String(e.getDate()).padStart(2,"0")}`;default:return`%T${t}`}}var Ke={name:"find",flags:[{flag:"-name",type:"value",valueHint:"pattern"},{flag:"-iname",type:"value",valueHint:"pattern"},{flag:"-type",type:"value",valueHint:"string"},{flag:"-maxdepth",type:"value",valueHint:"number"},{flag:"-mindepth",type:"value",valueHint:"number"},{flag:"-empty",type:"boolean"},{flag:"-print",type:"boolean"},{flag:"-print0",type:"boolean"}],needsFiles:!0};export{Qe as a,Ke as b};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import{a as u}from"./chunk-4VDEBYW7.js";import{a as f}from"./chunk-7VWUKGDV.js";import{b as m,e as s}from"./chunk-RAUBS6MJ.js";import{k as l}from"./chunk-463VWH7H.js";var v={recursive:{short:"p",long:"parents",type:"boolean"},verbose:{short:"v",long:"verbose",type:"boolean"}},E={name:"mkdir",async execute(g,n){let p=l(g),e=f("mkdir",p,v);if(!e.ok)return e.error;let y=e.result.flags.recursive,k=e.result.flags.verbose,a=e.result.positional;if(a.length===0)return{stdout:m(),stderr:s(`mkdir: missing operand
|
|
3
|
+
`),exitCode:1};let d="",o="",c=0;for(let r of a)try{let i=n.fs.resolvePath(n.cwd,r);await n.fs.mkdir(i,{recursive:y}),k&&(d+=`mkdir: created directory '${r}'
|
|
4
|
+
`)}catch(i){let t=u(i);t.includes("ENOENT")||t.includes("no such file")?o+=`mkdir: cannot create directory '${r}': No such file or directory
|
|
5
|
+
`:t.includes("EEXIST")||t.includes("already exists")?o+=`mkdir: cannot create directory '${r}': File exists
|
|
6
|
+
`:o+=`mkdir: cannot create directory '${r}': ${t}
|
|
7
|
+
`,c=1}return{stdout:s(d),stderr:s(o),exitCode:c}}},A={name:"mkdir",flags:[{flag:"-p",type:"boolean"},{flag:"-v",type:"boolean"}],needsArgs:!0};export{E as a,A as b};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import{g as i,h as d,j as h}from"./chunk-463VWH7H.js";var f=64*1024;function s(){return new ReadableStream({start(t){t.close()}})}function g(t){return t.length===0?s():new ReadableStream({start(r){if(t.length<=f)r.enqueue(t);else for(let n=0;n<t.length;n+=f)r.enqueue(t.subarray(n,Math.min(n+f,t.length)));r.close()}})}function m(t){return t.length===0?s():new ReadableStream({start(r){for(let n of t)n.length>0&&r.enqueue(n);r.close()}})}function p(t){return t.length===0?s():g(d(t))}async function x(t,r){let n=[],e=0,o=t.getReader();try{for(;;){let{done:c,value:u}=await o.read();if(c)break;if(!(!u||u.length===0)){if(e+=u.length,r!==void 0&&e>r)throw new Error(`stream exceeded maxBytes=${r} (collected ${e})`);n.push(u)}}}finally{o.releaseLock()}if(n.length===0)return i;if(n.length===1)return n[0];let a=new Uint8Array(e),l=0;for(let c of n)a.set(c,l),l+=c.length;return a}async function k(t){let r=new TextDecoder,n=t.getReader(),e="";try{for(;;){let{done:o,value:a}=await n.read();if(o)break;a&&a.length>0&&(e+=r.decode(a,{stream:!0}))}e+=r.decode()}finally{n.releaseLock()}return e}function R(t,r){let n="a",e=null;return new ReadableStream({async pull(o){for(;;){if(n==="done"){o.close();return}e===null&&(e=(n==="a"?t:r).getReader());let{done:a,value:l}=await e.read();if(a){e.releaseLock(),e=null,n=n==="a"?"b":"done";continue}if(l&&l.length>0){o.enqueue(l);return}}},async cancel(){if(e){try{await e.cancel()}catch{}e=null}}})}function S(t){return t.tee()}async function*y(t){let r=t.getReader();try{for(;;){let{done:n,value:e}=await r.read();if(n)return;e&&e.length>0&&(yield e)}}finally{r.releaseLock()}}async function*b(t){let r=i;for await(let n of y(t)){let e=n;r.length>0&&(e=h(r,n),r=i);let o=0;for(let a=0;a<e.length;a++)e[a]===10&&(yield e.subarray(o,a),o=a+1);o<e.length&&(r=e.subarray(o))}r.length>0&&(yield r)}export{f as a,s as b,g as c,m as d,p as e,x as f,k as g,R as h,S as i,y as j,b as k};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import{c as g}from"./chunk-CAXM2HMK.js";import{a as p,b as f}from"./chunk-DFAHK2EQ.js";import{b as o,e as u,g as m}from"./chunk-RAUBS6MJ.js";import{k as d}from"./chunk-463VWH7H.js";var y={name:"bash",summary:"execute shell commands or scripts",usage:"bash [OPTIONS] [SCRIPT_FILE] [ARGUMENTS...]",options:["-c COMMAND execute COMMAND string"," --help display this help and exit"],notes:["Without -c, reads and executes commands from SCRIPT_FILE.","Arguments are passed as $1, $2, etc. to the script.",'$0 is set to the script name (or "bash" with -c).']},P={name:"bash",async execute(a,e){let t=d(a);if(f(t))return p(y);if(t[0]==="-c"&&t.length>=2){let s=t[1],n=t[2]||"bash",l=t.slice(3);return i(s,n,l,e)}if(t.length===0){let s=await m(e.stdin);return s.trim()?i(s,"bash",[],e,o()):{stdout:o(),stderr:o(),exitCode:0}}let r=t[0],c=t.slice(1);try{let s=e.fs.resolvePath(e.cwd,r),n=await e.fs.readFileText(s);return i(n,r,c,e)}catch{return{stdout:o(),stderr:u(`bash: ${r}: No such file or directory
|
|
3
|
+
`),exitCode:127}}}},v={name:"sh",async execute(a,e){let t=d(a);if(f(t))return p({...y,name:"sh",summary:"execute shell commands or scripts (POSIX shell)"});if(t[0]==="-c"&&t.length>=2){let s=t[1],n=t[2]||"sh",l=t.slice(3);return i(s,n,l,e)}if(t.length===0){let s=await m(e.stdin);return s.trim()?i(s,"sh",[],e,o()):{stdout:o(),stderr:o(),exitCode:0}}let r=t[0],c=t.slice(1);try{let s=e.fs.resolvePath(e.cwd,r),n=await e.fs.readFileText(s);return i(n,r,c,e)}catch{return{stdout:o(),stderr:u(`sh: ${r}: No such file or directory
|
|
4
|
+
`),exitCode:127}}}};async function i(a,e,t,r,c=r.stdin){if(!r.exec)return{stdout:o(),stderr:u(`bash: internal error: exec function not available
|
|
5
|
+
`),exitCode:1};let s=g(r.exportedEnv||{},{0:e,"#":String(t.length),"@":t.join(" "),"*":t.join(" ")});t.forEach((h,x)=>{s[String(x+1)]=h});let n=a;if(n.startsWith("#!")){let h=n.indexOf(`
|
|
6
|
+
`);h!==-1&&(n=n.slice(h+1))}return await r.exec(n,{env:s,cwd:r.cwd,stdin:c})}var N={name:"bash",flags:[{flag:"-c",type:"value",valueHint:"string"}],stdinType:"text"},S={name:"sh",flags:[{flag:"-c",type:"value",valueHint:"string"}],stdinType:"text"};export{P as a,v as b,N as c,S as d};
|