@jerryan/just-bash 3.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +308 -0
- package/LICENSE +201 -0
- package/README.md +827 -0
- package/dist/AGENTS.md +383 -0
- package/dist/Bash.d.ts +317 -0
- package/dist/abort-signals.d.ts +10 -0
- package/dist/agent-sandbox.d.ts +104 -0
- package/dist/ast/types.d.ts +612 -0
- package/dist/banned-patterns-test.d.ts +1 -0
- package/dist/bin/chunks/alias-3R4G6HQY.js +3 -0
- package/dist/bin/chunks/awk2-KO7ZE3P7.js +3 -0
- package/dist/bin/chunks/base64-TQ5KOCNW.js +3 -0
- package/dist/bin/chunks/basename-C4CRGDXP.js +3 -0
- package/dist/bin/chunks/bash-CFCBBWVH.js +3 -0
- package/dist/bin/chunks/cat-BQ7FQTN5.js +3 -0
- package/dist/bin/chunks/chmod-WYYTXGVB.js +3 -0
- package/dist/bin/chunks/chunk-23OI2XDJ.js +20 -0
- package/dist/bin/chunks/chunk-2ETT4ELS.js +4 -0
- package/dist/bin/chunks/chunk-2UV6ZFHK.js +4 -0
- package/dist/bin/chunks/chunk-2YLY6FJA.js +10 -0
- package/dist/bin/chunks/chunk-3FQBUEB6.js +3 -0
- package/dist/bin/chunks/chunk-3MRB66F4.js +3 -0
- package/dist/bin/chunks/chunk-3PCPQIUD.js +3 -0
- package/dist/bin/chunks/chunk-42AMF6EE.js +3 -0
- package/dist/bin/chunks/chunk-43E7AR6A.js +3 -0
- package/dist/bin/chunks/chunk-45DUHCXR.js +7 -0
- package/dist/bin/chunks/chunk-472JZJ2D.js +22 -0
- package/dist/bin/chunks/chunk-47IFMQYS.js +3 -0
- package/dist/bin/chunks/chunk-4JF56A3P.js +15 -0
- package/dist/bin/chunks/chunk-5SKEZPTU.js +12 -0
- package/dist/bin/chunks/chunk-67XYNGRV.js +9 -0
- package/dist/bin/chunks/chunk-6ESRNSO7.js +7 -0
- package/dist/bin/chunks/chunk-6KHZX4HU.js +12 -0
- package/dist/bin/chunks/chunk-7FGDUBSN.js +14 -0
- package/dist/bin/chunks/chunk-7JZKVC3F.js +2 -0
- package/dist/bin/chunks/chunk-7PPAWLUI.js +12 -0
- package/dist/bin/chunks/chunk-7PUOS2OO.js +143 -0
- package/dist/bin/chunks/chunk-7VWOECJ3.js +101 -0
- package/dist/bin/chunks/chunk-7WBCA2BB.js +3 -0
- package/dist/bin/chunks/chunk-AGKL4LDL.js +4 -0
- package/dist/bin/chunks/chunk-AI7JUA46.js +13 -0
- package/dist/bin/chunks/chunk-AJF3OBTR.js +4 -0
- package/dist/bin/chunks/chunk-B2DRBHGQ.js +3 -0
- package/dist/bin/chunks/chunk-B2GCIQI2.js +16 -0
- package/dist/bin/chunks/chunk-B6WWC6K3.js +9 -0
- package/dist/bin/chunks/chunk-BIJXTWZ4.js +3 -0
- package/dist/bin/chunks/chunk-CC2AQ6B7.js +15 -0
- package/dist/bin/chunks/chunk-CL7IYCGG.js +20 -0
- package/dist/bin/chunks/chunk-CMTQFWZK.js +5 -0
- package/dist/bin/chunks/chunk-CPKBPQ2C.js +3 -0
- package/dist/bin/chunks/chunk-DJAX3ZRG.js +8 -0
- package/dist/bin/chunks/chunk-DN2YCFOR.js +3 -0
- package/dist/bin/chunks/chunk-DYIBFLS3.js +17 -0
- package/dist/bin/chunks/chunk-DZAFUADN.js +36 -0
- package/dist/bin/chunks/chunk-F3UDTTI7.js +13 -0
- package/dist/bin/chunks/chunk-FHMIEBRM.js +6 -0
- package/dist/bin/chunks/chunk-FONAGXRJ.js +17 -0
- package/dist/bin/chunks/chunk-FPWHWWXO.js +8 -0
- package/dist/bin/chunks/chunk-FUT3X2GJ.js +9 -0
- package/dist/bin/chunks/chunk-G4AUMZUY.js +4 -0
- package/dist/bin/chunks/chunk-GA5TPRMF.js +34 -0
- package/dist/bin/chunks/chunk-GOWX7VPU.js +7 -0
- package/dist/bin/chunks/chunk-GQKQEK5N.js +11 -0
- package/dist/bin/chunks/chunk-GR4ZHKXI.js +3 -0
- package/dist/bin/chunks/chunk-HDWHYM2T.js +18 -0
- package/dist/bin/chunks/chunk-HQ63MFHG.js +34 -0
- package/dist/bin/chunks/chunk-HW2VJKFH.js +4 -0
- package/dist/bin/chunks/chunk-HWI42GQO.js +7 -0
- package/dist/bin/chunks/chunk-HZGHQZSY.js +10 -0
- package/dist/bin/chunks/chunk-I4IRHQDW.js +3 -0
- package/dist/bin/chunks/chunk-I57EACSL.js +3 -0
- package/dist/bin/chunks/chunk-JELR4642.js +21 -0
- package/dist/bin/chunks/chunk-JQM3DKCH.js +12 -0
- package/dist/bin/chunks/chunk-K27FY3ES.js +3 -0
- package/dist/bin/chunks/chunk-KG2KXL4Y.js +3 -0
- package/dist/bin/chunks/chunk-KI54R2QB.js +3 -0
- package/dist/bin/chunks/chunk-KP2UH5CJ.js +22 -0
- package/dist/bin/chunks/chunk-KUMHQGUR.js +3 -0
- package/dist/bin/chunks/chunk-LE2XKKGQ.js +7 -0
- package/dist/bin/chunks/chunk-LJQIAFWS.js +5 -0
- package/dist/bin/chunks/chunk-LXFMIXGA.js +3 -0
- package/dist/bin/chunks/chunk-M7SIPZZZ.js +22 -0
- package/dist/bin/chunks/chunk-MF3GVFLC.js +11 -0
- package/dist/bin/chunks/chunk-MROECM42.js +3 -0
- package/dist/bin/chunks/chunk-MUFNRCMY.js +24 -0
- package/dist/bin/chunks/chunk-MVBK66TR.js +22 -0
- package/dist/bin/chunks/chunk-MYTNZ7MA.js +7 -0
- package/dist/bin/chunks/chunk-N26Y42L6.js +10 -0
- package/dist/bin/chunks/chunk-NE4R2FVV.js +5 -0
- package/dist/bin/chunks/chunk-NLU5LALY.js +37 -0
- package/dist/bin/chunks/chunk-NXUXZWS5.js +7 -0
- package/dist/bin/chunks/chunk-O2BCKSMK.js +3 -0
- package/dist/bin/chunks/chunk-OLEQNRKX.js +8 -0
- package/dist/bin/chunks/chunk-OUQKFRVR.js +6 -0
- package/dist/bin/chunks/chunk-OXLC2WWX.js +26 -0
- package/dist/bin/chunks/chunk-OYXHOZZ4.js +15 -0
- package/dist/bin/chunks/chunk-PBOVSFTJ.js +3 -0
- package/dist/bin/chunks/chunk-PPVF2N6C.js +3 -0
- package/dist/bin/chunks/chunk-PQ2INDRF.js +87 -0
- package/dist/bin/chunks/chunk-PXP4YYZA.js +13 -0
- package/dist/bin/chunks/chunk-PZQVSQX6.js +4 -0
- package/dist/bin/chunks/chunk-Q2GOPGDA.js +6 -0
- package/dist/bin/chunks/chunk-Q3LE3Y66.js +13 -0
- package/dist/bin/chunks/chunk-QES5OSUC.js +3 -0
- package/dist/bin/chunks/chunk-QFTZKD5O.js +13 -0
- package/dist/bin/chunks/chunk-QL33F2W6.js +8 -0
- package/dist/bin/chunks/chunk-QMPZXXEK.js +8 -0
- package/dist/bin/chunks/chunk-QYZN33JA.js +3 -0
- package/dist/bin/chunks/chunk-R2J5MJOM.js +20 -0
- package/dist/bin/chunks/chunk-RPUFEP5O.js +65 -0
- package/dist/bin/chunks/chunk-RVPTAYDS.js +4 -0
- package/dist/bin/chunks/chunk-SC5TEGMM.js +12 -0
- package/dist/bin/chunks/chunk-SDGPS6XI.js +10 -0
- package/dist/bin/chunks/chunk-TW2IJRUF.js +3 -0
- package/dist/bin/chunks/chunk-TYBXHT6W.js +10 -0
- package/dist/bin/chunks/chunk-V2XF3TTW.js +276 -0
- package/dist/bin/chunks/chunk-V4U26ZWL.js +16 -0
- package/dist/bin/chunks/chunk-VTAMGD42.js +3 -0
- package/dist/bin/chunks/chunk-WAJVRK5B.js +16 -0
- package/dist/bin/chunks/chunk-WEHA3JFD.js +3 -0
- package/dist/bin/chunks/chunk-WFHYGSLJ.js +6 -0
- package/dist/bin/chunks/chunk-WFVCEB5T.js +3 -0
- package/dist/bin/chunks/chunk-YERKK5B3.js +4 -0
- package/dist/bin/chunks/chunk-YIANER7Y.js +8 -0
- package/dist/bin/chunks/chunk-YJ5OCPSK.js +7 -0
- package/dist/bin/chunks/chunk-YOIFOOGX.js +9 -0
- package/dist/bin/chunks/chunk-YQEKKZTU.js +12 -0
- package/dist/bin/chunks/chunk-YUZRUF5F.js +10 -0
- package/dist/bin/chunks/chunk-ZMGLTHSU.js +15 -0
- package/dist/bin/chunks/clear-OE52K3TM.js +3 -0
- package/dist/bin/chunks/column-AJFK3TWF.js +3 -0
- package/dist/bin/chunks/comm-URDMZCXL.js +3 -0
- package/dist/bin/chunks/cp-OMVKM35F.js +3 -0
- package/dist/bin/chunks/curl-NHNZ46BU.js +31 -0
- package/dist/bin/chunks/cut-42X6363P.js +3 -0
- package/dist/bin/chunks/date-6MQGVWDY.js +3 -0
- package/dist/bin/chunks/diff-YXZZCUSQ.js +3 -0
- package/dist/bin/chunks/dirname-TPUFCYF6.js +3 -0
- package/dist/bin/chunks/dist-5MWO25Y4.js +141 -0
- package/dist/bin/chunks/du-LUFPVLNW.js +3 -0
- package/dist/bin/chunks/echo-NYDCCFWB.js +3 -0
- package/dist/bin/chunks/env-2TSVF4W7.js +3 -0
- package/dist/bin/chunks/expand-IQRKKT7D.js +3 -0
- package/dist/bin/chunks/expr-NNMDHOCN.js +3 -0
- package/dist/bin/chunks/file-4T64QNLS.js +3 -0
- package/dist/bin/chunks/find-AWH2KOY7.js +3 -0
- package/dist/bin/chunks/flag-coverage-J2ZHA465.js +3 -0
- package/dist/bin/chunks/fold-YEY7X54W.js +3 -0
- package/dist/bin/chunks/grep-CVU5V66H.js +3 -0
- package/dist/bin/chunks/gzip-FDPA6EKG.js +3 -0
- package/dist/bin/chunks/head-QKVY3SIO.js +3 -0
- package/dist/bin/chunks/help-HVIDHJ6M.js +3 -0
- package/dist/bin/chunks/history-3HAU45KT.js +3 -0
- package/dist/bin/chunks/hostname-2I76DUQL.js +3 -0
- package/dist/bin/chunks/html-to-markdown-XUMA42ZC.js +3 -0
- package/dist/bin/chunks/join-34DX7YK5.js +3 -0
- package/dist/bin/chunks/jq-V7OTAVU5.js +3 -0
- package/dist/bin/chunks/js-exec-DJQLXWCS.js +99 -0
- package/dist/bin/chunks/js-exec-worker.js +4809 -0
- package/dist/bin/chunks/ln-B35EKC2Q.js +3 -0
- package/dist/bin/chunks/ls-Q6ZZ6SQ2.js +3 -0
- package/dist/bin/chunks/md5sum-Z6KAYGDK.js +3 -0
- package/dist/bin/chunks/mkdir-74BP5NTG.js +3 -0
- package/dist/bin/chunks/mv-76LAHXFR.js +3 -0
- package/dist/bin/chunks/nl-4IZRRT7U.js +3 -0
- package/dist/bin/chunks/od-2GXD4D5K.js +3 -0
- package/dist/bin/chunks/paste-DWWA3JTW.js +3 -0
- package/dist/bin/chunks/printf-YXCSED2H.js +3 -0
- package/dist/bin/chunks/pwd-YKLNXWZI.js +3 -0
- package/dist/bin/chunks/python3-JCJHSX4Z.js +14 -0
- package/dist/bin/chunks/readlink-EHXJNW62.js +3 -0
- package/dist/bin/chunks/rev-CZTQCNOZ.js +3 -0
- package/dist/bin/chunks/rg-PXNKNIMY.js +3 -0
- package/dist/bin/chunks/rm-3PLW4O4B.js +3 -0
- package/dist/bin/chunks/rmdir-7ZIVFZJX.js +3 -0
- package/dist/bin/chunks/sed-4LVDFHIJ.js +3 -0
- package/dist/bin/chunks/seq-X2EAOGV5.js +3 -0
- package/dist/bin/chunks/sha1sum-CATBXX76.js +3 -0
- package/dist/bin/chunks/sha256sum-YGSNBVY3.js +3 -0
- package/dist/bin/chunks/sleep-DVFE2GSF.js +3 -0
- package/dist/bin/chunks/sort-HBOCBBJQ.js +3 -0
- package/dist/bin/chunks/split-ZNNNHKSP.js +3 -0
- package/dist/bin/chunks/sqlite3-KP42NNIY.js +3 -0
- package/dist/bin/chunks/sqlite3-worker.js +1928 -0
- package/dist/bin/chunks/stat-LROLDXHH.js +3 -0
- package/dist/bin/chunks/strings-CNUK76JL.js +3 -0
- package/dist/bin/chunks/tac-DG4BMYM5.js +3 -0
- package/dist/bin/chunks/tail-UOTUV25D.js +3 -0
- package/dist/bin/chunks/tar-7HGZIMZD.js +3 -0
- package/dist/bin/chunks/tee-L4HKV5PD.js +3 -0
- package/dist/bin/chunks/time-LF7BTSK5.js +3 -0
- package/dist/bin/chunks/timeout-YGFHQJKX.js +3 -0
- package/dist/bin/chunks/touch-TVQAUQOG.js +3 -0
- package/dist/bin/chunks/tr-PVFO6FRY.js +3 -0
- package/dist/bin/chunks/tree-ZGP6NPGS.js +3 -0
- package/dist/bin/chunks/true-KFTJGQLQ.js +3 -0
- package/dist/bin/chunks/unexpand-JPOQORZF.js +3 -0
- package/dist/bin/chunks/uniq-JMHDIJXT.js +3 -0
- package/dist/bin/chunks/wc-3KLVOCI2.js +3 -0
- package/dist/bin/chunks/which-4TPGVSBZ.js +3 -0
- package/dist/bin/chunks/whoami-B5HDVKW6.js +3 -0
- package/dist/bin/chunks/worker.js +3330 -0
- package/dist/bin/chunks/xan-WW53ETXT.js +3 -0
- package/dist/bin/chunks/xan-view-PD26QEFN.js +3 -0
- package/dist/bin/chunks/xargs-4AMMXFXL.js +3 -0
- package/dist/bin/chunks/yq-MYZOS2WN.js +3 -0
- package/dist/bin/just-bash.js +858 -0
- package/dist/bin/shell/chunks/alias-3R4G6HQY.js +3 -0
- package/dist/bin/shell/chunks/awk2-KO7ZE3P7.js +3 -0
- package/dist/bin/shell/chunks/base64-TQ5KOCNW.js +3 -0
- package/dist/bin/shell/chunks/basename-C4CRGDXP.js +3 -0
- package/dist/bin/shell/chunks/bash-CFCBBWVH.js +3 -0
- package/dist/bin/shell/chunks/cat-BQ7FQTN5.js +3 -0
- package/dist/bin/shell/chunks/chmod-WYYTXGVB.js +3 -0
- package/dist/bin/shell/chunks/chunk-23OI2XDJ.js +20 -0
- package/dist/bin/shell/chunks/chunk-2ETT4ELS.js +4 -0
- package/dist/bin/shell/chunks/chunk-2UV6ZFHK.js +4 -0
- package/dist/bin/shell/chunks/chunk-2YLY6FJA.js +10 -0
- package/dist/bin/shell/chunks/chunk-3FQBUEB6.js +3 -0
- package/dist/bin/shell/chunks/chunk-3MRB66F4.js +3 -0
- package/dist/bin/shell/chunks/chunk-3PCPQIUD.js +3 -0
- package/dist/bin/shell/chunks/chunk-42AMF6EE.js +3 -0
- package/dist/bin/shell/chunks/chunk-43E7AR6A.js +3 -0
- package/dist/bin/shell/chunks/chunk-45DUHCXR.js +7 -0
- package/dist/bin/shell/chunks/chunk-472JZJ2D.js +22 -0
- package/dist/bin/shell/chunks/chunk-47IFMQYS.js +3 -0
- package/dist/bin/shell/chunks/chunk-4JF56A3P.js +15 -0
- package/dist/bin/shell/chunks/chunk-5SKEZPTU.js +12 -0
- package/dist/bin/shell/chunks/chunk-67XYNGRV.js +9 -0
- package/dist/bin/shell/chunks/chunk-6ESRNSO7.js +7 -0
- package/dist/bin/shell/chunks/chunk-6KHZX4HU.js +12 -0
- package/dist/bin/shell/chunks/chunk-7FGDUBSN.js +14 -0
- package/dist/bin/shell/chunks/chunk-7JZKVC3F.js +2 -0
- package/dist/bin/shell/chunks/chunk-7PPAWLUI.js +12 -0
- package/dist/bin/shell/chunks/chunk-7PUOS2OO.js +143 -0
- package/dist/bin/shell/chunks/chunk-7VWOECJ3.js +101 -0
- package/dist/bin/shell/chunks/chunk-7WBCA2BB.js +3 -0
- package/dist/bin/shell/chunks/chunk-AGKL4LDL.js +4 -0
- package/dist/bin/shell/chunks/chunk-AI7JUA46.js +13 -0
- package/dist/bin/shell/chunks/chunk-AJF3OBTR.js +4 -0
- package/dist/bin/shell/chunks/chunk-B2DRBHGQ.js +3 -0
- package/dist/bin/shell/chunks/chunk-B2GCIQI2.js +16 -0
- package/dist/bin/shell/chunks/chunk-B6WWC6K3.js +9 -0
- package/dist/bin/shell/chunks/chunk-BIJXTWZ4.js +3 -0
- package/dist/bin/shell/chunks/chunk-CC2AQ6B7.js +15 -0
- package/dist/bin/shell/chunks/chunk-CL7IYCGG.js +20 -0
- package/dist/bin/shell/chunks/chunk-CMTQFWZK.js +5 -0
- package/dist/bin/shell/chunks/chunk-CPKBPQ2C.js +3 -0
- package/dist/bin/shell/chunks/chunk-DJAX3ZRG.js +8 -0
- package/dist/bin/shell/chunks/chunk-DN2YCFOR.js +3 -0
- package/dist/bin/shell/chunks/chunk-DYIBFLS3.js +17 -0
- package/dist/bin/shell/chunks/chunk-DZAFUADN.js +36 -0
- package/dist/bin/shell/chunks/chunk-F3UDTTI7.js +13 -0
- package/dist/bin/shell/chunks/chunk-FHMIEBRM.js +6 -0
- package/dist/bin/shell/chunks/chunk-FONAGXRJ.js +17 -0
- package/dist/bin/shell/chunks/chunk-FPWHWWXO.js +8 -0
- package/dist/bin/shell/chunks/chunk-FUT3X2GJ.js +9 -0
- package/dist/bin/shell/chunks/chunk-G4AUMZUY.js +4 -0
- package/dist/bin/shell/chunks/chunk-GA5TPRMF.js +34 -0
- package/dist/bin/shell/chunks/chunk-GOWX7VPU.js +7 -0
- package/dist/bin/shell/chunks/chunk-GQKQEK5N.js +11 -0
- package/dist/bin/shell/chunks/chunk-GR4ZHKXI.js +3 -0
- package/dist/bin/shell/chunks/chunk-HDWHYM2T.js +18 -0
- package/dist/bin/shell/chunks/chunk-HQ63MFHG.js +34 -0
- package/dist/bin/shell/chunks/chunk-HW2VJKFH.js +4 -0
- package/dist/bin/shell/chunks/chunk-HWI42GQO.js +7 -0
- package/dist/bin/shell/chunks/chunk-HZGHQZSY.js +10 -0
- package/dist/bin/shell/chunks/chunk-I4IRHQDW.js +3 -0
- package/dist/bin/shell/chunks/chunk-I57EACSL.js +3 -0
- package/dist/bin/shell/chunks/chunk-JELR4642.js +21 -0
- package/dist/bin/shell/chunks/chunk-JQM3DKCH.js +12 -0
- package/dist/bin/shell/chunks/chunk-K27FY3ES.js +3 -0
- package/dist/bin/shell/chunks/chunk-KG2KXL4Y.js +3 -0
- package/dist/bin/shell/chunks/chunk-KI54R2QB.js +3 -0
- package/dist/bin/shell/chunks/chunk-KP2UH5CJ.js +22 -0
- package/dist/bin/shell/chunks/chunk-KUMHQGUR.js +3 -0
- package/dist/bin/shell/chunks/chunk-LE2XKKGQ.js +7 -0
- package/dist/bin/shell/chunks/chunk-LJQIAFWS.js +5 -0
- package/dist/bin/shell/chunks/chunk-LXFMIXGA.js +3 -0
- package/dist/bin/shell/chunks/chunk-M7SIPZZZ.js +22 -0
- package/dist/bin/shell/chunks/chunk-MF3GVFLC.js +11 -0
- package/dist/bin/shell/chunks/chunk-MROECM42.js +3 -0
- package/dist/bin/shell/chunks/chunk-MUFNRCMY.js +24 -0
- package/dist/bin/shell/chunks/chunk-MVBK66TR.js +22 -0
- package/dist/bin/shell/chunks/chunk-MYTNZ7MA.js +7 -0
- package/dist/bin/shell/chunks/chunk-N26Y42L6.js +10 -0
- package/dist/bin/shell/chunks/chunk-NE4R2FVV.js +5 -0
- package/dist/bin/shell/chunks/chunk-NLU5LALY.js +37 -0
- package/dist/bin/shell/chunks/chunk-NXUXZWS5.js +7 -0
- package/dist/bin/shell/chunks/chunk-O2BCKSMK.js +3 -0
- package/dist/bin/shell/chunks/chunk-OLEQNRKX.js +8 -0
- package/dist/bin/shell/chunks/chunk-OUQKFRVR.js +6 -0
- package/dist/bin/shell/chunks/chunk-OXLC2WWX.js +26 -0
- package/dist/bin/shell/chunks/chunk-OYXHOZZ4.js +15 -0
- package/dist/bin/shell/chunks/chunk-PBOVSFTJ.js +3 -0
- package/dist/bin/shell/chunks/chunk-PPVF2N6C.js +3 -0
- package/dist/bin/shell/chunks/chunk-PQ2INDRF.js +87 -0
- package/dist/bin/shell/chunks/chunk-PXP4YYZA.js +13 -0
- package/dist/bin/shell/chunks/chunk-PZQVSQX6.js +4 -0
- package/dist/bin/shell/chunks/chunk-Q2GOPGDA.js +6 -0
- package/dist/bin/shell/chunks/chunk-Q3LE3Y66.js +13 -0
- package/dist/bin/shell/chunks/chunk-QES5OSUC.js +3 -0
- package/dist/bin/shell/chunks/chunk-QFTZKD5O.js +13 -0
- package/dist/bin/shell/chunks/chunk-QL33F2W6.js +8 -0
- package/dist/bin/shell/chunks/chunk-QMPZXXEK.js +8 -0
- package/dist/bin/shell/chunks/chunk-QYZN33JA.js +3 -0
- package/dist/bin/shell/chunks/chunk-R2J5MJOM.js +20 -0
- package/dist/bin/shell/chunks/chunk-RPUFEP5O.js +65 -0
- package/dist/bin/shell/chunks/chunk-RVPTAYDS.js +4 -0
- package/dist/bin/shell/chunks/chunk-SC5TEGMM.js +12 -0
- package/dist/bin/shell/chunks/chunk-SDGPS6XI.js +10 -0
- package/dist/bin/shell/chunks/chunk-TW2IJRUF.js +3 -0
- package/dist/bin/shell/chunks/chunk-TYBXHT6W.js +10 -0
- package/dist/bin/shell/chunks/chunk-V2XF3TTW.js +276 -0
- package/dist/bin/shell/chunks/chunk-V4U26ZWL.js +16 -0
- package/dist/bin/shell/chunks/chunk-VTAMGD42.js +3 -0
- package/dist/bin/shell/chunks/chunk-WAJVRK5B.js +16 -0
- package/dist/bin/shell/chunks/chunk-WEHA3JFD.js +3 -0
- package/dist/bin/shell/chunks/chunk-WFHYGSLJ.js +6 -0
- package/dist/bin/shell/chunks/chunk-WFVCEB5T.js +3 -0
- package/dist/bin/shell/chunks/chunk-YERKK5B3.js +4 -0
- package/dist/bin/shell/chunks/chunk-YIANER7Y.js +8 -0
- package/dist/bin/shell/chunks/chunk-YJ5OCPSK.js +7 -0
- package/dist/bin/shell/chunks/chunk-YOIFOOGX.js +9 -0
- package/dist/bin/shell/chunks/chunk-YQEKKZTU.js +12 -0
- package/dist/bin/shell/chunks/chunk-YUZRUF5F.js +10 -0
- package/dist/bin/shell/chunks/chunk-ZMGLTHSU.js +15 -0
- package/dist/bin/shell/chunks/clear-OE52K3TM.js +3 -0
- package/dist/bin/shell/chunks/column-AJFK3TWF.js +3 -0
- package/dist/bin/shell/chunks/comm-URDMZCXL.js +3 -0
- package/dist/bin/shell/chunks/cp-OMVKM35F.js +3 -0
- package/dist/bin/shell/chunks/curl-NHNZ46BU.js +31 -0
- package/dist/bin/shell/chunks/cut-42X6363P.js +3 -0
- package/dist/bin/shell/chunks/date-6MQGVWDY.js +3 -0
- package/dist/bin/shell/chunks/diff-YXZZCUSQ.js +3 -0
- package/dist/bin/shell/chunks/dirname-TPUFCYF6.js +3 -0
- package/dist/bin/shell/chunks/dist-5MWO25Y4.js +141 -0
- package/dist/bin/shell/chunks/du-LUFPVLNW.js +3 -0
- package/dist/bin/shell/chunks/echo-NYDCCFWB.js +3 -0
- package/dist/bin/shell/chunks/env-2TSVF4W7.js +3 -0
- package/dist/bin/shell/chunks/expand-IQRKKT7D.js +3 -0
- package/dist/bin/shell/chunks/expr-NNMDHOCN.js +3 -0
- package/dist/bin/shell/chunks/file-4T64QNLS.js +3 -0
- package/dist/bin/shell/chunks/find-AWH2KOY7.js +3 -0
- package/dist/bin/shell/chunks/flag-coverage-J2ZHA465.js +3 -0
- package/dist/bin/shell/chunks/fold-YEY7X54W.js +3 -0
- package/dist/bin/shell/chunks/grep-CVU5V66H.js +3 -0
- package/dist/bin/shell/chunks/gzip-FDPA6EKG.js +3 -0
- package/dist/bin/shell/chunks/head-QKVY3SIO.js +3 -0
- package/dist/bin/shell/chunks/help-HVIDHJ6M.js +3 -0
- package/dist/bin/shell/chunks/history-3HAU45KT.js +3 -0
- package/dist/bin/shell/chunks/hostname-2I76DUQL.js +3 -0
- package/dist/bin/shell/chunks/html-to-markdown-XUMA42ZC.js +3 -0
- package/dist/bin/shell/chunks/join-34DX7YK5.js +3 -0
- package/dist/bin/shell/chunks/jq-V7OTAVU5.js +3 -0
- package/dist/bin/shell/chunks/js-exec-DJQLXWCS.js +99 -0
- package/dist/bin/shell/chunks/ln-B35EKC2Q.js +3 -0
- package/dist/bin/shell/chunks/ls-Q6ZZ6SQ2.js +3 -0
- package/dist/bin/shell/chunks/md5sum-Z6KAYGDK.js +3 -0
- package/dist/bin/shell/chunks/mkdir-74BP5NTG.js +3 -0
- package/dist/bin/shell/chunks/mv-76LAHXFR.js +3 -0
- package/dist/bin/shell/chunks/nl-4IZRRT7U.js +3 -0
- package/dist/bin/shell/chunks/od-2GXD4D5K.js +3 -0
- package/dist/bin/shell/chunks/paste-DWWA3JTW.js +3 -0
- package/dist/bin/shell/chunks/printf-YXCSED2H.js +3 -0
- package/dist/bin/shell/chunks/pwd-YKLNXWZI.js +3 -0
- package/dist/bin/shell/chunks/python3-JCJHSX4Z.js +14 -0
- package/dist/bin/shell/chunks/readlink-EHXJNW62.js +3 -0
- package/dist/bin/shell/chunks/rev-CZTQCNOZ.js +3 -0
- package/dist/bin/shell/chunks/rg-PXNKNIMY.js +3 -0
- package/dist/bin/shell/chunks/rm-3PLW4O4B.js +3 -0
- package/dist/bin/shell/chunks/rmdir-7ZIVFZJX.js +3 -0
- package/dist/bin/shell/chunks/sed-4LVDFHIJ.js +3 -0
- package/dist/bin/shell/chunks/seq-X2EAOGV5.js +3 -0
- package/dist/bin/shell/chunks/sha1sum-CATBXX76.js +3 -0
- package/dist/bin/shell/chunks/sha256sum-YGSNBVY3.js +3 -0
- package/dist/bin/shell/chunks/sleep-DVFE2GSF.js +3 -0
- package/dist/bin/shell/chunks/sort-HBOCBBJQ.js +3 -0
- package/dist/bin/shell/chunks/split-ZNNNHKSP.js +3 -0
- package/dist/bin/shell/chunks/sqlite3-KP42NNIY.js +3 -0
- package/dist/bin/shell/chunks/stat-LROLDXHH.js +3 -0
- package/dist/bin/shell/chunks/strings-CNUK76JL.js +3 -0
- package/dist/bin/shell/chunks/tac-DG4BMYM5.js +3 -0
- package/dist/bin/shell/chunks/tail-UOTUV25D.js +3 -0
- package/dist/bin/shell/chunks/tar-7HGZIMZD.js +3 -0
- package/dist/bin/shell/chunks/tee-L4HKV5PD.js +3 -0
- package/dist/bin/shell/chunks/time-LF7BTSK5.js +3 -0
- package/dist/bin/shell/chunks/timeout-YGFHQJKX.js +3 -0
- package/dist/bin/shell/chunks/touch-TVQAUQOG.js +3 -0
- package/dist/bin/shell/chunks/tr-PVFO6FRY.js +3 -0
- package/dist/bin/shell/chunks/tree-ZGP6NPGS.js +3 -0
- package/dist/bin/shell/chunks/true-KFTJGQLQ.js +3 -0
- package/dist/bin/shell/chunks/unexpand-JPOQORZF.js +3 -0
- package/dist/bin/shell/chunks/uniq-JMHDIJXT.js +3 -0
- package/dist/bin/shell/chunks/wc-3KLVOCI2.js +3 -0
- package/dist/bin/shell/chunks/which-4TPGVSBZ.js +3 -0
- package/dist/bin/shell/chunks/whoami-B5HDVKW6.js +3 -0
- package/dist/bin/shell/chunks/xan-WW53ETXT.js +3 -0
- package/dist/bin/shell/chunks/xan-view-PD26QEFN.js +3 -0
- package/dist/bin/shell/chunks/xargs-4AMMXFXL.js +3 -0
- package/dist/bin/shell/chunks/yq-MYZOS2WN.js +3 -0
- package/dist/bin/shell/shell.js +834 -0
- package/dist/bounded-builder.d.ts +37 -0
- package/dist/browser.d.ts +23 -0
- package/dist/bundle/browser.js +1576 -0
- package/dist/bundle/chunks/alias-T5TO5GWK.js +2 -0
- package/dist/bundle/chunks/awk2-W6BNZEJN.js +2 -0
- package/dist/bundle/chunks/base64-MHVQ5XHI.js +2 -0
- package/dist/bundle/chunks/basename-SJZQ5W65.js +2 -0
- package/dist/bundle/chunks/bash-HIEWVHJ2.js +2 -0
- package/dist/bundle/chunks/cat-VZBWBIJB.js +2 -0
- package/dist/bundle/chunks/chmod-WM2JFFQC.js +2 -0
- package/dist/bundle/chunks/chunk-24NLAR7R.js +36 -0
- package/dist/bundle/chunks/chunk-26GP3ACY.js +12 -0
- package/dist/bundle/chunks/chunk-2KNTH3KH.js +9 -0
- package/dist/bundle/chunks/chunk-2SMD2AUA.js +3 -0
- package/dist/bundle/chunks/chunk-2TSZPVPI.js +21 -0
- package/dist/bundle/chunks/chunk-2VWG4LDT.js +11 -0
- package/dist/bundle/chunks/chunk-3WASQYTF.js +11 -0
- package/dist/bundle/chunks/chunk-44YCJWNC.js +6 -0
- package/dist/bundle/chunks/chunk-4EDQZIAN.js +5 -0
- package/dist/bundle/chunks/chunk-4MJ7VJG4.js +21 -0
- package/dist/bundle/chunks/chunk-4MZPEZTU.js +3 -0
- package/dist/bundle/chunks/chunk-57LGFT4S.js +3 -0
- package/dist/bundle/chunks/chunk-5I5U6IYI.js +142 -0
- package/dist/bundle/chunks/chunk-6DDRR56B.js +33 -0
- package/dist/bundle/chunks/chunk-6QF3PCMO.js +8 -0
- package/dist/bundle/chunks/chunk-6RK4AAB7.js +21 -0
- package/dist/bundle/chunks/chunk-6WGIZV3E.js +13 -0
- package/dist/bundle/chunks/chunk-73JQKNZT.js +33 -0
- package/dist/bundle/chunks/chunk-7AISL3XV.js +12 -0
- package/dist/bundle/chunks/chunk-7EUWTCWK.js +2 -0
- package/dist/bundle/chunks/chunk-7IJWBG4I.js +2 -0
- package/dist/bundle/chunks/chunk-7O2RDO2R.js +14 -0
- package/dist/bundle/chunks/chunk-A4R2GWRF.js +9 -0
- package/dist/bundle/chunks/chunk-AGH5UJJI.js +4 -0
- package/dist/bundle/chunks/chunk-ANCQ4SCV.js +2 -0
- package/dist/bundle/chunks/chunk-ASE6AYV3.js +17 -0
- package/dist/bundle/chunks/chunk-AYSZ5MAE.js +2 -0
- package/dist/bundle/chunks/chunk-BKUWXPEM.js +2 -0
- package/dist/bundle/chunks/chunk-BRJERIF4.js +2 -0
- package/dist/bundle/chunks/chunk-DAKEIWT3.js +21 -0
- package/dist/bundle/chunks/chunk-DLL7UR66.js +2 -0
- package/dist/bundle/chunks/chunk-DMWNBCXJ.js +10 -0
- package/dist/bundle/chunks/chunk-DVSA72LH.js +2 -0
- package/dist/bundle/chunks/chunk-EJFBIRMD.js +6 -0
- package/dist/bundle/chunks/chunk-EZNS4GF7.js +9 -0
- package/dist/bundle/chunks/chunk-F6XU52K3.js +35 -0
- package/dist/bundle/chunks/chunk-FHC24QSK.js +7 -0
- package/dist/bundle/chunks/chunk-FIMF2TLE.js +20 -0
- package/dist/bundle/chunks/chunk-FOCWZZDE.js +2 -0
- package/dist/bundle/chunks/chunk-FQUVK4Q5.js +11 -0
- package/dist/bundle/chunks/chunk-FSJ6TTCC.js +19 -0
- package/dist/bundle/chunks/chunk-FT6ODGOU.js +2 -0
- package/dist/bundle/chunks/chunk-FTET43KM.js +2 -0
- package/dist/bundle/chunks/chunk-FX4RBUYU.js +5 -0
- package/dist/bundle/chunks/chunk-FZRQOL3C.js +7 -0
- package/dist/bundle/chunks/chunk-FZZL53S2.js +275 -0
- package/dist/bundle/chunks/chunk-GN6CQ3J4.js +2 -0
- package/dist/bundle/chunks/chunk-HDRAUQK2.js +2 -0
- package/dist/bundle/chunks/chunk-HP7HWZ2S.js +15 -0
- package/dist/bundle/chunks/chunk-HRIJVWZS.js +14 -0
- package/dist/bundle/chunks/chunk-HXWB4Z5X.js +7 -0
- package/dist/bundle/chunks/chunk-ICLA3MUR.js +3 -0
- package/dist/bundle/chunks/chunk-IXFQXNL4.js +7 -0
- package/dist/bundle/chunks/chunk-KIGPB52X.js +2 -0
- package/dist/bundle/chunks/chunk-L2UW7DWF.js +2 -0
- package/dist/bundle/chunks/chunk-LI6PTSPD.js +9 -0
- package/dist/bundle/chunks/chunk-LPJEKUCB.js +8 -0
- package/dist/bundle/chunks/chunk-LSLPJOYM.js +3 -0
- package/dist/bundle/chunks/chunk-LVDUF74R.js +7 -0
- package/dist/bundle/chunks/chunk-MLIO3BK2.js +7 -0
- package/dist/bundle/chunks/chunk-MQKGGNPS.js +16 -0
- package/dist/bundle/chunks/chunk-N3A4JVFJ.js +2 -0
- package/dist/bundle/chunks/chunk-NBNI7G66.js +8 -0
- package/dist/bundle/chunks/chunk-NCUTH6QL.js +2 -0
- package/dist/bundle/chunks/chunk-OQ7C4FYO.js +2 -0
- package/dist/bundle/chunks/chunk-P57S6Z6R.js +6 -0
- package/dist/bundle/chunks/chunk-PCPW54JH.js +7 -0
- package/dist/bundle/chunks/chunk-PJM5C3HZ.js +25 -0
- package/dist/bundle/chunks/chunk-PPEXVPHR.js +19 -0
- package/dist/bundle/chunks/chunk-Q4JSJ3KQ.js +4 -0
- package/dist/bundle/chunks/chunk-QAYAQNCG.js +23 -0
- package/dist/bundle/chunks/chunk-QHDBQA5N.js +9 -0
- package/dist/bundle/chunks/chunk-QIQMJJZ4.js +4 -0
- package/dist/bundle/chunks/chunk-QJ7OXJAZ.js +6 -0
- package/dist/bundle/chunks/chunk-QJFYYEFV.js +11 -0
- package/dist/bundle/chunks/chunk-R2FBRMDU.js +14 -0
- package/dist/bundle/chunks/chunk-ROAWFE6V.js +5 -0
- package/dist/bundle/chunks/chunk-RPKJJFGZ.js +14 -0
- package/dist/bundle/chunks/chunk-S3ENGQML.js +15 -0
- package/dist/bundle/chunks/chunk-SBBYKIYU.js +3 -0
- package/dist/bundle/chunks/chunk-SGX4WOAM.js +2 -0
- package/dist/bundle/chunks/chunk-SHKOQWO4.js +3 -0
- package/dist/bundle/chunks/chunk-SIOONII3.js +2 -0
- package/dist/bundle/chunks/chunk-STHBFACM.js +1 -0
- package/dist/bundle/chunks/chunk-SX2HC7SO.js +2 -0
- package/dist/bundle/chunks/chunk-T6DNSPYO.js +100 -0
- package/dist/bundle/chunks/chunk-TBVD66LC.js +10 -0
- package/dist/bundle/chunks/chunk-TDD4NFYE.js +2 -0
- package/dist/bundle/chunks/chunk-TVCZIH6M.js +8 -0
- package/dist/bundle/chunks/chunk-U4K5ZDWK.js +9 -0
- package/dist/bundle/chunks/chunk-UC76ZOWM.js +15 -0
- package/dist/bundle/chunks/chunk-UIJUTQPH.js +3 -0
- package/dist/bundle/chunks/chunk-ULXTDFQC.js +2 -0
- package/dist/bundle/chunks/chunk-UTKGYVUZ.js +7 -0
- package/dist/bundle/chunks/chunk-UUIYAOD4.js +2 -0
- package/dist/bundle/chunks/chunk-VJ6UXG2R.js +64 -0
- package/dist/bundle/chunks/chunk-W2Z6LYL6.js +11 -0
- package/dist/bundle/chunks/chunk-W5DWRFSU.js +2 -0
- package/dist/bundle/chunks/chunk-WN54B5NQ.js +12 -0
- package/dist/bundle/chunks/chunk-WNH3HOQA.js +2 -0
- package/dist/bundle/chunks/chunk-WXPNKIIH.js +2 -0
- package/dist/bundle/chunks/chunk-WZQNMEQW.js +2 -0
- package/dist/bundle/chunks/chunk-XV2V56NQ.js +12 -0
- package/dist/bundle/chunks/chunk-XVSR5HHH.js +6 -0
- package/dist/bundle/chunks/chunk-XXBIOG4R.js +5 -0
- package/dist/bundle/chunks/chunk-Y62SXZKJ.js +12 -0
- package/dist/bundle/chunks/chunk-YEYSCLSJ.js +3 -0
- package/dist/bundle/chunks/chunk-YJKHREBZ.js +11 -0
- package/dist/bundle/chunks/chunk-YUSFCOM7.js +2 -0
- package/dist/bundle/chunks/chunk-ZBUZKIPX.js +6 -0
- package/dist/bundle/chunks/chunk-ZDPFA4L3.js +6 -0
- package/dist/bundle/chunks/chunk-ZT3WF5R7.js +16 -0
- package/dist/bundle/chunks/chunk-ZXFELXJH.js +6 -0
- package/dist/bundle/chunks/clear-KPIUNI6K.js +2 -0
- package/dist/bundle/chunks/column-QJI65SH2.js +2 -0
- package/dist/bundle/chunks/comm-DTWKU2MC.js +2 -0
- package/dist/bundle/chunks/cp-2KZIPZJS.js +2 -0
- package/dist/bundle/chunks/curl-K4WT7UPN.js +30 -0
- package/dist/bundle/chunks/cut-FMDNVWQN.js +2 -0
- package/dist/bundle/chunks/date-7OEDRA27.js +2 -0
- package/dist/bundle/chunks/diff-CSARC7WF.js +2 -0
- package/dist/bundle/chunks/dirname-Z2ZMOOW2.js +2 -0
- package/dist/bundle/chunks/du-7AZCLKR6.js +2 -0
- package/dist/bundle/chunks/echo-PLLZYM2L.js +2 -0
- package/dist/bundle/chunks/env-VUUMB47B.js +2 -0
- package/dist/bundle/chunks/expand-J3VOSOMK.js +2 -0
- package/dist/bundle/chunks/expr-XSBELPAC.js +2 -0
- package/dist/bundle/chunks/file-URNAD6FQ.js +2 -0
- package/dist/bundle/chunks/find-END3EAHV.js +2 -0
- package/dist/bundle/chunks/flag-coverage-DPSAPFXA.js +2 -0
- package/dist/bundle/chunks/fold-QJBPHRFJ.js +2 -0
- package/dist/bundle/chunks/grep-4AYF3A5J.js +2 -0
- package/dist/bundle/chunks/gzip-RQOBR22H.js +2 -0
- package/dist/bundle/chunks/head-6UIPFWVJ.js +2 -0
- package/dist/bundle/chunks/help-QDDMBDU7.js +2 -0
- package/dist/bundle/chunks/history-3N762S3K.js +2 -0
- package/dist/bundle/chunks/hostname-CESD3CQR.js +2 -0
- package/dist/bundle/chunks/html-to-markdown-PE6BPRPA.js +2 -0
- package/dist/bundle/chunks/join-C2B6NGXH.js +2 -0
- package/dist/bundle/chunks/jq-NY7PCVMH.js +2 -0
- package/dist/bundle/chunks/js-exec-XKF2B7C3.js +98 -0
- package/dist/bundle/chunks/js-exec-worker.js +4809 -0
- package/dist/bundle/chunks/ln-OPY2ZVGQ.js +2 -0
- package/dist/bundle/chunks/ls-ZPXGZX63.js +2 -0
- package/dist/bundle/chunks/md5sum-JEDX55KS.js +2 -0
- package/dist/bundle/chunks/mkdir-WDDKK2P3.js +2 -0
- package/dist/bundle/chunks/mv-ZF6UBVRB.js +2 -0
- package/dist/bundle/chunks/nl-IELOWYJG.js +2 -0
- package/dist/bundle/chunks/od-Z4AIL3P4.js +2 -0
- package/dist/bundle/chunks/paste-ZNHNSRBW.js +2 -0
- package/dist/bundle/chunks/printf-B2NSYQ3N.js +2 -0
- package/dist/bundle/chunks/pwd-76BPYV5F.js +2 -0
- package/dist/bundle/chunks/python3-F5S5TYGS.js +13 -0
- package/dist/bundle/chunks/readlink-U5OM5A3M.js +2 -0
- package/dist/bundle/chunks/rev-EPOS3MFH.js +2 -0
- package/dist/bundle/chunks/rg-NAMXBYKS.js +2 -0
- package/dist/bundle/chunks/rm-JQ4GDKDD.js +2 -0
- package/dist/bundle/chunks/rmdir-YJKPQVCK.js +2 -0
- package/dist/bundle/chunks/sed-LIRH26EA.js +2 -0
- package/dist/bundle/chunks/seq-B6KDLMYQ.js +2 -0
- package/dist/bundle/chunks/sha1sum-BLPZJ6MP.js +2 -0
- package/dist/bundle/chunks/sha256sum-VJZ4PHQ4.js +2 -0
- package/dist/bundle/chunks/sleep-PPRBTSVR.js +2 -0
- package/dist/bundle/chunks/sort-CB5GO7XH.js +2 -0
- package/dist/bundle/chunks/split-JICLAMP6.js +2 -0
- package/dist/bundle/chunks/sqlite3-4EZ4GXVD.js +2 -0
- package/dist/bundle/chunks/sqlite3-worker.js +1928 -0
- package/dist/bundle/chunks/stat-LXFZND2P.js +2 -0
- package/dist/bundle/chunks/strings-VLFTYX2Z.js +2 -0
- package/dist/bundle/chunks/tac-YXC4HBTR.js +2 -0
- package/dist/bundle/chunks/tail-UBGSN4JF.js +2 -0
- package/dist/bundle/chunks/tar-B72KU357.js +2 -0
- package/dist/bundle/chunks/tee-OOWSWHRQ.js +2 -0
- package/dist/bundle/chunks/time-NERE2JJ2.js +2 -0
- package/dist/bundle/chunks/timeout-C6WDYPLV.js +2 -0
- package/dist/bundle/chunks/touch-W4DF6Z4T.js +2 -0
- package/dist/bundle/chunks/tr-UI2LA3GA.js +2 -0
- package/dist/bundle/chunks/tree-7OOL2MH6.js +2 -0
- package/dist/bundle/chunks/true-QUBPEGGU.js +2 -0
- package/dist/bundle/chunks/unexpand-YD5BWFH4.js +2 -0
- package/dist/bundle/chunks/uniq-PAEPA27E.js +2 -0
- package/dist/bundle/chunks/wc-7WVM7GV4.js +2 -0
- package/dist/bundle/chunks/which-UWVKETYW.js +2 -0
- package/dist/bundle/chunks/whoami-KR6E7UIR.js +2 -0
- package/dist/bundle/chunks/worker.js +3330 -0
- package/dist/bundle/chunks/xan-UIGVJCMA.js +2 -0
- package/dist/bundle/chunks/xan-view-FOCYCKZQ.js +2 -0
- package/dist/bundle/chunks/xargs-VQEXRD3C.js +2 -0
- package/dist/bundle/chunks/yq-FGNXZCGX.js +2 -0
- package/dist/bundle/index.cjs +2237 -0
- package/dist/bundle/index.js +809 -0
- package/dist/commands/alias/alias.d.ts +6 -0
- package/dist/commands/awk/ast.d.ts +202 -0
- package/dist/commands/awk/awk2.d.ts +9 -0
- package/dist/commands/awk/builtins.d.ts +17 -0
- package/dist/commands/awk/interpreter/context.d.ts +88 -0
- package/dist/commands/awk/interpreter/expressions.d.ts +17 -0
- package/dist/commands/awk/interpreter/fields.d.ts +25 -0
- package/dist/commands/awk/interpreter/index.d.ts +8 -0
- package/dist/commands/awk/interpreter/interpreter.d.ts +54 -0
- package/dist/commands/awk/interpreter/statements.d.ts +11 -0
- package/dist/commands/awk/interpreter/type-coercion.d.ts +32 -0
- package/dist/commands/awk/interpreter/types.d.ts +13 -0
- package/dist/commands/awk/interpreter/variables.d.ts +35 -0
- package/dist/commands/awk/lexer.d.ts +101 -0
- package/dist/commands/awk/parser2-print.d.ts +38 -0
- package/dist/commands/awk/parser2.d.ts +96 -0
- package/dist/commands/base64/base64.d.ts +7 -0
- package/dist/commands/basename/basename.d.ts +4 -0
- package/dist/commands/bash/bash.d.ts +6 -0
- package/dist/commands/browser-excluded.d.ts +16 -0
- package/dist/commands/cat/cat.d.ts +4 -0
- package/dist/commands/chmod/chmod.d.ts +4 -0
- package/dist/commands/clear/clear.d.ts +4 -0
- package/dist/commands/column/column.d.ts +11 -0
- package/dist/commands/comm/comm.d.ts +12 -0
- package/dist/commands/compression/codec-budget.d.ts +35 -0
- package/dist/commands/cp/cp.d.ts +4 -0
- package/dist/commands/curl/curl.d.ts +8 -0
- package/dist/commands/curl/form.d.ts +23 -0
- package/dist/commands/curl/help.d.ts +9 -0
- package/dist/commands/curl/parse.d.ts +9 -0
- package/dist/commands/curl/response-formatting.d.ts +20 -0
- package/dist/commands/curl/types.d.ts +70 -0
- package/dist/commands/cut/cut.d.ts +4 -0
- package/dist/commands/date/date.d.ts +7 -0
- package/dist/commands/diff/diff.d.ts +7 -0
- package/dist/commands/dirname/dirname.d.ts +4 -0
- package/dist/commands/du/du.d.ts +4 -0
- package/dist/commands/duration.d.ts +5 -0
- package/dist/commands/echo/echo.d.ts +4 -0
- package/dist/commands/env/env.d.ts +6 -0
- package/dist/commands/expand/expand.d.ts +12 -0
- package/dist/commands/expand/unexpand.d.ts +12 -0
- package/dist/commands/expr/expr.d.ts +9 -0
- package/dist/commands/file/file.d.ts +9 -0
- package/dist/commands/find/find.d.ts +4 -0
- package/dist/commands/find/matcher.d.ts +53 -0
- package/dist/commands/find/parser.d.ts +2 -0
- package/dist/commands/find/types.d.ts +89 -0
- package/dist/commands/flag-coverage.d.ts +2 -0
- package/dist/commands/fold/fold.d.ts +12 -0
- package/dist/commands/format-mode.d.ts +4 -0
- package/dist/commands/fuzz-flags-types.d.ts +17 -0
- package/dist/commands/fuzz-flags.d.ts +8 -0
- package/dist/commands/grep/grep.d.ts +8 -0
- package/dist/commands/gzip/gzip.d.ts +13 -0
- package/dist/commands/head/head-tail-shared.d.ts +38 -0
- package/dist/commands/head/head.d.ts +4 -0
- package/dist/commands/help/help.d.ts +4 -0
- package/dist/commands/help.d.ts +16 -0
- package/dist/commands/history/history.d.ts +4 -0
- package/dist/commands/hostname/hostname.d.ts +11 -0
- package/dist/commands/html-to-markdown/html-to-markdown.d.ts +9 -0
- package/dist/commands/join/join.d.ts +12 -0
- package/dist/commands/jq/jq.d.ts +9 -0
- package/dist/commands/js-exec/fetch-polyfill.d.ts +6 -0
- package/dist/commands/js-exec/js-exec-worker.d.ts +33 -0
- package/dist/commands/js-exec/js-exec.d.ts +13 -0
- package/dist/commands/js-exec/module-shims.d.ts +29 -0
- package/dist/commands/js-exec/path-polyfill.d.ts +6 -0
- package/dist/commands/ln/ln.d.ts +4 -0
- package/dist/commands/ls/ls.d.ts +4 -0
- package/dist/commands/md5sum/checksum.d.ts +7 -0
- package/dist/commands/md5sum/md5sum.d.ts +4 -0
- package/dist/commands/md5sum/sha1sum.d.ts +4 -0
- package/dist/commands/md5sum/sha256sum.d.ts +4 -0
- package/dist/commands/mkdir/mkdir.d.ts +4 -0
- package/dist/commands/mv/mv.d.ts +4 -0
- package/dist/commands/nl/nl.d.ts +12 -0
- package/dist/commands/od/od.d.ts +12 -0
- package/dist/commands/paste/paste.d.ts +4 -0
- package/dist/commands/printf/escapes.d.ts +27 -0
- package/dist/commands/printf/printf.d.ts +4 -0
- package/dist/commands/printf/strftime.d.ts +14 -0
- package/dist/commands/pwd/pwd.d.ts +4 -0
- package/dist/commands/python3/python3.d.ts +16 -0
- package/dist/commands/python3/worker.d.ts +31 -0
- package/dist/commands/query-engine/builtins/array-builtins.d.ts +20 -0
- package/dist/commands/query-engine/builtins/control-builtins.d.ts +18 -0
- package/dist/commands/query-engine/builtins/date-builtins.d.ts +15 -0
- package/dist/commands/query-engine/builtins/format-builtins.d.ts +11 -0
- package/dist/commands/query-engine/builtins/index-builtins.d.ts +16 -0
- package/dist/commands/query-engine/builtins/index.d.ts +17 -0
- package/dist/commands/query-engine/builtins/math-builtins.d.ts +15 -0
- package/dist/commands/query-engine/builtins/navigation-builtins.d.ts +18 -0
- package/dist/commands/query-engine/builtins/object-builtins.d.ts +15 -0
- package/dist/commands/query-engine/builtins/path-builtins.d.ts +20 -0
- package/dist/commands/query-engine/builtins/sql-builtins.d.ts +16 -0
- package/dist/commands/query-engine/builtins/string-builtins.d.ts +15 -0
- package/dist/commands/query-engine/builtins/type-builtins.d.ts +11 -0
- package/dist/commands/query-engine/evaluator.d.ts +62 -0
- package/dist/commands/query-engine/index.d.ts +8 -0
- package/dist/commands/query-engine/json-output.d.ts +11 -0
- package/dist/commands/query-engine/parser-types.d.ts +171 -0
- package/dist/commands/query-engine/parser.d.ts +14 -0
- package/dist/commands/query-engine/path-operations.d.ts +15 -0
- package/dist/commands/query-engine/safe-object.d.ts +84 -0
- package/dist/commands/query-engine/value-operations.d.ts +44 -0
- package/dist/commands/readlink/readlink.d.ts +4 -0
- package/dist/commands/registry.d.ts +56 -0
- package/dist/commands/rev/rev.d.ts +13 -0
- package/dist/commands/rg/file-types.d.ts +49 -0
- package/dist/commands/rg/gitignore.d.ts +98 -0
- package/dist/commands/rg/rg-options.d.ts +61 -0
- package/dist/commands/rg/rg-parser.d.ts +20 -0
- package/dist/commands/rg/rg-search.d.ts +15 -0
- package/dist/commands/rg/rg.d.ts +14 -0
- package/dist/commands/rm/rm.d.ts +4 -0
- package/dist/commands/rmdir/rmdir.d.ts +4 -0
- package/dist/commands/search-engine/index.d.ts +10 -0
- package/dist/commands/search-engine/matcher.d.ts +72 -0
- package/dist/commands/search-engine/regex.d.ts +46 -0
- package/dist/commands/sed/executor.d.ts +7 -0
- package/dist/commands/sed/lexer.d.ts +88 -0
- package/dist/commands/sed/parser.d.ts +21 -0
- package/dist/commands/sed/sed-regex.d.ts +23 -0
- package/dist/commands/sed/sed.d.ts +4 -0
- package/dist/commands/sed/types.d.ts +216 -0
- package/dist/commands/seq/seq.d.ts +16 -0
- package/dist/commands/sleep/sleep.d.ts +4 -0
- package/dist/commands/sort/comparator.d.ts +9 -0
- package/dist/commands/sort/parser.d.ts +11 -0
- package/dist/commands/sort/sort.d.ts +4 -0
- package/dist/commands/sort/types.d.ts +30 -0
- package/dist/commands/split/split.d.ts +12 -0
- package/dist/commands/sqlite3/formatters.d.ts +17 -0
- package/dist/commands/sqlite3/sqlite3.d.ts +24 -0
- package/dist/commands/sqlite3/worker.d.ts +50 -0
- package/dist/commands/sqlite3/worker.js +1928 -0
- package/dist/commands/stat/stat.d.ts +4 -0
- package/dist/commands/strings/strings.d.ts +12 -0
- package/dist/commands/tac/tac.d.ts +11 -0
- package/dist/commands/tail/tail.d.ts +4 -0
- package/dist/commands/tar/archive.d.ts +150 -0
- package/dist/commands/tar/bzip2-compress.d.ts +18 -0
- package/dist/commands/tar/tar-options.d.ts +37 -0
- package/dist/commands/tar/tar.d.ts +10 -0
- package/dist/commands/tee/tee.d.ts +4 -0
- package/dist/commands/time/time.d.ts +27 -0
- package/dist/commands/timeout/timeout.d.ts +4 -0
- package/dist/commands/touch/touch.d.ts +4 -0
- package/dist/commands/tr/tr.d.ts +4 -0
- package/dist/commands/tree/tree.d.ts +4 -0
- package/dist/commands/true/true.d.ts +6 -0
- package/dist/commands/uniq/uniq.d.ts +4 -0
- package/dist/commands/wc/wc.d.ts +4 -0
- package/dist/commands/which/which.d.ts +4 -0
- package/dist/commands/whoami/whoami.d.ts +11 -0
- package/dist/commands/worker-bridge/bridge-handler.d.ts +73 -0
- package/dist/commands/worker-bridge/protocol.d.ts +141 -0
- package/dist/commands/worker-bridge/sync-backend.d.ts +86 -0
- package/dist/commands/worker-request-controller.d.ts +36 -0
- package/dist/commands/xan/aggregation.d.ts +30 -0
- package/dist/commands/xan/bounded-output.d.ts +4 -0
- package/dist/commands/xan/column-selection.d.ts +20 -0
- package/dist/commands/xan/csv.d.ts +62 -0
- package/dist/commands/xan/moonblade-parser.d.ts +89 -0
- package/dist/commands/xan/moonblade-to-jq.d.ts +12 -0
- package/dist/commands/xan/moonblade-tokenizer.d.ts +32 -0
- package/dist/commands/xan/subcommands.d.ts +15 -0
- package/dist/commands/xan/xan-agg.d.ts +8 -0
- package/dist/commands/xan/xan-columns.d.ts +8 -0
- package/dist/commands/xan/xan-core.d.ts +10 -0
- package/dist/commands/xan/xan-data.d.ts +52 -0
- package/dist/commands/xan/xan-filter.d.ts +8 -0
- package/dist/commands/xan/xan-map.d.ts +11 -0
- package/dist/commands/xan/xan-reshape.d.ts +40 -0
- package/dist/commands/xan/xan-simple.d.ts +40 -0
- package/dist/commands/xan/xan-view.d.ts +12 -0
- package/dist/commands/xan/xan.d.ts +10 -0
- package/dist/commands/xargs/xargs.d.ts +4 -0
- package/dist/commands/yq/formats.d.ts +65 -0
- package/dist/commands/yq/yq.d.ts +13 -0
- package/dist/custom-commands.d.ts +65 -0
- package/dist/encoding.d.ts +131 -0
- package/dist/execution-output.d.ts +28 -0
- package/dist/execution-scope.d.ts +110 -0
- package/dist/fatal-execution-error.d.ts +27 -0
- package/dist/fs/encoding.d.ts +17 -0
- package/dist/fs/identity.d.ts +9 -0
- package/dist/fs/in-memory-fs/in-memory-fs.d.ts +98 -0
- package/dist/fs/in-memory-fs/index.d.ts +1 -0
- package/dist/fs/init.d.ts +22 -0
- package/dist/fs/interface.d.ts +255 -0
- package/dist/fs/mountable-fs/index.d.ts +1 -0
- package/dist/fs/mountable-fs/mountable-fs.d.ts +118 -0
- package/dist/fs/overlay-fs/apply.d.ts +22 -0
- package/dist/fs/overlay-fs/index.d.ts +1 -0
- package/dist/fs/overlay-fs/overlay-fs.d.ts +360 -0
- package/dist/fs/overlay-fs/overlay-tree.d.ts +188 -0
- package/dist/fs/path-utils.d.ts +48 -0
- package/dist/fs/read-write-fs/index.d.ts +1 -0
- package/dist/fs/read-write-fs/read-write-fs.d.ts +150 -0
- package/dist/fs/real-fs-utils.d.ts +90 -0
- package/dist/fs/sanitize-error.d.ts +19 -0
- package/dist/fs/traversal.d.ts +98 -0
- package/dist/index.d.cts +30 -0
- package/dist/index.d.ts +30 -0
- package/dist/interpreter/alias-expansion.d.ts +27 -0
- package/dist/interpreter/arithmetic.d.ts +24 -0
- package/dist/interpreter/assignment-expansion.d.ts +24 -0
- package/dist/interpreter/builtin-dispatch.d.ts +46 -0
- package/dist/interpreter/builtins/break.d.ts +6 -0
- package/dist/interpreter/builtins/cd.d.ts +6 -0
- package/dist/interpreter/builtins/compgen.d.ts +26 -0
- package/dist/interpreter/builtins/complete.d.ts +17 -0
- package/dist/interpreter/builtins/compopt.d.ts +28 -0
- package/dist/interpreter/builtins/continue.d.ts +6 -0
- package/dist/interpreter/builtins/declare-array-parsing.d.ts +18 -0
- package/dist/interpreter/builtins/declare-print.d.ts +39 -0
- package/dist/interpreter/builtins/declare.d.ts +35 -0
- package/dist/interpreter/builtins/dirs.d.ts +29 -0
- package/dist/interpreter/builtins/eval.d.ts +15 -0
- package/dist/interpreter/builtins/exit.d.ts +5 -0
- package/dist/interpreter/builtins/export.d.ts +14 -0
- package/dist/interpreter/builtins/getopts.d.ts +18 -0
- package/dist/interpreter/builtins/hash.d.ts +19 -0
- package/dist/interpreter/builtins/help.d.ts +12 -0
- package/dist/interpreter/builtins/index.d.ts +44 -0
- package/dist/interpreter/builtins/let.d.ts +18 -0
- package/dist/interpreter/builtins/local.d.ts +6 -0
- package/dist/interpreter/builtins/mapfile.d.ts +17 -0
- package/dist/interpreter/builtins/read.d.ts +6 -0
- package/dist/interpreter/builtins/return.d.ts +6 -0
- package/dist/interpreter/builtins/set.d.ts +9 -0
- package/dist/interpreter/builtins/shift.d.ts +15 -0
- package/dist/interpreter/builtins/shopt.d.ts +7 -0
- package/dist/interpreter/builtins/source.d.ts +6 -0
- package/dist/interpreter/builtins/unset.d.ts +16 -0
- package/dist/interpreter/builtins/variable-assignment.d.ts +69 -0
- package/dist/interpreter/command-analysis.d.ts +30 -0
- package/dist/interpreter/command-resolution.d.ts +43 -0
- package/dist/interpreter/conditionals.d.ts +17 -0
- package/dist/interpreter/control-flow.d.ts +21 -0
- package/dist/interpreter/defense-aware-command-context.d.ts +6 -0
- package/dist/interpreter/errors.d.ts +161 -0
- package/dist/interpreter/expansion/analysis.d.ts +37 -0
- package/dist/interpreter/expansion/arith-text-expansion.d.ts +20 -0
- package/dist/interpreter/expansion/array-pattern-ops.d.ts +21 -0
- package/dist/interpreter/expansion/array-prefix-suffix.d.ts +46 -0
- package/dist/interpreter/expansion/array-slice-transform.d.ts +36 -0
- package/dist/interpreter/expansion/array-word-expansion.d.ts +39 -0
- package/dist/interpreter/expansion/brace-range.d.ts +24 -0
- package/dist/interpreter/expansion/command-substitution.d.ts +23 -0
- package/dist/interpreter/expansion/glob-escape.d.ts +32 -0
- package/dist/interpreter/expansion/indirect-expansion.d.ts +42 -0
- package/dist/interpreter/expansion/parameter-ops.d.ts +113 -0
- package/dist/interpreter/expansion/pattern-expansion.d.ts +23 -0
- package/dist/interpreter/expansion/pattern-removal.d.ts +17 -0
- package/dist/interpreter/expansion/pattern-replacement.d.ts +4 -0
- package/dist/interpreter/expansion/pattern.d.ts +23 -0
- package/dist/interpreter/expansion/positional-params.d.ts +59 -0
- package/dist/interpreter/expansion/prompt.d.ts +39 -0
- package/dist/interpreter/expansion/quoting.d.ts +13 -0
- package/dist/interpreter/expansion/tilde.d.ts +14 -0
- package/dist/interpreter/expansion/unquoted-expansion.d.ts +76 -0
- package/dist/interpreter/expansion/variable-attrs.d.ts +19 -0
- package/dist/interpreter/expansion/variable.d.ts +36 -0
- package/dist/interpreter/expansion/word-glob-expansion.d.ts +33 -0
- package/dist/interpreter/expansion/word-split.d.ts +29 -0
- package/dist/interpreter/expansion.d.ts +53 -0
- package/dist/interpreter/fd-table.d.ts +130 -0
- package/dist/interpreter/functions.d.ts +14 -0
- package/dist/interpreter/helpers/array.d.ts +56 -0
- package/dist/interpreter/helpers/bounded-array.d.ts +2 -0
- package/dist/interpreter/helpers/condition.d.ts +19 -0
- package/dist/interpreter/helpers/errors.d.ts +8 -0
- package/dist/interpreter/helpers/file-tests.d.ts +33 -0
- package/dist/interpreter/helpers/ifs.d.ts +104 -0
- package/dist/interpreter/helpers/loop.d.ts +24 -0
- package/dist/interpreter/helpers/nameref.d.ts +65 -0
- package/dist/interpreter/helpers/numeric-compare.d.ts +13 -0
- package/dist/interpreter/helpers/quoting.d.ts +26 -0
- package/dist/interpreter/helpers/readonly.d.ts +45 -0
- package/dist/interpreter/helpers/regex.d.ts +8 -0
- package/dist/interpreter/helpers/result.d.ts +60 -0
- package/dist/interpreter/helpers/shell-constants.d.ts +41 -0
- package/dist/interpreter/helpers/shellopts.d.ts +28 -0
- package/dist/interpreter/helpers/string-compare.d.ts +24 -0
- package/dist/interpreter/helpers/string-tests.d.ts +13 -0
- package/dist/interpreter/helpers/variable-tests.d.ts +9 -0
- package/dist/interpreter/helpers/word-matching.d.ts +16 -0
- package/dist/interpreter/helpers/word-parts.d.ts +22 -0
- package/dist/interpreter/helpers/xtrace.d.ts +18 -0
- package/dist/interpreter/index.d.ts +3 -0
- package/dist/interpreter/interpreter.d.ts +82 -0
- package/dist/interpreter/numeric-fd-redirects.d.ts +8 -0
- package/dist/interpreter/pipeline-execution.d.ts +16 -0
- package/dist/interpreter/process-substitution.d.ts +62 -0
- package/dist/interpreter/redirections.d.ts +50 -0
- package/dist/interpreter/simple-command-assignments.d.ts +36 -0
- package/dist/interpreter/state-transaction.d.ts +7 -0
- package/dist/interpreter/subshell-group.d.ts +40 -0
- package/dist/interpreter/type-command.d.ts +37 -0
- package/dist/interpreter/types.d.ts +402 -0
- package/dist/limits.d.ts +111 -0
- package/dist/network/allow-list/shared.d.ts +49 -0
- package/dist/network/allow-list.d.ts +59 -0
- package/dist/network/dns-pin.d.ts +42 -0
- package/dist/network/fetch.d.ts +27 -0
- package/dist/network/index.d.ts +7 -0
- package/dist/network/types.d.ts +182 -0
- package/dist/parser/arithmetic-parser.d.ts +23 -0
- package/dist/parser/arithmetic-primaries.d.ts +45 -0
- package/dist/parser/command-parser.d.ts +10 -0
- package/dist/parser/compound-parser.d.ts +28 -0
- package/dist/parser/conditional-parser.d.ts +8 -0
- package/dist/parser/expansion-parser.d.ts +18 -0
- package/dist/parser/lexer.d.ts +195 -0
- package/dist/parser/parser-substitution.d.ts +85 -0
- package/dist/parser/parser.d.ts +152 -0
- package/dist/parser/types.d.ts +40 -0
- package/dist/parser/word-parser.d.ts +35 -0
- package/dist/sandbox/Command.d.ts +35 -0
- package/dist/sandbox/Sandbox.d.ts +121 -0
- package/dist/sandbox/index.d.ts +2 -0
- package/dist/security/blocked-globals.d.ts +60 -0
- package/dist/security/defense-context.d.ts +13 -0
- package/dist/security/defense-in-depth-box.d.ts +354 -0
- package/dist/security/index.d.ts +33 -0
- package/dist/security/safe-timestamp.d.ts +1 -0
- package/dist/security/security-violation-logger.d.ts +99 -0
- package/dist/security/trusted-globals.d.ts +17 -0
- package/dist/security/types.d.ts +151 -0
- package/dist/security/violation-error-message.d.ts +3 -0
- package/dist/security/wasm-callback.d.ts +6 -0
- package/dist/security/worker-defense-in-depth.d.ts +228 -0
- package/dist/shell-metadata.d.ts +25 -0
- package/dist/source-limit.d.ts +2 -0
- package/dist/timers.d.ts +16 -0
- package/dist/transform/pipeline.d.ts +8 -0
- package/dist/transform/plugins/command-collector.d.ts +8 -0
- package/dist/transform/plugins/tee-plugin.d.ts +40 -0
- package/dist/transform/serialize.d.ts +4 -0
- package/dist/transform/types.d.ts +18 -0
- package/dist/types.d.ts +319 -0
- package/dist/utils/args.d.ts +55 -0
- package/dist/utils/constants.d.ts +15 -0
- package/dist/utils/file-reader.d.ts +76 -0
- package/dist/utils/glob.d.ts +25 -0
- package/dist/vitest-setup.d.ts +1 -0
- package/package.json +136 -0
- package/vendor/cpython-emscripten/python.cjs +2 -0
- package/vendor/cpython-emscripten/python.wasm +0 -0
- package/vendor/cpython-emscripten/python313.zip +0 -0
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import{createRequire} from"node:module";const require=createRequire(import.meta.url);
|
|
3
|
+
import{a as t}from"./chunk-HWI42GQO.js";import{l as n,m as r,n as i}from"./chunk-FUT3X2GJ.js";function e(o){return o instanceof n||o instanceof r||o instanceof t||o instanceof i}function E(o){if(e(o))throw o}export{e as a,E as b};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import{createRequire} from"node:module";const require=createRequire(import.meta.url);
|
|
3
|
+
import{l as h}from"./chunk-FUT3X2GJ.js";import{a as c,b as p}from"./chunk-CPKBPQ2C.js";import{a as N,b as v,c as y}from"./chunk-MUFNRCMY.js";var x={name:"nl",summary:"number lines of files",usage:"nl [OPTION]... [FILE]...",description:"Write each FILE to standard output, with line numbers added. If no FILE is specified, standard input is read.",options:["-b STYLE Body numbering style: a (all), t (non-empty), n (none)","-n FORMAT Number format: ln (left), rn (right), rz (right zeros)","-w WIDTH Number width (default: 6)","-s SEP Separator after number (default: TAB)","-v START Starting line number (default: 1)","-i INCR Line number increment (default: 1)"],examples:["nl file.txt # Number non-empty lines","nl -ba file.txt # Number all lines","nl -n rz -w 3 file.txt # Right-justified with zeros","nl -s ': ' file.txt # Use ': ' as separator"]};function $(i,r,s){let l=String(i);switch(r){case"ln":return l.padEnd(s);case"rn":return l.padStart(s);case"rz":return l.padStart(s,"0");default:return r}}function S(i,r){switch(r){case"a":return!0;case"t":return i.trim().length>0;case"n":return!1;default:return r}}function w(i,r,s,l){if(i==="")return{output:"",nextNumber:s};let o=i.split(`
|
|
4
|
+
`),d=[],t=0,u=s,f=i.endsWith(`
|
|
5
|
+
`)&&o[o.length-1]==="";f&&o.pop();for(let n of o){let e=d.length>0?1:0,m=c(r.separator)+c(n);if(S(n,r.bodyStyle)){let a=Math.max(String(u).length,r.width)+m+e;if(a>l-t)throw new h(`nl: output size limit exceeded (${l} bytes)`,"output_size");let b=`${$(u,r.numberFormat,r.width)}${r.separator}${n}`;d.push(b),t+=a,u+=r.increment}else{let a=r.width+m+e;if(a>l-t)throw new h(`nl: output size limit exceeded (${l} bytes)`,"output_size");let b=`${" ".repeat(r.width)}${r.separator}${n}`;d.push(b),t+=a}}if(f&&t+1>l)throw new h(`nl: output size limit exceeded (${l} bytes)`,"output_size");return{output:d.join(`
|
|
6
|
+
`)+(f?`
|
|
7
|
+
`:""),nextNumber:u}}var I={name:"nl",execute:async(i,r)=>{if(v(i))return N(x);let s={bodyStyle:"t",numberFormat:"rn",width:6,separator:" ",startNumber:1,increment:1},l=[],o=Math.min(r.limits.maxStringLength,r.limits.maxOutputSize),d=o,t=0;for(;t<i.length;){let n=i[t];if(n==="-b"&&t+1<i.length){let e=i[t+1];if(e!=="a"&&e!=="t"&&e!=="n")return{exitCode:1,stdout:"",stderr:`nl: invalid body numbering style: '${e}'
|
|
8
|
+
`};s.bodyStyle=e,t+=2}else if(n.startsWith("-b")){let e=n.slice(2);if(e!=="a"&&e!=="t"&&e!=="n")return{exitCode:1,stdout:"",stderr:`nl: invalid body numbering style: '${e}'
|
|
9
|
+
`};s.bodyStyle=e,t++}else if(n==="-n"&&t+1<i.length){let e=i[t+1];if(e!=="ln"&&e!=="rn"&&e!=="rz")return{exitCode:1,stdout:"",stderr:`nl: invalid line numbering format: '${e}'
|
|
10
|
+
`};s.numberFormat=e,t+=2}else if(n.startsWith("-n")){let e=n.slice(2);if(e!=="ln"&&e!=="rn"&&e!=="rz")return{exitCode:1,stdout:"",stderr:`nl: invalid line numbering format: '${e}'
|
|
11
|
+
`};s.numberFormat=e,t++}else if(n==="-w"&&t+1<i.length){let e=/^\d+$/.test(i[t+1])?Number(i[t+1]):NaN;if(!Number.isSafeInteger(e)||e<1||e>o)return{exitCode:1,stdout:"",stderr:`nl: invalid line number field width: '${i[t+1]}'
|
|
12
|
+
`};s.width=e,t+=2}else if(n.startsWith("-w")){let e=/^\d+$/.test(n.slice(2))?Number(n.slice(2)):NaN;if(!Number.isSafeInteger(e)||e<1||e>o)return{exitCode:1,stdout:"",stderr:`nl: invalid line number field width: '${n.slice(2)}'
|
|
13
|
+
`};s.width=e,t++}else if(n==="-s"&&t+1<i.length)s.separator=i[t+1],t+=2;else if(n.startsWith("-s"))s.separator=n.slice(2),t++;else if(n==="-v"&&t+1<i.length){let e=parseInt(i[t+1],10);if(Number.isNaN(e))return{exitCode:1,stdout:"",stderr:`nl: invalid starting line number: '${i[t+1]}'
|
|
14
|
+
`};s.startNumber=e,t+=2}else if(n.startsWith("-v")){let e=parseInt(n.slice(2),10);if(Number.isNaN(e))return{exitCode:1,stdout:"",stderr:`nl: invalid starting line number: '${n.slice(2)}'
|
|
15
|
+
`};s.startNumber=e,t++}else if(n==="-i"&&t+1<i.length){let e=parseInt(i[t+1],10);if(Number.isNaN(e))return{exitCode:1,stdout:"",stderr:`nl: invalid line number increment: '${i[t+1]}'
|
|
16
|
+
`};s.increment=e,t+=2}else if(n.startsWith("-i")){let e=parseInt(n.slice(2),10);if(Number.isNaN(e))return{exitCode:1,stdout:"",stderr:`nl: invalid line number increment: '${n.slice(2)}'
|
|
17
|
+
`};s.increment=e,t++}else if(n==="--"){l.push(...i.slice(t+1));break}else{if(n.startsWith("-")&&n!=="-")return y("nl",n);l.push(n),t++}}let u="",f=s.startNumber;if(l.length===0){let n=p(r.stdin)??"";u=w(n,s,f,d).output}else for(let n of l){let e=r.fs.resolvePath(r.cwd,n),m=await r.fs.readFile(e);if(m===null)return{exitCode:1,stdout:u,stderr:`nl: ${n}: No such file or directory
|
|
18
|
+
`};let a=w(m,s,f,d-c(u));u+=a.output,f=a.nextNumber}return{exitCode:0,stdout:u,stderr:""}}},L={name:"nl",flags:[{flag:"-b",type:"value",valueHint:"string"},{flag:"-n",type:"value",valueHint:"string"},{flag:"-w",type:"value",valueHint:"number"},{flag:"-s",type:"value",valueHint:"string"},{flag:"-v",type:"value",valueHint:"number"},{flag:"-i",type:"value",valueHint:"number"}],stdinType:"text",needsFiles:!0};export{I as a,L as b};
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import{createRequire} from"node:module";const require=createRequire(import.meta.url);
|
|
3
|
+
import{a as w}from"./chunk-QES5OSUC.js";import{b as m}from"./chunk-GR4ZHKXI.js";import{d as v}from"./chunk-I57EACSL.js";import{e as B}from"./chunk-WEHA3JFD.js";import{l as z}from"./chunk-FUT3X2GJ.js";import{a as L}from"./chunk-NE4R2FVV.js";import{a as F,b as E}from"./chunk-MUFNRCMY.js";import{constants as C,gunzipSync as _,gzipSync as A}from"node:zlib";var D={name:"gzip",summary:"compress or expand files",usage:"gzip [OPTION]... [FILE]...",description:`Compress FILEs (by default, in-place).
|
|
4
|
+
|
|
5
|
+
When no FILE is given, or when FILE is -, read from standard input.
|
|
6
|
+
|
|
7
|
+
With -d, decompress instead.`,options:["-c, --stdout write to standard output, keep original files","-d, --decompress decompress","-f, --force force overwrite of output file","-k, --keep keep (don't delete) input files","-l, --list list compressed file contents","-n, --no-name do not save or restore the original name and timestamp","-N, --name save or restore the original file name and timestamp","-q, --quiet suppress all warnings","-r, --recursive operate recursively on directories","-S, --suffix=SUF use suffix SUF on compressed files (default: .gz)","-t, --test test compressed file integrity","-v, --verbose verbose mode","-1, --fast compress faster","-9, --best compress better"," --help display this help and exit"]},H={name:"gunzip",summary:"decompress files",usage:"gunzip [OPTION]... [FILE]...",description:`Decompress FILEs (by default, in-place).
|
|
8
|
+
|
|
9
|
+
When no FILE is given, or when FILE is -, read from standard input.`,options:["-c, --stdout write to standard output, keep original files","-f, --force force overwrite of output file","-k, --keep keep (don't delete) input files","-l, --list list compressed file contents","-n, --no-name do not restore the original name and timestamp","-N, --name restore the original file name and timestamp","-q, --quiet suppress all warnings","-r, --recursive operate recursively on directories","-S, --suffix=SUF use suffix SUF on compressed files (default: .gz)","-t, --test test compressed file integrity","-v, --verbose verbose mode"," --help display this help and exit"]},R={name:"zcat",summary:"decompress files to stdout",usage:"zcat [OPTION]... [FILE]...",description:`Decompress FILEs to standard output.
|
|
10
|
+
|
|
11
|
+
When no FILE is given, or when FILE is -, read from standard input.`,options:["-f, --force force; read compressed data even from a terminal","-l, --list list compressed file contents","-q, --quiet suppress all warnings","-S, --suffix=SUF use suffix SUF on compressed files (default: .gz)","-t, --test test compressed file integrity","-v, --verbose verbose mode"," --help display this help and exit"]},G={stdout:{short:"c",long:"stdout",type:"boolean"},toStdout:{long:"to-stdout",type:"boolean"},decompress:{short:"d",long:"decompress",type:"boolean"},uncompress:{long:"uncompress",type:"boolean"},force:{short:"f",long:"force",type:"boolean"},keep:{short:"k",long:"keep",type:"boolean"},list:{short:"l",long:"list",type:"boolean"},noName:{short:"n",long:"no-name",type:"boolean"},name:{short:"N",long:"name",type:"boolean"},quiet:{short:"q",long:"quiet",type:"boolean"},recursive:{short:"r",long:"recursive",type:"boolean"},suffix:{short:"S",long:"suffix",type:"string",default:".gz"},test:{short:"t",long:"test",type:"boolean"},verbose:{short:"v",long:"verbose",type:"boolean"},fast:{short:"1",long:"fast",type:"boolean"},level2:{short:"2",type:"boolean"},level3:{short:"3",type:"boolean"},level4:{short:"4",type:"boolean"},level5:{short:"5",type:"boolean"},level6:{short:"6",type:"boolean"},level7:{short:"7",type:"boolean"},level8:{short:"8",type:"boolean"},best:{short:"9",long:"best",type:"boolean"}};function I(e){return e.best?C.Z_BEST_COMPRESSION:e.level8?8:e.level7?7:e.level6?6:e.level5?5:e.level4?4:e.level3?3:e.level2?2:e.fast?C.Z_BEST_SPEED:C.Z_DEFAULT_COMPRESSION}function k(e){if(e.length<10)return{originalName:null,mtime:null,headerSize:0};if(e[0]!==31||e[1]!==139)return{originalName:null,mtime:null,headerSize:0};let t=e[3],o=e[4]|e[5]<<8|e[6]<<16|e[7]<<24,r=10;if(t&4){if(r+2>e.length)return{originalName:null,mtime:null,headerSize:0};let n=e[r]|e[r+1]<<8;r+=2+n}let i=null;if(t&8){let n=r;for(;r<e.length&&e[r]!==0;)r++;r<e.length&&(i=new TextDecoder().decode(e.slice(n,r)),r++)}if(t&16){for(;r<e.length&&e[r]!==0;)r++;r++}return t&2&&(r+=2),{originalName:i,mtime:o>0?new Date(o*1e3):null,headerSize:r}}function Z(e){return e.length===0||e==="."||e===".."||e.includes("/")||e.includes("\\")||/[\0-\x1f\x7f]/.test(e)?null:e}function q(e){if(e.length<4)return 0;let t=e.length;return e[t-4]|e[t-3]<<8|e[t-2]<<16|e[t-1]<<24}function x(e){return e.length>=2&&e[0]===31&&e[1]===139}function b(e){return Buffer.from(e).toString("latin1")}function P(e){return e.limits.maxOutputSize}function $(e,t,o,r,i){if(t<=0)throw new Error("decompressed data exceeds limit (0 bytes)");let n=new w({maxInputBytes:o,maxOutputBytes:t,maxExpansionRatio:1e4,signal:r,label:"gzip"});if(n.acceptInput(e.length),q(e)>t)throw new Error(`decompressed data exceeds limit (${t} bytes)`);let a;try{let u=Math.min(t,Math.floor((i?.executionScope?.remainingLiveBytes??t*2)/2));if(u<=0)throw new Error("gzip: live byte limit exceeded");a=i?.executionScope?.reserveBytes("gzip output",u*2,"gzip");let p=_(e,{maxOutputLength:u});return n.acceptOutput(p.length),{data:p,lease:a}}catch(u){throw a?.release(),u}}function O(e,t,o){let r=new w({maxInputBytes:o.limits.maxInputBytes,maxOutputBytes:o.limits.maxOutputSize,signal:o.signal,label:"gzip"});r.acceptInput(e.length);let i;try{let n=Math.min(o.limits.maxOutputSize,Math.floor((o.executionScope?.remainingLiveBytes??o.limits.maxOutputSize*2)/2));if(n<=0)throw new Error("gzip: live byte limit exceeded");i=o.executionScope?.reserveBytes("gzip output",n*2,"gzip");let s=A(e,{level:t,maxOutputLength:n});return r.acceptOutput(s.length),{data:s,lease:i}}catch(n){throw i?.release(),n}}async function T(e,t,o){let r=await e.fs.stat(t);if(r.size>e.limits.maxInputBytes)throw new z(`input size limit exceeded (${e.limits.maxInputBytes} bytes)`,"string_length");let i=e.executionScope?.reserveBytes("gzip input",r.size,o);try{let n=await e.fs.readFileBuffer(t);if(n.byteLength>r.size)throw new z("gzip: input grew while being read","string_length");return e.executionScope?.consumeInput(n.byteLength,o),{data:n,lease:i}}catch(n){throw i?.release(),n}}async function W(e,t,o){if(t!=="-"&&t!=="")return T(e,e.fs.resolvePath(e.cwd,t),o);let r=e.stdin,i=e.executionScope?.reserveBytes("gzip input",r.length,o);try{return{data:Uint8Array.from(r,n=>n.charCodeAt(0)),lease:i}}catch(n){throw i?.release(),n}}async function M(e,t,o,r,i,n){let s=o.suffix,a,u,p,g=P(e);if(t==="-"||t===""){let l=e.stdin,d=e.executionScope?.reserveBytes("gzip input",l.length,r),f;try{if(p=Uint8Array.from(l,c=>c.charCodeAt(0)),i){if(!x(p))return o.quiet?{stdout:"",stderr:"",exitCode:1}:{stdout:"",stderr:`${r}: stdin: not in gzip format
|
|
12
|
+
`,exitCode:1};try{let c=$(p,g,e.limits.maxInputBytes,e.signal,e);return f=c.lease,{stdout:b(c.data),stderr:"",exitCode:0}}catch(c){m(c);let U=c instanceof Error?c.message:"unknown error";return{stdout:"",stderr:`${r}: stdin: ${U}
|
|
13
|
+
`,exitCode:1}}}else{let c=O(p,I(o),e);return f=c.lease,{stdout:b(c.data),stderr:"",exitCode:0}}}finally{f?.release(),d?.release()}}a=e.fs.resolvePath(e.cwd,t);try{let l=await e.fs.stat(a);if(l.size>e.limits.maxInputBytes)return{stdout:"",stderr:`${r}: ${t}: input size limit exceeded (${e.limits.maxInputBytes} bytes)
|
|
14
|
+
`,exitCode:1};if(l.isDirectory)return o.recursive?await K(e,a,o,r,i,n):o.quiet?{stdout:"",stderr:"",exitCode:1}:{stdout:"",stderr:`${r}: ${t}: is a directory -- ignored
|
|
15
|
+
`,exitCode:1}}catch{return{stdout:"",stderr:`${r}: ${t}: No such file or directory
|
|
16
|
+
`,exitCode:1}}let y,h;try{let l=await T(e,a,r);p=l.data,y=l.lease}catch(l){return m(l),{stdout:"",stderr:`${r}: ${t}: No such file or directory
|
|
17
|
+
`,exitCode:1}}try{if(i){if(!t.endsWith(s))return o.quiet?{stdout:"",stderr:"",exitCode:1}:{stdout:"",stderr:`${r}: ${t}: unknown suffix -- ignored
|
|
18
|
+
`,exitCode:1};if(!x(p))return o.quiet?{stdout:"",stderr:"",exitCode:1}:{stdout:"",stderr:`${r}: ${t}: not in gzip format
|
|
19
|
+
`,exitCode:1};let l;try{let d=$(p,g,e.limits.maxInputBytes,e.signal,e);l=d.data,h=d.lease}catch(d){m(d);let f=d instanceof Error?d.message:"unknown error";return{stdout:"",stderr:`${r}: ${t}: ${f}
|
|
20
|
+
`,exitCode:1}}if(n)return{stdout:b(l),stderr:"",exitCode:0};if(o.name){let d=k(p),f=d.originalName?Z(d.originalName):null;f?u=e.fs.resolvePath(e.cwd,f):u=a.slice(0,-s.length)}else u=a.slice(0,-s.length);if(!o.force)try{return await e.fs.stat(u),{stdout:"",stderr:`${r}: ${u} already exists; not overwritten
|
|
21
|
+
`,exitCode:1}}catch{}if(await e.fs.writeFile(u,l),!o.keep&&!n&&await e.fs.rm(a),o.verbose){let d=p.length>0?((1-p.length/l.length)*100).toFixed(1):"0.0";return{stdout:"",stderr:`${t}: ${d}% -- replaced with ${u.split("/").pop()}
|
|
22
|
+
`,exitCode:0}}return{stdout:"",stderr:"",exitCode:0}}else{if(t.endsWith(s))return o.quiet?{stdout:"",stderr:"",exitCode:1}:{stdout:"",stderr:`${r}: ${t} already has ${s} suffix -- unchanged
|
|
23
|
+
`,exitCode:1};let l=I(o),d;try{let f=O(p,l,e);d=f.data,h=f.lease}catch(f){m(f);let c=f instanceof Error?f.message:"unknown error";return{stdout:"",stderr:`${r}: ${t}: ${c}
|
|
24
|
+
`,exitCode:1}}if(n)return{stdout:b(d),stderr:"",exitCode:0};if(u=a+s,!o.force)try{return await e.fs.stat(u),{stdout:"",stderr:`${r}: ${u} already exists; not overwritten
|
|
25
|
+
`,exitCode:1}}catch{}if(await e.fs.writeFile(u,d),!o.keep&&!n&&await e.fs.rm(a),o.verbose){let f=p.length>0?((1-d.length/p.length)*100).toFixed(1):"0.0";return{stdout:"",stderr:`${t}: ${f}% -- replaced with ${u.split("/").pop()}
|
|
26
|
+
`,exitCode:0}}return{stdout:"",stderr:"",exitCode:0}}}finally{h?.release(),y?.release()}}async function K(e,t,o,r,i,n){let s=Math.min(e.limits.maxOutputSize,e.limits.maxStringLength),a=new v(s,r),u=new v(s,r),p=0;return await B({fs:e.fs,root:t,symlinks:"never",limits:e.limits,signal:e.signal,executionScope:e.executionScope,site:r},async g=>{if(g.depth===0||g.phase!=="enter"||!g.stat.isFile)return;let y=o.suffix;if(i&&!g.path.endsWith(y)||!i&&g.path.endsWith(y))return;let h=g.path.startsWith(`${e.cwd}/`)?g.path.slice(e.cwd.length+1):g.path,l=await M(e,h,o,r,i,n);a.append(l.stdout),u.append(l.stderr),l.exitCode!==0&&(p=l.exitCode)}),{stdout:a.build(),stderr:u.build(),exitCode:p}}async function j(e,t,o,r){let i,n;try{let s=await W(e,t,r);i=s.data,n=s.lease}catch(s){return m(s),{stdout:"",stderr:`${r}: ${t}: No such file or directory
|
|
27
|
+
`,exitCode:1}}try{if(!x(i))return o.quiet?{stdout:"",stderr:"",exitCode:1}:{stdout:"",stderr:`${r}: ${t}: not in gzip format
|
|
28
|
+
`,exitCode:1};let s=i.length,a=q(i),u=a>0?((1-s/a)*100).toFixed(1):"0.0",g=k(i).originalName||(t==="-"?"":t.replace(/\.gz$/,""));return{stdout:`${s.toString().padStart(10)} ${a.toString().padStart(10)} ${u.padStart(5)}% ${g}
|
|
29
|
+
`,stderr:"",exitCode:0}}finally{n?.release()}}async function J(e,t,o,r){let i,n;try{let s=await W(e,t,r);i=s.data,n=s.lease}catch(s){return m(s),{stdout:"",stderr:`${r}: ${t}: No such file or directory
|
|
30
|
+
`,exitCode:1}}try{if(!x(i))return o.quiet?{stdout:"",stderr:"",exitCode:1}:{stdout:"",stderr:`${r}: ${t}: not in gzip format
|
|
31
|
+
`,exitCode:1};try{return $(i,P(e),e.limits.maxInputBytes,e.signal,e).lease?.release(),o.verbose?{stdout:"",stderr:`${t}: OK
|
|
32
|
+
`,exitCode:0}:{stdout:"",stderr:"",exitCode:0}}catch(s){m(s);let a=s instanceof Error?s.message:"invalid";return{stdout:"",stderr:`${r}: ${t}: ${a}
|
|
33
|
+
`,exitCode:1}}}finally{n?.release()}}async function S(e,t,o){let r=o==="zcat"?R:o==="gunzip"?H:D;if(E(e))return F(r);let i=L(o,e,G);if(!i.ok)return i.error.stderr.includes("unrecognized option"),i.error;let n=i.result.flags,s=i.result.positional,a=o==="gunzip"||o==="zcat"||n.decompress||n.uncompress,u=o==="zcat"||n.stdout||n.toStdout;if(n.list){s.length===0&&(s=["-"]);let h=` compressed uncompressed ratio uncompressed_name
|
|
34
|
+
`,l="",d=0;for(let f of s){let c=await j(t,f,n,o);h+=c.stdout,l+=c.stderr,c.exitCode!==0&&(d=c.exitCode)}return{stdout:h,stderr:l,exitCode:d}}if(n.test){s.length===0&&(s=["-"]);let h="",l="",d=0;for(let f of s){let c=await J(t,f,n,o);h+=c.stdout,l+=c.stderr,c.exitCode!==0&&(d=c.exitCode)}return{stdout:h,stderr:l,exitCode:d}}s.length===0&&(s=["-"]);let p="",g="",y=0;for(let h of s){let l=await M(t,h,n,o,a,u);p+=l.stdout,g+=l.stderr,l.exitCode!==0&&(y=l.exitCode)}return{stdout:p,stderr:g,exitCode:y}}var se={name:"gzip",async execute(e,t){return{...await S(e,t,"gzip"),stdoutEncoding:"binary"}}},ie={name:"gunzip",async execute(e,t){return{...await S(e,t,"gunzip"),stdoutEncoding:"binary"}}},le={name:"zcat",async execute(e,t){return{...await S(e,t,"zcat"),stdoutEncoding:"binary"}}},ue={name:"gzip",flags:[{flag:"-c",type:"boolean"},{flag:"-d",type:"boolean"},{flag:"-f",type:"boolean"},{flag:"-k",type:"boolean"},{flag:"-l",type:"boolean"},{flag:"-n",type:"boolean"},{flag:"-q",type:"boolean"},{flag:"-r",type:"boolean"},{flag:"-t",type:"boolean"},{flag:"-v",type:"boolean"},{flag:"-1",type:"boolean"},{flag:"-9",type:"boolean"}],stdinType:"binary",needsFiles:!0},ae={name:"gunzip",flags:[{flag:"-c",type:"boolean"},{flag:"-f",type:"boolean"},{flag:"-k",type:"boolean"},{flag:"-q",type:"boolean"},{flag:"-v",type:"boolean"}],stdinType:"binary",needsFiles:!0},de={name:"zcat",flags:[{flag:"-f",type:"boolean"},{flag:"-q",type:"boolean"},{flag:"-v",type:"boolean"}],stdinType:"binary",needsFiles:!0};export{se as a,ie as b,le as c,ue as d,ae as e,de as f};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import{createRequire} from"node:module";const require=createRequire(import.meta.url);
|
|
3
|
+
import{l as g}from"./chunk-FUT3X2GJ.js";import{a as f}from"./chunk-CPKBPQ2C.js";function O(n,e,u,r={}){let t=new Date(e*1e3),a=M(t,u),c="",s=0,o=0,i=0,y=new Map,h=d=>{let m=f(d);if(r.maxOutputBytes!==void 0&&m>r.maxOutputBytes-s)throw new g(`strftime: output size limit exceeded (${r.maxOutputBytes} bytes)`,"output_size");c+=d,s+=m};for(;o<n.length;){if(i++,r.maxOperations!==void 0&&i>r.maxOperations)throw new g(`strftime: iteration limit exceeded (${r.maxOperations})`,"iterations");if(n[o]==="%"&&o+1<n.length){let d=n[o+1],m;y.has(d)?m=y.get(d)??null:(m=w(t,a,d,u),y.set(d,m)),m!==null?(h(m),o+=2):(h(n[o]),o++)}else h(n[o]),o++}return c}function M(n,e){let u={year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",weekday:"short",hour12:!1,timeZone:e};try{let t=new Intl.DateTimeFormat("en-US",u).formatToParts(n),a=i=>t.find(y=>y.type===i)?.value??"",c=new Map([["Sun",0],["Mon",1],["Tue",2],["Wed",3],["Thu",4],["Fri",5],["Sat",6]]),s=a("weekday"),o=(i,y)=>{let h=Number.parseInt(i,10);return Number.isNaN(h)?y:h};return{year:o(a("year"),n.getFullYear()),month:o(a("month"),n.getMonth()+1),day:o(a("day"),n.getDate()),hour:o(a("hour"),n.getHours())%24,minute:o(a("minute"),n.getMinutes()),second:o(a("second"),n.getSeconds()),weekday:c.get(s)??n.getDay()}}catch{return{year:n.getFullYear(),month:n.getMonth()+1,day:n.getDate(),hour:n.getHours(),minute:n.getMinutes(),second:n.getSeconds(),weekday:n.getDay()}}}function w(n,e,u,r){let t=(o,i=2)=>String(o).padStart(i,"0"),a=$(e.year,e.month,e.day),c=l(e.year,e.month,e.day,e.weekday,0),s=l(e.year,e.month,e.day,e.weekday,1);switch(u){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," ")} ${t(e.hour)}:${t(e.minute)}:${t(e.second)} ${e.year}`;case"C":return t(Math.floor(e.year/100));case"d":return t(e.day);case"D":return`${t(e.month)}/${t(e.day)}/${t(e.year%100)}`;case"e":return String(e.day).padStart(2," ");case"F":return`${e.year}-${t(e.month)}-${t(e.day)}`;case"g":return t(S(e.year,e.month,e.day)%100);case"G":return String(S(e.year,e.month,e.day));case"H":return t(e.hour);case"I":return t(e.hour%12||12);case"j":return String(a).padStart(3,"0");case"k":return String(e.hour).padStart(2," ");case"l":return String(e.hour%12||12).padStart(2," ");case"m":return t(e.month);case"M":return t(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`${t(e.hour%12||12)}:${t(e.minute)}:${t(e.second)} ${e.hour<12?"AM":"PM"}`;case"R":return`${t(e.hour)}:${t(e.minute)}`;case"s":return String(Math.floor(n.getTime()/1e3));case"S":return t(e.second);case"t":return" ";case"T":return`${t(e.hour)}:${t(e.minute)}:${t(e.second)}`;case"u":return String(e.weekday===0?7:e.weekday);case"U":return t(c);case"V":return t(k(e.year,e.month,e.day));case"w":return String(e.weekday);case"W":return t(s);case"x":return`${t(e.month)}/${t(e.day)}/${t(e.year%100)}`;case"X":return`${t(e.hour)}:${t(e.minute)}:${t(e.second)}`;case"y":return t(e.year%100);case"Y":return String(e.year);case"z":return D(n,r);case"Z":return T(n,r);case"%":return"%";default:return null}}function D(n,e){if(!e){let c=-n.getTimezoneOffset(),s=c>=0?"+":"-",o=Math.floor(Math.abs(c)/60),i=Math.abs(c)%60;return`${s}${String(o).padStart(2,"0")}${String(i).padStart(2,"0")}`}try{let o=new Intl.DateTimeFormat("en-US",{timeZone:e,timeZoneName:"longOffset"}).formatToParts(n).find(i=>i.type==="timeZoneName");if(o){let i=o.value.match(/GMT([+-])(\d{2}):(\d{2})/);if(i)return`${i[1]}${i[2]}${i[3]}`;if(o.value==="GMT"||o.value==="UTC")return"+0000"}}catch{}let u=-n.getTimezoneOffset(),r=u>=0?"+":"-",t=Math.floor(Math.abs(u)/60),a=Math.abs(u)%60;return`${r}${String(t).padStart(2,"0")}${String(a).padStart(2,"0")}`}function T(n,e){try{return new Intl.DateTimeFormat("en-US",{timeZone:e,timeZoneName:"short"}).formatToParts(n).find(a=>a.type==="timeZoneName")?.value??"UTC"}catch{return"UTC"}}function $(n,e,u){let r=[31,28,31,30,31,30,31,31,30,31,30,31];(n%4===0&&n%100!==0||n%400===0)&&(r[1]=29);let a=u;for(let c=0;c<e-1;c++)a+=r[c];return a}function l(n,e,u,r,t){let a=$(n,e,u),c=new Date(n,0,1).getDay(),s=1+(7+t-c)%7,o=a-s;return o<0?0:Math.floor(o/7)+1}function k(n,e,u){let r=new Date(n,e-1,u,12,0,0);r.setDate(r.getDate()+3-(r.getDay()+6)%7);let t=new Date(r.getFullYear(),0,4);t.setDate(t.getDate()+3-(t.getDay()+6)%7);let a=r.getTime()-t.getTime();return 1+Math.round(a/(10080*60*1e3))}function S(n,e,u){let r=new Date(n,e-1,u,12,0,0);return r.setDate(r.getDate()+3-(r.getDay()+6)%7),r.getFullYear()}export{O as a};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import{createRequire} from"node:module";const require=createRequire(import.meta.url);
|
|
3
|
+
import*as M from"node:async_hooks";import*as $ from"node:module";var v;function T(){return v||w(),v}function w(){let a=[{prop:"Function",target:globalThis,violationType:"function_constructor",strategy:"throw",reason:"Function constructor allows arbitrary code execution"},{prop:"eval",target:globalThis,violationType:"eval",strategy:"throw",reason:"eval() allows arbitrary code execution"},{prop:"setTimeout",target:globalThis,violationType:"setTimeout",strategy:"throw",reason:"setTimeout with string argument allows code execution"},{prop:"setInterval",target:globalThis,violationType:"setInterval",strategy:"throw",reason:"setInterval with string argument allows code execution"},{prop:"setImmediate",target:globalThis,violationType:"setImmediate",strategy:"throw",reason:"setImmediate could be used to escape sandbox context"},{prop:"env",target:process,violationType:"process_env",strategy:"throw",reason:"process.env could leak sensitive environment variables",allowedKeys:new Set(["NODE_V8_COVERAGE","NODE_DEBUG","NODE_DEBUG_NATIVE","NODE_COMPILE_CACHE","NODE_ENV","WATCH_REPORT_DEPENDENCIES","FORCE_COLOR","DEBUG","UNDICI_NO_FG","JEST_WORKER_ID","__MINIMATCH_TESTING_PLATFORM__","LOG_TOKENS","LOG_STREAM"])},{prop:"binding",target:process,violationType:"process_binding",strategy:"throw",reason:"process.binding provides access to native Node.js modules"},{prop:"_linkedBinding",target:process,violationType:"process_binding",strategy:"throw",reason:"process._linkedBinding provides access to native Node.js modules"},{prop:"dlopen",target:process,violationType:"process_dlopen",strategy:"throw",reason:"process.dlopen allows loading native addons"},{prop:"getBuiltinModule",target:process,violationType:"process_get_builtin_module",strategy:"throw",reason:"process.getBuiltinModule allows loading native Node.js modules (fs, child_process, vm)"},{prop:"exit",target:process,violationType:"process_exit",strategy:"throw",reason:"process.exit could terminate the interpreter"},{prop:"abort",target:process,violationType:"process_exit",strategy:"throw",reason:"process.abort could crash the interpreter"},{prop:"kill",target:process,violationType:"process_kill",strategy:"throw",reason:"process.kill could signal other processes"},{prop:"setuid",target:process,violationType:"process_setuid",strategy:"throw",reason:"process.setuid could escalate privileges"},{prop:"setgid",target:process,violationType:"process_setuid",strategy:"throw",reason:"process.setgid could escalate privileges"},{prop:"seteuid",target:process,violationType:"process_setuid",strategy:"throw",reason:"process.seteuid could escalate effective user privileges"},{prop:"setegid",target:process,violationType:"process_setuid",strategy:"throw",reason:"process.setegid could escalate effective group privileges"},{prop:"initgroups",target:process,violationType:"process_setuid",strategy:"throw",reason:"process.initgroups could modify supplementary group IDs"},{prop:"setgroups",target:process,violationType:"process_setuid",strategy:"throw",reason:"process.setgroups could modify supplementary group IDs"},{prop:"umask",target:process,violationType:"process_umask",strategy:"throw",reason:"process.umask could modify file creation permissions"},{prop:"argv",target:process,violationType:"process_argv",strategy:"throw",reason:"process.argv may contain secrets in CLI arguments"},{prop:"cwd",target:process,violationType:"process_chdir",strategy:"throw",reason:"process.cwd could disclose real host working directory path"},{prop:"chdir",target:process,violationType:"process_chdir",strategy:"throw",reason:"process.chdir could confuse the interpreter's CWD tracking"},{prop:"report",target:process,violationType:"process_report",strategy:"throw",reason:"process.report could disclose full environment, host paths, and system info"},{prop:"loadEnvFile",target:process,violationType:"process_env",strategy:"throw",reason:"process.loadEnvFile could load env files bypassing env proxy"},{prop:"setUncaughtExceptionCaptureCallback",target:process,violationType:"process_exception_handler",strategy:"throw",reason:"setUncaughtExceptionCaptureCallback could intercept security errors"},...["on","once","addListener","prependListener","prependOnceListener"].map(t=>({prop:t,target:process,violationType:"process_exception_handler",strategy:"throw",reason:"process-global listeners can outlive the sandbox and lose its security context"})),{prop:"send",target:process,violationType:"process_send",strategy:"throw",reason:"process.send could communicate with parent process in IPC contexts"},{prop:"channel",target:process,violationType:"process_channel",strategy:"throw",reason:"process.channel could access IPC channel to parent process"},{prop:"cpuUsage",target:process,violationType:"process_timing",strategy:"throw",reason:"process.cpuUsage could enable timing side-channel attacks"},{prop:"memoryUsage",target:process,violationType:"process_timing",strategy:"throw",reason:"process.memoryUsage could enable timing side-channel attacks"},{prop:"hrtime",target:process,violationType:"process_timing",strategy:"throw",reason:"process.hrtime could enable timing side-channel attacks"},{prop:"WeakRef",target:globalThis,violationType:"weak_ref",strategy:"throw",reason:"WeakRef could be used to leak references outside sandbox"},{prop:"FinalizationRegistry",target:globalThis,violationType:"finalization_registry",strategy:"throw",reason:"FinalizationRegistry could be used to leak references outside sandbox"},{prop:"Reflect",target:globalThis,violationType:"reflect",strategy:"freeze",reason:"Reflect provides introspection capabilities"},{prop:"Proxy",target:globalThis,violationType:"proxy",strategy:"throw",reason:"Proxy allows intercepting and modifying object behavior"},{prop:"WebAssembly",target:globalThis,violationType:"webassembly",strategy:"throw",reason:"WebAssembly allows executing arbitrary compiled code"},{prop:"SharedArrayBuffer",target:globalThis,violationType:"shared_array_buffer",strategy:"throw",reason:"SharedArrayBuffer could enable side-channel communication or timing attacks"},{prop:"Atomics",target:globalThis,violationType:"atomics",strategy:"throw",reason:"Atomics could enable side-channel communication or timing attacks"},{prop:"performance",target:globalThis,violationType:"performance_timing",strategy:"throw",reason:"performance.now() provides sub-millisecond timing for side-channel attacks"},{prop:"stdout",target:process,violationType:"process_stdout",strategy:"throw",reason:"process.stdout could bypass interpreter output to write to host stdout"},{prop:"stderr",target:process,violationType:"process_stderr",strategy:"throw",reason:"process.stderr could bypass interpreter output to write to host stderr"},{prop:"__defineGetter__",target:Object.prototype,violationType:"prototype_mutation",strategy:"throw",reason:"__defineGetter__ allows prototype pollution via getter injection"},{prop:"__defineSetter__",target:Object.prototype,violationType:"prototype_mutation",strategy:"throw",reason:"__defineSetter__ allows prototype pollution via setter injection"},{prop:"__lookupGetter__",target:Object.prototype,violationType:"prototype_mutation",strategy:"throw",reason:"__lookupGetter__ enables introspection for prototype pollution attacks"},{prop:"__lookupSetter__",target:Object.prototype,violationType:"prototype_mutation",strategy:"throw",reason:"__lookupSetter__ enables introspection for prototype pollution attacks"},{prop:"JSON",target:globalThis,violationType:"json_mutation",strategy:"freeze",reason:"Freeze JSON to prevent mutation of parsing/serialization"},{prop:"Math",target:globalThis,violationType:"math_mutation",strategy:"freeze",reason:"Freeze Math to prevent mutation of math utilities"}];try{let t=Object.getPrototypeOf(async()=>{}).constructor;t&&t!==Function&&a.push({prop:"constructor",target:Object.getPrototypeOf(async()=>{}),violationType:"async_function_constructor",strategy:"throw",reason:"AsyncFunction constructor allows arbitrary async code execution"})}catch{}try{let t=Object.getPrototypeOf(function*(){}).constructor;t&&t!==Function&&a.push({prop:"constructor",target:Object.getPrototypeOf(function*(){}),violationType:"generator_function_constructor",strategy:"throw",reason:"GeneratorFunction constructor allows arbitrary generator code execution"})}catch{}try{let t=Object.getPrototypeOf(async function*(){}).constructor;t&&t!==Function&&t!==Object.getPrototypeOf(async()=>{}).constructor&&a.push({prop:"constructor",target:Object.getPrototypeOf(async function*(){}),violationType:"async_generator_function_constructor",strategy:"throw",reason:"AsyncGeneratorFunction constructor allows arbitrary async generator code execution"})}catch{}let e=a.filter(t=>{try{return t.target[t.prop]!==void 0}catch{return!1}});return v??=new Set(e.map(({violationType:t})=>t)),e}var j=performance.timeOrigin,V=performance.now.bind(performance);function k(){return Math.floor(j+V())}var E=new Set(["function_constructor","async_function_constructor","generator_function_constructor","async_generator_function_constructor"]);function D(a){let e=a?.find(t=>E.has(t));if(e)throw new RangeError(`defenseInDepth.excludeViolationTypes cannot disable the non-excludable "${e}" protection`)}var R=`
|
|
4
|
+
|
|
5
|
+
This is a defense-in-depth measure and indicates a bug in just-bash. Please report this at security@vercel.com`;function O(a,e,t){let i=t&&!E.has(e)?`
|
|
6
|
+
|
|
7
|
+
If this access is required by trusted host-runtime code, add "${e}" to defenseInDepth.excludeViolationTypes.`:"";return a+R+i}var f=typeof __BROWSER__<"u"&&__BROWSER__;function S(){return typeof crypto<"u"&&crypto.randomUUID?crypto.randomUUID():"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,a=>{let e=Math.random()*16|0;return(a==="x"?e:e&3|8).toString(16)})}var P=null,m=null,A=null;if(!f)try{P=M.AsyncLocalStorage,m=$,A=m.Module??m.default??null}catch{}var d=class extends Error{violation;constructor(e,t){super(O(e,t.type,t.type==="error_prepare_stack_trace"||T().has(t.type))),this.violation=t,this.name="SecurityViolationError"}},p=!f&&P?new P:null,L=1e3;function G(a,e,...t){return p.run(a,()=>e(...t))}var N={enabled:!0,auditMode:!1,processLifetimeIntrinsicHardening:!1};function I(){return!f&&typeof m?.registerHooks=="function"}function C(a){let e=typeof a=="boolean"?{enabled:a}:a??{};if(D(e.excludeViolationTypes),e.enabled!==void 0&&e.enabled!==!0&&e.enabled!==!1&&e.enabled!=="auto")throw new RangeError('defenseInDepth.enabled must be true, false, or "auto"');let t={...N,...e},i=t.enabled==="auto"?"auto":t.enabled?"enabled":"disabled",r={...t,enabled:i!=="disabled",requested:i};return r.excludeViolationTypes&&(r.excludeViolationTypes=[...new Set(r.excludeViolationTypes)].sort()),r}function H(a,e){if(a.enabled!==e.enabled||a.auditMode!==e.auditMode||a.processLifetimeIntrinsicHardening!==e.processLifetimeIntrinsicHardening||a.onViolation!==e.onViolation)return!1;let t=a.excludeViolationTypes??[],i=e.excludeViolationTypes??[];return t.length===i.length&&t.every((r,o)=>r===i[o])}var B=class a{static instance=null;static importHooksRegistered=!1;static trustedExecutionDepth=new Map;config;refCount=0;patchFailures=[];activeExecutionIds=new Set;contextCache=new Map;originalDescriptors=[];temporaryIntrinsicDescriptors=[];violations=[];activationTime=0;totalActiveTimeMs=0;constructor(e){this.config=e}static getInstance(e){let t=C(e);if(!a.instance)a.instance=new a(t);else{let i=a.instance.config;if(!H(t,i))throw new Error("DefenseInDepthBox config conflict: all resolved defense options, including exclusions and the violation callback, must match across Bash instances. Call DefenseInDepthBox.resetInstance() between incompatible configurations.")}return a.instance}static resetInstance(){a.instance&&(a.instance.forceDeactivate(),a.instance=null),a.trustedExecutionDepth.clear()}static isInSandboxedContext(){return p?p?.getStore()?.sandboxActive===!0:!1}static getCurrentExecutionId(){if(p)return p?.getStore()?.executionId}static enterTrustedScope(e){let t=a.trustedExecutionDepth.get(e)??0;a.trustedExecutionDepth.set(e,t+1)}static leaveTrustedScope(e){let t=a.trustedExecutionDepth.get(e);if(t){if(t===1){a.trustedExecutionDepth.delete(e);return}a.trustedExecutionDepth.set(e,t-1)}}static isTrustedScopeActive(e){return e?(a.trustedExecutionDepth.get(e)??0)>0:!1}static isTrustedContext(e){return!e||e.forceUntrusted?!1:e.trusted===!0||a.isTrustedScopeActive(e.executionId)}isExecutionIdActive(e){return this.activeExecutionIds.has(e)}getCachedContext(e){let t=this.contextCache.get(e);return t||(t={sandboxActive:!0,executionId:e},this.contextCache.set(e,t)),t}static bindCurrentContext(e){if(!p)return e;let t=p.getStore(),i=t?.sandboxActive===!0?t.executionId:void 0;if(!i)return e;let o=a.instance?.getCachedContext(i)??{sandboxActive:!0,executionId:i},n=t?.forceUntrusted?{...o,forceUntrusted:!0}:o;return((...s)=>{let c=a.instance;if(!(c&&!c.isExecutionIdActive(i)&&(c.recordViolation("bound_callback_after_deactivate","bound callback","Bound callback blocked after originating execution was deactivated"),!c.config.auditMode)))return G(n,e,...s)})}isEnabled(){return this.getStatus().state==="enabled"}getStatus(){let e=I();return this.config.requested==="disabled"?{requested:"disabled",state:"disabled",level:"none",contextualDynamicImportProtection:e,processLifetimeIntrinsicHardening:this.config.processLifetimeIntrinsicHardening===!0,intrinsicProtection:this.config.processLifetimeIntrinsicHardening?"process-lifetime":"scoped-best-effort"}:!p||f?{requested:this.config.requested,state:"unsupported",level:"none",contextualDynamicImportProtection:!1,processLifetimeIntrinsicHardening:this.config.processLifetimeIntrinsicHardening===!0,intrinsicProtection:this.config.processLifetimeIntrinsicHardening?"process-lifetime":"scoped-best-effort",reason:"context-aware ESM loader hooks (node:module.registerHooks) are unavailable"}:{requested:this.config.requested,state:"enabled",level:this.config.auditMode?"none":e?"full":"best-effort",contextualDynamicImportProtection:e,processLifetimeIntrinsicHardening:this.config.processLifetimeIntrinsicHardening===!0,intrinsicProtection:this.config.processLifetimeIntrinsicHardening?"process-lifetime":"scoped-best-effort",reason:this.config.auditMode?"audit mode records violations but does not block them":e?void 0:"best-effort protection; context-aware ESM loader hooks are unavailable"}}updateConfig(e){if(this.refCount>0)throw new Error("DefenseInDepthBox configuration cannot change while protection is active");this.config=C({...this.config,...e})}activate(){if(!f&&this.config.enabled&&!p)throw new Error("DefenseInDepthBox: enabled protection requires node:async_hooks and node:module");if(f||!this.config.enabled){let i=S(),r=!1;return{run:o=>r?Promise.reject(new Error("DefenseInDepthBox handle is deactivated and cannot run new work")):o(),deactivate:()=>{r=!0},executionId:i}}if(this.refCount++,this.refCount===1){try{this.applyPatches()}catch(i){throw this.restorePatches(),this.activeExecutionIds.clear(),this.contextCache.clear(),this.refCount=0,i}this.activationTime=Date.now()}let e=S(),t=!1;return{run:i=>t?Promise.reject(new Error("DefenseInDepthBox handle is deactivated and cannot run new work")):(this.activeExecutionIds.add(e),p.run({sandboxActive:!0,executionId:e},i)),deactivate:()=>{t||(t=!0,this.activeExecutionIds.delete(e),this.contextCache.delete(e),this.refCount--,this.refCount===0&&(this.restorePatches(),this.totalActiveTimeMs+=Date.now()-this.activationTime),this.refCount<0&&(this.refCount=0))},executionId:e}}forceDeactivate(){this.refCount>0&&(this.restorePatches(),this.totalActiveTimeMs+=Date.now()-this.activationTime),this.activeExecutionIds.clear(),this.contextCache.clear(),this.refCount=0}isActive(){return this.refCount>0}getStats(){return{violationsBlocked:this.violations.length,violations:[...this.violations],activeTimeMs:this.totalActiveTimeMs+(this.refCount>0?Date.now()-this.activationTime:0),refCount:this.refCount}}getPatchFailures(){return[...this.patchFailures]}clearViolations(){this.violations=[]}getPathForTarget(e,t){return e===globalThis?`globalThis.${t}`:e===process?`process.${t}`:e===Error?`Error.${t}`:e===Function.prototype?`Function.prototype.${t}`:e===Object.prototype?`Object.prototype.${t}`:`<object>.${t}`}static runTrusted(e){if(!p)return e();let t=p.getStore();if(!t)return e();let{executionId:i}=t;return p.run({...t,trusted:!0,forceUntrusted:!1},()=>{a.enterTrustedScope(i);try{let r=e();return typeof r=="object"&&r!==null&&"finally"in r&&typeof r.finally=="function"?r.finally(()=>{a.leaveTrustedScope(i)}):(a.leaveTrustedScope(i),r)}catch(r){throw a.leaveTrustedScope(i),r}})}static async runTrustedAsync(e){if(!p)return e();let t=p.getStore();if(!t)return e();let{executionId:i}=t;return p.run({...t,trusted:!0,forceUntrusted:!1},async()=>{a.enterTrustedScope(i);try{return await e()}finally{a.leaveTrustedScope(i)}})}static async runUntrustedAsync(e){if(!p)return e();let t=p.getStore();return t?p.run({...t,trusted:!1,forceUntrusted:!0},e):e()}shouldBlock(){if(f||this.config.auditMode||!p)return!1;let e=p?.getStore();return!(e?.sandboxActive!==!0||a.isTrustedContext(e))}shouldAudit(){if(!this.config.auditMode||!p)return!1;let e=p.getStore();return e?.sandboxActive===!0&&!a.isTrustedContext(e)}recordViolation(e,t,i){let r={timestamp:k(),type:e,message:i,path:t,stack:new Error().stack,executionId:p?.getStore()?.executionId};if(this.violations.length<L&&this.violations.push(r),this.config.onViolation)try{this.config.onViolation(r)}catch(o){console.debug("[DefenseInDepthBox] onViolation callback threw:",o instanceof Error?o.message:o)}return r}createBlockingProxy(e,t,i){let r=this;return new Proxy(e,{apply(o,n,s){if(r.shouldBlock()){let c=`${t} is blocked during script execution`,l=r.recordViolation(i,t,c);throw new d(c,l)}return r.shouldAudit()&&r.recordViolation(i,t,`${t} called (audit mode)`),Reflect.apply(o,n,s)},construct(o,n,s){if(r.shouldBlock()){let c=`${t} constructor is blocked during script execution`,l=r.recordViolation(i,t,c);throw new d(c,l)}return r.shouldAudit()&&r.recordViolation(i,t,`${t} constructor called (audit mode)`),Reflect.construct(o,n,s)}})}createBlockingObjectProxy(e,t,i,r){let o=this;return new Proxy(e,{get(n,s,c){if(o.shouldBlock()){if(r&&typeof s=="string"&&r.has(s))return Reflect.get(n,s,c);let l=`${t}.${String(s)}`,u=`${l} is blocked during script execution`,h=o.recordViolation(i,l,u);throw new d(u,h)}if(o.shouldAudit()){let l=`${t}.${String(s)}`;o.recordViolation(i,l,`${l} accessed (audit mode)`)}return Reflect.get(n,s,c)},set(n,s,c,l){if(o.shouldBlock()){let u=`${t}.${String(s)}`,h=`${u} modification is blocked during script execution`,y=o.recordViolation(i,u,h);throw new d(h,y)}return t==="process.env"&&s==="DEBUG"?Reflect.set(n,s,c):Reflect.set(n,s,c,l)},ownKeys(n){if(o.shouldBlock()){let s=`${t} enumeration is blocked during script execution`,c=o.recordViolation(i,t,s);throw new d(s,c)}return Reflect.ownKeys(n)},getOwnPropertyDescriptor(n,s){if(o.shouldBlock()){let c=`${t}.${String(s)}`,l=`${c} descriptor access is blocked during script execution`,u=o.recordViolation(i,c,l);throw new d(l,u)}return Reflect.getOwnPropertyDescriptor(n,s)},has(n,s){if(o.shouldBlock()){let c=`${t}.${String(s)}`,l=`${c} existence check is blocked during script execution`,u=o.recordViolation(i,c,l);throw new d(l,u)}return Reflect.has(n,s)},deleteProperty(n,s){if(o.shouldBlock()){let c=`${t}.${String(s)}`,l=`${c} deletion is blocked during script execution`,u=o.recordViolation(i,c,l);throw new d(l,u)}return Reflect.deleteProperty(n,s)},setPrototypeOf(n,s){if(o.shouldBlock()){let c=`${t} setPrototypeOf is blocked during script execution`,l=o.recordViolation(i,t,c);throw new d(c,l)}return Reflect.setPrototypeOf(n,s)},defineProperty(n,s,c){if(o.shouldBlock()){let l=`${t}.${String(s)}`,u=`${l} defineProperty is blocked during script execution`,h=o.recordViolation(i,l,u);throw new d(u,h)}return Reflect.defineProperty(n,s,c)}})}createReadonlyObjectProxy(e,t,i){let r=this,o=n=>{let s=`${t} ${n} is blocked during script execution`,c=r.recordViolation(i,t,s);throw new d(s,c)};return new Proxy(e,{set(n,s,c,l){return r.shouldBlock()&&o("modification"),Reflect.set(n,s,c,l)},defineProperty(n,s,c){return r.shouldBlock()&&o("defineProperty"),Reflect.defineProperty(n,s,c)},deleteProperty(n,s){return r.shouldBlock()&&o("deletion"),Reflect.deleteProperty(n,s)},setPrototypeOf(n,s){return r.shouldBlock()&&o("setPrototypeOf"),Reflect.setPrototypeOf(n,s)},preventExtensions(n){return r.shouldBlock()&&o("preventExtensions"),Reflect.preventExtensions(n)}})}applyPatches(){this.patchFailures=[];let e=w(),t=new Set(this.config.excludeViolationTypes??[]),i=new Set(["process_send","process_channel","process_stdout","process_stderr"]),r=[];for(let s of e)if(!t.has(s.violationType)&&!i.has(s.violationType)){if(s.strategy==="freeze"){r.push(s);continue}this.applyPatch(s)}this.protectConstructorChain(),t.has("error_prepare_stack_trace")||this.protectErrorPrepareStackTrace(),this.protectPromiseThen(),I()&&this.protectDynamicImport(),this.protectModuleLoad(),this.protectModuleResolveFilename(),this.protectProcessMainModule(),this.protectProcessExecPath(),this.protectProxyRevocable();let o=["Function.prototype.constructor","Module._load","Module._resolveFilename"],n=this.patchFailures.filter(s=>o.includes(s));if(n.length>0)throw this.restorePatches(),new Error(`DefenseInDepthBox: critical patches failed: ${n.join(", ")}`);this.config.processLifetimeIntrinsicHardening||this.protectReversibleIntrinsics(r);for(let s of r)this.applyPatch(s,this.config.processLifetimeIntrinsicHardening===!0);this.config.processLifetimeIntrinsicHardening&&this.lockWellKnownSymbols()}protectReversibleIntrinsics(e){let t=new Set,i=(n,s)=>{let c=Object.getOwnPropertyDescriptor(n,s);!c||!("value"in c)||c.writable!==!0||c.configurable!==!0||(this.temporaryIntrinsicDescriptors.push({target:n,prop:s,descriptor:c}),Object.defineProperty(n,s,{...c,writable:!1}))};for(let{target:n,prop:s}of e){let c=n[s];if(!(typeof c!="object"||c===null)){t.add(c);for(let l of Reflect.ownKeys(c))i(c,l)}}let r=[];for(let n of[Array,Map,Set,RegExp,Promise])r.push([n,Symbol.species]);for(let n of[Array.prototype,String.prototype,Map.prototype,Set.prototype])r.push([n,Symbol.iterator]);r.push([Symbol.prototype,Symbol.toPrimitive],[Date.prototype,Symbol.toPrimitive],[Function.prototype,Symbol.hasInstance],[Array.prototype,Symbol.unscopables]);for(let n of[Symbol.match,Symbol.matchAll,Symbol.replace,Symbol.search,Symbol.split])r.push([RegExp.prototype,n]);for(let n of[Map.prototype,Set.prototype,Promise.prototype,ArrayBuffer.prototype])r.push([n,Symbol.toStringTag]);for(let[n,s]of r)t.add(n),i(n,s);let o=(n,s,c)=>{let l=Object.getOwnPropertyDescriptor(n,s);if(!l||!("value"in l)||typeof l.value!="function"||l.configurable!==!0)return;let u=l.value,h=this,y=function(...b){let g=b[0];if(h.shouldBlock()&&typeof g=="object"&&g!==null&&t.has(g)){let x=`${c}.${s}`,_=`${x} is blocked for protected intrinsics during script execution`,F=h.recordViolation("prototype_mutation",x,_);throw new d(_,F)}return Reflect.apply(u,this,b)};this.temporaryIntrinsicDescriptors.push({target:n,prop:s,descriptor:l}),Object.defineProperty(n,s,{...l,value:y,writable:!1})};for(let n of["assign","defineProperties","defineProperty","freeze","preventExtensions","seal","setPrototypeOf"])o(Object,n,"Object");for(let n of["defineProperty","deleteProperty","preventExtensions","set","setPrototypeOf"])o(Reflect,n,"Reflect")}protectConstructorChain(){this.patchPrototypeConstructor(Function.prototype,"Function.prototype.constructor","function_constructor");try{let e=Object.getPrototypeOf(async()=>{}).constructor;e&&e!==Function&&this.patchPrototypeConstructor(e.prototype,"AsyncFunction.prototype.constructor","async_function_constructor")}catch(e){this.patchFailures.push("AsyncFunction.prototype.constructor"),console.debug("[DefenseInDepthBox] Could not patch AsyncFunction.prototype.constructor:",e instanceof Error?e.message:e)}try{let e=Object.getPrototypeOf(function*(){}).constructor;e&&e!==Function&&this.patchPrototypeConstructor(e.prototype,"GeneratorFunction.prototype.constructor","generator_function_constructor")}catch(e){this.patchFailures.push("GeneratorFunction.prototype.constructor"),console.debug("[DefenseInDepthBox] Could not patch GeneratorFunction.prototype.constructor:",e instanceof Error?e.message:e)}try{let e=Object.getPrototypeOf(async function*(){}).constructor,t=Object.getPrototypeOf(async()=>{}).constructor;e&&e!==Function&&e!==t&&this.patchPrototypeConstructor(e.prototype,"AsyncGeneratorFunction.prototype.constructor","async_generator_function_constructor")}catch(e){this.patchFailures.push("AsyncGeneratorFunction.prototype.constructor"),console.debug("[DefenseInDepthBox] Could not patch AsyncGeneratorFunction.prototype.constructor:",e instanceof Error?e.message:e)}}protectErrorPrepareStackTrace(){let e=this;try{let t=Object.getOwnPropertyDescriptor(Error,"prepareStackTrace");this.originalDescriptors.push({target:Error,prop:"prepareStackTrace",descriptor:t});let i=t?.value;Object.defineProperty(Error,"prepareStackTrace",{get(){return i},set(r){if(e.shouldBlock()){let o="Error.prepareStackTrace modification is blocked during script execution",n=e.recordViolation("error_prepare_stack_trace","Error.prepareStackTrace",o);throw new d(o,n)}e.shouldAudit()&&e.recordViolation("error_prepare_stack_trace","Error.prepareStackTrace","Error.prepareStackTrace set (audit mode)"),i=r},configurable:!0})}catch(t){this.patchFailures.push("Error.prepareStackTrace"),console.debug("[DefenseInDepthBox] Could not protect Error.prepareStackTrace:",t instanceof Error?t.message:t)}}protectPromiseThen(){let e=this;try{let o=function(...n){return p.run(this.captured,()=>{if(!this.box.isExecutionIdActive(this.executionId)){if(this.box.recordViolation("promise_then_after_deactivate","Promise.then","Promise.then callback is blocked after defense deactivation"),this.box.config.auditMode)return Reflect.apply(this.cb,void 0,n);if(this.kind==="fulfilled")return n[0];throw n[0]}return Reflect.apply(this.cb,void 0,n)})};var t=o;let i=Object.getOwnPropertyDescriptor(Promise.prototype,"then");this.originalDescriptors.push({target:Promise.prototype,prop:"then",descriptor:i});let r=i?.value;if(typeof r!="function")return;Object.defineProperty(Promise.prototype,"then",{value:function(s,c){if(!p)return Reflect.apply(r,this,[s,c]);let l=p.getStore(),u=l?.sandboxActive===!0&&l.trusted!==!0?l.executionId:void 0;if(!u)return Reflect.apply(r,this,[s,c]);let h=e.getCachedContext(u),y=l?.forceUntrusted?{...h,forceUntrusted:!0}:h,b=(g,x)=>typeof g!="function"?g:o.bind({box:e,executionId:u,captured:y,cb:g,kind:x});return Reflect.apply(r,this,[b(s,"fulfilled"),b(c,"rejected")])},writable:!0,configurable:!0})}catch(i){this.patchFailures.push("Promise.prototype.then"),console.debug("[DefenseInDepthBox] Could not protect Promise.prototype.then:",i instanceof Error?i.message:i)}}patchPrototypeConstructor(e,t,i){let r=this;try{let o=Object.getOwnPropertyDescriptor(e,"constructor");this.originalDescriptors.push({target:e,prop:"constructor",descriptor:o});let n=o?.value;Object.defineProperty(e,"constructor",{get(){if(r.shouldBlock()){let s=`${t} access is blocked during script execution`,c=r.recordViolation(i,t,s);throw new d(s,c)}return r.shouldAudit()&&r.recordViolation(i,t,`${t} accessed (audit mode)`),n},set(s){if(r.shouldBlock()){let c=`${t} modification is blocked during script execution`,l=r.recordViolation(i,t,c);throw new d(c,l)}Object.defineProperty(this,"constructor",{value:s,writable:!0,configurable:!0})},configurable:!0})}catch(o){this.patchFailures.push(t),console.debug(`[DefenseInDepthBox] Could not patch ${t}:`,o instanceof Error?o.message:o)}}protectProcessMainModule(){if(typeof process>"u")return;let e=this;try{let t=Object.getOwnPropertyDescriptor(process,"mainModule");this.originalDescriptors.push({target:process,prop:"mainModule",descriptor:t});let i=t?.value;i!==void 0&&Object.defineProperty(process,"mainModule",{get(){if(e.shouldBlock()){let r="process.mainModule access is blocked during script execution",o=e.recordViolation("process_main_module","process.mainModule",r);throw new d(r,o)}return e.shouldAudit()&&e.recordViolation("process_main_module","process.mainModule","process.mainModule accessed (audit mode)"),i},set(r){if(e.shouldBlock()){let o="process.mainModule modification is blocked during script execution",n=e.recordViolation("process_main_module","process.mainModule",o);throw new d(o,n)}Object.defineProperty(process,"mainModule",{value:r,writable:!0,configurable:!0})},configurable:!0})}catch(t){this.patchFailures.push("process.mainModule"),console.debug("[DefenseInDepthBox] Could not protect process.mainModule:",t instanceof Error?t.message:t)}}protectProcessExecPath(){if(typeof process>"u")return;let e=this;try{let t=Object.getOwnPropertyDescriptor(process,"execPath");this.originalDescriptors.push({target:process,prop:"execPath",descriptor:t});let i=t?.value??process.execPath;Object.defineProperty(process,"execPath",{get(){if(e.shouldBlock()){let r="process.execPath access is blocked during script execution",o=e.recordViolation("process_exec_path","process.execPath",r);throw new d(r,o)}return e.shouldAudit()&&e.recordViolation("process_exec_path","process.execPath","process.execPath accessed (audit mode)"),i},set(r){if(e.shouldBlock()){let o="process.execPath modification is blocked during script execution",n=e.recordViolation("process_exec_path","process.execPath",o);throw new d(o,n)}Object.defineProperty(process,"execPath",{value:r,writable:!0,configurable:!0})},configurable:!0})}catch(t){this.patchFailures.push("process.execPath"),console.debug("[DefenseInDepthBox] Could not protect process.execPath:",t instanceof Error?t.message:t)}}lockWellKnownSymbols(){let e=(t,i)=>{try{let r=Object.getOwnPropertyDescriptor(t,i);if(r?.configurable){if("value"in r){Object.defineProperty(t,i,{...r,configurable:!1,writable:!1});return}Object.defineProperty(t,i,{...r,configurable:!1})}}catch{}};for(let t of[Array,Map,Set,RegExp,Promise])e(t,Symbol.species);for(let t of[Array.prototype,String.prototype,Map.prototype,Set.prototype])e(t,Symbol.iterator);e(Symbol.prototype,Symbol.toPrimitive),e(Date.prototype,Symbol.toPrimitive);for(let t of[Symbol.match,Symbol.matchAll,Symbol.replace,Symbol.search,Symbol.split])e(RegExp.prototype,t);e(Function.prototype,Symbol.hasInstance),e(Array.prototype,Symbol.unscopables);for(let t of[Map.prototype,Set.prototype,Promise.prototype,ArrayBuffer.prototype])e(t,Symbol.toStringTag)}protectProxyRevocable(){let e=this;try{let t=Proxy.revocable;if(typeof t!="function")return;let i=Object.getOwnPropertyDescriptor(Proxy,"revocable");this.originalDescriptors.push({target:Proxy,prop:"revocable",descriptor:i}),Object.defineProperty(Proxy,"revocable",{value:function(o,n){if(e.shouldBlock()){let s="Proxy.revocable is blocked during script execution",c=e.recordViolation("proxy","Proxy.revocable",s);throw new d(s,c)}return e.shouldAudit()&&e.recordViolation("proxy","Proxy.revocable","Proxy.revocable called (audit mode)"),t(o,n)},writable:!1,configurable:!0})}catch(t){this.patchFailures.push("Proxy.revocable"),console.debug("[DefenseInDepthBox] Could not protect Proxy.revocable:",t instanceof Error?t.message:t)}}protectDynamicImport(){if(!(f||a.importHooksRegistered))try{let e=m;if(!e)throw new Error("node:module is unavailable");let t=new Set;for(let o of e.builtinModules??[]){let n=o.startsWith("node:")?o.slice(5):o;t.add(n);let s=n.indexOf("/");s>0&&t.add(n.slice(0,s))}let i=o=>{if(o.startsWith("./")||o.startsWith("../")||o.startsWith("/")||o.startsWith("file:")||o.startsWith("data:")||o.startsWith("blob:")||o.startsWith("http:")||o.startsWith("https:"))return!1;let n=o.startsWith("node:")?o.slice(5):o;if(!n)return!1;if(typeof e.isBuiltin=="function"&&e.isBuiltin(n)||t.has(n))return!0;let s=n.indexOf("/");return s>0&&t.has(n.slice(0,s))},r=o=>{let n=p?.getStore();return o.config.auditMode===!0&&n?.sandboxActive===!0&&!a.isTrustedContext(n)};if(typeof e.registerHooks=="function"){e.registerHooks({resolve(o,n,s){let c=a.instance;if(!c)return s(o,n);if((o.startsWith("data:")||o.startsWith("blob:"))&&c.shouldBlock()){let l=`import(${o.startsWith("data:")?"data:":"blob:"})`,u=`dynamic import of ${o.startsWith("data:")?"data:":"blob:"} URLs is blocked by defense-in-depth`,h=c.recordViolation("dynamic_import_builtin",l,u);throw new d(u,h)}if(i(o)){let l=`import(${o})`,u=`dynamic import of Node.js builtin '${o}' is blocked during script execution`;if(c.shouldBlock()){let h=c.recordViolation("dynamic_import_builtin",l,u);throw new d(u,h)}r(c)&&c.recordViolation("dynamic_import_builtin",l,`dynamic import of Node.js builtin '${o}' called (audit mode)`)}return s(o,n)}}),a.importHooksRegistered=!0;return}throw new Error("context-aware ESM loader hooks (node:module.registerHooks) are unavailable")}catch(e){throw new Error(`DefenseInDepthBox: could not register dynamic-import hooks: ${e instanceof Error?e.message:String(e)}`,{cause:e})}}protectModuleLoad(){this.protectModuleMethod("_load","module_load")}protectModuleResolveFilename(){this.protectModuleMethod("_resolveFilename","module_resolve_filename")}protectModuleMethod(e,t){if(f)return;let i=`Module.${e}`;try{let r=A,o=r?.[e];if(!r||typeof o!="function")throw new Error("node:module Module class or method is unavailable");let n=Object.getOwnPropertyDescriptor(r,e);if(!n)throw new Error("method has no own property descriptor");if(n.configurable===!1&&n.writable===!1)throw new Error("method is non-configurable and non-writable");let s=this.createBlockingProxy(o,i,t);this.originalDescriptors.push({target:r,prop:e,descriptor:n}),Object.defineProperty(r,e,{...n,value:s});let c=Object.getOwnPropertyDescriptor(r,e);if(r[e]!==s||c?.value!==s)throw new Error("installed patch failed verification")}catch{this.patchFailures.push(i)}}applyPatch(e,t=!1){let{target:i,prop:r,violationType:o,strategy:n}=e;try{let s=i[r];if(s===void 0)return;let c=Object.getOwnPropertyDescriptor(i,r);if(this.originalDescriptors.push({target:i,prop:r,descriptor:c}),n==="freeze"){if(typeof s=="object"&&s!==null){t&&Object.freeze(s);let l=this.getPathForTarget(i,r),u=this.createReadonlyObjectProxy(s,l,o);Object.defineProperty(i,r,{...c,value:u})}}else{let l=this.getPathForTarget(i,r),u=typeof s=="function"?this.createBlockingProxy(s,l,o):this.createBlockingObjectProxy(s,l,o,e.allowedKeys);Object.defineProperty(i,r,{value:u,writable:!0,configurable:!0})}}catch(s){let c=this.getPathForTarget(i,r);this.patchFailures.push(c),console.debug(`[DefenseInDepthBox] Could not patch ${c}:`,s instanceof Error?s.message:s)}}restorePatches(){for(let e=this.temporaryIntrinsicDescriptors.length-1;e>=0;e--){let{target:t,prop:i,descriptor:r}=this.temporaryIntrinsicDescriptors[e];try{Object.defineProperty(t,i,r)}catch(o){console.debug(`[DefenseInDepthBox] Could not restore temporary intrinsic ${String(i)}:`,o instanceof Error?o.message:o)}}this.temporaryIntrinsicDescriptors=[];for(let e=this.originalDescriptors.length-1;e>=0;e--){let{target:t,prop:i,descriptor:r}=this.originalDescriptors[e];try{r?Object.defineProperty(t,i,r):delete t[i]}catch(o){let n=this.getPathForTarget(t,i);console.debug(`[DefenseInDepthBox] Could not restore ${n}:`,o instanceof Error?o.message:o)}}this.originalDescriptors=[]}};export{d as a,B as b};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import{createRequire} from"node:module";const require=createRequire(import.meta.url);
|
|
3
|
+
import{a as n}from"./chunk-BIJXTWZ4.js";import{b as $}from"./chunk-GR4ZHKXI.js";import{l as F}from"./chunk-FUT3X2GJ.js";import{a as S}from"./chunk-CPKBPQ2C.js";import{a as x}from"./chunk-NE4R2FVV.js";import{a as z,b as O}from"./chunk-MUFNRCMY.js";var M={name:"stat",summary:"display file or file system status",usage:"stat [OPTION]... FILE...",options:["-c FORMAT use the specified FORMAT instead of the default"," --help display this help and exit"]},E={format:{short:"c",type:"string"}},I={name:"stat",async execute(l,s){if(O(l))return z(M);let o=x("stat",l,E);if(!o.ok)return o.error;let m=o.result.flags.format??null,u=o.result.positional;if(u.length===0)return{stdout:"",stderr:`stat: missing operand
|
|
4
|
+
`,exitCode:1};let c="",f="",p=!1,d=0,g=Math.min(s.limits.maxOutputSize,s.limits.maxStringLength),h=e=>{let r=S(e);if(r>g-d)throw new F(`stat: output size limit exceeded (${g} bytes)`,"output_size");c+=e,d+=r};for(let e of u){let r=s.fs.resolvePath(s.cwd,e);try{let t=await s.fs.stat(r);if(m){let a=t.mode.toString(8),i=n(t.mode,t.isDirectory),w=new Map([["%n",e],["%N",`'${e}'`],["%s",String(t.size)],["%F",t.isDirectory?"directory":"regular file"],["%a",a],["%A",i],["%u","1000"],["%U","user"],["%g","1000"],["%G","group"]]),A=m.replace(/%[nNsFaAuUgG]/g,y=>w.get(y)??y);h(`${A}
|
|
5
|
+
`)}else{let a=t.mode.toString(8).padStart(4,"0"),i=n(t.mode,t.isDirectory);h(` File: ${e}
|
|
6
|
+
Size: ${t.size} Blocks: ${Math.ceil(t.size/512)}
|
|
7
|
+
Access: (${a}/${i})
|
|
8
|
+
Modify: ${t.mtime.toISOString()}
|
|
9
|
+
`)}}catch(t){$(t),f+=`stat: cannot stat '${e}': No such file or directory
|
|
10
|
+
`,p=!0}}return{stdout:c,stderr:f,exitCode:p?1:0}}},P={name:"stat",flags:[{flag:"-c",type:"value",valueHint:"format"},{flag:"-L",type:"boolean"}],needsArgs:!0};export{I as a,P as b};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import{createRequire} from"node:module";const require=createRequire(import.meta.url);
|
|
3
|
+
import{l as o}from"./chunk-FUT3X2GJ.js";import{a as u}from"./chunk-CPKBPQ2C.js";function n(s,t){if(!Number.isSafeInteger(s)||s<0)throw new o(`${t}: invalid bounded allocation count`,"array_elements")}function c(s){return new o(`${s}: invalid bounded allocation count`,"array_elements")}function f(s,t,e){n(s,e),n(t,e);let i=s+t;if(!Number.isSafeInteger(i))throw c(e);return i}function p(s,t,e){if(n(s,e),n(t,e),s!==0&&t>Math.floor(Number.MAX_SAFE_INTEGER/s))throw c(e);return s*t}function m(s,t,e,i){let r=new a(e,i);for(let h=0;h<s.length;h++)h>0&&r.append(t),r.append(s[h]);return r.build()}var a=class{maxBytes;label;createLimitError;reservedBytes;chunks=[];usedBytes=0;constructor(t,e,i=void 0,r=0){this.maxBytes=t,this.label=e,this.createLimitError=i,this.reservedBytes=r,n(t,e),n(r,e),r>t&&this.fail()}fail(){throw this.createLimitError?.()??new o(`${this.label}: output size limit exceeded (${this.maxBytes} bytes)`,"output_size")}get byteLength(){return this.usedBytes}get remainingBytes(){return this.maxBytes-this.reservedBytes-this.usedBytes}reserve(t){n(t,this.label),t>this.remainingBytes&&this.fail()}append(t){let e=u(t);return this.reserve(e),t&&this.chunks.push(t),this.usedBytes+=e,this}repeat(t,e){n(e,this.label);let i=u(t);return i!==0&&e>Math.floor(this.remainingBytes/i)&&this.fail(),this.append(t.repeat(e))}reset(){this.chunks.length=0,this.usedBytes=0}build(){return this.chunks.join("")}};export{f as a,p as b,m as c,a as d};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import{createRequire} from"node:module";const require=createRequire(import.meta.url);
|
|
3
|
+
import{a as C}from"./chunk-QYZN33JA.js";import{a as se,b as re}from"./chunk-R2J5MJOM.js";import{b as O}from"./chunk-GR4ZHKXI.js";import{l as A}from"./chunk-FUT3X2GJ.js";import{b as j}from"./chunk-CPKBPQ2C.js";import{a as me,c as ne}from"./chunk-MUFNRCMY.js";var xe="(standard input)";function he(t){let e=t.limits.maxLoopIterations,i=t.limits.maxArrayElements;return Math.max(e,Math.min(i,e*10))}function w(t){if(++t.operations>t.maxOperations)throw new A(`grep: glob operation limit exceeded (${t.maxOperations})`,"glob_operations")}function _(t){if(t.results>=t.maxResults)throw new A(`grep: array element limit exceeded (${t.maxResults})`,"array_elements");t.results++}var we="[^\\s\\S]";function Fe(t){return t.split(`
|
|
4
|
+
`)}function ve(t){if(t==="")return[];let e=t.split(`
|
|
5
|
+
`);return e[e.length-1]===""&&e.pop(),e}function Ce(t,e){return t.length===1?{pattern:t[0],mode:e}:e==="fixed"?{pattern:t.map(i=>`(?:${i.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")})`).join("|"),mode:"extended"}:e==="basic"?{pattern:t.join("\\|"),mode:e}:{pattern:t.map(i=>`(?:${i})`).join("|"),mode:e}}var Ee={name:"grep",summary:"print lines that match patterns",usage:"grep [OPTION]... PATTERN [FILE]...",description:["Search for PATTERN in each FILE.","With no FILE, or when FILE is -, read standard input."],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","-f FILE, --file=FILE obtain patterns from FILE, one per line"," --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"]},de={name:"grep",async execute(t,e){let i=!1,g=!1,f=!1,h=!1,c=!1,u=!1,a=!1,l=!1,m=!1,F=!1,$=!1,y=!1,x=!1,M=!1,G=!1,S=0,N=0,W=0,B=[],b=[],X=[],L=null,H=[],Z=[],Q=!0;for(let s=0;s<t.length;s++){let r=t[s];if(Q&&r==="--"){Q=!1;continue}if(Q&&r==="--help")return me(Ee);if(Q&&r.startsWith("-")&&r!=="-"){if(r==="-e"&&s+1<t.length){L=t[++s];continue}if(r.startsWith("--file=")){H.push(r.slice(7));continue}if(r.startsWith("--include=")){B.push(r.slice(10));continue}if(r.startsWith("--exclude=")){b.push(r.slice(10));continue}if(r.startsWith("--exclude-dir=")){X.push(r.slice(14));continue}if(r.startsWith("--max-count=")){S=parseInt(r.slice(12),10);continue}let v=r.match(/^-m(\d+)$/);if(v){S=parseInt(v[1],10);continue}if(r==="-m"&&s+1<t.length){S=parseInt(t[++s],10);continue}let o=r.match(/^-([ABC])(\d+)$/);if(o){let p=parseInt(o[2],10);o[1]==="A"?W=p:o[1]==="B"?N=p:o[1]==="C"&&(N=p,W=p);continue}if((r==="-A"||r==="-B"||r==="-C")&&s+1<t.length){let p=parseInt(t[++s],10);r==="-A"?W=p:r==="-B"?N=p:(N=p,W=p);continue}let d=r.startsWith("--")?[r]:r.slice(1).split("");for(let p=0;p<d.length;p++){let n=d[p];if(n==="f"||n==="--file"){let z=n==="f"?d.slice(p+1).join(""):"";if(z.length>0)H.push(z);else if(s+1<t.length)H.push(t[++s]);else return{stdout:"",stderr:n==="f"?`grep: option requires an argument -- 'f'
|
|
6
|
+
`:`grep: option '--file' requires an argument
|
|
7
|
+
`,exitCode:2};break}if(n==="i"||n==="--ignore-case")i=!0;else if(n==="n"||n==="--line-number")g=!0;else if(n==="v"||n==="--invert-match")f=!0;else if(n==="c"||n==="--count")h=!0;else if(n==="l"||n==="--files-with-matches")c=!0;else if(n==="L"||n==="--files-without-match")u=!0;else if(n==="r"||n==="R"||n==="--recursive")a=!0;else if(n==="w"||n==="--word-regexp")l=!0;else if(n==="x"||n==="--line-regexp")m=!0;else if(n==="E"||n==="--extended-regexp")F=!0;else if(n==="P"||n==="--perl-regexp")$=!0;else if(n==="F"||n==="--fixed-strings")y=!0;else if(n==="o"||n==="--only-matching")x=!0;else if(n==="h"||n==="--no-filename")M=!0;else if(n==="q"||n==="--quiet"||n==="--silent")G=!0;else{if(n.startsWith("--"))return ne("grep",n);if(n.length===1)return ne("grep",`-${n}`)}}}else Z.push(r)}if(L===null&&H.length===0&&(L=Z.shift()??null,L===null))return{stdout:"",stderr:`grep: missing pattern
|
|
8
|
+
`,exitCode:2};let J=Z,E=L===null?[]:Fe(L),K=!1;for(let s of H){let r;if(s==="")return{stdout:"",stderr:`grep: : No such file or directory
|
|
9
|
+
`,exitCode:2};if(s==="-")r=K?"":j(e.stdin),K=!0;else try{let o=e.fs.resolvePath(e.cwd,s);if((await e.fs.stat(o)).isDirectory)return{stdout:"",stderr:`grep: ${s}: Is a directory
|
|
10
|
+
`,exitCode:2};r=await e.fs.readFile(o)}catch(o){return O(o),{stdout:"",stderr:`grep: ${s}: No such file or directory
|
|
11
|
+
`,exitCode:2}}let v=ve(r);if(E.length+v.length>e.limits.maxArrayElements)throw new A(`grep: array element limit exceeded (${e.limits.maxArrayElements})`,"array_elements");E.push(...v)}if(E.length===0&&!f&&!u)return{stdout:"",stderr:"",exitCode:1};let k=y?"fixed":F?"extended":$?"perl":"basic";if(k==="perl"&&new Set(E).size>1)return{stdout:"",stderr:`grep: the -P option only supports a single pattern
|
|
12
|
+
`,exitCode:2};if(E.length>1&&k!=="fixed")for(let s of E)try{re(s,{mode:k})}catch{return{stdout:"",stderr:`grep: invalid regular expression: ${s}
|
|
13
|
+
`,exitCode:2}}let ie=E.length===0?{pattern:we,mode:"extended"}:Ce(E,k),Y,ee,I;try{let s=re(ie.pattern,{mode:ie.mode,ignoreCase:i,wholeWord:l,lineRegexp:m});Y=s.regex,ee=s.kResetGroup,I=s.preFilter}catch{return{stdout:"",stderr:`grep: invalid regular expression: ${E.join(`
|
|
14
|
+
`)}
|
|
15
|
+
`,exitCode:2}}if(J.length===0&&e.stdin!==void 0){let s=K?"":j(e.stdin),r=se(s,Y,{invertMatch:f,showLineNumbers:g,countOnly:h,filename:"",onlyMatching:x,beforeContext:N,afterContext:W,maxCount:S,kResetGroup:ee,preFilter:I,maxWork:he(e),maxMatches:e.limits.maxArrayElements,signal:e.signal});return G?{stdout:"",stderr:"",exitCode:r.matched?0:1}:{stdout:r.output,stderr:"",exitCode:r.matched?0:1}}if(J.length===0)return{stdout:"",stderr:`grep: no input files
|
|
16
|
+
`,exitCode:2};let U="",oe="",le=!1,ae=!1,P=[],R={operations:0,results:0,maxOperations:e.limits.maxGlobOperations,maxResults:e.limits.maxArrayElements},te=s=>{if(s.length>R.maxResults-P.length)throw new A(`grep: array element limit exceeded (${R.maxResults})`,"array_elements");P.push(...s)},fe=!1,ue=!1;for(let s of J){if(s==="-"){if(P.length>=R.maxResults)throw new A(`grep: array element limit exceeded (${R.maxResults})`,"array_elements");P.push({path:xe,isFile:!0,isStdin:!0,stdinAtEof:fe}),fe=!0;continue}if(ue=!0,s.includes("*")||s.includes("?")||s.includes("[")){let r=await Pe(s,e,R);if(a)for(let v of r){let o=await V(v.path,e,B,b,X,v.isFile,R);te(o)}else te(r)}else if(a){let r=await V(s,e,B,b,X,void 0,R);te(r)}else{if(P.length>=R.maxResults)throw new A(`grep: array element limit exceeded (${R.maxResults})`,"array_elements");P.push({path:s})}}let pe=(P.length>1||a&&ue)&&!M,ce=50;for(let s=0;s<P.length;s+=ce){let r=P.slice(s,s+ce),v=await Promise.all(r.map(async o=>{let d=o.path,p=d.split("/").pop()||d;if(b.length>0&&!a&&!o.isStdin&&b.some(n=>C(p,n,{stripQuotes:!0}))||B.length>0&&!a&&!o.isStdin&&!B.some(n=>C(p,n,{stripQuotes:!0})))return null;try{let n;if(o.isStdin)n=o.stdinAtEof||e.stdin===void 0?"":j(e.stdin);else{let D=e.fs.resolvePath(e.cwd,d),T=!1;if(o.isFile===void 0?T=(await e.fs.stat(D)).isDirectory:T=!o.isFile,T)return a?null:{error:`grep: ${d}: Is a directory
|
|
17
|
+
`};n=await e.fs.readFile(D)}if(I&&!f){let D=I.ignoreCase?n.toLowerCase():n;if(!I.needles.some(T=>D.includes(T))){if(h){let T=pe?`${d}:0`:"0";return{file:d,result:{output:`${T}
|
|
18
|
+
`,matched:!1,matchCount:0}}}return{file:d,result:{output:"",matched:!1,matchCount:0}}}}let z=se(n,Y,{invertMatch:f,showLineNumbers:g,countOnly:h,filename:pe?d:"",onlyMatching:x,beforeContext:N,afterContext:W,maxCount:S,kResetGroup:ee,preFilter:I,maxWork:he(e),maxMatches:e.limits.maxArrayElements,signal:e.signal});return{file:d,result:z}}catch(n){return O(n),{error:`grep: ${d}: No such file or directory
|
|
19
|
+
`}}}));for(let o of v){if(o===null)continue;if("error"in o&&o.error){oe+=o.error,o.error.includes("Is a directory")||(ae=!0);continue}if(!("file"in o)||!o.result)continue;let{file:d,result:p}=o;if(p.matched){if(le=!0,G)return{stdout:"",stderr:"",exitCode:0};c?U+=`${d}
|
|
20
|
+
`:u||(U+=p.output)}else u?U+=`${d}
|
|
21
|
+
`:h&&!c&&(U+=p.output)}}let q;return ae?q=2:q=le?0:1,G?{stdout:"",stderr:"",exitCode:q}:{stdout:U,stderr:oe,exitCode:q}}},ge=256;async function ye(t,e,i,g,f,h=0){if(h>=ge)return;let c=i.fs.resolvePath(i.cwd,t);try{if(w(f),!(await i.fs.stat(c)).isDirectory){let l=t.split("/").pop()||"";if(e){let m=e.replace(/^\//,"");C(l,m,{stripQuotes:!0})&&(_(f),g.push(t))}return}w(f);let a=await i.fs.readdir(c);for(let l of a){let m=t==="."?l:`${t}/${l}`,F=i.fs.resolvePath(i.cwd,m);if(w(f),(await i.fs.stat(F)).isDirectory)await ye(m,e,i,g,f,h+1);else if(e){let y=e.replace(/^\//,"");C(l,y,{stripQuotes:!0})&&(_(f),g.push(m))}}}catch(u){O(u)}}async function Pe(t,e,i){let g=[],f=t.lastIndexOf("/"),h,c;if(f===-1?(h=e.cwd,c=t):(h=t.slice(0,f)||"/",c=t.slice(f+1)),t.includes("**")){let a=[],l=t.split("**"),m=l[0].replace(/\/$/,"")||".",F=l[1]||"";return await ye(m,F,e,a,i),a.map($=>({path:$}))}let u=e.fs.resolvePath(e.cwd,h);try{if(e.fs.readdirWithFileTypes){w(i);let a=await e.fs.readdirWithFileTypes(u);for(let l of a)if(w(i),C(l.name,c,{stripQuotes:!0})){let m=f===-1?l.name:`${h}/${l.name}`;_(i),g.push({path:m,isFile:l.isFile})}}else{w(i);let a=await e.fs.readdir(u);for(let l of a)if(w(i),C(l,c,{stripQuotes:!0})){let m=f===-1?l:`${h}/${l}`;_(i),g.push({path:m})}}}catch(a){O(a)}return g.sort((a,l)=>a.path.localeCompare(l.path))}async function V(t,e,i=[],g=[],f=[],h,c={operations:0,results:0,maxOperations:e.limits.maxGlobOperations,maxResults:e.limits.maxArrayElements},u=[],a=0){if(a>=ge)return u;let l=e.fs.resolvePath(e.cwd,t);try{let m,F;if(h!==void 0)m=h,F=!h;else{w(c);let y=await e.fs.stat(l);m=y.isFile,F=y.isDirectory}if(m){let y=t.split("/").pop()||t;return g.length>0&&g.some(x=>C(y,x,{stripQuotes:!0}))||i.length>0&&!i.some(x=>C(y,x,{stripQuotes:!0}))||(_(c),u.push({path:t,isFile:!0})),u}if(!F)return u;let $=t.split("/").pop()||t;if(f.length>0&&f.some(y=>C($,y,{stripQuotes:!0})))return u;if(e.fs.readdirWithFileTypes){w(c);let y=await e.fs.readdirWithFileTypes(l);for(let x of y){if(w(c),x.name.startsWith("."))continue;let M=t==="."?x.name:`${t}/${x.name}`;await V(M,e,i,g,f,x.isFile,c,u,a+1)}}else{w(c);let y=await e.fs.readdir(l);for(let x of y){if(w(c),x.startsWith("."))continue;let M=t==="."?x:`${t}/${x}`;await V(M,e,i,g,f,void 0,c,u,a+1)}}}catch(m){O(m)}return u}var Le={name:"fgrep",async execute(t,e){return de.execute(["-F",...t],e)}},Ie={name:"egrep",async execute(t,e){return de.execute(["-E",...t],e)}},Oe={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"},{flag:"-f",type:"value",valueHint:"path"}],stdinType:"text",needsArgs:!0},Se={name:"fgrep",flags:[],stdinType:"text",needsArgs:!0},Be={name:"egrep",flags:[],stdinType:"text",needsArgs:!0};export{de as a,Le as b,Ie as c,Oe as d,Se as e,Be as f};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import{createRequire} from"node:module";const require=createRequire(import.meta.url);
|
|
3
|
+
import{a as O}from"./chunk-3MRB66F4.js";import{b as D}from"./chunk-O2BCKSMK.js";import{a as A,b as h}from"./chunk-TW2IJRUF.js";import{c as F,d as g}from"./chunk-PPVF2N6C.js";import{b as T}from"./chunk-HWI42GQO.js";import{a as m,b as w}from"./chunk-PBOVSFTJ.js";var n={NOOP:0,READ_FILE:1,WRITE_FILE:2,STAT:3,READDIR:4,MKDIR:5,RM:6,EXISTS:7,APPEND_FILE:8,SYMLINK:9,READLINK:10,LSTAT:11,CHMOD:12,REALPATH:13,RENAME:14,COPY_FILE:15,WRITE_STDOUT:100,WRITE_STDERR:101,EXIT:102,HTTP_REQUEST:200,EXEC_COMMAND:300,INVOKE_TOOL:400},r={PENDING:0,READY:1,SUCCESS:2,ERROR:3},l={NONE:0,NOT_FOUND:1,IS_DIRECTORY:2,NOT_DIRECTORY:3,EXISTS:4,PERMISSION_DENIED:5,INVALID_PATH:6,IO_ERROR:7,TIMEOUT:8,NETWORK_ERROR:9,NETWORK_NOT_CONFIGURED:10},o={OP_CODE:0,STATUS:4,PATH_LENGTH:8,DATA_LENGTH:12,RESULT_LENGTH:16,ERROR_CODE:20,FLAGS:24,MODE:28,PATH_BUFFER:32,DATA_BUFFER:4128},p={CONTROL_REGION:32,PATH_BUFFER:4096,DATA_BUFFER:8388608,TOTAL:8392736},S={NONE:0,RECURSIVE:1,FORCE:2,MKDIR_RECURSIVE:1},u={IS_FILE:0,IS_DIRECTORY:1,IS_SYMLINK:2,MODE:4,SIZE:8,MTIME:16,TOTAL:24};function x(){return new A(p.TOTAL)}var R=class{int32View;uint8View;dataView;constructor(t){this.int32View=new Int32Array(t),this.uint8View=new Uint8Array(t),this.dataView=new DataView(t)}getOpCode(){return h.load(this.int32View,o.OP_CODE/4)}setOpCode(t){h.store(this.int32View,o.OP_CODE/4,t)}getStatus(){return h.load(this.int32View,o.STATUS/4)}setStatus(t){h.store(this.int32View,o.STATUS/4,t)}getPathLength(){return h.load(this.int32View,o.PATH_LENGTH/4)}setPathLength(t){h.store(this.int32View,o.PATH_LENGTH/4,t)}getDataLength(){return h.load(this.int32View,o.DATA_LENGTH/4)}setDataLength(t){h.store(this.int32View,o.DATA_LENGTH/4,t)}getResultLength(){return h.load(this.int32View,o.RESULT_LENGTH/4)}setResultLength(t){h.store(this.int32View,o.RESULT_LENGTH/4,t)}getErrorCode(){return h.load(this.int32View,o.ERROR_CODE/4)}setErrorCode(t){h.store(this.int32View,o.ERROR_CODE/4,t)}getFlags(){return h.load(this.int32View,o.FLAGS/4)}setFlags(t){h.store(this.int32View,o.FLAGS/4,t)}getMode(){return h.load(this.int32View,o.MODE/4)}setMode(t){h.store(this.int32View,o.MODE/4,t)}getPath(){let t=this.getPathLength(),e=this.uint8View.slice(o.PATH_BUFFER,o.PATH_BUFFER+t);return new TextDecoder().decode(e)}setPath(t){let e=new TextEncoder().encode(t);if(e.length>p.PATH_BUFFER)throw new Error(`Path too long: ${e.length} > ${p.PATH_BUFFER}`);this.uint8View.set(e,o.PATH_BUFFER),this.setPathLength(e.length)}getData(){let t=this.getDataLength();return this.uint8View.slice(o.DATA_BUFFER,o.DATA_BUFFER+t)}setData(t){if(t.length>p.DATA_BUFFER)throw new Error(`Data too large: ${t.length} > ${p.DATA_BUFFER}`);this.uint8View.set(t,o.DATA_BUFFER),this.setDataLength(t.length)}getDataAsString(){let t=this.getData();return new TextDecoder().decode(t)}setDataFromString(t){let e=new TextEncoder().encode(t);this.setData(e)}getResult(){let t=this.getResultLength();return this.uint8View.slice(o.DATA_BUFFER,o.DATA_BUFFER+t)}setResult(t){if(t.length>p.DATA_BUFFER)throw new Error(`Result too large: ${t.length} > ${p.DATA_BUFFER}`);this.uint8View.set(t,o.DATA_BUFFER),this.setResultLength(t.length)}getResultAsString(){let t=this.getResult();return new TextDecoder().decode(t)}setResultFromString(t){let e=new TextEncoder().encode(t);this.setResult(e)}encodeStat(t){this.uint8View[o.DATA_BUFFER+u.IS_FILE]=t.isFile?1:0,this.uint8View[o.DATA_BUFFER+u.IS_DIRECTORY]=t.isDirectory?1:0,this.uint8View[o.DATA_BUFFER+u.IS_SYMLINK]=t.isSymbolicLink?1:0,this.dataView.setInt32(o.DATA_BUFFER+u.MODE,t.mode,!0);let e=Math.min(t.size,Number.MAX_SAFE_INTEGER);this.dataView.setFloat64(o.DATA_BUFFER+u.SIZE,e,!0),this.dataView.setFloat64(o.DATA_BUFFER+u.MTIME,t.mtime.getTime(),!0),this.setResultLength(u.TOTAL)}decodeStat(){return{isFile:this.uint8View[o.DATA_BUFFER+u.IS_FILE]===1,isDirectory:this.uint8View[o.DATA_BUFFER+u.IS_DIRECTORY]===1,isSymbolicLink:this.uint8View[o.DATA_BUFFER+u.IS_SYMLINK]===1,mode:this.dataView.getInt32(o.DATA_BUFFER+u.MODE,!0),size:this.dataView.getFloat64(o.DATA_BUFFER+u.SIZE,!0),mtime:new Date(this.dataView.getFloat64(o.DATA_BUFFER+u.MTIME,!0))}}waitForReady(t){return h.wait(this.int32View,o.STATUS/4,r.PENDING,t)}waitForReadyAsync(t){return h.waitAsync(this.int32View,o.STATUS/4,r.PENDING,t)}async waitUntilReady(t){let e=Date.now();for(;;){let a=this.getStatus();if(a===r.READY)return!0;let s=Date.now()-e;if(s>=t)return!1;let i=t-s,c=h.waitAsync(this.int32View,o.STATUS/4,a,i);if(c.async&&await c.value==="timed-out")return!1}}waitForResult(t){return h.wait(this.int32View,o.STATUS/4,r.READY,t)}notify(){return h.notify(this.int32View,o.STATUS/4)}reset(){this.setOpCode(n.NOOP),this.setStatus(r.PENDING),this.setPathLength(0),this.setDataLength(0),this.setResultLength(0),this.setErrorCode(l.NONE),this.setFlags(S.NONE),this.setMode(0)}};var C=class{fs;cwd;commandName;secureFetch;maxOutputSize;exec;invokeTool;protocol;running=!1;output={stdout:"",stderr:"",exitCode:0};outputLimitExceeded=!1;startTime=0;timeoutMs=0;constructor(t,e,a,s,i=void 0,c=0,d=void 0,E=void 0){this.fs=e,this.cwd=a,this.commandName=s,this.secureFetch=i,this.maxOutputSize=c,this.exec=d,this.invokeTool=E,this.protocol=new R(t)}remainingMs(){return Math.max(0,this.timeoutMs-(Date.now()-this.startTime))}raceDeadline(t){let e=this.remainingMs();if(e<=0)return this.running=!1,this.output.exitCode=124,this.output.stderr+=`
|
|
4
|
+
${this.commandName}: execution timeout exceeded
|
|
5
|
+
`,Promise.reject(new Error("Operation timed out"));let a=t();return e===Number.POSITIVE_INFINITY?a:new Promise((s,i)=>{let c=F(()=>{this.running=!1,this.output.exitCode=124,this.output.stderr+=`
|
|
6
|
+
${this.commandName}: execution timeout exceeded
|
|
7
|
+
`,i(new Error("Operation timed out"))},e);a.then(d=>{g(c),s(d)},d=>{g(c),i(d)})})}async run(t){for(this.running=!0,this.startTime=Date.now(),this.timeoutMs=t;this.running;){if(Date.now()-this.startTime>=t){this.output.stderr+=`
|
|
8
|
+
${this.commandName}: execution timeout exceeded
|
|
9
|
+
`,this.output.exitCode=124;break}let a=this.remainingMs();if(!await this.protocol.waitUntilReady(a)){this.output.stderr+=`
|
|
10
|
+
${this.commandName}: execution timeout exceeded
|
|
11
|
+
`,this.output.exitCode=124;break}if(!this.running)break;let i=this.protocol.getOpCode();await this.handleOperation(i),this.protocol.notify()}return this.output}stop(){this.running=!1,this.protocol.setStatus(r.READY),this.protocol.notify()}async handleOperation(t){try{switch(t){case n.READ_FILE:await this.handleReadFile();break;case n.WRITE_FILE:await this.handleWriteFile();break;case n.STAT:await this.handleStat();break;case n.LSTAT:await this.handleLstat();break;case n.READDIR:await this.handleReaddir();break;case n.MKDIR:await this.handleMkdir();break;case n.RM:await this.handleRm();break;case n.EXISTS:await this.handleExists();break;case n.APPEND_FILE:await this.handleAppendFile();break;case n.SYMLINK:await this.handleSymlink();break;case n.READLINK:await this.handleReadlink();break;case n.CHMOD:await this.handleChmod();break;case n.REALPATH:await this.handleRealpath();break;case n.RENAME:await this.handleRename();break;case n.COPY_FILE:await this.handleCopyFile();break;case n.WRITE_STDOUT:this.handleWriteStdout();break;case n.WRITE_STDERR:this.handleWriteStderr();break;case n.EXIT:this.handleExit();break;case n.HTTP_REQUEST:await this.handleHttpRequest();break;case n.EXEC_COMMAND:await this.handleExecCommand();break;case n.INVOKE_TOOL:await this.handleInvokeTool();break;default:this.protocol.setErrorCode(l.IO_ERROR),this.protocol.setStatus(r.ERROR)}}catch(e){this.setErrorFromException(e)}}resolvePath(t){return this.fs.resolvePath(this.cwd,t)}async handleReadFile(){let t=this.resolvePath(this.protocol.getPath());try{let e=await this.fs.readFileBuffer(t);this.protocol.setResult(e),this.protocol.setStatus(r.SUCCESS)}catch(e){this.setErrorFromException(e)}}async handleWriteFile(){let t=this.resolvePath(this.protocol.getPath()),e=this.protocol.getData();try{await this.fs.writeFile(t,e),this.protocol.setStatus(r.SUCCESS)}catch(a){this.setErrorFromException(a)}}async handleStat(){let t=this.resolvePath(this.protocol.getPath());try{let e=await this.fs.stat(t);this.protocol.encodeStat(e),this.protocol.setStatus(r.SUCCESS)}catch(e){this.setErrorFromException(e)}}async handleLstat(){let t=this.resolvePath(this.protocol.getPath());try{let e=await this.fs.lstat(t);this.protocol.encodeStat(e),this.protocol.setStatus(r.SUCCESS)}catch(e){this.setErrorFromException(e)}}async handleReaddir(){let t=this.resolvePath(this.protocol.getPath());try{let e=await this.fs.readdir(t);this.protocol.setResultFromString(JSON.stringify(e)),this.protocol.setStatus(r.SUCCESS)}catch(e){this.setErrorFromException(e)}}async handleMkdir(){let t=this.resolvePath(this.protocol.getPath()),a=(this.protocol.getFlags()&S.MKDIR_RECURSIVE)!==0;try{await this.fs.mkdir(t,{recursive:a}),this.protocol.setStatus(r.SUCCESS)}catch(s){this.setErrorFromException(s)}}async handleRm(){let t=this.resolvePath(this.protocol.getPath()),e=this.protocol.getFlags(),a=(e&S.RECURSIVE)!==0,s=(e&S.FORCE)!==0;try{await this.fs.rm(t,{recursive:a,force:s}),this.protocol.setStatus(r.SUCCESS)}catch(i){this.setErrorFromException(i)}}async handleExists(){let t=this.resolvePath(this.protocol.getPath());try{let e=await this.fs.exists(t);this.protocol.setResult(new Uint8Array([e?1:0])),this.protocol.setStatus(r.SUCCESS)}catch(e){this.setErrorFromException(e)}}async handleAppendFile(){let t=this.resolvePath(this.protocol.getPath()),e=this.protocol.getData();try{await this.fs.appendFile(t,e),this.protocol.setStatus(r.SUCCESS)}catch(a){this.setErrorFromException(a)}}async handleSymlink(){let t=this.protocol.getPath(),e=this.protocol.getDataAsString(),a=this.resolvePath(t);try{await this.fs.symlink(e,a),this.protocol.setStatus(r.SUCCESS)}catch(s){this.setErrorFromException(s)}}async handleReadlink(){let t=this.resolvePath(this.protocol.getPath());try{let e=await this.fs.readlink(t);this.protocol.setResultFromString(e),this.protocol.setStatus(r.SUCCESS)}catch(e){this.setErrorFromException(e)}}async handleChmod(){let t=this.resolvePath(this.protocol.getPath()),e=this.protocol.getMode();try{await this.fs.chmod(t,e),this.protocol.setStatus(r.SUCCESS)}catch(a){this.setErrorFromException(a)}}async handleRealpath(){let t=this.resolvePath(this.protocol.getPath());try{let e=await this.fs.realpath(t);this.protocol.setResultFromString(e),this.protocol.setStatus(r.SUCCESS)}catch(e){this.setErrorFromException(e)}}async handleRename(){let t=this.resolvePath(this.protocol.getPath()),e=this.resolvePath(this.protocol.getDataAsString());try{await this.fs.mv(t,e),this.protocol.setStatus(r.SUCCESS)}catch(a){this.setErrorFromException(a)}}async handleCopyFile(){let t=this.resolvePath(this.protocol.getPath()),e=this.resolvePath(this.protocol.getDataAsString());try{await this.fs.cp(t,e),this.protocol.setStatus(r.SUCCESS)}catch(a){this.setErrorFromException(a)}}handleWriteStdout(){let t=this.protocol.getDataAsString();if(!this.tryAppendOutput("stdout",t)){this.outputLimitExceeded=!0,this.output.exitCode=1,this.appendOutputLimitError(),this.protocol.setErrorCode(l.IO_ERROR),this.protocol.setResultFromString("Output size limit exceeded"),this.protocol.setStatus(r.ERROR);return}this.protocol.setStatus(r.SUCCESS)}handleWriteStderr(){let t=this.protocol.getDataAsString();if(!this.tryAppendOutput("stderr",t)){this.outputLimitExceeded=!0,this.output.exitCode=1,this.appendOutputLimitError(),this.protocol.setErrorCode(l.IO_ERROR),this.protocol.setResultFromString("Output size limit exceeded"),this.protocol.setStatus(r.ERROR);return}this.protocol.setStatus(r.SUCCESS)}handleExit(){let t=this.protocol.getFlags();this.outputLimitExceeded?this.output.exitCode===0&&(this.output.exitCode=1):this.output.exitCode=t,this.protocol.setStatus(r.SUCCESS),this.running=!1}tryAppendOutput(t,e){return this.outputLimitExceeded?!1:this.maxOutputSize<=0?(t==="stdout"?this.output.stdout+=e:this.output.stderr+=e,!0):this.output.stdout.length+this.output.stderr.length+e.length>this.maxOutputSize?!1:(t==="stdout"?this.output.stdout+=e:this.output.stderr+=e,!0)}appendOutputLimitError(){if(this.maxOutputSize<=0)return;let t=`${this.commandName}: total output size exceeded (>${this.maxOutputSize} bytes), increase executionLimits.maxOutputSize
|
|
12
|
+
`,e=t.length>this.maxOutputSize?t.slice(0,this.maxOutputSize):t;if(this.output.stderr.includes("total output size exceeded"))return;let s=this.output.stdout.length+this.output.stderr.length+e.length-this.maxOutputSize;if(s>0)if(this.output.stdout.length>=s)this.output.stdout=this.output.stdout.slice(0,this.output.stdout.length-s);else{let i=s-this.output.stdout.length;this.output.stdout="",i>=this.output.stderr.length?this.output.stderr="":this.output.stderr=this.output.stderr.slice(0,this.output.stderr.length-i)}this.output.stderr+=e}async handleHttpRequest(){let t=this.secureFetch;if(!t){this.protocol.setErrorCode(l.NETWORK_NOT_CONFIGURED),this.protocol.setResultFromString("Network access not configured. Enable network in Bash options."),this.protocol.setStatus(r.ERROR);return}let e=this.protocol.getPath(),a=this.protocol.getDataAsString();try{let s=a?JSON.parse(a):{},i=this.remainingMs(),c=await this.raceDeadline(()=>t(e,{method:s.method,headers:s.headers,body:s.body,timeoutMs:i})),d=JSON.stringify({status:c.status,statusText:c.statusText,headers:c.headers,bodyBase64:D(c.body,"base64"),url:c.url});this.protocol.setResultFromString(d),this.protocol.setStatus(r.SUCCESS)}catch(s){let i=m(s instanceof Error?s.message:String(s));this.protocol.setErrorCode(l.NETWORK_ERROR),this.protocol.setResultFromString(i),this.protocol.setStatus(r.ERROR)}}async handleExecCommand(){let t=this.exec;if(!t){this.protocol.setErrorCode(l.IO_ERROR),this.protocol.setResultFromString("Command execution not available in this context."),this.protocol.setStatus(r.ERROR);return}let e=this.protocol.getPath(),a=this.protocol.getDataAsString(),s=new AbortController;try{let i={cwd:this.cwd,signal:s.signal};if(a){let E=JSON.parse(a);E.stdin&&(i.stdin=E.stdin),E.args&&Array.isArray(E.args)&&(i.args=E.args.map(f=>String(f)),e=O([e]))}let c=await this.raceDeadline(()=>t(e,i)),d=JSON.stringify({stdout:c.stdout,stderr:c.stderr,exitCode:c.exitCode});this.protocol.setResultFromString(d),this.protocol.setStatus(r.SUCCESS)}catch(i){s.abort();let c=i instanceof Error?i.message:String(i);this.protocol.setErrorCode(l.IO_ERROR),this.protocol.setResultFromString(c),this.protocol.setStatus(r.ERROR)}}async handleInvokeTool(){let t=this.invokeTool;if(!t){this.protocol.setErrorCode(l.IO_ERROR),this.protocol.setResultFromString("Tool invocation not available in this context."),this.protocol.setStatus(r.ERROR);return}let e=this.protocol.getPath(),a=this.protocol.getDataAsString();try{let s=await this.raceDeadline(()=>T.runTrustedAsync(()=>t(e,a)));this.protocol.setResultFromString(s),this.protocol.setStatus(r.SUCCESS)}catch(s){let i=w(s instanceof Error?s.message:String(s));this.protocol.setErrorCode(l.IO_ERROR),this.protocol.setResultFromString(i),this.protocol.setStatus(r.ERROR)}}setErrorFromException(t){let e=t instanceof Error?t.message:String(t),a=m(e),s=l.IO_ERROR,i=e.toLowerCase();i.includes("no such file")||i.includes("not found")||i.includes("enoent")?s=l.NOT_FOUND:i.includes("is a directory")||i.includes("eisdir")?s=l.IS_DIRECTORY:i.includes("not a directory")||i.includes("enotdir")?s=l.NOT_DIRECTORY:i.includes("already exists")||i.includes("eexist")?s=l.EXISTS:(i.includes("permission")||i.includes("eperm")||i.includes("eacces"))&&(s=l.PERMISSION_DENIED),this.protocol.setErrorCode(s),this.protocol.setResultFromString(a),this.protocol.setStatus(r.ERROR)}};export{x as a,C as b};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import{createRequire} from"node:module";const require=createRequire(import.meta.url);
|
|
3
|
+
import{a as o}from"./chunk-FUT3X2GJ.js";import{a as i}from"./chunk-CPKBPQ2C.js";var h=class{scope;site;stdoutChunks=[];stderrChunks=[];stdoutBytes=0;stderrBytes=0;attachedErrors=new WeakSet;constructor(t,s){this.scope=t,this.site=s}append(t,s,e=0,r="text"){let d;try{d=this.scope.appendOutput(t,s,this.site,e,r)}catch(n){throw this.prependTo(n),n}s&&(t==="stdout"?this.stdoutChunks:this.stderrChunks).push(s),t==="stdout"?this.stdoutBytes+=d:this.stderrBytes+=d}prependTo(t){t instanceof o&&(this.attachedErrors.has(t)||(this.attachedErrors.add(t),t.prependOutput(this.stdout,this.stderr)))}appendResult(t,s=t.stdout){let e=t.stdoutKind==="bytes"||t.stdoutEncoding==="binary"?"bytes":"text",r=e==="bytes"?s.length:i(s);this.append("stdout",s,Math.min(t.internalOutputAccounting?.stdout??0,r),e),this.append("stderr",t.stderr,t.internalOutputAccounting?.stderr??0)}build(t,s){return{stdout:this.stdoutChunks.join(""),stderr:this.stderrChunks.join(""),exitCode:t,...s,internalOutputAccounting:{stdout:this.stdoutBytes,stderr:this.stderrBytes}}}get stdout(){return this.stdoutChunks.join("")}get stderr(){return this.stderrChunks.join("")}};export{h as a};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import{createRequire} from"node:module";const require=createRequire(import.meta.url);
|
|
3
|
+
import{a as s}from"./chunk-2YLY6FJA.js";var a=s("sha256sum","sha256","compute SHA256 message digest"),m={name:"sha256sum",flags:[{flag:"-c",type:"boolean"}],needsFiles:!0};export{a,m as b};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import{createRequire} from"node:module";const require=createRequire(import.meta.url);
|
|
3
|
+
var e={name:"true",async execute(){return{stdout:"",stderr:"",exitCode:0}}},t={name:"false",async execute(){return{stdout:"",stderr:"",exitCode:1}}},s={name:"true",flags:[]},r={name:"false",flags:[]};export{e as a,t as b,s as c,r as d};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import{createRequire} from"node:module";const require=createRequire(import.meta.url);
|
|
3
|
+
import{a as we,b as Oe}from"./chunk-DN2YCFOR.js";var xe=Oe((le,pe)=>{(function(he,w){typeof define=="function"&&define.amd?define([],w):typeof pe=="object"&&typeof le<"u"?pe.exports=w():he.Papa=w()})(le,function he(){"use strict";var w=(function(){return typeof self<"u"?self:typeof window<"u"?window:typeof w<"u"?w:{}})();function _e(){var t=w.URL||w.webkitURL||null,e=he.toString();return f.BLOB_URL||(f.BLOB_URL=t.createObjectURL(new Blob(["var global = (function() { if (typeof self !== 'undefined') { return self; } if (typeof window !== 'undefined') { return window; } if (typeof global !== 'undefined') { return global; } return {}; })(); global.IS_PAPA_WORKER=true; ","(",e,")();"],{type:"text/javascript"})))}var Y=!w.document&&!!w.postMessage,ue=w.IS_PAPA_WORKER||!1,ne={},Re=0,f={};f.parse=ge,f.unparse=Ee,f.RECORD_SEP="",f.UNIT_SEP="",f.BYTE_ORDER_MARK="\uFEFF",f.BAD_DELIMITERS=["\r",`
|
|
4
|
+
`,'"',f.BYTE_ORDER_MARK],f.WORKERS_SUPPORTED=!Y&&!!w.Worker,f.NODE_STREAM_INPUT=1,f.LocalChunkSize=1024*1024*10,f.RemoteChunkSize=1024*1024*5,f.DefaultDelimiter=",",f.Parser=fe,f.ParserHandle=ce,f.NetworkStreamer=V,f.FileStreamer=G,f.StringStreamer=Q,f.ReadableStreamStreamer=ee,typeof PAPA_BROWSER_CONTEXT>"u"&&(f.DuplexStreamStreamer=te),ue&&(w.onmessage=be);function oe(t){return t.charCodeAt(0)===65279?t.slice(1):t}function ge(t,e){e=e||{};var r=e.dynamicTyping||!1;if(g(r)&&(e.dynamicTypingFunction=r,r={}),e.dynamicTyping=r,e.transform=g(e.transform)?e.transform:!1,e.worker&&f.WORKERS_SUPPORTED){var s=Ce();s.userStep=e.step,s.userChunk=e.chunk,s.userComplete=e.complete,s.userError=e.error,e.step=g(e.step),e.chunk=g(e.chunk),e.complete=g(e.complete),e.error=g(e.error),delete e.worker,s.postMessage({input:t,config:e,workerId:s.id});return}var i=null;return t===f.NODE_STREAM_INPUT&&typeof PAPA_BROWSER_CONTEXT>"u"?(i=new te(e),i.getStream()):(typeof t=="string"?(t=oe(t),e.download?i=new V(e):i=new Q(e)):t.readable===!0&&g(t.read)&&g(t.on)?i=new ee(e):(w.File&&t instanceof File||t instanceof Object)&&(i=new G(e)),i.stream(t))}function Ee(t,e){var r=!1,s=!0,i=",",c=`\r
|
|
5
|
+
`,m='"',h=m+m,_=!1,x=null,S=!1;P();var d=new RegExp(re(m),"g");if(typeof t=="string"&&(t=JSON.parse(t)),Array.isArray(t)){if(!t.length||Array.isArray(t[0]))return u(null,t,_);if(typeof t[0]=="object")return u(x||Object.keys(t[0]),t,_)}else if(typeof t=="object")return typeof t.data=="string"&&(t.data=JSON.parse(t.data)),Array.isArray(t.data)&&(t.fields||(t.fields=t.meta&&t.meta.fields||x),t.fields||(t.fields=Array.isArray(t.data[0])?t.fields:typeof t.data[0]=="object"?Object.keys(t.data[0]):[]),!Array.isArray(t.data[0])&&typeof t.data[0]!="object"&&(t.data=[t.data])),u(t.fields||[],t.data||[],_);throw new Error("Unable to serialize unrecognized input");function P(){if(typeof e=="object"){if(typeof e.delimiter=="string"&&!f.BAD_DELIMITERS.filter(function(y){return e.delimiter.indexOf(y)!==-1}).length&&(i=e.delimiter),(typeof e.quotes=="boolean"||typeof e.quotes=="function"||Array.isArray(e.quotes))&&(r=e.quotes),(typeof e.skipEmptyLines=="boolean"||typeof e.skipEmptyLines=="string")&&(_=e.skipEmptyLines),typeof e.newline=="string"&&(c=e.newline),typeof e.quoteChar=="string"&&(m=e.quoteChar,h=m+m),typeof e.header=="boolean"&&(s=e.header),Array.isArray(e.columns)){if(e.columns.length===0)throw new Error("Option columns is empty");x=e.columns}e.escapeChar!==void 0&&(h=e.escapeChar+m),e.escapeFormulae instanceof RegExp?S=e.escapeFormulae:typeof e.escapeFormulae=="boolean"&&e.escapeFormulae&&(S=/^[=+\-@\t\r].*$/)}}function u(y,v,C){var A="";typeof y=="string"&&(y=JSON.parse(y)),typeof v=="string"&&(v=JSON.parse(v));var b=Array.isArray(y)&&y.length>0,D=!Array.isArray(v[0]);if(b&&s){for(var q=0;q<y.length;q++)q>0&&(A+=i),A+=l(y[q],q);v.length>0&&(A+=c)}for(var k=0;k<v.length;k++){var N=b?y.length:v[k].length,W=!1,a=b?Object.keys(v[k]).length===0:v[k].length===0;if(C&&!b&&(W=C==="greedy"?v[k].join("").trim()==="":v[k].length===1&&v[k][0].length===0),C==="greedy"&&b){for(var o=[],p=0;p<N;p++){var E=D?y[p]:p;o.push(v[k][E])}W=o.join("").trim()===""}if(!W){for(var n=0;n<N;n++){n>0&&!a&&(A+=i);var R=b&&D?y[n]:n;A+=l(v[k][R],n)}k<v.length-1&&(!C||N>0&&!a)&&(A+=c)}}return A}function l(y,v){if(typeof y>"u"||y===null)return"";if(y.constructor===Date)return isNaN(y.getTime())?"":y.toISOString();var C=!1;S&&typeof y=="string"&&S.test(y)&&(y="'"+y,C=!0);var A=y.toString(),b=A.replace(d,h);return C=C||r===!0||typeof r=="function"&&r(y,v)||Array.isArray(r)&&r[v]||J(b,f.BAD_DELIMITERS)||b.indexOf(i)>-1||A.indexOf(m)>-1||b.charAt(0)===" "||b.charAt(b.length-1)===" ",C?m+b+m:b}function J(y,v){for(var C=0;C<v.length;C++)if(y.indexOf(v[C])>-1)return!0;return!1}}function z(t){this._handle=null,this._finished=!1,this._completed=!1,this._halted=!1,this._input=null,this._baseIndex=0,this._partialLine="",this._rowCount=0,this._start=0,this._nextChunk=null,this.isFirstChunk=!0,this._completeResults={data:[],errors:[],meta:{}},e.call(this,t),this.parseChunk=function(r,s){let i=parseInt(this._config.skipFirstNLines)||0;if(this.isFirstChunk&&i>0){let S=this._config.newline;if(!S){let P=this._config.quoteChar||'"';S=this._handle.guessLineEndings(r,P)}r=[...r.split(S).slice(i)].join(S)}if(this.isFirstChunk&&g(this._config.beforeFirstChunk)){var c=this._config.beforeFirstChunk(r);c!==void 0&&(r=c)}this.isFirstChunk=!1,this._halted=!1;var m=this._partialLine+r;this._partialLine="";var h=this._handle.parse(m,this._baseIndex,!this._finished);if(this._handle.paused()||this._handle.aborted()){this._halted=!0;return}var _=h.meta.cursor;this._finished||(this._partialLine=m.substring(_-this._baseIndex),this._baseIndex=_),h&&h.data&&(this._rowCount+=h.data.length);var x=this._finished||this._config.preview&&this._rowCount>=this._config.preview;if(ue)w.postMessage({results:h,workerId:f.WORKER_ID,finished:x});else if(g(this._config.chunk)&&!s){if(this._config.chunk(h,this._handle),this._handle.paused()||this._handle.aborted()){this._halted=!0;return}h=void 0,this._completeResults=void 0}return!this._config.step&&!this._config.chunk&&(this._completeResults.data=this._completeResults.data.concat(h.data),this._completeResults.errors=this._completeResults.errors.concat(h.errors),this._completeResults.meta=h.meta),!this._completed&&x&&g(this._config.complete)&&(!h||!h.meta.aborted)&&(this._config.complete(this._completeResults,this._input),this._completed=!0),!x&&(!h||!h.meta.paused)&&this._nextChunk(),h},this._sendError=function(r){g(this._config.error)?this._config.error(r):ue&&this._config.error&&w.postMessage({workerId:f.WORKER_ID,error:r,finished:!1})};function e(r){var s=ae(r);s.chunkSize=parseInt(s.chunkSize),!r.step&&!r.chunk&&(s.chunkSize=null),this._handle=new ce(s),this._handle.streamer=this,this._config=s}}function V(t){t=t||{},t.chunkSize||(t.chunkSize=f.RemoteChunkSize),z.call(this,t);var e;Y?this._nextChunk=function(){this._readChunk(),this._chunkLoaded()}:this._nextChunk=function(){this._readChunk()},this.stream=function(s){this._input=s,this._nextChunk()},this._readChunk=function(){if(this._finished){this._chunkLoaded();return}if(e=new XMLHttpRequest,this._config.withCredentials&&(e.withCredentials=this._config.withCredentials),Y||(e.onload=L(this._chunkLoaded,this),e.onerror=L(this._chunkError,this)),e.open(this._config.downloadRequestBody?"POST":"GET",this._input,!Y),this._config.downloadRequestHeaders){var s=this._config.downloadRequestHeaders;for(var i in s)e.setRequestHeader(i,s[i])}if(this._config.chunkSize){var c=this._start+this._config.chunkSize-1;e.setRequestHeader("Range","bytes="+this._start+"-"+c)}try{e.send(this._config.downloadRequestBody)}catch(m){this._chunkError(m.message)}Y&&e.status===0&&this._chunkError()},this._chunkLoaded=function(){if(e.readyState===4){if(e.status<200||e.status>=400){this._chunkError();return}this._start+=this._config.chunkSize?this._config.chunkSize:e.responseText.length,this._finished=!this._config.chunkSize||this._start>=r(e),this.parseChunk(e.responseText)}},this._chunkError=function(s){var i=e.statusText||s;this._sendError(new Error(i))};function r(s){var i=s.getResponseHeader("Content-Range");return i===null?-1:parseInt(i.substring(i.lastIndexOf("/")+1))}}V.prototype=Object.create(z.prototype),V.prototype.constructor=V;function G(t){t=t||{},t.chunkSize||(t.chunkSize=f.LocalChunkSize),z.call(this,t);var e,r,s=typeof FileReader<"u";this.stream=function(i){this._input=i,r=i.slice||i.webkitSlice||i.mozSlice,s?(e=new FileReader,e.onload=L(this._chunkLoaded,this),e.onerror=L(this._chunkError,this)):e=new FileReaderSync,this._nextChunk()},this._nextChunk=function(){!this._finished&&(!this._config.preview||this._rowCount<this._config.preview)&&this._readChunk()},this._readChunk=function(){var i=this._input;if(this._config.chunkSize){var c=Math.min(this._start+this._config.chunkSize,this._input.size);i=r.call(i,this._start,c)}var m=e.readAsText(i,this._config.encoding);s||this._chunkLoaded({target:{result:m}})},this._chunkLoaded=function(i){this._start+=this._config.chunkSize,this._finished=!this._config.chunkSize||this._start>=this._input.size,this.parseChunk(i.target.result)},this._chunkError=function(){this._sendError(e.error)}}G.prototype=Object.create(z.prototype),G.prototype.constructor=G;function Q(t){t=t||{},z.call(this,t);var e;this.stream=function(r){return e=r,this._nextChunk()},this._nextChunk=function(){if(!this._finished){var r=this._config.chunkSize,s;return r?(s=e.substring(0,r),e=e.substring(r)):(s=e,e=""),this._finished=!e,this.parseChunk(s)}}}Q.prototype=Object.create(Q.prototype),Q.prototype.constructor=Q;function ee(t){t=t||{},z.call(this,t);var e=[],r=!0,s=!1;this.pause=function(){z.prototype.pause.apply(this,arguments),this._input.pause()},this.resume=function(){z.prototype.resume.apply(this,arguments),this._input.resume()},this.stream=function(i){this._input=i,this._input.on("data",this._streamData),this._input.on("end",this._streamEnd),this._input.on("error",this._streamError)},this._checkIsFinished=function(){s&&e.length===1&&(this._finished=!0)},this._nextChunk=function(){this._checkIsFinished(),e.length?this.parseChunk(e.shift()):r=!0},this._streamData=L(function(i){try{e.push(typeof i=="string"?i:i.toString(this._config.encoding)),r&&(r=!1,this._checkIsFinished(),this.parseChunk(e.shift()))}catch(c){this._streamError(c)}},this),this._streamError=L(function(i){this._streamCleanUp(),this._sendError(i)},this),this._streamEnd=L(function(){this._streamCleanUp(),s=!0,this._streamData("")},this),this._streamCleanUp=L(function(){this._input.removeListener("data",this._streamData),this._input.removeListener("end",this._streamEnd),this._input.removeListener("error",this._streamError)},this)}ee.prototype=Object.create(z.prototype),ee.prototype.constructor=ee;function te(t){var e=we("stream").Duplex,r=ae(t),s=!0,i=!1,c=[],m=null;this._onCsvData=function(h){var _=h.data;!m.push(_)&&!this._handle.paused()&&this._handle.pause()},this._onCsvComplete=function(){m.push(null)},r.step=L(this._onCsvData,this),r.complete=L(this._onCsvComplete,this),z.call(this,r),this._nextChunk=function(){i&&c.length===1&&(this._finished=!0),c.length?c.shift()():s=!0},this._addToParseQueue=function(h,_){c.push(L(function(){if(this.parseChunk(typeof h=="string"?h:h.toString(r.encoding)),g(_))return _()},this)),s&&(s=!1,this._nextChunk())},this._onRead=function(){this._handle.paused()&&this._handle.resume()},this._onWrite=function(h,_,x){this._addToParseQueue(h,x)},this._onWriteComplete=function(){i=!0,this._addToParseQueue("")},this.getStream=function(){return m},m=new e({readableObjectMode:!0,decodeStrings:!1,read:L(this._onRead,this),write:L(this._onWrite,this)}),m.once("finish",L(this._onWriteComplete,this))}typeof PAPA_BROWSER_CONTEXT>"u"&&(te.prototype=Object.create(z.prototype),te.prototype.constructor=te);function ce(t){var e=Math.pow(2,53),r=-e,s=/^\s*-?(\d+\.?|\.\d+|\d+\.\d+)([eE][-+]?\d+)?\s*$/,i=/^((\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d\.\d+([+-][0-2]\d:[0-5]\d|Z))|(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d([+-][0-2]\d:[0-5]\d|Z))|(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d([+-][0-2]\d:[0-5]\d|Z)))$/,c=this,m=0,h=0,_,x,S=!1,d=!1,P,u=[],l={data:[],errors:[],meta:{}};if(g(t.step)){var J=t.step;t.step=function(a){if(l=a,A())C();else{if(C(),l.data.length===0)return;m+=a.data.length,t.preview&&m>t.preview?x.abort():(l.data=l.data[0],J(l,c))}}}this.parse=function(a,o,p){var E=t.quoteChar||'"';if(t.newline||(t.newline=this.guessLineEndings(a,E)),P=!1,t.delimiter)g(t.delimiter)&&(t.delimiter=t.delimiter(a),l.meta.delimiter=t.delimiter);else{var n=N(a,t.newline,t.skipEmptyLines,t.comments,t.delimitersToGuess);n.successful?t.delimiter=n.bestDelimiter:(P=!0,t.delimiter=f.DefaultDelimiter),l.meta.delimiter=t.delimiter}var R=ae(t);return t.preview&&t.header&&R.preview++,_=a,x=new fe(R),l=x.parse(_,o,p),C(),S?{meta:{paused:!0}}:l||{meta:{paused:!1}}},this.paused=function(){return S},this.pause=function(){S=!0,x.abort(),_=g(t.chunk)?"":_.substring(x.getCharIndex())},this.resume=function(){c.streamer._halted?(S=!1,c.streamer.parseChunk(_,!0)):setTimeout(c.resume,3)},this.aborted=function(){return d},this.abort=function(){d=!0,x.abort(),l.meta.aborted=!0,g(t.complete)&&t.complete(l),_=""},this.guessLineEndings=function(a,o){a=a.substring(0,1024*1024);var p=new RegExp(re(o)+"([^]*?)"+re(o),"gm");a=a.replace(p,"");var E=a.split("\r"),n=a.split(`
|
|
6
|
+
`),R=n.length>1&&n[0].length<E[0].length;if(E.length===1||R)return`
|
|
7
|
+
`;for(var T=0,O=0;O<E.length;O++)E[O][0]===`
|
|
8
|
+
`&&T++;return T>=E.length/2?`\r
|
|
9
|
+
`:"\r"};function y(a){return t.skipEmptyLines==="greedy"?a.join("").trim()==="":a.length===1&&a[0].length===0}function v(a){if(s.test(a)){var o=parseFloat(a);if(o>r&&o<e)return!0}return!1}function C(){return l&&P&&(W("Delimiter","UndetectableDelimiter","Unable to auto-detect delimiting character; defaulted to '"+f.DefaultDelimiter+"'"),P=!1),t.skipEmptyLines&&(l.data=l.data.filter(function(a){return!y(a)})),A()&&b(),k()}function A(){return t.header&&u.length===0}function b(){if(!l)return;function a(p,E){p=oe(p),g(t.transformHeader)&&(p=t.transformHeader(p,E)),u.push(p)}if(Array.isArray(l.data[0])){for(var o=0;A()&&o<l.data.length;o++)l.data[o].forEach(a);l.data.splice(0,1)}else l.data.forEach(a)}function D(a){return t.dynamicTypingFunction&&t.dynamicTyping[a]===void 0&&(t.dynamicTyping[a]=t.dynamicTypingFunction(a)),(t.dynamicTyping[a]||t.dynamicTyping)===!0}function q(a,o){return D(a)?o==="true"||o==="TRUE"?!0:o==="false"||o==="FALSE"?!1:v(o)?parseFloat(o):i.test(o)?new Date(o):o===""?null:o:o}function k(){if(!l||!t.header&&!t.dynamicTyping&&!t.transform)return l;function a(p,E){var n=t.header?{}:[],R;for(R=0;R<p.length;R++){var T=R,O=p[R];t.header&&(T=R>=u.length?"__parsed_extra":u[R]),t.transform&&(O=t.transform(O,T)),O=q(T,O),T==="__parsed_extra"?(n[T]=n[T]||[],n[T].push(O)):n[T]=O}return t.header&&(R>u.length?W("FieldMismatch","TooManyFields","Too many fields: expected "+u.length+" fields but parsed "+R,h+E):R<u.length&&W("FieldMismatch","TooFewFields","Too few fields: expected "+u.length+" fields but parsed "+R,h+E)),n}var o=1;return!l.data.length||Array.isArray(l.data[0])?(l.data=l.data.map(a),o=l.data.length):l.data=a(l.data,0),t.header&&l.meta&&(l.meta.fields=u),h+=o,l}function N(a,o,p,E,n){var R,T,O,X;n=n||[","," ","|",";",f.RECORD_SEP,f.UNIT_SEP];for(var j=0;j<n.length;j++){var se=n[j],K=0,B=0,F=0;O=void 0;for(var H=new fe({comments:E,delimiter:se,newline:o,preview:10}).parse(a),I=0;I<H.data.length;I++){if(p&&y(H.data[I])){F++;continue}var M=H.data[I].length;if(B+=M,typeof O>"u"){O=M;continue}else M>0&&(K+=Math.abs(M-O),O=M)}H.data.length>0&&(B/=H.data.length-F),B>1.99&&(typeof T>"u"||K<T||K===T&&B>X)&&(T=K,R=se,X=B)}return t.delimiter=R,{successful:!!R,bestDelimiter:R}}function W(a,o,p,E){var n={type:a,code:o,message:p};E!==void 0&&(n.row=E),l.errors.push(n)}}function re(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function fe(t){t=t||{};var e=t.delimiter,r=t.newline,s=t.comments,i=t.step,c=t.preview,m=t.fastMode,h,_=null,x=!1;t.quoteChar===void 0||t.quoteChar===null?h='"':h=t.quoteChar;var S=h;if(t.escapeChar!==void 0&&(S=t.escapeChar),(typeof e!="string"||f.BAD_DELIMITERS.indexOf(e)>-1)&&(e=","),s===e)throw new Error("Comment character same as delimiter");s===!0?s="#":(typeof s!="string"||f.BAD_DELIMITERS.indexOf(s)>-1)&&(s=!1),r!==`
|
|
10
|
+
`&&r!=="\r"&&r!==`\r
|
|
11
|
+
`&&(r=`
|
|
12
|
+
`);var d=0,P=!1;this.parse=function(u,l,J){if(typeof u!="string")throw new Error("Input must be a string");var y=u.length,v=e.length,C=r.length,A=s.length,b=g(i);d=0;var D=[],q=[],k=[],N=0;if(!u)return F();if(m||m!==!1&&u.indexOf(h)===-1){for(var W=u.split(r),a=0;a<W.length;a++){if(k=W[a],d+=k.length,a!==W.length-1)d+=r.length;else if(J)return F();if(!(s&&k.substring(0,A)===s)){if(b){if(D=[],j(k.split(e)),H(),P)return F()}else j(k.split(e));if(c&&a>=c)return D=D.slice(0,c),F(!0)}}return F()}for(var o=u.indexOf(e,d),p=u.indexOf(r,d),E=new RegExp(re(S)+re(h),"g"),n=u.indexOf(h,d);;){if(u[d]===h){for(n=d,d++;;){if(n=u.indexOf(h,n+1),n===-1)return J||q.push({type:"Quotes",code:"MissingQuotes",message:"Quoted field unterminated",row:D.length,index:d}),K();if(n===y-1){var R=u.substring(d,n).replace(E,h);return K(R)}if(h===S&&u[n+1]===S){n++;continue}if(!(h!==S&&n!==0&&u[n-1]===S)){o!==-1&&o<n+1&&(o=u.indexOf(e,n+1)),p!==-1&&p<n+1&&(p=u.indexOf(r,n+1));var T=p===-1?o:Math.min(o,p),O=se(T);if(u.substr(n+1+O,v)===e){k.push(u.substring(d,n).replace(E,h)),d=n+1+O+v,u[n+1+O+v]!==h&&(n=u.indexOf(h,d)),o=u.indexOf(e,d),p=u.indexOf(r,d);break}var X=se(p);if(u.substring(n+1+X,n+1+X+C)===r){if(k.push(u.substring(d,n).replace(E,h)),B(n+1+X+C),o=u.indexOf(e,d),n=u.indexOf(h,d),b&&(H(),P))return F();if(c&&D.length>=c)return F(!0);break}q.push({type:"Quotes",code:"InvalidQuotes",message:"Trailing quote on quoted field is malformed",row:D.length,index:d}),n++}}continue}if(s&&k.length===0&&u.substring(d,d+A)===s){if(p===-1)return F();d=p+C,p=u.indexOf(r,d),o=u.indexOf(e,d);continue}if(o!==-1&&(o<p||p===-1)){k.push(u.substring(d,o)),d=o+v,o=u.indexOf(e,d);continue}if(p!==-1){if(k.push(u.substring(d,p)),B(p+C),b&&(H(),P))return F();if(c&&D.length>=c)return F(!0);continue}break}return K();function j(I){D.push(I),N=d}function se(I){var M=0;if(I!==-1){var $=u.substring(n+1,I);$&&$.trim()===""&&(M=$.length)}return M}function K(I){return J||(typeof I>"u"&&(I=u.substring(d)),k.push(I),d=y,j(k),b&&H()),F()}function B(I){d=I,j(k),k=[],p=u.indexOf(r,d)}function F(I){if(t.header&&!l&&D.length&&!x){let M=D[0],$=Object.create(null),de=new Set(M),ve=!1;for(let Z=0;Z<M.length;Z++){let U=oe(M[Z]);if(g(t.transformHeader)&&(U=t.transformHeader(U,Z)),!$[U])$[U]=1,M[Z]=U;else{let ie,ke=$[U];do ie=`${U}_${ke}`,ke++;while(de.has(ie));de.add(ie),M[Z]=ie,$[U]++,ve=!0,_===null&&(_={}),_[ie]=U}de.add(U)}ve&&console.warn("Duplicate headers found and renamed."),x=!0}return{data:D,errors:q,meta:{delimiter:e,linebreak:r,aborted:P,truncated:!!I,cursor:N+(l||0),renamedHeaders:_}}}function H(){i(F()),D=[],q=[]}},this.abort=function(){P=!0},this.getCharIndex=function(){return d}}function Ce(){if(!f.WORKERS_SUPPORTED)return!1;var t=_e(),e=new w.Worker(t);return e.onmessage=Se,e.id=Re++,ne[e.id]=e,e}function Se(t){var e=t.data,r=ne[e.workerId],s=!1;if(e.error)r.userError(e.error,e.file);else if(e.results&&e.results.data){var i=function(){s=!0,me(e.workerId,{data:[],errors:[],meta:{aborted:!0}})},c={abort:i,pause:ye,resume:ye};if(g(r.userStep)){for(var m=0;m<e.results.data.length&&(r.userStep({data:e.results.data[m],errors:e.results.errors,meta:e.results.meta},c),!s);m++);delete e.results}else g(r.userChunk)&&(r.userChunk(e.results,c,e.file),delete e.results)}e.finished&&!s&&me(e.workerId,e.results)}function me(t,e){var r=ne[t];g(r.userComplete)&&r.userComplete(e),r.terminate(),delete ne[t]}function ye(){throw new Error("Not implemented.")}function be(t){var e=t.data;if(typeof f.WORKER_ID>"u"&&e&&(f.WORKER_ID=e.workerId),typeof e.input=="string")w.postMessage({workerId:f.WORKER_ID,results:f.parse(e.input,e.config),finished:!0});else if(w.File&&e.input instanceof File||e.input instanceof Object){var r=f.parse(e.input,e.config);r&&w.postMessage({workerId:f.WORKER_ID,results:r,finished:!0})}}function ae(t){if(typeof t!="object"||t===null)return t;var e=Array.isArray(t)?[]:{};for(var r in t)e[r]=ae(t[r]);return e}function L(t,e){return function(){t.apply(e,arguments)}}function g(t){return typeof t=="function"}return f})});export{xe as a};
|
|
13
|
+
/*! Bundled license information:
|
|
14
|
+
|
|
15
|
+
papaparse/papaparse.js:
|
|
16
|
+
(* @license
|
|
17
|
+
Papa Parse
|
|
18
|
+
v5.6.0
|
|
19
|
+
https://github.com/mholt/PapaParse
|
|
20
|
+
License: MIT
|
|
21
|
+
*)
|
|
22
|
+
*/
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import{createRequire} from"node:module";const require=createRequire(import.meta.url);
|
|
3
|
+
import{a as e,b as a}from"./chunk-MUFNRCMY.js";var t={name:"clear",summary:"clear the terminal screen",usage:"clear [OPTIONS]",options:[" --help display this help and exit"]},s={name:"clear",async execute(r,c){return a(r)?e(t):{stdout:"\x1B[2J\x1B[H",stderr:"",exitCode:0}}},o={name:"clear",flags:[]};export{s as a,o as b};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import{createRequire} from"node:module";const require=createRequire(import.meta.url);
|
|
3
|
+
import{d as k}from"./chunk-WEHA3JFD.js";import{l as u,m}from"./chunk-FUT3X2GJ.js";import{a as h,b as p,c as g}from"./chunk-MUFNRCMY.js";var w={name:"readlink",summary:"print resolved symbolic links or canonical file names",usage:"readlink [OPTIONS] FILE...",options:["-f canonicalize by following every symlink in every component of the given name recursively"," --help display this help and exit"]},x={name:"readlink",async execute(r,n){if(p(r))return h(w);let l=!1,t=0;for(;t<r.length&&r[t].startsWith("-");){let i=r[t];if(i==="-f"||i==="--canonicalize")l=!0,t++;else if(i==="--"){t++;break}else return g("readlink",i)}let c=r.slice(t);if(c.length===0)return{stdout:"",stderr:`readlink: missing operand
|
|
4
|
+
`,exitCode:1};let a="",d=!1,y=new k({limits:n.limits,signal:n.signal,executionScope:n.executionScope,site:"readlink",label:"symlink traversal"});for(let i of c){let s=n.fs.resolvePath(n.cwd,i);try{if(l){let e=s,o=new Set;for(;y.visit(o.size),!o.has(e);){o.add(e);try{let f=await n.fs.readlink(e);if(f.startsWith("/"))e=f;else{let b=e.substring(0,e.lastIndexOf("/"))||"/";e=n.fs.resolvePath(b,f)}}catch{break}}a+=`${e}
|
|
5
|
+
`}else{let e=await n.fs.readlink(s);a+=`${e}
|
|
6
|
+
`}}catch(e){if(e instanceof u||e instanceof m)throw e;l?a+=`${s}
|
|
7
|
+
`:d=!0}}return{stdout:a,stderr:"",exitCode:d?1:0}}},F={name:"readlink",flags:[{flag:"-f",type:"boolean"},{flag:"-e",type:"boolean"}],needsArgs:!0};export{x as a,F as b};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import{createRequire} from"node:module";const require=createRequire(import.meta.url);
|
|
3
|
+
import{a as h}from"./chunk-HW2VJKFH.js";import{a as y,b as w,c as g}from"./chunk-MUFNRCMY.js";var $={name:"date",summary:"display the current time in the given FORMAT",usage:"date [OPTION]... [+FORMAT]",options:["-d, --date=STRING display time described by STRING, not 'now'","-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"]};function N(e){try{return new Intl.DateTimeFormat(void 0,{timeZone:e}),!0}catch{return!1}}function S(e,a){let i=new Intl.DateTimeFormat("en-US",{timeZone:a,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",hour12:!1}).formatToParts(e),t=o=>i.find(l=>l.type===o)?.value??"00",r=Number.parseInt(t("hour"),10)%24,s=new Date(`${t("year")}-${t("month")}-${t("day")}T${String(r).padStart(2,"0")}:${t("minute")}:${t("second")}Z`);return Number.isNaN(s.getTime())?null:s}function I(e,a){let i=e.match(/^(\d{4})-(\d{2})-(\d{2})(?:[T ](\d{2}):(\d{2})(?::(\d{2}))?)?$/);if(!i)return null;let[,t,r,s,o="00",l="00",c="00"]=i,p=new Date(`${t}-${r}-${s}T${o}:${l}:${c}Z`);if(Number.isNaN(p.getTime()))return null;try{let u=p;for(let d=0;d<3;d++){let f=S(u,a);if(f===null)return null;let m=f.getTime()-p.getTime();if(m===0)return u;u=new Date(u.getTime()-m)}return u}catch{return null}}function b(e,a){if(e.startsWith("@")){let r=e.slice(1);if(!/^-?\d+$/.test(r))return null;let s=Number(r);if(!Number.isSafeInteger(s))return null;let o=new Date(s*1e3);return Number.isNaN(o.getTime())?null:o}let i=e.toLowerCase().trim();if(i==="now"||i==="today")return new Date;if(i==="yesterday")return new Date(Date.now()-864e5);if(i==="tomorrow")return new Date(Date.now()+864e5);if(a&&!/Z$/i.test(e)&&!/[+-]\d{2}:?\d{2}$/.test(e)){let r=I(e,a);if(r)return r}let t=new Date(e);return Number.isNaN(t.getTime())?null:t}var x={name:"date",async execute(e,a){if(w(e))return y($);let i=!1,t=null,r=null,s=!1,o=!1;for(let m=0;m<e.length;m++){let n=e[m];if(n==="-u"||n==="--utc")i=!0;else if(n==="-d"||n==="--date")t=e[++m]??"";else if(n.startsWith("--date="))t=n.slice(7);else if(n==="-I"||n==="--iso-8601")s=!0;else if(n==="-R"||n==="--rfc-email")o=!0;else if(n.startsWith("+"))r=n.slice(1);else{if(n.startsWith("--"))return g("date",n);if(n.startsWith("-"))for(let T of n.slice(1))if(T==="u")i=!0;else if(T==="I")s=!0;else if(T==="R")o=!0;else return g("date",`-${T}`)}}let l=a.env.get("TZ");l&&!N(l)&&(l=void 0);let c=i?"UTC":l??"UTC",p=t!==null?b(t,l):new Date;if(!p)return{stdout:"",stderr:`date: invalid date '${t}'
|
|
4
|
+
`,exitCode:1};let u=Math.floor(p.getTime()/1e3),d,f={maxOperations:a.limits.maxLoopIterations,maxOutputBytes:Math.min(a.limits.maxStringLength,a.limits.maxOutputSize)-1};return r?d=h(r,u,c,f):s?d=h("%Y-%m-%dT%H:%M:%S%z",u,c,f):o?d=h("%a, %d %b %Y %H:%M:%S %z",u,c,f):d=h("%a %b %e %H:%M:%S %Z %Y",u,c,f),{stdout:`${d}
|
|
5
|
+
`,stderr:"",exitCode:0}}},z={name:"date",flags:[{flag:"-d",type:"value",valueHint:"string"},{flag:"-u",type:"boolean"},{flag:"-I",type:"boolean"},{flag:"-R",type:"boolean"}]};export{x as a,z as b};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import{createRequire} from"node:module";const require=createRequire(import.meta.url);
|
|
3
|
+
import{a as m}from"./chunk-2YLY6FJA.js";var s=m("md5sum","md5","compute MD5 message digest"),o={name:"md5sum",flags:[{flag:"-c",type:"boolean"}],needsFiles:!0};export{s as a,o as b};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import{createRequire} from"node:module";const require=createRequire(import.meta.url);
|
|
3
|
+
import{b as E}from"./chunk-GR4ZHKXI.js";import{a as h}from"./chunk-WEHA3JFD.js";import{l as $}from"./chunk-FUT3X2GJ.js";import{a as k}from"./chunk-CPKBPQ2C.js";import{a as C,b as L,c as F}from"./chunk-MUFNRCMY.js";var A={name:"split",summary:"split a file into pieces",usage:"split [OPTION]... [FILE [PREFIX]]",description:"Output pieces of FILE to PREFIXaa, PREFIXab, ...; default size is 1000 lines, and default PREFIX is 'x'.",options:["-l N Put N lines per output file","-b SIZE Put SIZE bytes per output file (K, M, G suffixes)","-n CHUNKS Split into CHUNKS equal-sized files","-d Use numeric suffixes (00, 01, ...) instead of alphabetic","-a LENGTH Use suffixes of length LENGTH (default: 2)","--additional-suffix=SUFFIX Append SUFFIX to file names"],examples:["split -l 100 file.txt # Split into 100-line chunks","split -b 1M file.bin # Split into 1MB chunks","split -n 5 file.txt # Split into 5 equal parts","split -d file.txt part_ # part_00, part_01, ...","split -a 3 -d file.txt x # x000, x001, ..."]},S=1e5,_=0;function U(e){return Uint8Array.from(e,t=>t.charCodeAt(0))}function N(e){let t=e.match(/^(\d+)([KMGTPEZY]?)([B]?)$/i);if(!t)return null;let i=Number(t[1]);if(!Number.isSafeInteger(i)||i<1)return null;let u=(t[2]||"").toUpperCase(),a=new Map([["",1],["K",1024],["M",1024*1024],["G",1024*1024*1024],["T",1024*1024*1024*1024],["P",1024*1024*1024*1024*1024]]).get(u);return a===void 0||i>Math.floor(Number.MAX_SAFE_INTEGER/a)?null:i*a}function x(e){if(!/^[0-9]+$/.test(e))return null;let t=Number(e);return Number.isSafeInteger(t)&&t>=1?t:null}function H(e,t,i){if(t)return e.toString().padStart(i,"0");let u="abcdefghijklmnopqrstuvwxyz",n=new Array(i),a=e;for(let o=i-1;o>=0;o--)n[o]=u[a%26],a=Math.floor(a/26);return n.join("")}function B(e,t){let i=[],u=0,n=0;for(let a=0;a<e.length;a++)e[a]===10&&(n++,n===t&&(i.push(e.subarray(u,a+1)),u=a+1,n=0));return u<e.length&&i.push(e.subarray(u)),i}function T(e,t){let i=[];for(let u=0;u<e.length;u+=t)i.push(e.subarray(u,u+t));return i}function X(e,t){let i=[],u=Math.ceil(e.length/t);for(let n=0;n<t;n++){let a=n*u,o=Math.min(a+u,e.length);a<o&&i.push(e.subarray(a,o))}return i}function z(e,t){let i=e?10**t:26**t;return Number.isSafeInteger(i)?i:Number.MAX_SAFE_INTEGER}function G(e){if(e.existence!=="unknown")return e.existence==="existing"?e.stableIdentity:e.canonicalPath===void 0?void 0:`missing:${e.canonicalPath}`}function I(e,t){return e.existence!==t.existence||e.existence==="unknown"||t.existence==="unknown"?!1:e.existence==="missing"&&t.existence==="missing"?e.canonicalPath===t.canonicalPath:e.existence==="existing"&&t.existence==="existing"?e.stableIdentity!==void 0&&e.stableIdentity===t.stableIdentity:!1}async function M(e,t,i){let u=t.lastIndexOf("/"),n=u<=0?"/":t.slice(0,u),a=t.slice(u+1);for(let o=0;o<100;o++){let d=_++,c=e.fs.resolvePath(n,`.${a}.just-bash-split-${i}-${d}`),p=await h(e.fs,c);if(p.existence==="missing")return c;if(p.existence==="unknown")break}throw new Error("unable to allocate transaction path")}var Z={name:"split",execute:async(e,t)=>{if(L(e))return C(A);let i={mode:"lines",lines:1e3,bytes:0,chunks:0,useNumericSuffix:!1,suffixLength:2,additionalSuffix:""},u=[],n=0;for(;n<e.length;){let s=e[n];if(s==="-l"&&n+1<e.length){let l=x(e[n+1]);if(l===null)return{exitCode:1,stdout:"",stderr:`split: invalid number of lines: '${e[n+1]}'
|
|
4
|
+
`};i.mode="lines",i.lines=l,n+=2}else if(s.match(/^-l\d+$/)){let l=x(s.slice(2));if(l===null)return{exitCode:1,stdout:"",stderr:`split: invalid number of lines: '${s.slice(2)}'
|
|
5
|
+
`};i.mode="lines",i.lines=l,n++}else if(s==="-b"&&n+1<e.length){let l=N(e[n+1]);if(l===null)return{exitCode:1,stdout:"",stderr:`split: invalid number of bytes: '${e[n+1]}'
|
|
6
|
+
`};i.mode="bytes",i.bytes=l,n+=2}else if(s.match(/^-b.+$/)){let l=N(s.slice(2));if(l===null)return{exitCode:1,stdout:"",stderr:`split: invalid number of bytes: '${s.slice(2)}'
|
|
7
|
+
`};i.mode="bytes",i.bytes=l,n++}else if(s==="-n"&&n+1<e.length){let l=x(e[n+1]);if(l===null)return{exitCode:1,stdout:"",stderr:`split: invalid number of chunks: '${e[n+1]}'
|
|
8
|
+
`};i.mode="chunks",i.chunks=l,n+=2}else if(s.match(/^-n\d+$/)){let l=x(s.slice(2));if(l===null)return{exitCode:1,stdout:"",stderr:`split: invalid number of chunks: '${s.slice(2)}'
|
|
9
|
+
`};i.mode="chunks",i.chunks=l,n++}else if(s==="-a"&&n+1<e.length){let l=x(e[n+1]);if(l===null||l>Math.min(t.limits.maxStringLength,t.limits.maxArrayElements))return{exitCode:1,stdout:"",stderr:`split: invalid suffix length: '${e[n+1]}'
|
|
10
|
+
`};i.suffixLength=l,n+=2}else if(s.match(/^-a\d+$/)){let l=x(s.slice(2));if(l===null||l>Math.min(t.limits.maxStringLength,t.limits.maxArrayElements))return{exitCode:1,stdout:"",stderr:`split: invalid suffix length: '${s.slice(2)}'
|
|
11
|
+
`};i.suffixLength=l,n++}else if(s==="-d"||s==="--numeric-suffixes")i.useNumericSuffix=!0,n++;else if(s.startsWith("--additional-suffix="))i.additionalSuffix=s.slice(20),n++;else if(s==="--additional-suffix"&&n+1<e.length)i.additionalSuffix=e[n+1],n+=2;else if(s==="--"){u.push(...e.slice(n+1));break}else{if(s.startsWith("-")&&s!=="-")return F("split",s);u.push(s),n++}}let a="-",o="x";if(u.length>=1&&(a=u[0]),u.length>=2&&(o=u[1]),u.length>2)return{exitCode:1,stdout:"",stderr:`split: extra operand '${u[2]}'
|
|
12
|
+
`};if(k(o)>t.limits.maxStringLength||k(i.additionalSuffix)>t.limits.maxStringLength||i.suffixLength>t.limits.maxStringLength-Math.min(t.limits.maxStringLength,k(o))-Math.min(t.limits.maxStringLength,k(i.additionalSuffix)))return{exitCode:1,stdout:"",stderr:`split: output filename exceeds configured string limit
|
|
13
|
+
`};let d,c=null,p;if(a==="-"){let s=t.stdin.length;p=t.executionScope?.reserveBytes("split transaction",s*2,"split"),d=U(t.stdin)}else{c=t.fs.resolvePath(t.cwd,a);try{let s=await t.fs.stat(c);if(p=t.executionScope?.reserveBytes("split transaction",s.size*2,"split"),d=await t.fs.readFileBuffer(c),d.byteLength>s.size)throw new $("split: input grew while being read","string_length");t.executionScope?.consumeInput(d.byteLength,"split")}catch(s){return p?.release(),E(s),{exitCode:1,stdout:"",stderr:`split: ${a}: No such file or directory
|
|
14
|
+
`}}}try{if(d.length===0)return{exitCode:0,stdout:"",stderr:""};if(i.mode==="chunks"&&i.chunks>S)return{exitCode:1,stdout:"",stderr:`split: too many output files (${i.chunks}), limit is ${S}
|
|
15
|
+
`};let s;switch(i.mode){case"lines":s=B(d,i.lines);break;case"bytes":s=T(d,i.bytes);break;case"chunks":s=X(d,i.chunks);break;default:return i.mode}if(s.length>S)return{exitCode:1,stdout:"",stderr:`split: too many output files (${s.length}), limit is ${S}
|
|
16
|
+
`};let l=z(i.useNumericSuffix,i.suffixLength);if(s.length>l)return{exitCode:1,stdout:"",stderr:`split: output file suffixes exhausted at ${l} files
|
|
17
|
+
`};t.executionScope?.consumeWork(s.length*i.suffixLength,"split suffix generation");let m=[],P=new Set,f=c?await h(t.fs,c):null;if(f?.existence==="unknown")return{exitCode:1,stdout:"",stderr:`split: cannot safely identify input file
|
|
18
|
+
`};for(let r=0;r<s.length;r++){let y=H(r,i.useNumericSuffix,i.suffixLength),b=`${o}${y}${i.additionalSuffix}`,v=t.fs.resolvePath(t.cwd,b),g=await h(t.fs,v),w=G(g);if(g.existence==="unknown"||w===void 0)return{exitCode:1,stdout:"",stderr:`split: cannot safely identify output file '${b}'
|
|
19
|
+
`};if(w!==void 0&&P.has(w))return{exitCode:1,stdout:"",stderr:`split: duplicate output file '${b}'
|
|
20
|
+
`};if(f!==null&&(f.existence==="existing"&&g.existence==="existing"&&f.stableIdentity!==void 0&&f.stableIdentity===g.stableIdentity||f.canonicalPath!==void 0&&f.canonicalPath===g.canonicalPath))return{exitCode:1,stdout:"",stderr:`split: output file '${b}' would overwrite input
|
|
21
|
+
`};w!==void 0&&P.add(w),m.push({path:v,displayName:b,content:s[r],initialIdentity:g,stagePath:"",committed:!1})}try{for(let r of m)r.stagePath=await M(t,r.path,"stage"),await t.fs.writeFile(r.stagePath,r.content);if(c!==null&&f!==null&&!I(f,await h(t.fs,c)))throw new Error("input identity changed during split");for(let r of m){let y=await h(t.fs,r.path);if(!I(r.initialIdentity,y))throw new Error("output identity changed during split");if(f?.existence==="existing"&&y.existence==="existing"&&f.stableIdentity===y.stableIdentity)throw new Error("output aliases input")}for(let r of m){if(!I(r.initialIdentity,await h(t.fs,r.path)))throw new Error("output identity changed during split");r.initialIdentity.existence==="existing"&&(r.backupPath=await M(t,r.path,"backup"),await t.fs.mv(r.path,r.backupPath)),await t.fs.mv(r.stagePath,r.path),r.committed=!0}for(let r of m)r.backupPath&&(await t.fs.rm(r.backupPath,{force:!0,recursive:!0}).catch(()=>{}),r.backupPath=void 0)}catch{for(let r of[...m].reverse())r.committed&&await t.fs.rm(r.path,{force:!0,recursive:!0}).catch(()=>{}),r.backupPath&&await t.fs.mv(r.backupPath,r.path).catch(()=>{}),r.stagePath&&await t.fs.rm(r.stagePath,{force:!0,recursive:!0}).catch(()=>{});return{exitCode:1,stdout:"",stderr:`split: failed to write output
|
|
22
|
+
`}}return{exitCode:0,stdout:"",stderr:""}}finally{p?.release()}}},Y={name:"split",flags:[{flag:"-l",type:"value",valueHint:"number"},{flag:"-b",type:"value",valueHint:"string"},{flag:"-n",type:"value",valueHint:"number"},{flag:"-d",type:"boolean"},{flag:"-a",type:"value",valueHint:"number"}],needsFiles:!0};export{Z as a,Y as b};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import{createRequire} from"node:module";const require=createRequire(import.meta.url);
|
|
3
|
+
import{a as p}from"./chunk-B2DRBHGQ.js";import{a as n,b as l}from"./chunk-PPVF2N6C.js";import{a as m,b as d}from"./chunk-MUFNRCMY.js";var f={name:"sleep",summary:"delay for a specified amount of time",usage:"sleep NUMBER[SUFFIX]",description:`Pause for NUMBER seconds. SUFFIX may be:
|
|
4
|
+
s - seconds (default)
|
|
5
|
+
m - minutes
|
|
6
|
+
h - hours
|
|
7
|
+
d - days
|
|
8
|
+
|
|
9
|
+
NUMBER may be a decimal number.`,options:[" --help display this help and exit"]},u=36e5,y={name:"sleep",async execute(r,e){if(d(r))return m(f);if(r.length===0)return{stdout:"",stderr:`sleep: missing operand
|
|
10
|
+
`,exitCode:1};let o=0;for(let s of r){let t=p(s);if(t===null)return{stdout:"",stderr:`sleep: invalid time interval '${s}'
|
|
11
|
+
`,exitCode:1};o+=t}if(o>u&&(o=u),e.signal?.aborted)return{stdout:"",stderr:"",exitCode:0};if(e.sleep){let s=Promise.resolve(e.sleep(o));if(e.signal){let t,i=new Promise(a=>{t=a,e.signal?.addEventListener("abort",t,{once:!0}),e.signal?.aborted&&a()});try{await Promise.race([s,i])}finally{t&&e.signal.removeEventListener("abort",t)}}else await s}else e.signal?await new Promise(s=>{let t=()=>{l(i),s()},i=n(()=>{e.signal?.removeEventListener("abort",t),s()},o);e.signal?.addEventListener("abort",t,{once:!0})}):await new Promise(s=>n(s,o));return{stdout:"",stderr:"",exitCode:0}}},E={name:"sleep",flags:[],needsArgs:!0};export{y as a,E as b};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import{createRequire} from"node:module";const require=createRequire(import.meta.url);
|
|
3
|
+
function r(e){return Object.assign(Object.create(null),Object.fromEntries(e))}function n(e,t){return Object.assign(Object.create(null),Object.fromEntries(e),t)}function c(...e){return Object.assign(Object.create(null),...e)}export{r as a,n as b,c};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import{createRequire} from"node:module";const require=createRequire(import.meta.url);
|
|
3
|
+
function s(t){let e=`${t.name} - ${t.summary}
|
|
4
|
+
|
|
5
|
+
`;if(e+=`Usage: ${t.usage}
|
|
6
|
+
`,t.description){if(e+=`
|
|
7
|
+
Description:
|
|
8
|
+
`,typeof t.description=="string")for(let n of t.description.split(`
|
|
9
|
+
`))e+=n?` ${n}
|
|
10
|
+
`:`
|
|
11
|
+
`;else if(t.description.length>0)for(let n of t.description)e+=n?` ${n}
|
|
12
|
+
`:`
|
|
13
|
+
`}if(t.options&&t.options.length>0){e+=`
|
|
14
|
+
Options:
|
|
15
|
+
`;for(let n of t.options)e+=` ${n}
|
|
16
|
+
`}if(t.examples&&t.examples.length>0){e+=`
|
|
17
|
+
Examples:
|
|
18
|
+
`;for(let n of t.examples)e+=` ${n}
|
|
19
|
+
`}if(t.notes&&t.notes.length>0){e+=`
|
|
20
|
+
Notes:
|
|
21
|
+
`;for(let n of t.notes)e+=` ${n}
|
|
22
|
+
`}return{stdout:e,stderr:"",exitCode:0}}function o(t){return t.includes("--help")}function r(t,e){return{stdout:"",stderr:e.startsWith("--")?`${t}: unrecognized option '${e}'
|
|
23
|
+
`:`${t}: invalid option -- '${e.replace(/^-/,"")}'
|
|
24
|
+
`,exitCode:1}}export{s as a,o as b,r as c};
|