just-bash 3.0.1 → 3.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +63 -0
- package/README.md +11 -0
- package/dist/AGENTS.md +2 -0
- package/dist/bin/chunks/{awk2-RLMNTGI7.js → awk2-UFCNQFCV.js} +1 -1
- package/dist/bin/{shell/chunks/base64-RZRLGMB3.js → chunks/base64-EGKVQIBC.js} +1 -1
- package/dist/bin/{shell/chunks/bash-CLP24TE2.js → chunks/bash-BEG4JB7K.js} +1 -1
- package/dist/bin/{shell/chunks/cat-LQH5FSAR.js → chunks/cat-NBL6MU5H.js} +1 -1
- package/dist/bin/chunks/{chunk-KFMPGSUT.js → chunk-2ZAK22BG.js} +1 -1
- package/dist/bin/chunks/chunk-4BNS566Q.js +4 -0
- package/dist/bin/chunks/chunk-4J4UC7OD.js +17 -0
- package/dist/bin/{shell/chunks/chunk-IEXQTXU5.js → chunks/chunk-52FZYTIX.js} +4 -4
- package/dist/bin/{shell/chunks/chunk-EDTBGO7F.js → chunks/chunk-5KX5YUWT.js} +1 -1
- package/dist/bin/chunks/{chunk-XFFUAO3F.js → chunk-6FYCU7QB.js} +1 -1
- package/dist/bin/chunks/{chunk-PAYQNSZN.js → chunk-6JKLDBRW.js} +1 -1
- package/dist/bin/chunks/{chunk-22HCD466.js → chunk-7HK63L6Y.js} +1 -1
- package/dist/bin/chunks/chunk-7NDRU2ZN.js +5 -0
- package/dist/bin/{shell/chunks/chunk-IZGLHVBB.js → chunks/chunk-AFAD5U2A.js} +1 -1
- package/dist/bin/chunks/{chunk-LNNWMRCB.js → chunk-AZH64XMJ.js} +1 -1
- package/dist/bin/chunks/{chunk-6FSBHK6H.js → chunk-C6JOQKE2.js} +1 -1
- package/dist/bin/{shell/chunks/chunk-77MLOOQS.js → chunks/chunk-CX5CEEGI.js} +1 -1
- package/dist/bin/chunks/{chunk-NXVG64T3.js → chunk-D7YFPDMV.js} +1 -1
- package/dist/bin/chunks/chunk-DHIKZU63.js +3 -0
- package/dist/bin/chunks/{chunk-UR4CEP4Y.js → chunk-DWECIBLJ.js} +1 -1
- package/dist/bin/chunks/{chunk-C7ISPH7Y.js → chunk-FEENTUVZ.js} +1 -1
- package/dist/bin/chunks/{chunk-FVRXEJYQ.js → chunk-FJABJBIW.js} +2 -2
- package/dist/bin/chunks/{chunk-YOKQNNQO.js → chunk-FYCT4DWY.js} +1 -1
- package/dist/bin/chunks/{chunk-J7TUF2VI.js → chunk-G7ZWT7BT.js} +1 -1
- package/dist/bin/chunks/{chunk-XJ37N3S5.js → chunk-GTO74SFS.js} +1 -1
- package/dist/bin/{shell/chunks/chunk-L24QXM5S.js → chunks/chunk-GXX3QUMM.js} +1 -1
- package/dist/bin/chunks/chunk-HMCRB24D.js +15 -0
- package/dist/bin/chunks/{chunk-FKVQZWJQ.js → chunk-HWNCK5BB.js} +1 -1
- package/dist/bin/chunks/{chunk-V2RP73X4.js → chunk-IX7LKVVH.js} +1 -1
- package/dist/bin/{shell/chunks/chunk-JZW7NFK2.js → chunks/chunk-J7XTZ47D.js} +1 -1
- package/dist/bin/chunks/{chunk-3BYTCO2H.js → chunk-JDFKEXLG.js} +1 -1
- package/dist/bin/{shell/chunks/chunk-HN2DCT7T.js → chunks/chunk-JJC4ENJL.js} +1 -1
- package/dist/bin/{shell/chunks/chunk-F3WNDKOC.js → chunks/chunk-JSZBZ2XU.js} +1 -1
- package/dist/bin/{shell/chunks/chunk-UO5LOD7U.js → chunks/chunk-KMZUSEWI.js} +1 -1
- package/dist/bin/{shell/chunks/chunk-OPMLWMNH.js → chunks/chunk-KWCO3YXP.js} +1 -1
- package/dist/bin/{shell/chunks/chunk-LSQTB2QK.js → chunks/chunk-LMA4D2KK.js} +1 -1
- package/dist/bin/{shell/chunks/chunk-HL4ZS7TX.js → chunks/chunk-LX2H4DPL.js} +3 -3
- package/dist/bin/chunks/{chunk-X4MX6EHF.js → chunk-MP77TJMM.js} +1 -1
- package/dist/bin/{shell/chunks/chunk-F3GKANW3.js → chunks/chunk-MTK7VLZG.js} +1 -1
- package/dist/bin/chunks/chunk-N3FQJLPZ.js +17 -0
- package/dist/bin/{shell/chunks/chunk-2SVX7I5P.js → chunks/chunk-NMMVECGD.js} +1 -1
- package/dist/bin/chunks/{chunk-LAHBP3FW.js → chunk-NXYVRP6D.js} +1 -1
- package/dist/bin/chunks/{chunk-7UU7KPEM.js → chunk-OVVMB2JI.js} +1 -1
- package/dist/bin/chunks/{chunk-YY5PJR7O.js → chunk-OXZSG3ZZ.js} +1 -1
- package/dist/bin/chunks/chunk-PDS5TEMS.js +80 -0
- package/dist/bin/{shell/chunks/chunk-CAZ75E7E.js → chunks/chunk-PKE7GKU5.js} +1 -1
- package/dist/bin/{shell/chunks/chunk-7AYT3UKI.js → chunks/chunk-PSJORJRS.js} +1 -1
- package/dist/bin/chunks/{chunk-7NC4CPHS.js → chunk-R36DS2UF.js} +1 -1
- package/dist/bin/chunks/{chunk-2NRAWO6E.js → chunk-RKBWTGBZ.js} +1 -1
- package/dist/bin/{shell/chunks/chunk-LC6D27QJ.js → chunks/chunk-RVGYO2OU.js} +1 -1
- package/dist/bin/chunks/{chunk-SMSELHIY.js → chunk-SF2OLINE.js} +1 -1
- package/dist/bin/{shell/chunks/chunk-M65CQLJE.js → chunks/chunk-TIRU5FOD.js} +1 -1
- package/dist/bin/chunks/{chunk-BE4PARL3.js → chunk-TKYWUEON.js} +1 -1
- package/dist/bin/chunks/chunk-TYBXHT6W.js +10 -0
- package/dist/bin/chunks/chunk-UI7CV277.js +20 -0
- package/dist/bin/chunks/{chunk-KRRM5UCC.js → chunk-UNWZQG7U.js} +1 -1
- package/dist/bin/{shell/chunks/chunk-4KSZJAQK.js → chunks/chunk-W5OBQVJ2.js} +1 -1
- package/dist/bin/chunks/{chunk-JNUX75OX.js → chunk-WHUKZ3K3.js} +1 -1
- package/dist/bin/chunks/chunk-Y2IUEWQD.js +11 -0
- package/dist/bin/chunks/chunk-Y5OWCEDV.js +64 -0
- package/dist/bin/chunks/{chunk-H7JTIXAO.js → chunk-ZZP3RSWL.js} +1 -1
- package/dist/bin/chunks/{column-AQB3A3PJ.js → column-QLGOK3XM.js} +1 -1
- package/dist/bin/{shell/chunks/comm-Q4VDF6ZO.js → chunks/comm-PLYUTVP3.js} +1 -1
- package/dist/bin/chunks/curl-DCSPNPEW.js +27 -0
- package/dist/bin/chunks/{cut-ZI2HIAW7.js → cut-JNQTCQY7.js} +1 -1
- package/dist/bin/chunks/date-OFYBOAUE.js +3 -0
- package/dist/bin/{shell/chunks/diff-YDJ42RKS.js → chunks/diff-LZ4WRLIF.js} +1 -1
- package/dist/bin/chunks/{env-NY32PQJM.js → env-FNVYNLGB.js} +1 -1
- package/dist/bin/{shell/chunks/expand-YYSO35NS.js → chunks/expand-CB7FG7LQ.js} +1 -1
- package/dist/bin/chunks/{expansion-PPP6PD75.js → expansion-PCODPDNZ.js} +1 -1
- package/dist/bin/{shell/chunks/expr-7PLWSWZI.js → chunks/expr-6A2XZORA.js} +1 -1
- package/dist/bin/chunks/{find-P4DOE7CE.js → find-5OZWMYCV.js} +1 -1
- package/dist/bin/chunks/flag-coverage-H6NG6ZQL.js +3 -0
- package/dist/bin/{shell/chunks/fold-5MF7QZWQ.js → chunks/fold-7YEITA5L.js} +1 -1
- package/dist/bin/chunks/{grep-VAYCFO4O.js → grep-KKBXRB73.js} +1 -1
- package/dist/bin/chunks/{gzip-UGBQQKIH.js → gzip-ZJP5VIAQ.js} +1 -1
- package/dist/bin/chunks/{head-QNC2ZYDO.js → head-B6GFQHKF.js} +1 -1
- package/dist/bin/{shell/chunks/html-to-markdown-QEFY7XQR.js → chunks/html-to-markdown-3HJ7L7NL.js} +1 -1
- package/dist/bin/chunks/{join-EJ73DYTK.js → join-WRM6S6CO.js} +1 -1
- package/dist/bin/chunks/{jq-GGTKKMEN.js → jq-33GJJXTL.js} +1 -1
- package/dist/bin/chunks/{js-exec-BC6NI55L.js → js-exec-F7JAZ4ZQ.js} +1 -1
- package/dist/bin/chunks/js-exec-worker.js +214 -17
- package/dist/bin/chunks/{md5sum-MCVDIB35.js → md5sum-ZNYCDRQL.js} +1 -1
- package/dist/bin/{shell/chunks/nl-KUPLVCTS.js → chunks/nl-6TVYE4ZB.js} +1 -1
- package/dist/bin/{shell/chunks/od-YQ5ZUI2H.js → chunks/od-Y3E3QXOL.js} +1 -1
- package/dist/bin/{shell/chunks/paste-A5KKPWXX.js → chunks/paste-LYNFXXCM.js} +1 -1
- package/dist/bin/chunks/printf-MR3FXCDE.js +3 -0
- package/dist/bin/{shell/chunks/python3-BQWDPUBM.js → chunks/python3-R5OFWJIH.js} +1 -1
- package/dist/bin/{shell/chunks/rev-PYHOZ4D4.js → chunks/rev-AJECDD4L.js} +1 -1
- package/dist/bin/chunks/{rg-BGFMSIVK.js → rg-2YWJS6TE.js} +1 -1
- package/dist/bin/chunks/{sed-FWA634SN.js → sed-IGRH7EGG.js} +1 -1
- package/dist/bin/chunks/{sha1sum-4KF52U3Y.js → sha1sum-5QZSNFY3.js} +1 -1
- package/dist/bin/chunks/{sha256sum-6YEPULPX.js → sha256sum-DI7JAVAU.js} +1 -1
- package/dist/bin/{shell/chunks/sleep-QHAPNY3Q.js → chunks/sleep-RPGCUUGX.js} +1 -1
- package/dist/bin/{shell/chunks/sort-4C6WOKNK.js → chunks/sort-HQPAFL76.js} +1 -1
- package/dist/bin/chunks/{split-TV7NL7LA.js → split-F6FSB5KI.js} +1 -1
- package/dist/bin/chunks/{sqlite3-W777NCI4.js → sqlite3-7TRACAE7.js} +1 -1
- package/dist/bin/chunks/sqlite3-worker.js +3 -2
- package/dist/bin/chunks/{strings-MDD72LR6.js → strings-6PE3YMPO.js} +1 -1
- package/dist/bin/chunks/{tac-C2N4NQ6S.js → tac-NERJXVOM.js} +1 -1
- package/dist/bin/chunks/{tail-BCB5W6JC.js → tail-24F643A4.js} +1 -1
- package/dist/bin/chunks/tar-5HK3VMV2.js +3 -0
- package/dist/bin/chunks/{tee-UQHPO4OW.js → tee-5B7P2QRJ.js} +1 -1
- package/dist/bin/chunks/{time-ZPY52VT2.js → time-FN6VJGRS.js} +1 -1
- package/dist/bin/chunks/{timeout-5AX3ZS3X.js → timeout-ZARIAF3K.js} +1 -1
- package/dist/bin/{shell/chunks/tr-G7K6M6HP.js → chunks/tr-QQZYZ3CH.js} +1 -1
- package/dist/bin/chunks/{unexpand-QIR4EDPG.js → unexpand-3JWOSSBQ.js} +1 -1
- package/dist/bin/chunks/{uniq-I7PVFJR4.js → uniq-Q5UH5NL3.js} +1 -1
- package/dist/bin/{shell/chunks/wc-6NGWULAP.js → chunks/wc-4HXNTHY3.js} +1 -1
- package/dist/bin/chunks/worker.js +3 -2
- package/dist/bin/chunks/{xan-KX4VPXUN.js → xan-TSDTZVY3.js} +1 -1
- package/dist/bin/chunks/{xan-view-JXOZLJ7S.js → xan-view-XBMA362V.js} +1 -1
- package/dist/bin/chunks/{xargs-UWHPYLY7.js → xargs-VTFN762K.js} +1 -1
- package/dist/bin/chunks/{yq-GCDCJBKB.js → yq-KU5YTNAK.js} +1 -1
- package/dist/bin/just-bash.js +171 -170
- package/dist/bin/shell/chunks/{awk2-RLMNTGI7.js → awk2-UFCNQFCV.js} +1 -1
- package/dist/bin/{chunks/base64-RZRLGMB3.js → shell/chunks/base64-EGKVQIBC.js} +1 -1
- package/dist/bin/{chunks/bash-CLP24TE2.js → shell/chunks/bash-BEG4JB7K.js} +1 -1
- package/dist/bin/{chunks/cat-LQH5FSAR.js → shell/chunks/cat-NBL6MU5H.js} +1 -1
- package/dist/bin/shell/chunks/{chunk-KFMPGSUT.js → chunk-2ZAK22BG.js} +1 -1
- package/dist/bin/shell/chunks/chunk-4BNS566Q.js +4 -0
- package/dist/bin/shell/chunks/chunk-4J4UC7OD.js +17 -0
- package/dist/bin/{chunks/chunk-IEXQTXU5.js → shell/chunks/chunk-52FZYTIX.js} +4 -4
- package/dist/bin/{chunks/chunk-EDTBGO7F.js → shell/chunks/chunk-5KX5YUWT.js} +1 -1
- package/dist/bin/shell/chunks/{chunk-XFFUAO3F.js → chunk-6FYCU7QB.js} +1 -1
- package/dist/bin/shell/chunks/{chunk-PAYQNSZN.js → chunk-6JKLDBRW.js} +1 -1
- package/dist/bin/shell/chunks/{chunk-22HCD466.js → chunk-7HK63L6Y.js} +1 -1
- package/dist/bin/shell/chunks/chunk-7NDRU2ZN.js +5 -0
- package/dist/bin/{chunks/chunk-IZGLHVBB.js → shell/chunks/chunk-AFAD5U2A.js} +1 -1
- package/dist/bin/shell/chunks/{chunk-LNNWMRCB.js → chunk-AZH64XMJ.js} +1 -1
- package/dist/bin/shell/chunks/{chunk-6FSBHK6H.js → chunk-C6JOQKE2.js} +1 -1
- package/dist/bin/{chunks/chunk-77MLOOQS.js → shell/chunks/chunk-CX5CEEGI.js} +1 -1
- package/dist/bin/shell/chunks/{chunk-NXVG64T3.js → chunk-D7YFPDMV.js} +1 -1
- package/dist/bin/shell/chunks/chunk-DHIKZU63.js +3 -0
- package/dist/bin/shell/chunks/{chunk-UR4CEP4Y.js → chunk-DWECIBLJ.js} +1 -1
- package/dist/bin/shell/chunks/{chunk-C7ISPH7Y.js → chunk-FEENTUVZ.js} +1 -1
- package/dist/bin/shell/chunks/{chunk-FVRXEJYQ.js → chunk-FJABJBIW.js} +2 -2
- package/dist/bin/shell/chunks/{chunk-YOKQNNQO.js → chunk-FYCT4DWY.js} +1 -1
- package/dist/bin/shell/chunks/{chunk-J7TUF2VI.js → chunk-G7ZWT7BT.js} +1 -1
- package/dist/bin/shell/chunks/{chunk-XJ37N3S5.js → chunk-GTO74SFS.js} +1 -1
- package/dist/bin/{chunks/chunk-L24QXM5S.js → shell/chunks/chunk-GXX3QUMM.js} +1 -1
- package/dist/bin/shell/chunks/chunk-HMCRB24D.js +15 -0
- package/dist/bin/shell/chunks/{chunk-FKVQZWJQ.js → chunk-HWNCK5BB.js} +1 -1
- package/dist/bin/shell/chunks/{chunk-V2RP73X4.js → chunk-IX7LKVVH.js} +1 -1
- package/dist/bin/{chunks/chunk-JZW7NFK2.js → shell/chunks/chunk-J7XTZ47D.js} +1 -1
- package/dist/bin/shell/chunks/{chunk-3BYTCO2H.js → chunk-JDFKEXLG.js} +1 -1
- package/dist/bin/{chunks/chunk-HN2DCT7T.js → shell/chunks/chunk-JJC4ENJL.js} +1 -1
- package/dist/bin/{chunks/chunk-F3WNDKOC.js → shell/chunks/chunk-JSZBZ2XU.js} +1 -1
- package/dist/bin/{chunks/chunk-UO5LOD7U.js → shell/chunks/chunk-KMZUSEWI.js} +1 -1
- package/dist/bin/{chunks/chunk-OPMLWMNH.js → shell/chunks/chunk-KWCO3YXP.js} +1 -1
- package/dist/bin/{chunks/chunk-LSQTB2QK.js → shell/chunks/chunk-LMA4D2KK.js} +1 -1
- package/dist/bin/{chunks/chunk-HL4ZS7TX.js → shell/chunks/chunk-LX2H4DPL.js} +3 -3
- package/dist/bin/shell/chunks/{chunk-X4MX6EHF.js → chunk-MP77TJMM.js} +1 -1
- package/dist/bin/{chunks/chunk-F3GKANW3.js → shell/chunks/chunk-MTK7VLZG.js} +1 -1
- package/dist/bin/shell/chunks/chunk-N3FQJLPZ.js +17 -0
- package/dist/bin/{chunks/chunk-2SVX7I5P.js → shell/chunks/chunk-NMMVECGD.js} +1 -1
- package/dist/bin/shell/chunks/{chunk-LAHBP3FW.js → chunk-NXYVRP6D.js} +1 -1
- package/dist/bin/shell/chunks/{chunk-7UU7KPEM.js → chunk-OVVMB2JI.js} +1 -1
- package/dist/bin/shell/chunks/{chunk-YY5PJR7O.js → chunk-OXZSG3ZZ.js} +1 -1
- package/dist/bin/shell/chunks/chunk-PDS5TEMS.js +80 -0
- package/dist/bin/{chunks/chunk-CAZ75E7E.js → shell/chunks/chunk-PKE7GKU5.js} +1 -1
- package/dist/bin/{chunks/chunk-7AYT3UKI.js → shell/chunks/chunk-PSJORJRS.js} +1 -1
- package/dist/bin/shell/chunks/{chunk-7NC4CPHS.js → chunk-R36DS2UF.js} +1 -1
- package/dist/bin/shell/chunks/{chunk-2NRAWO6E.js → chunk-RKBWTGBZ.js} +1 -1
- package/dist/bin/{chunks/chunk-LC6D27QJ.js → shell/chunks/chunk-RVGYO2OU.js} +1 -1
- package/dist/bin/shell/chunks/{chunk-SMSELHIY.js → chunk-SF2OLINE.js} +1 -1
- package/dist/bin/{chunks/chunk-M65CQLJE.js → shell/chunks/chunk-TIRU5FOD.js} +1 -1
- package/dist/bin/shell/chunks/{chunk-BE4PARL3.js → chunk-TKYWUEON.js} +1 -1
- package/dist/bin/shell/chunks/chunk-TYBXHT6W.js +10 -0
- package/dist/bin/shell/chunks/chunk-UI7CV277.js +20 -0
- package/dist/bin/shell/chunks/{chunk-KRRM5UCC.js → chunk-UNWZQG7U.js} +1 -1
- package/dist/bin/{chunks/chunk-4KSZJAQK.js → shell/chunks/chunk-W5OBQVJ2.js} +1 -1
- package/dist/bin/shell/chunks/{chunk-JNUX75OX.js → chunk-WHUKZ3K3.js} +1 -1
- package/dist/bin/shell/chunks/chunk-Y2IUEWQD.js +11 -0
- package/dist/bin/shell/chunks/chunk-Y5OWCEDV.js +64 -0
- package/dist/bin/shell/chunks/{chunk-H7JTIXAO.js → chunk-ZZP3RSWL.js} +1 -1
- package/dist/bin/shell/chunks/{column-AQB3A3PJ.js → column-QLGOK3XM.js} +1 -1
- package/dist/bin/{chunks/comm-Q4VDF6ZO.js → shell/chunks/comm-PLYUTVP3.js} +1 -1
- package/dist/bin/shell/chunks/curl-DCSPNPEW.js +27 -0
- package/dist/bin/shell/chunks/{cut-ZI2HIAW7.js → cut-JNQTCQY7.js} +1 -1
- package/dist/bin/shell/chunks/date-OFYBOAUE.js +3 -0
- package/dist/bin/{chunks/diff-YDJ42RKS.js → shell/chunks/diff-LZ4WRLIF.js} +1 -1
- package/dist/bin/shell/chunks/{env-NY32PQJM.js → env-FNVYNLGB.js} +1 -1
- package/dist/bin/{chunks/expand-YYSO35NS.js → shell/chunks/expand-CB7FG7LQ.js} +1 -1
- package/dist/bin/shell/chunks/{expansion-PPP6PD75.js → expansion-PCODPDNZ.js} +1 -1
- package/dist/bin/{chunks/expr-7PLWSWZI.js → shell/chunks/expr-6A2XZORA.js} +1 -1
- package/dist/bin/shell/chunks/{find-P4DOE7CE.js → find-5OZWMYCV.js} +1 -1
- package/dist/bin/shell/chunks/flag-coverage-H6NG6ZQL.js +3 -0
- package/dist/bin/{chunks/fold-5MF7QZWQ.js → shell/chunks/fold-7YEITA5L.js} +1 -1
- package/dist/bin/shell/chunks/{grep-VAYCFO4O.js → grep-KKBXRB73.js} +1 -1
- package/dist/bin/shell/chunks/{gzip-UGBQQKIH.js → gzip-ZJP5VIAQ.js} +1 -1
- package/dist/bin/shell/chunks/{head-QNC2ZYDO.js → head-B6GFQHKF.js} +1 -1
- package/dist/bin/{chunks/html-to-markdown-QEFY7XQR.js → shell/chunks/html-to-markdown-3HJ7L7NL.js} +1 -1
- package/dist/bin/shell/chunks/{join-EJ73DYTK.js → join-WRM6S6CO.js} +1 -1
- package/dist/bin/shell/chunks/{jq-GGTKKMEN.js → jq-33GJJXTL.js} +1 -1
- package/dist/bin/shell/chunks/{js-exec-BC6NI55L.js → js-exec-F7JAZ4ZQ.js} +1 -1
- package/dist/bin/shell/chunks/{md5sum-MCVDIB35.js → md5sum-ZNYCDRQL.js} +1 -1
- package/dist/bin/{chunks/nl-KUPLVCTS.js → shell/chunks/nl-6TVYE4ZB.js} +1 -1
- package/dist/bin/{chunks/od-YQ5ZUI2H.js → shell/chunks/od-Y3E3QXOL.js} +1 -1
- package/dist/bin/{chunks/paste-A5KKPWXX.js → shell/chunks/paste-LYNFXXCM.js} +1 -1
- package/dist/bin/shell/chunks/printf-MR3FXCDE.js +3 -0
- package/dist/bin/{chunks/python3-BQWDPUBM.js → shell/chunks/python3-R5OFWJIH.js} +1 -1
- package/dist/bin/{chunks/rev-PYHOZ4D4.js → shell/chunks/rev-AJECDD4L.js} +1 -1
- package/dist/bin/shell/chunks/{rg-BGFMSIVK.js → rg-2YWJS6TE.js} +1 -1
- package/dist/bin/shell/chunks/{sed-FWA634SN.js → sed-IGRH7EGG.js} +1 -1
- package/dist/bin/shell/chunks/{sha1sum-4KF52U3Y.js → sha1sum-5QZSNFY3.js} +1 -1
- package/dist/bin/shell/chunks/{sha256sum-6YEPULPX.js → sha256sum-DI7JAVAU.js} +1 -1
- package/dist/bin/{chunks/sleep-QHAPNY3Q.js → shell/chunks/sleep-RPGCUUGX.js} +1 -1
- package/dist/bin/{chunks/sort-4C6WOKNK.js → shell/chunks/sort-HQPAFL76.js} +1 -1
- package/dist/bin/shell/chunks/{split-TV7NL7LA.js → split-F6FSB5KI.js} +1 -1
- package/dist/bin/shell/chunks/{sqlite3-W777NCI4.js → sqlite3-7TRACAE7.js} +1 -1
- package/dist/bin/shell/chunks/{strings-MDD72LR6.js → strings-6PE3YMPO.js} +1 -1
- package/dist/bin/shell/chunks/{tac-C2N4NQ6S.js → tac-NERJXVOM.js} +1 -1
- package/dist/bin/shell/chunks/{tail-BCB5W6JC.js → tail-24F643A4.js} +1 -1
- package/dist/bin/shell/chunks/tar-5HK3VMV2.js +3 -0
- package/dist/bin/shell/chunks/{tee-UQHPO4OW.js → tee-5B7P2QRJ.js} +1 -1
- package/dist/bin/shell/chunks/{time-ZPY52VT2.js → time-FN6VJGRS.js} +1 -1
- package/dist/bin/shell/chunks/{timeout-5AX3ZS3X.js → timeout-ZARIAF3K.js} +1 -1
- package/dist/bin/{chunks/tr-G7K6M6HP.js → shell/chunks/tr-QQZYZ3CH.js} +1 -1
- package/dist/bin/shell/chunks/{unexpand-QIR4EDPG.js → unexpand-3JWOSSBQ.js} +1 -1
- package/dist/bin/shell/chunks/{uniq-I7PVFJR4.js → uniq-Q5UH5NL3.js} +1 -1
- package/dist/bin/{chunks/wc-6NGWULAP.js → shell/chunks/wc-4HXNTHY3.js} +1 -1
- package/dist/bin/shell/chunks/{xan-KX4VPXUN.js → xan-TSDTZVY3.js} +1 -1
- package/dist/bin/shell/chunks/{xan-view-JXOZLJ7S.js → xan-view-XBMA362V.js} +1 -1
- package/dist/bin/shell/chunks/{xargs-UWHPYLY7.js → xargs-VTFN762K.js} +1 -1
- package/dist/bin/shell/chunks/{yq-GCDCJBKB.js → yq-KU5YTNAK.js} +1 -1
- package/dist/bin/shell/shell.js +170 -169
- package/dist/bundle/browser.js +646 -637
- package/dist/bundle/chunks/{awk2-LA3USKJP.js → awk2-SREAOJRG.js} +1 -1
- package/dist/bundle/chunks/{base64-C2AIWVNC.js → base64-WIGL46P3.js} +1 -1
- package/dist/bundle/chunks/{bash-YZ33HQZQ.js → bash-F4KHPMTX.js} +1 -1
- package/dist/bundle/chunks/{cat-TSFMZVYS.js → cat-LPZ6XNHG.js} +1 -1
- package/dist/bundle/chunks/{chunk-ICIEVHY5.js → chunk-55LZFN6S.js} +1 -1
- package/dist/bundle/chunks/{chunk-6VAT5Z2D.js → chunk-5MV7Q5QB.js} +1 -1
- package/dist/bundle/chunks/{chunk-UP6MSJGD.js → chunk-6L65G6A7.js} +1 -1
- package/dist/bundle/chunks/{chunk-GGC5NEPZ.js → chunk-6NYPZ4NX.js} +1 -1
- package/dist/bundle/chunks/{chunk-4RUAZWKT.js → chunk-7CSMHFIJ.js} +4 -4
- package/dist/bundle/chunks/{chunk-ACSZB4FE.js → chunk-AAGO7IQ5.js} +1 -1
- package/dist/bundle/chunks/chunk-AFQAPVZ3.js +16 -0
- package/dist/bundle/chunks/{chunk-5H5SCKJM.js → chunk-AX2X3SZS.js} +1 -1
- package/dist/bundle/chunks/{chunk-EBAPSGAO.js → chunk-AXMYAPFA.js} +1 -1
- package/dist/bundle/chunks/chunk-BU36VZYL.js +4 -0
- package/dist/bundle/chunks/{chunk-CBJVD2XA.js → chunk-CJFAMHFC.js} +1 -1
- package/dist/bundle/chunks/{chunk-GJC3WVOW.js → chunk-CQV3EITV.js} +1 -1
- package/dist/bundle/chunks/{chunk-Q7H5W7YE.js → chunk-DJ7QC6LC.js} +2 -2
- package/dist/bundle/chunks/{chunk-S3LEJEPP.js → chunk-DVJY2RAX.js} +1 -1
- package/dist/bundle/chunks/{chunk-N6DXJ2JN.js → chunk-EUCNMMRD.js} +1 -1
- package/dist/bundle/chunks/{chunk-GTQIUQM6.js → chunk-FLMHFDSN.js} +1 -1
- package/dist/bundle/chunks/chunk-GE6OQDB2.js +10 -0
- package/dist/bundle/chunks/{chunk-FW54FHZR.js → chunk-GHB6M7KA.js} +1 -1
- package/dist/bundle/chunks/{chunk-LNBPBRV4.js → chunk-GRQJA2J7.js} +1 -1
- package/dist/bundle/chunks/{chunk-R74UQCKX.js → chunk-H2TS57O5.js} +1 -1
- package/dist/bundle/chunks/{chunk-7JHM3L42.js → chunk-H7WISVP3.js} +1 -1
- package/dist/bundle/chunks/chunk-HAIOEUEV.js +63 -0
- package/dist/bundle/chunks/{chunk-46RN27KI.js → chunk-IZ6KBTV7.js} +1 -1
- package/dist/bundle/chunks/{chunk-T4TFLF3R.js → chunk-JTMQLUCH.js} +1 -1
- package/dist/bundle/chunks/{chunk-2JIPICV3.js → chunk-K5JMLDHX.js} +1 -1
- package/dist/bundle/chunks/{chunk-L64BMZUV.js → chunk-KAPG5ONA.js} +1 -1
- package/dist/bundle/chunks/chunk-KSBHIW2H.js +19 -0
- package/dist/bundle/chunks/{chunk-XHLMAZX2.js → chunk-KTL5PAHY.js} +1 -1
- package/dist/bundle/chunks/{chunk-YCLFEX4T.js → chunk-KTPCYKBB.js} +1 -1
- package/dist/bundle/chunks/chunk-LI6PTSPD.js +9 -0
- package/dist/bundle/chunks/{chunk-LEKBROJD.js → chunk-LZUPLYFM.js} +1 -1
- package/dist/bundle/chunks/{chunk-4N6J7B5P.js → chunk-MFRETFZB.js} +1 -1
- package/dist/bundle/chunks/{chunk-OVGANXCG.js → chunk-MIZIUC5M.js} +1 -1
- package/dist/bundle/chunks/chunk-MJLETYZI.js +14 -0
- package/dist/bundle/chunks/{chunk-VLCHOJWK.js → chunk-MTHXXA6H.js} +1 -1
- package/dist/bundle/chunks/{chunk-6LASZU3O.js → chunk-NGPDJCUE.js} +1 -1
- package/dist/bundle/chunks/{chunk-ZZKH2ELC.js → chunk-OVH44QKR.js} +1 -1
- package/dist/bundle/chunks/chunk-PDUL32DM.js +16 -0
- package/dist/bundle/chunks/{chunk-KD3KENL6.js → chunk-PYDWFCTN.js} +1 -1
- package/dist/bundle/chunks/{chunk-AQ6FYS2X.js → chunk-QAJKDPNS.js} +1 -1
- package/dist/bundle/chunks/{chunk-XCQWV4AU.js → chunk-R4QNMLOB.js} +1 -1
- package/dist/bundle/chunks/chunk-RBQG6ZUG.js +3 -0
- package/dist/bundle/chunks/{chunk-U73A73IE.js → chunk-RCXNPPJY.js} +1 -1
- package/dist/bundle/chunks/{chunk-S443BAN4.js → chunk-S2BIZAWY.js} +1 -1
- package/dist/bundle/chunks/chunk-STFC2ZJT.js +79 -0
- package/dist/bundle/chunks/{chunk-XRFHFXFP.js → chunk-SY4HAUHP.js} +1 -1
- package/dist/bundle/chunks/{chunk-FJK43EBQ.js → chunk-TA74ENH7.js} +1 -1
- package/dist/bundle/chunks/{chunk-OC35HPHG.js → chunk-TC2WHAIS.js} +1 -1
- package/dist/bundle/chunks/{chunk-TN7HHBQW.js → chunk-VACKIICN.js} +3 -3
- package/dist/bundle/chunks/{chunk-GSPYNYZA.js → chunk-VBLMIJON.js} +1 -1
- package/dist/bundle/chunks/{chunk-VPADYNBD.js → chunk-WKPK7M56.js} +1 -1
- package/dist/bundle/chunks/chunk-XEKXHOPO.js +2 -0
- package/dist/bundle/chunks/{chunk-BVKWRAS6.js → chunk-XPK7ZFVA.js} +1 -1
- package/dist/bundle/chunks/{chunk-FAXLQUCQ.js → chunk-XZUZRAAC.js} +1 -1
- package/dist/bundle/chunks/{chunk-HJBTD7PY.js → chunk-YRNR2VHY.js} +1 -1
- package/dist/bundle/chunks/{chunk-KATRCGLX.js → chunk-YWOZZRSK.js} +1 -1
- package/dist/bundle/chunks/{chunk-FX7KQCEA.js → chunk-Z3KJQD7F.js} +1 -1
- package/dist/bundle/chunks/{column-XT6UFXNQ.js → column-PVOEF65J.js} +1 -1
- package/dist/bundle/chunks/{comm-VV2LDX2J.js → comm-5QMYEAJL.js} +1 -1
- package/dist/bundle/chunks/curl-PAWGO3EH.js +26 -0
- package/dist/bundle/chunks/{cut-OKARJCCV.js → cut-NDMV7SPO.js} +1 -1
- package/dist/bundle/chunks/date-XKUEQ4WF.js +2 -0
- package/dist/bundle/chunks/{diff-MWJFIG7X.js → diff-TT4M7WM3.js} +1 -1
- package/dist/bundle/chunks/{env-36M5BO7M.js → env-DLFRY633.js} +1 -1
- package/dist/bundle/chunks/{expand-JSPG6VOP.js → expand-T2TH4TBQ.js} +1 -1
- package/dist/bundle/chunks/{expansion-R25BK4W3.js → expansion-CDGKP4VC.js} +1 -1
- package/dist/bundle/chunks/{expr-5JAACS4X.js → expr-YLACLCSM.js} +1 -1
- package/dist/bundle/chunks/find-T5TGGXUU.js +2 -0
- package/dist/bundle/chunks/flag-coverage-TRYUZMPS.js +2 -0
- package/dist/bundle/chunks/{fold-4TQNYMSW.js → fold-XR2JMFCW.js} +1 -1
- package/dist/bundle/chunks/{grep-V3LQVMRQ.js → grep-VUESTEZ7.js} +1 -1
- package/dist/bundle/chunks/{gzip-O5ASJAFY.js → gzip-HF3D26QX.js} +1 -1
- package/dist/bundle/chunks/{head-442HYESI.js → head-AEMOMQSZ.js} +1 -1
- package/dist/bundle/chunks/{html-to-markdown-JW4MSQZO.js → html-to-markdown-LXXMVQ3V.js} +1 -1
- package/dist/bundle/chunks/{join-TBRGI3LQ.js → join-YIABB6WR.js} +1 -1
- package/dist/bundle/chunks/{jq-4XLYLOS5.js → jq-3FAAQVR6.js} +1 -1
- package/dist/bundle/chunks/{js-exec-N5KEZBH7.js → js-exec-SR6IMNWM.js} +1 -1
- package/dist/bundle/chunks/js-exec-worker.js +214 -17
- package/dist/bundle/chunks/{md5sum-SPU24VSG.js → md5sum-LU7RVIB7.js} +1 -1
- package/dist/bundle/chunks/{nl-WSDW7I4O.js → nl-Q2L5XQWZ.js} +1 -1
- package/dist/bundle/chunks/{od-WOKFDJTP.js → od-RDSM4TQJ.js} +1 -1
- package/dist/bundle/chunks/{paste-7JC6S4DX.js → paste-ABCY7E6C.js} +1 -1
- package/dist/bundle/chunks/printf-JPOOWRJC.js +2 -0
- package/dist/bundle/chunks/{python3-POMOR4OA.js → python3-JPCH6LLN.js} +1 -1
- package/dist/bundle/chunks/{rev-5EHFX4EJ.js → rev-GCV6X22K.js} +1 -1
- package/dist/bundle/chunks/rg-N5WLPMSA.js +2 -0
- package/dist/bundle/chunks/{sed-S5UIK574.js → sed-DX2SGXMF.js} +1 -1
- package/dist/bundle/chunks/{sha1sum-2PTOAFR6.js → sha1sum-O6DM3TPQ.js} +1 -1
- package/dist/bundle/chunks/{sha256sum-NS7D3IXX.js → sha256sum-WPVZLZPS.js} +1 -1
- package/dist/bundle/chunks/{sleep-X22JJINO.js → sleep-HZ4QEFOK.js} +1 -1
- package/dist/bundle/chunks/{sort-SW2YEO5B.js → sort-VW2NIZHW.js} +1 -1
- package/dist/bundle/chunks/{split-4KKZZXXE.js → split-NBMH43M2.js} +1 -1
- package/dist/bundle/chunks/{sqlite3-CGOEFJAO.js → sqlite3-UE3PJTDQ.js} +1 -1
- package/dist/bundle/chunks/sqlite3-worker.js +3 -2
- package/dist/bundle/chunks/{strings-6WDHLGMX.js → strings-MCXFXPDL.js} +1 -1
- package/dist/bundle/chunks/{tac-2STMMJYW.js → tac-BQ7EDZW2.js} +1 -1
- package/dist/bundle/chunks/{tail-R4PCA2C4.js → tail-GJMTLMNE.js} +1 -1
- package/dist/bundle/chunks/tar-WIZ3PDF4.js +2 -0
- package/dist/bundle/chunks/{tee-YUZ2FKCJ.js → tee-SGANDVNY.js} +1 -1
- package/dist/bundle/chunks/{time-D4LNBSWX.js → time-FCZCDIAM.js} +1 -1
- package/dist/bundle/chunks/timeout-VDIEAB4R.js +2 -0
- package/dist/bundle/chunks/{tr-36LHWFRQ.js → tr-JNNR5JMS.js} +1 -1
- package/dist/bundle/chunks/{unexpand-CADSA4VO.js → unexpand-2TKXAENW.js} +1 -1
- package/dist/bundle/chunks/{uniq-XSIZR6PB.js → uniq-DMFKT3AB.js} +1 -1
- package/dist/bundle/chunks/{wc-LF7NU4LA.js → wc-TZFYWFLA.js} +1 -1
- package/dist/bundle/chunks/worker.js +3 -2
- package/dist/bundle/chunks/{xan-Y6WF3IRG.js → xan-U6654PZR.js} +1 -1
- package/dist/bundle/chunks/xan-view-YATJ4KAA.js +2 -0
- package/dist/bundle/chunks/{xargs-MGZPH7AX.js → xargs-VDP7DLOU.js} +1 -1
- package/dist/bundle/chunks/yq-ZBXLBSXV.js +2 -0
- package/dist/bundle/index.cjs +914 -905
- package/dist/bundle/index.js +215 -214
- package/dist/commands/curl/types.d.ts +29 -0
- package/dist/commands/js-exec/module-shims.d.ts +1 -1
- package/dist/commands/sqlite3/worker.js +3 -2
- package/dist/commands/tar/tar-options.d.ts +1 -1
- package/dist/encoding.d.ts +14 -0
- package/dist/parser/parser-substitution.d.ts +14 -0
- package/package.json +1 -1
- package/dist/bin/chunks/chunk-3UKQXBQ3.js +0 -6
- package/dist/bin/chunks/chunk-ALVEEXFD.js +0 -19
- package/dist/bin/chunks/chunk-BGX3RW7H.js +0 -10
- package/dist/bin/chunks/chunk-D6CPXGKK.js +0 -75
- package/dist/bin/chunks/chunk-FOUVACI7.js +0 -16
- package/dist/bin/chunks/chunk-Q4UMTSRO.js +0 -15
- package/dist/bin/chunks/chunk-UGJM7CKP.js +0 -17
- package/dist/bin/chunks/chunk-VBDLSL7Y.js +0 -10
- package/dist/bin/chunks/chunk-VZK4FHWJ.js +0 -3
- package/dist/bin/chunks/chunk-Y4FPH5DQ.js +0 -64
- package/dist/bin/chunks/curl-AXXGQRR2.js +0 -27
- package/dist/bin/chunks/date-JEZYSA4F.js +0 -3
- package/dist/bin/chunks/flag-coverage-RFKIBJ6L.js +0 -3
- package/dist/bin/chunks/printf-Z5C2UOI5.js +0 -3
- package/dist/bin/chunks/tar-DOO744MK.js +0 -3
- package/dist/bin/shell/chunks/chunk-3UKQXBQ3.js +0 -6
- package/dist/bin/shell/chunks/chunk-ALVEEXFD.js +0 -19
- package/dist/bin/shell/chunks/chunk-BGX3RW7H.js +0 -10
- package/dist/bin/shell/chunks/chunk-D6CPXGKK.js +0 -75
- package/dist/bin/shell/chunks/chunk-FOUVACI7.js +0 -16
- package/dist/bin/shell/chunks/chunk-Q4UMTSRO.js +0 -15
- package/dist/bin/shell/chunks/chunk-UGJM7CKP.js +0 -17
- package/dist/bin/shell/chunks/chunk-VBDLSL7Y.js +0 -10
- package/dist/bin/shell/chunks/chunk-VZK4FHWJ.js +0 -3
- package/dist/bin/shell/chunks/chunk-Y4FPH5DQ.js +0 -64
- package/dist/bin/shell/chunks/curl-AXXGQRR2.js +0 -27
- package/dist/bin/shell/chunks/date-JEZYSA4F.js +0 -3
- package/dist/bin/shell/chunks/flag-coverage-RFKIBJ6L.js +0 -3
- package/dist/bin/shell/chunks/printf-Z5C2UOI5.js +0 -3
- package/dist/bin/shell/chunks/tar-DOO744MK.js +0 -3
- package/dist/bundle/chunks/chunk-CHFEPBH4.js +0 -18
- package/dist/bundle/chunks/chunk-G5EVRAOO.js +0 -74
- package/dist/bundle/chunks/chunk-GIUR5SNU.js +0 -15
- package/dist/bundle/chunks/chunk-MZFCCXPZ.js +0 -63
- package/dist/bundle/chunks/chunk-NRSASXYY.js +0 -2
- package/dist/bundle/chunks/chunk-OGJ5CFPR.js +0 -9
- package/dist/bundle/chunks/chunk-SO6R3ZKN.js +0 -16
- package/dist/bundle/chunks/chunk-XDGLKIHR.js +0 -9
- package/dist/bundle/chunks/chunk-XUIHBHL5.js +0 -5
- package/dist/bundle/chunks/chunk-XYXUMFSU.js +0 -14
- package/dist/bundle/chunks/curl-LV5Y3AMS.js +0 -26
- package/dist/bundle/chunks/date-UUUPW43J.js +0 -2
- package/dist/bundle/chunks/find-INTH3OLC.js +0 -2
- package/dist/bundle/chunks/flag-coverage-XWSYNE72.js +0 -2
- package/dist/bundle/chunks/printf-TWGXF445.js +0 -2
- package/dist/bundle/chunks/rg-S4FXYXWB.js +0 -2
- package/dist/bundle/chunks/tar-STHHZTZ6.js +0 -2
- package/dist/bundle/chunks/timeout-YDCRSLPQ.js +0 -2
- package/dist/bundle/chunks/xan-view-HDVKHFC2.js +0 -2
- package/dist/bundle/chunks/yq-4QJW3EQG.js +0 -2
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import{createRequire} from"node:module";const require=createRequire(import.meta.url);
|
|
3
|
-
import{a as _,c as W}from"./chunk-JXLDT4KX.js";import{k as T}from"./chunk-47WZ2U6M.js";import{a as D}from"./chunk-I4IRHQDW.js";import{a as N,b as A}from"./chunk-MUFNRCMY.js";import{c as H,e as L}from"./chunk-LNVSXNT7.js";var z=H(C=>{(function(){"use strict";var t={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 a(c){return e(n(c),arguments)}function r(c,i){return a.apply(null,[c].concat(i||[]))}function e(c,i){var u=1,l=c.length,o,m="",p,d,f,h,y,S,k,x;for(p=0;p<l;p++)if(typeof c[p]=="string")m+=c[p];else if(typeof c[p]=="object"){if(f=c[p],f.keys)for(o=i[u],d=0;d<f.keys.length;d++){if(o==null)throw new Error(a('[sprintf] Cannot access property "%s" of undefined value "%s"',f.keys[d],f.keys[d-1]));o=o[f.keys[d]]}else f.param_no?o=i[f.param_no]:o=i[u++];if(t.not_type.test(f.type)&&t.not_primitive.test(f.type)&&o instanceof Function&&(o=o()),t.numeric_arg.test(f.type)&&typeof o!="number"&&isNaN(o))throw new TypeError(a("[sprintf] expecting number but found %T",o));switch(t.number.test(f.type)&&(k=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}t.json.test(f.type)?m+=o:(t.number.test(f.type)&&(!k||f.sign)?(x=k?"+":"-",o=o.toString().replace(t.sign,"")):x="",y=f.pad_char?f.pad_char==="0"?"0":f.pad_char.charAt(1):" ",S=f.width-(x+o).length,h=f.width&&S>0?y.repeat(S):"",m+=f.align?x+o+h:y==="0"?x+h+o:h+x+o)}return m}var s=Object.create(null);function n(c){if(s[c])return s[c];for(var i=c,u,l=[],o=0;i;){if((u=t.text.exec(i))!==null)l.push(u[0]);else if((u=t.modulo.exec(i))!==null)l.push("%");else if((u=t.placeholder.exec(i))!==null){if(u[2]){o|=1;var m=[],p=u[2],d=[];if((d=t.key.exec(p))!==null)for(m.push(d[1]);(p=p.substring(d[0].length))!=="";)if((d=t.key_access.exec(p))!==null)m.push(d[1]);else if((d=t.index_access.exec(p))!==null)m.push(d[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]=m}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 s[c]=l}typeof C<"u"&&(C.sprintf=a,C.vsprintf=r),typeof window<"u"&&(window.sprintf=a,window.vsprintf=r,typeof define=="function"&&define.amd&&define(function(){return{sprintf:a,vsprintf:r}}))})()});var $=L(z(),1);function P(t,a,r){let e=new Date(a*1e3),s="",n=0;for(;n<t.length;)if(t[n]==="%"&&n+1<t.length){let c=t[n+1],i=R(e,c,r);i!==null?(s+=i,n+=2):(s+=t[n],n++)}else s+=t[n],n++;return s}function G(t,a){let r={year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",weekday:"short",hour12:!1,timeZone:a};try{let s=new Intl.DateTimeFormat("en-US",r).formatToParts(t),n=u=>s.find(l=>l.type===u)?.value??"",c=new Map([["Sun",0],["Mon",1],["Tue",2],["Wed",3],["Thu",4],["Fri",5],["Sat",6]]),i=n("weekday");return{year:Number.parseInt(n("year"),10)||t.getFullYear(),month:Number.parseInt(n("month"),10)||t.getMonth()+1,day:Number.parseInt(n("day"),10)||t.getDate(),hour:Number.parseInt(n("hour"),10)||t.getHours(),minute:Number.parseInt(n("minute"),10)||t.getMinutes(),second:Number.parseInt(n("second"),10)||t.getSeconds(),weekday:c.get(i)??t.getDay()}}catch{return{year:t.getFullYear(),month:t.getMonth()+1,day:t.getDate(),hour:t.getHours(),minute:t.getMinutes(),second:t.getSeconds(),weekday:t.getDay()}}}function R(t,a,r){let e=G(t,r),s=(u,l=2)=>String(u).padStart(l,"0"),n=Z(e.year,e.month,e.day),c=j(e.year,e.month,e.day,e.weekday,0),i=j(e.year,e.month,e.day,e.weekday,1);switch(a){case"a":return["Sun","Mon","Tue","Wed","Thu","Fri","Sat"][e.weekday];case"A":return["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"][e.weekday];case"b":case"h":return["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"][e.month-1];case"B":return["January","February","March","April","May","June","July","August","September","October","November","December"][e.month-1];case"c":return`${["Sun","Mon","Tue","Wed","Thu","Fri","Sat"][e.weekday]} ${["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"][e.month-1]} ${String(e.day).padStart(2," ")} ${s(e.hour)}:${s(e.minute)}:${s(e.second)} ${e.year}`;case"C":return s(Math.floor(e.year/100));case"d":return s(e.day);case"D":return`${s(e.month)}/${s(e.day)}/${s(e.year%100)}`;case"e":return String(e.day).padStart(2," ");case"F":return`${e.year}-${s(e.month)}-${s(e.day)}`;case"g":return s(O(e.year,e.month,e.day)%100);case"G":return String(O(e.year,e.month,e.day));case"H":return s(e.hour);case"I":return s(e.hour%12||12);case"j":return String(n).padStart(3,"0");case"k":return String(e.hour).padStart(2," ");case"l":return String(e.hour%12||12).padStart(2," ");case"m":return s(e.month);case"M":return s(e.minute);case"n":return`
|
|
4
|
-
`;case"N":return"000000000";case"p":return e.hour<12?"AM":"PM";case"P":return e.hour<12?"am":"pm";case"r":return`${s(e.hour%12||12)}:${s(e.minute)}:${s(e.second)} ${e.hour<12?"AM":"PM"}`;case"R":return`${s(e.hour)}:${s(e.minute)}`;case"s":return String(Math.floor(t.getTime()/1e3));case"S":return s(e.second);case"t":return" ";case"T":return`${s(e.hour)}:${s(e.minute)}:${s(e.second)}`;case"u":return String(e.weekday===0?7:e.weekday);case"U":return s(c);case"V":return s(Q(e.year,e.month,e.day));case"w":return String(e.weekday);case"W":return s(i);case"x":return`${s(e.month)}/${s(e.day)}/${s(e.year%100)}`;case"X":return`${s(e.hour)}:${s(e.minute)}:${s(e.second)}`;case"y":return s(e.year%100);case"Y":return String(e.year);case"z":return V(t,r);case"Z":return q(t,r);case"%":return"%";default:return null}}function V(t,a){if(!a){let c=-t.getTimezoneOffset(),i=c>=0?"+":"-",u=Math.floor(Math.abs(c)/60),l=Math.abs(c)%60;return`${i}${String(u).padStart(2,"0")}${String(l).padStart(2,"0")}`}try{let u=new Intl.DateTimeFormat("en-US",{timeZone:a,timeZoneName:"longOffset"}).formatToParts(t).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 r=-t.getTimezoneOffset(),e=r>=0?"+":"-",s=Math.floor(Math.abs(r)/60),n=Math.abs(r)%60;return`${e}${String(s).padStart(2,"0")}${String(n).padStart(2,"0")}`}function q(t,a){try{return new Intl.DateTimeFormat("en-US",{timeZone:a,timeZoneName:"short"}).formatToParts(t).find(n=>n.type==="timeZoneName")?.value??"UTC"}catch{return"UTC"}}function Z(t,a,r){let e=[31,28,31,30,31,30,31,31,30,31,30,31];(t%4===0&&t%100!==0||t%400===0)&&(e[1]=29);let n=r;for(let c=0;c<a-1;c++)n+=e[c];return n}function j(t,a,r,e,s){let n=Z(t,a,r),u=(new Date(t,0,1).getDay()-s+7)%7,l=(e-s+7)%7,o=n-1+u;return Math.floor((o-l+7)/7)}function Q(t,a,r){let e=new Date(t,a-1,r,12,0,0);e.setDate(e.getDate()+3-(e.getDay()+6)%7);let s=new Date(e.getFullYear(),0,4);s.setDate(s.getDate()+3-(s.getDay()+6)%7);let n=e.getTime()-s.getTime();return 1+Math.round(n/(10080*60*1e3))}function O(t,a,r){let e=new Date(t,a-1,r,12,0,0);return e.setDate(e.getDate()+3-(e.getDay()+6)%7),e.getFullYear()}function B(t){let a="",r=0;for(;r<t.length;){let e=t[r];if(e<128){a+=String.fromCharCode(e),r++;continue}if((e&224)===192){if(r+1<t.length&&(t[r+1]&192)===128&&e>=194){let s=(e&31)<<6|t[r+1]&63;a+=String.fromCharCode(s),r+=2;continue}a+=String.fromCharCode(e),r++;continue}if((e&240)===224){if(r+2<t.length&&(t[r+1]&192)===128&&(t[r+2]&192)===128){if(e===224&&t[r+1]<160){a+=String.fromCharCode(e),r++;continue}let s=(e&15)<<12|(t[r+1]&63)<<6|t[r+2]&63;if(s>=55296&&s<=57343){a+=String.fromCharCode(e),r++;continue}a+=String.fromCharCode(s),r+=3;continue}a+=String.fromCharCode(e),r++;continue}if((e&248)===240&&e<=244){if(r+3<t.length&&(t[r+1]&192)===128&&(t[r+2]&192)===128&&(t[r+3]&192)===128){if(e===240&&t[r+1]<144){a+=String.fromCharCode(e),r++;continue}let s=(e&7)<<18|(t[r+1]&63)<<12|(t[r+2]&63)<<6|t[r+3]&63;if(s>1114111){a+=String.fromCharCode(e),r++;continue}a+=String.fromCodePoint(s),r+=4;continue}a+=String.fromCharCode(e),r++;continue}a+=String.fromCharCode(e),r++}return a}var K={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)"]},ge={name:"printf",async execute(t,a){if(A(t))return N(K);if(t.length===0)return{stdout:"",stderr:`printf: usage: printf format [arguments]
|
|
5
|
-
`,exitCode:2};let r=null,e=0;for(;e<t.length;){let c=t[e];if(c==="--"){e++;break}if(c==="-v"){if(e+1>=t.length)return{stdout:"",stderr:`printf: -v: option requires an argument
|
|
6
|
-
`,exitCode:1};if(r=t[e+1],!/^[a-zA-Z_][a-zA-Z0-9_]*(\[[a-zA-Z0-9_@*"'$]+\])?$/.test(r))return{stdout:"",stderr:`printf: \`${r}': not a valid identifier
|
|
7
|
-
`,exitCode:2};e+=2}else{if(c.startsWith("-")&&c!=="-")break;break}}if(e>=t.length)return{stdout:"",stderr:`printf: usage: printf format [arguments]
|
|
8
|
-
`,exitCode:1};let s=t[e],n=t.slice(e+1);try{let c=W(s),i="",u=0,l=!1,o="",m=a.env.get("TZ"),p=a.limits?.maxStringLength;do{let{result:d,argsConsumed:f,error:h,errMsg:y,stopped:S}=ee(c,n,u,m);if(i+=d,p!==void 0&&p>0&&i.length>p)throw new T(`printf: output size limit exceeded (${p} bytes)`,"string_length");if(u+=f,h&&(l=!0,y&&(o=y)),S)break}while(u<n.length&&u>0);if(u===0&&n.length>0,r){let d=r.match(/^([a-zA-Z_][a-zA-Z0-9_]*)\[(['"]?)(.+?)\2\]$/);if(d){let f=d[1],h=d[3];h=h.replace(/\$([a-zA-Z_][a-zA-Z0-9_]*)/g,(y,S)=>a.env.get(S)??""),a.env.set(`${f}_${h}`,i)}else a.env.set(r,i);return{stdout:"",stderr:o,exitCode:l?1:0}}return{stdout:i,stderr:o,exitCode:l?1:0}}catch(c){if(c instanceof T)throw c;return{stdout:"",stderr:`printf: ${D(c)}
|
|
9
|
-
`,exitCode:1}}}};function ee(t,a,r,e){let s="",n=0,c=0,i=!1,u="";for(;n<t.length;)if(t[n]==="%"&&n+1<t.length){let l=n;if(n++,t[n]==="%"){s+="%",n++;continue}let o=t.slice(l).match(/^%(-?\d*)(?:\.(\d+))?\(([^)]*)\)T/);if(o){let b=o[1]?parseInt(o[1],10):0,I=o[2]?parseInt(o[2],10):-1,Y=o[3],X=o[0],v=a[r+c]||"";c++;let M;v===""||v==="-1"||v==="-2"?M=Math.floor(Date.now()/1e3):M=parseInt(v,10)||0;let w=P(Y,M,e);if(I>=0&&w.length>I&&(w=w.slice(0,I)),b!==0){let F=Math.abs(b);w.length<F&&(b<0?w=w.padEnd(F," "):w=w.padStart(F," "))}s+=w,n=l+X.length;continue}for(;n<t.length&&"+-0 #'".includes(t[n]);)n++;let m=!1;if(t[n]==="*")m=!0,n++;else for(;n<t.length&&/\d/.test(t[n]);)n++;let p=!1;if(t[n]===".")if(n++,t[n]==="*")p=!0,n++;else for(;n<t.length&&/\d/.test(t[n]);)n++;n<t.length&&"hlL".includes(t[n])&&n++;let d=t[n]||"";n++;let h=t.slice(l,n);if(m){let b=parseInt(a[r+c]||"0",10);c++,h=h.replace("*",String(b))}if(p){let b=parseInt(a[r+c]||"0",10);c++,h=h.replace(".*",`.${b}`)}let y=a[r+c]||"";c++;let{value:S,parseError:k,parseErrMsg:x,stopped:J}=te(h,d,y);if(s+=S,k&&(i=!0,x&&(u=x)),J)return{result:s,argsConsumed:c,error:i,errMsg:u,stopped:!0}}else s+=t[n],n++;return{result:s,argsConsumed:c,error:i,errMsg:u,stopped:!1}}function te(t,a,r){let e=!1,s="";switch(a){case"d":case"i":{let n=E(r);return e=g,e&&(s=`printf: ${r}: invalid number
|
|
10
|
-
`),{value:U(t,n),parseError:e,parseErrMsg:s}}case"o":{let n=E(r);return e=g,e&&(s=`printf: ${r}: invalid number
|
|
11
|
-
`),{value:re(t,n),parseError:e,parseErrMsg:s}}case"u":{let n=E(r);e=g,e&&(s=`printf: ${r}: invalid number
|
|
12
|
-
`);let c=n<0?n>>>0:n;return{value:U(t.replace("u","d"),c),parseError:e,parseErrMsg:s}}case"x":case"X":{let n=E(r);return e=g,e&&(s=`printf: ${r}: invalid number
|
|
13
|
-
`),{value:ne(t,n),parseError:e,parseErrMsg:s}}case"e":case"E":case"f":case"F":case"g":case"G":{let n=parseFloat(r)||0;return{value:oe(t,a,n),parseError:!1,parseErrMsg:""}}case"c":{if(r==="")return{value:"",parseError:!1,parseErrMsg:""};let i=new TextEncoder().encode(r)[0];return{value:String.fromCharCode(i),parseError:!1,parseErrMsg:""}}case"s":return{value:ae(t,r),parseError:!1,parseErrMsg:""};case"q":return{value:ie(t,r),parseError:!1,parseErrMsg:""};case"b":{let n=ce(r);return{value:n.value,parseError:!1,parseErrMsg:"",stopped:n.stopped}}default:try{return{value:(0,$.sprintf)(t,r),parseError:!1,parseErrMsg:""}}catch{return{value:"",parseError:!0,parseErrMsg:`printf: [sprintf] unexpected placeholder
|
|
14
|
-
`}}}}var g=!1;function E(t){g=!1;let a=t.trimStart(),r=a!==a.trimEnd();if(t=a.trimEnd(),t.startsWith("'")&&t.length>=2||t.startsWith('"')&&t.length>=2)return t.charCodeAt(1);if(t.startsWith("\\'")&&t.length>=3||t.startsWith('\\"')&&t.length>=3)return t.charCodeAt(2);if(t.startsWith("+")&&(t=t.slice(1)),t.startsWith("0x")||t.startsWith("0X")){let e=parseInt(t,16);return Number.isNaN(e)?(g=!0,0):(r&&(g=!0),e)}if(t.startsWith("0")&&t.length>1&&/^-?0[0-7]+$/.test(t))return r&&(g=!0),parseInt(t,8)||0;if(/^\d+#/.test(t)){g=!0;let e=t.match(/^(\d+)#/);return e?parseInt(e[1],10):0}if(t!==""&&!/^-?\d+$/.test(t)){g=!0;let e=parseInt(t,10);return Number.isNaN(e)?0:e}return r&&(g=!0),parseInt(t,10)||0}function U(t,a){let r=t.match(/^%([- +#0']*)(\d*)(\.(\d*))?[diu]$/);if(!r)return(0,$.sprintf)(t.replace(/\.\d*/,""),a);let e=r[1]||"",s=r[2]?parseInt(r[2],10):0,n=r[3]!==void 0?r[4]?parseInt(r[4],10):0:-1,c=a<0,i=Math.abs(a),u=String(i);n>=0&&(u=u.padStart(n,"0"));let l="";c?l="-":e.includes("+")?l="+":e.includes(" ")&&(l=" ");let o=l+u;return s>o.length&&(e.includes("-")?o=o.padEnd(s," "):e.includes("0")&&n<0?o=l+u.padStart(s-l.length,"0"):o=o.padStart(s," ")),o}function re(t,a){let r=t.match(/^%([- +#0']*)(\d*)(\.(\d*))?o$/);if(!r)return(0,$.sprintf)(t,a);let e=r[1]||"",s=r[2]?parseInt(r[2],10):0,n=r[3]!==void 0?r[4]?parseInt(r[4],10):0:-1,c=Math.abs(a).toString(8);n>=0&&(c=c.padStart(n,"0")),e.includes("#")&&!c.startsWith("0")&&(c=`0${c}`);let i=c;return s>i.length&&(e.includes("-")?i=i.padEnd(s," "):e.includes("0")&&n<0?i=i.padStart(s,"0"):i=i.padStart(s," ")),i}function ne(t,a){let r=t.includes("X"),e=t.match(/^%([- +#0']*)(\d*)(\.(\d*))?[xX]$/);if(!e)return(0,$.sprintf)(t,a);let s=e[1]||"",n=e[2]?parseInt(e[2],10):0,c=e[3]!==void 0?e[4]?parseInt(e[4],10):0:-1,i=Math.abs(a).toString(16);r&&(i=i.toUpperCase()),c>=0&&(i=i.padStart(c,"0"));let u="";s.includes("#")&&a!==0&&(u=r?"0X":"0x");let l=u+i;return n>l.length&&(s.includes("-")?l=l.padEnd(n," "):s.includes("0")&&c<0?l=u+i.padStart(n-u.length,"0"):l=l.padStart(n," ")),l}function se(t){if(t==="")return"''";if(/^[a-zA-Z0-9_./-]+$/.test(t))return t;if(/[\x00-\x1f\x7f-\xff]/.test(t)){let e="$'";for(let s of t){let n=s.charCodeAt(0);s==="'"?e+="\\'":s==="\\"?e+="\\\\":s===`
|
|
15
|
-
`?e+="\\n":s===" "?e+="\\t":s==="\r"?e+="\\r":s==="\x07"?e+="\\a":s==="\b"?e+="\\b":s==="\f"?e+="\\f":s==="\v"?e+="\\v":s==="\x1B"?e+="\\E":n<32||n>=127&&n<=255?e+=`\\${n.toString(8).padStart(3,"0")}`:s==='"'?e+='\\"':e+=s}return e+="'",e}let r="";for(let e of t)" |&;<>()$`\\\"'*?[#~=%!{}".includes(e)?r+=`\\${e}`:r+=e;return r}function ae(t,a){let r=t.match(/^%(-?)(\d*)(\.(\d*))?s$/);if(!r)return(0,$.sprintf)(t.replace(/0+(?=\d)/,""),a);let e=r[1]==="-",s=r[2]?parseInt(r[2],10):0,n=r[3]!==void 0?r[4]?parseInt(r[4],10):0:-1,c=e?-s:s;return _(a,c,n)}function ie(t,a){let r=se(a),e=t.match(/^%(-?)(\d*)q$/);if(!e)return r;let s=e[1]==="-",n=e[2]?parseInt(e[2],10):0,c=r;return n>c.length&&(s?c=c.padEnd(n," "):c=c.padStart(n," ")),c}function oe(t,a,r){let e=t.match(/^%([- +#0']*)(\d*)(\.(\d*))?[eEfFgG]$/);if(!e)return(0,$.sprintf)(t,r);let s=e[1]||"",n=e[2]?parseInt(e[2],10):0,c=e[3]!==void 0?e[4]?parseInt(e[4],10):0:6,i,u=a.toLowerCase();if(u==="e"?(i=r.toExponential(c),i=i.replace(/e([+-])(\d)$/,"e$10$2"),a==="E"&&(i=i.toUpperCase())):u==="f"?(i=r.toFixed(c),s.includes("#")&&c===0&&!i.includes(".")&&(i+=".")):u==="g"?(i=r.toPrecision(c||1),s.includes("#")||(i=i.replace(/\.?0+$/,""),i=i.replace(/\.?0+e/,"e")),i=i.replace(/e([+-])(\d)$/,"e$10$2"),a==="G"&&(i=i.toUpperCase())):i=r.toString(),r>=0&&(s.includes("+")?i=`+${i}`:s.includes(" ")&&(i=` ${i}`)),n>i.length)if(s.includes("-"))i=i.padEnd(n," ");else if(s.includes("0")){let l=i.match(/^[+ -]/)?.[0]||"",o=l?i.slice(1):i;i=l+o.padStart(n-l.length,"0")}else i=i.padStart(n," ");return i}function ce(t){let a="",r=0;for(;r<t.length;)if(t[r]==="\\"&&r+1<t.length)switch(t[r+1]){case"n":a+=`
|
|
16
|
-
`,r+=2;break;case"t":a+=" ",r+=2;break;case"r":a+="\r",r+=2;break;case"\\":a+="\\",r+=2;break;case"a":a+="\x07",r+=2;break;case"b":a+="\b",r+=2;break;case"f":a+="\f",r+=2;break;case"v":a+="\v",r+=2;break;case"c":return{value:a,stopped:!0};case"x":{let s=[],n=r;for(;n+1<t.length&&t[n]==="\\"&&t[n+1]==="x";){let c="",i=n+2;for(;i<t.length&&i<n+4&&/[0-9a-fA-F]/.test(t[i]);)c+=t[i],i++;if(c)s.push(parseInt(c,16)),n=i;else break}s.length>0?(a+=B(s),r=n):(a+="\\x",r+=2);break}case"u":{let s="",n=r+2;for(;n<t.length&&n<r+6&&/[0-9a-fA-F]/.test(t[n]);)s+=t[n],n++;s?(a+=String.fromCodePoint(parseInt(s,16)),r=n):(a+="\\u",r+=2);break}case"0":{let s="",n=r+2;for(;n<t.length&&n<r+5&&/[0-7]/.test(t[n]);)s+=t[n],n++;s?a+=String.fromCharCode(parseInt(s,8)):a+="\0",r=n;break}case"1":case"2":case"3":case"4":case"5":case"6":case"7":{let s="",n=r+1;for(;n<t.length&&n<r+4&&/[0-7]/.test(t[n]);)s+=t[n],n++;a+=String.fromCharCode(parseInt(s,8)),r=n;break}default:a+=t[r],r++}else a+=t[r],r++;return{value:a,stopped:!1}}var ye={name:"printf",flags:[{flag:"-v",type:"value",valueHint:"string"}],stdinType:"none",needsArgs:!0};export{ge as a,ye as b};
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import{createRequire} from"node:module";const require=createRequire(import.meta.url);
|
|
3
|
-
import{a as q,b as M}from"./chunk-LSQTB2QK.js";import{d as b}from"./chunk-MLUOPG3W.js";import{a as A,b as L}from"./chunk-LNNWMRCB.js";import{a as k}from"./chunk-HL4ZS7TX.js";import{a as F}from"./chunk-H7JTIXAO.js";import{a as E}from"./chunk-VZK4FHWJ.js";import{k as $}from"./chunk-47WZ2U6M.js";import{a as J}from"./chunk-PBOVSFTJ.js";import{a as D,b as z,c as O}from"./chunk-MUFNRCMY.js";function U(e){switch(e){case"\b":return"\\b";case"\f":return"\\f";case`
|
|
4
|
-
`:return"\\n";case"\r":return"\\r";case" ":return"\\t";default:return`\\u${e.charCodeAt(0).toString(16).padStart(4,"0")}`}}function W(e){let r="",t=!1,o=!1;for(let l=0;l<e.length;l++){let n=e[l];if(o){r+=n,o=!1;continue}if(n==="\\"){r+=n,o=!0;continue}if(n==='"'){r+=n,t=!t;continue}if(t&&n.charCodeAt(0)<=31){r+=U(n);continue}r+=n}return r}function I(e,r,t){return JSON.parse(W(e.slice(r,t)))}function T(e){let r=[],t=0,o=e.length;for(;t<o;){for(;t<o&&/\s/.test(e[t]);)t++;if(t>=o)break;let l=t,n=e[t];if(n==="{"||n==="["){let a=n,f=n==="{"?"}":"]",c=1,p=!1,d=!1;for(t++;t<o&&c>0;){let h=e[t];d?d=!1:h==="\\"?d=!0:h==='"'?p=!p:p||(h===a?c++:h===f&&c--),t++}if(c!==0)throw new Error(`Unexpected end of JSON input at position ${t} (unclosed ${a})`);r.push(b(I(e,l,t)))}else if(n==='"'){let a=!1;for(t++;t<o;){let f=e[t];if(a)a=!1;else if(f==="\\")a=!0;else if(f==='"'){t++;break}t++}r.push(b(I(e,l,t)))}else if(n==="-"||n>="0"&&n<="9"){for(;t<o&&/[\d.eE+-]/.test(e[t]);)t++;r.push(b(I(e,l,t)))}else if(e.slice(t,t+4)==="true")r.push(!0),t+=4;else if(e.slice(t,t+5)==="false")r.push(!1),t+=5;else if(e.slice(t,t+4)==="null")r.push(null),t+=4;else{let a=e.slice(t,t+10);throw new Error(`Invalid JSON at position ${l}: unexpected '${a.split(/\s/)[0]}'`)}}return r}var _={name:"jq",summary:"command-line JSON processor",usage:"jq [OPTIONS] FILTER [FILE]",options:["-r, --raw-output output strings without quotes","-c, --compact compact output (no pretty printing)","-e, --exit-status set exit status based on output","-s, --slurp read entire input into array","-n, --null-input don't read any input","-j, --join-output don't print newlines after each output","-a, --ascii force ASCII output","-S, --sort-keys sort object keys","-C, --color colorize output (ignored)","-M, --monochrome monochrome output (ignored)"," --tab use tabs for indentation"," --help display this help and exit"]};function j(e,r,t,o,l,n=0){if(e===null||e===void 0)return"null";if(typeof e=="boolean")return String(e);if(typeof e=="number")return Number.isFinite(e)?String(e):"null";if(typeof e=="string")return t?e:JSON.stringify(e);let a=l?" ":" ";if(Array.isArray(e))return e.length===0?"[]":r?`[${e.map(c=>j(c,!0,!1,o,l)).join(",")}]`:`[
|
|
5
|
-
${e.map(c=>a.repeat(n+1)+j(c,!1,!1,o,l,n+1)).join(`,
|
|
6
|
-
`)}
|
|
7
|
-
${a.repeat(n)}]`;if(typeof e=="object"){let f=Object.keys(e);return o&&(f=f.sort()),f.length===0?"{}":r?`{${f.map(p=>`${JSON.stringify(p)}:${j(e[p],!0,!1,o,l)}`).join(",")}}`:`{
|
|
8
|
-
${f.map(p=>{let d=j(e[p],!1,!1,o,l,n+1);return`${a.repeat(n+1)}${JSON.stringify(p)}: ${d}`}).join(`,
|
|
9
|
-
`)}
|
|
10
|
-
${a.repeat(n)}}`}return String(e)}var se={name:"jq",async execute(e,r){A(r.requireDefenseContext,"jq","execution entry");let t=(i,s)=>L(r.requireDefenseContext,"jq",i,s);if(z(e))return D(_);let o=!1,l=!1,n=!1,a=!1,f=!1,c=!1,p=!1,d=!1,h=".",N=!1,g=[];for(let i=0;i<e.length;i++){let s=e[i];if(s==="-r"||s==="--raw-output")o=!0;else if(s==="-c"||s==="--compact-output")l=!0;else if(s==="-e"||s==="--exit-status")n=!0;else if(s==="-s"||s==="--slurp")a=!0;else if(s==="-n"||s==="--null-input")f=!0;else if(s==="-j"||s==="--join-output")c=!0;else if(!(s==="-a"||s==="--ascii")){if(s==="-S"||s==="--sort-keys")p=!0;else if(!(s==="-C"||s==="--color")){if(!(s==="-M"||s==="--monochrome"))if(s==="--tab")d=!0;else if(s==="-")g.push("-");else{if(s.startsWith("--"))return O("jq",s);if(s.startsWith("-")){for(let u of s.slice(1))if(u==="r")o=!0;else if(u==="c")l=!0;else if(u==="e")n=!0;else if(u==="s")a=!0;else if(u==="n")f=!0;else if(u==="j")c=!0;else if(u!=="a"){if(u==="S")p=!0;else if(u!=="C"){if(u!=="M")return O("jq",`-${u}`)}}}else N?g.push(s):(h=s,N=!0)}}}}let y=[];if(!f)if(g.length===0||g.length===1&&g[0]==="-")y.push({source:"stdin",content:E(r.stdin)});else{let i=await t("file read",()=>F(r,g,{cmdName:"jq",stopOnError:!0}));if(i.exitCode!==0)return{stdout:"",stderr:i.stderr,exitCode:2};y=i.files.map(s=>({source:s.filename||"stdin",content:E(s.content)}))}try{let i=M(h),s=[],u={limits:r.limits?{maxIterations:r.limits.maxJqIterations}:void 0,env:r.env,coverage:r.coverage,requireDefenseContext:r.requireDefenseContext};if(f)s=q(null,i,u);else if(a){let m=[];for(let{content:C}of y){let w=C.trim();w&&m.push(...T(w))}s=q(m,i,u)}else for(let{content:m}of y){let C=m.trim();if(!C)continue;let w=T(C);for(let P of w)s.push(...q(P,i,u))}let V=s.map(m=>j(m,l,o,p,d)),B=c?"":`
|
|
11
|
-
`,S=V.join(B),x=r.limits?.maxStringLength;if(x!==void 0&&x>0&&S.length>x)throw new $(`jq: output size limit exceeded (${x} bytes)`,"string_length");let H=n&&(s.length===0||s.every(m=>m==null||m===!1))?1:0;return{stdout:S?c?S:`${S}
|
|
12
|
-
`:"",stderr:"",exitCode:H}}catch(i){if(i instanceof k)throw i;if(i instanceof $)return{stdout:"",stderr:`jq: ${J(i.message)}
|
|
13
|
-
`,exitCode:$.EXIT_CODE};let s=J(i.message);return s.includes("Unknown function")?{stdout:"",stderr:`jq: error: ${s}
|
|
14
|
-
`,exitCode:3}:{stdout:"",stderr:`jq: parse error: ${s}
|
|
15
|
-
`,exitCode:5}}}},re={name:"jq",flags:[{flag:"-r",type:"boolean"},{flag:"-c",type:"boolean"},{flag:"-e",type:"boolean"},{flag:"-s",type:"boolean"},{flag:"-n",type:"boolean"},{flag:"-j",type:"boolean"},{flag:"-S",type:"boolean"},{flag:"--tab",type:"boolean"}],stdinType:"json",needsArgs:!0};export{se as a,re as b};
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import{createRequire} from"node:module";const require=createRequire(import.meta.url);
|
|
3
|
-
import{c}from"./chunk-MUFNRCMY.js";function $(t,i){let r=10,s=null,o=!1,l=!1,n=!1,u=[];for(let f=0;f<t.length;f++){let e=t[f];if(e==="-n"&&f+1<t.length){let a=t[++f];i==="tail"&&a.startsWith("+")?(n=!0,r=parseInt(a.slice(1),10)):r=parseInt(a,10)}else if(i==="tail"&&e.startsWith("-n+"))n=!0,r=parseInt(e.slice(3),10);else if(e.startsWith("-n"))r=parseInt(e.slice(2),10);else if(e==="-c"&&f+1<t.length)s=parseInt(t[++f],10);else if(e.startsWith("-c"))s=parseInt(e.slice(2),10);else if(e.startsWith("--bytes="))s=parseInt(e.slice(8),10);else if(e.startsWith("--lines="))r=parseInt(e.slice(8),10);else if(e==="-q"||e==="--quiet"||e==="--silent")o=!0;else if(e==="-v"||e==="--verbose")l=!0;else if(e.match(/^-\d+$/))r=parseInt(e.slice(1),10);else{if(e.startsWith("--"))return{ok:!1,error:c(i,e)};if(e.startsWith("-")&&e!=="-")return{ok:!1,error:c(i,e)};u.push(e)}}return s!==null&&(Number.isNaN(s)||s<0)?{ok:!1,error:{stdout:"",stderr:`${i}: invalid number of bytes
|
|
4
|
-
`,exitCode:1}}:Number.isNaN(r)||r<0?{ok:!1,error:{stdout:"",stderr:`${i}: invalid number of lines
|
|
5
|
-
`,exitCode:1}}:{ok:!0,options:{lines:r,bytes:s,quiet:o,verbose:l,files:u,fromLine:n}}}async function g(t,i,r,s){let{quiet:o,verbose:l,files:n}=i;if(n.length===0)return{stdout:s(t.stdin),stderr:"",exitCode:0};let u="",f="",e=0,a=l||!o&&n.length>1,h=0;for(let p=0;p<n.length;p++){let d=n[p];try{let b=t.fs.resolvePath(t.cwd,d),x=await t.fs.readFile(b);a&&(h>0&&(u+=`
|
|
6
|
-
`),u+=`==> ${d} <==
|
|
7
|
-
`),u+=s(x),h++}catch{f+=`${r}: ${d}: No such file or directory
|
|
8
|
-
`,e=1}}return{stdout:u,stderr:f,exitCode:e}}function k(t,i,r){if(r!==null)return t.slice(0,r);if(i===0)return"";let s=0,o=0,l=t.length;for(;s<l&&o<i;){let n=t.indexOf(`
|
|
9
|
-
`,s);if(n===-1)return`${t}
|
|
10
|
-
`;o++,s=n+1}return s>0?t.slice(0,s):""}function v(t,i,r,s){if(r!==null)return t.slice(-r);let o=t.length;if(o===0)return"";if(s){let f=0,e=1;for(;f<o&&e<i;){let h=t.indexOf(`
|
|
11
|
-
`,f);if(h===-1)break;e++,f=h+1}let a=t.slice(f);return a.endsWith(`
|
|
12
|
-
`)?a:`${a}
|
|
13
|
-
`}if(i===0)return"";let l=o-1;t[l]===`
|
|
14
|
-
`&&l--;let n=0;for(;l>=0&&n<i;){if(t[l]===`
|
|
15
|
-
`&&(n++,n===i)){l++;break}l--}l<0&&(l=0);let u=t.slice(l);return t[o-1]===`
|
|
16
|
-
`?u:`${u}
|
|
17
|
-
`}export{$ as a,g as b,k as c,v as d};
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import{createRequire} from"node:module";const require=createRequire(import.meta.url);
|
|
3
|
-
import{a as x}from"./chunk-UR4CEP4Y.js";import{a as z,b as J}from"./chunk-ALVEEXFD.js";import{a as X}from"./chunk-VZK4FHWJ.js";import{a as Z,b as j,c as q}from"./chunk-MUFNRCMY.js";var ie={name:"grep",summary:"print lines that match patterns",usage:"grep [OPTION]... PATTERN [FILE]...",options:["-E, --extended-regexp PATTERN is an extended regular expression","-P, --perl-regexp PATTERN is a Perl regular expression","-F, --fixed-strings PATTERN is a set of newline-separated strings","-i, --ignore-case ignore case distinctions","-v, --invert-match select non-matching lines","-w, --word-regexp match only whole words","-x, --line-regexp match only whole lines","-c, --count print only a count of matching lines","-l, --files-with-matches print only names of files with matches","-L, --files-without-match print names of files with no matches","-m NUM, --max-count=NUM stop after NUM matches","-n, --line-number print line number with output lines","-h, --no-filename suppress the file name prefix on output","-o, --only-matching show only nonempty parts of lines that match","-q, --quiet, --silent suppress all normal output","-r, -R, --recursive search directories recursively","-A NUM print NUM lines of trailing context","-B NUM print NUM lines of leading context","-C NUM print NUM lines of context","-e PATTERN use PATTERN for matching"," --include=GLOB search only files matching GLOB"," --exclude=GLOB skip files matching GLOB"," --exclude-dir=DIR skip directories matching DIR"," --help display this help and exit"]},K={name:"grep",async execute(t,s){if(j(t))return Z(ie);let l=!1,f=!1,c=!1,p=!1,m=!1,a=!1,n=!1,u=!1,y=!1,w=!1,h=!1,d=!1,F=!1,P=!1,B=!1,$=0,T=0,C=0,W=[],A=[],U=[],R=null,I=[];for(let r=0;r<t.length;r++){let i=t[r];if(i.startsWith("-")&&i!=="-"){if(i==="-e"&&r+1<t.length){R=t[++r];continue}if(i.startsWith("--include=")){W.push(i.slice(10));continue}if(i.startsWith("--exclude=")){A.push(i.slice(10));continue}if(i.startsWith("--exclude-dir=")){U.push(i.slice(14));continue}if(i.startsWith("--max-count=")){$=parseInt(i.slice(12),10);continue}let b=i.match(/^-m(\d+)$/);if(b){$=parseInt(b[1],10);continue}if(i==="-m"&&r+1<t.length){$=parseInt(t[++r],10);continue}let o=i.match(/^-([ABC])(\d+)$/);if(o){let e=parseInt(o[2],10);o[1]==="A"?C=e:o[1]==="B"?T=e:o[1]==="C"&&(T=e,C=e);continue}if((i==="-A"||i==="-B"||i==="-C")&&r+1<t.length){let e=parseInt(t[++r],10);i==="-A"?C=e:i==="-B"?T=e:(T=e,C=e);continue}let g=i.startsWith("--")?[i]:i.slice(1).split("");for(let e of g)if(e==="i"||e==="--ignore-case")l=!0;else if(e==="n"||e==="--line-number")f=!0;else if(e==="v"||e==="--invert-match")c=!0;else if(e==="c"||e==="--count")p=!0;else if(e==="l"||e==="--files-with-matches")m=!0;else if(e==="L"||e==="--files-without-match")a=!0;else if(e==="r"||e==="R"||e==="--recursive")n=!0;else if(e==="w"||e==="--word-regexp")u=!0;else if(e==="x"||e==="--line-regexp")y=!0;else if(e==="E"||e==="--extended-regexp")w=!0;else if(e==="P"||e==="--perl-regexp")h=!0;else if(e==="F"||e==="--fixed-strings")d=!0;else if(e==="o"||e==="--only-matching")F=!0;else if(e==="h"||e==="--no-filename")P=!0;else if(e==="q"||e==="--quiet"||e==="--silent")B=!0;else{if(e.startsWith("--"))return q("grep",e);if(e.length===1)return q("grep",`-${e}`)}}else R===null?R=i:I.push(i)}if(R===null)return{stdout:"",stderr:`grep: missing pattern
|
|
4
|
-
`,exitCode:2};let ee=d?"fixed":w?"extended":h?"perl":"basic",L,O,Q;try{let r=J(R,{mode:ee,ignoreCase:l,wholeWord:u,lineRegexp:y});L=r.regex,O=r.kResetGroup,Q=r.preFilter}catch{return{stdout:"",stderr:`grep: invalid regular expression: ${R}
|
|
5
|
-
`,exitCode:2}}if(I.length===0&&s.stdin!==void 0){let r=z(X(s.stdin),L,{invertMatch:c,showLineNumbers:f,countOnly:p,filename:"",onlyMatching:F,beforeContext:T,afterContext:C,maxCount:$,kResetGroup:O,preFilter:Q});return B?{stdout:"",stderr:"",exitCode:r.matched?0:1}:{stdout:r.output,stderr:"",exitCode:r.matched?0:1}}if(I.length===0)return{stdout:"",stderr:`grep: no input files
|
|
6
|
-
`,exitCode:2};let M="",S="",D=!1,k=!1,v=[];for(let r of I)if(r.includes("*")||r.includes("?")||r.includes("[")){let i=await re(r,s);if(n)for(let b of i){let o=await H(b.path,s,W,A,U,b.isFile);v.push(...o)}else v.push(...i)}else if(n){let i=await H(r,s,W,A,U);v.push(...i)}else v.push({path:r});let te=(v.length>1||n)&&!P,_=50;for(let r=0;r<v.length;r+=_){let i=v.slice(r,r+_),b=await Promise.all(i.map(async o=>{let g=o.path,e=g.split("/").pop()||g;if(A.length>0&&!n&&A.some(N=>x(e,N,{stripQuotes:!0}))||W.length>0&&!n&&!W.some(N=>x(e,N,{stripQuotes:!0})))return null;try{let N=s.fs.resolvePath(s.cwd,g),G=!1;if(o.isFile===void 0?G=(await s.fs.stat(N)).isDirectory:G=!o.isFile,G)return n?null:{error:`grep: ${g}: Is a directory
|
|
7
|
-
`};let se=await s.fs.readFile(N),ne=z(se,L,{invertMatch:c,showLineNumbers:f,countOnly:p,filename:te?g:"",onlyMatching:F,beforeContext:T,afterContext:C,maxCount:$,kResetGroup:O,preFilter:Q});return{file:g,result:ne}}catch{return{error:`grep: ${g}: No such file or directory
|
|
8
|
-
`}}}));for(let o of b){if(o===null)continue;if("error"in o&&o.error){S+=o.error,o.error.includes("Is a directory")||(k=!0);continue}if(!("file"in o)||!o.result)continue;let{file:g,result:e}=o;if(e.matched){if(D=!0,B)return{stdout:"",stderr:"",exitCode:0};m?M+=`${g}
|
|
9
|
-
`:a||(M+=e.output)}else a?M+=`${g}
|
|
10
|
-
`:p&&!m&&(M+=e.output)}}let E;return k?E=2:a?E=M.length>0?0:1:E=D?0:1,B?{stdout:"",stderr:"",exitCode:E}:{stdout:M,stderr:S,exitCode:E}}},V=256;async function Y(t,s,l,f,c=0){if(c>=V)return;let p=l.fs.resolvePath(l.cwd,t);try{if(!(await l.fs.stat(p)).isDirectory){let n=t.split("/").pop()||"";if(s){let u=s.replace(/^\//,"");x(n,u,{stripQuotes:!0})&&f.push(t)}return}let a=await l.fs.readdir(p);for(let n of a){let u=t==="."?n:`${t}/${n}`,y=l.fs.resolvePath(l.cwd,u);if((await l.fs.stat(y)).isDirectory)await Y(u,s,l,f,c+1);else if(s){let h=s.replace(/^\//,"");x(n,h,{stripQuotes:!0})&&f.push(u)}}}catch{}}async function re(t,s){let l=[],f=t.lastIndexOf("/"),c,p;if(f===-1?(c=s.cwd,p=t):(c=t.slice(0,f)||"/",p=t.slice(f+1)),t.includes("**")){let a=[],n=t.split("**"),u=n[0].replace(/\/$/,"")||".",y=n[1]||"";return await Y(u,y,s,a),a.map(w=>({path:w}))}let m=s.fs.resolvePath(s.cwd,c);try{if(s.fs.readdirWithFileTypes){let a=await s.fs.readdirWithFileTypes(m);for(let n of a)if(x(n.name,p,{stripQuotes:!0})){let u=f===-1?n.name:`${c}/${n.name}`;l.push({path:u,isFile:n.isFile})}}else{let a=await s.fs.readdir(m);for(let n of a)if(x(n,p,{stripQuotes:!0})){let u=f===-1?n:`${c}/${n}`;l.push({path:u})}}}catch{}return l.sort((a,n)=>a.path.localeCompare(n.path))}async function H(t,s,l=[],f=[],c=[],p,m=0){if(m>=V)return[];let a=s.fs.resolvePath(s.cwd,t),n=[];try{let u,y;if(p!==void 0)u=p,y=!p;else{let h=await s.fs.stat(a);u=h.isFile,y=h.isDirectory}if(u){let h=t.split("/").pop()||t;return f.length>0&&f.some(d=>x(h,d,{stripQuotes:!0}))?[]:l.length>0&&!l.some(d=>x(h,d,{stripQuotes:!0}))?[]:[{path:t,isFile:!0}]}if(!y)return[];let w=t.split("/").pop()||t;if(c.length>0&&c.some(h=>x(w,h,{stripQuotes:!0})))return[];if(s.fs.readdirWithFileTypes){let h=await s.fs.readdirWithFileTypes(a);for(let d of h){if(d.name.startsWith("."))continue;let F=t==="."?d.name:`${t}/${d.name}`,P=await H(F,s,l,f,c,d.isFile,m+1);n.push(...P)}}else{let h=await s.fs.readdir(a);for(let d of h){if(d.startsWith("."))continue;let F=t==="."?d:`${t}/${d}`,P=await H(F,s,l,f,c,void 0,m+1);n.push(...P)}}}catch{}return n}var ce={name:"fgrep",async execute(t,s){return K.execute(["-F",...t],s)}},pe={name:"egrep",async execute(t,s){return K.execute(["-E",...t],s)}},he={name:"grep",flags:[{flag:"-E",type:"boolean"},{flag:"-F",type:"boolean"},{flag:"-P",type:"boolean"},{flag:"-i",type:"boolean"},{flag:"-v",type:"boolean"},{flag:"-w",type:"boolean"},{flag:"-x",type:"boolean"},{flag:"-c",type:"boolean"},{flag:"-l",type:"boolean"},{flag:"-L",type:"boolean"},{flag:"-n",type:"boolean"},{flag:"-h",type:"boolean"},{flag:"-o",type:"boolean"},{flag:"-q",type:"boolean"},{flag:"-r",type:"boolean"},{flag:"-m",type:"value",valueHint:"number"},{flag:"-A",type:"value",valueHint:"number"},{flag:"-B",type:"value",valueHint:"number"},{flag:"-C",type:"value",valueHint:"number"},{flag:"-e",type:"value",valueHint:"pattern"}],stdinType:"text",needsArgs:!0},de={name:"fgrep",flags:[],stdinType:"text",needsArgs:!0},ge={name:"egrep",flags:[],stdinType:"text",needsArgs:!0};export{K as a,ce as b,pe as c,he as d,de as e,ge as f};
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import{createRequire} from"node:module";const require=createRequire(import.meta.url);
|
|
3
|
-
var i=new TextDecoder("utf-8",{fatal:!0}),d=new TextEncoder;function y(t){let e=t;if(!e)return e;let n=!1;for(let r=0;r<e.length;r++){let u=e.charCodeAt(r);if(u>255)return e;u>127&&(n=!0)}if(!n)return e;let o=new Uint8Array(e.length);for(let r=0;r<e.length;r++)o[r]=e.charCodeAt(r);try{return i.decode(o)}catch{return e}}function c(t){if(!t)return t;let e=d.encode(t),n="";for(let o=0;o<e.length;o++)n+=String.fromCharCode(e[o]);return n}var a="";function f(t){let e="";for(let n=0;n<t.length;n++)e+=String.fromCharCode(t[n]);return e}async function x(t,e){return typeof t.readFileBytes=="function"?t.readFileBytes(e):f(await t.readFileBuffer(e))}function s(t){return t.stdoutKind?t.stdoutKind:t.stdoutEncoding==="binary"?"bytes":"text"}function l(t){return s(t)==="bytes"?t.stdout:c(t.stdout)}export{y as a,c as b,a as c,x as d,l as e};
|
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import{createRequire} from"node:module";const require=createRequire(import.meta.url);
|
|
3
|
-
import{a as ye}from"./chunk-BIJXTWZ4.js";import{b as Q}from"./chunk-HL4ZS7TX.js";import{a as U}from"./chunk-IEXQTXU5.js";import{a as pe,b as ge,c as ee}from"./chunk-MUFNRCMY.js";var Ke="file",Je="link",Ve="symlink",ke="directory",Qe={file:"0",link:"1",symlink:"2","character-device":"3","block-device":"4",directory:"5",fifo:"6","pax-header":"x","pax-global-header":"g","gnu-long-name":"L","gnu-long-link-name":"K"},et={0:Ke,1:Je,2:Ve,3:"character-device",4:"block-device",5:ke,6:"fifo",x:"pax-header",g:"pax-global-header",L:"gnu-long-name",K:"gnu-long-link-name"},tt=new Uint8Array(512),_=new Uint8Array(0),T=new TextEncoder,ze=new TextDecoder;function P(e,t,i,r){r&&T.encodeInto(r,e.subarray(t,t+i))}function L(e,t,i,r){if(r===void 0)return;let n=r.toString(8).padStart(i-1,"0");T.encodeInto(n,e.subarray(t,t+i-1))}function S(e,t,i){let r=e.indexOf(0,t),n=r===-1||r>t+i?t+i:r;return ze.decode(e.subarray(t,n))}function ne(e,t,i){let r=0,n=t+i;for(let s=t;s<n;s++){let a=e[s];if(a===0)break;a!==32&&(r=r*8+(a-48))}return r}function W(e,t,i){if(e[t]&128){let r=0;r=e[t]&127;for(let n=1;n<i;n++)r=r*256+e[t+n];if(!Number.isSafeInteger(r))throw new Error("TAR number too large");return r}return ne(e,t,i)}var N=e=>e.type==="directory"||e.type==="symlink"||e.type==="link"||e.type==="character-device"||e.type==="block-device"||e.type==="fifo";async function Ce(e){if(e==null)return _;if(e instanceof Uint8Array)return e;if(typeof e=="string")return T.encode(e);if(e instanceof ArrayBuffer)return new Uint8Array(e);if(e instanceof Blob)return new Uint8Array(await e.arrayBuffer());throw new TypeError("Unsupported content type for entry body.")}var we=(e,t)=>{let i=e.split("/").filter(Boolean);return t>=i.length?"":i.slice(t).join("/")};function Ae(e,t){let{strip:i,filter:r,map:n}=t;if(!i&&!r&&!n)return e;let s={...e};if(i&&i>0){let o=we(s.name,i);if(!o)return null;if(s.name=s.type==="directory"&&!o.endsWith("/")?`${o}/`:o,s.linkname){let c=s.linkname.startsWith("/");if(c||s.type==="link"){let l=we(s.linkname,i);s.linkname=c?`/${l}`||"/":l}}}if(r?.(s)===!1)return null;let a=n?n(s):s;return a&&(!a.name||!a.name.trim()||a.name==="."||a.name==="/")?null:a}var re=32,rt=48;function nt(e){let t=ne(e,148,8),i=0;for(let r=0;r<e.length;r++)r>=148&&r<156?i+=re:i+=e[r];return t===i}function it(e){e.fill(re,148,156);let t=0;for(let i of e)t+=i;for(let i=153;i>=148;i--)e[i]=(t&7)+rt,t>>=3;e[154]=0,e[155]=re}var st=256;function ot(e){let t={};T.encode(e.name).length>100&&Ee(e.name)===null&&(t.path=e.name),e.linkname&&T.encode(e.linkname).length>100&&(t.linkpath=e.linkname),e.uname&&T.encode(e.uname).length>32&&(t.uname=e.uname),e.gname&&T.encode(e.gname).length>32&&(t.gname=e.gname),e.uid!=null&&e.uid>2097151&&(t.uid=String(e.uid)),e.gid!=null&&e.gid>2097151&&(t.gid=String(e.gid)),e.size!=null&&e.size>8589934591&&(t.size=String(e.size)),e.pax&&Object.assign(t,e.pax);let i=Object.entries(t);if(i.length===0)return null;let r=T.encode(i.map(([n,s])=>{let a=`${n}=${s}
|
|
4
|
-
`,o=T.encode(a).length+1,c=o+String(o).length;return c=o+String(c).length,`${c} ${a}`}).join(""));return{paxHeader:$e({name:ze.decode(T.encode(`PaxHeader/${e.name}`).slice(0,100)),size:r.length,type:"pax-header",mode:420,mtime:e.mtime,uname:e.uname,gname:e.gname,uid:e.uid,gid:e.gid}),paxBody:r}}function Ee(e){let t=T.encode(e).length;if(t<=100||t>st)return null;for(let i=e.length-1;i>0;i--){if(e[i]!=="/")continue;let r=e.slice(0,i),n=e.slice(i+1);if(T.encode(r).length<=155&&T.encode(n).length<=100)return{prefix:r,name:n}}return null}function $e(e){let t=new Uint8Array(512),i=N(e)?0:e.size??0,r=e.name,n="";if(!e.pax?.path){let s=Ee(r);s&&(r=s.name,n=s.prefix)}return P(t,0,100,r),L(t,100,8,e.mode??(e.type==="directory"?493:420)),L(t,108,8,e.uid??0),L(t,116,8,e.gid??0),L(t,124,12,i),L(t,136,12,Math.floor((e.mtime?.getTime()??Date.now())/1e3)),P(t,156,1,Qe[e.type??"file"]),P(t,157,100,e.linkname),P(t,257,6,"ustar\0"),P(t,263,2,"00"),P(t,265,32,e.uname),P(t,297,32,e.gname),P(t,345,155,n),it(t),t}function at(e,t){if(t&&!nt(e))throw new Error("Invalid tar header checksum.");let i=S(e,156,1),r={name:S(e,0,100),mode:ne(e,100,8),uid:W(e,108,8),gid:W(e,116,8),size:W(e,124,12),mtime:new Date(W(e,136,12)*1e3),type:et[i]||"file",linkname:S(e,157,100)},n=S(e,257,6);return N(r)&&(r.size=0),n.trim()==="ustar"&&(r.uname=S(e,265,32),r.gname=S(e,297,32)),n==="ustar"&&(r.prefix=S(e,345,155)),r}var be={path:["name",e=>e],linkpath:["linkname",e=>e],size:["size",e=>parseInt(e,10)],mtime:["mtime",parseFloat],uid:["uid",e=>parseInt(e,10)],gid:["gid",e=>parseInt(e,10)],uname:["uname",e=>e],gname:["gname",e=>e]};function lt(e){let t=new TextDecoder("utf-8"),i=Object.create(null),r=Object.create(null),n=0;for(;n<e.length;){let s=e.indexOf(32,n);if(s===-1)break;let a=parseInt(t.decode(e.subarray(n,s)),10);if(Number.isNaN(a)||a===0)break;let o=n+a,[c,l]=t.decode(e.subarray(s+1,o-1)).split("=",2);if(c&&l!==void 0&&(r[c]=l,Object.hasOwn(be,c))){let[f,u]=be[c],y=u(l);(typeof y=="string"||!Number.isNaN(y))&&(i[f]=y)}n=o}return Object.keys(r).length>0&&(i.pax=r),i}function xe(e,t){t.name!==void 0&&(e.name=t.name),t.linkname!==void 0&&(e.linkname=t.linkname),t.size!==void 0&&(e.size=t.size),t.mtime!==void 0&&(e.mtime=new Date(t.mtime*1e3)),t.uid!==void 0&&(e.uid=t.uid),t.gid!==void 0&&(e.gid=t.gid),t.uname!==void 0&&(e.uname=t.uname),t.gname!==void 0&&(e.gname=t.gname),t.pax&&(e.pax=Object.assign({},e.pax??{},t.pax))}function ct(e){switch(e){case"pax-global-header":case"pax-header":return lt;case"gnu-long-name":return t=>({name:S(t,0,t.length)});case"gnu-long-link-name":return t=>({linkname:S(t,0,t.length)});default:return}}function ft(e){let t=$e(e),i=ot(e);if(!i)return[t];let r=-i.paxBody.length&511,n=r>0?[tt.subarray(0,r)]:[];return[i.paxHeader,i.paxBody,...n,t]}var ut=new Uint8Array(512*2);function Be(e,t,i){let r=null,n=0,s=!1,a=o=>{let c=new Error(o);throw t(c),c};return{add(o){s&&a("No new tar entries after finalize."),r!==null&&a("Previous entry must be completed before adding a new one");let c=N(o)?0:o.size;(!Number.isSafeInteger(c)||c<0)&&a("Invalid tar entry size.");try{let l=ft({...o,size:c});for(let f of l)e(f);r={...o,size:c},n=0}catch(l){t(l)}},write(o){r||a("No active tar entry."),s&&a("Cannot write data after finalize.");let c=n+o.length;c>r.size&&a(`"${r.name}" exceeds given size of ${r.size} bytes.`);try{n=c,e(o)}catch(l){t(l)}},endEntry(){r||a("No active entry to end."),s&&a("Cannot end entry after finalize.");try{n!==r.size&&a(`Size mismatch for "${r.name}".`);let o=-r.size&511;o>0&&e(new Uint8Array(o)),r=null,n=0}catch(o){throw t(o),o}},finalize(){s&&a("Archive has already been finalized"),r!==null&&a("Cannot finalize while an entry is still active");try{e(ut),s=!0,i&&i()}catch(o){t(o)}}}}var j=256;function dt(){let e=new Array(j),t=e.length-1,i=0,r=0,n=0,s=o=>{let c=e[i];o===c.length?(e[i]=_,i=i+1&t):e[i]=c.subarray(o),n-=o,n===0&&e.length>j&&(e=new Array(j),t=j-1,i=0,r=0)};function a(o,c){if(c){let g=0,d=Math.min(o,n);for(;d>0;){let p=e[i],m=Math.min(d,p.length),x=m===p.length?p:p.subarray(0,m);if(s(m),d-=m,g+=m,!c(x))break}return g}if(n<o)return null;if(o===0)return _;let l=e[i];if(l.length>=o){let g=l.length===o?l:l.subarray(0,o);return s(o),g}let f=new Uint8Array(o),u=0,y=o;for(;y>0;){let g=e[i],d=Math.min(y,g.length);f.set(d===g.length?g:g.subarray(0,d),u),u+=d,y-=d,s(d)}return f}return{push:o=>{if(o.length===0)return;let c=r+1&t;if(c===i){let l=e.length,f=l*2,u=new Array(f),y=r-i+l&l-1;if(i<r)for(let g=0;g<y;g++)u[g]=e[i+g];else if(y>0){let g=l-i;for(let d=0;d<g;d++)u[d]=e[i+d];for(let d=0;d<r;d++)u[g+d]=e[d]}e=u,t=f-1,i=0,r=y,c=r+1&t}e[r]=o,r=c,n+=o.length},available:()=>n,peek:o=>{if(n<o)return null;if(o===0)return _;let c=e[i];if(c.length>=o)return c.length===o?c:c.subarray(0,o);let l=new Uint8Array(o),f=0,u=i;for(;f<o;){let y=e[u],g=Math.min(o-f,y.length);g===y.length?l.set(y,f):l.set(y.subarray(0,g),f),f+=g,u=u+1&t}return l},discard:o=>{if(o>n)throw new Error("Too many bytes consumed");if(o===0)return;let c=o;for(;c>0;){let l=e[i],f=Math.min(c,l.length);s(f),c-=f}},pull:a}}var te=0,D=1,H=new Error("Tar archive is truncated.");function Te(e={}){let t=e.strict??!1,{available:i,peek:r,push:n,discard:s,pull:a}=dt(),o=te,c=!1,l=!1,f=!1,u=null,y={},g={},d={isEntryActive:()=>o===D,isBodyComplete:()=>!u||u.remaining===0,canFinish:()=>!u||i()>=u.remaining+u.padding,write(p){if(c)throw new Error("Archive already ended.");n(p)},end(){c=!0},readHeader(){if(o!==te)throw new Error("Cannot read header while an entry is active");if(!l)for(;!l;){if(i()<512){if(c){if(i()>0&&t)throw H;l=!0;return}return null}let p=r(512);if(ve(p)){if(i()<512*2){if(c){if(t)throw H;l=!0;return}return null}if(ve(r(512*2).subarray(512))){s(512*2),l=!0,f=!0;return}if(t)throw new Error("Invalid tar header.");s(512);continue}let m;try{m=at(p,t)}catch(E){if(t)throw E;s(512);continue}let x=ct(m.type);if(x){let E=m.size+(-m.size&511);if(i()<512+E){if(c&&t)throw H;return null}s(512);let v=x(a(E).subarray(0,m.size)),$=m.type==="pax-global-header"?y:g;for(let z in v)$[z]=v[z];continue}s(512);let b=m;return m.prefix&&(b.name=`${m.prefix}/${b.name}`),xe(b,y),xe(b,g),b.name.endsWith("/")&&b.type==="file"&&(b.type=ke),g={},u={header:b,remaining:b.size,padding:-b.size&511},o=D,b}},streamBody(p){if(o!==D||!u||u.remaining===0)return 0;let m=Math.min(u.remaining,i());if(m===0)return 0;let x=a(m,p);return u.remaining-=x,x},skipPadding(){if(o!==D||!u)return!0;if(u.remaining>0)throw new Error("Body not fully consumed");return i()<u.padding?!1:(s(u.padding),u=null,o=te,!0)},skipEntry(){if(o!==D||!u)return!0;let p=Math.min(u.remaining,i());return p>0&&(s(p),u.remaining-=p),u.remaining>0?!1:d.skipPadding()},validateEOF(){if(t){if(!f)throw H;if(i()>0&&a(i()).some(p=>p!==0))throw new Error("Invalid EOF.")}}};return d}function ve(e){if(e.byteOffset%8===0){let t=new BigUint64Array(e.buffer,e.byteOffset,e.length/8);for(let i=0;i<t.length;i++)if(t[i]!==0n)return!1;return!0}for(let t=0;t<e.length;t++)if(e[t]!==0)return!1;return!0}function Fe(){return new CompressionStream("gzip")}function Ie(){return new DecompressionStream("gzip")}function mt(){let e,t;return{readable:new ReadableStream({start(i){e=i,t=Be(i.enqueue.bind(i),i.error.bind(i),i.close.bind(i))}}),controller:{add(i){let r=N(i);return t.add(i),r&&t.endEntry(),new WritableStream({write(n){t.write(n)},close(){r||t.endEntry()},abort(n){e.error(n)}})},finalize(){t.finalize()},error(i){e.error(i)}}}}async function Pe(e){let t=[],i=e.getReader(),r=0;try{for(;;){let{done:a,value:o}=await i.read();if(a)break;t.push(o),r+=o.length}let n=new Uint8Array(r),s=0;for(let a of t)n.set(a,s),s+=a.length;return n}finally{i.releaseLock()}}var Se=e=>e.pipeTo(new WritableStream);function ht(e={}){let t=Te(e),i=e.strict??!1,r=null,n=null,s=!1,a=!1,o=!1,c=!1,l=()=>{try{n?.close()}catch{}n=null},f=d=>{if(!c){c=!0;try{n?.error(d)}catch{}n=null;try{r.error(d)}catch{}r=null}},u=()=>{if(!c){c=!0,l();try{r.close()}catch{}r=null}},y=()=>{if(i)throw new Error("Tar archive is truncated.");u()},g=()=>{if(!(s||c||!r)){s=!0;try{for(;;){if(a){o&&(t.validateEOF(),u());break}if(t.isEntryActive()){if(o&&!t.canFinish()){y();break}if(n){if((n.desiredSize??1)<=0)break;if(t.streamBody(d=>(n.enqueue(d),(n.desiredSize??1)>0))===0&&!t.isBodyComplete()){o&&y();break}}else if(!t.skipEntry()){o&&y();break}if(t.isBodyComplete()&&(l(),!t.skipPadding())){o&&y();break}}else{if((r.desiredSize??0)<0)break;let d=t.readHeader();if(d===null){o&&u();break}if(d===void 0){if(o){t.validateEOF(),u();break}a=!0;break}r.enqueue({header:d,body:new ReadableStream({start(p){d.size===0?p.close():n=p},pull:g,cancel(){n=null,g()}})})}}}catch(d){throw f(d),d}finally{s=!1}}};return{readable:new ReadableStream({start(d){r=d},pull:g,cancel(d){d!==void 0?f(d):u()}},{highWaterMark:2}),writable:new WritableStream({write(d){try{if(a&&i&&d.some(p=>p!==0))throw new Error("Invalid EOF.");t.write(d),g()}catch(p){throw f(p),p}},close(){try{o=!0,t.end(),g()}catch(d){throw f(d),d}},abort(d){f(d)}})}}async function Oe(e){let{readable:t,controller:i}=mt();return await(async()=>{for(let r of e){let n=i.add(r.header),s="body"in r?r.body:r.data;if(!s){await n.close();continue}if(s instanceof ReadableStream)await s.pipeTo(n);else if(s instanceof Blob)await s.stream().pipeTo(n);else try{let a=await Ce(s);if(a.length>0){let o=n.getWriter();await o.write(a),await o.close()}else await n.close()}catch{throw new TypeError(`Unsupported content type for entry "${r.header.name}".`)}}})().then(()=>i.finalize()).catch(r=>i.error(r)),new Uint8Array(await Pe(t))}async function Ue(e,t={}){let i=e instanceof ReadableStream?e:new ReadableStream({start(s){s.enqueue(e instanceof Uint8Array?e:new Uint8Array(e)),s.close()}}),r=[],n=i.pipeThrough(ht(t));for await(let s of n){let a;try{a=Ae(s.header,t)}catch(o){throw await s.body.cancel(),o}if(a===null){await Se(s.body);continue}N(a)?(await Se(s.body),r.push({header:a})):r.push({header:a,data:await Pe(s.body)})}return r}import At from"seek-bzip";var pt=(()=>{let e=new Uint32Array(256);for(let t=0;t<256;t++){let i=t<<24;for(let r=0;r<8;r++)i=i&2147483648?i<<1^79764919:i<<1;e[t]=i>>>0}return e})();function gt(e,t){return(e<<8^pt[(e>>>24^t)&255])>>>0}var ie=class{buffer=[];current=0;bitCount=0;writeBits(t,i){for(let r=t-1;r>=0;r--)this.current=this.current<<1|i>>>r&1,this.bitCount++,this.bitCount===8&&(this.buffer.push(this.current),this.current=0,this.bitCount=0)}writeBit(t){this.current=this.current<<1|t&1,this.bitCount++,this.bitCount===8&&(this.buffer.push(this.current),this.current=0,this.bitCount=0)}finish(){return this.bitCount>0&&this.buffer.push(this.current<<8-this.bitCount),new Uint8Array(this.buffer)}};function yt(e){let t=[],i=0;for(;i<e.length;){let r=e[i],n=1;for(;i+n<e.length&&e[i+n]===r&&n<255;)n++;n>=4?(t.push(r,r,r,r),t.push(n-4),i+=n):(t.push(r),i++)}return new Uint8Array(t)}function wt(e){let t=e.length;if(t===0)return{transformed:new Uint8Array(0),pointer:0};let i=bt(e),r=new Uint8Array(t),n=0;for(let s=0;s<t;s++)i[s]===0?(n=s,r[s]=e[t-1]):r[s]=e[i[s]-1];return{transformed:r,pointer:n}}function bt(e){let t=e.length,i=new Int32Array(t),r=new Int32Array(t);for(let n=0;n<t;n++)i[n]=n,r[n]=e[n];for(let n=1;n<t;n*=2){let s=r.slice();i.sort((a,o)=>s[a]!==s[o]?s[a]-s[o]:s[(a+n)%t]-s[(o+n)%t]),r[i[0]]=0;for(let a=1;a<t;a++)s[i[a]]===s[i[a-1]]&&s[(i[a]+n)%t]===s[(i[a-1]+n)%t]?r[i[a]]=r[i[a-1]]:r[i[a]]=r[i[a-1]]+1;if(r[i[t-1]]===t-1)break}return i}function xt(e,t){let i=[];for(let a=0;a<256;a++)t[a]&&i.push(a);let r=new Array(256).fill(-1);for(let a=0;a<i.length;a++)r[i[a]]=a;let n=new Uint16Array(e.length),s=i.slice();for(let a=0;a<e.length;a++){let o=e[a],c=0;for(;s[c]!==o;)c++;if(n[a]=c,c>0){let l=s[c];for(let f=c;f>0;f--)s[f]=s[f-1];s[0]=l}}return{encoded:n,length:e.length}}function vt(e,t,i){let s=i+1,a=[],o=0;for(;o<t;)if(e[o]===0){let l=0;for(;o<t&&e[o]===0;)l++,o++;let f=l;for(;f>0;)f--,f&1?a.push(1):a.push(0),f>>>=1}else a.push(e[o]+1),o++;a.push(s);let c=new Uint16Array(a.length);for(let l=0;l<a.length;l++)c[l]=a[l];return{symbols:c,length:a.length,eob:s}}function Ne(e,t,i){if(t<=1){let l=new Array(e.length).fill(0);for(let f=0;f<e.length;f++)e[f]>0&&(l[f]=1);return{codeLengths:l,maxLen:1,minLen:1}}let r=[];for(let l=0;l<e.length;l++)e[l]>0&&r.push({freq:e[l],symbol:l,left:null,right:null});if(r.length===0)return{codeLengths:new Array(e.length).fill(0),maxLen:0,minLen:0};if(r.length===1){let l=new Array(e.length).fill(0);return l[r[0].symbol]=1,{codeLengths:l,maxLen:1,minLen:1}}for(;r.length>1;){r.sort((u,y)=>u.freq-y.freq);let l=r.shift(),f=r.shift();r.push({freq:l.freq+f.freq,symbol:-1,left:l,right:f})}let n=new Array(e.length).fill(0);function s(l,f){if(!l.left&&!l.right){n[l.symbol]=f;return}l.left&&s(l.left,f+1),l.right&&s(l.right,f+1)}s(r[0],0);let a=!0;for(;a;){a=!1;for(let l=0;l<n.length;l++)n[l]>i&&(n[l]=i,a=!0);if(a){let l=0;for(let f=0;f<n.length;f++)n[f]>0&&(l+=1/(1<<n[f]));if(l>1)for(let f=1;f<i&&l>1;f++)for(let u=0;u<n.length&&l>1;u++)n[u]===f&&(n[u]++,l-=1/(1<<f)-1/(1<<f+1));a=!1;for(let f=0;f<n.length;f++)if(n[f]>i){a=!0;break}}}let o=i,c=0;for(let l=0;l<n.length;l++)n[l]>0&&(n[l]<o&&(o=n[l]),n[l]>c&&(c=n[l]));return{codeLengths:n,maxLen:c,minLen:o}}function kt(e,t){let i=new Array(t).fill(0),r=e.slice(0,t),n=Math.max(...r,0),s=new Array(n+1).fill(0);for(let c=0;c<t;c++)r[c]>0&&s[r[c]]++;let a=new Array(n+1).fill(0),o=0;for(let c=1;c<=n;c++)o=o+s[c-1]<<1,a[c]=o;for(let c=0;c<t;c++)r[c]>0&&(i[c]=a[r[c]]++);return{codes:i,lengths:r}}function zt(e,t,i){e.writeBits(24,3227993),e.writeBits(24,2511705),e.writeBits(32,i),e.writeBit(0);let r=yt(t),{transformed:n,pointer:s}=wt(r);e.writeBits(24,s);let a=new Array(256).fill(!1);for(let h=0;h<n.length;h++)a[n[h]]=!0;let o=new Array(16).fill(!1);for(let h=0;h<16;h++)for(let w=0;w<16;w++)if(a[h*16+w]){o[h]=!0;break}for(let h=0;h<16;h++)e.writeBit(o[h]?1:0);for(let h=0;h<16;h++)if(o[h])for(let w=0;w<16;w++)e.writeBit(a[h*16+w]?1:0);let c=0;for(let h=0;h<256;h++)a[h]&&c++;let{encoded:l,length:f}=xt(n,a),{symbols:u,length:y}=vt(l,f,c),g=c+2,d=50,p=Math.ceil(y/d),m;y<200?m=2:y<600?m=3:y<1200?m=4:y<2400?m=5:m=6,m>p&&(m=Math.max(2,p));let x=[];for(let h=0;h<m;h++)x.push(new Array(g).fill(0));let b=new Int32Array(p);for(let h=0;h<p;h++)b[h]=h%m;for(let h=0;h<p;h++){let w=h*d,k=Math.min(w+d,y),B=b[h];for(let C=w;C<k;C++)x[B][u[C]]++}function E(h){for(let w=0;w<g;w++)h[w]<1&&(h[w]=1)}let v=[];for(let h=0;h<m;h++)E(x[h]),v.push(Ne(x[h],g,20));for(let h=0;h<4;h++){for(let w=0;w<m;w++)x[w].fill(0);for(let w=0;w<p;w++){let k=w*d,B=Math.min(k+d,y),C=0,M=1/0;for(let I=0;I<m;I++){let J=0;for(let V=k;V<B;V++)J+=v[I].codeLengths[u[V]]||20;J<M&&(M=J,C=I)}b[w]=C;for(let I=k;I<B;I++)x[C][u[I]]++}for(let w=0;w<m;w++)E(x[w]),v[w]=Ne(x[w],g,20)}e.writeBits(3,m),e.writeBits(15,p);let $=[],z=[];for(let h=0;h<m;h++)z.push(h);for(let h=0;h<p;h++){let w=b[h],k=0;for(;z[k]!==w;)k++;if($.push(k),k>0){let B=z[k];for(let C=k;C>0;C--)z[C]=z[C-1];z[0]=B}}for(let h=0;h<p;h++){for(let w=0;w<$[h];w++)e.writeBit(1);e.writeBit(0)}for(let h=0;h<m;h++){let w=v[h].codeLengths,k=w[0];e.writeBits(5,k);for(let B=0;B<g;B++){let C=w[B];for(;k<C;)e.writeBit(1),e.writeBit(0),k++;for(;k>C;)e.writeBit(1),e.writeBit(1),k--;e.writeBit(0)}}for(let h=0;h<m;h++){let{codes:w,lengths:k}=kt(v[h].codeLengths,g);v[h]=Object.assign(v[h],{_codes:w,_lengths:k})}let he=0,R=0;for(let h=0;h<y;h++){(R===0||R>=d)&&(h>0&&he++,R=0);let w=b[he],k=v[w],B=u[h],C=k._lengths[B],M=k._codes[B];C>0&&e.writeBits(C,M),R++}}var Ct=10*1024*1024;function Le(e,t=9,i=Ct){if(t<1||t>9)throw new Error("Block size level must be 1-9");if(e.length>i)throw new Error(`Input too large for bzip2 compression (${e.length} bytes, max ${i})`);let r=t*1e5,n=new ie;n.writeBits(8,66),n.writeBits(8,90),n.writeBits(8,104),n.writeBits(8,48+t);let s=0,a=0;for(;a<e.length;){let o=Math.min(a+r,e.length),c=e.subarray(a,o),l=4294967295;for(let f=0;f<c.length;f++)l=gt(l,c[f]);l=~l>>>0,s=(s<<1|s>>>31)>>>0,s=(s^l)>>>0,zt(n,c,l),a=o}return n.writeBits(24,1536581),n.writeBits(24,3690640),n.writeBits(32,s),n.finish()}var X=null,Z=null;async function Me(){if(X)return X;if(Z)throw Z;try{return X=await Q.runTrustedAsync(()=>import("node-liblzma")),X}catch{throw Z=new Error("xz compression requires node-liblzma which failed to load. Install liblzma-dev (apt) or xz (brew) and reinstall dependencies."),Z}}var G=null,q=null;async function We(){if(G)return G;if(q)throw q;try{return G=await Q.runTrustedAsync(()=>import("@mongodb-js/zstd")),G}catch{throw q=new Error("zstd compression requires @mongodb-js/zstd which is not installed. Install it with: npm install @mongodb-js/zstd"),q}}var A=100*1024*1024,De=512,Re=1e4;function Et(e){let t="file";e.isDirectory?t="directory":e.isSymlink&&(t="symlink");let i=e.name;e.isDirectory&&!i.endsWith("/")&&(i+="/");let r;e.content!==void 0&&(typeof e.content=="string"?r=new TextEncoder().encode(e.content):r=e.content);let n=e.isDirectory||e.isSymlink?0:r?.length??0;return{header:{name:i,mode:e.mode??(e.isDirectory?493:420),uid:e.uid??0,gid:e.gid??0,size:n,mtime:e.mtime??new Date,type:t,linkname:e.linkTarget??"",uname:"user",gname:"user"},body:r}}async function O(e){let t=e.map(Et);return Oe(t)}async function je(e){let t=await O(e),n=new ReadableStream({start(l){l.enqueue(t),l.close()}}).pipeThrough(Fe()).getReader(),s=[];for(;;){let{done:l,value:f}=await n.read();if(l)break;s.push(f)}let a=s.reduce((l,f)=>l+f.length,0),o=new Uint8Array(a),c=0;for(let l of s)o.set(l,c),c+=l.length;return o}async function F(e){if(e.length>A)return{entries:[],error:`Archive too large (max ${A} bytes)`};if(e.length<De||e.length%De!==0)return{entries:[],error:"Invalid tar archive format"};try{let t=await Ue(e),i=[];for(let r of t){if(i.length>=Re)return{entries:i,error:`Too many entries (max ${Re})`};let n="file";switch(r.header.type){case"directory":n="directory";break;case"symlink":n="symlink";break;case"link":n="hardlink";break;case"file":n="file";break;default:n="other"}i.push({name:r.header.name,mode:r.header.mode??420,uid:r.header.uid??0,gid:r.header.gid??0,size:r.header.size,mtime:r.header.mtime??new Date,type:n,linkTarget:r.header.linkname||void 0,content:r.data??new Uint8Array(0)})}return{entries:i}}catch(t){let i=t instanceof Error?t.message:"Unknown error";return{entries:[],error:i}}}async function se(e){if(e.length>A)return{entries:[],error:`Archive too large (max ${A} bytes)`};try{let r=new ReadableStream({start(c){c.enqueue(e),c.close()}}).pipeThrough(Ie()).getReader(),n=[],s=0;for(;;){let{done:c,value:l}=await r.read();if(c)break;if(s+=l.length,s>A)return await r.cancel(),{entries:[],error:`Decompressed archive too large (max ${A} bytes)`};n.push(l)}let a=new Uint8Array(s),o=0;for(let c of n)a.set(c,o),o+=c.length;return F(a)}catch(t){let i=t instanceof Error?t.message:"Unknown error";return{entries:[],error:`Decompression failed: ${i}`}}}function oe(e){return e.length>=2&&e[0]===31&&e[1]===139}function ae(e){return e.length>=3&&e[0]===66&&e[1]===90&&e[2]===104}function le(e){return e.length>=6&&e[0]===253&&e[1]===55&&e[2]===122&&e[3]===88&&e[4]===90&&e[5]===0}async function $t(e){let t=At.decode(Buffer.from(e));return new Uint8Array(t)}async function Bt(e){return Le(e,9)}async function Tt(e){let i=(await Me()).unxzSync(Buffer.from(e));return new Uint8Array(i)}async function St(e){let i=(await Me()).xzSync(Buffer.from(e));return new Uint8Array(i)}async function He(e){let t=await O(e);return Bt(t)}async function _e(e,t){if(!t?.allowNativeCodecs)throw new Error("xz compression is disabled by default (native codec risk). Pass { allowNativeCodecs: true } to opt in.");let i=await O(e);return St(i)}async function ce(e){if(e.length>A)return{entries:[],error:`Archive too large (max ${A} bytes)`};try{let t=await $t(e);return t.length>A?{entries:[],error:`Decompressed archive too large (max ${A} bytes)`}:F(t)}catch(t){let i=t instanceof Error?t.message:"Unknown error";return{entries:[],error:i}}}async function fe(e,t){if(!t?.allowNativeCodecs)return{entries:[],error:"xz decompression is disabled by default (native codec risk). Pass { allowNativeCodecs: true } to opt in, or decompress the archive externally before extraction."};if(e.length>A)return{entries:[],error:`Archive too large (max ${A} bytes)`};try{let i=await Tt(e);return i.length>A?{entries:[],error:`Decompressed archive too large (max ${A} bytes)`}:F(i)}catch(i){let r=i instanceof Error?i.message:"Unknown error";return{entries:[],error:r}}}function ue(e){return e.length>=4&&e[0]===40&&e[1]===181&&e[2]===47&&e[3]===253}async function Ft(e){let i=await(await We()).compress(Buffer.from(e),3);return new Uint8Array(i)}async function It(e){let i=await(await We()).decompress(Buffer.from(e));return new Uint8Array(i)}async function Xe(e,t){if(!t?.allowNativeCodecs)throw new Error("zstd compression is disabled by default (native codec risk). Pass { allowNativeCodecs: true } to opt in.");let i=await O(e);return Ft(i)}async function de(e,t){if(!t?.allowNativeCodecs)return{entries:[],error:"zstd decompression is disabled by default (native codec risk). Pass { allowNativeCodecs: true } to opt in, or decompress the archive externally before extraction."};if(e.length>A)return{entries:[],error:`Archive too large (max ${A} bytes)`};try{let i=await It(e);return i.length>A?{entries:[],error:`Decompressed archive too large (max ${A} bytes)`}:F(i)}catch(i){let r=i instanceof Error?i.message:"Unknown error";return{entries:[],error:r}}}function Ze(e){let t={create:!1,append:!1,update:!1,extract:!1,list:!1,file:"",autoCompress:!1,gzip:!1,bzip2:!1,xz:!1,zstd:!1,verbose:!1,toStdout:!1,keepOldFiles:!1,touch:!1,directory:"",preserve:!1,absoluteNames:!1,strip:0,exclude:[],filesFrom:"",excludeFrom:"",wildcards:!1},i=[],r=0;for(;r<e.length;){let n=e[r];if(n.startsWith("-")&&!n.startsWith("--")&&n.length>2){if(/^-\d+$/.test(n)){i.push(n),r++;continue}for(let s=1;s<n.length;s++){let a=n[s];switch(a){case"c":t.create=!0;break;case"r":t.append=!0;break;case"u":t.update=!0;break;case"x":t.extract=!0;break;case"t":t.list=!0;break;case"a":t.autoCompress=!0;break;case"z":t.gzip=!0;break;case"j":t.bzip2=!0;break;case"J":t.xz=!0;break;case"v":t.verbose=!0;break;case"O":t.toStdout=!0;break;case"k":t.keepOldFiles=!0;break;case"m":t.touch=!0;break;case"p":t.preserve=!0;break;case"P":t.absoluteNames=!0;break;case"f":if(s<n.length-1)t.file=n.substring(s+1),s=n.length;else{if(r++,r>=e.length)return{ok:!1,error:{stdout:"",stderr:`tar: option requires an argument -- 'f'
|
|
5
|
-
`,exitCode:2}};t.file=e[r]}break;case"C":if(s<n.length-1)t.directory=n.substring(s+1),s=n.length;else{if(r++,r>=e.length)return{ok:!1,error:{stdout:"",stderr:`tar: option requires an argument -- 'C'
|
|
6
|
-
`,exitCode:2}};t.directory=e[r]}break;case"T":if(s<n.length-1)t.filesFrom=n.substring(s+1),s=n.length;else{if(r++,r>=e.length)return{ok:!1,error:{stdout:"",stderr:`tar: option requires an argument -- 'T'
|
|
7
|
-
`,exitCode:2}};t.filesFrom=e[r]}break;case"X":if(s<n.length-1)t.excludeFrom=n.substring(s+1),s=n.length;else{if(r++,r>=e.length)return{ok:!1,error:{stdout:"",stderr:`tar: option requires an argument -- 'X'
|
|
8
|
-
`,exitCode:2}};t.excludeFrom=e[r]}break;default:return{ok:!1,error:ee("tar",`-${a}`)}}}r++;continue}if(n==="-c"||n==="--create")t.create=!0;else if(n==="-r"||n==="--append")t.append=!0;else if(n==="-u"||n==="--update")t.update=!0;else if(n==="-x"||n==="--extract"||n==="--get")t.extract=!0;else if(n==="-t"||n==="--list")t.list=!0;else if(n==="-a"||n==="--auto-compress")t.autoCompress=!0;else if(n==="-z"||n==="--gzip"||n==="--gunzip")t.gzip=!0;else if(n==="-j"||n==="--bzip2")t.bzip2=!0;else if(n==="-J"||n==="--xz")t.xz=!0;else if(n==="--zstd")t.zstd=!0;else if(n==="-v"||n==="--verbose")t.verbose=!0;else if(n==="-O"||n==="--to-stdout")t.toStdout=!0;else if(n==="-k"||n==="--keep-old-files")t.keepOldFiles=!0;else if(n==="-m"||n==="--touch")t.touch=!0;else if(n==="--wildcards")t.wildcards=!0;else if(n==="-p"||n==="--preserve"||n==="--preserve-permissions")t.preserve=!0;else if(n==="-P"||n==="--absolute-names")t.absoluteNames=!0;else if(n==="-f"||n==="--file"){if(r++,r>=e.length)return{ok:!1,error:{stdout:"",stderr:`tar: option requires an argument -- 'f'
|
|
9
|
-
`,exitCode:2}};t.file=e[r]}else if(n.startsWith("--file="))t.file=n.substring(7);else if(n==="-C"||n==="--directory"){if(r++,r>=e.length)return{ok:!1,error:{stdout:"",stderr:`tar: option requires an argument -- 'C'
|
|
10
|
-
`,exitCode:2}};t.directory=e[r]}else if(n.startsWith("--directory="))t.directory=n.substring(12);else if(n.startsWith("--strip-components=")||n.startsWith("--strip=")){let s=n.includes("--strip-components=")?n.substring(19):n.substring(8),a=parseInt(s,10);if(Number.isNaN(a)||a<0)return{ok:!1,error:{stdout:"",stderr:`tar: invalid number for --strip: '${s}'
|
|
11
|
-
`,exitCode:2}};t.strip=a}else if(n.startsWith("--exclude="))t.exclude.push(n.substring(10));else if(n==="--exclude"){if(r++,r>=e.length)return{ok:!1,error:{stdout:"",stderr:`tar: option '--exclude' requires an argument
|
|
12
|
-
`,exitCode:2}};t.exclude.push(e[r])}else if(n==="-T"||n==="--files-from"){if(r++,r>=e.length)return{ok:!1,error:{stdout:"",stderr:`tar: option requires an argument -- 'T'
|
|
13
|
-
`,exitCode:2}};t.filesFrom=e[r]}else if(n.startsWith("--files-from="))t.filesFrom=n.substring(13);else if(n==="-X"||n==="--exclude-from"){if(r++,r>=e.length)return{ok:!1,error:{stdout:"",stderr:`tar: option requires an argument -- 'X'
|
|
14
|
-
`,exitCode:2}};t.excludeFrom=e[r]}else if(n.startsWith("--exclude-from="))t.excludeFrom=n.substring(15);else if(n==="--"){i.push(...e.slice(r+1));break}else{if(n.startsWith("-"))return{ok:!1,error:ee("tar",n)};i.push(n)}r++}return{ok:!0,options:t,files:i}}var Ge=100,Pt={name:"tar",summary:"manipulate tape archives",usage:"tar [options] [file...]",description:["Create, extract, or list contents of tar archives.","","One of -c, -r, -u, -x, or -t is required to specify the operation."],options:["-c, --create create a new archive","-r, --append append files to the end of an archive","-u, --update only append files newer than copy in archive","-x, --extract extract files from an archive","-t, --list list contents of an archive","-f, --file=ARCHIVE use archive file ARCHIVE","-a, --auto-compress use archive suffix to determine compression","-z, --gzip filter archive through gzip","-j, --bzip2 filter archive through bzip2","-J, --xz filter archive through xz","--zstd filter archive through zstd","-v, --verbose verbosely list files processed","-O, --to-stdout extract files to standard output","-k, --keep-old-files don't replace existing files when extracting","-m, --touch don't extract file modified time","-C, --directory=DIR change to directory DIR before performing operations","-p, --preserve preserve permissions","-P, --absolute-names do not strip leading '/' or block '..' paths","-T, --files-from=FILE read files to extract/create from FILE","-X, --exclude-from=FILE read exclude patterns from FILE","--strip=N strip N leading path components on extraction","--exclude=PATTERN exclude files matching PATTERN","--wildcards use wildcards for pattern matching"," --help display this help and exit"],examples:["tar -cvf archive.tar file1 file2 Create archive from files","tar -czvf archive.tar.gz dir/ Create gzip-compressed archive","tar -cjvf archive.tar.bz2 dir/ Create bzip2-compressed archive","tar -rf archive.tar newfile.txt Append file to archive","tar -uf archive.tar dir/ Update archive with newer files","tar -xvf archive.tar Extract archive","tar -xvf archive.tar -C /tmp Extract to /tmp","tar -tvf archive.tar List archive contents","tar -xzf archive.tar.gz Extract gzip archive","tar -xf archive.tar file1.txt Extract specific file","tar -xOf archive.tar file.txt Extract file to stdout","tar -xf archive.tar --wildcards '*.txt' Extract matching files"]};function me(e,t){let i=e.includes("/")?e.substring(e.lastIndexOf("/")+1):e;for(let r of t){let n=r.replace(/[.+^${}()|[\]\\]/g,"\\$&").replace(/\*\*/g,"<<<GLOBSTAR>>>").replace(/\*/g,"[^/]*").replace(/<<<GLOBSTAR>>>/g,".*").replace(/\?/g,".");if(U(`^${n}$`).test(e)||U(`^${n}/`).test(e)||!r.includes("/")&&U(`^${n}$`).test(i))return!0}return!1}function Y(e,t){let i=t.replace(/[.+^${}()|[\]\\]/g,"\\$&").replace(/\*\*/g,"<<<GLOBSTAR>>>").replace(/\*/g,"[^/]*").replace(/<<<GLOBSTAR>>>/g,".*").replace(/\?/g,"."),r=e.includes("/")?e.substring(e.lastIndexOf("/")+1):e;return U(`^${i}$`).test(e)||U(`^${i}$`).test(r)}function qe(e,t){if(t<=0)return e;let i=e.split("/").filter(r=>r!=="");return i.length<=t?"":i.slice(t).join("/")}function Ye(e){return e.split("/").some(t=>t==="..")}function Ot(e,t){if(t)return{safePath:e};let i=e.replace(/^\/+/,"");return i.length===0?{safePath:""}:Ye(i)?{error:"Path contains '..'"}:{safePath:i}}function Ut(e){let i=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"][e.getMonth()],r=e.getDate().toString().padStart(2," "),n=e.getHours().toString().padStart(2,"0"),s=e.getMinutes().toString().padStart(2,"0");return`${i} ${r} ${n}:${s}`}async function K(e,t,i,r){let n=[],s=[],a=e.fs.resolvePath(t,i);try{let o=await e.fs.stat(a);if(me(i,r))return{entries:n,errors:s};if(o.isDirectory){n.push({name:i,isDirectory:!0,mode:o.mode,mtime:o.mtime});let c=await e.fs.readdir(a);for(let l=0;l<c.length;l+=Ge){let f=c.slice(l,l+Ge),u=await Promise.all(f.map(y=>K(e,t,i?`${i}/${y}`:y,r)));for(let y of u)n.push(...y.entries),s.push(...y.errors)}}else if(o.isFile){let c=await e.fs.readFileBuffer(a);n.push({name:i,content:c,mode:o.mode,mtime:o.mtime})}else if(o.isSymbolicLink){let c=await e.fs.readlink(a);n.push({name:i,isSymlink:!0,linkTarget:c,mode:o.mode,mtime:o.mtime})}}catch(o){let c=o instanceof Error?o.message:"unknown error";s.push(`tar: ${i}: ${c}`)}return{entries:n,errors:s}}async function Nt(e,t,i){if(i.length===0)return{stdout:"",stderr:`tar: Cowardly refusing to create an empty archive
|
|
15
|
-
`,exitCode:2};let r=t.directory?e.fs.resolvePath(e.cwd,t.directory):e.cwd,n=[],s=[],a="";for(let f of i){let{entries:u,errors:y}=await K(e,r,f,t.exclude);if(n.push(...u),s.push(...y),t.verbose)for(let g of u)a+=`${g.name}${g.isDirectory?"/":""}
|
|
16
|
-
`}if(n.length===0&&s.length>0)return{stdout:"",stderr:`${s.join(`
|
|
17
|
-
`)}
|
|
18
|
-
`,exitCode:2};let o;try{t.gzip?o=await je(n):t.bzip2?o=await He(n):t.xz?o=await _e(n):t.zstd?o=await Xe(n):o=await O(n)}catch(f){return{stdout:"",stderr:`tar: error creating archive: ${f instanceof Error?f.message:"unknown error"}
|
|
19
|
-
`,exitCode:2}}let c="";if(t.file&&t.file!=="-"){let f=e.fs.resolvePath(e.cwd,t.file);try{await e.fs.writeFile(f,o)}catch(u){let y=u instanceof Error?u.message:"unknown error";return{stdout:"",stderr:`tar: ${t.file}: ${y}
|
|
20
|
-
`,exitCode:2}}}else c=Buffer.from(o).toString("latin1");let l=a;return s.length>0&&(l+=`${s.join(`
|
|
21
|
-
`)}
|
|
22
|
-
`),{stdout:c,stderr:l,exitCode:s.length>0?2:0,stdoutKind:c.length>0?"bytes":"text"}}async function Lt(e,t,i){if(!t.file||t.file==="-")return{stdout:"",stderr:`tar: Cannot append to stdin/stdout
|
|
23
|
-
`,exitCode:2};if(i.length===0)return{stdout:"",stderr:`tar: Cowardly refusing to append nothing to archive
|
|
24
|
-
`,exitCode:2};let r=e.fs.resolvePath(e.cwd,t.file),n;try{n=await e.fs.readFileBuffer(r)}catch{return{stdout:"",stderr:`tar: ${t.file}: Cannot open: No such file or directory
|
|
25
|
-
`,exitCode:2}}let s=await F(n);if(s.error)return{stdout:"",stderr:`tar: ${s.error}
|
|
26
|
-
`,exitCode:2};let a=s.entries.map(d=>({name:d.name,content:d.content,mode:d.mode,mtime:d.mtime,isDirectory:d.type==="directory",isSymlink:d.type==="symlink",linkTarget:d.linkTarget,uid:d.uid,gid:d.gid})),o=t.directory?e.fs.resolvePath(e.cwd,t.directory):e.cwd,c=[],l=[],f="";for(let d of i){let{entries:p,errors:m}=await K(e,o,d,t.exclude);if(c.push(...p),l.push(...m),t.verbose)for(let x of p)f+=`${x.name}${x.isDirectory?"/":""}
|
|
27
|
-
`}let u=[...a,...c],y;try{y=await O(u)}catch(d){return{stdout:"",stderr:`tar: error creating archive: ${d instanceof Error?d.message:"unknown error"}
|
|
28
|
-
`,exitCode:2}}try{await e.fs.writeFile(r,y)}catch(d){let p=d instanceof Error?d.message:"unknown error";return{stdout:"",stderr:`tar: ${t.file}: ${p}
|
|
29
|
-
`,exitCode:2}}let g=f;return l.length>0&&(g+=`${l.join(`
|
|
30
|
-
`)}
|
|
31
|
-
`),{stdout:"",stderr:g,exitCode:l.length>0?2:0}}async function Dt(e,t,i){if(!t.file||t.file==="-")return{stdout:"",stderr:`tar: Cannot update stdin/stdout
|
|
32
|
-
`,exitCode:2};if(i.length===0)return{stdout:"",stderr:`tar: Cowardly refusing to update with nothing
|
|
33
|
-
`,exitCode:2};let r=e.fs.resolvePath(e.cwd,t.file),n;try{n=await e.fs.readFileBuffer(r)}catch{return{stdout:"",stderr:`tar: ${t.file}: Cannot open: No such file or directory
|
|
34
|
-
`,exitCode:2}}let s=await F(n);if(s.error)return{stdout:"",stderr:`tar: ${s.error}
|
|
35
|
-
`,exitCode:2};let a=new Map;for(let m of s.entries)a.set(m.name,m.mtime);let o=t.directory?e.fs.resolvePath(e.cwd,t.directory):e.cwd,c=[],l=[],f="";for(let m of i){let{entries:x,errors:b}=await K(e,o,m,t.exclude);l.push(...b);for(let E of x){let v=a.get(E.name);(!v||E.mtime&&E.mtime.getTime()>v.getTime())&&(c.push(E),t.verbose&&(f+=`${E.name}${E.isDirectory?"/":""}
|
|
36
|
-
`))}}if(c.length===0){let m="";return l.length>0&&(m=`${l.join(`
|
|
37
|
-
`)}
|
|
38
|
-
`),{stdout:"",stderr:m,exitCode:l.length>0?2:0}}let u=new Set(c.map(m=>m.name)),g=[...s.entries.filter(m=>!u.has(m.name)).map(m=>({name:m.name,content:m.content,mode:m.mode,mtime:m.mtime,isDirectory:m.type==="directory",isSymlink:m.type==="symlink",linkTarget:m.linkTarget,uid:m.uid,gid:m.gid})),...c],d;try{d=await O(g)}catch(m){return{stdout:"",stderr:`tar: error creating archive: ${m instanceof Error?m.message:"unknown error"}
|
|
39
|
-
`,exitCode:2}}try{await e.fs.writeFile(r,d)}catch(m){let x=m instanceof Error?m.message:"unknown error";return{stdout:"",stderr:`tar: ${t.file}: ${x}
|
|
40
|
-
`,exitCode:2}}let p=f;return l.length>0&&(p+=`${l.join(`
|
|
41
|
-
`)}
|
|
42
|
-
`),{stdout:"",stderr:p,exitCode:l.length>0?2:0}}async function Rt(e,t,i){let r;if(t.file&&t.file!=="-"){let p=e.fs.resolvePath(e.cwd,t.file);try{r=await e.fs.readFileBuffer(p)}catch{return{stdout:"",stderr:`tar: ${t.file}: Cannot open: No such file or directory
|
|
43
|
-
`,exitCode:2}}}else r=Uint8Array.from(e.stdin,p=>p.charCodeAt(0));let n,s=t.gzip||oe(r),a=t.bzip2||ae(r),o=t.xz||le(r),c=t.zstd||ue(r);if(s?n=await se(r):a?n=await ce(r):o?n=await fe(r):c?n=await de(r):n=await F(r),n.error)return{stdout:"",stderr:`tar: ${n.error}
|
|
44
|
-
`,exitCode:2};let l=t.directory?e.fs.resolvePath(e.cwd,t.directory):e.cwd,f=t.absoluteNames?i:i.map(p=>p.replace(/^\/+/,"")).filter(p=>p.length>0),u="",y="",g=[];if(t.directory&&!t.toStdout)try{await e.fs.mkdir(l,{recursive:!0})}catch{}for(let p of n.entries){let m=qe(p.name,t.strip);if(!m)continue;let x=Ot(m,t.absoluteNames);if(x.error){g.push(`tar: ${m}: ${x.error}`);continue}let b=x.safePath??"";if(!b)continue;let E=b.endsWith("/")?b.slice(0,-1):b;if(f.length>0){let $;if(t.wildcards?$=f.some(z=>Y(b,z)||Y(E,z)||b.startsWith(`${z}/`)):$=f.some(z=>b===z||b.startsWith(`${z}/`)||E===z),!$)continue}if(me(b,t.exclude))continue;let v=e.fs.resolvePath(l,b);try{if(p.type==="directory"){if(t.toStdout)continue;await e.fs.mkdir(v,{recursive:!0}),t.verbose&&(u+=`${b}
|
|
45
|
-
`)}else if(p.type==="file"){if(t.toStdout){y+=new TextDecoder().decode(p.content),t.verbose&&(u+=`${b}
|
|
46
|
-
`);continue}if(t.keepOldFiles)try{await e.fs.stat(v),t.verbose&&(u+=`${b}: not overwritten, file exists
|
|
47
|
-
`);continue}catch{}let $=v.substring(0,v.lastIndexOf("/"));if($)try{await e.fs.mkdir($,{recursive:!0})}catch{}if(await e.fs.writeFile(v,p.content),t.preserve&&p.mode)try{await e.fs.chmod(v,p.mode)}catch{}t.verbose&&(u+=`${b}
|
|
48
|
-
`)}else if(p.type==="symlink"&&p.linkTarget){if(t.toStdout)continue;if(!t.absoluteNames&&(p.linkTarget.startsWith("/")||Ye(p.linkTarget))){g.push(`tar: ${b}: unsafe symlink target`);continue}if(t.keepOldFiles)try{await e.fs.stat(v),t.verbose&&(u+=`${b}: not overwritten, file exists
|
|
49
|
-
`);continue}catch{}let $=v.substring(0,v.lastIndexOf("/"));if($)try{await e.fs.mkdir($,{recursive:!0})}catch{}try{await e.fs.symlink(p.linkTarget,v)}catch{}t.verbose&&(u+=`${b}
|
|
50
|
-
`)}}catch($){let z=$ instanceof Error?$.message:"unknown error";g.push(`tar: ${b}: ${z}`)}}let d=u;return g.length>0&&(d+=`${g.join(`
|
|
51
|
-
`)}
|
|
52
|
-
`),{stdout:y,stderr:d,exitCode:g.length>0?2:0}}async function Mt(e,t,i){let r;if(t.file&&t.file!=="-"){let f=e.fs.resolvePath(e.cwd,t.file);try{r=await e.fs.readFileBuffer(f)}catch{return{stdout:"",stderr:`tar: ${t.file}: Cannot open: No such file or directory
|
|
53
|
-
`,exitCode:2}}}else r=Uint8Array.from(e.stdin,f=>f.charCodeAt(0));let n,s=t.gzip||oe(r),a=t.bzip2||ae(r),o=t.xz||le(r),c=t.zstd||ue(r);if(s?n=await se(r):a?n=await ce(r):o?n=await fe(r):c?n=await de(r):n=await F(r),n.error)return{stdout:"",stderr:`tar: ${n.error}
|
|
54
|
-
`,exitCode:2};let l="";for(let f of n.entries){let u=qe(f.name,t.strip);if(!u)continue;let y=u.endsWith("/")?u.slice(0,-1):u;if(i.length>0){let g;if(t.wildcards?g=i.some(d=>Y(u,d)||Y(y,d)||u.startsWith(`${d}/`)):g=i.some(d=>u===d||u.startsWith(`${d}/`)||y===d),!g)continue}if(!me(u,t.exclude))if(t.verbose){let g=f.type==="directory",d=ye(f.mode,g),p=`${f.uid}/${f.gid}`,m=f.size.toString().padStart(8," "),x=Ut(f.mtime),b=`${d} ${p.padEnd(10)} ${m} ${x} ${u}`;f.type==="symlink"&&f.linkTarget&&(b+=` -> ${f.linkTarget}`),l+=`${b}
|
|
55
|
-
`}else l+=`${u}
|
|
56
|
-
`}return{stdout:l,stderr:"",exitCode:0}}var sr={name:"tar",async execute(e,t){if(ge(e))return pe(Pt);let i=Ze(e);if(!i.ok)return i.error;let{options:r,files:n}=i,s=[r.create,r.append,r.update,r.extract,r.list].filter(Boolean).length;if(s===0)return{stdout:"",stderr:`tar: You must specify one of -c, -r, -u, -x, or -t
|
|
57
|
-
`,exitCode:2};if(s>1)return{stdout:"",stderr:`tar: You may not specify more than one of -c, -r, -u, -x, or -t
|
|
58
|
-
`,exitCode:2};if(r.autoCompress&&r.file&&r.create){let c=r.file.toLowerCase();c.endsWith(".tar.gz")||c.endsWith(".tgz")?r.gzip=!0:c.endsWith(".tar.bz2")||c.endsWith(".tbz2")?r.bzip2=!0:c.endsWith(".tar.xz")||c.endsWith(".txz")?r.xz=!0:(c.endsWith(".tar.zst")||c.endsWith(".tzst"))&&(r.zstd=!0)}let a=[r.gzip,r.bzip2,r.xz,r.zstd].filter(Boolean).length;if(a>1)return{stdout:"",stderr:`tar: You may not specify more than one compression option
|
|
59
|
-
`,exitCode:2};if((r.append||r.update)&&a>0)return{stdout:"",stderr:`tar: Cannot append/update compressed archives - decompress first
|
|
60
|
-
`,exitCode:2};let o=n;if(r.filesFrom){let c=t.fs.resolvePath(t.cwd,r.filesFrom);try{let f=(await t.fs.readFile(c)).split(`
|
|
61
|
-
`).map(u=>u.trim()).filter(u=>u.length>0&&!u.startsWith("#"));o=[...n,...f]}catch{return{stdout:"",stderr:`tar: ${r.filesFrom}: Cannot open: No such file or directory
|
|
62
|
-
`,exitCode:2}}}if(r.excludeFrom){let c=t.fs.resolvePath(t.cwd,r.excludeFrom);try{let f=(await t.fs.readFile(c)).split(`
|
|
63
|
-
`).map(u=>u.trim()).filter(u=>u.length>0&&!u.startsWith("#"));r.exclude.push(...f)}catch{return{stdout:"",stderr:`tar: ${r.excludeFrom}: Cannot open: No such file or directory
|
|
64
|
-
`,exitCode:2}}}return r.create?Nt(t,r,o):r.append?Lt(t,r,o):r.update?Dt(t,r,o):r.extract?Rt(t,r,o):Mt(t,r,o)}},or={name:"tar",flags:[{flag:"-c",type:"boolean"},{flag:"-x",type:"boolean"},{flag:"-t",type:"boolean"},{flag:"-f",type:"value",valueHint:"path"},{flag:"-z",type:"boolean"},{flag:"-j",type:"boolean"},{flag:"-v",type:"boolean"},{flag:"-C",type:"value",valueHint:"path"},{flag:"--strip-components",type:"value",valueHint:"number"},{flag:"--exclude",type:"value",valueHint:"pattern"}],needsArgs:!0};export{sr as a,or as b};
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import{createRequire} from"node:module";const require=createRequire(import.meta.url);
|
|
3
|
-
import{b as v}from"./chunk-O2BCKSMK.js";import{d}from"./chunk-NYIPFY36.js";import{a as w}from"./chunk-I4IRHQDW.js";import{a as T,b,c as f}from"./chunk-MUFNRCMY.js";import"./chunk-LNVSXNT7.js";function c(s){let t=s.indexOf("=");if(t>=0){let a=s.slice(0,t),r=s.slice(t+1);return a?`${encodeURIComponent(a)}=${encodeURIComponent(r)}`:encodeURIComponent(r)}return encodeURIComponent(s)}function m(s){let t=s.indexOf("=");if(t<0)return null;let a=s.slice(0,t),r=s.slice(t+1),e,i,o=r.match(/;type=([^;]+)$/);o&&(i=o[1],r=r.slice(0,-o[0].length));let n=r.match(/;filename=([^;]+)/);return n&&(e=n[1],r=r.replace(n[0],"")),(r.startsWith("@")||r.startsWith("<"))&&(e=e??r.slice(1).split("/").pop()),{name:a,value:r,filename:e,contentType:i}}function F(s,t){let a=`----CurlFormBoundary${Date.now().toString(36)}`,r=[];for(let e of s){let i=e.value;if(i.startsWith("@")||i.startsWith("<")){let n=i.slice(1);i=t.get(n)??""}let o=`--${a}\r
|
|
4
|
-
`;e.filename?(o+=`Content-Disposition: form-data; name="${e.name}"; filename="${e.filename}"\r
|
|
5
|
-
`,e.contentType&&(o+=`Content-Type: ${e.contentType}\r
|
|
6
|
-
`)):o+=`Content-Disposition: form-data; name="${e.name}"\r
|
|
7
|
-
`,o+=`\r
|
|
8
|
-
${i}\r
|
|
9
|
-
`,r.push(o)}return r.push(`--${a}--\r
|
|
10
|
-
`),{body:r.join(""),boundary:a}}var O={name:"curl",summary:"transfer a URL",usage:"curl [OPTIONS] URL",options:["-X, --request METHOD HTTP method (GET, POST, PUT, DELETE, etc.)","-H, --header HEADER Add header (can be used multiple times)","-d, --data DATA HTTP POST data"," --data-raw DATA HTTP POST data (no @ interpretation)"," --data-binary DATA HTTP POST binary data"," --data-urlencode DATA URL-encode and POST data","-F, --form NAME=VALUE Multipart form data","-u, --user USER:PASS HTTP authentication","-A, --user-agent STR Set User-Agent header","-e, --referer URL Set Referer header","-b, --cookie DATA Send cookies (name=value or @file)","-c, --cookie-jar FILE Save cookies to file","-T, --upload-file FILE Upload file (PUT)","-o, --output FILE Write output to file","-O, --remote-name Write to file named from URL","-I, --head Show headers only (HEAD request)","-i, --include Include response headers in output","-s, --silent Silent mode (no progress)","-S, --show-error Show errors even when silent","-f, --fail Fail silently on HTTP errors (no output)","-L, --location Follow redirects (default)"," --max-redirs NUM Maximum redirects (default: 20)","-m, --max-time SECS Maximum time for request"," --connect-timeout SECS Connection timeout","-w, --write-out FMT Output format after completion","-v, --verbose Verbose output"," --help Display this help and exit","","Note: Network access must be configured via BashEnv network option."," curl is not available by default for security reasons."]};function W(s){let t={method:"GET",headers:new d,dataBinary:!1,formFields:[],useRemoteName:!1,headOnly:!1,includeHeaders:!1,silent:!1,showError:!1,failSilently:!1,followRedirects:!0,verbose:!1},a=!1;for(let r=0;r<s.length;r++){let e=s[r];if(e==="-X"||e==="--request")t.method=s[++r]??"GET";else if(e.startsWith("-X"))t.method=e.slice(2);else if(e.startsWith("--request="))t.method=e.slice(10);else if(e==="-H"||e==="--header"){let i=s[++r];if(i){let o=i.indexOf(":");if(o>0){let n=i.slice(0,o).trim(),l=i.slice(o+1).trim();t.headers.append(n,l)}}}else if(e.startsWith("--header=")){let i=e.slice(9),o=i.indexOf(":");if(o>0){let n=i.slice(0,o).trim(),l=i.slice(o+1).trim();t.headers.append(n,l)}}else if(e==="-d"||e==="--data"||e==="--data-raw")t.data=s[++r]??"",a=!0;else if(e.startsWith("-d"))t.data=e.slice(2),a=!0;else if(e.startsWith("--data="))t.data=e.slice(7),a=!0;else if(e.startsWith("--data-raw="))t.data=e.slice(11),a=!0;else if(e==="--data-binary")t.data=s[++r]??"",t.dataBinary=!0,a=!0;else if(e.startsWith("--data-binary="))t.data=e.slice(14),t.dataBinary=!0,a=!0;else if(e==="--data-urlencode"){let i=s[++r]??"";t.data=(t.data?`${t.data}&`:"")+c(i),a=!0}else if(e.startsWith("--data-urlencode=")){let i=e.slice(17);t.data=(t.data?`${t.data}&`:"")+c(i),a=!0}else if(e==="-F"||e==="--form"){let i=s[++r]??"",o=m(i);o&&t.formFields.push(o),a=!0}else if(e.startsWith("--form=")){let i=e.slice(7),o=m(i);o&&t.formFields.push(o),a=!0}else if(e==="-u"||e==="--user")t.user=s[++r];else if(e.startsWith("-u"))t.user=e.slice(2);else if(e.startsWith("--user="))t.user=e.slice(7);else if(e==="-A"||e==="--user-agent")t.headers.set("User-Agent",s[++r]??"");else if(e.startsWith("-A"))t.headers.set("User-Agent",e.slice(2));else if(e.startsWith("--user-agent="))t.headers.set("User-Agent",e.slice(13));else if(e==="-e"||e==="--referer")t.headers.set("Referer",s[++r]??"");else if(e.startsWith("-e"))t.headers.set("Referer",e.slice(2));else if(e.startsWith("--referer="))t.headers.set("Referer",e.slice(10));else if(e==="-b"||e==="--cookie")t.headers.set("Cookie",s[++r]??"");else if(e.startsWith("-b"))t.headers.set("Cookie",e.slice(2));else if(e.startsWith("--cookie="))t.headers.set("Cookie",e.slice(9));else if(e==="-c"||e==="--cookie-jar")t.cookieJar=s[++r];else if(e.startsWith("--cookie-jar="))t.cookieJar=e.slice(13);else if(e==="-T"||e==="--upload-file")t.uploadFile=s[++r],t.method==="GET"&&(t.method="PUT");else if(e.startsWith("--upload-file="))t.uploadFile=e.slice(14),t.method==="GET"&&(t.method="PUT");else if(e==="-m"||e==="--max-time"){let i=parseFloat(s[++r]??"0");!Number.isNaN(i)&&i>0&&(t.timeoutMs=i*1e3)}else if(e.startsWith("--max-time=")){let i=parseFloat(e.slice(11));!Number.isNaN(i)&&i>0&&(t.timeoutMs=i*1e3)}else if(e==="--connect-timeout"){let i=parseFloat(s[++r]??"0");!Number.isNaN(i)&&i>0&&t.timeoutMs===void 0&&(t.timeoutMs=i*1e3)}else if(e.startsWith("--connect-timeout=")){let i=parseFloat(e.slice(18));!Number.isNaN(i)&&i>0&&t.timeoutMs===void 0&&(t.timeoutMs=i*1e3)}else if(e==="-o"||e==="--output")t.outputFile=s[++r];else if(e.startsWith("--output="))t.outputFile=e.slice(9);else if(e==="-O"||e==="--remote-name")t.useRemoteName=!0;else if(e==="-I"||e==="--head")t.headOnly=!0,t.method="HEAD";else if(e==="-i"||e==="--include")t.includeHeaders=!0;else if(e==="-s"||e==="--silent")t.silent=!0;else if(e==="-S"||e==="--show-error")t.showError=!0;else if(e==="-f"||e==="--fail")t.failSilently=!0;else if(e==="-L"||e==="--location")t.followRedirects=!0;else if(e==="--max-redirs")r++;else if(!e.startsWith("--max-redirs="))if(e==="-w"||e==="--write-out")t.writeOut=s[++r];else if(e.startsWith("--write-out="))t.writeOut=e.slice(12);else if(e==="-v"||e==="--verbose")t.verbose=!0;else{if(e.startsWith("--")&&e!=="--")return f("curl",e);if(e.startsWith("-")&&e!=="-")for(let i of e.slice(1))switch(i){case"s":t.silent=!0;break;case"S":t.showError=!0;break;case"f":t.failSilently=!0;break;case"L":t.followRedirects=!0;break;case"I":t.headOnly=!0,t.method="HEAD";break;case"i":t.includeHeaders=!0;break;case"O":t.useRemoteName=!0;break;case"v":t.verbose=!0;break;default:return f("curl",`-${i}`)}else e.startsWith("-")||(t.url=e)}}return a&&t.method==="GET"&&(t.method="POST"),t}function h(s){return Object.entries(s).map(([t,a])=>`${t}: ${a}`).join(`\r
|
|
11
|
-
`)}function S(s){try{return new URL(s).pathname.split("/").pop()||"index.html"}catch{return"index.html"}}function p(s,t){let a=s;return a=a.replace(/%\{http_code\}/g,String(t.status)),a=a.replace(/%\{content_type\}/g,t.headers["content-type"]||""),a=a.replace(/%\{url_effective\}/g,t.url),a=a.replace(/%\{size_download\}/g,String(t.bodyLength)),a=a.replace(/\\n/g,`
|
|
12
|
-
`),a}async function E(s,t){if(s.uploadFile){let a=t.fs.resolvePath(t.cwd,s.uploadFile);return{body:await t.fs.readFile(a)}}if(s.formFields.length>0){let a=new Map;for(let i of s.formFields)if(i.value.startsWith("@")||i.value.startsWith("<")){let o=t.fs.resolvePath(t.cwd,i.value.slice(1));try{let n=await t.fs.readFile(o);a.set(i.value.slice(1),n)}catch{a.set(i.value.slice(1),"")}}let{body:r,boundary:e}=F(s.formFields,a);return{body:r,contentType:`multipart/form-data; boundary=${e}`}}return s.data!==void 0?{body:s.data}:{}}function P(s,t){let a=new d(s.headers);if(s.user){let r=Buffer.from(s.user).toString("base64");a.set("Authorization",`Basic ${r}`)}return t&&!a.has("Content-Type")&&a.set("Content-Type",t),a}async function H(s,t,a){if(!s.cookieJar)return;let r=t["set-cookie"];if(!r)return;let e=a.fs.resolvePath(a.cwd,s.cookieJar);await a.fs.writeFile(e,r)}function R(s){return v(s,"binary")}function k(s,t,a){let r="";if(s.verbose){r+=`> ${s.method} ${a}
|
|
13
|
-
`;for(let[e,i]of s.headers)r+=`> ${e}: ${i}
|
|
14
|
-
`;r+=`>
|
|
15
|
-
`,r+=`< HTTP/1.1 ${t.status} ${t.statusText}
|
|
16
|
-
`;for(let[e,i]of Object.entries(t.headers))r+=`< ${e}: ${i}
|
|
17
|
-
`;r+=`<
|
|
18
|
-
`}return s.includeHeaders&&!s.verbose&&(r+=`HTTP/1.1 ${t.status} ${t.statusText}\r
|
|
19
|
-
`,r+=h(t.headers),r+=`\r
|
|
20
|
-
\r
|
|
21
|
-
`),s.headOnly?s.includeHeaders||s.verbose||(r+=`HTTP/1.1 ${t.status} ${t.statusText}\r
|
|
22
|
-
`,r+=h(t.headers),r+=`\r
|
|
23
|
-
`):r+=R(t.body),s.writeOut&&(r+=p(s.writeOut,{status:t.status,headers:t.headers,url:t.url,bodyLength:t.body.byteLength})),r}var J={name:"curl",async execute(s,t){if(b(s))return T(O);let a=W(s);if("exitCode"in a)return a;let r=a;if(!r.url)return{stdout:"",stderr:`curl: no URL specified
|
|
24
|
-
`,exitCode:2};if(!t.fetch)return{stdout:"",stderr:`curl: internal error: fetch not available
|
|
25
|
-
`,exitCode:1};let e=r.url;e.match(/^https?:\/\//)||(e=`https://${e}`);try{let{body:i,contentType:o}=await E(r,t),n=P(r,o),l=await t.fetch(e,{method:r.method,headers:n,body:i,followRedirects:r.followRedirects,timeoutMs:r.timeoutMs});if(await H(r,l.headers,t),r.failSilently&&l.status>=400)return{stdout:"",stderr:r.showError||!r.silent?`curl: (22) The requested URL returned error: ${l.status}
|
|
26
|
-
`:"",exitCode:22};let u=k(r,l,e);if(r.outputFile||r.useRemoteName){let y=r.outputFile||S(e),$=t.fs.resolvePath(t.cwd,y);await t.fs.writeFile($,r.headOnly?"":l.body),r.verbose||(u=""),r.writeOut&&(u=p(r.writeOut,{status:l.status,headers:l.headers,url:l.url,bodyLength:l.body.byteLength}))}return{stdout:u,stderr:"",exitCode:0}}catch(i){let o=w(i),n=1;return o.includes("Network access denied")?n=7:o.includes("HTTP method")&&o.includes("not allowed")?n=3:o.includes("Redirect target not in allow-list")||o.includes("Too many redirects")?n=47:o.includes("aborted")&&(n=28),{stdout:"",stderr:!r.silent||r.showError?`curl: (${n}) ${o}
|
|
27
|
-
`:"",exitCode:n}}}};export{J as curlCommand};
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import{createRequire} from"node:module";const require=createRequire(import.meta.url);
|
|
3
|
-
import{b as yr}from"./chunk-Y4FPH5DQ.js";import{b as Ar}from"./chunk-JZW7NFK2.js";import{b as $r}from"./chunk-FVRXEJYQ.js";import"./chunk-LAHBP3FW.js";import"./chunk-MNWK4UIM.js";import{c as Sr}from"./chunk-EDTBGO7F.js";import{b as wr}from"./chunk-JNUX75OX.js";import{b as xr}from"./chunk-DYIBFLS3.js";import{b as vr}from"./chunk-RVPTAYDS.js";import{b as kr}from"./chunk-BGX3RW7H.js";import{b as qr}from"./chunk-AJF3OBTR.js";import{b as Cr}from"./chunk-2ETT4ELS.js";import{b as br}from"./chunk-X4MX6EHF.js";import{d as Ir,e as Mr,f as jr}from"./chunk-BPZJYOUA.js";import{b as tr}from"./chunk-BE4PARL3.js";import{b as lr}from"./chunk-ZFUVUYWG.js";import{b as ur}from"./chunk-XPTYN6UE.js";import{b as pr}from"./chunk-4KSZJAQK.js";import{b as er}from"./chunk-CAZ75E7E.js";import{b as dr}from"./chunk-F3WNDKOC.js";import{b as cr}from"./chunk-22HCD466.js";import"./chunk-FKVQZWJQ.js";import{b as hr}from"./chunk-BZP56QBM.js";import{c as or,d as ar}from"./chunk-KI54R2QB.js";import{b as sr}from"./chunk-KUMHQGUR.js";import{c as ir,d as gr}from"./chunk-7UU7KPEM.js";import{b as mr}from"./chunk-Q4UMTSRO.js";import"./chunk-LSQTB2QK.js";import{b as Fr}from"./chunk-6WJQNLR2.js";import{b as zr}from"./chunk-7NC4CPHS.js";import{b as fr}from"./chunk-3UKQXBQ3.js";import{b as nr}from"./chunk-77MLOOQS.js";import"./chunk-B2DRBHGQ.js";import{b as R}from"./chunk-YJ5OCPSK.js";import{b as U}from"./chunk-Q2GOPGDA.js";import{b as V}from"./chunk-PXP4YYZA.js";import{b as W}from"./chunk-WDWNEHHE.js";import{c as X,d as Y}from"./chunk-YUZRUF5F.js";import{c as Z,d as _}from"./chunk-DJAX3ZRG.js";import{b as N}from"./chunk-PZQVSQX6.js";import{b as rr}from"./chunk-YOKQNNQO.js";import{b as G}from"./chunk-UO5LOD7U.js";import{b as H}from"./chunk-F3GKANW3.js";import{b as J}from"./chunk-7VCQWCSH.js";import{b as K}from"./chunk-PAYQNSZN.js";import{b as L}from"./chunk-KFMPGSUT.js";import{b as O}from"./chunk-V2RP73X4.js";import{b as P}from"./chunk-AGKL4LDL.js";import{b as Q}from"./chunk-3BYTCO2H.js";import{b as y}from"./chunk-7AYT3UKI.js";import{b as A}from"./chunk-2SVX7I5P.js";import{b as $}from"./chunk-2NRAWO6E.js";import{b as S}from"./chunk-J7TUF2VI.js";import{b as T}from"./chunk-6FSBHK6H.js";import{b as B}from"./chunk-IZGLHVBB.js";import{b as D}from"./chunk-C7ISPH7Y.js";import{b as E}from"./chunk-HN2DCT7T.js";import{b as w}from"./chunk-LC6D27QJ.js";import{b as x}from"./chunk-YY5PJR7O.js";import{b as v}from"./chunk-UOMNSQEZ.js";import"./chunk-BIJXTWZ4.js";import{d as k,e as q,f as C}from"./chunk-VBDLSL7Y.js";import"./chunk-UR4CEP4Y.js";import{b}from"./chunk-L24QXM5S.js";import"./chunk-MLUOPG3W.js";import"./chunk-3MRB66F4.js";import"./chunk-ALVEEXFD.js";import{b as I}from"./chunk-M65CQLJE.js";import{b as M}from"./chunk-NXVG64T3.js";import{b as j}from"./chunk-OPMLWMNH.js";import{b as t}from"./chunk-YOIFOOGX.js";import{b as l}from"./chunk-2AIXTPH2.js";import{b as u}from"./chunk-3WIMLJM7.js";import{b as p}from"./chunk-2GG3NVC4.js";import{b as e}from"./chunk-XHCCSVP6.js";import{b as d}from"./chunk-G4AUMZUY.js";import{b as c}from"./chunk-XRUDFQG5.js";import{b as h}from"./chunk-XFFUAO3F.js";import"./chunk-UGJM7CKP.js";import"./chunk-NYIPFY36.js";import"./chunk-KRRM5UCC.js";import"./chunk-MROECM42.js";import"./chunk-LNNWMRCB.js";import"./chunk-HL4ZS7TX.js";import"./chunk-IEXQTXU5.js";import{b as i}from"./chunk-XBB73LFB.js";import{b as g}from"./chunk-XJ37N3S5.js";import"./chunk-H7JTIXAO.js";import"./chunk-VZK4FHWJ.js";import{b as m}from"./chunk-FOUVACI7.js";import"./chunk-JXLDT4KX.js";import"./chunk-47WZ2U6M.js";import{b as F}from"./chunk-N6YW4W3Z.js";import"./chunk-7JZKVC3F.js";import{b as z}from"./chunk-OLEQNRKX.js";import"./chunk-PBOVSFTJ.js";import{b as f}from"./chunk-5XSZHUEI.js";import"./chunk-NE4R2FVV.js";import{b as n}from"./chunk-QL33F2W6.js";import"./chunk-I4IRHQDW.js";import"./chunk-MUFNRCMY.js";import"./chunk-LNVSXNT7.js";var Er=[i,g,m,F,z,f,n,t,l,u,p,e,d,c,h,w,x,v,k,q,C,b,I,M,j,y,A,$,S,T,B,D,E,G,H,J,K,L,O,P,Q,R,U,V,W,X,Y,Z,_,N,rr,or,ar,sr,ir,gr,mr,Fr,zr,fr,nr,tr,lr,ur,pr,er,dr,cr,hr,wr,xr,vr,kr,qr,Cr,br,Ir,Mr,jr,yr,Ar,$r,Sr];function Tr(){return Er}var Br=new Map;for(let r of Tr())Br.set(r.name,new Set(r.flags.map(o=>o.flag)));function Fa(r,o,Dr){let a=Br.get(o);if(!(!a||a.size===0))for(let s of Dr)a.has(s)&&r.hit(`cmd:flag:${o}:${s}`)}export{Fa as emitFlagCoverage};
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import{createRequire} from"node:module";const require=createRequire(import.meta.url);
|
|
3
|
-
import{a,b}from"./chunk-FOUVACI7.js";import"./chunk-JXLDT4KX.js";import"./chunk-47WZ2U6M.js";import"./chunk-I4IRHQDW.js";import"./chunk-MUFNRCMY.js";import"./chunk-LNVSXNT7.js";export{b as flagsForFuzzing,a as printfCommand};
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import{createRequire} from"node:module";const require=createRequire(import.meta.url);
|
|
3
|
-
import{a,b}from"./chunk-Y4FPH5DQ.js";import"./chunk-BIJXTWZ4.js";import"./chunk-HL4ZS7TX.js";import"./chunk-IEXQTXU5.js";import"./chunk-VZK4FHWJ.js";import"./chunk-MUFNRCMY.js";import"./chunk-LNVSXNT7.js";export{b as flagsForFuzzing,a as tarCommand};
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import{createRequire} from"node:module";const require=createRequire(import.meta.url);
|
|
3
|
-
import{a as m,b as k,c as p}from"./chunk-MUFNRCMY.js";var g={name:"date",summary:"display the current time in the given FORMAT",usage:"date [OPTION]... [+FORMAT]",options:["-d, --date=STRING display time described by STRING","-u, --utc print Coordinated Universal Time (UTC)","-I, --iso-8601 output date/time in ISO 8601 format","-R, --rfc-email output RFC 5322 date format"," --help display this help and exit"]},T=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],S=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function s(a,i=2){return String(a).padStart(i,"0")}function b(a,i,n){let t={Y:a.getUTCFullYear(),m:a.getUTCMonth(),D:a.getUTCDate(),H:a.getUTCHours(),M:a.getUTCMinutes(),S:a.getUTCSeconds(),w:a.getUTCDay()},e="",l=0;for(;l<i.length;){if(i[l]==="%"&&l+1<i.length){let o=i[++l];switch(o){case"%":e+="%";break;case"a":e+=T[t.w];break;case"b":case"h":e+=S[t.m];break;case"d":e+=s(t.D);break;case"e":e+=String(t.D).padStart(2," ");break;case"F":e+=`${t.Y}-${s(t.m+1)}-${s(t.D)}`;break;case"H":e+=s(t.H);break;case"I":e+=s(t.H%12||12);break;case"m":e+=s(t.m+1);break;case"M":e+=s(t.M);break;case"n":e+=`
|
|
4
|
-
`;break;case"p":e+=t.H<12?"AM":"PM";break;case"P":e+=t.H<12?"am":"pm";break;case"R":e+=`${s(t.H)}:${s(t.M)}`;break;case"s":e+=Math.floor(a.getTime()/1e3);break;case"S":e+=s(t.S);break;case"t":e+=" ";break;case"T":e+=`${s(t.H)}:${s(t.M)}:${s(t.S)}`;break;case"u":e+=t.w||7;break;case"w":e+=t.w;break;case"y":e+=s(t.Y%100);break;case"Y":e+=t.Y;break;case"z":e+="+0000";break;case"Z":e+="UTC";break;default:e+=`%${o}`}}else e+=i[l];l++}return e}function h(a){let i=new Date(a);if(!Number.isNaN(i.getTime()))return i;if(/^\d+$/.test(a))return new Date(Number.parseInt(a,10)*1e3);let n=a.toLowerCase();return n==="now"||n==="today"?new Date:n==="yesterday"?new Date(Date.now()-864e5):n==="tomorrow"?new Date(Date.now()+864e5):null}var M={name:"date",async execute(a,i){if(k(a))return m(g);let n=!1,t=null,e=null,l=!1,o=!1;for(let f=0;f<a.length;f++){let r=a[f];if(r==="-u"||r==="--utc")n=!0;else if(r==="-d"||r==="--date")t=a[++f]??"";else if(r.startsWith("--date="))t=r.slice(7);else if(r==="-I"||r==="--iso-8601")l=!0;else if(r==="-R"||r==="--rfc-email")o=!0;else if(r.startsWith("+"))e=r.slice(1);else{if(r.startsWith("--"))return p("date",r);if(r.startsWith("-"))for(let d of r.slice(1))if(d==="u")n=!0;else if(d==="I")l=!0;else if(d==="R")o=!0;else return p("date",`-${d}`)}}let u=t!==null?h(t):new Date;if(!u)return{stdout:"",stderr:`date: invalid date '${t}'
|
|
5
|
-
`,exitCode:1};let c;return e?c=b(u,e,n):l?c=b(u,"%Y-%m-%dT%H:%M:%S%z",n):o?c=b(u,"%a, %d %b %Y %H:%M:%S %z",n):c=b(u,"%a %b %e %H:%M:%S %Z %Y",n),{stdout:`${c}
|
|
6
|
-
`,stderr:"",exitCode:0}}},D={name:"date",flags:[{flag:"-d",type:"value",valueHint:"string"},{flag:"-u",type:"boolean"},{flag:"-I",type:"boolean"},{flag:"-R",type:"boolean"}]};export{M as a,D as b};
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import{createRequire} from"node:module";const require=createRequire(import.meta.url);
|
|
3
|
-
import{a as W}from"./chunk-IEXQTXU5.js";function _(n,t){let e=n.ignoreCase?t.toLowerCase():t,i=n.needles;for(let l=0;l<i.length;l++)if(e.indexOf(i[l])!==-1)return!0;return!1}function D(n,t){return n.replace(/\$(&|\d+|<([^>]+)>)/g,(e,i,l)=>{if(i==="&")return t[0];if(l!==void 0)return t.groups?.[l]??"";let o=parseInt(i,10);return t[o]??""})}function Q(n,t,e={}){let{invertMatch:i=!1,showLineNumbers:l=!1,countOnly:o=!1,countMatches:u=!1,filename:a="",onlyMatching:p=!1,beforeContext:k=0,afterContext:v=0,maxCount:A=0,contextSeparator:T="--",showColumn:O=!1,vimgrep:N=!1,showByteOffset:y=!1,replace:R=null,passthru:z=!1,multiline:U=!1,kResetGroup:P,preFilter:b}=e;if(U)return X(n,t,{invertMatch:i,showLineNumbers:l,countOnly:o,countMatches:u,filename:a,onlyMatching:p,beforeContext:k,afterContext:v,maxCount:A,contextSeparator:T,showColumn:O,showByteOffset:y,replace:R,kResetGroup:P});let M=n.split(`
|
|
4
|
-
`),j=M.length,L=j>0&&M[j-1]===""?j-1:j;if(o||u){let c=0,s=(u||p)&&!i;for(let h=0;h<L;h++){let r=M[h];if(!(b&&!i&&!_(b,r)))if(t.lastIndex=0,s)for(let m=t.exec(r);m!==null;m=t.exec(r))c++,m[0].length===0&&t.lastIndex++;else t.test(r)!==i&&c++}return{output:`${a?`${a}:${c}`:String(c)}
|
|
5
|
-
`,matched:c>0,matchCount:c}}if(k===0&&v===0&&!z){let c=[],s=!1,d=0,h=0;for(let r=0;r<L&&!(A>0&&d>=A);r++){let m=M[r],I=null;if(b&&!_(b,m)||(t.lastIndex=0,I=t.exec(m)),I!==null!==i)if(s=!0,d++,p)for(let g=I;g!==null;g=t.exec(m)){let F=P!==void 0?g[P]??"":g[0],E=R!==null?D(R,g):F,x=a?`${a}:`:"";y&&(x+=`${h+g.index}:`),l&&(x+=`${r+1}:`),O&&(x+=`${g.index+1}:`),c.push(x+E),g[0].length===0&&t.lastIndex++}else if(N)for(let g=I;g!==null;g=t.exec(m)){let F=a?`${a}:`:"";y&&(F+=`${h+g.index}:`),l&&(F+=`${r+1}:`),O&&(F+=`${g.index+1}:`),c.push(F+m),g[0].length===0&&t.lastIndex++}else{let g=I?I.index+1:1,F=m;R!==null&&(t.lastIndex=0,F=t.replace(m,(...x)=>{if(x[0].length===0)return"";let G=x,B=x[x.length-1];return typeof B=="object"&&B!==null?(G.groups=B,G.input=x[x.length-2],G.index=x[x.length-3]):(G.input=x[x.length-1],G.index=x[x.length-2]),D(R,G)}));let E=a?`${a}:`:"";y&&(E+=`${h+(I?I.index:0)}:`),l&&(E+=`${r+1}:`),O&&(E+=`${g}:`),c.push(E+F)}h+=m.length+1}return{output:c.length>0?`${c.join(`
|
|
6
|
-
`)}
|
|
7
|
-
`:"",matched:s,matchCount:d}}if(z){let c=[],s=!1,d=0;for(let h=0;h<L;h++){let r=M[h],m;b&&!_(b,r)?m=!1:(t.lastIndex=0,m=t.test(r));let I=m!==i;I&&(s=!0,d++);let Z=I?":":"-",g=a?`${a}${Z}`:"";l&&(g+=`${h+1}${Z}`),c.push(g+r)}return{output:c.length>0?`${c.join(`
|
|
8
|
-
`)}
|
|
9
|
-
`:"",matched:s,matchCount:d}}let C=[],S=0,w=new Set,f=-1,$=[];for(let c=0;c<L&&!(A>0&&S>=A);c++){let s=M[c],d;b&&!_(b,s)?d=!1:(t.lastIndex=0,d=t.test(s)),d!==i&&($.push(c),S++)}for(let c of $){let s=Math.max(0,c-k);f>=0&&s>f+1&&C.push(T);for(let h=s;h<c;h++)if(!w.has(h)){w.add(h),f=h;let r=M[h];l&&(r=`${h+1}-${r}`),a&&(r=`${a}-${r}`),C.push(r)}if(!w.has(c)){w.add(c),f=c;let h=M[c];if(p){t.lastIndex=0;for(let r=t.exec(h);r!==null;r=t.exec(h)){let m=P!==void 0?r[P]??"":r[0],I=R!==null?R:m,Z=a?`${a}:`:"";l&&(Z+=`${c+1}:`),O&&(Z+=`${r.index+1}:`),C.push(Z+I),r[0].length===0&&t.lastIndex++}}else{let r=h;l&&(r=`${c+1}:${r}`),a&&(r=`${a}:${r}`),C.push(r)}}let d=Math.min(L-1,c+v);for(let h=c+1;h<=d;h++)if(!w.has(h)){w.add(h),f=h;let r=M[h];l&&(r=`${h+1}-${r}`),a&&(r=`${a}-${r}`),C.push(r)}}return{output:C.length>0?`${C.join(`
|
|
10
|
-
`)}
|
|
11
|
-
`:"",matched:S>0,matchCount:S}}function X(n,t,e){let{invertMatch:i,showLineNumbers:l,countOnly:o,countMatches:u,filename:a,onlyMatching:p,beforeContext:k,afterContext:v,maxCount:A,contextSeparator:T,showColumn:O,showByteOffset:N,replace:y,kResetGroup:R}=e,z=n.split(`
|
|
12
|
-
`),U=z.length,P=U>0&&z[U-1]===""?U-1:U,b=[0];for(let f=0;f<n.length;f++)n[f]===`
|
|
13
|
-
`&&b.push(f+1);let M=f=>{let $=0;for(let c=0;c<b.length&&!(b[c]>f);c++)$=c;return $},j=f=>{let $=M(f);return f-b[$]+1},L=[];t.lastIndex=0;for(let f=t.exec(n);f!==null&&!(A>0&&L.length>=A);f=t.exec(n)){let $=M(f.index),c=M(f.index+Math.max(0,f[0].length-1)),s=R!==void 0?f[R]??"":f[0];L.push({startLine:$,endLine:c,byteOffset:f.index,column:j(f.index),matchText:s}),f[0].length===0&&t.lastIndex++}if(o||u){let f;if(u)f=i?0:L.length;else{let c=new Set;for(let s of L)for(let d=s.startLine;d<=s.endLine;d++)c.add(d);f=i?P-c.size:c.size}return{output:`${a?`${a}:${f}`:String(f)}
|
|
14
|
-
`,matched:f>0,matchCount:f}}if(i){let f=new Set;for(let c of L)for(let s=c.startLine;s<=c.endLine;s++)f.add(s);let $=[];for(let c=0;c<P;c++)if(!f.has(c)){let s=z[c];l&&(s=`${c+1}:${s}`),a&&(s=`${a}:${s}`),$.push(s)}return{output:$.length>0?`${$.join(`
|
|
15
|
-
`)}
|
|
16
|
-
`:"",matched:$.length>0,matchCount:$.length}}if(L.length===0)return{output:"",matched:!1,matchCount:0};let C=new Set,S=-1,w=[];for(let f of L){let $=Math.max(0,f.startLine-k),c=Math.min(P-1,f.endLine+v);S>=0&&$>S+1&&w.push(T);for(let s=$;s<f.startLine;s++)if(!C.has(s)){C.add(s),S=s;let d=z[s];l&&(d=`${s+1}-${d}`),a&&(d=`${a}-${d}`),w.push(d)}if(p){let s=y!==null?y:f.matchText,d=a?`${a}:`:"";N&&(d+=`${f.byteOffset}:`),l&&(d+=`${f.startLine+1}:`),O&&(d+=`${f.column}:`),w.push(d+s);for(let h=f.startLine;h<=f.endLine;h++)C.add(h),S=h}else for(let s=f.startLine;s<=f.endLine&&s<P;s++)if(!C.has(s)){C.add(s),S=s;let d=z[s];y!==null&&s===f.startLine&&(t.lastIndex=0,d=t.replace(d,y));let h=a?`${a}:`:"";N&&s===f.startLine&&(h+=`${f.byteOffset}:`),l&&(h+=`${s+1}:`),O&&s===f.startLine&&(h+=`${f.column}:`),w.push(h+d)}for(let s=f.endLine+1;s<=c;s++)if(!C.has(s)){C.add(s),S=s;let d=z[s];l&&(d=`${s+1}-${d}`),a&&(d=`${a}-${d}`),w.push(d)}}return{output:w.length>0?`${w.join(`
|
|
17
|
-
`)}
|
|
18
|
-
`:"",matched:!0,matchCount:L.length}}var q=new Map([["alpha","a-zA-Z"],["digit","0-9"],["alnum","a-zA-Z0-9"],["lower","a-z"],["upper","A-Z"],["xdigit","0-9A-Fa-f"],["space"," \\t\\n\\r\\f\\v"],["blank"," \\t"],["punct","!-/:-@\\[-`{-~"],["graph","!-~"],["print"," -~"],["cntrl","\\x00-\\x1F\\x7F"],["ascii","\\x00-\\x7F"],["word","a-zA-Z0-9_"]]);function K(n){let t="",e=0;for(;e<n.length;){if(n.slice(e,e+7)==="[[:<:]]"){t+="\\b",e+=7;continue}if(n.slice(e,e+7)==="[[:>:]]"){t+="\\b",e+=7;continue}if(n[e]==="["){let i="[";for(e++,e<n.length&&(n[e]==="^"||n[e]==="!")&&(i+="^",e++),e<n.length&&n[e]==="]"&&(i+="\\]",e++);e<n.length&&n[e]!=="]";){if(n[e]==="["&&e+1<n.length&&n[e+1]===":"){let l=n.indexOf(":]",e+2);if(l!==-1){let o=n.slice(e+2,l),u=q.get(o);if(u){i+=u,e=l+2;continue}}}if(n[e]==="\\"&&e+1<n.length){i+=n[e]+n[e+1],e+=2;continue}i+=n[e],e++}e<n.length&&n[e]==="]"&&(i+="]",e++),t+=i;continue}if(n[e]==="\\"&&e+1<n.length){t+=n[e]+n[e+1],e+=2;continue}t+=n[e],e++}return t}function H(n,t){let e,i;switch(t.mode){case"fixed":e=n.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");break;case"extended":case"perl":{if(e=K(n),e=e.replace(/\(\?P<([^>]+)>/g,"(?<$1>"),t.mode==="perl"){e=ee(e),e=ne(e),e=te(e);let a=oe(e);e=a.pattern,i=a.kResetGroup}break}default:e=K(n),e=he(e);break}t.wholeWord&&(e=`\\b(?:${e})\\b`),t.lineRegexp&&(e=`^${e}$`);let l=/\\u\{[0-9A-Fa-f]+\}/.test(e),o="g"+(t.ignoreCase?"i":"")+(t.multiline?"m":"")+(t.multilineDotall?"s":"")+(l?"u":""),u=J(e,t.ignoreCase??!1);return{regex:W(e,o),kResetGroup:i,preFilter:u??void 0}}function J(n,t){let e=n;if(e.startsWith("\\b(?:")&&e.endsWith(")\\b")?e=e.slice(5,e.length-3):e.startsWith("\\b")&&e.endsWith("\\b")&&e.length>=4&&(e=e.slice(2,e.length-2)),e.length===0)return null;let i=V(e);if(i===null)return null;let l=[];for(let o of i){let u=Y(o);if(u===null||u.length===0)return null;l.push(u)}return l.length===0?null:{needles:t?l.map(o=>o.toLowerCase()):l,ignoreCase:t}}function V(n){let t=[],e=0,i=!1,l=0;for(let o=0;o<n.length;o++){let u=n[o];if(u==="\\"){o++;continue}if(i){u==="]"&&(i=!1);continue}if(u==="[")i=!0;else if(u==="(")e++;else if(u===")"){if(e--,e<0)return null}else u==="|"&&e===0&&(t.push(n.slice(l,o)),l=o+1)}return e!==0||i?null:(t.push(n.slice(l)),t)}function Y(n){let t="";for(let e=0;e<n.length;e++){let i=n[e];if(i==="\\"){let l=n[e+1];if(l===void 0||/[dDwWsSbBAZzGQE0-9ckpPNXRxuU]/.test(l))return null;l==="n"?t+=`
|
|
19
|
-
`:l==="t"?t+=" ":l==="r"?t+="\r":l==="f"?t+="\f":l==="v"?t+="\v":t+=l,e++;continue}if(/[.*+?^${}()|[\]]/.test(i))return null;t+=i}return t}function ee(n){let t="",e=0;for(;e<n.length;)if(n[e]==="\\"&&e+1<n.length&&n[e+1]==="Q"){e+=2;let i="";for(;e<n.length;){if(n[e]==="\\"&&e+1<n.length&&n[e+1]==="E"){e+=2;break}i+=n[e],e++}t+=i.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}else t+=n[e],e++;return t}function ne(n){return n.replace(/\\x\{([0-9A-Fa-f]+)\}/g,"\\u{$1}")}function te(n){let t="",e=0;for(;e<n.length;){if(n[e]==="("&&e+1<n.length&&n[e+1]==="?"){let i=n.slice(e).match(/^\(\?([imsx]*)(-[imsx]*)?(:|$|\))/);if(i){let l=i[1]||"",o=i[2]||"",u=i[3];if(u===":"){let a=e+i[0].length-1,p=ie(n,e);if(p!==-1){let k=n.slice(a+1,p),v=le(k,l,o);t+=`(?:${v})`,e=p+1;continue}}else if(u===")"||u===""){e+=i[0].length;continue}}}t+=n[e],e++}return t}function ie(n,t){let e=0,i=t;for(;i<n.length;){if(n[i]==="\\"){i+=2;continue}if(n[i]==="["){for(i++;i<n.length&&n[i]!=="]";)n[i]==="\\"&&i++,i++;i++;continue}if(n[i]==="(")e++;else if(n[i]===")"&&(e--,e===0))return i;i++}return-1}function le(n,t,e){let i=n;return t.includes("i")&&(i=se(i)),i}function se(n){let t="",e=0;for(;e<n.length;){let i=n[e];if(i==="\\"){e+1<n.length?(t+=i+n[e+1],e+=2):(t+=i,e++);continue}if(i==="["){t+=i,e++,e<n.length&&n[e]==="^"&&(t+=n[e],e++);let l=[];for(;e<n.length&&n[e]!=="]";)if(n[e]==="\\")l.push(n[e]),e++,e<n.length&&(l.push(n[e]),e++);else if(n[e]==="-"&&l.length>0&&e+1<n.length&&n[e+1]!=="]"){let o=l[l.length-1],u=n[e+1];l.push("-"),l.push(u),/[a-z]/.test(o)&&/[a-z]/.test(u)?(l.push(o.toUpperCase()),l.push("-"),l.push(u.toUpperCase())):/[A-Z]/.test(o)&&/[A-Z]/.test(u)&&(l.push(o.toLowerCase()),l.push("-"),l.push(u.toLowerCase())),e+=2}else{let o=n[e];if(l.push(o),/[a-zA-Z]/.test(o)){let u=o===o.toLowerCase()?o.toUpperCase():o.toLowerCase();l.includes(u)||l.push(u)}e++}t+=l.join(""),e<n.length&&(t+=n[e],e++);continue}if(/[a-zA-Z]/.test(i)){let l=i.toLowerCase(),o=i.toUpperCase();t+=`[${o}${l}]`}else t+=i;e++}return t}function oe(n){let t=fe(n);if(t===-1)return{pattern:n};let e=n.slice(0,t),i=n.slice(t+2),l=ce(e);return{pattern:`(?:${e})(${i})`,kResetGroup:l+1}}function fe(n){let t=0;for(;t<n.length-1;)if(n[t]==="\\"){if(n[t+1]==="K"){let e=0,i=t-1;for(;i>=0&&n[i]==="\\";)e++,i--;if(e%2===0)return t}t+=2}else t++;return-1}function ce(n){let t=0,e=0;for(;e<n.length;){if(n[e]==="\\"){e+=2;continue}if(n[e]==="["){for(e++;e<n.length&&n[e]!=="]";)n[e]==="\\"&&e++,e++;e++;continue}if(n[e]==="(")if(e+1<n.length&&n[e+1]==="?"){if(e+2<n.length){let i=n[e+2];if(i===":"||i==="="||i==="!"){e++;continue}if(i==="<"&&e+3<n.length){let l=n[e+3];if(l==="="||l==="!"){e++;continue}t++,e++;continue}}}else t++;e++}return t}function ue(n){let t=n.replace(/\$\{0\}|\$0(?![0-9])/g,"$$&");return t=t.replace(/\$\{([^0-9}][^}]*)\}/g,"$$<$1>"),t=t.replace(/\$([a-zA-Z_][a-zA-Z0-9_]*)(?![>0-9])/g,"$$<$1>"),t}function he(n){let t="",e=0,i=!0,l=0;for(;e<n.length;){let o=n[e];if(o==="["){for(t+=o,e++,e<n.length&&(n[e]==="^"||n[e]==="!")&&(t+=n[e],e++),e<n.length&&n[e]==="]"&&(t+=n[e],e++);e<n.length&&n[e]!=="]";)n[e]==="\\"&&e+1<n.length?(t+=n[e]+n[e+1],e+=2):(t+=n[e],e++);e<n.length&&n[e]==="]"&&(t+=n[e],e++),i=!1;continue}if(o==="\\"&&e+1<n.length){let u=n[e+1];if(u==="|"){t+="|",e+=2,i=!0;continue}if(u==="("){t+="(",e+=2,l++,i=!0;continue}if(u===")"){t+=")",e+=2,l=Math.max(0,l-1),i=!1;continue}if(u==="{"){let p=n.slice(e).match(/^\\{(\d+)(,(\d*)?)?\\}/);if(p){let k=p[1],v=p[2]!==void 0,A=p[3]||"";v?t+=`{${k},${A}}`:t+=`{${k}}`,e+=p[0].length,i=!1;continue}t+="\\{",e+=2,i=!1;continue}if(u==="}"){t+="\\}",e+=2,i=!1;continue}t+=o+u,e+=2,i=!1;continue}if(o==="*"&&i){t+="\\*",e++;continue}if(o==="^"){if(i){t+="^",e++;continue}t+="\\^",e++;continue}if(o==="$"){let u=e===n.length-1,a=e+2<n.length&&n[e+1]==="\\"&&n[e+2]===")";u||a?t+="$":t+="\\$",e++,i=!1;continue}o==="+"||o==="?"||o==="|"||o==="("||o===")"||o==="{"||o==="}"?t+=`\\${o}`:t+=o,e++,i=!1}return t}export{Q as a,H as b,ue as c};
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import{createRequire} from"node:module";const require=createRequire(import.meta.url);
|
|
3
|
-
async function c(e,t){if(e.length>0&&e[0]!=="-"){let i=t.fs.resolvePath(t.cwd,e[0]);try{let o=(await t.fs.readFile(i)).split(`
|
|
4
|
-
`);o[o.length-1]===""&&o.pop();let r=o.reverse();return{stdout:r.length>0?`${r.join(`
|
|
5
|
-
`)}
|
|
6
|
-
`:"",stderr:"",exitCode:0}}catch{return{stdout:"",stderr:`tac: ${e[0]}: No such file or directory
|
|
7
|
-
`,exitCode:1}}}let n=t.stdin.split(`
|
|
8
|
-
`);n[n.length-1]===""&&n.pop();let s=n.reverse();return{stdout:s.length>0?`${s.join(`
|
|
9
|
-
`)}
|
|
10
|
-
`:"",stderr:"",exitCode:0}}var u={name:"tac",execute:c},f={name:"tac",flags:[],stdinType:"text",needsFiles:!0};export{u as a,f as b};
|